diff --git a/deps/curl/.azure-pipelines.yml b/deps/curl/.azure-pipelines.yml deleted file mode 100644 index 5c789637..00000000 --- a/deps/curl/.azure-pipelines.yml +++ /dev/null @@ -1,249 +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 -# -########################################################################### -# https://dev.azure.com/daniel0244/curl/_build?view=runs -# -# Azure Pipelines configuration: -# https://aka.ms/yaml - -trigger: - branches: - include: - - 'master' - - '*/ci' - paths: - exclude: - - '.circleci/*' - - '.cirrus.yml' - - '.github/*' - - '.github/workflows/*' - - 'appveyor.*' - - 'packages/*' - - 'plan9/*' - -pr: - branches: - include: - - 'master' - paths: - exclude: - - '.circleci/*' - - '.cirrus.yml' - - '.github/*' - - '.github/workflows/*' - - 'appveyor.*' - - 'packages/*' - - 'plan9/*' - -variables: - MAKEFLAGS: '-j 2' - -stages: - - ########################################## - ### Linux jobs first - ########################################## - - - stage: linux - dependsOn: [] - jobs: - - job: ubuntu - # define defaults to make sure variables are always expanded/replaced - variables: - install: '' - configure: '' - tests: '!433' - timeoutInMinutes: 60 - pool: - vmImage: 'ubuntu-latest' - strategy: - matrix: - default: - name: default - install: - configure: --enable-debug --with-openssl - disable_ipv6: - name: w/o IPv6 - configure: --disable-ipv6 --with-openssl - disable_http_smtp_imap: - name: w/o HTTP/SMTP/IMAP - configure: --disable-http --disable-smtp --disable-imap --without-ssl - disable_thredres: - name: sync resolver - configure: --disable-threaded-resolver --with-openssl - https_only: - name: HTTPS only - configure: --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-pop3 --disable-rtmp --disable-rtsp --disable-scp --disable-sftp --disable-smb --disable-smtp --disable-telnet --disable-tftp --with-openssl - torture: - name: torture - install: libnghttp2-dev - configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl - tests: -n -t --shallow=25 !FTP - steps: - - script: sudo apt-get update && sudo apt-get install -y stunnel4 python3-impacket libzstd-dev libbrotli-dev libpsl-dev $(install) - displayName: 'apt install' - retryCountOnTaskFailure: 3 - - - script: autoreconf -fi && ./configure --enable-warnings --enable-werror $(configure) - displayName: 'configure $(name)' - - - script: make V=1 && make V=1 examples && cd tests && make V=1 - displayName: 'compile' - - - script: make V=1 test-ci - displayName: 'test' - env: - AZURE_ACCESS_TOKEN: "$(System.AccessToken)" - TFLAGS: "-ac /usr/bin/curl -r $(tests)" - - - stage: scanbuild - dependsOn: [] - jobs: - - job: ubuntu - timeoutInMinutes: 30 - pool: - vmImage: 'ubuntu-latest' - steps: - - script: sudo apt-get update && sudo apt-get install -y clang-tools clang libssl-dev libssh2-1-dev libpsl-dev libbrotli-dev libzstd-dev - displayName: 'apt install' - retryCountOnTaskFailure: 3 - - - script: autoreconf -fi - displayName: 'autoreconf' - - - script: scan-build ./configure --enable-debug --enable-werror --with-openssl --with-libssh2 - displayName: 'configure' - env: - CC: "clang" - CCX: "clang++" - - - script: scan-build --status-bugs make - displayName: 'make' - - - script: scan-build --status-bugs make examples - displayName: 'make examples' - - ########################################## - ### Windows jobs below - ########################################## - - - stage: windows - dependsOn: [] - variables: - agent.preferPowerShellOnContainers: true - jobs: - - job: msys2 - # define defaults to make sure variables are always expanded/replaced - variables: - container_img: '' - container_cmd: '' - configure: '' - tests: '' - timeoutInMinutes: 120 - pool: - vmImage: 'windows-2019' - strategy: - matrix: - mingw32_openssl: - name: 32-bit OpenSSL/libssh2 - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2 - configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --with-libssh2 --with-openssl --without-libpsl - tests: "~571" - mingw64_openssl: - name: 64-bit OpenSSL/libssh2 - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2 - configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh2 --with-openssl --without-libpsl - tests: "~571" - mingw64_libssh: - name: 64-bit OpenSSL/libssh - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - prepare: pacman -S --needed --noconfirm --noprogressbar libssh-devel mingw-w64-x86_64-libssh - configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh --with-openssl --without-libpsl - tests: "~571 ~614" - mingw32: - name: 32-bit w/o zlib - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --without-zlib --without-ssl --without-libpsl - tests: "!203 !1143" - mingw64: - name: 64-bit w/o zlib - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --without-zlib --without-ssl --without-libpsl - tests: "!203 !1143" - mingw32_schannel: - name: 32-bit Schannel/SSPI/WinIDN/libssh2 - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2 - configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2 --without-libpsl - tests: "~571" - mingw64_schannel: - name: 64-bit Schannel/SSPI/WinIDN/libssh2 - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2 - configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2 --without-libpsl - tests: "~571" - mingw32_schannel_nozlib: - name: 32-bit Schannel/SSPI/WinIDN w/o zlib - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib --without-libpsl - tests: "!203 !1143" - mingw64_schannel_nozlib: - name: 64-bit Schannel/SSPI/WinIDN w/o zlib - container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019 - container_cmd: C:\msys64\usr\bin\sh - configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib --without-libpsl - tests: "!203 !1143" - container: - image: $(container_img) - env: - MSYS2_PATH_TYPE: inherit - steps: - - script: $(container_cmd) -l -c "cd $(echo '%cd%') && $(prepare)" - displayName: 'prepare' - condition: variables.prepare - retryCountOnTaskFailure: 3 - - - script: $(container_cmd) -l -c "cd $(echo '%cd%') && autoreconf -fi && ./configure $(configure)" - displayName: 'configure $(name)' - - - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 && make V=1 examples && cd tests && make V=1" - displayName: 'compile' - - - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 install && PATH=/usr/bin:/bin find . -type f -path '*/.libs/*.exe' -print -execdir mv -t .. {} \;" - displayName: 'install' - - - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 test-ci" - displayName: 'test' - env: - AZURE_ACCESS_TOKEN: "$(System.AccessToken)" - TFLAGS: "-ac /usr/bin/curl.exe !IDN !SCP ~612 $(tests)" diff --git a/deps/curl/.circleci/config.yml b/deps/curl/.circleci/config.yml index 9fc6127a..c196afd6 100644 --- a/deps/curl/.circleci/config.yml +++ b/deps/curl/.circleci/config.yml @@ -23,119 +23,11 @@ ########################################################################### # View these jobs in the browser: https://app.circleci.com/pipelines/github/curl/curl -# -# The macOS builds use M1 (ARM) machines for platform diversity. -# See https://circleci.com/docs/configuration-reference/#macos-execution-environment -# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference +# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/configuration-reference/ version: 2.1 commands: - configure: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-werror --with-openssl - - configure-openssl-no-verbose: - steps: - - run: - command: | - autoreconf -fi - ./configure --disable-verbose --enable-werror --with-openssl - - configure-no-proxy: - steps: - - run: - command: | - autoreconf -fi - ./configure --disable-proxy --enable-werror --with-openssl - - configure-macos-normal: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --without-ssl CFLAGS='-Wno-vla -mmacosx-version-min=10.9' CPPFLAGS="-I$(brew --prefix libpsl)/include" LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-debug: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --without-ssl --enable-debug CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-libssh2: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --without-ssl --with-libssh2=/opt/homebrew/opt/libssh2 --enable-debug CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-libssh-c-ares: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --with-openssl --with-libssh --enable-ares --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-libssh: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --with-openssl --with-libssh --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || tail -1000 config.log - - configure-macos-c-ares: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --without-ssl --enable-ares --enable-debug CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-http-only: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-maintainer-mode --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-mqtt --disable-pop3 --disable-rtsp --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets --disable-shared --without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp --without-libssh2 --without-nghttp2 --without-ssl --without-zlib --enable-debug CFLAGS='-Wno-vla -mmacosx-version-min=10.15' - - configure-macos-securetransport-http2: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --with-secure-transport CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.8' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-openssl-http2: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-libressl-http2: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix libressl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-torture: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --disable-shared --disable-threaded-resolver --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - - configure-macos-torture-ftp: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-websockets --disable-shared --disable-threaded-resolver --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" - install-cares: steps: - run: @@ -155,93 +47,106 @@ 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 install impacket - install-deps-brew: - steps: - - run: - command: | - # Drop libressl as long as we're not trying to build it - echo libtool autoconf automake pkg-config nghttp2 libssh2 openssl libssh c-ares libpsl icu4c | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile - while [ $? -eq 0 ]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done - sudo python3 -m pip install impacket - - configure-libssh: - steps: - - run: - command: | - autoreconf -fi - ./configure --enable-warnings --enable-werror --with-openssl --with-libssh - install-wolfssl: steps: - run: command: | - WOLFSSL_VER=5.6.0 + # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com + WOLFSSL_VER=5.7.4 + echo "Installing wolfSSL $WOLFSSL_VER" curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VER-stable.tar.gz tar -xzf v$WOLFSSL_VER-stable.tar.gz cd wolfssl-$WOLFSSL_VER-stable ./autogen.sh - ./configure --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl + ./configure --disable-dependency-tracking --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl make install install-wolfssh: steps: - run: command: | - WOLFSSH_VER=1.4.12 + # renovate: datasource=github-tags depName=wolfSSL/wolfssh versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com + WOLFSSH_VER=1.4.18 + echo "Installing wolfSSH $WOLFSSH_VER" curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssh/archive/v$WOLFSSH_VER-stable.tar.gz tar -xzf v$WOLFSSH_VER-stable.tar.gz cd wolfssh-$WOLFSSH_VER-stable ./autogen.sh - ./configure --with-wolfssl=$HOME/wssl --prefix=$HOME/wssh --enable-scp --enable-sftp --disable-examples + ./configure --disable-dependency-tracking --with-wolfssl=$HOME/wssl --prefix=$HOME/wssh --enable-scp --enable-sftp --disable-examples make install + configure: + steps: + - run: + command: | + autoreconf -fi + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \ + --with-openssl \ + || { tail -1000 config.log; false; } + + configure-openssl-no-verbose: + steps: + - run: + command: | + autoreconf -fi + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror \ + --with-openssl --disable-verbose \ + || { tail -1000 config.log; false; } + + configure-no-proxy: + steps: + - run: + command: | + autoreconf -fi + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror \ + --with-openssl --disable-proxy \ + || { tail -1000 config.log; false; } + + configure-libssh: + steps: + - run: + command: | + autoreconf -fi + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \ + --with-openssl --with-libssh \ + || { tail -1000 config.log; false; } + configure-cares: steps: - run: command: | autoreconf -fi - ./configure --enable-warnings --enable-werror --with-openssl --enable-ares + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \ + --with-openssl --enable-ares \ + || { tail -1000 config.log; false; } configure-wolfssh: steps: - run: command: | autoreconf -fi - LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" ./configure --enable-warnings --enable-werror --with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh + LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" \ + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \ + --with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh \ + || { tail -1000 config.log; false; } configure-cares-debug: steps: - run: command: | autoreconf -fi - ./configure --enable-debug --enable-werror --with-openssl --enable-ares + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-debug \ + --with-openssl --enable-ares \ + || { tail -1000 config.log; false; } build: steps: - run: make -j3 V=1 - run: make -j3 V=1 examples - build-macos: - steps: - - run: make -j5 V=1 - - run: make -j5 V=1 examples - test: steps: - - run: make -j3 V=1 test-ci - - test-macos: - steps: - - run: make -j5 V=1 test-ci - - test-torture: - steps: - - run: make -j5 V=1 test-ci TFLAGS="-n -t --shallow=25 !FTP" - - test-torture-ftp: - steps: - # Test 250 takes too long, causing Circle CI to kill the job - - run: make -j5 V=1 test-ci TFLAGS="-n -t --shallow=20 FTP !250 !251" + - run: make -j3 V=1 test-ci TFLAGS='-j14' executors: ubuntu: @@ -328,138 +233,6 @@ jobs: - build - test - macos-arm-normal: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-normal - - build-macos - - test-macos - - macos-arm-debug: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-debug - - build-macos - - test-macos - - macos-arm-libssh2: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-libssh2 - - build-macos - - test-macos - - macos-arm-libssh-c-ares: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-libssh-c-ares - - build-macos - - test-macos - - macos-arm-libssh: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-libssh - - build-macos - - test-macos - - macos-arm-c-ares: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-c-ares - - build-macos - - test-macos - - macos-arm-http-only: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-http-only - - build-macos - - test-macos - - macos-arm-http-securetransport-http2: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-securetransport-http2 - - build-macos - - test-macos - - macos-arm-http-openssl-http2: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-openssl-http2 - - build-macos - - test-macos - - macos-arm-http-libressl-http2: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-libressl-http2 - - build-macos - - test-macos - - macos-arm-http-torture: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-torture - - build-macos - - test-torture - - macos-arm-http-torture-ftp: - macos: - xcode: 15.0.0 - resource_class: macos.m1.medium.gen1 - steps: - - checkout - - install-deps-brew - - configure-macos-torture-ftp - - build-macos - - test-torture-ftp - workflows: x86-openssl: jobs: @@ -492,53 +265,3 @@ workflows: arm-openssl-c-ares: jobs: - arm-cares - - macos-arm-normal: - jobs: - - macos-arm-normal - - macos-arm-debug: - jobs: - - macos-arm-debug - - macos-arm-libssh2: - jobs: - - macos-arm-libssh2 - - macos-arm-libssh-c-ares: - jobs: - - macos-arm-libssh-c-ares - - macos-arm-libssh: - jobs: - - macos-arm-libssh - - macos-arm-c-ares: - jobs: - - macos-arm-c-ares - - macos-arm-http-only: - jobs: - - macos-arm-http-only - - macos-arm-http-securetransport-http2: - jobs: - - macos-arm-http-securetransport-http2 - - macos-arm-http-openssl-http2: - jobs: - - macos-arm-http-openssl-http2 - - # There are problem linking with LibreSSL on the CI boxes that prevent this - # from working. - # macos-arm-http-libressl-http2: - # jobs: - # - macos-arm-http-libressl-http2 - - macos-arm-http-torture: - jobs: - - macos-arm-http-torture - - macos-arm-http-torture-ftp: - jobs: - - macos-arm-http-torture-ftp diff --git a/deps/curl/.cirrus.yml b/deps/curl/.cirrus.yml deleted file mode 100644 index 05c92756..00000000 --- a/deps/curl/.cirrus.yml +++ /dev/null @@ -1,85 +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 -# -########################################################################### -# https://cirrus-ci.com/github/curl/curl -# -# Cirrus CI configuration: -# https://cirrus-ci.org/guide/writing-tasks/ - -freebsd_task: - skip: "changesIncludeOnly( - '**/CMakeLists.txt', - '.azure-pipelines.yml', - '.circleci/**', - '.github/**', - 'appveyor.*', - 'CMake/**', - 'packages/**', - 'plan9/**', - 'projects/**', - 'winbuild/**' - )" - - name: FreeBSD - - matrix: - - name: FreeBSD 14.0 - freebsd_instance: - image_family: freebsd-14-0 - - env: - CIRRUS_CLONE_DEPTH: 10 - CRYPTOGRAPHY_DONT_BUILD_RUST: 1 - MAKEFLAGS: -j 3 - - pkginstall_script: - - pkg update -f - - pkg install -y autoconf automake libtool pkgconf brotli openldap26-client heimdal libpsl libssh2 libidn2 librtmp libnghttp2 nghttp2 stunnel py39-openssl py39-impacket py39-cryptography libpsl - - pkg delete -y curl - configure_script: - - autoreconf -fi - # Building with the address sanitizer is causing unexplainable test issues due to timeouts - # - case `uname -r` in - # 12.2*) - # export CC=clang; - # export CFLAGS="-fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g"; - # export CXXFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g"; - # export LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined,integer" ;; - # esac - - ./configure --prefix="${HOME}"/install --enable-debug --with-openssl --with-libssh2 --with-brotli --with-gssapi --with-libidn2 --enable-manual --enable-ldap --enable-ldaps --with-librtmp --with-libpsl --with-nghttp2 || { tail -300 config.log; false; } - compile_script: - - make V=1 && make V=1 examples && cd tests && make V=1 - test_script: - # blackhole? - - sysctl net.inet.tcp.blackhole - # make sure we don't run blackhole != 0 - - sudo sysctl net.inet.tcp.blackhole=0 - # Some tests won't run if run as root so run them as another user. - # Make directories world writable so the test step can write wherever it needs. - - find . -type d -exec chmod 777 {} \; - # The OpenSSH server instance for the testsuite cannot be started on FreeBSD, - # therefore the SFTP and SCP tests are disabled right away from the beginning. - # - - sudo -u nobody make V=1 TFLAGS="-n !SFTP !SCP" test-ci - install_script: - - make V=1 install diff --git a/deps/curl/.dcignore b/deps/curl/.dcignore deleted file mode 100644 index e33af3ec..00000000 --- a/deps/curl/.dcignore +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -tests/** -docs/** -docs/examples/** diff --git a/deps/curl/.gitattributes b/deps/curl/.gitattributes index 481fd5cf..41a5aff8 100644 --- a/deps/curl/.gitattributes +++ b/deps/curl/.gitattributes @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: curl -*.dsw -crlf buildconf eol=lf configure.ac eol=lf *.m4 eol=lf @@ -11,8 +10,6 @@ configure.ac eol=lf *.sh eol=lf *.[ch] whitespace=tab-in-indent -# Batch files (bat,btm,cmd) must be run with CRLF line endings. +# Batch files must be run with CRLF line endings. # Refer to https://github.com/curl/curl/pull/6442 *.bat text eol=crlf -*.btm text eol=crlf -*.cmd text eol=crlf diff --git a/deps/curl/.github/CONTRIBUTING.md b/deps/curl/.github/CONTRIBUTING.md index 18be9ed2..0cb7f45a 100644 --- a/deps/curl/.github/CONTRIBUTING.md +++ b/deps/curl/.github/CONTRIBUTING.md @@ -26,4 +26,4 @@ Send your suggestions using one of these methods: 3. as an [issue](https://github.com/curl/curl/issues) -/ The curl team! +/ The curl team diff --git a/deps/curl/.github/ISSUE_TEMPLATE/bug_report.yml b/deps/curl/.github/ISSUE_TEMPLATE/bug_report.yml index e74ac081..a857700f 100644 --- a/deps/curl/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/deps/curl/.github/ISSUE_TEMPLATE/bug_report.yml @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: curl -name: Bug Report -description: Create a report to help us improve +name: Bug Report on code +description: Tell us about your problem with curl or libcurl body: - type: markdown diff --git a/deps/curl/.github/ISSUE_TEMPLATE/config.yml b/deps/curl/.github/ISSUE_TEMPLATE/config.yml index 9ca2c8fd..bce618da 100644 --- a/deps/curl/.github/ISSUE_TEMPLATE/config.yml +++ b/deps/curl/.github/ISSUE_TEMPLATE/config.yml @@ -4,12 +4,15 @@ blank_issues_enabled: false contact_links: + - name: Ask a question (without email) + url: https://github.com/curl/curl/discussions + about: Use the Discussion forum here on GitHub + - name: Ask a question (using email) + url: https://curl.se/mail/ + about: Send question to the suitable mailing list + - name: Commercial support + url: https://curl.se/support.html + about: Pay for fast quality support for and help with curl/libcurl - name: Feature request url: https://curl.se/mail/ about: To propose new features or enhancements, please bring that discussion to a suitable curl mailing list. - - name: Question - url: https://curl.se/mail/ - about: Questions should go to the mailing list - - name: Commercial support - url: https://curl.se/support.html - about: Several companies are offering paid support for curl/libcurl diff --git a/deps/curl/.github/ISSUE_TEMPLATE/docs.yml b/deps/curl/.github/ISSUE_TEMPLATE/docs.yml new file mode 100644 index 00000000..1b60a597 --- /dev/null +++ b/deps/curl/.github/ISSUE_TEMPLATE/docs.yml @@ -0,0 +1,32 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +name: Bug Report on documentation +description: Problems, errors, mistakes or typos in documentation. +labels: documentation + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + Only file documentation bugs here! Ask questions on the mailing lists https://curl.se/mail/ + + - type: textarea + id: source + attributes: + label: Specify which documentation you found a problem with + description: | + Include function name, URL, tarball version and all other relevant + details that identify the documentation source. + validations: + required: true + + - type: textarea + id: problem + attributes: + label: The problem + validations: + required: true diff --git a/deps/curl/.github/dependabot.yml b/deps/curl/.github/dependabot.yml index 5ace4600..792d0f0b 100644 --- a/deps/curl/.github/dependabot.yml +++ b/deps/curl/.github/dependabot.yml @@ -1,3 +1,7 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + version: 2 updates: - package-ecosystem: "github-actions" diff --git a/deps/curl/.github/labeler.yml b/deps/curl/.github/labeler.yml index c22bd6e4..cd0468d8 100644 --- a/deps/curl/.github/labeler.yml +++ b/deps/curl/.github/labeler.yml @@ -15,36 +15,78 @@ # 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. -# Therefore, to get any-glob-to-all-files semantics, there must be a single glob -# with all matching patterns within braces. +# Therefore, to get any-glob-to-all-files semantics with multiple matching +# patterns, they must be joined with commas to a single string surrounded by +# braces. For example: '{lib/**,src/**}'. # # See https://github.com/actions/labeler/ for documentation on this file. +--- appleOS: - all: - changed-files: - - any-glob-to-all-files: - - '{.github/workflows/macos.yml,lib/config-mac.h,lib/macos*,lib/vtls/sectransp*,m4/curl-sectransp.m4,MacOSX-Framework}' + - any-glob-to-all-files: "{\ + .github/workflows/macos.yml,\ + lib/config-mac.h,\ + lib/macos*,\ + lib/vtls/sectransp*,\ + m4/curl-sectransp.m4\ + }" authentication: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/mk-ca-bundle.1,docs/libcurl/opts/CURLINFO_HTTPAUTH*,docs/libcurl/opts/CURLINFO_PROXYAUTH*,docs/libcurl/opts/CURLOPT_KRB*,docs/libcurl/opts/CURLOPT_SASL*,docs/libcurl/opts/CURLOPT_SERVICE_NAME*,docs/libcurl/opts/CURLOPT_USERNAME*,docs/libcurl/opts/CURLOPT_USERPWD*,docs/libcurl/opts/CURLOPT_XOAUTH*,lib/*gssapi*,lib/*krb5*,lib/*ntlm*,lib/curl_sasl.*,lib/http_aws*,lib/http_digest.*,lib/http_negotiate.*,lib/vauth/**,tests/server/fake_ntlm.c}' + - any-glob-to-all-files: "{\ + docs/mk-ca-bundle.1,\ + docs/libcurl/opts/CURLINFO_HTTPAUTH*,\ + docs/libcurl/opts/CURLINFO_PROXYAUTH*,\ + docs/libcurl/opts/CURLOPT_KRB*,\ + docs/libcurl/opts/CURLOPT_SASL*,\ + docs/libcurl/opts/CURLOPT_SERVICE_NAME*,\ + docs/libcurl/opts/CURLOPT_USERNAME*,\ + docs/libcurl/opts/CURLOPT_USERPWD*,\ + docs/libcurl/opts/CURLOPT_XOAUTH*,\ + lib/*gssapi*,\ + lib/*krb5*,\ + lib/*ntlm*,\ + lib/curl_sasl.*,\ + lib/http_aws*,\ + lib/http_digest.*,\ + lib/http_negotiate.*,\ + lib/vauth/**\ + }" build: - all: - changed-files: - - any-glob-to-all-files: - - '{**/CMakeLists.txt,**/Makefile.am,**/Makefile.inc,**/Makefile.mk,**/*.m4,**/*.mk,*.m4,docs/INSTALL.cmake,lib/curl_config.h.cmake,lib/libcurl*.in,CMake/**,CMakeLists.txt,configure.ac,m4/**,MacOSX-Framework,Makefile.*,packages/**,plan9/**,projects/**,winbuild/**,libcurl.def}' + - any-glob-to-all-files: "{\ + **/CMakeLists.txt,\ + **/Makefile.am,\ + **/Makefile.inc,\ + **/Makefile.mk,\ + **/*.m4,\ + **/*.mk,\ + *.m4,\ + docs/INSTALL.cmake,\ + lib/curl_config.h.cmake,\ + lib/libcurl*.in,\ + CMake/**,\ + CMakeLists.txt,\ + configure.ac,\ + m4/**,\ + Makefile.*,\ + packages/**,\ + plan9/**,\ + projects/**,\ + winbuild/**,\ + lib/libcurl.def\ + }" CI: - all: - changed-files: - any-glob-to-any-file: - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - '.github/**' - 'appveyor.*' - 'scripts/ci*' @@ -55,8 +97,12 @@ CI: cmake: - all: - changed-files: - - any-glob-to-all-files: - - '{**/CMakeLists.txt,CMake/**,docs/INSTALL.cmake,lib/curl_config.h.cmake}' + - any-glob-to-all-files: "{\ + **/CMakeLists.txt,\ + CMake/**,\ + docs/INSTALL.cmake,\ + lib/curl_config.h.cmake\ + }" cmdline tool: - all: @@ -68,32 +114,93 @@ cmdline tool: connecting & proxies: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/CONNECTION-FILTERS.md,docs/examples/ipv6.c,docs/libcurl/opts/CURLINFO_CONNECT*,docs/libcurl/opts/CURLINFO_PROXY*,docs/libcurl/opts/CURLOPT_ADDRESS*,docs/libcurl/opts/CURLOPT_CONNECT*,docs/libcurl/opts/CURLOPT_HAPROXY*,docs/libcurl/opts/CURLOPT_OPENSOCKET*,docs/libcurl/opts/CURLOPT_PRE_PROXY*,docs/libcurl/opts/CURLOPT_PROXY*,docs/libcurl/opts/CURLOPT_SOCKOPT*,docs/libcurl/opts/CURLOPT_SOCKS*,docs/libcurl/opts/CURLOPT_TCP*,docs/libcurl/opts/CURLOPT_TIMEOUT*,lib/cf-*proxy.*,lib/cf-socket.*,lib/cfilters.*,lib/conncache.*,lib/connect.*,lib/http_proxy.*,lib/if2ip.*,lib/noproxy.*,lib/socks.*,tests/server/socksd.c}' + - any-glob-to-all-files: "{\ + docs/internals/CONNECTION-FILTERS.md,\ + docs/examples/ipv6.c,\ + docs/libcurl/opts/CURLINFO_CONNECT*,\ + docs/libcurl/opts/CURLINFO_PROXY*,\ + docs/libcurl/opts/CURLOPT_ADDRESS*,\ + docs/libcurl/opts/CURLOPT_CONNECT*,\ + docs/libcurl/opts/CURLOPT_HAPROXY*,\ + docs/libcurl/opts/CURLOPT_OPENSOCKET*,\ + docs/libcurl/opts/CURLOPT_PRE_PROXY*,\ + docs/libcurl/opts/CURLOPT_PROXY*,\ + docs/libcurl/opts/CURLOPT_SOCKOPT*,\ + docs/libcurl/opts/CURLOPT_SOCKS*,\ + docs/libcurl/opts/CURLOPT_TCP*,\ + docs/libcurl/opts/CURLOPT_TIMEOUT*,\ + lib/cf-*proxy.*,\ + lib/cf-socket.*,\ + lib/cfilters.*,\ + lib/conncache.*,\ + lib/connect.*,\ + lib/http_proxy.*,\ + lib/if2ip.*,\ + lib/noproxy.*,\ + lib/socks.*,\ + tests/server/socksd.c\ + }" cookies: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/HTTP-COOKIES.md,docs/cmdline-opts/cookie*,docs/cmdline-opts/junk-session-cookies.md,docs/libcurl/opts/CURLINFO_COOKIE*,docs/libcurl/opts/CURLOPT_COOKIE*,docs/examples/cookie_interface.c,lib/cookie.*,lib/psl.*}' + - any-glob-to-all-files: "{\ + docs/HTTP-COOKIES.md,\ + docs/cmdline-opts/cookie*,\ + docs/cmdline-opts/junk-session-cookies.md,\ + docs/libcurl/opts/CURLINFO_COOKIE*,\ + docs/libcurl/opts/CURLOPT_COOKIE*,\ + docs/examples/cookie_interface.c,\ + lib/cookie.*,\ + lib/psl.*\ + }" cryptography: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/CIPHERS.md,docs/RUSTLS.md,docs/libcurl/opts/CURLOPT_EGDSOCKET*,lib/*sha256*,lib/*sha512*,lib/curl_des.*,lib/curl_hmac.*,lib/curl_md?.*,lib/md?.*,lib/rand.*}' + - any-glob-to-all-files: "{\ + docs/CIPHERS.md,\ + docs/RUSTLS.md,\ + docs/libcurl/opts/CURLOPT_EGDSOCKET*,\ + lib/*sha256*,\ + lib/*sha512*,\ + lib/curl_des.*,\ + lib/curl_hmac.*,\ + lib/curl_md?.*,\ + lib/md?.*,\ + lib/rand.*\ + }" DICT: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/dict.*,tests/dictserver.py}' + - any-glob-to-all-files: "{\ + lib/dict.*,\ + tests/dictserver.py\ + }" documentation: - all: - changed-files: - - any-glob-to-all-files: - - '{.github/workflows/badwords.yml,.github/workflows/man-examples.yml,.github/workflows/synopsis.yml,.github/scripts/badwords.*,.github/scripts/cd2cd,.github/scripts/cd2nroff,.github/scripts/cdall.pl,.github/scripts/nroff2cd,.github/scripts/verify-examples.pl,.github/scripts/verify-synopsis.pl,**/*.md,**/*.txt,**/*.1,CHANGES,docs/**,LICENSES/**,README,RELEASE-NOTES,scripts/cd*}' + - any-glob-to-all-files: "{\ + .github/workflows/checkdocs.yml,\ + .github/scripts/badwords.*,\ + .github/scripts/cd2cd,\ + .github/scripts/cd2nroff,\ + .github/scripts/cdall.pl,\ + .github/scripts/nroff2cd,\ + .github/scripts/verify-examples.pl,\ + .github/scripts/verify-synopsis.pl,\ + **/*.md,\ + **/*.txt,\ + **/*.1,\ + CHANGES.md,\ + docs/**,\ + LICENSES/**,\ + README,\ + RELEASE-NOTES,\ + scripts/cd*\ + }" - all-globs-to-all-files: # negative matches - '!**/CMakeLists.txt' @@ -102,50 +209,112 @@ documentation: FTP: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/libcurl/opts/CURLINFO_FTP*,docs/libcurl/opts/CURLOPT_FTP*,docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,docs/examples/ftp*,lib/curl_fnmatch.*,lib/curl_range.*,lib/ftp*,tests/ftp*' + - any-glob-to-all-files: "{\ + docs/libcurl/opts/CURLINFO_FTP*,\ + docs/libcurl/opts/CURLOPT_FTP*,\ + docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,\ + docs/examples/ftp*,\ + lib/curl_fnmatch.*,\ + lib/curl_range.*,\ + lib/ftp*,\ + tests/ftp*\ + }" GOPHER: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/gopher*}' + - any-glob-to-all-files: "{\ + lib/gopher*\ + }" HTTP: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/examples/hsts*,docs/examples/http-*,docs/examples/httpput*,docs/examples/https*,docs/examples/*post*,docs/HSTS.md,docs/HTTP-COOKIES.md,docs/libcurl/opts/CURLINFO_COOKIE*,docs/libcurl/opts/CURLOPT_COOKIE*,docs/libcurl/opts/CURLINFO_HTTP_**,docs/libcurl/opts/CURLINFO_REDIRECT*,docs/libcurl/opts/CURLINFO_REFER*,docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,docs/libcurl/opts/CURLOPT_HSTS*,docs/libcurl/opts/CURLOPT_HTTP*,docs/libcurl/opts/CURLOPT_POST.*,docs/libcurl/opts/CURLOPT_POSTFIELD*,docs/libcurl/opts/CURLOPT_POSTREDIR*,docs/libcurl/opts/CURLOPT_REDIR*,docs/libcurl/opts/CURLOPT_REFER*,docs/libcurl/opts/CURLOPT_TRAILER*,docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING*,lib/cf-https*,lib/cf-h1*,lib/cf-h2*,lib/cookie.*,lib/http*,tests/http*,tests/http-server.pl,tests/http/*,tests/nghttp*}' + - any-glob-to-all-files: "{\ + docs/examples/hsts*,\ + docs/examples/http-*,\ + docs/examples/httpput*,\ + docs/examples/https*,\ + docs/examples/*post*,\ + docs/HTTP-COOKIES.md,\ + docs/libcurl/opts/CURLINFO_COOKIE*,\ + docs/libcurl/opts/CURLOPT_COOKIE*,\ + docs/libcurl/opts/CURLINFO_HTTP_**,\ + docs/libcurl/opts/CURLINFO_REDIRECT*,\ + docs/libcurl/opts/CURLINFO_REFER*,\ + docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,\ + docs/libcurl/opts/CURLOPT_HSTS*,\ + docs/libcurl/opts/CURLOPT_HTTP*,\ + docs/libcurl/opts/CURLOPT_POST.*,\ + docs/libcurl/opts/CURLOPT_POSTFIELD*,\ + docs/libcurl/opts/CURLOPT_POSTREDIR*,\ + docs/libcurl/opts/CURLOPT_REDIR*,\ + docs/libcurl/opts/CURLOPT_REFER*,\ + docs/libcurl/opts/CURLOPT_TRAILER*,\ + docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING*,\ + lib/cf-https*,\ + lib/cf-h1*,\ + lib/cf-h2*,\ + lib/cookie.*,\ + lib/hsts.*,\ + lib/http*,\ + tests/http*,\ + tests/http-server.pl,\ + tests/http/*,\ + tests/nghttp*\ + }" HTTP/2: - all: - changed-files: - - any-glob-to-all-files: - - '{CMake/FindNGHTTP2.cmake,CMake/FindQUICHE.cmake,docs/HTTP2.md,docs/libcurl/opts/CURLOPT_STREAM*,docs/examples/http2*,lib/http2*,tests/http2-server.pl}' + - any-glob-to-all-files: "{\ + CMake/FindNGHTTP2.cmake,\ + CMake/FindQuiche.cmake,\ + docs/libcurl/opts/CURLOPT_STREAM*,\ + docs/examples/http2*,\ + lib/http2*,\ + tests/http2-server.pl\ + }" HTTP/3: - all: - changed-files: - - any-glob-to-all-files: - - '{.github/workflows/ngtcp2*,.github/workflows/quiche*,.github/workflows/osslq*,CMake/FindMSH3.cmake,CMake/FindNGHTTP3.cmake,CMake/FindNGTCP2.cmake,docs/HTTP3.md,docs/examples/http3*,lib/vquic/**,tests/http3-server.pl,tests/nghttpx.conf}' + - any-glob-to-all-files: "{\ + .github/workflows/ngtcp2*,\ + .github/workflows/quiche*,\ + .github/workflows/osslq*,\ + CMake/FindMSH3.cmake,\ + CMake/FindNGHTTP3.cmake,\ + CMake/FindNGTCP2.cmake,\ + docs/HTTP3.md,\ + docs/examples/http3*,\ + lib/vquic/**,\ + tests/http3-server.pl,\ + tests/nghttpx.conf\ + }" Hyper: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/HYPER.md,lib/c-hyper.*}' + - any-glob-to-all-files: "{\ + docs/HYPER.md,\ + lib/c-hyper.*\ + }" IMAP: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/imap*,docs/examples/imap*}' + - any-glob-to-all-files: "{\ + lib/imap*,\ + docs/examples/imap*\ + }" LDAP: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/*ldap*}' + - any-glob-to-all-files: "{\ + lib/*ldap*\ + }" libcurl API: - all: @@ -158,68 +327,120 @@ libcurl API: logging: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/cmdline-opts/trace*,docs/libcurl/curl_global_trace*,lib/curl_trc*,tests/http/test_15_tracing.py}' + - any-glob-to-all-files: "{\ + docs/cmdline-opts/trace*,\ + docs/libcurl/curl_global_trace*,\ + lib/curl_trc*,\ + tests/http/test_15_tracing.py\ + }" MIME: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/libcurl/curl_form*,docs/libcurl/curl_mime_*,docs/libcurl/opts/CURLOPT_MIME*,docs/libcurl/opts/CURLOPT_HTTPPOST*,lib/formdata*,lib/mime*,src/tool_formparse.*}' + - any-glob-to-all-files: "{\ + docs/libcurl/curl_form*,\ + docs/libcurl/curl_mime_*,\ + docs/libcurl/opts/CURLOPT_MIME*,\ + docs/libcurl/opts/CURLOPT_HTTPPOST*,\ + lib/formdata*,\ + lib/mime*,\ + src/tool_formparse.*\ + }" MQTT: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/MQTT.md,lib/mqtt*,tests/server/mqttd.c}' + - any-glob-to-all-files: "{\ + lib/mqtt*,\ + tests/server/mqttd.c\ + }" name lookup: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/examples/resolve.c,docs/libcurl/opts/CURLINFO_NAMELOOKUP*,docs/libcurl/opts/CURLOPT_DNS*,docs/libcurl/opts/CURLOPT_DOH*,docs/libcurl/opts/CURLOPT_RESOLVE*,lib/asyn*,lib/curl_gethostname.*,lib/doh*,lib/host*,lib/idn*,lib/inet_pton.*,lib/socketpair*,tests/server/resolve.c}' + - any-glob-to-all-files: "{\ + docs/examples/resolve.c,\ + docs/libcurl/opts/CURLINFO_NAMELOOKUP*,\ + docs/libcurl/opts/CURLOPT_DNS*,\ + docs/libcurl/opts/CURLOPT_DOH*,\ + docs/libcurl/opts/CURLOPT_RESOLVE*,\ + lib/asyn*,\ + lib/curl_gethostname.*,\ + lib/doh*,\ + lib/host*,\ + lib/idn*,\ + lib/inet_pton.*,\ + lib/socketpair*,\ + tests/server/resolve.c\ + }" POP3: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/examples/pop3*,lib/pop3.*}' + - any-glob-to-all-files: "{\ + docs/examples/pop3*,\ + lib/pop3.*\ + }" RTMP: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/curl_rtmp.*}' + - any-glob-to-all-files: "{\ + lib/curl_rtmp.*\ + }" RTSP: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/libcurl/opts/CURLINFO_RTSP*,docs/libcurl/opts/CURLOPT_RTSP*,lib/rtsp.*,tests/rtspserver.pl,tests/server/rtspd.c}' + - any-glob-to-all-files: "{\ + docs/libcurl/opts/CURLINFO_RTSP*,\ + docs/libcurl/opts/CURLOPT_RTSP*,\ + lib/rtsp.*,\ + tests/rtspserver.pl,\ + tests/server/rtspd.c\ + }" SCP/SFTP: - all: - changed-files: - - any-glob-to-all-files: - - '{CMake/FindLibSSH2.cmake,docs/libcurl/opts/CURLOPT_SSH*,docs/examples/sftp*,lib/vssh/**,tests/sshhelp.pm,tests/sshserver.pl}' + - any-glob-to-all-files: "{\ + CMake/FindLibssh2.cmake,\ + docs/libcurl/opts/CURLOPT_SSH*,\ + docs/examples/sftp*,\ + lib/vssh/**,\ + tests/sshhelp.pm,\ + tests/sshserver.pl\ + }" script: - all: - changed-files: - - any-glob-to-all-files: - - '{**/*.pl,**/*.sh,curl-config.in,docs/curl-config.1,docs/mk-ca-bundle.1,docs/THANKS-filter,scripts/**}' + - any-glob-to-all-files: "{\ + **/*.pl,\ + **/*.sh,\ + curl-config.in,\ + docs/curl-config.1,\ + docs/mk-ca-bundle.1,\ + docs/THANKS-filter,\ + scripts/**\ + }" SMB: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/smb.*,tests/smbserver.py}' + - any-glob-to-all-files: "{\ + lib/smb.*,\ + tests/smbserver.py\ + }" SMTP: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/examples/smtp-*,docs/libcurl/opts/CURLOPT_MAIL*,lib/smtp.*}' + - any-glob-to-all-files: "{\ + docs/examples/smtp-*,\ + docs/libcurl/opts/CURLOPT_MAIL*,\ + lib/smtp.*\ + }" tests: - all: @@ -230,29 +451,87 @@ tests: TFTP: - all: - changed-files: - - any-glob-to-all-files: - - '{lib/tftp.*,tests/tftpserver.pl,tests/server/tftp*}' + - any-glob-to-all-files: "{\ + lib/tftp.*,\ + tests/tftpserver.pl,\ + tests/server/tftp*\ + }" TLS: - all: - changed-files: - - any-glob-to-all-files: - - '{CMake/FindBearSSL.cmake,CMake/FindMbedTLS.cmake,CMake/FindWolfSSL.cmake,docs/examples/ssl*,docs/examples/*ssl.*,docs/examples/*tls.*,docs/SSL*,docs/libcurl/curl_global_sslset*,docs/libcurl/opts/CURLINFO_CA*,docs/libcurl/opts/CURLINFO_CERT*,docs/libcurl/opts/CURLINFO_SSL*,docs/libcurl/opts/CURLINFO_TLS*,docs/libcurl/opts/CURLOPT_CA*,docs/libcurl/opts/CURLOPT_CERT*,docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY*,docs/libcurl/opts/CURLOPT_SSL*,docs/libcurl/opts/CURLOPT_TLS*,docs/libcurl/opts/CURLOPT_USE_SSL*,lib/vtls/**,m4/curl-bearssl.m4,m4/curl-gnutls.m4,m4/curl-mbedtls.m4,m4/curl-openssl.m4,m4/curl-rustls.m4,m4/curl-schannel.m4,m4/curl-sectransp.m4,m4/curl-wolfssl.m4}' + - any-glob-to-all-files: "{\ + CMake/FindBearSSL.cmake,\ + CMake/FindMbedTLS.cmake,\ + CMake/FindWolfSSL.cmake,\ + CMake/FindRustls.cmake,\ + docs/examples/ssl*,\ + docs/examples/*ssl.*,\ + docs/examples/*tls.*,\ + docs/SSL*,\ + docs/libcurl/curl_global_sslset*,\ + docs/libcurl/opts/CURLINFO_CA*,\ + docs/libcurl/opts/CURLINFO_CERT*,\ + docs/libcurl/opts/CURLINFO_SSL*,\ + docs/libcurl/opts/CURLINFO_TLS*,\ + docs/libcurl/opts/CURLOPT_CA*,\ + docs/libcurl/opts/CURLOPT_CERT*,\ + docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY*,\ + docs/libcurl/opts/CURLOPT_SSL*,\ + docs/libcurl/opts/CURLOPT_TLS*,\ + docs/libcurl/opts/CURLOPT_USE_SSL*,\ + lib/vtls/**,\ + m4/curl-bearssl.m4,\ + m4/curl-gnutls.m4,\ + m4/curl-mbedtls.m4,\ + m4/curl-openssl.m4,\ + m4/curl-rustls.m4,\ + m4/curl-schannel.m4,\ + m4/curl-sectransp.m4,\ + m4/curl-wolfssl.m4\ + }" URL: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/libcurl/curl_url*,docs/URL-SYNTAX.md,docs/examples/parseurl*,include/curl/urlapi.h,lib/urlapi*}' + - any-glob-to-all-files: "{\ + docs/libcurl/curl_url*,\ + docs/URL-SYNTAX.md,\ + docs/examples/parseurl*,\ + include/curl/urlapi.h,\ + lib/urlapi*\ + }" WebSocket: - all: - changed-files: - - any-glob-to-all-files: - - '{docs/WEBSOCKET.md*,docs/examples/websocket*,docs/libcurl/curl_ws_*,docs/libcurl/libcurl-ws*,docs/libcurl/opts/CURLOPT_WS_*,include/curl/websockets.h,lib/ws.*,tests/http/clients/ws*,tests/http/test_20_websockets.py,tests/http/testenv/ws*}' + - any-glob-to-all-files: "{\ + docs/internals/WEBSOCKET.md*,\ + docs/examples/websocket*,\ + docs/libcurl/curl_ws_*,\ + docs/libcurl/libcurl-ws*,\ + docs/libcurl/opts/CURLOPT_WS_*,\ + include/curl/websockets.h,\ + lib/ws.*,\ + tests/http/clients/ws*,\ + tests/http/test_20_websockets.py,\ + tests/http/testenv/ws*\ + }" Windows: - all: - changed-files: - - any-glob-to-all-files: - - '{appveyor.*,CMake/Platforms/WindowsCache.cmake,lib/*win32*,lib/curl_multibyte.*,lib/rename.*,lib/vtls/schannel*,m4/curl-schannel.m4,projects/**,src/tool_doswin.c,winbuild/**,libcurl.def}' + - any-glob-to-all-files: "{\ + appveyor.*,\ + .github/workflows/windows.yml,\ + CMake/Platforms/WindowsCache.cmake,\ + lib/*win32*,\ + lib/curl_multibyte.*,\ + lib/rename.*,\ + lib/vtls/schannel*,\ + m4/curl-schannel.m4,\ + projects/**,\ + src/tool_doswin.c,\ + winbuild/**,\ + lib/libcurl.def\ + }" diff --git a/deps/curl/.github/scripts/badwords.pl b/deps/curl/.github/scripts/badwords.pl index ffebad94..3b215e43 100644 --- a/deps/curl/.github/scripts/badwords.pl +++ b/deps/curl/.github/scripts/badwords.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) Daniel Stenberg, , et al. # # SPDX-License-Identifier: curl diff --git a/deps/curl/.github/scripts/badwords.txt b/deps/curl/.github/scripts/badwords.txt index 2942ce8d..0af80b1d 100644 --- a/deps/curl/.github/scripts/badwords.txt +++ b/deps/curl/.github/scripts/badwords.txt @@ -12,28 +12,38 @@ wild-card:wildcard wild card:wildcard i'm:I am you've:You have +we've:we have +we're:we are +we'll:we will +we'd:we would they've:They have they're:They are +they'll:They will +they'd:They would +you've:you have +you'd:you would +you'll:you will +you're:you are should've:should have -don't:do not +don't=do not could've:could have doesn't:does not isn't:is not +aren't:are not a html: an html a http: an http a ftp: an ftp url =URL internet\b=Internet isation:ization -it's:it is +\bit's:it is +it'd:it would there's:there is [^.]\. And: Rewrite it somehow? ^(And|So|But) = Rewrite it somehow? \. But: Rewrite it somehow? \. So : Rewrite without "so" ? dir :directory -you'd:you would -you'll:you will can't:cannot that's:that is web page:webpage @@ -43,8 +53,16 @@ file name\b:filename file names\b:filenames \buser name\b:username \buser names\b:usernames +\bpass phrase:passphrase didn't:did not doesn't:does not won't:will not couldn't:could not \bwill\b:rewrite to present tense +\b32bit=32-bit +\b64bit=64-bit +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/deps/curl/.github/scripts/binarycheck.pl b/deps/curl/.github/scripts/binarycheck.pl new file mode 100644 index 00000000..25df8ddb --- /dev/null +++ b/deps/curl/.github/scripts/binarycheck.pl @@ -0,0 +1,115 @@ +#!/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 scripts scans the entire git repository for binary files. +# +# All files in the git repo that contain signs of being binary are then +# collected and a sha256sum is generated for all of them. That summary is then +# compared to the list of pre-vetted files so that only the exact copies of +# already scrutinized files are deemed okay to "appear binary". +# + +use strict; +use warnings; + +my $root = "."; +my $sumsfile = ".github/scripts/binarycheck.sums"; +if($ARGV[0]) { + $root = $ARGV[0]; +} + +my @bin; +my %known; +my $error = 0; + +sub knownbins { + open(my $mh, "<", "$sumsfile") || + die "can't read known binaries"; + while(<$mh>) { + my $l = $_; + chomp $l; + if($l =~ /^([a-f0-9]+) (.*)/) { + my ($sum, $file) = ($1, $2); + $known{$file} = 1; + } + elsif($l =~ /^#/) { + # skip comments + } + else { + print STDERR "suspicious line in $sumsfile\n"; + $error++; + } + } + close($mh); +} + +sub checkfile { + my ($file) = @_; + open(my $mh, "<", "$file") || die "can't read $file"; + my $line = 0; + while(<$mh>) { + my $l = $_; + $line++; + if($l =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) { + push @bin, $file; + + if(!$known{$file}) { + printf STDERR "$file:$line has unknown binary contents\n"; + $error++; + } + last; + } + } + close($mh); +} + +my @files = `git ls-files -- $root`; + +if(scalar(@files) < 3000) { + # this means this is not the git source code repository or that git does + # not work, error out! + print STDERR "too few files in the git repository!\n"; + exit 1; +} + +knownbins(); + +if(scalar(keys %known) < 10) { + print STDERR "too few known binaries in $sumsfile\n"; + exit 2; +} + +for my $f (@files) { + chomp $f; + checkfile("$root/$f"); +} + +my $check=system("sha256sum -c $sumsfile"); +if($check) { + print STDERR "sha256sum detected a problem\n"; + $error++; +} + +exit $error; diff --git a/deps/curl/.github/scripts/binarycheck.sums b/deps/curl/.github/scripts/binarycheck.sums new file mode 100644 index 00000000..8d542f79 --- /dev/null +++ b/deps/curl/.github/scripts/binarycheck.sums @@ -0,0 +1,25 @@ +# Copyright (C) Daniel Stenberg, , et al. +# SPDX-License-Identifier: curl +339d83446859f914867398046270d40b6ca7538c0adfef45eb62c8a16abb6a51 ./tests/certs/EdelCurlRoot-ca.der +c819fdeb4a6d27dde78895c2f3ed6467a31b332e72781e4ce6e11400bae9df3c ./tests/certs/Server-localhost-firstSAN-sv.der +f95d6b18fa02a0e2d98ed851cfa2f0b4b57d67fe8676ce4b1f78fc294ac22307 ./tests/certs/Server-localhost-firstSAN-sv.pub.der +3520cdc749d32bbe93276be4d8f714e24b5b882284566966f28361f1cb8a4d1c ./tests/certs/Server-localhost-lastSAN-sv.der +d623be406f9c02b28b2f2a376b3d8e06ed25335b7cbf96cb2c8de9357a09250d ./tests/certs/Server-localhost-lastSAN-sv.pub.der +d89d7ea295af4baa5f57304c69570b4a71f2dd4f9fe06350ab50041287b6910a ./tests/certs/Server-localhost-sv.der +0005032e4e1cf7cc5c1540ef03d8bf32703d1ee3b4dc83e2d79afe0b1f4e5e77 ./tests/certs/Server-localhost-sv.pub.der +5b22627a94c67159a18203ab5cd96b739188188cec61e73a444b2290e14d3d82 ./tests/certs/Server-localhost.nn-sv.der +611cbce062c9c6924119d7498e19eacdee4326190e516cad9c212a4b4bb49930 ./tests/certs/Server-localhost.nn-sv.pub.der +6eb66ef346068b4d9bbcc7c79244c48d3a4877f08618ff379b40ae02e067ba09 ./tests/certs/Server-localhost0h-sv.der +b967734c9bfe3d7a1a7795f348f0bce4d9ba15ca9590697ef2d4d15b92822db0 ./tests/certs/Server-localhost0h-sv.pub.der +6605cac758b09a954b12c2970c7d7a00f92658fc3ced250b281ae066e3ea6a73 ./tests/certs/stunnel-sv.der +2e9634d7d8387fbffd1fe43e030746610b2fc088f627333a9b58e5cb224ad6ba ./tests/certs/stunnel-sv.pub.der +9e38c1fb0a151c4e23c8abddc44711c12afb3161c6b2a1c68e1bb2b0a4484e3b ./tests/data/test1425 +26ee981dcb84b6a2adce601084b78e6b787b54a2a997549582a8bd42087ab51b ./tests/data/test1426 +d640923e45809a3fe277e0af90459d82d32603aacc7b8db88754fcb335bf98df ./tests/data/test1531 +6f51bc318104fb5fe4b6013fc4e8e1c3c8dec1819202e8ea025bdbc4bbc8c02d ./tests/data/test1938 +28a957ec3397881bbafd0d97879cedfd475bcd1ece903e531576affd7aa3865c ./tests/data/test2080 +db99126801fd5e7cb0c1ec1a0078e5599038c8c07073f3d62ed51f155e0e3d38 ./tests/data/test262 +2d073a52984bab1f196d80464ea8ab6dafd887bd5fee9ed58603f8510df0c6a5 ./tests/data/test35 +4cc9fd6f31d0bb4dcb38e1565796e7ec5e48ea5ac9d3c1101de576be618786ba ./tests/data/test463 +d655a29dcf2423b420b508c9e381b0fad0b88feb74caa8978725e22c9f7c374d ./tests/data/test467 +8644ccf85e552755bf65faf2991d84f19523919379ec2cf195841a4cabe1507b ./tests/data/test545 diff --git a/deps/curl/.github/scripts/cleancmd.pl b/deps/curl/.github/scripts/cleancmd.pl index fabcce23..e9366de7 100644 --- a/deps/curl/.github/scripts/cleancmd.pl +++ b/deps/curl/.github/scripts/cleancmd.pl @@ -1,9 +1,9 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) Daniel Stenberg, , et al. # # SPDX-License-Identifier: curl # -# Input: a cmdline docs markdown, it gets modfied *in place* +# Input: a cmdline docs markdown, it gets modified *in place* # # The main purpose is to strip off the leading meta-data part, but also to # clean up whatever else the spell checker might have a problem with that we diff --git a/deps/curl/.github/scripts/cleanspell.pl b/deps/curl/.github/scripts/cleanspell.pl index 9a0d79f5..bfa07dc0 100644 --- a/deps/curl/.github/scripts/cleanspell.pl +++ b/deps/curl/.github/scripts/cleanspell.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) Daniel Stenberg, , et al. # # SPDX-License-Identifier: curl diff --git a/deps/curl/scripts/cmp-config.pl b/deps/curl/.github/scripts/cmp-config.pl similarity index 86% rename from deps/curl/scripts/cmp-config.pl rename to deps/curl/.github/scripts/cmp-config.pl index ebd7c2fb..c58e3a6d 100644 --- a/deps/curl/scripts/cmp-config.pl +++ b/deps/curl/.github/scripts/cmp-config.pl @@ -37,19 +37,28 @@ my %remove = ( '#define _FILE_OFFSET_BITS 64' => 1, '#define CURL_EXTERN_SYMBOL' => 1, '#define CURL_SA_FAMILY_T sa_family_t' => 1, + '#define CURL_SA_FAMILY_T ADDRESS_FAMILY' => 1, + '#define HAVE_ADDRESS_FAMILY 1' => 1, '#define GETHOSTNAME_TYPE_ARG2 size_t' => 1, + '#define GETHOSTNAME_TYPE_ARG2 int' => 1, '#define HAVE_BROTLI 1' => 1, '#define HAVE_BROTLI_DECODE_H 1' => 1, '#define HAVE_DECL_GETPWUID_R 1' => 1, + '#define HAVE_DECL_GETPWUID_R 0' => 1, + '#define HAVE_DECL_GETPWUID_R_MISSING 1' => 1, '#define HAVE_DLFCN_H 1' => 1, '#define HAVE_GETHOSTBYNAME 1' => 1, + '#define HAVE_GSSAPI_GSSAPI_KRB5_H 1' => 1, '#define HAVE_INTTYPES_H 1' => 1, '#define HAVE_IOCTL 1' => 1, + '#define HAVE_LDAP_H 1' => 1, '#define HAVE_LDAP_SSL 1' => 1, '#define HAVE_LIBBROTLIDEC 1' => 1, + '#define HAVE_LIBSOCKET 1' => 1, + '#define HAVE_LIBSSH2 1' => 1, '#define HAVE_LIBSSL 1' => 1, '#define HAVE_LIBZSTD 1' => 1, - '#define HAVE_OPENSSL3 1' => 1, + '#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1, '#define HAVE_OPENSSL_CRYPTO_H 1' => 1, '#define HAVE_OPENSSL_ERR_H 1' => 1, '#define HAVE_OPENSSL_PEM_H 1' => 1, @@ -66,8 +75,9 @@ my %remove = ( '#define HAVE_ZSTD 1' => 1, '#define HAVE_ZSTD_H 1' => 1, '#define LT_OBJDIR ".libs/"' => 1, - '#define OS "Linux"' => 1, - '#define OS "x86_64-pc-linux-gnu"' => 1, + '#define NEED_LBER_H 1' => 1, + '#define CURL_OS "Linux"' => 1, + '#define CURL_OS "x86_64-pc-linux-gnu"' => 1, '#define PACKAGE "curl"' => 1, '#define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.se/mail/"' => 1, '#define PACKAGE_NAME "curl"' => 1, @@ -76,7 +86,6 @@ my %remove = ( '#define PACKAGE_URL ""' => 1, '#define PACKAGE_VERSION "-"' => 1, '#define SIZEOF_LONG_LONG 8' => 1, - '#define USE_MANUAL 1' => 1, '#define VERSION "-"' => 1, ); diff --git a/deps/curl/.github/scripts/cmp-pkg-config.sh b/deps/curl/.github/scripts/cmp-pkg-config.sh new file mode 100644 index 00000000..37a31621 --- /dev/null +++ b/deps/curl/.github/scripts/cmp-pkg-config.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +# Sort list of libs, libpaths, cflags found in libcurl.pc and curl-config files, +# then diff the autotools and cmake generated ones. + +sort_lists() { + prevline='' + section='' + while IFS= read -r l; do + if [[ "${prevline}" =~ (--cc|--configure) ]]; then # curl-config + echo "" + else + # libcurl.pc + if [[ "${l}" =~ ^(Requires|Libs|Cflags)(\.private)?:\ (.+)$ ]]; then + if [ "${BASH_REMATCH[1]}" = 'Requires' ]; then + # Spec does not allow duplicates here: + # https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html#Requires: + # "You may only mention the same package one time on the Requires: line" + val="$(printf '%s' "${BASH_REMATCH[3]}" | tr ',' '\n' | sort | tr '\n' ' ')" + else + val="$(printf '%s' "${BASH_REMATCH[3]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')" + fi + l="${BASH_REMATCH[1]}${BASH_REMATCH[2]}: ${val}" + # curl-config + elif [[ "${section}" =~ (--libs|--static-libs) && "${l}" =~ ^( *echo\ \")(.+)(\")$ ]]; then + val="$(printf '%s' "${BASH_REMATCH[2]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')" + l="${BASH_REMATCH[1]}${val}${BASH_REMATCH[3]}" + section='' + fi + echo "${l}" + fi + # curl-config + prevline="${l}" + if [[ "${l}" =~ --[a-z-]+\) ]]; then + section="${BASH_REMATCH[0]}" + fi + done < "$1" +} + +am=$(mktemp -t autotools.XXX); sort_lists "$1" > "${am}" +cm=$(mktemp -t cmake.XXX) ; sort_lists "$2" > "${cm}" +diff -u "${am}" "${cm}" +res="$?" +rm -r -f "${am}" "${cm}" + +exit "${res}" diff --git a/deps/curl/.github/scripts/codespell-ignore.txt b/deps/curl/.github/scripts/codespell-ignore.txt index 3832cec4..a239d9ef 100644 --- a/deps/curl/.github/scripts/codespell-ignore.txt +++ b/deps/curl/.github/scripts/codespell-ignore.txt @@ -13,3 +13,4 @@ inout msdos ba fo +ede diff --git a/deps/curl/.github/scripts/distfiles.sh b/deps/curl/.github/scripts/distfiles.sh new file mode 100644 index 00000000..31b5a118 --- /dev/null +++ b/deps/curl/.github/scripts/distfiles.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +# Compare git repo files with tarball files and report a mismatch +# after excluding exceptions. + +set -eu + +gitonly=".git* +^.* +^appveyor.* +^buildconf +^GIT-INFO.md +^README.md +^renovate.json +^REUSE.toml +^SECURITY.md +^LICENSES/* +^docs/examples/adddocsref.pl +^docs/THANKS-filter +^projects/Windows/* +^scripts/ciconfig.pl +^scripts/cijobs.pl +^scripts/contributors.sh +^scripts/contrithanks.sh +^scripts/delta +^scripts/installcheck.sh +^scripts/release-notes.pl +^scripts/singleuse.pl +^src/tool_hugehelp.c.cvs +^tests/CI.md" + +tarfiles="$(mktemp)" +gitfiles="$(mktemp)" + +tar -tf "$1" \ + | sed -E 's|^[^/]+/||g' \ + | grep -v -E '(/|^)$' \ + | sort > "${tarfiles}" + +git -C "${2:-.}" ls-files \ + | grep -v -E "($(printf '%s' "${gitonly}" | tr $'\n' '|' | sed -e 's|\.|\\.|g' -e 's|\*|.+|g'))$" \ + | sort > "${gitfiles}" + +dif="$(diff -u "${tarfiles}" "${gitfiles}" | tail -n +3 || true)" + +rm -rf "${tarfiles:?}" "${gitfiles:?}" + +echo 'Only in tarball:' +echo "${dif}" | grep '^-' || true +echo + +echo 'Missing from tarball:' +if echo "${dif}" | grep '^+'; then + exit 1 +fi diff --git a/deps/curl/.github/scripts/shellcheck.sh b/deps/curl/.github/scripts/shellcheck.sh new file mode 100644 index 00000000..b4a07c58 --- /dev/null +++ b/deps/curl/.github/scripts/shellcheck.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +shellcheck --version +# shellcheck disable=SC2046 +shellcheck --exclude=1091 \ + --enable=avoid-nullary-conditions,deprecate-which \ + $(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files)) diff --git a/deps/curl/.github/scripts/spacecheck.pl b/deps/curl/.github/scripts/spacecheck.pl new file mode 100644 index 00000000..b2473b15 --- /dev/null +++ b/deps/curl/.github/scripts/spacecheck.pl @@ -0,0 +1,153 @@ +#!/usr/bin/env perl +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Viktor Szakats +# +# 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 +# +########################################################################### + +use strict; +use warnings; + +my @tabs = ( + "^m4/zz40-xc-ovr.m4", + "Makefile\\.[a-z]+\$", + "/mkfile", + "\\.(bat|sln|vc)\$", + "^tests/certs/.+\\.der\$", + "^tests/data/test", +); + +my @mixed_eol = ( + "^tests/certs/.+\\.(crt|der)\$", + "^tests/certs/Server-localhost0h-sv.pem", + "^tests/data/test", +); + +my @need_crlf = ( + "\\.(bat|sln)\$", + "^winbuild/.+\\.md\$", +); + +my @space_at_eol = ( + "^tests/.+\\.(cacert|crt|pem)\$", + "^tests/data/test", +); + +my @eol_at_eof = ( + "^tests/certs/.+\\.der\$", +); + +sub fn_match { + my ($filename, @masklist) = @_; + + foreach my $mask (@masklist) { + if ($filename =~ $mask) { + return 1; + } + } + return 0; +} + +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 "" +} + +my $issues = 0; + +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': $!"; + my $content = do { local $/; <$fh> }; + close $fh; + + my @err = (); + + if (!fn_match($filename, @tabs) && + $content =~ /\t/) { + push @err, "content: has tab"; + } + + my $eol = eol_detect($content); + + if ($eol eq "" && + !fn_match($filename, @mixed_eol)) { + push @err, "content: has mixed EOL types"; + } + + if ($eol ne "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, @mixed_eol)) { + push @err, "content: must use LF EOL for this file type"; + } + + if (!fn_match($filename, @space_at_eol) && + $content =~ /[ \t]\n/) { + push @err, "content: has line-ending whitespace"; + } + + if ($content ne "" && + !fn_match($filename, @eol_at_eof) && + $content !~ /\n\z/) { + push @err, "content: has no EOL at EOF"; + } + + if ($content =~ /\n\n\z/ || + $content =~ /\r\n\r\n\z/) { + push @err, "content: has multiple EOL at EOF"; + } + + if (@err) { + $issues++; + foreach my $err (@err) { + print "$filename: $err\n"; + } + } +} +close $git_ls_files; + +if ($issues) { + exit 1; +} diff --git a/deps/curl/.github/scripts/spellcheck.words b/deps/curl/.github/scripts/spellcheck.words index ab7b18c1..7aa13af7 100644 --- a/deps/curl/.github/scripts/spellcheck.words +++ b/deps/curl/.github/scripts/spellcheck.words @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: curl # +AAAA ABI accessor ACK @@ -10,6 +11,7 @@ AIA AIX al Alessandro +aliasMode allocator alnum ALPN @@ -31,7 +33,6 @@ archivers Archos Arntsen Aros -ascii asynch AsynchDNS atime @@ -42,6 +43,7 @@ Autoconf autoconf Automake automake +autoreconf Autotools autotools AVR @@ -67,7 +69,6 @@ Bjørn bool boolean BoringSSL -boringssl Boukris Broadcom brotli @@ -77,7 +78,6 @@ bugfix bugfixes buildable buildbot -buildconf Caddy calloc CAPA @@ -109,6 +109,7 @@ CLA CLAs cleartext CLI +ClientHello clientp cliget closesocket @@ -117,11 +118,15 @@ cmake CMake's cmake's CMakeLists +CNA +CNAME +CNAMEs CodeQL codeql CODESET codeset Comcast +commit's Config config conncache @@ -132,6 +137,7 @@ CPUs CR CRL CRLF +crontab crt crypto cryptographic @@ -145,6 +151,7 @@ cURL CURLcode curldown CURLE +CURLECH CURLH curlimages CURLINFO @@ -163,9 +170,12 @@ dbg Debian DEBUGBUILD decrypt +decrypting deepcode DELE DER +dereference +dereferences deselectable deserialization Deserialized @@ -189,6 +199,7 @@ DNS dns dnsop DoH +DoT doxygen drftpd dsa @@ -200,8 +211,13 @@ EBCDIC ECC ECDHE ECH +ECHConfig +ECHConfigList +ecl ECONNREFUSED eCOS +ECT +EF EFnet EGD EHLO @@ -277,12 +293,13 @@ globbed globbing gmail GnuTLS -gnutls Golemon GOST GPG GPL GPLed +GREASE +GREASEing Greear groff gsasl @@ -306,6 +323,7 @@ Hards Haxx haxx Heimdal +HelloRetryRequest HELO HH HMAC @@ -315,6 +333,7 @@ homebrew hostname hostnames Housley +HRR Hruska HSTS hsts @@ -342,9 +361,10 @@ ifdef ifdefed Ifdefs ifdefs +ifhost IIS ILE -Illumos +illumos IMAP imap IMAPS @@ -420,11 +440,9 @@ libpsl Libre libre LibreSSL -libressl librtmp libs libssh -libSSH libssh2 Libtool libtool @@ -434,12 +452,15 @@ libz libzstd LineageOS linux +lldb ln localhost LOGDIR logfile lookups loopback +LOWCOST +LOWDELAY LPRT LSB lseek @@ -459,6 +480,7 @@ Marek Mavrogiannopoulos Mbed mbedTLS +md Meglio memdebug MesaLink @@ -469,6 +491,8 @@ Michal Micrium MicroBlaze MicroOS +middlebox +MINCOST mingw MinGW MINIX @@ -485,6 +509,7 @@ MorphOS MPE MPL mprintf +MPTCP MQTT mqtt mqtts @@ -504,6 +529,7 @@ mTLS MUA multicwd multiparts +multipath MultiSSL mumbo musedev @@ -589,6 +615,7 @@ pkcs PKGBUILD PKI pluggable +pn PolarSSL Polhem pollset @@ -624,6 +651,7 @@ py pycurl pytest Pytest +qname QNX QoS Qubes @@ -638,6 +666,7 @@ ReactOS README realloc Realtime +rebalances rebase RECV recv @@ -659,7 +688,6 @@ RETR retransmit retrigger RHEL -RICS Rikard rmdir ROADMAP @@ -667,9 +695,13 @@ Roadmap Rockbox roffit RPG +RR +RRs +RRtype RSA RTMP rtmp +rtmpdump RTMPE RTMPS RTMPT @@ -684,6 +716,7 @@ runtests runtime Ruslan rustc +Rustls rustls Sagula SanDisk @@ -735,6 +768,7 @@ SOCKOPT SOCKSv Solaris SONAME +SOVERSION Soref SPARC SPDX @@ -762,6 +796,7 @@ stdin stdout Steinar Stenberg +STLS STOR strcat strcpy @@ -783,6 +818,7 @@ SunSSH superset svc svcb +SVCB Svyatoslav Swisscom sws @@ -798,6 +834,7 @@ TCP tcpdump Tekniska testability +testcurl TFTP tftp threadsafe @@ -811,10 +848,12 @@ toolchain toolchains toolset toplevel +TOS TPF TrackMemory transcode Tru +trurl trustless Tse Tsujikawa @@ -840,7 +879,6 @@ unescape Unglobbed Unicode UNICOS -unix UnixSockets UnixWare unlink @@ -852,6 +890,7 @@ unsanitized Unshare unsharing untrusted +unwrite UPN upstreaming URI @@ -874,6 +913,7 @@ VC vcpkg vexxhost Viktor +VLAN VM VMS VMware @@ -881,6 +921,7 @@ vnd VRF VRFY VSE +vsftpd vsprintf vt vtls @@ -890,6 +931,7 @@ Warta watchOS WAV WB +wcurl web page WebDAV WebOS @@ -900,14 +942,10 @@ WHATWG whitespace Whitespaces winbind -WinBind winbuild -winidn WinIDN WinLDAP -WinSock winsock -WinSSL winssl Wireshark wolfSSH diff --git a/deps/curl/.github/scripts/spellcheck.yaml b/deps/curl/.github/scripts/spellcheck.yaml index 5cf4f9a0..04dfbfaf 100644 --- a/deps/curl/.github/scripts/spellcheck.yaml +++ b/deps/curl/.github/scripts/spellcheck.yaml @@ -29,4 +29,4 @@ matrix: - 'strong' - 'em' sources: - - '**/*.md|!docs/BINDINGS.md' + - '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md' diff --git a/deps/curl/.github/scripts/trimmarkdownheader.pl b/deps/curl/.github/scripts/trimmarkdownheader.pl new file mode 100644 index 00000000..9c623730 --- /dev/null +++ b/deps/curl/.github/scripts/trimmarkdownheader.pl @@ -0,0 +1,41 @@ +#!/usr/bin/env perl +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl +# +# Given: a libcurl curldown man page +# Outputs: the same file, minus the header +# + +my $f = $ARGV[0]; + +open(F, "<$f") or die; + +my @out; +my $line = 0; +my $hideheader = 0; + +while() { + if($hideheader) { + if(/^---/) { + # end if hiding + $hideheader = 0; + } + push @out, "\n"; # replace with blank + next; + } + elsif(!$line++ && /^---/) { + # starts with a header, strip off the header + $hideheader = 1; + push @out, "\n"; # replace with blank + next; + } + push @out, $_; +} +close(F); + +open(O, ">$f") or die; +for my $l (@out) { + print O $l; +} +close(O); diff --git a/deps/curl/.github/scripts/verify-synopsis.pl b/deps/curl/.github/scripts/verify-synopsis.pl index 9d321850..aa269179 100644 --- a/deps/curl/.github/scripts/verify-synopsis.pl +++ b/deps/curl/.github/scripts/verify-synopsis.pl @@ -46,17 +46,17 @@ sub extract { open(O, ">$cfile"); while() { $iline++; - if(/^.SH SYNOPSIS/) { + if(/^# SYNOPSIS/) { $syn = 1 } elsif($syn == 1) { - if(/^.nf/) { + if(/^\~\~\~/) { $syn++; print O "#line $iline \"$f\"\n"; } } elsif($syn == 2) { - if(/^.fi/) { + if(/^\~\~\~/) { last; } # turn the vararg argument into vararg @@ -68,13 +68,17 @@ sub extract { close(F); close(O); + if($syn < 2) { + print STDERR "Found no synopsis in $f\n"; + return 1; + } + return 0; } my $error; for my $m (@files) { - print "Verify $m\n"; - extract($m); + $error |= extract($m); $error |= testcompile($m); } exit $error; diff --git a/deps/curl/.github/scripts/yamlcheck.sh b/deps/curl/.github/scripts/yamlcheck.sh new file mode 100644 index 00000000..2431c97a --- /dev/null +++ b/deps/curl/.github/scripts/yamlcheck.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +set -eu + +# shellcheck disable=SC2046 +yamllint \ + --format standard \ + --strict \ + --config-data "$(dirname "$0")/yamlcheck.yaml" \ + $(git ls-files '*.yaml' '*.yml') diff --git a/deps/curl/.github/scripts/yamlcheck.yaml b/deps/curl/.github/scripts/yamlcheck.yaml new file mode 100644 index 00000000..a6e16410 --- /dev/null +++ b/deps/curl/.github/scripts/yamlcheck.yaml @@ -0,0 +1,17 @@ +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl +# +# Docs: https://yamllint.readthedocs.io/en/stable/configuration.html + +extends: default + +rules: + line-length: + max: 500 + level: warning + + braces: disable + commas: disable + comments: disable + document-start: disable diff --git a/deps/curl/.github/workflows/appveyor-status.yml b/deps/curl/.github/workflows/appveyor-status.yml index df54422f..221db2d2 100644 --- a/deps/curl/.github/workflows/appveyor-status.yml +++ b/deps/curl/.github/workflows/appveyor-status.yml @@ -4,7 +4,7 @@ name: AppVeyor Status Report -on: +'on': status concurrency: diff --git a/deps/curl/.github/workflows/awslc.yml b/deps/curl/.github/workflows/awslc.yml deleted file mode 100644 index 48525164..00000000 --- a/deps/curl/.github/workflows/awslc.yml +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: Linux AWS-LC - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: awslc-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - awslc-version: 1.13.0 - -jobs: - autoconf: - name: awslc (autoconf) - runs-on: 'ubuntu-latest' - timeout-minutes: 30 - - steps: - - run: | - sudo apt-get update --yes - sudo apt-get install --yes libtool autoconf automake pkg-config stunnel4 libpsl-dev - # ensure we don't pick up openssl in this build - sudo apt remove --yes libssl-dev - sudo python3 -m pip install impacket - name: 'install prereqs and impacket' - - - name: cache awslc - uses: actions/cache@v4 - id: cache-awslc - env: - cache-name: cache-awslc - with: - path: /home/runner/awslc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.awslc-version }} - - - name: build awslc - if: steps.cache-awslc.outputs.cache-hit != 'true' - run: | - curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \ - https://github.com/awslabs/aws-lc/archive/refs/tags/v${{ env.awslc-version }}.tar.gz - tar xzf v${{ env.awslc-version }}.tar.gz - mkdir aws-lc-${{ env.awslc-version }}-build - cd aws-lc-${{ env.awslc-version }}-build - cmake -DCMAKE_INSTALL_PREFIX=$HOME/awslc ../aws-lc-${{ env.awslc-version }} - cmake --build . --parallel - cmake --install . - - - uses: actions/checkout@v4 - - - run: autoreconf -fi - name: 'autoreconf' - - - run: | - mkdir build - cd build - ../configure --enable-warnings --enable-werror --with-openssl=$HOME/awslc - cd .. - name: 'configure out-of-tree' - - - run: make -C build V=1 - name: 'make' - - - run: make -C build V=1 examples - name: 'make examples' - - - run: make -C build V=1 -C tests - name: 'make tests' - - - run: make -C build V=1 test-ci - name: 'run tests' - - cmake: - name: awslc (cmake) - runs-on: 'ubuntu-latest' - timeout-minutes: 15 - - steps: - - run: | - sudo apt-get update - sudo apt-get install cmake stunnel4 - # ensure we don't pick up openssl in this build - sudo apt remove --yes libssl-dev - sudo python3 -m pip install impacket - name: 'install prereqs and impacket' - - - name: cache awslc - uses: actions/cache@v4 - id: cache-awslc - env: - cache-name: cache-awslc - with: - path: /home/runner/awslc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.awslc-version }} - - - name: build awslc - if: steps.cache-awslc.outputs.cache-hit != 'true' - run: | - curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \ - https://github.com/awslabs/aws-lc/archive/refs/tags/v${{ env.awslc-version }}.tar.gz - tar xzf v${{ env.awslc-version }}.tar.gz - mkdir aws-lc-${{ env.awslc-version }}-build - cd aws-lc-${{ env.awslc-version }}-build - cmake -DCMAKE_INSTALL_PREFIX=$HOME/awslc ../aws-lc-${{ env.awslc-version }} - cmake --build . --parallel - cmake --install . - - - uses: actions/checkout@v4 - - # CMAKE_COMPILE_WARNING_AS_ERROR is available in cmake 3.24 or later - - run: cmake -Bbuild -DOPENSSL_ROOT_DIR=$HOME/awslc -DBUILD_SHARED_LIBS=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON . - name: 'cmake generate out-of-tree' - - - run: cmake --build build --parallel - name: 'cmake build' - - - run: cmake --install build --prefix $HOME/curl --strip - name: 'cmake install' diff --git a/deps/curl/.github/workflows/badwords.yml b/deps/curl/.github/workflows/badwords.yml deleted file mode 100644 index 0165d9bf..00000000 --- a/deps/curl/.github/workflows/badwords.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: badwords - -on: - # Trigger the workflow on push or pull requests, but only for the - # master branch - push: - branches: - - master - - '*/ci' - pull_request: - branches: - - master - -jobs: - check: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: check - run: ./.github/scripts/badwords.pl < .github/scripts/badwords.txt docs/*.md docs/libcurl/*.md docs/libcurl/opts/*.md docs/cmdline-opts/*.md diff --git a/deps/curl/.github/workflows/checkdocs.yml b/deps/curl/.github/workflows/checkdocs.yml new file mode 100644 index 00000000..45910b7d --- /dev/null +++ b/deps/curl/.github/workflows/checkdocs.yml @@ -0,0 +1,159 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +# This workflow contains tests that operate on documentation files only. Some +# checks modify the source so they cannot be combined into a single job. + +name: Docs + +'on': + push: + branches: + - master + - '*/ci' + paths: + - '.github/workflows/checkdocs.yml' + - '.github/scripts/**' + - '**.md' + - 'docs/*' + pull_request: + branches: + - master + paths: + - '.github/workflows/checkdocs.yml' + - '.github/scripts/**' + - '**.md' + - 'docs/*' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + # proselint: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + # name: checkout + # + # - name: install prereqs + # run: | + # sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + # sudo apt-get install -y --no-install-suggests --no-install-recommends \ + # python3-proselint + # + # # config file help: https://github.com/amperser/proselint/ + # - name: create proselint config + # run: | + # cat < $HOME/.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 -z '*.md' | 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 + # + # # This is for CHECKSRC and files with aggressive exclamation mark needs + # - name: create second proselint config + # run: | + # cat < $HOME/.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 + + # Docs: https://github.com/marketplace/actions/markdown-link-check + linkcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: trim the cmdline docs markdown files + run: find docs/cmdline-opts -name "*.md" ! -name "_*" ! -name MANPAGE.md -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl + + - uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # v1 + with: + use-quiet-mode: 'yes' + + spellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: trim all man page *.md files + run: find docs -name "*.md" ! -name "_*" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl + + - name: trim libcurl man page *.md files + run: find docs/libcurl \( -name "curl_*.md" -o -name "libcurl*.md" \) -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl + + - name: trim libcurl option man page *.md files + run: find docs/libcurl/opts -name "CURL*.md" -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl + + - name: trim cmdline docs markdown _*.md files + run: find docs/cmdline-opts -name "_*.md" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl --no-header + + - name: setup the custom wordlist + run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt + + - name: Check Spelling + uses: rojopolis/spellcheck-github-actions@74c2a1451c617e7dd9532340b199e18d5411b168 # v0 + with: + config_path: .github/scripts/spellcheck.yaml + + badwords-synopsis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: badwords + run: .github/scripts/badwords.pl < .github/scripts/badwords.txt docs/*.md docs/libcurl/*.md docs/libcurl/opts/*.md docs/cmdline-opts/*.md docs/TODO docs/KNOWN_BUGS tests/*.md + + - name: verify-synopsis + run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md + + man-examples: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: render nroff versions + run: autoreconf -fi && ./configure --without-ssl --without-libpsl && make -C docs + + - name: verify examples + run: .github/scripts/verify-examples.pl docs/libcurl/curl*.3 docs/libcurl/opts/*.3 + + miscchecks: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: spacecheck + run: .github/scripts/spacecheck.pl diff --git a/deps/curl/.github/workflows/checksrc.yml b/deps/curl/.github/workflows/checksrc.yml new file mode 100644 index 00000000..8ecf1f4f --- /dev/null +++ b/deps/curl/.github/workflows/checksrc.yml @@ -0,0 +1,110 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +# This workflow contains checks at the source code level only. + +name: Source + +'on': + push: + branches: + - master + - '*/ci' + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'plan9/**' + - 'tests/data/**' + - 'winbuild/**' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'plan9/**' + - 'tests/data/**' + - 'winbuild/**' + +permissions: {} + +jobs: + checksrc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: check + run: git ls-files -z "*.[ch]" | xargs -0 -n1 ./scripts/checksrc.pl + + codespell-cmakelint-pytype-ruff: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: install + env: + DEBIAN_FRONTEND: noninteractive + run: >- + sudo apt-get install -y --no-install-suggests --no-install-recommends + codespell python3-pip python3-networkx python3-pydot python3-yaml + python3-toml python3-markupsafe python3-jinja2 python3-tabulate + python3-typing-extensions python3-libcst python3-impacket + python3-websockets python3-pytest && + python3 -m pip install --break-system-packages cmakelint==1.4.3 pytype==2024.9.13 ruff==0.6.8 + + - name: spellcheck + run: | + codespell \ + --skip scripts/mk-ca-bundle.pl \ + --skip src/tool_hugehelp.c \ + -I .github/scripts/codespell-ignore.txt \ + CMake include m4 scripts src lib + + - name: cmakelint + run: scripts/cmakelint.sh + + - name: pytype + run: find . -name '*.py' -exec pytype -j auto -k {} + + + - name: ruff + run: ruff check --extend-select=B007,B016,C405,C416,COM818,D200,D213,D204,D401,D415,FURB129,N818,PERF401,PERF403,PIE790,PIE808,PLW0127,Q004,RUF010,SIM101,SIM117,SIM118,TRY400,TRY401 + + reuse: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: REUSE Compliance Check + uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4 + + miscchecks: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + name: checkout + + - name: shellcheck + run: .github/scripts/shellcheck.sh + + - name: spacecheck + run: .github/scripts/spacecheck.pl + + - name: yamlcheck + run: .github/scripts/yamlcheck.sh + + - name: binarycheck + run: .github/scripts/binarycheck.pl + + # we allow some extra in source code + - name: badwords + run: | + grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | \ + .github/scripts/badwords.pl $(git ls-files -- src lib include) diff --git a/deps/curl/.github/workflows/codeql-analysis.yml b/deps/curl/.github/workflows/codeql-analysis.yml index f98e4da4..3c6f777f 100644 --- a/deps/curl/.github/workflows/codeql-analysis.yml +++ b/deps/curl/.github/workflows/codeql-analysis.yml @@ -4,16 +4,14 @@ name: CodeQL -on: +'on': push: branches: - master - '*/ci' paths-ignore: - '**/*.md' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'docs/**' - 'packages/**' @@ -26,9 +24,7 @@ on: - master paths-ignore: - '**/*.md' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'docs/**' - 'packages/**' @@ -51,11 +47,11 @@ jobs: security-events: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3 with: languages: cpp queries: security-extended @@ -63,7 +59,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -77,4 +73,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3 diff --git a/deps/curl/.github/workflows/codespell.yml b/deps/curl/.github/workflows/codespell.yml deleted file mode 100644 index 2b095dae..00000000 --- a/deps/curl/.github/workflows/codespell.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: Codespell - -on: - push: - branches: - - master - - '*/ci' - paths: - - 'lib/**' - - 'src/**' - - 'include/**' - pull_request: - branches: - - master - - 'lib/**' - - 'src/**' - - 'include/**' - -jobs: - codespell: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: install - run: | - sudo apt-get update - sudo apt-get install codespell - - - name: spellcheck - run: codespell --skip src/tool_hugehelp.c -I .github/scripts/codespell-ignore.txt include src lib diff --git a/deps/curl/.github/workflows/configure-vs-cmake.yml b/deps/curl/.github/workflows/configure-vs-cmake.yml index dc2273f7..57ec347b 100644 --- a/deps/curl/.github/workflows/configure-vs-cmake.yml +++ b/deps/curl/.github/workflows/configure-vs-cmake.yml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: curl name: configure-vs-cmake -on: +'on': push: branches: - master @@ -12,7 +12,8 @@ on: - '**/*.m4' - '**/CMakeLists.txt' - 'lib/curl_config.h.cmake' - - 'scripts/cmp-config.pl' + - '.github/scripts/cmp-config.pl' + - '.github/workflows/configure-vs-cmake.yml' pull_request: branches: @@ -22,24 +23,116 @@ on: - '**/*.m4' - '**/CMakeLists.txt' - 'lib/curl_config.h.cmake' - - 'scripts/cmp-config.pl' + - '.github/scripts/cmp-config.pl' + - '.github/workflows/configure-vs-cmake.yml' permissions: {} jobs: - check: + check-linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: run configure --with-openssl run: | - autoreconf -fi - ./configure --with-openssl --without-libpsl + autoreconf -fi + export PKG_CONFIG_DEBUG_SPEW=1 + mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --without-brotli --without-zstd - name: run cmake run: | - mkdir build && cd build && cmake .. + cmake -B bld-cm -DCURL_USE_LIBPSL=OFF + + - name: 'configure log' + run: cat bld-am/config.log 2>/dev/null || true + + - name: 'cmake log' + run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true - name: compare generated curl_config.h files - run: ./scripts/cmp-config.pl lib/curl_config.h build/lib/curl_config.h + run: ./.github/scripts/cmp-config.pl bld-am/lib/curl_config.h bld-cm/lib/curl_config.h + + - name: compare generated libcurl.pc files + run: ./.github/scripts/cmp-pkg-config.sh bld-am/libcurl.pc bld-cm/libcurl.pc + + - name: compare generated curl-config files + run: ./.github/scripts/cmp-pkg-config.sh bld-am/curl-config bld-cm/curl-config + + check-macos: + runs-on: macos-latest + steps: + - name: install packages + run: | + while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew install libtool autoconf automake && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done + + - name: 'toolchain versions' + run: | + echo '::group::brew packages installed'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: run configure --with-openssl + run: | + autoreconf -fi + export PKG_CONFIG_DEBUG_SPEW=1 + mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --disable-ldap + + - name: run cmake + run: | + cmake -B bld-cm -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \ + "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ + -DCURL_USE_LIBSSH2=OFF + + - name: 'configure log' + run: cat bld-am/config.log 2>/dev/null || true + + - name: 'cmake log' + run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true + + - name: compare generated curl_config.h files + run: ./.github/scripts/cmp-config.pl bld-am/lib/curl_config.h bld-cm/lib/curl_config.h + + - name: compare generated libcurl.pc files + run: ./.github/scripts/cmp-pkg-config.sh bld-am/libcurl.pc bld-cm/libcurl.pc + + - name: compare generated curl-config files + run: ./.github/scripts/cmp-pkg-config.sh bld-am/curl-config bld-cm/curl-config + + check-windows: + runs-on: ubuntu-latest + env: + TRIPLET: 'x86_64-w64-mingw32' + steps: + - name: install packages + run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install mingw-w64 + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: run configure --with-schannel + run: | + autoreconf -fi + export PKG_CONFIG_DEBUG_SPEW=1 + mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-schannel --without-libpsl --host=${TRIPLET} + + - name: run cmake + run: | + cmake -B bld-cm -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \ + -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_C_COMPILER_TARGET=${TRIPLET} \ + -DCMAKE_C_COMPILER=${TRIPLET}-gcc + + - name: 'configure log' + run: cat bld-am/config.log 2>/dev/null || true + + - name: 'cmake log' + run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true + + - name: compare generated curl_config.h files + run: ./.github/scripts/cmp-config.pl bld-am/lib/curl_config.h bld-cm/lib/curl_config.h + + - name: compare generated libcurl.pc files + run: ./.github/scripts/cmp-pkg-config.sh bld-am/libcurl.pc bld-cm/libcurl.pc + + - name: compare generated curl-config files + run: ./.github/scripts/cmp-pkg-config.sh bld-am/curl-config bld-cm/curl-config diff --git a/deps/curl/.github/workflows/curl-for-win.yml b/deps/curl/.github/workflows/curl-for-win.yml new file mode 100644 index 00000000..d844d414 --- /dev/null +++ b/deps/curl/.github/workflows/curl-for-win.yml @@ -0,0 +1,135 @@ +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl +--- +name: curl-for-win + +'on': + push: + branches: + - master + - '*/ci' + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +env: + CW_NOGET: 'curl trurl' + CW_MAP: '0' + CW_JOBS: '5' + CW_NOPKG: '1' + +jobs: + linux-glibc-llvm: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + 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-linux-a64-x64' + export CW_REVISION='${{ github.sha }}' + DOCKER_IMAGE='debian:bookworm-slim' + DOCKER_CONTENT_TRUST=1 + export CW_CCSUFFIX='-15' + export CW_GCCSUFFIX='-12' + docker trust inspect --pretty "${DOCKER_IMAGE}" + time docker pull "${DOCKER_IMAGE}" + docker images --digests + time docker 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: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + 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-linux-musl-r64-x64' + export CW_REVISION='${{ github.sha }}' + . ./_versions.sh + docker trust inspect --pretty "${DOCKER_IMAGE}" + time docker pull "${DOCKER_IMAGE}" + docker images --digests + time docker run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ + --env-file <(env | grep -a -E \ + '^(CW_|GITHUB_)') \ + "${DOCKER_IMAGE}" \ + sh -c ./_ci-linux-debian.sh + + mac-clang: + runs-on: macos-latest + timeout-minutes: 30 + env: + CW_JOBS: '4' + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + 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-mac-x64' + export CW_REVISION='${{ github.sha }}' + sh -c ./_ci-mac-homebrew.sh + + win-llvm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + 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-win-x64' + export CW_REVISION='${{ github.sha }}' + . ./_versions.sh + docker trust inspect --pretty "${DOCKER_IMAGE}" + time docker pull "${DOCKER_IMAGE}" + docker images --digests + time docker run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ + --env-file <(env | grep -a -E \ + '^(CW_|GITHUB_)') \ + "${DOCKER_IMAGE}" \ + sh -c ./_ci-linux-debian.sh diff --git a/deps/curl/.github/workflows/distcheck.yml b/deps/curl/.github/workflows/distcheck.yml index 15068b64..8790157f 100644 --- a/deps/curl/.github/workflows/distcheck.yml +++ b/deps/curl/.github/workflows/distcheck.yml @@ -4,7 +4,7 @@ name: dist -on: +'on': push: branches: - master @@ -17,12 +17,14 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true +permissions: {} + jobs: maketgz-and-verify-in-tree: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - run: sudo apt-get purge -y curl libcurl4 libcurl4-doc name: 'remove preinstalled curl libcurl4{-doc}' @@ -33,25 +35,27 @@ jobs: - run: ./configure --without-ssl --without-libpsl name: 'configure' - - run: make V=1 && make V=1 clean - name: 'make and clean' + - run: make V=1 + name: 'make' - - run: ./maketgz 99.98.97 - name: 'maketgz' + - name: 'maketgz' + run: | + SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97 - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: name: 'release-tgz' path: 'curl-99.98.97.tar.gz' + retention-days: 1 - run: | echo "::stop-commands::$(uuidgen)" tar xvf curl-99.98.97.tar.gz pushd curl-99.98.97 ./configure --prefix=$HOME/temp --without-ssl --without-libpsl - make - make test-ci - make install + make -j5 + make -j5 test-ci + make -j5 install popd # basic check of the installed files bash scripts/installcheck.sh $HOME/temp @@ -60,10 +64,10 @@ jobs: verify-out-of-tree-docs: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 with: name: 'release-tgz' @@ -74,8 +78,8 @@ jobs: mkdir build pushd build ../curl-99.98.97/configure --without-ssl --without-libpsl - make - make test-ci + make -j5 + make -j5 test-ci popd rm -rf build rm -rf curl-99.98.97 @@ -83,10 +87,10 @@ jobs: verify-out-of-tree-autotools-debug: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 with: name: 'release-tgz' @@ -97,17 +101,17 @@ jobs: mkdir build pushd build ../configure --without-ssl --enable-debug "--prefix=${PWD}/pkg" --without-libpsl - make -j3 - make -j3 test-ci - make -j3 install + make -j5 + make -j5 test-ci + make -j5 install name: 'verify out-of-tree autotools debug build' verify-out-of-tree-cmake: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 needs: maketgz-and-verify-in-tree steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 with: name: 'release-tgz' @@ -115,8 +119,38 @@ jobs: echo "::stop-commands::$(uuidgen)" tar xvf curl-99.98.97.tar.gz pushd curl-99.98.97 - mkdir build - pushd build - cmake .. - make + cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF + make -C build -j5 name: 'verify out-of-tree cmake build' + + missing-files: + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: maketgz-and-verify-in-tree + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 + with: + name: 'release-tgz' + + - name: 'detect files missing from release tarball' + run: .github/scripts/distfiles.sh curl-99.98.97.tar.gz + + reproducible-releases: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - run: sudo apt-get purge -y curl libcurl4 libcurl4-doc + name: 'remove preinstalled curl libcurl4{-doc}' + + - run: ./scripts/dmaketgz 9.10.11 + name: 'generate release tarballs' + + - name: 'verify release tarballs' + run: | + mkdir _verify + mv curl-9.10.11.tar.gz _verify + cd _verify + ../scripts/verify-release curl-9.10.11.tar.gz diff --git a/deps/curl/.github/workflows/fuzz.yml b/deps/curl/.github/workflows/fuzz.yml index 247a1c0a..fc647d88 100644 --- a/deps/curl/.github/workflows/fuzz.yml +++ b/deps/curl/.github/workflows/fuzz.yml @@ -4,7 +4,7 @@ name: Fuzzer -on: +'on': push: branches: - master @@ -12,9 +12,7 @@ on: paths-ignore: - '**/*.md' - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'CMake/**' - 'packages/**' @@ -28,9 +26,7 @@ on: paths-ignore: - '**/*.md' - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'CMake/**' - 'packages/**' diff --git a/deps/curl/.github/workflows/hacktoberfest-accepted.yml b/deps/curl/.github/workflows/hacktoberfest-accepted.yml index 3c4ecd87..2b8d0acb 100644 --- a/deps/curl/.github/workflows/hacktoberfest-accepted.yml +++ b/deps/curl/.github/workflows/hacktoberfest-accepted.yml @@ -4,7 +4,7 @@ name: Hacktoberfest -on: +'on': # this must not ever run on any other branch than master push: branches: @@ -26,7 +26,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 100 diff --git a/deps/curl/.github/workflows/http3-linux.yml b/deps/curl/.github/workflows/http3-linux.yml new file mode 100644 index 00000000..55d9766d --- /dev/null +++ b/deps/curl/.github/workflows/http3-linux.yml @@ -0,0 +1,537 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +name: Linux HTTP/3 + +'on': + push: + branches: + - master + - '*/ci' + paths-ignore: + - '**/*.md' + - '**/CMakeLists.txt' + - '.circleci/**' + - 'appveyor.*' + - 'CMake/**' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + - '**/CMakeLists.txt' + - '.circleci/**' + - 'appveyor.*' + - 'CMake/**' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + +concurrency: + # Hardcoded workflow filename as workflow name above is just Linux again + group: http3-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +env: + MAKEFLAGS: -j 5 + # handled in renovate.json + openssl-version: 3.4.0 + # handled in renovate.json + quictls-version: 3.3.0 + # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com + gnutls-version: 3.8.7 + wolfssl-version: master + # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com + nghttp3-version: 1.6.0 + # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com + ngtcp2-version: 1.8.1 + # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com + nghttp2-version: 1.64.0 + # renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com + quiche-version: 0.22.0 + +jobs: + setup: + runs-on: ubuntu-latest + outputs: + wolfssl-version: ${{ steps.wolfssl-version.outputs.result }} + + steps: + - id: wolfssl-version + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + with: + result-encoding: string + script: | + let version = '${{ env.wolfssl-version }}' + + if (version != 'master') { + return version + } + + let { data: commits } = await github.rest.repos.listCommits({ + owner: 'wolfSSL', + repo: 'wolfssl', + }) + + return commits[0].sha + + build-cache: + needs: + - setup + runs-on: ubuntu-latest + + steps: + - name: cache quictls + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-quictls-no-deprecated + env: + cache-name: cache-quictls-no-deprecated + with: + path: /home/runner/quictls/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }}-quic1 + + - name: cache gnutls + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-gnutls + env: + cache-name: cache-gnutls + with: + path: /home/runner/gnutls/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.gnutls-version }} + + - name: cache wolfssl + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-wolfssl + env: + cache-name: cache-wolfssl + wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }} + with: + path: /home/runner/wolfssl/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }} + + - name: cache nghttp3 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-nghttp3 + env: + cache-name: cache-nghttp3 + with: + path: /home/runner/nghttp3/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp3-version }} + + - name: cache ngtcp2 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-ngtcp2 + env: + cache-name: cache-ngtcp2 + with: + path: /home/runner/ngtcp2/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }} + + - name: cache nghttp2 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-nghttp2 + env: + cache-name: cache-nghttp2 + with: + path: /home/runner/nghttp2/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }} + + - id: settings + if: | + steps.cache-quictls-no-deprecated.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' || + steps.cache-ngtcp2.outputs.cache-hit != 'true' || + steps.cache-nghttp2.outputs.cache-hit != 'true' + run: | + echo 'needs-build=true' >> $GITHUB_OUTPUT + + - name: install build prereqs + if: steps.settings.outputs.needs-build == 'true' + run: | + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo apt-get update -y + sudo apt-get install -y --no-install-suggests --no-install-recommends \ + libtool autoconf automake pkgconf stunnel4 \ + libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \ + nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \ + libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \ + texinfo texlive texlive-extra-utils autopoint libev-dev \ + apache2 apache2-dev libnghttp2-dev + echo 'CC=gcc-12' >> $GITHUB_ENV + echo 'CXX=g++-12' >> $GITHUB_ENV + + - if: steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' + run: | + cd $HOME + git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }}-quic1 https://github.com/quictls/openssl quictls + cd quictls + ./config no-deprecated --prefix=$PWD/build --libdir=lib + make + make -j1 install_sw + name: 'build quictls' + + - if: steps.cache-gnutls.outputs.cache-hit != 'true' + run: | + cd $HOME + git clone --quiet --depth=1 -b ${{ env.gnutls-version }} https://github.com/gnutls/gnutls.git + cd gnutls + ./bootstrap + ./configure --disable-dependency-tracking --prefix=$PWD/build \ + LDFLAGS="-Wl,-rpath,$PWD/build/lib -L$PWD/build/lib" \ + --with-included-libtasn1 --with-included-unistring \ + --disable-guile --disable-doc --disable-tests --disable-tools + make + make install + name: 'build gnutls' + + - if: steps.cache-wolfssl.outputs.cache-hit != 'true' + env: + wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }} + run: | + cd $HOME + mkdir wolfssl + cd wolfssl + git init + git remote add origin https://github.com/wolfSSL/wolfssl.git + git fetch origin --depth=1 ${{ env.wolfssl-version }} + git checkout ${{ env.wolfssl-version }} + ./autogen.sh + ./configure --disable-dependency-tracking --enable-all --enable-quic --prefix=$PWD/build + make + make install + name: 'build wolfssl' + + - if: steps.cache-nghttp3.outputs.cache-hit != 'true' + run: | + cd $HOME + git clone --quiet --depth=1 -b v${{ env.nghttp3-version }} https://github.com/ngtcp2/nghttp3 + cd nghttp3 + git submodule update --init --depth=1 + autoreconf -fi + ./configure --disable-dependency-tracking --prefix=$PWD/build PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig" --enable-lib-only + make + make install + name: 'build nghttp3' + + - if: steps.cache-ngtcp2.outputs.cache-hit != 'true' + run: | + cd $HOME + git clone --quiet --depth=1 -b v${{ env.ngtcp2-version }} https://github.com/ngtcp2/ngtcp2 + cd ngtcp2 + autoreconf -fi + ./configure --disable-dependency-tracking --prefix=$PWD/build \ + PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig:$HOME/quictls/build/lib/pkgconfig:$HOME/gnutls/build/lib/pkgconfig:$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig" \ + --enable-lib-only --with-openssl --with-gnutls --with-wolfssl + make install + name: 'build ngtcp2' + + - if: steps.cache-nghttp2.outputs.cache-hit != 'true' + run: | + cd $HOME + git clone --quiet --depth=1 -b v${{ env.nghttp2-version }} https://github.com/nghttp2/nghttp2 + cd nghttp2 + autoreconf -fi + ./configure --disable-dependency-tracking --prefix=$PWD/build \ + PKG_CONFIG_PATH="$HOME/build/lib/pkgconfig:$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig" \ + LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib" \ + --enable-http3 + make install + name: 'build nghttp2' + + linux: + name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }} + needs: + - setup + - build-cache + runs-on: 'ubuntu-24.04' + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + build: + - name: quictls + PKG_CONFIG_PATH: '$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' + configure: >- + LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib" + --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm + --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" + --with-openssl=$HOME/quictls/build + + - name: gnutls + PKG_CONFIG_PATH: '$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' + configure: >- + LDFLAGS="-Wl,-rpath,$HOME/gnutls/build/lib" + --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug + --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" + --with-gnutls=$HOME/gnutls/build + + - name: wolfssl + PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' + configure: >- + LDFLAGS="-Wl,-rpath,$HOME/wolfssl/build/lib" + --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug + --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" + --with-wolfssl=$HOME/wolfssl/build + + - name: wolfssl + PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig' + generate: >- + -DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON -DENABLE_DEBUG=ON + -DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" + -DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" + + - name: openssl-quic + PKG_CONFIG_PATH: '$HOME/openssl/build/lib64/pkgconfig' + configure: >- + LDFLAGS="-Wl,-rpath,$HOME/openssl/build/lib64" + --enable-warnings --enable-werror --enable-debug --disable-ntlm + --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" + --with-openssl=$HOME/openssl/build --with-openssl-quic + --with-nghttp3=$HOME/nghttp3/build + + - name: quiche + configure: >- + LDFLAGS="-Wl,-rpath,$HOME/quiche/target/release" + --with-openssl=$HOME/quiche/quiche/deps/boringssl/src + --enable-warnings --enable-werror --enable-debug + --with-quiche=$HOME/quiche/target/release + --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx" + --with-ca-fallback + + - name: quiche + PKG_CONFIG_PATH: '$HOME/quiche/target/release' + generate: >- + -DOPENSSL_ROOT_DIR=$HOME/quiche/quiche/deps/boringssl/src -DENABLE_DEBUG=ON + -DUSE_QUICHE=ON + -DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" + -DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx" + -DCURL_CA_FALLBACK=ON + + steps: + - run: | + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo apt-get update -y + sudo apt-get install -y --no-install-suggests --no-install-recommends \ + libtool autoconf automake ninja-build pkgconf stunnel4 \ + libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \ + nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \ + libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \ + texinfo texlive texlive-extra-utils autopoint libev-dev \ + apache2 apache2-dev libnghttp2-dev vsftpd + echo 'CC=gcc-12' >> $GITHUB_ENV + echo 'CXX=g++-12' >> $GITHUB_ENV + name: 'install prereqs' + + - name: cache quictls + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-quictls-no-deprecated + env: + cache-name: cache-quictls-no-deprecated + with: + path: /home/runner/quictls/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }} + fail-on-cache-miss: true + + - name: cache gnutls + if: matrix.build.name == 'gnutls' + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-gnutls + env: + cache-name: cache-gnutls + with: + path: /home/runner/gnutls/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.gnutls-version }} + fail-on-cache-miss: true + + - name: cache wolfssl + if: matrix.build.name == 'wolfssl' + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-wolfssl + env: + cache-name: cache-wolfssl + wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }} + with: + path: /home/runner/wolfssl/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }} + fail-on-cache-miss: true + + - name: cache nghttp3 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-nghttp3 + env: + cache-name: cache-nghttp3 + with: + path: /home/runner/nghttp3/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp3-version }} + fail-on-cache-miss: true + + - name: cache ngtcp2 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-ngtcp2 + env: + cache-name: cache-ngtcp2 + with: + path: /home/runner/ngtcp2/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }} + fail-on-cache-miss: true + + - name: cache nghttp2 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-nghttp2 + env: + cache-name: cache-nghttp2 + with: + path: /home/runner/nghttp2/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }} + fail-on-cache-miss: true + + - name: cache openssl + if: matrix.build.name == 'openssl-quic' + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-openssl + env: + cache-name: cache-openssl + with: + path: /home/runner/openssl/build + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.openssl-version }} + + - name: 'install openssl' + if: matrix.build.name == 'openssl-quic' && steps.cache-openssl.outputs.cache-hit != 'true' + run: | + git clone --quiet --depth=1 -b openssl-${{ env.openssl-version }} https://github.com/openssl/openssl + cd openssl + ./config --prefix=$HOME/openssl/build + make -j1 install_sw + cat exporters/openssl.pc + + - name: cache quiche + if: matrix.build.name == 'quiche' + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-quiche + env: + cache-name: cache-quiche + with: + path: /home/runner/quiche + key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quiche-version }} + + - if: matrix.build.name == 'quiche' && steps.cache-quiche.outputs.cache-hit != 'true' + run: | + cd $HOME + git clone --quiet --depth=1 -b ${{ env.quiche-version }} --recursive https://github.com/cloudflare/quiche.git + cd quiche + #### Work-around https://github.com/curl/curl/issues/7927 ####### + #### See https://github.com/alexcrichton/cmake-rs/issues/131 #### + sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml + + 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 + ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/ + + # include dir + # $HOME/quiche/quiche/deps/boringssl/src/include + # lib dir + # $HOME/quiche/quiche/deps/boringssl/src/lib + name: 'build quiche and boringssl' + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - run: autoreconf -fi + if: ${{ matrix.build.configure }} + name: 'autoreconf' + + - name: 'configure' + run: | + if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then + export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}" + fi + if [ -n '${{ matrix.build.generate }}' ]; then + cmake -B . -G Ninja \ + -DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ + -DCURL_BROTLI=ON -DCURL_ZSTD=ON \ + ${{ matrix.build.generate }} + else + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + ${{ matrix.build.configure }} + fi + + - name: 'configure log' + if: ${{ !cancelled() }} + run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true + + - name: 'curl_config.h' + run: | + echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' lib/curl_config.h | sort || true + + - name: 'test configs' + run: | + cat tests/config || true + cat tests/http/config.ini || true + + - name: 'build' + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose + else + make V=1 + fi + + - run: ./src/curl -V + name: 'check curl -V output' + + - name: 'build tests' + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target testdeps + else + make V=1 -C tests + fi + + - name: 'install test prereqs' + run: | + sudo python3 -m pip install --break-system-packages -r tests/requirements.txt + + - name: 'run tests' + env: + TFLAGS: "${{ matrix.build.tflags }}" + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target test-ci + else + make V=1 test-ci + fi + + - name: 'install pytest prereqs' + run: | + sudo python3 -m pip install --break-system-packages -r tests/http/requirements.txt + + - name: 'run pytest' + env: + TFLAGS: "${{ matrix.build.tflags }}" + CURL_CI: github + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target curl-pytest-ci + else + make V=1 pytest-ci + fi + + - name: 'build examples' + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target curl-examples + else + make V=1 examples + fi diff --git a/deps/curl/.github/workflows/label.yml b/deps/curl/.github/workflows/label.yml index b874c31b..eb74b5c0 100644 --- a/deps/curl/.github/workflows/label.yml +++ b/deps/curl/.github/workflows/label.yml @@ -10,7 +10,7 @@ # https://github.com/actions/labeler name: Labeler -on: [pull_request_target] +'on': [pull_request_target] jobs: label: @@ -21,6 +21,6 @@ jobs: pull-requests: write steps: - - uses: actions/labeler@v5 + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/deps/curl/.github/workflows/linkcheck.yml b/deps/curl/.github/workflows/linkcheck.yml deleted file mode 100644 index ba92efab..00000000 --- a/deps/curl/.github/workflows/linkcheck.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: Markdown links - -on: - push: - branches: - - master - - '*/ci' - paths: - - '.github/workflows/linkcheck.yml' - - '**.md' - pull_request: - branches: - - master - paths: - - '.github/workflows/linkcheck.yml' - - '**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -jobs: - # Docs: https://github.com/marketplace/actions/markdown-link-check - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - name: checkout - - - name: trim the cmdline docs markdown files - run: find docs/cmdline-opts -name "*.md" ! -name "_*" ! -name MANPAGE.md | xargs -n1 ./.github/scripts/cleancmd.pl - - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: 'yes' diff --git a/deps/curl/.github/workflows/linux-old.yml b/deps/curl/.github/workflows/linux-old.yml new file mode 100644 index 00000000..830e0a09 --- /dev/null +++ b/deps/curl/.github/workflows/linux-old.yml @@ -0,0 +1,144 @@ +# Copyright (C) Daniel Fandrich, , et al. +# +# SPDX-License-Identifier: curl +# +# Compile on an old version of Linux that has barely the minimal build +# requirements for CMake. This tests that curl is still usable on really +# outdated systems. +# +# Debian stretch is chosen as it closely matches some of the oldest major +# versions we support (especially cmake); see docs/INTERNALS.md and it +# 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 +# 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. + +name: Old Linux + +'on': + push: + branches: + - master + - '*/ci' + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + +permissions: {} + +env: + MAKEFLAGS: -j 5 + DEBIAN_FRONTEND: noninteractive + +jobs: + cmake: + name: linux (cmake & autoconf) + runs-on: 'ubuntu-latest' + container: 'debian:stretch' + + steps: + - name: 'install prereqs' + # Remember, this shell is dash, not bash + run: | + sed -E -i -e s@[a-z]+\.debian\.org/@archive.debian.org/debian-archive/@ -e '/ stretch-updates /d' /etc/apt/sources.list + apt-get update + # See comment above if this fails after 2025-05-20 + apt-get install -y --no-install-suggests --no-install-recommends httrack + httrack --get https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb + 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 update + apt-get install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libssl1.0-dev libssh-dev libssh2-1-dev libc-ares-dev heimdal-dev libldap2-dev librtmp-dev stunnel4 groff + # GitHub's actions/checkout needs a newer glibc. This one is the + # latest available for buster, the next stable release after stretch. + httrack --get https://security.debian.org/debian-security/pool/updates/main/g/glibc/libc6_2.28-10+deb10u4_amd64.deb + dpkg -i libc6_*_amd64.deb + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: 'cmake build-only (out-of-tree, libssh2)' + run: | + mkdir bld-1 + cd bld-1 + cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ + -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON + make install + src/curl --disable --version + + - name: 'cmake 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 + + - name: 'cmake generate (out-of-tree, c-ares, libssh, zstd, gssapi)' + run: | + mkdir bld-cares + cd bld-cares + cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ + -DENABLE_ARES=ON -DCURL_ZSTD=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_LIBRTMP=ON \ + -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON + + - name: 'cmake 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' + run: | + make -C bld-cares + bld-cares/src/curl --disable --version + + - name: 'cmake install' + run: make -C bld-cares install + + - name: 'cmake build tests' + run: make -C bld-cares testdeps + + - name: 'cmake run tests' + run: make -C bld-cares test-ci + + - name: 'autoreconf' + run: autoreconf -if + + - name: 'configure (out-of-tree, libssh2)' + run: | + mkdir bld-am + cd bld-am + ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + --with-openssl --enable-ares --with-libssh --with-zstd --with-gssapi --with-librtmp \ + --prefix="$PWD"/../install-am + + - name: 'autoconf 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: 'autoconf build' + run: | + make -C bld-am + bld-am/src/curl --disable --version + + - name: 'autoconf install' + run: make -C bld-am install + + - name: 'autoconf build tests' + run: make -C bld-am/tests all diff --git a/deps/curl/.github/workflows/linux.yml b/deps/curl/.github/workflows/linux.yml index 3d447a87..de526058 100644 --- a/deps/curl/.github/workflows/linux.yml +++ b/deps/curl/.github/workflows/linux.yml @@ -4,16 +4,14 @@ name: Linux -on: +'on': push: branches: - master - '*/ci' paths-ignore: - '**/*.md' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'packages/**' - 'plan9/**' @@ -24,9 +22,7 @@ on: - master paths-ignore: - '**/*.md' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'packages/**' - 'plan9/**' @@ -40,137 +36,236 @@ concurrency: permissions: {} env: - MAKEFLAGS: -j 3 + MAKEFLAGS: -j 5 + # unhandled bearssl-version: 0.6 - libressl-version: v3.7.3 - mbedtls-version: v3.5.0 - mod_h2-version: v2.0.26 - msh3-version: v0.6.0 - openssl3-version: openssl-3.1.3 - quictls-version: 3.1.4+quic - rustls-version: v0.12.0 + # renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com + libressl-version: 4.0.0 + # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?.+)-stable$ registryUrl=https://github.com + wolfssl-version: 5.7.4 + # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com + mbedtls-version: 3.6.2 + # renovate: datasource=github-tags depName=nibanks/msh3 versioning=semver registryUrl=https://github.com + msh3-version: 0.6.0 + # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com + awslc-version: 1.37.0 + # handled in renovate.json + openssl-version: 3.4.0 + # handled in renovate.json + quictls-version: 3.3.0 + # renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com + rustls-version: 0.14.0 jobs: - autotools: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-latest' + linux: + name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }} + runs-on: 'ubuntu-24.04' container: ${{ matrix.build.container }} - timeout-minutes: 90 + timeout-minutes: 45 strategy: fail-fast: false matrix: build: - name: bearssl - install_packages: zlib1g-dev valgrind + install_packages: zlib1g-dev install_steps: bearssl pytest configure: LDFLAGS="-Wl,-rpath,$HOME/bearssl/lib" --with-bearssl=$HOME/bearssl --enable-debug - singleuse: --unit - - name: bearssl-clang + - name: bearssl clang install_packages: zlib1g-dev clang install_steps: bearssl configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/bearssl/lib" --with-bearssl=$HOME/bearssl --enable-debug - singleuse: --unit - - name: libressl - install_packages: zlib1g-dev valgrind + - name: libressl heimdal + install_packages: zlib1g-dev heimdal-dev install_steps: libressl pytest - configure: LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --enable-debug - singleuse: --unit + configure: LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --with-gssapi --enable-debug - - name: libressl-clang + - name: libressl heimdal valgrind + install_packages: zlib1g-dev heimdal-dev valgrind + install_steps: libressl pytest + generate: -DOPENSSL_ROOT_DIR=$HOME/libressl -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON + + - name: libressl clang install_packages: zlib1g-dev clang install_steps: libressl configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --enable-debug - singleuse: --unit - - name: mbedtls + - name: wolfssl-all + install_packages: zlib1g-dev + install_steps: wolfssl-all + configure: LDFLAGS="-Wl,-rpath,$HOME/wolfssl-all/lib" --with-wolfssl=$HOME/wolfssl-all --enable-debug + + - name: wolfssl-opensslextra valgrind + install_packages: zlib1g-dev valgrind + install_steps: wolfssl-opensslextra + configure: LDFLAGS="-Wl,-rpath,$HOME/wolfssl-opensslextra/lib" --with-wolfssl=$HOME/wolfssl-opensslextra --enable-debug + + - name: mbedtls valgrind install_packages: libnghttp2-dev valgrind install_steps: mbedtls pytest configure: LDFLAGS="-Wl,-rpath,$HOME/mbedtls/lib" --with-mbedtls=$HOME/mbedtls --enable-debug - singleuse: --unit - - name: mbedtls-clang + - name: mbedtls clang install_packages: libnghttp2-dev clang install_steps: mbedtls configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/mbedtls/lib" --with-mbedtls=$HOME/mbedtls --enable-debug - singleuse: --unit + + - name: mbedtls + install_packages: libnghttp2-dev + install_steps: mbedtls + PKG_CONFIG_PATH: '$HOME/mbedtls/lib/pkgconfig' # Requires v3.6.0 or v2.28.8 + generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON + + - name: mbedtls-pkg + install_packages: libnghttp2-dev libmbedtls-dev + generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON + + - name: mbedtls-pkg !pc + install_packages: libnghttp2-dev libmbedtls-dev + install_steps: skipall + generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DCURL_USE_PKGCONFIG=OFF - name: msh3 - install_packages: zlib1g-dev valgrind + install_packages: zlib1g-dev install_steps: quictls msh3 configure: LDFLAGS="-Wl,-rpath,$HOME/msh3/lib -Wl,-rpath,$HOME/quictls/lib" --with-msh3=$HOME/msh3 --with-openssl=$HOME/quictls --enable-debug - singleuse: --unit - - name: openssl3 + - name: msh3 + install_packages: zlib1g-dev + install_steps: quictls msh3 skipall + PKG_CONFIG_PATH: '$HOME/msh3/lib/pkgconfig' # Broken as of v0.6.0 + generate: -DOPENSSL_ROOT_DIR=$HOME/quictls -DUSE_MSH3=ON -DMSH3_INCLUDE_DIR=$HOME/msh3/include -DMSH3_LIBRARY=$HOME/msh3/lib/libmsh3.so -DENABLE_DEBUG=ON + + - name: awslc + install_packages: zlib1g-dev + install_steps: awslc + configure: LDFLAGS="-Wl,-rpath,$HOME/awslc/lib" --with-openssl=$HOME/awslc + + - name: awslc + install_packages: zlib1g-dev + install_steps: awslc + generate: -DOPENSSL_ROOT_DIR=$HOME/awslc -DCMAKE_UNITY_BUILD=OFF + + - name: openssl default + install_steps: pytest + configure: --with-openssl --enable-debug --disable-unity + + - name: openssl libssh2 sync-resolver valgrind + install_packages: zlib1g-dev libssh2-1-dev valgrind + install_steps: pytest + configure: --with-openssl --enable-debug --disable-threaded-resolver --with-libssh2 + + - name: openssl + install_packages: zlib1g-dev + install_steps: pytest + configure: CFLAGS=-std=gnu89 --with-openssl --enable-debug + + - name: openssl -O3 valgrind install_packages: zlib1g-dev valgrind - install_steps: gcc-11 openssl3 pytest - configure: CFLAGS=-std=gnu89 LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets - singleuse: --unit + configure: CPPFLAGS=-DCURL_WARN_SIGN_CONVERSION CFLAGS=-O3 --with-openssl --enable-debug - - name: openssl3-O3 - install_packages: zlib1g-dev valgrind - install_steps: gcc-11 openssl3 - configure: CPPFLAGS=-DCURL_WARN_SIGN_CONVERSION CFLAGS=-O3 LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets - singleuse: --unit + - name: openssl clang krb5 + install_packages: zlib1g-dev libkrb5-dev clang + configure: CC=clang --with-openssl --with-gssapi --enable-debug - - name: openssl3-clang - install_packages: zlib1g-dev clang - install_steps: openssl3 - configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets - singleuse: --unit + - name: openssl clang krb5 + install_packages: zlib1g-dev libkrb5-dev clang + install_steps: skipall + generate: -DCURL_USE_OPENSSL=ON -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON + + - name: openssl !ipv6 + configure: --with-openssl --disable-ipv6 --enable-debug --disable-unity + + - name: openssl https-only + configure: >- + --with-openssl --enable-debug --disable-unity + --disable-dict --disable-gopher --disable-ldap --disable-telnet + --disable-imap --disable-pop3 --disable-smtp + --disable-rtmp --disable-rtsp + --disable-scp --disable-sftp --disable-tftp --disable-ftp --disable-file --disable-smb + + - name: openssl torture !FTP + install_packages: zlib1g-dev libnghttp2-dev libssh2-1-dev libc-ares-dev + generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON + tflags: -t --shallow=25 !FTP + torture: true + + - name: openssl torture FTP + install_packages: zlib1g-dev libnghttp2-dev libssh2-1-dev libc-ares-dev + generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON + tflags: -t --shallow=20 FTP + torture: true + + - name: openssl i686 + install_packages: gcc-14-i686-linux-gnu libssl-dev:i386 librtmp-dev:i386 libssh2-1-dev:i386 libidn2-0-dev:i386 libc-ares-dev:i386 zlib1g-dev:i386 + configure: >- + PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig + CC=i686-linux-gnu-gcc-14 + CPPFLAGS=-I/usr/include/i386-linux-gnu + LDFLAGS=-L/usr/lib/i386-linux-gnu + --host=i686-linux-gnu + --with-openssl --with-librtmp --with-libssh2 --with-libidn2 --enable-ares --enable-debug + + - name: '!ssl !http !smtp !imap' + configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity + + - name: scanbuild + install_packages: clang-tools clang libssl-dev libssh2-1-dev + install_steps: skipall + configure: --with-openssl --enable-debug --with-libssh2 --disable-unity + configure-prefix: CC=clang scan-build + make-prefix: scan-build --status-bugs - name: address-sanitizer install_packages: zlib1g-dev libssh2-1-dev clang libssl-dev libubsan1 libasan8 libtsan2 install_steps: pytest - configure: > + configure: >- CC=clang CFLAGS="-fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined,integer" LIBS="-ldl -lubsan" - --with-openssl --enable-debug --enable-websockets - singleuse: --unit + --with-openssl --enable-debug + + - name: thread-sanitizer + install_packages: zlib1g-dev clang libtsan2 + install_steps: pytest openssl-tsan + configure: >- + CC=clang + CFLAGS="-fsanitize=thread -g" + LDFLAGS="-fsanitize=thread -Wl,-rpath,$HOME/openssl/lib" + --with-openssl=$HOME/openssl --enable-debug - name: memory-sanitizer install_packages: clang - install_steps: - configure: > + configure: >- CC=clang CFLAGS="-fsanitize=memory -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=memory" LIBS="-ldl" - --without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug --enable-websocketsx - singleuse: --unit + --without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug - name: event-based - install_packages: libssh-dev valgrind + install_packages: libssh-dev configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl tflags: -n -e '!TLS-SRP' - singleuse: --unit - - name: hyper - install_steps: rust hyper valgrind - configure: LDFLAGS="-Wl,-rpath,$HOME/hyper/target/debug" --with-openssl --with-hyper=$HOME/hyper --enable-debug --enable-websockets - singleuse: --unit + - name: rustls valgrind + install_packages: valgrind + install_steps: rust rustls pytest + configure: --with-rustls=$HOME/rustls --enable-debug - name: rustls - install_steps: rust rustls pytest valgrind libpsl-dev - configure: --with-rustls=$HOME/rustls --enable-debug - singleuse: --unit + install_steps: rust rustls skipall + PKG_CONFIG_PATH: '$HOME/rustls/lib/pkgconfig' # Not built as of v0.14.0 + generate: -DCURL_USE_RUSTLS=ON -DRUSTLS_INCLUDE_DIR=$HOME/rustls/include -DRUSTLS_LIBRARY=$HOME/rustls/lib/librustls.a -DENABLE_DEBUG=ON - - name: Intel compiler - without SSL - install_packages: zlib1g-dev valgrind - install_steps: intel - configure: CC=icc --enable-debug --without-ssl - singleuse: --unit - - - name: Intel compiler - OpenSSL - install_packages: zlib1g-dev libssl-dev valgrind + - name: IntelC openssl + install_packages: zlib1g-dev libssl-dev install_steps: intel configure: CC=icc --enable-debug --with-openssl - singleuse: --unit - - name: Slackware-openssl-with-gssapi-gcc + - name: Slackware openssl gssapi gcc # These are essentially the same flags used to build the curl Slackware package # https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild configure: --with-openssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs @@ -178,44 +273,64 @@ jobs: container: 'andy5995/slackware-build-essential:15.0' - name: Alpine MUSL - configure: --enable-debug --enable-websockets --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl + configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl container: 'alpine:3.18' - singleuse: --unit steps: - - if: matrix.build.container == null + - if: matrix.build.container == null && !contains(matrix.build.name, 'i686') run: | - sudo apt-get update - sudo apt-get install libtool autoconf automake pkg-config stunnel4 libpsl-dev libbrotli-dev libzstd-dev ${{ matrix.build.install_packages }} - sudo python3 -m pip install impacket - name: 'install prereqs and impacket' + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo apt-get update -y + sudo apt-get install -y --no-install-suggests --no-install-recommends \ + libtool autoconf automake pkgconf ninja-build stunnel4 \ + libpsl-dev libbrotli-dev libzstd-dev \ + ${{ matrix.build.install_packages }} + name: 'install prereqs' + + - if: contains(matrix.build.name, 'i686') + run: | + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo dpkg --add-architecture i386 + sudo apt-get update -y + sudo apt-get install -y --no-install-suggests --no-install-recommends \ + libtool autoconf automake pkgconf stunnel4 \ + libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 \ + ${{ matrix.build.install_packages }} + name: 'install prereqs' + + - if: contains(matrix.build.install_steps, 'pytest') + run: | + sudo apt-get install -y --no-install-suggests --no-install-recommends \ + apache2 apache2-dev libnghttp2-dev vsftpd + name: 'install prereqs for pytest' - if: startsWith(matrix.build.container, 'alpine') run: | - apk add --no-cache build-base autoconf automake libtool perl openssl-dev libssh2-dev zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev heimdal-dev libpsl-dev py3-impacket py3-asn1 py3-six py3-pycryptodomex perl-time-hires openssh stunnel sudo git + apk add --no-cache build-base autoconf automake libtool perl openssl-dev libssh2-dev \ + zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev heimdal-dev libpsl-dev \ + py3-impacket py3-asn1 py3-six py3-pycryptodomex \ + perl-time-hires openssh stunnel sudo git name: 'install dependencies' - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - if: contains(matrix.build.install_steps, 'gcc-11') - run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa - sudo apt-get update - sudo apt-get install gcc-11 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 - sudo update-alternatives --set gcc /usr/bin/gcc-11 - gcc --version - name: 'install gcc-11' + - name: 'Fix kernel mmap rnd bits' + # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with + # high-entropy ASLR in much newer kernels that GitHub runners are + # using leading to random crashes: https://reviews.llvm.org/D148280 + # See https://github.com/actions/runner-images/issues/9491 + continue-on-error: true + run: sudo sysctl vm.mmap_rnd_bits=28 - - name: cache bearssl + - name: 'cache bearssl' if: contains(matrix.build.install_steps, 'bearssl') - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 id: cache-bearssl env: cache-name: cache-bearssl with: path: /home/runner/bearssl - key: ${{ runner.os }}-build-${{ env.cache-name }}-bearssl-${{ env.bearssl-version }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.bearssl-version }} - name: 'build bearssl' if: contains(matrix.build.install_steps, 'bearssl') && steps.cache-bearssl.outputs.cache-hit != 'true' @@ -228,131 +343,188 @@ jobs: cp inc/*.h $HOME/bearssl/include cp build/libbearssl.* $HOME/bearssl/lib - - name: cache libressl + - name: 'cache libressl' if: contains(matrix.build.install_steps, 'libressl') - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 id: cache-libressl env: cache-name: cache-libressl with: path: /home/runner/libressl - key: ${{ runner.os }}-build-${{ env.cache-name }}-libressl-${{ env.libressl-version }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.libressl-version }} - name: 'build libressl' if: contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true' run: | - git clone --quiet --depth=1 -b ${{ env.libressl-version }} https://github.com/libressl-portable/portable.git libressl-git + git clone --quiet --depth=1 -b v${{ env.libressl-version }} https://github.com/libressl-portable/portable.git libressl-git cd libressl-git ./autogen.sh - ./configure --prefix=$HOME/libressl + ./configure --disable-dependency-tracking --prefix=$HOME/libressl make install - - name: cache mbedtls + - name: 'cache wolfssl (all)' + if: contains(matrix.build.install_steps, 'wolfssl-all') + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-wolfssl-all + env: + cache-name: cache-wolfssl-all + with: + path: /home/runner/wolfssl-all + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }} + + - name: 'build wolfssl (all)' + if: contains(matrix.build.install_steps, 'wolfssl-all') && steps.cache-wolfssl-all.outputs.cache-hit != 'true' + run: | + curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v${{ env.wolfssl-version }}-stable.tar.gz + tar -xzf v${{ env.wolfssl-version }}-stable.tar.gz + cd wolfssl-${{ env.wolfssl-version }}-stable + ./autogen.sh + ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --prefix=$HOME/wolfssl-all --enable-all + make install + + - name: 'cache wolfssl (opensslextra)' + if: contains(matrix.build.install_steps, 'wolfssl-opensslextra') + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-wolfssl-opensslextra + env: + cache-name: cache-wolfssl-opensslextra + with: + path: /home/runner/wolfssl-opensslextra + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }} + + - name: 'build wolfssl (opensslextra)' + if: contains(matrix.build.install_steps, 'wolfssl-opensslextra') && steps.cache-wolfssl-opensslextra.outputs.cache-hit != 'true' + run: | + curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v${{ env.wolfssl-version }}-stable.tar.gz + tar -xzf v${{ env.wolfssl-version }}-stable.tar.gz + cd wolfssl-${{ env.wolfssl-version }}-stable + ./autogen.sh + ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --prefix=$HOME/wolfssl-opensslextra --enable-opensslextra + make install + + - name: 'cache mbedtls' if: contains(matrix.build.install_steps, 'mbedtls') - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 id: cache-mbedtls env: cache-name: cache-mbedtls with: path: /home/runner/mbedtls - key: ${{ runner.os }}-build-${{ env.cache-name }}-mbedtls-${{ env.mbedtls-version }} + 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' run: | - git clone --quiet --depth=1 -b ${{ env.mbedtls-version }} https://github.com/ARMmbed/mbedtls + git clone --quiet --depth=1 -b v${{ env.mbedtls-version }} https://github.com/Mbed-TLS/mbedtls cd mbedtls - make DESTDIR=$HOME/mbedtls install + git submodule update --init --depth=1 + cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=$HOME/mbedtls \ + -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF + cmake --build . + cmake --install . - - name: cache openssl3 - if: contains(matrix.build.install_steps, 'openssl3') - uses: actions/cache@v4 - id: cache-openssl3 + - name: 'cache openssl (thread sanitizer)' + if: contains(matrix.build.install_steps, 'openssl-tsan') + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-openssl-tsan env: - cache-name: cache-openssl3 + cache-name: cache-openssl-tsan with: - path: /home/runner/openssl3 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.openssl3-version }} + path: /home/runner/openssl + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.openssl-version }} - - name: 'install openssl3' - if: contains(matrix.build.install_steps, 'openssl3') && steps.cache-openssl3.outputs.cache-hit != 'true' + - 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 ${{ env.openssl3-version }} https://github.com/openssl/openssl + git clone --quiet --depth=1 -b openssl-${{ env.openssl-version }} https://github.com/openssl/openssl cd openssl - ./config --prefix=$HOME/openssl3 --libdir=$HOME/openssl3/lib + CC="clang" CFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread" ./config --prefix=$HOME/openssl --libdir=lib make -j1 install_sw - - name: cache quictls + - name: 'cache quictls' if: contains(matrix.build.install_steps, 'quictls') - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 id: cache-quictls env: cache-name: cache-quictls with: path: /home/runner/quictls - key: ${{ runner.os }}-build-${{ env.cache-name }}-quictls-${{ env.quictls-version }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.quictls-version }}-quic1 - name: 'build quictls' if: contains(matrix.build.install_steps, 'quictls') && steps.cache-quictls.outputs.cache-hit != 'true' run: | - git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }} https://github.com/quictls/openssl + git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }}-quic1 https://github.com/quictls/openssl cd openssl - ./config --prefix=$HOME/quictls --libdir=$HOME/quictls/lib + ./config --prefix=$HOME/quictls --libdir=lib make -j1 install_sw - - name: cache msh3 + - name: 'cache msh3' if: contains(matrix.build.install_steps, 'msh3') - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 id: cache-msh3 env: cache-name: cache-msh3 with: path: /home/runner/msh3 - key: ${{ runner.os }}-build-${{ env.cache-name }}-msh3-${{ env.msh3-version }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.msh3-version }} - name: 'build msh3' if: contains(matrix.build.install_steps, 'msh3') && steps.cache-msh3.outputs.cache-hit != 'true' run: | - git clone --quiet -b ${{ env.msh3-version }} --depth=1 --recursive https://github.com/nibanks/msh3 - cd msh3 && mkdir build && cd build - cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/msh3 .. + git clone --quiet --depth=1 -b v${{ env.msh3-version }} --recursive https://github.com/nibanks/msh3 + cd msh3 + cmake -B . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/msh3 cmake --build . cmake --install . - - if: contains(matrix.build.install_steps, 'rust') - run: | - cd $HOME - curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y - source $HOME/.cargo/env - rustup toolchain install nightly - name: 'install rust' + - name: 'cache awslc' + if: contains(matrix.build.install_steps, 'awslc') + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-awslc + env: + cache-name: cache-awslc + with: + path: /home/runner/awslc + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.awslc-version }} - - name: cache rustls + - name: 'build awslc' + if: contains(matrix.build.install_steps, 'awslc') && steps.cache-awslc.outputs.cache-hit != 'true' + run: | + curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \ + https://github.com/awslabs/aws-lc/archive/refs/tags/v${{ env.awslc-version }}.tar.gz + tar xzf v${{ env.awslc-version }}.tar.gz + mkdir aws-lc-${{ env.awslc-version }}-build + cd aws-lc-${{ env.awslc-version }}-build + cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/awslc ../aws-lc-${{ env.awslc-version }} + cmake --build . + cmake --install . + + - name: 'cache rustls' if: contains(matrix.build.install_steps, 'rustls') - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 id: cache-rustls env: cache-name: cache-rustls with: path: /home/runner/rustls - key: ${{ runner.os }}-build-${{ env.cache-name }}-rustls-${{ env.rustls-version }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.rustls-version }} + + - name: 'install rust' + if: contains(matrix.build.install_steps, 'rust') && steps.cache-rustls.outputs.cache-hit != 'true' + run: | + cd $HOME + curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y + source $HOME/.cargo/env + rustup toolchain install nightly - name: 'build rustls' if: contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true' run: | - git clone --quiet --depth=1 -b ${{ env.rustls-version }} --recursive https://github.com/rustls/rustls-ffi.git + git clone --quiet --depth=1 -b v${{ env.rustls-version }} --recursive https://github.com/rustls/rustls-ffi.git cd rustls-ffi make DESTDIR=$HOME/rustls install - - if: contains(matrix.build.install_steps, 'hyper') - run: | - cd $HOME - git clone --quiet --depth=1 https://github.com/hyperium/hyper.git - cd $HOME/hyper - RUSTFLAGS="--cfg hyper_unstable_ffi" cargo +nightly rustc --features client,http1,http2,ffi -Z unstable-options --crate-type cdylib - echo "LD_LIBRARY_PATH=$HOME/hyper/target/debug:/usr/local/lib" >> $GITHUB_ENV - name: 'install hyper' - - if: contains(matrix.build.install_steps, 'intel') run: | cd /tmp @@ -363,72 +535,122 @@ jobs: printenv >> $GITHUB_ENV name: 'install Intel compilers' - - if: contains(matrix.build.install_steps, 'pytest') - run: | - sudo apt-get install apache2 apache2-dev libnghttp2-dev - sudo python3 -m pip install -r tests/http/requirements.txt - name: 'install pytest and apach2-dev' - - - name: cache mod_h2 - if: contains(matrix.build.install_steps, 'pytest') - uses: actions/cache@v4 - id: cache-mod_h2 - env: - cache-name: cache-mod_h2 - with: - path: /home/runner/mod_h2 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mod_h2-version }} - - - name: 'build mod_h2' - if: contains(matrix.build.install_steps, 'pytest') && steps.cache-mod_h2.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.mod_h2-version }} https://github.com/icing/mod_h2 - cd mod_h2 - autoreconf -fi - ./configure - make - - - name: 'install mod_h2' - if: contains(matrix.build.install_steps, 'pytest') - run: | - cd $HOME/mod_h2 - sudo make install - - run: autoreconf -fi + if: ${{ matrix.build.configure }} name: 'autoreconf' - - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} - name: 'configure' + - name: 'configure' + run: | + [[ '${{ matrix.build.install_steps }}' = *'awslc'* ]] && sudo apt remove --yes libssl-dev + if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then + export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}" + fi + if [ -n '${{ matrix.build.generate }}' ]; then + cmake -B . -G Ninja \ + -DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ + -DCURL_BROTLI=ON -DCURL_ZSTD=ON \ + ${{ matrix.build.generate }} + else + ${{ matrix.build.configure-prefix }} \ + ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + ${{ matrix.build.configure }} + fi - - run: make V=1 - name: 'make' + - name: 'configure log' + if: ${{ !cancelled() }} + run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true - - run: | + - name: 'curl_config.h' + run: | + echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' lib/curl_config.h | sort || true + + - name: 'test configs' + run: | + cat tests/config || true + cat tests/http/config.ini || true + + - name: 'build' + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + ${{ matrix.build.make-prefix }} cmake --build . --verbose + else + ${{ matrix.build.make-prefix }} make V=1 + fi + + - name: 'single-use function check' + if: ${{ contains(matrix.build.configure, '--disable-unity') || contains(matrix.build.generate, '-DCMAKE_UNITY_BUILD=OFF') }} + run: | git config --global --add safe.directory "*" - ./scripts/singleuse.pl ${{ matrix.build.singleuse }} lib/.libs/libcurl.a - name: single-use function check + if [ -n '${{ matrix.build.generate }}' ]; then + libcurla=lib/libcurl.a + else + libcurla=lib/.libs/libcurl.a + fi + ./scripts/singleuse.pl --unit ${libcurla} - run: ./src/curl -V name: 'check curl -V output' - - run: make V=1 examples - name: 'make examples' + - run: cmake --install . --prefix $HOME/curl --strip + if: ${{ matrix.build.generate }} + name: 'cmake install' - - run: make V=1 -C tests - name: 'make tests' + - name: 'build tests' + if: ${{ matrix.build.install_steps != 'skipall' }} + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target testdeps + else + make V=1 -C tests + fi - - run: make V=1 test-ci - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }}" + - name: 'install test prereqs' + if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.container == null }} + run: | + sudo python3 -m pip install --break-system-packages -r tests/requirements.txt - - if: contains(matrix.build.install_steps, 'pytest') - # run for `tests` directory, so pytest does not pick up any other - # packages we might have built here - run: - pytest -v tests - name: 'run pytest' + - name: 'run tests' + if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' }} + timeout-minutes: ${{ contains(matrix.build.install_packages, 'valgrind') && 30 || 15 }} + run: | + export TFLAGS='${{ matrix.build.tflags }}' + if [ -z '${{ matrix.build.torture }}' ]; then + if [[ '${{ matrix.build.install_packages }}' = *'valgrind'* ]]; then + TFLAGS+=' -j6' + fi + if [[ '${{ matrix.build.install_packages }}' = *'heimdal-dev'* ]]; then + TFLAGS+=' ~2077 ~2078' # valgrind errors + fi + fi + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} + else + make V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} + fi + + - name: 'install pytest prereqs' + if: contains(matrix.build.install_steps, 'pytest') + run: | + sudo python3 -m pip install --break-system-packages -r tests/http/requirements.txt + + - name: 'run pytest' + if: contains(matrix.build.install_steps, 'pytest') env: TFLAGS: "${{ matrix.build.tflags }}" CURL_CI: github + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build . --verbose --target curl-pytest-ci + else + make V=1 pytest-ci + fi + + - name: 'build examples' + run: | + if [ -n '${{ matrix.build.generate }}' ]; then + ${{ matrix.build.make-prefix }} cmake --build . --verbose --target curl-examples + else + ${{ matrix.build.make-prefix }} make V=1 examples + fi diff --git a/deps/curl/.github/workflows/linux32.yml b/deps/curl/.github/workflows/linux32.yml deleted file mode 100644 index e3fca3d1..00000000 --- a/deps/curl/.github/workflows/linux32.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) Dan Fandrich -# -# SPDX-License-Identifier: curl - -name: Linux 32-bit - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - -jobs: - linux-i686: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-22.04' - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - build: - - name: Linux i686 - install_packages: gcc-11-i686-linux-gnu libssl-dev:i386 zlib1g-dev:i386 libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 - configure: --enable-debug --enable-websockets --with-openssl --host=i686-linux-gnu CC=i686-linux-gnu-gcc-11 PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig CPPFLAGS=-I/usr/include/i386-linux-gnu LDFLAGS=-L/usr/lib/i386-linux-gnu - - steps: - - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -y - sudo apt-get install -y --no-install-suggests --no-install-recommends libtool autoconf automake pkg-config stunnel4 ${{ matrix.build.install_packages }} - sudo python3 -m pip install impacket - name: 'install prereqs' - - - uses: actions/checkout@v4 - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} - name: 'configure' - - - run: make V=1 - name: 'make' - - - run: ./src/curl -V - name: 'check curl -V output' - - - run: make V=1 examples - name: 'make examples' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-ci - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }}" diff --git a/deps/curl/.github/workflows/macos.yml b/deps/curl/.github/workflows/macos.yml index 2f2d7539..4f981d67 100644 --- a/deps/curl/.github/workflows/macos.yml +++ b/deps/curl/.github/workflows/macos.yml @@ -4,16 +4,14 @@ name: macOS -on: +'on': push: branches: - master - '*/ci' paths-ignore: - '**/*.md' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'packages/**' - 'plan9/**' @@ -24,9 +22,7 @@ on: - master paths-ignore: - '**/*.md' - - '.azure-pipelines.yml' - '.circleci/**' - - '.cirrus.yml' - 'appveyor.*' - 'packages/**' - 'plan9/**' @@ -39,205 +35,556 @@ concurrency: permissions: {} +# Deprecated Apple APIs and the macos-version-min value required to avoid +# deprecation warnings with llvm/clang: +# +# - 10.7 Lion (2011) - GSS +# - 10.8 Mountain Lion (2012) - CFURLCreateDataAndPropertiesFromResource (used by curl Secure Transport code) +# - 10.9 Maverick (2013) - LDAP +# - 10.14 Mojave (2018) - Secure Transport +# +# For Secure Transport, curl implements features that require a target +# newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`. +# In this case `-Wno-deprecated-declarations` still comes handy to pacify +# deprecation warnings, though the real solution would be to avoid calling +# that function. + env: - DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer - MAKEFLAGS: -j 5 + LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings + MAKEFLAGS: -j 4 jobs: - autotools: - name: ${{ matrix.build.name }} + macos: + name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.build.name }}" runs-on: 'macos-latest' - timeout-minutes: 90 + timeout-minutes: 45 + env: + DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" + CC: ${{ matrix.compiler }} + CFLAGS: '' strategy: fail-fast: false matrix: + compiler: [clang, llvm@15, gcc-12] build: - - name: normal - install: nghttp2 - configure: --without-ssl --enable-websockets - macosx-version-min: 10.9 - - name: debug - install: nghttp2 - configure: --enable-debug --without-ssl --enable-websockets - macosx-version-min: 10.9 - - name: libssh2 - install: nghttp2 libssh2 - configure: --enable-debug --with-libssh2 --without-ssl --enable-websockets - macosx-version-min: 10.9 - - name: libssh-c-ares - install: openssl nghttp2 libssh - configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl --enable-ares --enable-websockets - macosx-version-min: 10.9 - - name: libssh - install: openssl nghttp2 libssh - configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl --enable-websockets - macosx-version-min: 10.9 - - name: c-ares - install: nghttp2 - configure: --enable-debug --enable-ares --without-ssl --enable-websockets - macosx-version-min: 10.9 - - name: HTTP only - install: nghttp2 - configure: | - --enable-debug \ - --enable-maintainer-mode \ - --disable-alt-svc \ - --disable-dict \ - --disable-file \ - --disable-ftp \ - --disable-gopher \ - --disable-imap \ - --disable-ldap \ - --disable-pop3 \ - --disable-rtmp \ - --disable-rtsp \ - --disable-scp \ - --disable-sftp \ - --disable-shared \ - --disable-smb \ - --disable-smtp \ - --disable-telnet \ - --disable-tftp \ - --disable-unix-sockets \ - --without-brotli \ - --without-gssapi \ - --without-libidn2 \ + # automake + - name: '!ssl !debug brotli zstd' + compiler: clang + install: brotli zstd + configure: --without-ssl --with-brotli --with-zstd + macos-version-min: '10.9' + - name: '!ssl !debug' + compiler: gcc-12 + configure: --without-ssl + macos-version-min: '10.9' + - name: '!ssl' + compiler: clang + configure: --enable-debug --without-ssl + macos-version-min: '10.9' + - name: '!ssl libssh2 AppleIDN' + compiler: clang + configure: --enable-debug --with-libssh2=$(brew --prefix libssh2) --without-ssl --with-apple-idn + macos-version-min: '10.9' + - name: 'OpenSSL libssh c-ares' + compiler: clang + install: libssh + configure: --enable-debug --with-libssh --with-openssl=$(brew --prefix openssl) --enable-ares + macos-version-min: '10.9' + - name: 'OpenSSL libssh' + compiler: llvm@15 + install: libssh + configure: --enable-debug --with-libssh --with-openssl=$(brew --prefix openssl) + macos-version-min: '10.9' + - name: '!ssl c-ares' + compiler: clang + configure: --enable-debug --enable-ares --without-ssl + macos-version-min: '10.9' + - name: '!ssl HTTP-only' + compiler: clang + configure: >- + --enable-debug + --disable-alt-svc --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap + --disable-ldap --disable-pop3 --disable-rtmp --disable-rtsp --disable-scp --disable-sftp + --disable-shared --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets + --without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp --without-libssh2 + --without-nghttp2 --without-ntlm-auth --without-ssl --without-zlib --without-zstd + + macos-version-min: '10.15' # Catalina (2019) + - name: 'SecureTransport libssh2' + compiler: clang + configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) + macos-version-min: '10.8' + - name: 'SecureTransport libssh2 10.12' + compiler: clang + configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) + macos-version-min: '10.12' # for monotonic timers + cflags: '-Wno-deprecated-declarations' + - name: 'SecureTransport libssh2' + compiler: gcc-12 + configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) + macos-version-min: '10.8' + - name: 'LibreSSL +examples' + compiler: clang + install: libressl + configure: --enable-debug --with-openssl=$(brew --prefix libressl) + macos-version-min: '10.9' + - name: 'OpenSSL' + compiler: clang + configure: --enable-debug --with-openssl=$(brew --prefix openssl) + macos-version-min: '10.9' + - name: 'OpenSSL event-based' + compiler: clang + configure: --enable-debug --with-openssl=$(brew --prefix openssl) + macos-version-min: '10.9' + tflags: -e + - name: 'OpenSSL libssh2 !ldap 10.15' + compiler: clang + configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix openssl) + macos-version-min: '10.15' + # cmake + - name: 'OpenSSL ws gsasl AppleIDN' + install: gsasl + generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON + macos-version-min: '10.9' + - name: 'OpenSSL +static libssh +examples' + install: libssh + generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON + macos-version-min: '10.9' + - name: 'SecureTransport ws debug' + generate: -DCURL_USE_SECTRANSP=ON -DENABLE_DEBUG=ON + macos-version-min: '10.8' + - name: 'LibreSSL !ldap heimdal c-ares +examples' + install: libressl heimdal + generate: -DOPENSSL_ROOT_DIR=$(brew --prefix libressl) -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix heimdal) -DCURL_DISABLE_LDAP=ON + macos-version-min: '10.15' + - name: 'wolfSSL !ldap brotli zstd' + install: brotli wolfssl zstd + generate: -DCURL_USE_WOLFSSL=ON -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_DISABLE_LDAP=ON + macos-version-min: '10.15' + - name: 'mbedTLS !ldap brotli zstd' + install: brotli mbedtls zstd + generate: -DCURL_USE_MBEDTLS=ON -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_DISABLE_LDAP=ON + macos-version-min: '10.15' + - name: 'GnuTLS !ldap krb5' + install: gnutls nettle krb5 + generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix krb5) -DCURL_DISABLE_LDAP=ON + macos-version-min: '10.15' + - name: 'OpenSSL torture !FTP' + generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_BROTLI=ON -DCURL_ZSTD=ON + tflags: -t --shallow=25 !FTP + macos-version-min: '10.9' + torture: true + - name: 'OpenSSL torture FTP' + generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_BROTLI=ON -DCURL_ZSTD=ON + tflags: -t --shallow=20 FTP + macos-version-min: '10.9' + torture: true + exclude: + - { compiler: llvm@15, build: { macos-version-min: '10.15' } } + - { compiler: llvm@15, build: { torture: true } } + - { compiler: gcc-12, build: { torture: true } } + # opt out jobs from combinations that have the compiler set manually + - { compiler: llvm@15, build: { compiler: 'clang' } } + - { compiler: llvm@15, build: { compiler: 'gcc-12' } } + - { compiler: gcc-12, build: { compiler: 'clang' } } + - { compiler: gcc-12, build: { compiler: 'llvm@15' } } + - { compiler: clang, build: { compiler: 'gcc-12' } } + - { compiler: clang, build: { compiler: 'llvm@15' } } + + steps: + - name: 'brew install' + # 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 + run: | + echo ${{ matrix.build.generate && 'ninja' || 'automake libtool' }} \ + pkg-config libpsl libssh2 nghttp2 stunnel ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile + while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done + + - name: 'brew unlink openssl' + run: | + if test -d $(brew --prefix)/include/openssl; then + brew unlink openssl + fi + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: 'toolchain versions' + run: | + [[ '${{ matrix.compiler }}' = 'llvm'* ]] && CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang" + [[ '${{ matrix.compiler }}' = 'gcc'* ]] && "${CC}" --print-sysroot + which "${CC}"; "${CC}" --version || true + xcodebuild -version || true + xcrun --sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-version || true + echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' + echo '::group::brew packages installed'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' + + - name: 'autoreconf' + if: ${{ matrix.build.configure }} + run: autoreconf -fi + + - name: 'configure' + run: | + if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then + CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang" + CC+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + CC+=" --target=$(uname -m)-apple-darwin" + fi + + if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then + libgccdir="$(dirname "$("${CC}" -print-libgcc-file-name)")" + echo '::group::gcc include-fixed details'; find "${libgccdir}/include-fixed" | sort; echo '::endgroup::' + for f in dispatch os AvailabilityInternal.h stdio.h; do + if [ -r "${libgccdir}/include-fixed/${f}" ]; then + echo "Zap gcc hack: '${libgccdir}/include-fixed/${f}'" + mv "${libgccdir}/include-fixed/${f}" "${libgccdir}/include-fixed/${f}-BAK" + fi + done + fi + if [ -n '${{ matrix.build.configure }}' ]; then + export CFLAGS + if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then + options+=" --target=$(uname -m)-apple-darwin" + fi + CFLAGS+=' ${{ matrix.build.cflags }}' + if [ '${{ matrix.compiler }}' != 'clang' ]; then + options+=" --with-sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + CFLAGS+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + fi + CFLAGS+=' -mmacosx-version-min=${{ matrix.build.macos-version-min }}' + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + --disable-dependency-tracking \ + --with-libpsl=$(brew --prefix libpsl) \ + ${{ matrix.build.configure }} ${options} + else + cmake -B bld -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.build.macos-version-min }} \ + "-DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" \ + "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ + ${{ matrix.build.generate }} + fi + + - name: 'configure log' + if: ${{ !cancelled() }} + run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true + + - name: 'curl_config.h' + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'build-cert' + if: contains(matrix.build.generate, '-DCURL_USE_SECTRANSP=ON') || contains(matrix.build.configure, '--with-secure-transport') + run: | + if [ -n '${{ matrix.build.configure }}' ]; then + make -C bld/tests/certs clean-certs + make -C bld/tests/certs build-certs -j1 + else + cmake --build bld --target clean-certs + cmake --build bld --target build-certs --parallel 1 + fi + + - name: 'build' + run: | + if [ -n '${{ matrix.build.configure }}' ]; then + make -C bld V=1 + else + cmake --build bld --verbose + fi + + - name: 'curl version' + run: bld/src/curl --disable --version + + - name: 'build tests' + run: | + if [ -n '${{ matrix.build.configure }}' ]; then + make -C bld V=1 -C tests + else + cmake --build bld --target testdeps + fi + + - name: 'install test prereqs' + run: | + python3 -m venv $HOME/venv + source $HOME/venv/bin/activate + python3 -m pip install -r tests/requirements.txt + + - name: 'run tests' + timeout-minutes: ${{ matrix.build.torture && 20 || 10 }} + run: | + export TFLAGS='-j20 ${{ matrix.build.tflags }}' + if [ -z '${{ matrix.build.torture }}' ]; then + TFLAGS+=' ~2037 ~2041' # flaky + if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then + TFLAGS+=' ~RTSP' # 567 568 569 570 571 572 577 689 3100 + TFLAGS+=' ~1156 ~1539' # HTTP Content-Range, Content-Length + if [[ -n '${{ matrix.build.configure }}' || \ + '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then + TFLAGS+=' ~2100' # 2100:'HTTP GET using DoH' https://github.com/curl/curl/actions/runs/9942146678/job/27462937524#step:15:5059 + fi + if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \ + '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then + TFLAGS+=' ~HTTP/2' # 2400 2401 2402 2403 2404 2406, Secure Transport + nghttp2 + else + TFLAGS+=' ~2402 ~2404' # non-Secure Transport + nghttp2 + fi + fi + if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \ + '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then + TFLAGS+=' ~313' # Secure Transport does not support crl file + TFLAGS+=' ~1631 ~1632' # Secure Transport is not able to shutdown ftp over https gracefully yet + fi + fi + source $HOME/venv/bin/activate + rm -f $HOME/.curlrc + if [ -n '${{ matrix.build.configure }}' ]; then + make -C bld V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} + else + cmake --build bld --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} + fi + + - name: 'build examples' + if: ${{ contains(matrix.build.name, '+examples') }} + run: | + if [ -n '${{ matrix.build.configure }}' ]; then + make -C bld examples V=1 + else + cmake --build bld --target curl-examples --verbose + fi + + combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, Secure Transport/not, built tool, combinations + if: true # Set to `true` to enable this test matrix. It runs quickly. + name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }} ${{ matrix.config }}" + runs-on: ${{ matrix.image }} + timeout-minutes: 10 + env: + DEVELOPER_DIR: "/Applications/Xcode${{ matrix.xcode && format('_{0}', matrix.xcode) || '' }}.app/Contents/Developer" + CC: ${{ matrix.compiler }} + strategy: + fail-fast: false + matrix: + config: [SecureTransport] # also: OpenSSL + compiler: [gcc-12, gcc-13, gcc-14, llvm@15, llvm@18, clang] + # Xcode support matrix as of 2024-07, with default macOS SDK versions and OS names, years: + # * = default Xcode on the runner. + # macos-13: 14.1, 14.2, 14.3.1, 15.0.1, 15.1,*15.2 + # macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4 + # macos-15: *16.0, 16.1 + # macOSSDK: 13.0, 13.1, 13.3, 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1 + # Ventura (2022) Sonoma (2023) Sequoia (2024) + # https://github.com/actions/runner-images/tree/main/images/macos + # https://en.wikipedia.org/wiki/MacOS_version_history + image: [macos-13, macos-14, macos-15] + # Can skip these to reduce jobs: + # 15.1 has the same default macOS SDK as 15.2 and identical test result. + # 14.1, 15.4 not revealing new fallouts. + #xcode: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1', '15.2', '15.3', '15.4', '16.0', '16.1'] # all Xcode + #xcode: ['14.1', '14.2', '14.3.1', '15.0.1' , '15.2', '15.3', '15.4', '16.0', '16.1'] # all SDK + #xcode: [ '14.2', '14.3.1', '15.0.1' , '15.2', '15.3' , '16.0' ] # coverage + xcode: [''] # default Xcodes + macos-version-min: ['10.8'] + build: [autotools, cmake] + exclude: + # Combinations uncovered by runner images: + - { image: macos-13, xcode: '15.3' } + - { image: macos-13, xcode: '15.4' } + - { image: macos-13, xcode: '16.0' } + - { image: macos-13, xcode: '16.1' } + - { image: macos-14, xcode: '14.1' } + - { image: macos-14, xcode: '14.2' } + - { image: macos-14, xcode: '14.3.1' } + - { image: macos-14, xcode: '16.0' } + - { image: macos-14, xcode: '16.1' } + - { image: macos-15, xcode: '14.1' } + - { image: macos-15, xcode: '14.2' } + - { image: macos-15, xcode: '14.3.1' } + - { 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-13, compiler: 'llvm@18' } + - { image: macos-14, compiler: 'llvm@18' } + - { image: macos-15, compiler: 'llvm@15' } + # Reduce build combinations, by dropping less interesting ones + - { compiler: gcc-12, config: SecureTransport } + - { compiler: gcc-13, build: cmake } + - { compiler: gcc-13, image: macos-13 } + - { compiler: gcc-14, config: SecureTransport } + steps: + - name: 'install autotools' + if: ${{ matrix.build == 'autotools' }} + run: | + echo automake libtool | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile + while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: 'toolchain versions' + run: | + [[ '${{ matrix.compiler }}' = 'llvm'* ]] && CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang" + [[ '${{ matrix.compiler }}' = 'gcc'* ]] && "${CC}" --print-sysroot + which "${CC}"; "${CC}" --version || true + xcodebuild -version || true + xcrun --sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-version || true + echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' + echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' + + - name: 'autoreconf' + if: ${{ matrix.build == 'autotools' }} + run: autoreconf -fi + + - name: 'configure / ${{ matrix.build }}' + run: | + if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then + CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang" + CC+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + CC+=" --target=$(uname -m)-apple-darwin" + fi + + # gcc ships with an `include-fixed` header set, which overrides SDK + # headers with the intent of making them compatible with gcc. The + # source for these headers is: + # https://github.com/gcc-mirror/gcc/tree/master/fixincludes + # with extra Apple-specific patches applied from here for Homebrew: + # https://github.com/iains/gcc-12-branch + # + # They pass through a generator phase at build-time which seems to + # pick the SDK installed on the build machine (maintained by the + # Homebrew project in our case) and patches it according to a set + # of rules in `inclhack.def`. + # + # Homebrew builds and ships different binaries for different macOS + # versions and CPUs, built on machines using the same OS version as + # the target one. Each of these machines have a particular version + # of Apple CommandLineTools with a default SDK version installed with + # them. + # + # Then this binary gets installed onto the end-user machine, + # matching the OS version at the time of installation. + # + # The problem with this approach is that the SDK version picked up + # at gcc build-time has a high chance of being or becoming out of + # sync with actual SDK installed on the end-user machine. This + # can happen after upgrading the OS, Xcode, selecting an SDK version + # manually, or other reasons. + # + # When the SDK versions do not match, the gcc hacks, instead of + # improving compatibility the SDK, are actively _breaking_ + # compatibility, in an unexpected, hard to diagnose way. + # + # The SDK version used for gcc-hacks is not advertised. We can + # extract the major SDK version from the generated gcc-hack header + # files, assuming someone knows what to look for and where. + # + # Basically it also means that the same `gcc-N` Homebrew package + # behaves differently depending on the OS it was built on. Causing + # an explosion of build combination. It may also mean that a minor + # gcc version bump is built against a different SDK version, and due + # to the extra patch for the hack applied by Homebrew, there may + # be extra changes as well. + # + # For GHA runners, it means that the default Xcode + OS combo have + # and SDK mismatch in 8 out of 12 combinations (66%). All fail to + # build, plus one more with matching SDK. This is 9 in total (75%) + # that fail to build out of the box. These are the 3 lucky default + # combinations that worked to build curl: + # macos-14 + Xcode 15.0.1 + gcc-12, gcc-14 + # + # Of all possible valid GHA runner, gcc, manually selected Xcode + # combinations, 40% are broken. + # + # Compared to mainline llvm: llvm ships the same binaries regardless + # of build-OS or environment, it contains no SDK-version-specific + # hacks, and has no 3rd party patches. This still leaves some + # occasional issues, but works much closer to expectations. + # + # Some of these hacks are helpful, in particular for fixing this + # issue via math.h: + # /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h:53:5: error: #error "Unsupported value of + # 53 | # error "Unsupported value of __FLT_EVAL_METHOD__." + # + # Errors seen in available CI combinations: + # error: two or more data types in declaration specifiers # fatal error: AvailabilityInternalLegacy.h: No such file or directory + # gcc-13 + macos-14 + Xcode 14.3.1 + # error: two or more data types in declaration specifiers + # gcc-13 + macos-12 + Xcode 14.1, 14.2 + # gcc-13 + Xcode 15.0.1, 15.1, 5.2 + # error: expected ';' before 'extern' + # gcc-12, gcc-14 + macos-12 + Xcode 14.1, 14.2 + # error: unknown type name 'dispatch_queue_t' + # gcc-12 + macos-13 + Xcode 15.0.1, 15.1, 15.2 + # error: type defaults to 'int' in declaration of 'DISPATCH_DECL_FACTORY_CLASS_SWIFT' [-Wimplicit-int] + # gcc-14 macos-13 Xcode 15.0.1, 15.1, 15.2 + # error: unknown type name 'FILE' + # Xcode 16.0 + # + # Unbreak Homebrew gcc builds by moving problematic SDK header overlay + # directories/files out of the way: + if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then + # E.g.: + # $(brew --prefix)/Cellar/gcc@11/11.4.0/lib/gcc/11/gcc/aarch64-apple-darwin23/11/include-fixed + # $(brew --prefix)/Cellar/gcc@11/11.4.0/lib/gcc/11/gcc/x86_64-apple-darwin21/11/include-fixed + # $(brew --prefix)/Cellar/gcc/14.1.0_1/lib/gcc/14/gcc/x86_64-apple-darwin21/14/include-fixed + libgccdir="$(dirname "$("${CC}" -print-libgcc-file-name)")" + echo '::group::gcc include-fixed details'; find "${libgccdir}/include-fixed" | sort; echo '::endgroup::' + patch_out='dispatch os AvailabilityInternal.h' + patch_out+=' stdio.h' # for Xcode 16 error: unknown type name 'FILE' + for f in ${patch_out}; do + if [ -r "${libgccdir}/include-fixed/${f}" ]; then + echo "Zap gcc hack: '${libgccdir}/include-fixed/${f}'" + mv "${libgccdir}/include-fixed/${f}" "${libgccdir}/include-fixed/${f}-BAK" + fi + done + fi + + if [ '${{ matrix.build }}' = 'autotools' ]; then + export CFLAGS + if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then + options+=" --target=$(uname -m)-apple-darwin" + fi + if [ '${{ matrix.compiler }}' != 'clang' ]; then + options+=" --with-sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + CFLAGS+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + fi + [ '${{ matrix.config }}' = 'OpenSSL' ] && options+=" --with-openssl=$(brew --prefix openssl)" + [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' --with-secure-transport' + CFLAGS+=' -mmacosx-version-min=${{ matrix.macos-version-min }}' + # would pick up nghttp2, libidn2, but libssh2 is disabled by default + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + --disable-dependency-tracking \ + --disable-docs --disable-manual \ + --without-nghttp2 --without-libidn2 \ --without-libpsl \ - --without-librtmp \ - --without-libssh2 \ - --without-nghttp2 \ - --without-ntlm-auth \ - --without-ssl \ - --without-zlib \ - --without-zstd + ${options} + else + [ '${{ matrix.config }}' = 'OpenSSL' ] && options+=' -DCURL_USE_OPENSSL=ON' + [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' -DCURL_USE_SECTRANSP=ON' + # would pick up nghttp2, libidn2, and libssh2 + cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos-version-min }} \ + "-DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" \ + "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ + "-DCMAKE_IGNORE_PREFIX_PATH=$(brew --prefix)" \ + -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF \ + -DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \ + -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \ + ${options} + fi - macosx-version-min: 10.15 - - name: SecureTransport http2 - install: nghttp2 - configure: --enable-debug --with-secure-transport --enable-websockets - macosx-version-min: 10.8 - - name: gcc SecureTransport - configure: CC=gcc-12 --enable-debug --with-secure-transport --enable-websockets --without-libpsl - macosx-version-min: 10.8 - - name: OpenSSL http2 - install: nghttp2 openssl - configure: --enable-debug --with-openssl=/usr/local/opt/openssl --enable-websockets - macosx-version-min: 10.9 - - name: LibreSSL http2 - install: nghttp2 libressl - configure: --enable-debug --with-openssl=/usr/local/opt/libressl --enable-websockets - macosx-version-min: 10.9 - - name: torture - install: nghttp2 openssl - configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl --enable-websockets - tflags: -n -t --shallow=25 !FTP - macosx-version-min: 10.9 - - name: torture-ftp - install: nghttp2 openssl - configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl --enable-websockets - tflags: -n -t --shallow=20 FTP - macosx-version-min: 10.9 - - name: macOS 10.15 - install: nghttp2 libssh2 openssl - configure: --enable-debug --disable-ldap --with-openssl=/usr/local/opt/openssl --enable-websockets - macosx-version-min: 10.15 - steps: - - run: echo libtool autoconf automake pkg-config libpsl ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile - name: 'brew bundle' + - name: 'configure log' + if: ${{ !cancelled() }} + run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true - # 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 - - run: "while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done" - name: 'brew install' + - name: 'curl_config.h' + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true - - run: | - case "${{ matrix.build.install }}" in - *openssl*) - ;; - *) - if test -d /usr/local/include/openssl; then - brew unlink openssl - fi;; - esac - name: 'brew unlink openssl' + - name: 'build / ${{ matrix.build }}' + run: make -C bld V=1 VERBOSE=1 - - run: python3 -m pip install impacket - name: 'pip3 install' - - - uses: actions/checkout@v4 - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} - name: 'configure' - env: - CFLAGS: "-mmacosx-version-min=${{ matrix.build.macosx-version-min }}" - - - run: make V=1 - name: 'make' - - - run: make V=1 examples - name: 'make examples' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-ci - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }} ~1452" - - cmake: - name: cmake ${{ matrix.compiler.CC }} ${{ matrix.build.name }} - runs-on: 'macos-latest' - env: ${{ matrix.compiler }} - strategy: - fail-fast: false - matrix: - compiler: - - CC: clang - CXX: clang++ - CFLAGS: "-mmacosx-version-min=10.15 -Wno-deprecated-declarations" - - CC: gcc-12 - CXX: g++-12 - CFLAGS: "-mmacosx-version-min=10.15 -Wno-error=undef -Wno-error=conversion" - build: - - name: OpenSSL - install: nghttp2 openssl - generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 - - name: LibreSSL - install: nghttp2 libressl - generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCMAKE_UNITY_BUILD=ON - - name: libssh2 - install: nghttp2 openssl libssh2 - generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_USE_LIBSSH2=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON - - name: GnuTLS - install: gnutls - generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCMAKE_SHARED_LINKER_FLAGS=-L/usr/local/lib -DCMAKE_EXE_LINKER_FLAGS=-L/usr/local/lib - steps: - - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile - name: 'brew bundle' - - - run: "while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done" - name: 'brew install' - - - run: | - case "${{ matrix.build.install }}" in - *openssl*) - ;; - *) - if test -d /usr/local/include/openssl; then - brew unlink openssl - fi;; - esac - name: 'brew unlink openssl' - - - uses: actions/checkout@v4 - - - run: cmake -S. -Bbuild -DCURL_WERROR=ON -DPICKY_COMPILER=ON ${{ matrix.build.generate }} - name: 'cmake generate' - - - run: cmake --build build - name: 'cmake build' + - name: 'curl version' + run: bld/src/curl --disable --version diff --git a/deps/curl/.github/workflows/man-examples.yml b/deps/curl/.github/workflows/man-examples.yml deleted file mode 100644 index 6f0d1e8a..00000000 --- a/deps/curl/.github/workflows/man-examples.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: manpage examples - -on: - push: - branches: - - master - - '*/ci' - paths: - - 'docs/libcurl/curl_*.3' - - 'docs/libcurl/opts/*.3' - - '.github/scripts/verify-examples.pl' - pull_request: - branches: - - master - paths: - - 'docs/libcurl/curl_*.3' - - 'docs/libcurl/opts/*.3' - - '.github/scripts/verify-examples.pl' - -jobs: - verify: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: render nroff versions - run: autoreconf -fi && ./configure --without-ssl --without-libpsl && make -C docs - - - name: verify examples - run: ./.github/scripts/verify-examples.pl docs/libcurl/curl*.3 docs/libcurl/opts/*.3 diff --git a/deps/curl/.github/workflows/ngtcp2-linux.yml b/deps/curl/.github/workflows/ngtcp2-linux.yml deleted file mode 100644 index 19172b48..00000000 --- a/deps/curl/.github/workflows/ngtcp2-linux.yml +++ /dev/null @@ -1,270 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: ngtcp2-linux - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: ngtcp2-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - quictls-version: 3.1.4+quic - gnutls-version: 3.8.3 - wolfssl-version: master - nghttp3-version: v1.1.0 - ngtcp2-version: v1.2.0 - nghttp2-version: v1.59.0 - mod_h2-version: v2.0.26 - -jobs: - autotools: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-latest' - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - build: - - name: quictls - configure: >- - PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/nghttpx/lib" - --with-ngtcp2=$HOME/nghttpx --enable-warnings --enable-werror --enable-debug --disable-ntlm - --with-test-nghttpx="$HOME/nghttpx/bin/nghttpx" - --with-openssl=$HOME/nghttpx - - name: gnutls - configure: >- - PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/nghttpx/lib" - --with-ngtcp2=$HOME/nghttpx --enable-warnings --enable-werror --enable-debug - --with-test-nghttpx="$HOME/nghttpx/bin/nghttpx" - --with-gnutls=$HOME/nghttpx - - name: wolfssl - configure: >- - PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/nghttpx/lib" - --with-ngtcp2=$HOME/nghttpx --enable-warnings --enable-werror --enable-debug - --with-test-nghttpx="$HOME/nghttpx/bin/nghttpx" - --with-wolfssl=$HOME/nghttpx - - steps: - - run: | - sudo apt-get update - sudo apt-get install libtool autoconf automake pkg-config stunnel4 \ - libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \ - nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \ - libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \ - texinfo texlive texlive-extra-utils autopoint libev-dev \ - apache2 apache2-dev libnghttp2-dev - name: 'install prereqs and impacket, pytest, crypto, apache2' - - - name: cache quictls - uses: actions/cache@v4 - id: cache-quictls-no-deprecated - env: - cache-name: cache-quictls-no-deprecated - with: - path: /home/runner/quictls - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.quictls-version }} - - - if: steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }} https://github.com/quictls/openssl quictls - cd quictls - ./config no-deprecated --prefix=$HOME/nghttpx --libdir=$HOME/nghttpx/lib - make - name: 'build quictls' - - - run: | - cd $HOME/quictls - make -j1 install_sw - name: 'install quictls' - - - - name: cache gnutls - uses: actions/cache@v4 - id: cache-gnutls - env: - cache-name: cache-gnutls - with: - path: /home/runner/gnutls - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.gnutls-version }} - - - if: steps.cache-gnutls.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.gnutls-version }} https://github.com/gnutls/gnutls.git - cd gnutls - ./bootstrap - ./configure --prefix=$HOME/nghttpx \ - PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/nghttpx/lib -L$HOME/nghttpx/lib" \ - --with-included-libtasn1 --with-included-unistring \ - --disable-guile --disable-doc --disable-tests --disable-tools - make - name: 'build gnutls' - - - run: | - cd $HOME/gnutls - make install - name: 'install gnutls' - - - - name: cache wolfssl - uses: actions/cache@v4 - id: cache-wolfssl - env: - cache-name: cache-wolfssl - with: - path: /home/runner/wolfssl - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }} - - - if: steps.cache-wolfssl.outputs.cache-hit != 'true' || ${{ env.wolfssl-version }} == 'master' - run: | - cd $HOME - rm -rf wolfssl - git clone --quiet --depth=1 -b ${{ env.wolfssl-version }} https://github.com/wolfSSL/wolfssl.git - cd wolfssl - ./autogen.sh - ./configure --enable-all --enable-quic --prefix=$HOME/nghttpx - make - name: 'build wolfssl' - - - run: | - cd $HOME/wolfssl - make install - name: 'install wolfssl' - - - - name: cache nghttp3 - uses: actions/cache@v4 - id: cache-nghttp3 - env: - cache-name: cache-nghttp3 - with: - path: /home/runner/nghttp3 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.nghttp3-version }} - - - if: steps.cache-nghttp3.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.nghttp3-version }} https://github.com/ngtcp2/nghttp3 - cd nghttp3 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only - make - name: 'build nghttp3' - - - run: | - cd $HOME/nghttp3 - make install - name: 'install nghttp3' - - # depends on all other cached libs built so far - - run: | - git clone --quiet --depth=1 -b ${{ env.ngtcp2-version }} https://github.com/ngtcp2/ngtcp2 - cd ngtcp2 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only --with-openssl --with-gnutls --with-wolfssl - make install - name: 'install ngtcp2' - - # depends on all other cached libs built so far - - run: | - git clone --quiet --depth=1 -b ${{ env.nghttp2-version }} https://github.com/nghttp2/nghttp2 - cd nghttp2 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-http3 - make install - name: 'install nghttp2' - - - name: cache mod_h2 - uses: actions/cache@v4 - id: cache-mod_h2 - env: - cache-name: cache-mod_h2 - with: - path: /home/runner/mod_h2 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mod_h2-version }} - - - if: steps.cache-mod_h2.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.mod_h2-version }} https://github.com/icing/mod_h2 - cd mod_h2 - autoreconf -fi - ./configure - make - name: 'build mod_h2' - - - run: | - cd $HOME/mod_h2 - sudo make install - name: 'install mod_h2' - - - uses: actions/checkout@v4 - - - run: | - sudo python3 -m pip install -r tests/requirements.txt -r tests/http/requirements.txt - name: 'install python test prereqs' - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure ${{ matrix.build.configure }} - name: 'configure' - - - run: make V=1 - name: 'make' - - - run: make V=1 examples - name: 'make examples' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-ci - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }}" - - - run: pytest -v tests - name: 'run pytest' - env: - TFLAGS: "${{ matrix.build.tflags }}" - CURL_CI: github diff --git a/deps/curl/.github/workflows/non-native.yml b/deps/curl/.github/workflows/non-native.yml new file mode 100644 index 00000000..e46c1dfe --- /dev/null +++ b/deps/curl/.github/workflows/non-native.yml @@ -0,0 +1,217 @@ +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +name: non-native + +'on': + push: + branches: + - master + - '*/ci' + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + netbsd: + name: 'NetBSD (cmake, openssl, clang)' + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + matrix: + arch: ['x86_64'] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: 'cmake' + uses: cross-platform-actions/action@cdc9ee69ef84a5f2e59c9058335d9c57bcb4ac86 # v0.25.0 + with: + operating_system: 'netbsd' + version: '10.0' + architecture: ${{ matrix.arch }} + run: | + # https://pkgsrc.se/ + sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket + cmake -B bld -G Ninja \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ + -DCURL_USE_OPENSSL=ON \ + -DCURL_BROTLI=ON -DCURL_USE_GSSAPI=ON \ + || { cat bld/CMakeFiles/CMake*.yaml; false; } + echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::' + cmake --build bld --config Debug + bld/src/curl --disable --version + if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU + cmake --build bld --config Debug --target testdeps + export TFLAGS='-j4' + cmake --build bld --config Debug --target test-ci + fi + echo '::group::build examples' + cmake --build bld --config Debug --target curl-examples + echo '::endgroup::' + + openbsd: + name: 'OpenBSD (cmake, libressl, clang)' + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + matrix: + arch: ['x86_64'] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: 'cmake' + uses: cross-platform-actions/action@cdc9ee69ef84a5f2e59c9058335d9c57bcb4ac86 # v0.25.0 + with: + operating_system: 'openbsd' + version: '7.5' + architecture: ${{ matrix.arch }} + run: | + # https://openbsd.app/ + sudo pkg_add cmake ninja perl brotli openldap-client libssh2 libidn2 libpsl nghttp2 python3 py3-impacket + cmake -B bld -G Ninja \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ + -DCURL_USE_OPENSSL=ON \ + -DCURL_BROTLI=ON \ + || { cat bld/CMakeFiles/CMake*.yaml; false; } + echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::' + cmake --build bld --config Debug + bld/src/curl --disable --version + if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU + cmake --build bld --config Debug --target testdeps + export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`? + cmake --build bld --config Debug --target test-ci + fi + echo '::group::build examples' + cmake --build bld --config Debug --target curl-examples + echo '::endgroup::' + + freebsd: + name: 'FreeBSD (${{ matrix.build }}, openssl, ${{ matrix.compiler }}, ${{ matrix.arch }})' + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + matrix: + include: + - { build: 'autotools', arch: 'x86_64', compiler: 'clang' } + - { build: 'autotools', arch: 'arm64', compiler: 'clang' } + - { build: 'cmake' , arch: 'arm64', compiler: 'clang' } + fail-fast: false + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: 'autotools' + if: ${{ matrix.build == 'autotools' }} + uses: cross-platform-actions/action@cdc9ee69ef84a5f2e59c9058335d9c57bcb4ac86 # v0.25.0 + with: + operating_system: 'freebsd' + version: '14.1' + architecture: ${{ matrix.arch }} + run: | + # https://ports.freebsd.org/ + sudo pkg install -y autoconf automake libtool \ + pkgconf brotli openldap26-client libidn2 libnghttp2 nghttp2 stunnel py311-impacket + autoreconf -fi + export CC='${{ matrix.compiler }}' + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \ + --prefix="${HOME}"/install \ + --with-openssl \ + --with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \ + --disable-dependency-tracking || { tail -n 1000 config.log; false; } + echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::' + echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::' + make -j3 install + src/curl --disable --version + if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU + make -j3 -C tests + make test-ci V=1 TFLAGS='-j4' + fi + echo '::group::build examples' + make -j3 examples + echo '::endgroup::' + + - name: 'cmake' + if: ${{ matrix.build == 'cmake' }} + uses: cross-platform-actions/action@cdc9ee69ef84a5f2e59c9058335d9c57bcb4ac86 # v0.25.0 + with: + operating_system: 'freebsd' + version: '14.1' + architecture: ${{ matrix.arch }} + run: | + # https://ports.freebsd.org/ + sudo pkg install -y cmake ninja perl5 \ + pkgconf brotli openldap26-client libidn2 libnghttp2 nghttp2 stunnel py311-impacket + cmake -B bld -G Ninja \ + '-DCMAKE_C_COMPILER=${{ matrix.compiler }}' \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ + -DCURL_USE_OPENSSL=ON \ + -DCURL_BROTLI=ON -DCURL_USE_GSSAPI=ON \ + || { cat bld/CMakeFiles/CMake*.yaml; false; } + echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::' + cmake --build bld --config Debug + bld/src/curl --disable --version + if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU + cmake --build bld --config Debug --target testdeps + cmake --build bld --config Debug --target test-ci + fi + echo '::group::build examples' + cmake --build bld --config Debug --target curl-examples + echo '::endgroup::' + + omnios: + name: 'OmniOS (autotools, openssl, gcc, amd64)' + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: 'autotools' + uses: vmactions/omnios-vm@52a1db31be4fd41325bb0ed32d9ff79f78c69d8d # v1 + with: + usesh: true + # https://pkg.omnios.org/r151050/core/en/index.shtml + prepare: pkg install build-essential libtool + run: | + set -e + ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env. + autoreconf -fi + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \ + --prefix="${HOME}"/install \ + --with-openssl \ + --disable-dependency-tracking || { tail -n 1000 config.log; false; } + echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::' + echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::' + gmake -j3 install + src/curl --disable --version + gmake -j3 -C tests + gmake test-ci V=1 + echo '::group::build examples' + gmake -j3 examples + echo '::endgroup::' diff --git a/deps/curl/.github/workflows/osslq-linux.yml b/deps/curl/.github/workflows/osslq-linux.yml deleted file mode 100644 index a15e28cc..00000000 --- a/deps/curl/.github/workflows/osslq-linux.yml +++ /dev/null @@ -1,233 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: osslq-linux - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: osslq-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - openssl3-version: openssl-3.2.0 - quictls-version: 3.1.4+quic - nghttp3-version: v1.1.0 - ngtcp2-version: v1.2.0 - nghttp2-version: v1.59.0 - mod_h2-version: v2.0.26 - -jobs: - autotools: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-latest' - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - build: - - name: openssl-quic - configure: >- - PKG_CONFIG_PATH="$HOME/openssl3/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" - --enable-warnings --enable-werror --enable-debug --disable-ntlm - --with-test-nghttpx="$HOME/nghttpx/bin/nghttpx" - --with-openssl=$HOME/openssl3 --with-openssl-quic - --with-nghttp3=$HOME/nghttpx - - steps: - - run: | - sudo apt-get update - sudo apt-get install libtool autoconf automake pkg-config stunnel4 \ - libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \ - nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \ - libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \ - texinfo texlive texlive-extra-utils autopoint libev-dev \ - apache2 apache2-dev libnghttp2-dev - name: 'install prereqs and impacket, pytest, crypto, apache2' - - - name: cache openssl3 - if: contains(matrix.build.install_steps, 'openssl3') - uses: actions/cache@v4 - id: cache-openssl3 - env: - cache-name: cache-openssl3 - with: - path: /home/runner/openssl3 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.openssl3-version }} - - - name: 'install openssl3' - if: steps.cache-openssl3.outputs.cache-hit != 'true' - run: | - git clone --quiet --depth=1 -b ${{ env.openssl3-version }} https://github.com/openssl/openssl - cd openssl - ./config --prefix=$HOME/openssl3 --libdir=$HOME/openssl3/lib - make -j1 install_sw - - - name: cache quictls - if: contains(matrix.build.install_steps, 'quictls') - uses: actions/cache@v4 - id: cache-quictls - env: - cache-name: cache-quictls - with: - path: /home/runner/quictls - key: ${{ runner.os }}-build-${{ env.cache-name }}-quictls-${{ env.quictls-version }} - - - name: cache quictls - uses: actions/cache@v4 - id: cache-quictls-no-deprecated - env: - cache-name: cache-quictls-no-deprecated - with: - path: /home/runner/quictls - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.quictls-version }} - - - if: steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }} https://github.com/quictls/openssl quictls - cd quictls - ./config no-deprecated --prefix=$HOME/nghttpx --libdir=$HOME/nghttpx/lib - make - name: 'build quictls' - - - run: | - cd $HOME/quictls - make -j1 install_sw - name: 'install quictls' - - - - name: cache nghttp3 - uses: actions/cache@v4 - id: cache-nghttp3 - env: - cache-name: cache-nghttp3 - with: - path: /home/runner/nghttp3 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.nghttp3-version }} - - - if: steps.cache-nghttp3.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.nghttp3-version }} https://github.com/ngtcp2/nghttp3 - cd nghttp3 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only - make - name: 'build nghttp3' - - - run: | - cd $HOME/nghttp3 - make install - name: 'install nghttp3' - - # depends on all other cached libs built so far - - run: | - git clone --quiet --depth=1 -b ${{ env.ngtcp2-version }} https://github.com/ngtcp2/ngtcp2 - cd ngtcp2 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only --with-openssl - make install - name: 'install ngtcp2' - - # depends on all other cached libs built so far - - run: | - git clone --quiet --depth=1 -b ${{ env.nghttp2-version }} https://github.com/nghttp2/nghttp2 - cd nghttp2 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-http3 - make install - name: 'install nghttp2' - - - name: cache mod_h2 - uses: actions/cache@v4 - id: cache-mod_h2 - env: - cache-name: cache-mod_h2 - with: - path: /home/runner/mod_h2 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mod_h2-version }} - - - if: steps.cache-mod_h2.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.mod_h2-version }} https://github.com/icing/mod_h2 - cd mod_h2 - autoreconf -fi - ./configure - make - name: 'build mod_h2' - - - run: | - cd $HOME/mod_h2 - sudo make install - name: 'install mod_h2' - - - uses: actions/checkout@v4 - - - run: | - sudo python3 -m pip install -r tests/requirements.txt -r tests/http/requirements.txt - name: 'install python test prereqs' - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure ${{ matrix.build.configure }} - name: 'configure' - - - run: make V=1 - name: 'make' - - - run: make V=1 examples - name: 'make examples' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-ci - name: 'run tests' - env: - # 2500 and 25002 fail atm due to fin handling - TFLAGS: "!http/3" - - - run: pytest -v tests - name: 'run pytest' - env: - TFLAGS: "${{ matrix.build.tflags }}" - CURL_CI: github diff --git a/deps/curl/.github/workflows/proselint.yml b/deps/curl/.github/workflows/proselint.yml deleted file mode 100644 index 87126672..00000000 --- a/deps/curl/.github/workflows/proselint.yml +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: proselint - -on: - push: - branches: - - master - - '*/ci' - paths: - - '.github/workflows/proselint.yml' - - '**.md' - pull_request: - branches: - - master - paths: - - '.github/workflows/proselint.yml' - - '**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: install prereqs - run: sudo apt-get install python3-proselint - - # config file help: https://github.com/amperser/proselint/ - - name: create proselint config - run: | - cat < $HOME/.proselintrc - { - "checks": { - "typography.diacritical_marks": false, - "typography.symbols": false, - "annotations.misc": false, - "security.password": false - } - } - JSON - - - name: check prose - run: a=`git ls-files '*.md' | grep -v docs/CHECKSRC.md` && proselint $a README - - # This is for CHECKSRC and files with aggressive exclamation mark needs - - name: create second proselint config - run: | - cat < $HOME/.proselintrc - { - "checks": { - "typography.diacritical_marks": false, - "typography.symbols": false, - "typography.exclamation": false, - "annotations.misc": false - } - } - JSON - - - name: check special prose - run: a=docs/CHECKSRC.md && proselint $a diff --git a/deps/curl/.github/workflows/quiche-linux.yml b/deps/curl/.github/workflows/quiche-linux.yml deleted file mode 100644 index 40fc4d58..00000000 --- a/deps/curl/.github/workflows/quiche-linux.yml +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: quiche - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: quiche-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - openssl-version: 3.1.4+quic - nghttp3-version: v1.1.0 - ngtcp2-version: v1.2.0 - nghttp2-version: v1.59.0 - quiche-version: 0.20.0 - mod_h2-version: v2.0.26 - -jobs: - autotools: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-latest' - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - build: - - name: quiche - install: >- - libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev - install_steps: pytest - configure: >- - LDFLAGS="-Wl,-rpath,/home/runner/quiche/target/release" - --with-openssl=/home/runner/quiche/quiche/deps/boringssl/src - --enable-debug - --with-quiche=/home/runner/quiche/target/release - --with-test-nghttpx="$HOME/nghttpx/bin/nghttpx" - --with-ca-fallback - - steps: - - run: | - sudo apt-get update - sudo apt-get install libtool autoconf automake pkg-config stunnel4 ${{ matrix.build.install }} - sudo apt-get install apache2 apache2-dev libnghttp2-dev - name: 'install prereqs and impacket, pytest, crypto' - - - name: cache nghttpx - uses: actions/cache@v4 - id: cache-nghttpx - env: - cache-name: cache-nghttpx - with: - path: /home/runner/nghttpx - key: ${{ runner.os }}-build-${{ env.cache-name }}-openssl-${{ env.openssl-version }}-nghttp3-${{ env.nghttp3-version }}-ngtcp2-${{ env.ngtcp2-version }}-nghttp2-${{ env.nghttp2-version }} - - - if: steps.cache-nghttpx.outputs.cache-hit != 'true' - run: | - git clone --quiet --depth=1 -b openssl-${{ env.openssl-version }} https://github.com/quictls/openssl - cd openssl - ./config --prefix=$HOME/nghttpx --libdir=$HOME/nghttpx/lib - make -j1 install_sw - name: 'install quictls' - - - if: steps.cache-nghttpx.outputs.cache-hit != 'true' - run: | - git clone --quiet --depth=1 -b ${{ env.nghttp3-version }} https://github.com/ngtcp2/nghttp3 - cd nghttp3 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only - make install - name: 'install nghttp3' - - - if: steps.cache-nghttpx.outputs.cache-hit != 'true' - run: | - git clone --quiet --depth=1 -b ${{ env.ngtcp2-version }} https://github.com/ngtcp2/ngtcp2 - cd ngtcp2 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only --with-openssl - make install - name: 'install ngtcp2' - - - if: steps.cache-nghttpx.outputs.cache-hit != 'true' - run: | - git clone --quiet --depth=1 -b ${{ env.nghttp2-version }} https://github.com/nghttp2/nghttp2 - cd nghttp2 - autoreconf -fi - ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-http3 - make install - name: 'install nghttp2' - - - name: cache quiche - uses: actions/cache@v4 - id: cache-quiche - env: - cache-name: cache-quiche - with: - path: /home/runner/quiche - key: ${{ runner.os }}-build-${{ env.cache-name }}-quiche-${{ env.quiche-version }} - - - if: steps.cache-quiche.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.quiche-version }} --recursive https://github.com/cloudflare/quiche.git - cd quiche - #### Work-around https://github.com/curl/curl/issues/7927 ####### - #### See https://github.com/alexcrichton/cmake-rs/issues/131 #### - sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml - - cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose - mkdir -v quiche/deps/boringssl/src/lib - ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/ - - # include dir - # /home/runner/quiche/quiche/deps/boringssl/src/include - # lib dir - # /home/runner/quiche/quiche/deps/boringssl/src/lib - name: 'build quiche and boringssl' - - - name: cache mod_h2 - uses: actions/cache@v4 - id: cache-mod_h2 - env: - cache-name: cache-mod_h2 - with: - path: /home/runner/mod_h2 - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mod_h2-version }} - - - if: steps.cache-mod_h2.outputs.cache-hit != 'true' - run: | - cd $HOME - git clone --quiet --depth=1 -b ${{ env.mod_h2-version }} https://github.com/icing/mod_h2 - cd mod_h2 - autoreconf -fi - ./configure - make - name: 'build mod_h2' - - - run: | - cd $HOME/mod_h2 - sudo make install - name: 'install mod_h2' - - - uses: actions/checkout@v4 - - - run: | - sudo python3 -m pip install -r tests/requirements.txt -r tests/http/requirements.txt - name: 'install python test prereqs' - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure ${{ matrix.build.configure }} - name: 'configure' - - - run: make V=1 - name: 'make' - - - run: make V=1 examples - name: 'make examples' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-ci - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }}" - - - run: pytest -v tests - name: 'run pytest' - env: - TFLAGS: "${{ matrix.build.tflags }}" - CURL_CI: github diff --git a/deps/curl/.github/workflows/reuse.yml b/deps/curl/.github/workflows/reuse.yml deleted file mode 100644 index 0818bfaa..00000000 --- a/deps/curl/.github/workflows/reuse.yml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. -# -# SPDX-License-Identifier: curl - -name: REUSE compliance - -on: - push: - branches: - - master - - '*/ci' - pull_request: - branches: - - master - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: REUSE Compliance Check - uses: fsfe/reuse-action@v3 diff --git a/deps/curl/.github/workflows/spellcheck.yml b/deps/curl/.github/workflows/spellcheck.yml deleted file mode 100644 index e78a36ca..00000000 --- a/deps/curl/.github/workflows/spellcheck.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: spell -on: - push: - branches: - - master - paths: - - '**.md' - - '**/spellcheck.yml' - - '**/spellcheck.yaml' - - '.github/scripts/*' - pull_request: - branches: - - master - paths: - - '**.md' - - '**/spellcheck.yml' - - '**/spellcheck.yaml' - - '.github/scripts/*' - -permissions: {} - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: trim all man page *.md files - run: find docs -name "*.md" ! -name "_*" | xargs -n1 ./.github/scripts/cleancmd.pl - - - name: trim libcurl man page *.md files - run: find docs/libcurl -name "curl_*.md" -o -name "libcurl*.md" | xargs -n1 ./.github/scripts/cleanspell.pl - - - name: trim libcurl option man page *.md files - run: find docs/libcurl/opts -name "CURL*.md" | xargs -n1 ./.github/scripts/cleanspell.pl - - - name: trim cmdline docs markdown _*.md files - run: find docs/cmdline-opts -name "_*.md" | xargs -n1 ./.github/scripts/cleancmd.pl --no-header - - - name: setup the custom wordlist - run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt - - - name: Check Spelling - uses: rojopolis/spellcheck-github-actions@v0 - with: - config_path: .github/scripts/spellcheck.yaml diff --git a/deps/curl/.github/workflows/synopsis.yml b/deps/curl/.github/workflows/synopsis.yml deleted file mode 100644 index 0938f4bf..00000000 --- a/deps/curl/.github/workflows/synopsis.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: SYNOPSIS - -on: - push: - branches: - - master - - '*/ci' - paths: - - 'docs/libcurl/curl_*.3' - pull_request: - branches: - - master - paths: - - 'docs/libcurl/curl_*.3' - -jobs: - verify: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: verify-synopsis - run: ./.github/scripts/verify-synopsis.pl docs/libcurl/curl*.3 diff --git a/deps/curl/.github/workflows/torture.yml b/deps/curl/.github/workflows/torture.yml deleted file mode 100644 index a50b37f1..00000000 --- a/deps/curl/.github/workflows/torture.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: Linux torture - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: torture-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - -jobs: - autotools: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-latest' - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - build: - - name: torture - install: libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libnghttp2-dev libssh2-1-dev libc-ares-dev - configure: --with-openssl --enable-debug --enable-ares --enable-websockets - tflags: -n -t --shallow=25 !FTP - - name: torture-ftp - install: libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libnghttp2-dev libssh2-1-dev libc-ares-dev - configure: --with-openssl --enable-debug --enable-ares - tflags: -n -t --shallow=20 FTP - - steps: - - run: | - sudo apt-get update - sudo apt-get install libtool autoconf automake pkg-config stunnel4 ${{ matrix.build.install }} - sudo python3 -m pip install impacket - name: 'install prereqs and impacket' - - - uses: actions/checkout@v4 - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} - name: 'configure' - - - run: make V=1 - name: 'make' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-torture - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }}" diff --git a/deps/curl/.github/workflows/windows.yml b/deps/curl/.github/workflows/windows.yml new file mode 100644 index 00000000..06d5f126 --- /dev/null +++ b/deps/curl/.github/workflows/windows.yml @@ -0,0 +1,820 @@ +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +name: Windows + +'on': + push: + branches: + - master + - '*/ci' + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + - '.circleci/**' + - 'appveyor.*' + - 'packages/**' + - 'plan9/**' + - 'projects/**' + - 'winbuild/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + cygwin: + name: "cygwin, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.platform }} ${{ matrix.name }}" + runs-on: windows-latest + timeout-minutes: 45 + defaults: + run: + shell: C:\cygwin\bin\bash.exe '{0}' + env: + SHELLOPTS: 'igncr' + strategy: + matrix: + include: + - { build: 'automake', platform: 'x86_64', tflags: 'skiprun', config: '', name: 'openssl R' } + - { build: 'cmake' , platform: 'x86_64', tflags: '' , config: '-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DENABLE_THREADED_RESOLVER=OFF', name: 'openssl' } + fail-fast: false + steps: + - run: git config --global core.autocrlf input + shell: pwsh + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4 + with: + platform: ${{ matrix.platform }} + site: https://mirrors.kernel.org/sourceware/cygwin/ + # https://cygwin.com/cgi-bin2/package-grep.cgi + packages: >- + autoconf libtool gcc-core gcc-g++ binutils + ${{ matrix.build }} make ninja + openssh + libssl-devel + libssh2-devel + libpsl-devel + zlib-devel + libbrotli-devel + libnghttp2-devel + + - name: 'autotools autoreconf' + if: ${{ matrix.build == 'automake' }} + timeout-minutes: 2 + run: autoreconf -fi + + - name: 'autotools configure' + if: ${{ matrix.build == 'automake' }} + timeout-minutes: 5 + run: | + PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + --prefix="${HOME}"/install \ + --with-openssl \ + --with-libssh2 \ + --disable-dependency-tracking \ + ${{ matrix.config }} + + - name: 'autotools configure log' + if: ${{ matrix.build == 'automake' && !cancelled() }} + run: cat bld/config.log 2>/dev/null || true + + - name: 'curl_config.h' + if: ${{ matrix.build == 'automake' }} + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'autotools build' + if: ${{ matrix.build == 'automake' }} + timeout-minutes: 10 + run: make -C bld -j5 V=1 install + + - name: 'curl version' + if: ${{ matrix.build == 'automake' }} + timeout-minutes: 1 + run: | + find . -name '*.exe' -o -name '*.dll' + bld/src/curl.exe --disable --version + + - name: 'autotools build tests' + if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' }} + timeout-minutes: 15 + run: make -C bld -j5 V=1 -C tests + + - name: 'autotools run tests' + if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 15 + run: | + export TFLAGS='-j20 ${{ matrix.tflags }} ~615' + if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then + TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" + fi + make -C bld -j5 V=1 test-ci + + - name: 'cmake configure' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 5 + run: | + PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" + cmake -B bld -G Ninja ${options} \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DCURL_BROTLI=ON \ + ${{ matrix.config }} + + - name: 'cmake configure log' + if: ${{ matrix.build == 'cmake' && !cancelled() }} + run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true + + - name: 'curl_config.h' + if: ${{ matrix.build == 'cmake' }} + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'cmake build' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 10 + run: cmake --build bld --config '${{ matrix.type }}' + + - name: 'curl version' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 1 + run: | + find . -name '*.exe' -o -name '*.dll' + PATH="$PWD/bld/lib:$PATH" + bld/src/curl.exe --disable --version + + - name: 'cmake build tests' + if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }} + timeout-minutes: 15 + run: cmake --build bld --config '${{ matrix.type }}' --target testdeps + + - name: 'cmake run tests' + if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 15 + run: | + export TFLAGS='-j8 ${{ matrix.tflags }} ~615' + if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then + TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" + fi + PATH="$PWD/bld/lib:$PATH" + cmake --build bld --config '${{ matrix.type }}' --target test-ci + + - name: 'cmake build examples' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 5 + run: cmake --build bld --config '${{ matrix.type }}' --target curl-examples + + msys2: # both msys and mingw-w64 + name: "${{ matrix.sys == 'msys' && 'msys2' || 'mingw' }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.env }} ${{ matrix.name }} ${{ matrix.test }}" + runs-on: windows-latest + timeout-minutes: 30 + defaults: + run: + shell: msys2 {0} + strategy: + matrix: + include: + - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !1233', config: '--enable-debug --disable-threaded-resolver --disable-proxy', name: '!proxy' } + - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --disable-threaded-resolver', name: 'default' } + - { build: 'cmake' , sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233', config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF', name: 'default' } + - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233', config: '', name: 'default R' } + - { build: 'autotools', sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib', name: 'default' } + - { build: 'autotools', sys: 'mingw64', env: 'x86_64' , tflags: '~472 ~1299 ~1613' , config: '--enable-debug --enable-windows-unicode --enable-ares', name: 'c-ares U' } + # FIXME: WebSockets test results ignored due to frequent failures on native Windows: + - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: '~2301 ~2302' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', type: 'Debug', name: 'schannel c-ares U' } + - { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', type: 'Release', name: 'schannel R TrackMemory' } + - { 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', type: 'Release', name: 'openssl' } + - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Release', test: 'uwp', name: 'schannel R' } + - { 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', type: 'Debug', cflags: '-DCURL_SCHANNEL_DEV_DEBUG', name: 'schannel dev debug' } + - { build: 'cmake' , sys: 'mingw32', env: 'i686' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Release', name: 'schannel R' } + fail-fast: false + steps: + - run: git config --global core.autocrlf input + shell: pwsh + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2 + if: ${{ matrix.sys == 'msys' }} + with: + msystem: ${{ matrix.sys }} + # https://packages.msys2.org/search + install: >- + gcc + ${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || 'ninja' }} + openssh + openssl-devel + zlib-devel + brotli-devel + libnghttp2-devel + libpsl-devel + libssh2-devel + + - uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2 + if: ${{ matrix.sys != 'msys' }} + with: + msystem: ${{ matrix.sys }} + install: >- + mingw-w64-${{ matrix.env }}-cc + mingw-w64-${{ matrix.env }}-${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || '' }} + openssh + mingw-w64-${{ matrix.env }}-openssl + mingw-w64-${{ matrix.env }}-libssh2 + mingw-w64-${{ matrix.env }}-libpsl + mingw-w64-${{ matrix.env }}-c-ares + + - name: 'autotools autoreconf' + if: ${{ matrix.build == 'autotools' }} + timeout-minutes: 2 + run: autoreconf -fi + + - name: 'autotools configure' + if: ${{ matrix.build == 'autotools' }} + timeout-minutes: 5 + run: | + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + --prefix="${HOME}"/install \ + --with-openssl \ + --with-libssh2 \ + --disable-dependency-tracking \ + ${{ matrix.config }} + + - name: 'autotools configure log' + if: ${{ matrix.build == 'autotools' && !cancelled() }} + run: cat bld/config.log 2>/dev/null || true + + - name: 'curl_config.h' + if: ${{ matrix.build == 'autotools' }} + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'autotools build' + if: ${{ matrix.build == 'autotools' }} + timeout-minutes: 10 + run: make -C bld -j5 V=1 install + + - name: 'curl version' + if: ${{ matrix.build == 'autotools' }} + timeout-minutes: 1 + run: | + # avoid libtool's curl.exe wrapper + mv bld/src/.libs/curl.exe bld/src/curl.exe + mv bld/lib/.libs/*.dll bld/src || true + find . -name '*.exe' -o -name '*.dll' + bld/src/curl.exe --disable --version + + - name: 'autotools build tests' + if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' }} + timeout-minutes: 10 + run: make -C bld -j5 V=1 -C tests + + - name: 'install test prereqs' + if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 5 + run: | + /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe + + - name: 'autotools run tests' + if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 10 + run: | + export TFLAGS='-j8 ${{ matrix.tflags }} ~SCP' + if [ '${{ matrix.sys }}' != 'msys' ]; then + TFLAGS+=' ~2301 ~2302' # WebSockets' + TFLAGS+=' ~612 ~613 ~616 ~618' # SFTP + else + TFLAGS+=' ~SFTP' + fi + if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then + TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" + fi + PATH="$PATH:/c/Program Files (x86)/stunnel/bin" + make -C bld -j5 V=1 test-ci + + - name: 'autotools build examples' + if: ${{ matrix.build == 'autotools' && (matrix.tflags == 'skipall' || matrix.tflags == 'skiprun') }} + timeout-minutes: 5 + run: make -C bld -j5 V=1 examples + + - name: 'cmake configure' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 5 + run: | + if [[ '${{ matrix.env }}' = 'clang'* ]]; then + options='-DCMAKE_C_COMPILER=clang' + else + options='-DCMAKE_C_COMPILER=gcc' + fi + if [ '${{ matrix.test }}' = 'uwp' ]; then + options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0' + pacman --noconfirm --ask 20 --noprogressbar --sync --needed 'mingw-w64-${{ matrix.env }}-winstorecompat-git' + specs="$(realpath gcc-specs-uwp)" + gcc -dumpspecs | sed -e 's/-lmingwex/-lwindowsapp -lmingwex -lwindowsapp -lwindowsappcompat/' -e 's/-lmsvcrt/-lmsvcr120_app/' > "${specs}" + cflags="-specs=$(cygpath -w "${specs}") -DWINSTORECOMPAT -DWINAPI_FAMILY=WINAPI_FAMILY_APP" + # CMake (as of v3.26.4) gets confused and applies the MSVC rc.exe command-line + # template to windres. Reset it to the windres template manually: + rcopts=' -O coff ' + else + rcopts='' + fi + [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' + [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' + cmake -B bld -G Ninja ${options} \ + "-DCMAKE_C_FLAGS=${{ matrix.cflags }} ${cflags}" \ + "-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \ + '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DCURL_BROTLI=ON \ + ${{ matrix.config }} + + - name: 'cmake configure log' + if: ${{ matrix.build == 'cmake' && !cancelled() }} + run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true + + - name: 'curl_config.h' + if: ${{ matrix.build == 'cmake' }} + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'cmake build' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 10 + run: cmake --build bld --config '${{ matrix.type }}' + + - name: 'curl version' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 1 + run: | + find . -name '*.exe' -o -name '*.dll' + if [ '${{ matrix.test }}' != 'uwp' ]; then # UWP missing 'msvcr120_app.dll', fails with exit code 0xc0000135 + PATH="$PWD/bld/lib:$PATH" + bld/src/curl.exe --disable --version + fi + + - name: 'cmake build tests' + if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }} + timeout-minutes: 10 + run: cmake --build bld --config '${{ matrix.type }}' --target testdeps + + - name: 'install test prereqs' + if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 5 + run: | + /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe + + - name: 'cmake run tests' + if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 10 + run: | + export TFLAGS='-j8 ${{ matrix.tflags }} ~SCP' + if [ '${{ matrix.sys }}' != 'msys' ]; then + TFLAGS+=' ~WebSockets' + TFLAGS+=' ~612 ~613 ~616 ~618' # SFTP + else + TFLAGS+=' ~SFTP' + fi + if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then + TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" + fi + PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin" + cmake --build bld --config '${{ matrix.type }}' --target test-ci + + - name: 'cmake build examples' + if: ${{ matrix.build == 'cmake' }} + timeout-minutes: 5 + run: cmake --build bld --config '${{ matrix.type }}' --target curl-examples + + old-mingw-w64: + name: 'old-mingw, CM ${{ matrix.env }} ${{ matrix.name }}' + runs-on: windows-latest + timeout-minutes: 30 + defaults: + run: + shell: C:\msys64\usr\bin\bash.exe {0} + strategy: + matrix: + include: + - name: 'schannel' + env: '9.5.0-x86_64' + dir: 'mingw64' + url: 'https://github.com/brechtsanders/winlibs_mingw/releases/download/9.5.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-9.5.0-mingw-w64msvcrt-10.0.0-r1.7z' + config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF' + type: 'Release' + tflags: '~2301 ~2302 ~3027' + - name: 'schannel U' + env: '7.3.0-x86_64' + dir: 'mingw64' + url: 'https://downloads.sourceforge.net/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-win32/seh/x86_64-7.3.0-release-win32-seh-rt_v5-rev0.7z' + config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON' + type: 'Release' + tflags: '~2301 ~2302 ~3027 ~3023 ~3024 ~1451' + - name: 'schannel !unity' + env: '6.4.0-i686' + dir: 'mingw32' + url: 'https://downloads.sourceforge.net/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/6.4.0/threads-win32/dwarf/i686-6.4.0-release-win32-dwarf-rt_v5-rev0.7z' + config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF -DCMAKE_UNITY_BUILD=OFF' + type: 'Debug' + tflags: 'skiprun' + fail-fast: false + steps: + - name: 'cache compiler (gcc ${{ matrix.env }})' + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 + id: cache-compiler + with: + path: ~\my-cache + key: ${{ runner.os }}-mingw-w64-${{ matrix.env }} + + - name: 'install compiler (gcc ${{ matrix.env }})' + if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }} + timeout-minutes: 5 + run: | + cd "${USERPROFILE}" || exit 1 + mkdir my-cache + cd my-cache || exit 1 + curl --fail --silent --show-error --retry 3 --retry-connrefused --output pack.bin --location --proto-redir =https '${{ matrix.url }}' + pwd + 7z x -y pack.bin >/dev/null + rm -r -f pack.bin + ls -l + + - run: git config --global core.autocrlf input + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: 'cmake configure' + timeout-minutes: 5 + run: | + PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" + [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' + [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' + cmake -B bld -G 'MSYS Makefiles' ${options} \ + -DCMAKE_C_COMPILER=gcc \ + '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DCURL_USE_LIBPSL=OFF \ + ${{ matrix.config }} + + - name: 'cmake configure log' + if: ${{ !cancelled() }} + run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true + + - name: 'curl_config.h' + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'cmake build' + timeout-minutes: 5 + run: | + PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --parallel 5 + + - name: 'curl version' + timeout-minutes: 1 + run: | + PATH=/usr/bin find . -name '*.exe' -o -name '*.dll' + PATH="$PWD/bld/lib:$PATH" + bld/src/curl.exe --disable --version + + - name: 'cmake build tests' + if: ${{ matrix.tflags != 'skipall' }} + timeout-minutes: 10 + run: | + PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps + + - name: 'install test prereqs' + if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 5 + run: | + /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe + python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket + + - name: 'cmake run tests' + if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 10 + run: | + PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" + export TFLAGS='-j4 ~WebSockets ${{ matrix.tflags }}' + if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then + TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" + fi + PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin" + cmake --build bld --config '${{ matrix.type }}' --target test-ci + + - name: 'cmake build examples' + timeout-minutes: 5 + run: | + PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples + + linux-cross-mingw-w64: + name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}" + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + build: [autotools, cmake] + compiler: [gcc] + env: + TRIPLET: 'x86_64-w64-mingw32' + steps: + - name: 'install packages' + run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }} + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: 'autotools autoreconf' + if: ${{ matrix.build == 'autotools' }} + run: autoreconf -fi + + - name: 'autotools configure' + if: ${{ matrix.build == 'autotools' }} + run: | + mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ + --host=${TRIPLET} \ + --with-schannel --with-winidn \ + --without-libpsl \ + --disable-dependency-tracking + + - name: 'autotools configure log' + if: ${{ matrix.build == 'autotools' && !cancelled() }} + run: cat bld/config.log 2>/dev/null || true + + - name: 'curl_config.h' + if: ${{ matrix.build == 'autotools' }} + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'autotools build' + if: ${{ matrix.build == 'autotools' }} + run: make -C bld -j5 + + - name: 'autotools build examples' + if: ${{ matrix.build == 'autotools' }} + run: make -C bld -j5 examples + + - name: 'cmake configure' + if: ${{ matrix.build == 'cmake' }} + run: | + cmake -B bld -G Ninja \ + -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_C_COMPILER_TARGET=${TRIPLET} \ + -DCMAKE_C_COMPILER=${TRIPLET}-gcc \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \ + -DCURL_USE_LIBPSL=OFF + + - name: 'cmake configure log' + if: ${{ matrix.build == 'cmake' && !cancelled() }} + run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true + + - name: 'curl_config.h' + if: ${{ matrix.build == 'cmake' }} + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'cmake build' + if: ${{ matrix.build == 'cmake' }} + run: cmake --build bld + + - name: 'cmake build tests' + if: ${{ matrix.build == 'cmake' }} + run: cmake --build bld --target testdeps + + - name: 'cmake build examples' + if: ${{ matrix.build == 'cmake' }} + run: cmake --build bld --target curl-examples + + msvc: + name: 'msvc, CM ${{ matrix.arch }}-${{ matrix.plat }} ${{ matrix.name }}' + runs-on: windows-latest + timeout-minutes: 55 + defaults: + run: + shell: C:\msys64\usr\bin\bash.exe {0} + env: + VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' + VCPKG_DISABLE_METRICS: '1' + strategy: + matrix: + include: + - name: 'schannel MultiSSL U' + install: 'brotli zlib zstd libpsl nghttp2 libssh2[core,zlib] pkgconf gsasl openssl mbedtls' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: '~1516 ~2301 ~2302 ~2303 ~2307' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON -DCURL_USE_MBEDTLS=ON -DCURL_DEFAULT_SSL_BACKEND=schannel + -DCURL_USE_GSASL=ON -DUSE_WIN32_IDN=ON -DENABLE_UNICODE=ON + + - name: 'openssl' + install: 'brotli zlib zstd libpsl nghttp2 nghttp3 openssl libssh2 pkgconf gsasl c-ares libuv' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: '~1516 ~2301 ~2302 ~2303 ~2307' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON + -DCURL_USE_GSASL=ON -DENABLE_ARES=ON -DCURL_USE_LIBUV=ON + + - name: 'openssl' + install: 'brotli zlib zstd nghttp2 nghttp3 openssl libssh2' + arch: 'x64' + plat: 'uwp' + type: 'Debug' + tflags: 'skiprun' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON + -DCURL_USE_LIBPSL=OFF + + - name: 'libressl' + install: 'brotli zlib zstd libpsl nghttp2 libressl libssh2[core,zlib] pkgconf ngtcp2[libressl] nghttp3' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: '~1516 ~2301 ~2302 ~2303 ~2307' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_NGTCP2=ON + -DCURL_CA_SEARCH_SAFE=ON + + - name: 'boringssl-ECH' + install: 'brotli zlib zstd libpsl nghttp2 boringssl libssh2[core,zlib]' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: '~1516 ~2301 ~2302 ~2303 ~2307' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON + -DUSE_HTTPSRR=ON -DUSE_ECH=ON + + - name: 'wolfssl' + install: 'brotli zlib zstd libpsl nghttp2 wolfssl libssh2 pkgconf gsasl ngtcp2[wolfssl] nghttp3' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: '~1516' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=OFF -DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON + -DCURL_USE_GSASL=ON + + - name: 'mbedtls' + install: 'brotli zlib zstd libpsl nghttp2 mbedtls libssh pkgconf gsasl' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: '~1516' + # 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 + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON + -DCURL_USE_SCHANNEL=OFF -DCURL_USE_MBEDTLS=ON + -DCURL_USE_GSASL=ON + + - name: 'msh3' + install: 'brotli zlib zstd libpsl nghttp2 msh3 libssh2 pkgconf gsasl' + arch: 'x64' + plat: 'windows' + type: 'Debug' + tflags: 'skipall' + config: >- + -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON + -DCURL_USE_SCHANNEL=OFF -DUSE_MSH3=ON + -DCURL_USE_GSASL=ON + + fail-fast: false + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: 'vcpkg cache setup' + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: 'vcpkg versions' + timeout-minutes: 1 + run: | + git -C "$VCPKG_INSTALLATION_ROOT" show --no-patch --format='%H %ai' + vcpkg version + + - name: 'vcpkg build' + timeout-minutes: 35 + run: vcpkg x-set-installed ${{ matrix.install }} '--triplet=${{ matrix.arch }}-${{ matrix.plat }}' + + - name: 'cmake configure' + timeout-minutes: 5 + run: | + PATH="/c/msys64/usr/bin:$PATH" + cmake -B bld ${options} \ + "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \ + "-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed" \ + '-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-${{ matrix.plat }}' \ + -DCMAKE_VS_GLOBALS=TrackFileAccess=false \ + '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \ + -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCURL_WERROR=ON \ + -DBUILD_SHARED_LIBS=OFF \ + -DENABLE_DEBUG=ON \ + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE= \ + ${{ matrix.config }} + + - name: 'cmake configure log' + if: ${{ !cancelled() }} + run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true + + - name: 'curl_config.h' + run: | + echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' + grep -F '#define' bld/lib/curl_config.h | sort || true + + - name: 'cmake build' + timeout-minutes: 5 + run: | + PATH="/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --parallel 5 + + - name: 'curl version' + timeout-minutes: 1 + run: | + find . -name '*.exe' -o -name '*.dll' + if [ '${{ matrix.plat }}' != 'uwp' ]; then + PATH="$PWD/bld/lib:$PATH" + bld/src/curl.exe --disable --version + fi + + - name: 'cmake build tests' + if: ${{ matrix.tflags != 'skipall' }} + timeout-minutes: 10 + run: | + PATH="/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps + + - name: 'install test prereqs' + if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 5 + run: | + # GnuTLS is not fully functional on Windows, so skip the tests + # https://github.com/ShiftMediaProject/gnutls/issues/23 + if [[ '${{ matrix.name }}' != *'gnutls'* ]]; then + /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel openssh || true + fi + curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe + python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket + + - name: 'cmake run tests' + if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} + timeout-minutes: 10 + run: | + export TFLAGS='-j8 ~WebSockets ~SCP ~612 ${{ matrix.tflags }}' + if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then + TFLAGS+=' ~SFTP' + elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then + TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory + fi + PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64" + PATH="/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --target test-ci + + - name: 'cmake build examples' + timeout-minutes: 5 + run: | + PATH="/c/msys64/usr/bin:$PATH" + cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples diff --git a/deps/curl/.github/workflows/wolfssl.yml b/deps/curl/.github/workflows/wolfssl.yml deleted file mode 100644 index 5aaf3d1b..00000000 --- a/deps/curl/.github/workflows/wolfssl.yml +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -name: Linux wolfSSL - -on: - push: - branches: - - master - - '*/ci' - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - pull_request: - branches: - - master - paths-ignore: - - '**/*.md' - - '**/CMakeLists.txt' - - '.azure-pipelines.yml' - - '.circleci/**' - - '.cirrus.yml' - - 'appveyor.*' - - 'CMake/**' - - 'packages/**' - - 'plan9/**' - - 'projects/**' - - 'winbuild/**' - -concurrency: - # Hardcoded workflow filename as workflow name above is just Linux again - group: wolfssl-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -permissions: {} - -env: - MAKEFLAGS: -j 3 - -jobs: - autotools: - name: ${{ matrix.build.name }} - runs-on: 'ubuntu-latest' - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - build: - - name: wolfssl (configured with --enable-all) - install: - configure: LDFLAGS="-Wl,-rpath,$HOME/wssl/lib" --with-wolfssl=$HOME/wssl --enable-debug - wolfssl-configure: --enable-all - - name: wolfssl (configured with --enable-opensslextra) - install: - configure: LDFLAGS="-Wl,-rpath,$HOME/wssl/lib" --with-wolfssl=$HOME/wssl --enable-debug - wolfssl-configure: --enable-opensslextra - - steps: - - run: | - sudo apt-get update - sudo apt-get install libtool autoconf automake pkg-config stunnel4 libpsl-dev ${{ matrix.build.install }} - sudo python3 -m pip install impacket - name: 'install prereqs and impacket' - - - run: | - WOLFSSL_VER=5.6.3 - curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VER-stable.tar.gz - tar -xzf v$WOLFSSL_VER-stable.tar.gz - cd wolfssl-$WOLFSSL_VER-stable - ./autogen.sh - ./configure --enable-tls13 ${{ matrix.build.wolfssl-configure }} --enable-harden --prefix=$HOME/wssl - make install - name: 'install wolfssl' - - - uses: actions/checkout@v4 - - - run: autoreconf -fi - name: 'autoreconf' - - - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} - name: 'configure' - - - run: make V=1 - name: 'make' - - - run: make V=1 examples - name: 'make examples' - - - run: make V=1 -C tests - name: 'make tests' - - - run: make V=1 test-ci - name: 'run tests' - env: - TFLAGS: "${{ matrix.build.tflags }}" diff --git a/deps/curl/.gitignore b/deps/curl/.gitignore index 2d5c2923..55768f6e 100644 --- a/deps/curl/.gitignore +++ b/deps/curl/.gitignore @@ -27,7 +27,6 @@ /builds/ /stats/ __pycache__ -CHANGES.dist Debug INSTALL Makefile @@ -37,6 +36,7 @@ TAGS aclocal.m4 aclocal.m4.bak autom4te.cache +buildinfo.txt compile config.cache config.guess @@ -65,3 +65,4 @@ curl_fuzzer_seed_corpus.zip libstandaloneengine.a tests/string tests/config +tests/ech-log/ diff --git a/deps/curl/.mailmap b/deps/curl/.mailmap index 8d2965e0..56a1e7c4 100644 --- a/deps/curl/.mailmap +++ b/deps/curl/.mailmap @@ -1,6 +1,6 @@ Guenter Knauf -Gisle Vanem -Gisle Vanem +Gisle Vanem +Gisle Vanem Alessandro Ghedini Alessandro Ghedini Björn Stenberg @@ -108,3 +108,7 @@ Brad Harder Derzsi Dániel Michael Osipov <1983-01-06@gmx.net> Michael Osipov +Christian Weisgerber +Moritz Buhl +Aki Sakurai <75532970+AkiSakurai@users.noreply.github.com> +Sinkevich Artem diff --git a/deps/curl/.reuse/dep5 b/deps/curl/.reuse/dep5 deleted file mode 100644 index d51e5b9c..00000000 --- a/deps/curl/.reuse/dep5 +++ /dev/null @@ -1,102 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: curl -Upstream-Contact: Daniel Stenberg -Source: https://curl.se - -# Tests -Files: tests/data/test* tests/certs/* tests/stunnel.pem tests/valgrind.supp -Copyright: Daniel Stenberg, , et al. -License: curl - -# Markdown documentation in docs/ -Files: docs/*.md -Copyright: Daniel Stenberg, , et al. -License: curl - -# Docs in docs/ -Files: docs/FAQ docs/INSTALL docs/INSTALL.cmake docs/KNOWN_BUGS docs/MAIL-ETIQUETTE docs/THANKS docs/TODO docs/cmdline-opts/page-footer docs/libcurl/curl_multi_socket_all.3 docs/libcurl/curl_strnequal.3 docs/libcurl/symbols-in-versions docs/options-in-versions -Copyright: Daniel Stenberg, , et al. -License: curl - -# Windows -Files: projects/Windows/* -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: libcurl.def -Copyright: Daniel Stenberg, , et al. -License: curl - -# Single files we do not want to edit directly -Files: CHANGES -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: GIT-INFO.md -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: RELEASE-NOTES -Copyright: Daniel Stenberg, , et al. -License: curl - -# checksrc control files -Files: lib/.checksrc src/.checksrc docs/examples/.checksrc tests/libtest/.checksrc -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: lib/libcurl.plist.in -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: lib/libcurl.vers.in -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: packages/OS400/README.OS400 -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: packages/vms/build_vms.com -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: packages/vms/curl_release_note_start.txt -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: packages/vms/curlmsg.sdl -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: packages/vms/macro32_exactcase.patch -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: packages/vms/readme -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: plan9/README -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: projects/wolfssl_override.props -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: README -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: .github/ISSUE_TEMPLATE/bug_report.md -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: .mailmap -Copyright: Daniel Stenberg, , et al. -License: curl - -Files: .github/dependabot.yml -Copyright: Daniel Stenberg, , et al. -License: curl diff --git a/deps/curl/CHANGES b/deps/curl/CHANGES deleted file mode 100644 index 3e2cd994..00000000 --- a/deps/curl/CHANGES +++ /dev/null @@ -1,7 +0,0 @@ -See https://curl.se/changes.html for the edited and human readable online -version of what has changed over the years in different curl releases. - -Generate a CHANGES file like the one present in every release like this: - -$ git log --pretty=fuller --no-color --date=short --decorate=full | \ - ./scripts/log2changes.pl diff --git a/deps/curl/CHANGES.md b/deps/curl/CHANGES.md new file mode 100644 index 00000000..6e2f7c6b --- /dev/null +++ b/deps/curl/CHANGES.md @@ -0,0 +1,12 @@ + + +In a release tarball, check the RELEASES-NOTES file for what was done in the +most recent release. In a git check-out, that file mentions changes that have +been done since the previous release. + +See the online [changelog](https://curl.se/changes.html) for the edited and +human readable version of what has changed in different curl releases. diff --git a/deps/curl/CMake/CurlSymbolHiding.cmake b/deps/curl/CMake/CurlSymbolHiding.cmake index 8289b492..16ec3fec 100644 --- a/deps/curl/CMake/CurlSymbolHiding.cmake +++ b/deps/curl/CMake/CurlSymbolHiding.cmake @@ -21,64 +21,46 @@ # SPDX-License-Identifier: curl # ########################################################################### -include(CheckCSourceCompiles) - -option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON) +option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON) mark_as_advanced(CURL_HIDDEN_SYMBOLS) -if(WIN32 AND ENABLE_CURLDEBUG) - # We need to export internal debug functions (e.g. curl_dbg_*), so disable - # symbol hiding for debug builds. +if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG)) + # We need to export internal debug functions, + # 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) endif() -if(CURL_HIDDEN_SYMBOLS) - set(SUPPORTS_SYMBOL_HIDING FALSE) +set(CURL_HIDES_PRIVATE_SYMBOLS FALSE) +unset(CURL_EXTERN_SYMBOL) +unset(CURL_CFLAG_SYMBOLS_HIDE) +if(CURL_HIDDEN_SYMBOLS) if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MSVC) - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") + set(CURL_HIDES_PRIVATE_SYMBOLS TRUE) + set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))") + set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") elseif(CMAKE_COMPILER_IS_GNUCC) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) - # note: this is considered buggy prior to 4.0 but the autotools don't care, so let's ignore that fact - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") + # Note: This is considered buggy prior to 4.0 but the autotools do not care, so let us ignore that fact + set(CURL_HIDES_PRIVATE_SYMBOLS TRUE) + set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))") + set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") endif() elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__global") - set(_CFLAG_SYMBOLS_HIDE "-xldscope=hidden") - elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) - # note: this should probably just check for version 9.1.045 but I'm not 100% sure - # so let's do it the same way autotools do. - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") - check_c_source_compiles("#include - int main (void) { printf(\"icc fvisibility bug test\"); return 0; }" _no_bug) - if(NOT _no_bug) - set(SUPPORTS_SYMBOL_HIDING FALSE) - set(_SYMBOL_EXTERN "") - set(_CFLAG_SYMBOLS_HIDE "") - endif() + set(CURL_HIDES_PRIVATE_SYMBOLS TRUE) + set(CURL_EXTERN_SYMBOL "__global") + set(CURL_CFLAG_SYMBOLS_HIDE "-xldscope=hidden") + elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) # Requires 9.1.045 + set(CURL_HIDES_PRIVATE_SYMBOLS TRUE) + set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))") + set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") elseif(MSVC) - set(SUPPORTS_SYMBOL_HIDING TRUE) - endif() - - set(HIDES_CURL_PRIVATE_SYMBOLS ${SUPPORTS_SYMBOL_HIDING}) -elseif(MSVC) - if(NOT CMAKE_VERSION VERSION_LESS 3.7) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) #present since 3.4.3 but broken - set(HIDES_CURL_PRIVATE_SYMBOLS FALSE) - else() - message(WARNING "Hiding private symbols regardless CURL_HIDDEN_SYMBOLS being disabled.") - set(HIDES_CURL_PRIVATE_SYMBOLS TRUE) + set(CURL_HIDES_PRIVATE_SYMBOLS TRUE) endif() else() - set(HIDES_CURL_PRIVATE_SYMBOLS FALSE) + if(MSVC) + # Note: This option is prone to export non-curl extra symbols. + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + endif() endif() - -set(CURL_CFLAG_SYMBOLS_HIDE ${_CFLAG_SYMBOLS_HIDE}) -set(CURL_EXTERN_SYMBOL ${_SYMBOL_EXTERN}) diff --git a/deps/curl/CMake/CurlTests.c b/deps/curl/CMake/CurlTests.c index 83d743d3..03346187 100644 --- a/deps/curl/CMake/CurlTests.c +++ b/deps/curl/CMake/CurlTests.c @@ -50,6 +50,7 @@ int main(void) int flags = 0; if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) return 1; + ; return 0; } #endif @@ -152,22 +153,19 @@ int main(void) { return 0; } #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, + 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)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -int main(void) { ; return 0; } +int main(void) { return 0; } #endif #ifdef HAVE_IOCTLSOCKET /* includes start */ #ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # include #endif int main(void) @@ -184,9 +182,6 @@ int main(void) #ifdef HAVE_IOCTLSOCKET_CAMEL /* includes start */ #ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # include #endif int main(void) @@ -202,9 +197,6 @@ int main(void) #ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO /* includes start */ #ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # include #endif int main(void) @@ -221,14 +213,11 @@ int main(void) #ifdef HAVE_IOCTLSOCKET_FIONBIO /* includes start */ #ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # include #endif int main(void) { - int flags = 0; + unsigned long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ; @@ -296,9 +285,6 @@ int main(void) #ifdef HAVE_SETSOCKOPT_SO_NONBLOCK /* includes start */ #ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # include #endif /* includes start */ @@ -337,7 +323,7 @@ int main(void) #include #include -/* float, because a pointer can't be implicitly cast to float */ +/* Float, because a pointer cannot be implicitly cast to float */ void check(float f) {} int main(void) @@ -380,7 +366,7 @@ int main(void) #ifdef HAVE_BUILTIN_AVAILABLE int main(void) { - if(__builtin_available(macOS 10.12, *)) {} + if(__builtin_available(macOS 10.12, iOS 5.0, *)) {} return 0; } #endif @@ -409,9 +395,6 @@ int main(void) #ifdef HAVE_WIN32_WINNT /* includes start */ #ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # ifndef NOGDI # define NOGDI # endif diff --git a/deps/curl/CMake/FindBearSSL.cmake b/deps/curl/CMake/FindBearSSL.cmake index 56a064ea..ff55be0f 100644 --- a/deps/curl/CMake/FindBearSSL.cmake +++ b/deps/curl/CMake/FindBearSSL.cmake @@ -21,12 +21,38 @@ # SPDX-License-Identifier: curl # ########################################################################### -find_path(BEARSSL_INCLUDE_DIRS bearssl.h) +# Find the BearSSL library +# +# Input variables: +# +# - `BEARSSL_INCLUDE_DIR`: The BearSSL include directory. +# - `BEARSSL_LIBRARY`: Path to `bearssl` library. +# +# Result variables: +# +# - `BEARSSL_FOUND`: System has BearSSL. +# - `BEARSSL_INCLUDE_DIRS`: The BearSSL include directories. +# - `BEARSSL_LIBRARIES`: The BearSSL library names. -find_library(BEARSSL_LIBRARY bearssl) +if(DEFINED BEARSSL_INCLUDE_DIRS AND NOT DEFINED BEARSSL_INCLUDE_DIR) + message(WARNING "BEARSSL_INCLUDE_DIRS is deprecated, use BEARSSL_INCLUDE_DIR instead.") + set(BEARSSL_INCLUDE_DIR "${BEARSSL_INCLUDE_DIRS}") + unset(BEARSSL_INCLUDE_DIRS) +endif() + +find_path(BEARSSL_INCLUDE_DIR NAMES "bearssl.h") +find_library(BEARSSL_LIBRARY NAMES "bearssl") include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(BEARSSL DEFAULT_MSG - BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY) +find_package_handle_standard_args(BearSSL + REQUIRED_VARS + BEARSSL_INCLUDE_DIR + BEARSSL_LIBRARY +) -mark_as_advanced(BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY) +if(BEARSSL_FOUND) + set(BEARSSL_INCLUDE_DIRS ${BEARSSL_INCLUDE_DIR}) + set(BEARSSL_LIBRARIES ${BEARSSL_LIBRARY}) +endif() + +mark_as_advanced(BEARSSL_INCLUDE_DIR BEARSSL_LIBRARY) diff --git a/deps/curl/CMake/FindBrotli.cmake b/deps/curl/CMake/FindBrotli.cmake index 11ab7f82..767abf07 100644 --- a/deps/curl/CMake/FindBrotli.cmake +++ b/deps/curl/CMake/FindBrotli.cmake @@ -21,23 +21,60 @@ # SPDX-License-Identifier: curl # ########################################################################### -include(FindPackageHandleStandardArgs) +# Find the brotli library +# +# Input variables: +# +# - `BROTLI_INCLUDE_DIR`: The brotli include directory. +# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library. +# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library. +# +# Result variables: +# +# - `BROTLI_FOUND`: System has brotli. +# - `BROTLI_INCLUDE_DIRS`: The brotli include directories. +# - `BROTLI_LIBRARIES`: The brotli library names. +# - `BROTLI_VERSION`: Version of brotli. -find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") +if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_BROTLI "libbrotlidec") +endif() -find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon) -find_library(BROTLIDEC_LIBRARY NAMES brotlidec) - -find_package_handle_standard_args(Brotli - FOUND_VAR - BROTLI_FOUND - REQUIRED_VARS - BROTLIDEC_LIBRARY - BROTLICOMMON_LIBRARY - BROTLI_INCLUDE_DIR - FAIL_MESSAGE - "Could NOT find Brotli" +find_path(BROTLI_INCLUDE_DIR "brotli/decode.h" + HINTS + ${PC_BROTLI_INCLUDEDIR} + ${PC_BROTLI_INCLUDE_DIRS} ) -set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR}) -set(BROTLI_LIBRARIES ${BROTLICOMMON_LIBRARY} ${BROTLIDEC_LIBRARY}) +find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon" + HINTS + ${PC_BROTLI_LIBDIR} + ${PC_BROTLI_LIBRARY_DIRS} +) +find_library(BROTLIDEC_LIBRARY NAMES "brotlidec" + HINTS + ${PC_BROTLI_LIBDIR} + ${PC_BROTLI_LIBRARY_DIRS} +) + +if(PC_BROTLI_VERSION) + set(BROTLI_VERSION ${PC_BROTLI_VERSION}) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Brotli + REQUIRED_VARS + BROTLI_INCLUDE_DIR + BROTLIDEC_LIBRARY + BROTLICOMMON_LIBRARY + VERSION_VAR + BROTLI_VERSION +) + +if(BROTLI_FOUND) + 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) diff --git a/deps/curl/CMake/FindCares.cmake b/deps/curl/CMake/FindCares.cmake new file mode 100644 index 00000000..ac55be16 --- /dev/null +++ b/deps/curl/CMake/FindCares.cmake @@ -0,0 +1,90 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 c-ares library +# +# Input variables: +# +# - `CARES_INCLUDE_DIR`: The c-ares include directory. +# - `CARES_LIBRARY`: Path to `cares` library. +# +# Result variables: +# +# - `CARES_FOUND`: System has c-ares. +# - `CARES_INCLUDE_DIRS`: The c-ares include directories. +# - `CARES_LIBRARIES`: The c-ares library names. +# - `CARES_VERSION`: Version of c-ares. + +if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_CARES "libcares") +endif() + +find_path(CARES_INCLUDE_DIR NAMES "ares.h" + HINTS + ${PC_CARES_INCLUDEDIR} + ${PC_CARES_INCLUDE_DIRS} +) + +find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares" + HINTS + ${PC_CARES_LIBDIR} + ${PC_CARES_LIBRARY_DIRS} +) + +if(PC_CARES_VERSION) + set(CARES_VERSION ${PC_CARES_VERSION}) +elseif(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h") + set(_version_regex1 "#[\t ]*define[\t ]+ARES_VERSION_MAJOR[\t ]+([0-9]+).*") + set(_version_regex2 "#[\t ]*define[\t ]+ARES_VERSION_MINOR[\t ]+([0-9]+).*") + set(_version_regex3 "#[\t ]*define[\t ]+ARES_VERSION_PATCH[\t ]+([0-9]+).*") + file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str1 REGEX "${_version_regex1}") + file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str2 REGEX "${_version_regex2}") + file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str3 REGEX "${_version_regex3}") + string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}") + string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}") + string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}") + set(CARES_VERSION "${_version_str1}.${_version_str2}.${_version_str3}") + unset(_version_regex1) + unset(_version_regex2) + unset(_version_regex3) + unset(_version_str1) + unset(_version_str2) + unset(_version_str3) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Cares + REQUIRED_VARS + CARES_INCLUDE_DIR + CARES_LIBRARY + VERSION_VAR + CARES_VERSION +) + +if(CARES_FOUND) + set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR}) + set(CARES_LIBRARIES ${CARES_LIBRARY}) +endif() + +mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY) diff --git a/deps/curl/CMake/FindGSS.cmake b/deps/curl/CMake/FindGSS.cmake index b244e610..2224f27a 100644 --- a/deps/curl/CMake/FindGSS.cmake +++ b/deps/curl/CMake/FindGSS.cmake @@ -21,292 +21,335 @@ # SPDX-License-Identifier: curl # ########################################################################### -# - Try to find the GSS Kerberos library -# Once done this will define +# Find the GSS Kerberos library # -# GSS_ROOT_DIR - Set this variable to the root installation of GSS +# Input variables: # -# Read-Only variables: -# GSS_FOUND - system has the Heimdal library -# GSS_FLAVOUR - "MIT" or "Heimdal" if anything found. -# GSS_INCLUDE_DIR - the Heimdal include directory -# GSS_LIBRARIES - The libraries needed to use GSS -# GSS_LINK_DIRECTORIES - Directories to add to linker search path -# GSS_LINKER_FLAGS - Additional linker flags -# GSS_COMPILER_FLAGS - Additional 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'll be set to "unknown" +# - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment) +# +# Result variables: +# +# - `GSS_FOUND`: System has the Heimdal library. +# - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found. +# - `GSS_INCLUDE_DIRS`: The GSS include directories. +# - `GSS_LIBRARIES`: The GSS library names. +# - `GSS_LIBRARY_DIRS`: The GSS library directories. +# - `GSS_LDFLAGS`: Required linker flags. +# - `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" -set(_MIT_MODNAME mit-krb5-gssapi) -set(_HEIMDAL_MODNAME heimdal-gssapi) +set(_gnu_modname "gss") +set(_mit_modname "mit-krb5-gssapi") +set(_heimdal_modname "heimdal-gssapi") include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckTypeSize) -set(_GSS_ROOT_HINTS - "${GSS_ROOT_DIR}" - "$ENV{GSS_ROOT_DIR}" +set(_gss_root_hints + "${GSS_ROOT_DIR}" + "$ENV{GSS_ROOT_DIR}" ) -# try to find library using system pkg-config if user didn't specify root dir +# Try to find library using system pkg-config if user did not specify root dir if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}") - if(UNIX) + if(CURL_USE_PKGCONFIG) find_package(PkgConfig QUIET) - pkg_search_module(_GSS_PKG ${_MIT_MODNAME} ${_HEIMDAL_MODNAME}) - list(APPEND _GSS_ROOT_HINTS "${_GSS_PKG_PREFIX}") - elseif(WIN32) - list(APPEND _GSS_ROOT_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]") + pkg_search_module(_GSS ${_gnu_modname} ${_mit_modname} ${_heimdal_modname}) + list(APPEND _gss_root_hints "${_GSS_PREFIX}") + endif() + if(WIN32) + list(APPEND _gss_root_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]") endif() endif() -if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approach. - find_file(_GSS_CONFIGURE_SCRIPT - NAMES - "krb5-config" - HINTS - ${_GSS_ROOT_HINTS} - PATH_SUFFIXES - bin - NO_CMAKE_PATH - NO_CMAKE_ENVIRONMENT_PATH +if(NOT _GSS_FOUND) # Not found by pkg-config. Let us take more traditional approach. + find_file(_gss_configure_script + NAMES + "krb5-config" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "bin" + NO_CMAKE_PATH + NO_CMAKE_ENVIRONMENT_PATH ) - # if not found in user-supplied directories, maybe system knows better - find_file(_GSS_CONFIGURE_SCRIPT - NAMES - "krb5-config" - PATH_SUFFIXES - bin + # If not found in user-supplied directories, maybe system knows better + find_file(_gss_configure_script + NAMES + "krb5-config" + PATH_SUFFIXES + "bin" ) - if(_GSS_CONFIGURE_SCRIPT) + if(_gss_configure_script) execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--cflags" "gssapi" - OUTPUT_VARIABLE _GSS_CFLAGS - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - message(STATUS "CFLAGS: ${_GSS_CFLAGS}") - if(NOT _GSS_CONFIGURE_FAILED) # 0 means success - # should also work in an odd case when multiple directories are given + COMMAND ${_gss_configure_script} "--cflags" "gssapi" + OUTPUT_VARIABLE _GSS_CFLAGS + RESULT_VARIABLE _gss_configure_failed + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + message(STATUS "FindGSS CFLAGS: ${_GSS_CFLAGS}") + if(NOT _gss_configure_failed) # 0 means success + # Should also work in an odd case when multiple directories are given string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS) string(REGEX REPLACE " +-I" ";" _GSS_CFLAGS "${_GSS_CFLAGS}") string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1" _GSS_CFLAGS "${_GSS_CFLAGS}") - foreach(_flag ${_GSS_CFLAGS}) + foreach(_flag IN LISTS _GSS_CFLAGS) if(_flag MATCHES "^-I.*") string(REGEX REPLACE "^-I" "" _val "${_flag}") - list(APPEND _GSS_INCLUDE_DIR "${_val}") + list(APPEND _GSS_INCLUDE_DIRS "${_val}") else() - list(APPEND _GSS_COMPILER_FLAGS "${_flag}") + list(APPEND _GSS_CFLAGS "${_flag}") endif() endforeach() endif() execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--libs" "gssapi" - OUTPUT_VARIABLE _GSS_LIB_FLAGS - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND ${_gss_configure_script} "--libs" "gssapi" + OUTPUT_VARIABLE _gss_lib_flags + RESULT_VARIABLE _gss_configure_failed + OUTPUT_STRIP_TRAILING_WHITESPACE ) - message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}") + message(STATUS "FindGSS LDFLAGS: ${_gss_lib_flags}") - if(NOT _GSS_CONFIGURE_FAILED) # 0 means success - # this script gives us libraries and link directories. Blah. We have to deal with it. - string(STRIP "${_GSS_LIB_FLAGS}" _GSS_LIB_FLAGS) - string(REGEX REPLACE " +-(L|l)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}") - string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}") + if(NOT _gss_configure_failed) # 0 means success + # This script gives us libraries and link directories. Blah. We have to deal with it. + string(STRIP "${_gss_lib_flags}" _gss_lib_flags) + string(REGEX REPLACE " +-(L|l)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}") + string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}") - foreach(_flag ${_GSS_LIB_FLAGS}) + foreach(_flag IN LISTS _gss_lib_flags) if(_flag MATCHES "^-l.*") string(REGEX REPLACE "^-l" "" _val "${_flag}") list(APPEND _GSS_LIBRARIES "${_val}") elseif(_flag MATCHES "^-L.*") string(REGEX REPLACE "^-L" "" _val "${_flag}") - list(APPEND _GSS_LINK_DIRECTORIES "${_val}") + list(APPEND _GSS_LIBRARY_DIRS "${_val}") else() - list(APPEND _GSS_LINKER_FLAGS "${_flag}") + list(APPEND _GSS_LDFLAGS "${_flag}") endif() endforeach() endif() execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--version" - OUTPUT_VARIABLE _GSS_VERSION - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND ${_gss_configure_script} "--version" + OUTPUT_VARIABLE _GSS_VERSION + RESULT_VARIABLE _gss_configure_failed + OUTPUT_STRIP_TRAILING_WHITESPACE ) - # older versions may not have the "--version" parameter. In this case we just don't care. - if(_GSS_CONFIGURE_FAILED) + # Older versions may not have the "--version" parameter. In this case we just do not care. + if(_gss_configure_failed) set(_GSS_VERSION 0) endif() execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--vendor" - OUTPUT_VARIABLE _GSS_VENDOR - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND ${_gss_configure_script} "--vendor" + OUTPUT_VARIABLE _gss_vendor + RESULT_VARIABLE _gss_configure_failed + OUTPUT_STRIP_TRAILING_WHITESPACE ) - # older versions may not have the "--vendor" parameter. In this case we just don't care. - if(_GSS_CONFIGURE_FAILED) - set(GSS_FLAVOUR "Heimdal") # most probably, shouldn't really matter + # Older versions may not have the "--vendor" parameter. In this case we just do not care. + if(_gss_configure_failed) + set(GSS_FLAVOUR "Heimdal") # most probably, should not really matter else() - if(_GSS_VENDOR MATCHES ".*H|heimdal.*") + if(_gss_vendor MATCHES ".*H|heimdal.*") set(GSS_FLAVOUR "Heimdal") else() set(GSS_FLAVOUR "MIT") endif() endif() - else() # either there is no config script or we are on a platform that doesn't provide one (Windows?) + else() # Either there is no config script or we are on a platform that does not provide one (Windows?) - find_path(_GSS_INCLUDE_DIR - NAMES - "gssapi/gssapi.h" - HINTS - ${_GSS_ROOT_HINTS} - PATH_SUFFIXES - include - inc + find_path(_GSS_INCLUDE_DIRS NAMES "gssapi/gssapi.h" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "include" + "inc" ) - if(_GSS_INCLUDE_DIR) #jay, we've found something - set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIR}") - check_include_files( "gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _GSS_HAVE_MIT_HEADERS) + if(_GSS_INCLUDE_DIRS) # jay, we have found something + cmake_push_check_state() + set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIRS}") + check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers) - if(_GSS_HAVE_MIT_HEADERS) + if(_gss_have_mit_headers) set(GSS_FLAVOUR "MIT") else() - # prevent compiling the header - just check if we can include it - list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__ROKEN_H__) - check_include_file( "roken.h" _GSS_HAVE_ROKEN_H) + # Prevent compiling the header - just check if we can include it + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__") + check_include_file("roken.h" _gss_have_roken_h) - check_include_file( "heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H) - if(_GSS_HAVE_ROKEN_H OR _GSS_HAVE_HEIMDAL_ROKEN_H) + check_include_file("heimdal/roken.h" _gss_have_heimdal_roken_h) + if(_gss_have_roken_h OR _gss_have_heimdal_roken_h) set(GSS_FLAVOUR "Heimdal") endif() - list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D__ROKEN_H__) endif() + cmake_pop_check_state() else() - # I'm not convinced if this is the right way but this is what autotools do at the moment - find_path(_GSS_INCLUDE_DIR - NAMES - "gssapi.h" - HINTS - ${_GSS_ROOT_HINTS} - PATH_SUFFIXES - include - inc + # I am not convinced if this is the right way but this is what autotools do at the moment + find_path(_GSS_INCLUDE_DIRS NAMES "gssapi.h" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "include" + "inc" ) - if(_GSS_INCLUDE_DIR) + if(_GSS_INCLUDE_DIRS) set(GSS_FLAVOUR "Heimdal") + else() + find_path(_GSS_INCLUDE_DIRS NAMES "gss.h" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "include" + ) + + if(_GSS_INCLUDE_DIRS) + set(GSS_FLAVOUR "GNU") + endif() endif() endif() - # if we have headers, check if we can link libraries + # If we have headers, check if we can link libraries if(GSS_FLAVOUR) - set(_GSS_LIBDIR_SUFFIXES "") - set(_GSS_LIBDIR_HINTS ${_GSS_ROOT_HINTS}) - get_filename_component(_GSS_CALCULATED_POTENTIAL_ROOT "${_GSS_INCLUDE_DIR}" PATH) - list(APPEND _GSS_LIBDIR_HINTS ${_GSS_CALCULATED_POTENTIAL_ROOT}) + set(_gss_libdir_suffixes "") + set(_gss_libdir_hints ${_gss_root_hints}) + get_filename_component(_gss_calculated_potential_root "${_GSS_INCLUDE_DIRS}" DIRECTORY) + list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root}) if(WIN32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) - list(APPEND _GSS_LIBDIR_SUFFIXES "lib/AMD64") - if(GSS_FLAVOUR STREQUAL "MIT") - set(_GSS_LIBNAME "gssapi64") + list(APPEND _gss_libdir_suffixes "lib/AMD64") + if(GSS_FLAVOUR STREQUAL "GNU") + set(_gss_libname "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + set(_gss_libname "gssapi64") else() - set(_GSS_LIBNAME "libgssapi") + set(_gss_libname "libgssapi") endif() else() - list(APPEND _GSS_LIBDIR_SUFFIXES "lib/i386") - if(GSS_FLAVOUR STREQUAL "MIT") - set(_GSS_LIBNAME "gssapi32") + list(APPEND _gss_libdir_suffixes "lib/i386") + if(GSS_FLAVOUR STREQUAL "GNU") + set(_gss_libname "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + set(_gss_libname "gssapi32") else() - set(_GSS_LIBNAME "libgssapi") + set(_gss_libname "libgssapi") endif() endif() else() - list(APPEND _GSS_LIBDIR_SUFFIXES "lib;lib64") # those suffixes are not checked for HINTS - if(GSS_FLAVOUR STREQUAL "MIT") - set(_GSS_LIBNAME "gssapi_krb5") + list(APPEND _gss_libdir_suffixes "lib;lib64") # those suffixes are not checked for HINTS + if(GSS_FLAVOUR STREQUAL "GNU") + set(_gss_libname "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + set(_gss_libname "gssapi_krb5") else() - set(_GSS_LIBNAME "gssapi") + set(_gss_libname "gssapi") endif() endif() - find_library(_GSS_LIBRARIES - NAMES - ${_GSS_LIBNAME} - HINTS - ${_GSS_LIBDIR_HINTS} - PATH_SUFFIXES - ${_GSS_LIBDIR_SUFFIXES} + find_library(_GSS_LIBRARIES NAMES ${_gss_libname} + HINTS + ${_gss_libdir_hints} + PATH_SUFFIXES + ${_gss_libdir_suffixes} ) - endif() endif() else() - if(_GSS_PKG_${_MIT_MODNAME}_VERSION) + # _GSS_MODULE_NAME set since CMake 3.16 + if(_GSS_MODULE_NAME STREQUAL _gnu_modname OR _GSS_${_gnu_modname}_VERSION) + set(GSS_FLAVOUR "GNU") + if(NOT _GSS_VERSION) # for old CMake versions? + set(_GSS_VERSION ${_GSS_${_gnu_modname}_VERSION}) + endif() + elseif(_GSS_MODULE_NAME STREQUAL _mit_modname OR _GSS_${_mit_modname}_VERSION) set(GSS_FLAVOUR "MIT") - set(_GSS_VERSION _GSS_PKG_${_MIT_MODNAME}_VERSION) + if(NOT _GSS_VERSION) # for old CMake versions? + set(_GSS_VERSION ${_GSS_${_mit_modname}_VERSION}) + endif() else() set(GSS_FLAVOUR "Heimdal") - set(_GSS_VERSION _GSS_PKG_${_MIT_HEIMDAL}_VERSION) + if(NOT _GSS_VERSION) # for old CMake versions? + set(_GSS_VERSION ${_GSS_${_heimdal_modname}_VERSION}) + endif() endif() + message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_GSS_INCLUDE_DIRS} (found version \"${_GSS_VERSION}\")") endif() -set(GSS_INCLUDE_DIR ${_GSS_INCLUDE_DIR}) +set(GSS_INCLUDE_DIRS ${_GSS_INCLUDE_DIRS}) set(GSS_LIBRARIES ${_GSS_LIBRARIES}) -set(GSS_LINK_DIRECTORIES ${_GSS_LINK_DIRECTORIES}) -set(GSS_LINKER_FLAGS ${_GSS_LINKER_FLAGS}) -set(GSS_COMPILER_FLAGS ${_GSS_COMPILER_FLAGS}) +set(GSS_LIBRARY_DIRS ${_GSS_LIBRARY_DIRS}) +set(GSS_LDFLAGS ${_GSS_LDFLAGS}) +set(GSS_CFLAGS ${_GSS_CFLAGS}) set(GSS_VERSION ${_GSS_VERSION}) if(GSS_FLAVOUR) if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal") if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.amd64.manifest") + set(_heimdal_manifest_file "Heimdal.Application.amd64.manifest") else() - set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.x86.manifest") + set(_heimdal_manifest_file "Heimdal.Application.x86.manifest") endif() - if(EXISTS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}") - file(STRINGS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}" heimdal_version_str - REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$") + if(EXISTS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}") + file(STRINGS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}" _heimdal_version_str + REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$") - string(REGEX MATCH "[0-9]\\.[^\"]+" - GSS_VERSION "${heimdal_version_str}") + string(REGEX MATCH "[0-9]\\.[^\"]+" GSS_VERSION "${_heimdal_version_str}") endif() if(NOT GSS_VERSION) set(GSS_VERSION "Heimdal Unknown") endif() elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT") - get_filename_component(_MIT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE) - if(WIN32 AND _MIT_VERSION) - set(GSS_VERSION "${_MIT_VERSION}") + get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME + CACHE) + if(WIN32 AND _mit_version) + set(GSS_VERSION "${_mit_version}") else() set(GSS_VERSION "MIT Unknown") endif() + elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "GNU") + 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}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(GSS_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) + endif() endif() endif() include(FindPackageHandleStandardArgs) - -set(_GSS_REQUIRED_VARS GSS_LIBRARIES GSS_FLAVOUR) - find_package_handle_standard_args(GSS - REQUIRED_VARS - ${_GSS_REQUIRED_VARS} - 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" + REQUIRED_VARS + GSS_FLAVOUR + GSS_LIBRARIES + 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" ) -mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES) +mark_as_advanced( + _GSS_CFLAGS + _GSS_FOUND + _GSS_INCLUDE_DIRS + _GSS_LDFLAGS + _GSS_LIBRARIES + _GSS_LIBRARY_DIRS + _GSS_MODULE_NAME + _GSS_PREFIX + _GSS_VERSION +) diff --git a/deps/curl/CMake/FindLibgsasl.cmake b/deps/curl/CMake/FindLibgsasl.cmake new file mode 100644 index 00000000..82ed07ed --- /dev/null +++ b/deps/curl/CMake/FindLibgsasl.cmake @@ -0,0 +1,79 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 libgsasl library +# +# Input variables: +# +# - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory. +# - `LIBGSASL_LIBRARY`: Path to `libgsasl` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `LIBGSASL_VERSION`: Version of 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") +endif() + +if(LIBGSASL_FOUND) + string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}") + 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") + + unset(LIBGSASL_VERSION CACHE) + if(LIBGSASL_INCLUDE_DIR AND EXISTS "${LIBGSASL_INCLUDE_DIR}/gsasl-version.h") + set(_version_regex "#[\t ]*define[\t ]+GSASL_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${LIBGSASL_INCLUDE_DIR}/gsasl-version.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(LIBGSASL_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libgsasl + REQUIRED_VARS + LIBGSASL_INCLUDE_DIR + LIBGSASL_LIBRARY + VERSION_VAR + LIBGSASL_VERSION + ) + + if(LIBGSASL_FOUND) + set(LIBGSASL_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR}) + set(LIBGSASL_LIBRARIES ${LIBGSASL_LIBRARY}) + endif() + + mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY) +endif() diff --git a/deps/curl/CMake/FindLibidn2.cmake b/deps/curl/CMake/FindLibidn2.cmake new file mode 100644 index 00000000..35580ae2 --- /dev/null +++ b/deps/curl/CMake/FindLibidn2.cmake @@ -0,0 +1,79 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 libidn2 library +# +# Input variables: +# +# - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory. +# - `LIBIDN2_LIBRARY`: Path to `libidn2` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `LIBIDN2_VERSION`: Version of 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") +endif() + +if(LIBIDN2_FOUND) + string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}") + 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") + + unset(LIBIDN2_VERSION CACHE) + if(LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/idn2.h") + set(_version_regex "#[\t ]*define[\t ]+IDN2_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(LIBIDN2_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libidn2 + REQUIRED_VARS + LIBIDN2_INCLUDE_DIR + LIBIDN2_LIBRARY + VERSION_VAR + LIBIDN2_VERSION + ) + + if(LIBIDN2_FOUND) + set(LIBIDN2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR}) + set(LIBIDN2_LIBRARIES ${LIBIDN2_LIBRARY}) + endif() + + mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY) +endif() diff --git a/deps/curl/CMake/FindLibpsl.cmake b/deps/curl/CMake/FindLibpsl.cmake new file mode 100644 index 00000000..bb323f4b --- /dev/null +++ b/deps/curl/CMake/FindLibpsl.cmake @@ -0,0 +1,80 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 libpsl library +# +# Input variables: +# +# - `LIBPSL_INCLUDE_DIR`: The libpsl include directory. +# - `LIBPSL_LIBRARY`: Path to `libpsl` library. +# +# Result variables: +# +# - `LIBPSL_FOUND`: System has libpsl. +# - `LIBPSL_INCLUDE_DIRS`: The libpsl include directories. +# - `LIBPSL_LIBRARIES`: The libpsl library names. +# - `LIBPSL_VERSION`: Version of libpsl. + +if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_LIBPSL "libpsl") +endif() + +find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h" + HINTS + ${PC_LIBPSL_INCLUDEDIR} + ${PC_LIBPSL_INCLUDE_DIRS} +) + +find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl" + HINTS + ${PC_LIBPSL_LIBDIR} + ${PC_LIBPSL_LIBRARY_DIRS} +) + +if(PC_LIBPSL_VERSION) + set(LIBPSL_VERSION ${PC_LIBPSL_VERSION}) +elseif(LIBPSL_INCLUDE_DIR AND EXISTS "${LIBPSL_INCLUDE_DIR}/libpsl.h") + set(_version_regex "#[\t ]*define[\t ]+PSL_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${LIBPSL_INCLUDE_DIR}/libpsl.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(LIBPSL_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libpsl + REQUIRED_VARS + LIBPSL_INCLUDE_DIR + LIBPSL_LIBRARY + VERSION_VAR + LIBPSL_VERSION +) + +if(LIBPSL_FOUND) + set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR}) + set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY}) +endif() + +mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY) diff --git a/deps/curl/CMake/FindLibssh.cmake b/deps/curl/CMake/FindLibssh.cmake new file mode 100644 index 00000000..2b95fd80 --- /dev/null +++ b/deps/curl/CMake/FindLibssh.cmake @@ -0,0 +1,93 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 libssh library +# +# Input variables: +# +# LIBSSH_INCLUDE_DIR The libssh include directory. +# LIBSSH_LIBRARY Path to libssh library. +# +# Result variables: +# +# 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_CFLAGS Required compiler flags. +# LIBSSH_VERSION Version of 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") +endif() + +if(LIBSSH_FOUND) + string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}") + 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") + + unset(LIBSSH_VERSION CACHE) + if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h") + set(_version_regex1 "#[\t ]*define[\t ]+LIBSSH_VERSION_MAJOR[\t ]+([0-9]+).*") + set(_version_regex2 "#[\t ]*define[\t ]+LIBSSH_VERSION_MINOR[\t ]+([0-9]+).*") + set(_version_regex3 "#[\t ]*define[\t ]+LIBSSH_VERSION_MICRO[\t ]+([0-9]+).*") + file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str1 REGEX "${_version_regex1}") + file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str2 REGEX "${_version_regex2}") + file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str3 REGEX "${_version_regex3}") + string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}") + string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}") + string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}") + set(LIBSSH_VERSION "${_version_str1}.${_version_str2}.${_version_str3}") + unset(_version_regex1) + unset(_version_regex2) + unset(_version_regex3) + unset(_version_str1) + unset(_version_str2) + unset(_version_str3) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libssh + REQUIRED_VARS + LIBSSH_INCLUDE_DIR + LIBSSH_LIBRARY + VERSION_VAR + LIBSSH_VERSION + ) + + if(LIBSSH_FOUND) + 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 +endif() diff --git a/deps/curl/CMake/FindLibssh2.cmake b/deps/curl/CMake/FindLibssh2.cmake new file mode 100644 index 00000000..0785214a --- /dev/null +++ b/deps/curl/CMake/FindLibssh2.cmake @@ -0,0 +1,80 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 libssh2 library +# +# Input variables: +# +# - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory. +# - `LIBSSH2_LIBRARY`: Path to `libssh2` library. +# +# Result variables: +# +# - `LIBSSH2_FOUND`: System has libssh2. +# - `LIBSSH2_INCLUDE_DIRS`: The libssh2 include directories. +# - `LIBSSH2_LIBRARIES`: The libssh2 library names. +# - `LIBSSH2_VERSION`: Version of libssh2. + +if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_LIBSSH2 "libssh2") +endif() + +find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h" + HINTS + ${PC_LIBSSH2_INCLUDEDIR} + ${PC_LIBSSH2_INCLUDE_DIRS} +) + +find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2" + HINTS + ${PC_LIBSSH2_LIBDIR} + ${PC_LIBSSH2_LIBRARY_DIRS} +) + +if(PC_LIBSSH2_VERSION) + set(LIBSSH2_VERSION ${PC_LIBSSH2_VERSION}) +elseif(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h") + set(_version_regex "#[\t ]*define[\t ]+LIBSSH2_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(LIBSSH2_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libssh2 + REQUIRED_VARS + LIBSSH2_INCLUDE_DIR + LIBSSH2_LIBRARY + VERSION_VAR + LIBSSH2_VERSION +) + +if(LIBSSH2_FOUND) + set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) + set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) +endif() + +mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) diff --git a/deps/curl/CMake/FindLibuv.cmake b/deps/curl/CMake/FindLibuv.cmake new file mode 100644 index 00000000..d647e343 --- /dev/null +++ b/deps/curl/CMake/FindLibuv.cmake @@ -0,0 +1,89 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 libuv library +# +# Input variables: +# +# - `LIBUV_INCLUDE_DIR`: The libuv include directory. +# - `LIBUV_LIBRARY`: Path to `libuv` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `LIBUV_VERSION`: Version of 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") +endif() + +if(LIBUV_FOUND) + string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}") + 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") + + unset(LIBUV_VERSION CACHE) + if(LIBUV_INCLUDE_DIR AND EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h") + set(_version_regex1 "#[\t ]*define[\t ]+UV_VERSION_MAJOR[\t ]+([0-9]+).*") + set(_version_regex2 "#[\t ]*define[\t ]+UV_VERSION_MINOR[\t ]+([0-9]+).*") + set(_version_regex3 "#[\t ]*define[\t ]+UV_VERSION_PATCH[\t ]+([0-9]+).*") + file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str1 REGEX "${_version_regex1}") + file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str2 REGEX "${_version_regex2}") + file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str3 REGEX "${_version_regex3}") + string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}") + string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}") + string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}") + set(LIBUV_VERSION "${_version_str1}.${_version_str2}.${_version_str3}") + unset(_version_regex1) + unset(_version_regex2) + unset(_version_regex3) + unset(_version_str1) + unset(_version_str2) + unset(_version_str3) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libuv + REQUIRED_VARS + LIBUV_INCLUDE_DIR + LIBUV_LIBRARY + VERSION_VAR + LIBUV_VERSION + ) + + if(LIBUV_FOUND) + set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR}) + set(LIBUV_LIBRARIES ${LIBUV_LIBRARY}) + endif() + + mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY) +endif() diff --git a/deps/curl/CMake/FindMSH3.cmake b/deps/curl/CMake/FindMSH3.cmake index 7d9c6b65..92e6c3ef 100644 --- a/deps/curl/CMake/FindMSH3.cmake +++ b/deps/curl/CMake/FindMSH3.cmake @@ -21,50 +21,47 @@ # SPDX-License-Identifier: curl # ########################################################################### +# Find the msh3 library +# +# Input variables: +# +# - `MSH3_INCLUDE_DIR`: The msh3 include directory. +# - `MSH3_LIBRARY`: Path to `msh3` library. +# +# Result variables: +# +# - `MSH3_FOUND`: System has msh3. +# - `MSH3_INCLUDE_DIRS`: The msh3 include directories. +# - `MSH3_LIBRARIES`: The msh3 library names. +# - `MSH3_LIBRARY_DIRS`: The msh3 library directories. +# - `MSH3_CFLAGS`: Required compiler flags. +# - `MSH3_VERSION`: Version of msh3. -#[=======================================================================[.rst: -FindMSH3 ----------- - -Find the msh3 library - -Result Variables -^^^^^^^^^^^^^^^^ - -``MSH3_FOUND`` - System has msh3 -``MSH3_INCLUDE_DIRS`` - The msh3 include directories. -``MSH3_LIBRARIES`` - The libraries needed to use msh3 -#]=======================================================================] -if(UNIX) +if(CURL_USE_PKGCONFIG AND + NOT DEFINED MSH3_INCLUDE_DIR AND + NOT DEFINED MSH3_LIBRARY) find_package(PkgConfig QUIET) - pkg_search_module(PC_MSH3 libmsh3) + pkg_check_modules(MSH3 "libmsh3") endif() -find_path(MSH3_INCLUDE_DIR msh3.h - HINTS - ${PC_MSH3_INCLUDEDIR} - ${PC_MSH3_INCLUDE_DIRS} -) - -find_library(MSH3_LIBRARY NAMES msh3 - HINTS - ${PC_MSH3_LIBDIR} - ${PC_MSH3_LIBRARY_DIRS} -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MSH3 - REQUIRED_VARS - MSH3_LIBRARY - MSH3_INCLUDE_DIR -) - if(MSH3_FOUND) - set(MSH3_LIBRARIES ${MSH3_LIBRARY}) - set(MSH3_INCLUDE_DIRS ${MSH3_INCLUDE_DIR}) -endif() + string(REPLACE ";" " " MSH3_CFLAGS "${MSH3_CFLAGS}") + message(STATUS "Found MSH3 (via pkg-config): ${MSH3_INCLUDE_DIRS} (found version \"${MSH3_VERSION}\")") +else() + find_path(MSH3_INCLUDE_DIR NAMES "msh3.h") + find_library(MSH3_LIBRARY NAMES "msh3") -mark_as_advanced(MSH3_INCLUDE_DIRS MSH3_LIBRARIES) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(MSH3 + REQUIRED_VARS + MSH3_INCLUDE_DIR + MSH3_LIBRARY + ) + + if(MSH3_FOUND) + set(MSH3_INCLUDE_DIRS ${MSH3_INCLUDE_DIR}) + set(MSH3_LIBRARIES ${MSH3_LIBRARY}) + endif() + + mark_as_advanced(MSH3_INCLUDE_DIR MSH3_LIBRARY) +endif() diff --git a/deps/curl/CMake/FindMbedTLS.cmake b/deps/curl/CMake/FindMbedTLS.cmake index 814bd97d..8db6eb36 100644 --- a/deps/curl/CMake/FindMbedTLS.cmake +++ b/deps/curl/CMake/FindMbedTLS.cmake @@ -21,16 +21,87 @@ # SPDX-License-Identifier: curl # ########################################################################### -find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h) +# Find the mbedTLS library +# +# 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. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `MBEDTLS_VERSION`: Version of mbedTLS. -find_library(MBEDTLS_LIBRARY mbedtls) -find_library(MBEDX509_LIBRARY mbedx509) -find_library(MBEDCRYPTO_LIBRARY mbedcrypto) +if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR) + message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.") + set(MBEDTLS_INCLUDE_DIR "${MBEDTLS_INCLUDE_DIRS}") + unset(MBEDTLS_INCLUDE_DIRS) +endif() -set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}") +if(CURL_USE_PKGCONFIG AND + NOT DEFINED MBEDTLS_INCLUDE_DIR AND + NOT DEFINED MBEDTLS_LIBRARY AND + NOT DEFINED MBEDX509_LIBRARY AND + NOT DEFINED MBEDCRYPTO_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(MBEDTLS "mbedtls") + pkg_check_modules(MBEDX509 "mbedx509") + pkg_check_modules(MBEDCRYPTO "mbedcrypto") +endif() -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MbedTLS DEFAULT_MSG - MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) +if(MBEDTLS_FOUND AND MBEDX509_FOUND AND MBEDCRYPTO_FOUND) + list(APPEND MBEDTLS_LIBRARIES ${MBEDX509_LIBRARIES} ${MBEDCRYPTO_LIBRARIES}) + list(REMOVE_DUPLICATES MBEDTLS_LIBRARIES) + string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}") + message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") +else() + find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h") + find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls") + find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509") + find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto") -mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) + unset(MBEDTLS_VERSION CACHE) + if(MBEDTLS_INCLUDE_DIR) + if(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h") # 3.x + set(_version_header "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h") + elseif(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h") # 2.x + set(_version_header "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h") + else() + unset(_version_header) + endif() + if(_version_header) + set(_version_regex "#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([0-9.]+)\"") + file(STRINGS "${_version_header}" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(MBEDTLS_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) + unset(_version_header) + endif() + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(MbedTLS + REQUIRED_VARS + MBEDTLS_INCLUDE_DIR + MBEDTLS_LIBRARY + MBEDX509_LIBRARY + MBEDCRYPTO_LIBRARY + VERSION_VAR + MBEDTLS_VERSION + ) + + if(MBEDTLS_FOUND) + 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() diff --git a/deps/curl/CMake/FindNGHTTP2.cmake b/deps/curl/CMake/FindNGHTTP2.cmake index 3957646c..a0aacbf2 100644 --- a/deps/curl/CMake/FindNGHTTP2.cmake +++ b/deps/curl/CMake/FindNGHTTP2.cmake @@ -21,21 +21,60 @@ # SPDX-License-Identifier: curl # ########################################################################### -include(FindPackageHandleStandardArgs) +# Find the nghttp2 library +# +# Input variables: +# +# - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory. +# - `NGHTTP2_LIBRARY`: Path to `nghttp2` library. +# +# Result variables: +# +# - `NGHTTP2_FOUND`: System has nghttp2. +# - `NGHTTP2_INCLUDE_DIRS`: The nghttp2 include directories. +# - `NGHTTP2_LIBRARIES`: The nghttp2 library names. +# - `NGHTTP2_VERSION`: Version of nghttp2. -find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h") +if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_NGHTTP2 "libnghttp2") +endif() -find_library(NGHTTP2_LIBRARY NAMES nghttp2) - -find_package_handle_standard_args(NGHTTP2 - FOUND_VAR - NGHTTP2_FOUND - REQUIRED_VARS - NGHTTP2_LIBRARY - NGHTTP2_INCLUDE_DIR +find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h" + HINTS + ${PC_NGHTTP2_INCLUDEDIR} + ${PC_NGHTTP2_INCLUDE_DIRS} ) -set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR}) -set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY}) +find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static" + HINTS + ${PC_NGHTTP2_LIBDIR} + ${PC_NGHTTP2_LIBRARY_DIRS} +) -mark_as_advanced(NGHTTP2_INCLUDE_DIRS NGHTTP2_LIBRARIES) +if(PC_NGHTTP2_VERSION) + set(NGHTTP2_VERSION ${PC_NGHTTP2_VERSION}) +elseif(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h") + set(_version_regex "#[\t ]*define[\t ]+NGHTTP2_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(NGHTTP2_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(NGHTTP2 + REQUIRED_VARS + NGHTTP2_INCLUDE_DIR + NGHTTP2_LIBRARY + VERSION_VAR + NGHTTP2_VERSION +) + +if(NGHTTP2_FOUND) + set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR}) + set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY}) +endif() + +mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY) diff --git a/deps/curl/CMake/FindNGHTTP3.cmake b/deps/curl/CMake/FindNGHTTP3.cmake index 9b13e6c6..1adbd604 100644 --- a/deps/curl/CMake/FindNGHTTP3.cmake +++ b/deps/curl/CMake/FindNGHTTP3.cmake @@ -21,38 +21,32 @@ # SPDX-License-Identifier: curl # ########################################################################### +# Find the nghttp3 library +# +# Input variables: +# +# - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory. +# - `NGHTTP3_LIBRARY`: Path to `nghttp3` library. +# +# Result variables: +# +# - `NGHTTP3_FOUND`: System has nghttp3. +# - `NGHTTP3_INCLUDE_DIRS`: The nghttp3 include directories. +# - `NGHTTP3_LIBRARIES`: The nghttp3 library names. +# - `NGHTTP3_VERSION`: Version of nghttp3. -#[=======================================================================[.rst: -FindNGHTTP3 ----------- - -Find the nghttp3 library - -Result Variables -^^^^^^^^^^^^^^^^ - -``NGHTTP3_FOUND`` - System has nghttp3 -``NGHTTP3_INCLUDE_DIRS`` - The nghttp3 include directories. -``NGHTTP3_LIBRARIES`` - The libraries needed to use nghttp3 -``NGHTTP3_VERSION`` - version of nghttp3. -#]=======================================================================] - -if(UNIX) +if(CURL_USE_PKGCONFIG) find_package(PkgConfig QUIET) - pkg_search_module(PC_NGHTTP3 libnghttp3) + pkg_check_modules(PC_NGHTTP3 "libnghttp3") endif() -find_path(NGHTTP3_INCLUDE_DIR nghttp3/nghttp3.h +find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h" HINTS ${PC_NGHTTP3_INCLUDEDIR} ${PC_NGHTTP3_INCLUDE_DIRS} ) -find_library(NGHTTP3_LIBRARY NAMES nghttp3 +find_library(NGHTTP3_LIBRARY NAMES "nghttp3" HINTS ${PC_NGHTTP3_LIBDIR} ${PC_NGHTTP3_LIBRARY_DIRS} @@ -60,19 +54,27 @@ find_library(NGHTTP3_LIBRARY NAMES nghttp3 if(PC_NGHTTP3_VERSION) set(NGHTTP3_VERSION ${PC_NGHTTP3_VERSION}) +elseif(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h") + set(_version_regex "#[\t ]*define[\t ]+NGHTTP3_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(NGHTTP3_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(NGHTTP3 REQUIRED_VARS - NGHTTP3_LIBRARY NGHTTP3_INCLUDE_DIR - VERSION_VAR NGHTTP3_VERSION + NGHTTP3_LIBRARY + VERSION_VAR + NGHTTP3_VERSION ) if(NGHTTP3_FOUND) - set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY}) set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR}) + set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY}) endif() -mark_as_advanced(NGHTTP3_INCLUDE_DIRS NGHTTP3_LIBRARIES) +mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY) diff --git a/deps/curl/CMake/FindNGTCP2.cmake b/deps/curl/CMake/FindNGTCP2.cmake index 7ea46658..99b022dc 100644 --- a/deps/curl/CMake/FindNGTCP2.cmake +++ b/deps/curl/CMake/FindNGTCP2.cmake @@ -21,46 +21,40 @@ # SPDX-License-Identifier: curl # ########################################################################### +# Find the ngtcp2 library +# +# This module accepts optional COMPONENTS to control the crypto library (these are +# mutually exclusive): +# +# - quictls: Use `libngtcp2_crypto_quictls`. (choose this for LibreSSL) +# - BoringSSL: Use `libngtcp2_crypto_boringssl`. (choose this for AWS-LC) +# - wolfSSL: Use `libngtcp2_crypto_wolfssl`. +# - GnuTLS: Use `libngtcp2_crypto_gnutls`. +# +# Input variables: +# +# - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory. +# - `NGTCP2_LIBRARY`: Path to `ngtcp2` library. +# +# Result variables: +# +# - `NGTCP2_FOUND`: System has ngtcp2. +# - `NGTCP2_INCLUDE_DIRS`: The ngtcp2 include directories. +# - `NGTCP2_LIBRARIES`: The ngtcp2 library names. +# - `NGTCP2_VERSION`: Version of ngtcp2. -#[=======================================================================[.rst: -FindNGTCP2 ----------- - -Find the ngtcp2 library - -This module accepts optional COMPONENTS to control the crypto library (these are -mutually exclusive):: - - quictls, LibreSSL: Use libngtcp2_crypto_quictls - BoringSSL, AWS-LC: Use libngtcp2_crypto_boringssl - wolfSSL: Use libngtcp2_crypto_wolfssl - GnuTLS: Use libngtcp2_crypto_gnutls - -Result Variables -^^^^^^^^^^^^^^^^ - -``NGTCP2_FOUND`` - System has ngtcp2 -``NGTCP2_INCLUDE_DIRS`` - The ngtcp2 include directories. -``NGTCP2_LIBRARIES`` - The libraries needed to use ngtcp2 -``NGTCP2_VERSION`` - version of ngtcp2. -#]=======================================================================] - -if(UNIX) +if(CURL_USE_PKGCONFIG) find_package(PkgConfig QUIET) - pkg_search_module(PC_NGTCP2 libngtcp2) + pkg_check_modules(PC_NGTCP2 "libngtcp2") endif() -find_path(NGTCP2_INCLUDE_DIR ngtcp2/ngtcp2.h +find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h" HINTS ${PC_NGTCP2_INCLUDEDIR} ${PC_NGTCP2_INCLUDE_DIRS} ) -find_library(NGTCP2_LIBRARY NAMES ngtcp2 +find_library(NGTCP2_LIBRARY NAMES "ngtcp2" HINTS ${PC_NGTCP2_LIBDIR} ${PC_NGTCP2_LIBRARY_DIRS} @@ -68,33 +62,43 @@ find_library(NGTCP2_LIBRARY NAMES ngtcp2 if(PC_NGTCP2_VERSION) set(NGTCP2_VERSION ${PC_NGTCP2_VERSION}) +elseif(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h") + set(_version_regex "#[\t ]*define[\t ]+NGTCP2_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(NGTCP2_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) endif() if(NGTCP2_FIND_COMPONENTS) - set(NGTCP2_CRYPTO_BACKEND "") - foreach(component IN LISTS NGTCP2_FIND_COMPONENTS) - if(component MATCHES "^(BoringSSL|quictls|wolfSSL|GnuTLS)") - if(NGTCP2_CRYPTO_BACKEND) + set(_ngtcp2_crypto_backend "") + foreach(_component IN LISTS NGTCP2_FIND_COMPONENTS) + if(_component MATCHES "^(BoringSSL|quictls|wolfSSL|GnuTLS)") + if(_ngtcp2_crypto_backend) message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected") endif() - set(NGTCP2_CRYPTO_BACKEND ${component}) + set(_ngtcp2_crypto_backend ${_component}) endif() endforeach() - if(NGTCP2_CRYPTO_BACKEND) - string(TOLOWER "ngtcp2_crypto_${NGTCP2_CRYPTO_BACKEND}" _crypto_library) - if(UNIX) - pkg_search_module(PC_${_crypto_library} lib${_crypto_library}) + if(_ngtcp2_crypto_backend) + string(TOLOWER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library) + + if(CURL_USE_PKGCONFIG) + pkg_check_modules(PC_${_crypto_library} "lib${_crypto_library}") endif() - find_library(${_crypto_library}_LIBRARY - NAMES - ${_crypto_library} + + get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY) + find_library(${_crypto_library}_LIBRARY NAMES ${_crypto_library} HINTS + ${_ngtcp2_library_dir} ${PC_${_crypto_library}_LIBDIR} ${PC_${_crypto_library}_LIBRARY_DIRS} ) + if(${_crypto_library}_LIBRARY) - set(NGTCP2_${NGTCP2_CRYPTO_BACKEND}_FOUND TRUE) + set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE) set(NGTCP2_CRYPTO_LIBRARY ${${_crypto_library}_LIBRARY}) endif() endif() @@ -103,15 +107,16 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(NGTCP2 REQUIRED_VARS - NGTCP2_LIBRARY NGTCP2_INCLUDE_DIR - VERSION_VAR NGTCP2_VERSION + NGTCP2_LIBRARY + VERSION_VAR + NGTCP2_VERSION HANDLE_COMPONENTS ) if(NGTCP2_FOUND) - 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_DIRS NGTCP2_LIBRARIES) +mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY) diff --git a/deps/curl/CMake/FindNettle.cmake b/deps/curl/CMake/FindNettle.cmake new file mode 100644 index 00000000..56f2a940 --- /dev/null +++ b/deps/curl/CMake/FindNettle.cmake @@ -0,0 +1,84 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 nettle library +# +# Input variables: +# +# - `NETTLE_INCLUDE_DIR`: The nettle include directory. +# - `NETTLE_LIBRARY`: Path to `nettle` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `NETTLE_VERSION`: Version of 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") +endif() + +if(NETTLE_FOUND) + string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}") + 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") + + unset(NETTLE_VERSION CACHE) + if(NETTLE_INCLUDE_DIR AND EXISTS "${NETTLE_INCLUDE_DIR}/nettle/version.h") + set(_version_regex1 "#[\t ]*define[ \t]+NETTLE_VERSION_MAJOR[ \t]+([0-9]+).*") + set(_version_regex2 "#[\t ]*define[ \t]+NETTLE_VERSION_MINOR[ \t]+([0-9]+).*") + file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_str1 REGEX "${_version_regex1}") + file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_str2 REGEX "${_version_regex2}") + string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}") + string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}") + set(NETTLE_VERSION "${_version_str1}.${_version_str2}") + unset(_version_regex1) + unset(_version_regex2) + unset(_version_str1) + unset(_version_str2) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Nettle + REQUIRED_VARS + NETTLE_INCLUDE_DIR + NETTLE_LIBRARY + VERSION_VAR + NETTLE_VERSION + ) + + if(NETTLE_FOUND) + set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR}) + set(NETTLE_LIBRARIES ${NETTLE_LIBRARY}) + endif() + + mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY) +endif() diff --git a/deps/curl/CMake/FindQUICHE.cmake b/deps/curl/CMake/FindQUICHE.cmake deleted file mode 100644 index 0488463d..00000000 --- a/deps/curl/CMake/FindQUICHE.cmake +++ /dev/null @@ -1,70 +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 -# -########################################################################### - -#[=======================================================================[.rst: -FindQUICHE ----------- - -Find the quiche library - -Result Variables -^^^^^^^^^^^^^^^^ - -``QUICHE_FOUND`` - System has quiche -``QUICHE_INCLUDE_DIRS`` - The quiche include directories. -``QUICHE_LIBRARIES`` - The libraries needed to use quiche -#]=======================================================================] -if(UNIX) - find_package(PkgConfig QUIET) - pkg_search_module(PC_QUICHE quiche) -endif() - -find_path(QUICHE_INCLUDE_DIR quiche.h - HINTS - ${PC_QUICHE_INCLUDEDIR} - ${PC_QUICHE_INCLUDE_DIRS} -) - -find_library(QUICHE_LIBRARY NAMES quiche - HINTS - ${PC_QUICHE_LIBDIR} - ${PC_QUICHE_LIBRARY_DIRS} -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(QUICHE - REQUIRED_VARS - QUICHE_LIBRARY - QUICHE_INCLUDE_DIR -) - -if(QUICHE_FOUND) - set(QUICHE_LIBRARIES ${QUICHE_LIBRARY}) - set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR}) -endif() - -mark_as_advanced(QUICHE_INCLUDE_DIRS QUICHE_LIBRARIES) diff --git a/deps/curl/CMake/FindQuiche.cmake b/deps/curl/CMake/FindQuiche.cmake new file mode 100644 index 00000000..6db5cb0c --- /dev/null +++ b/deps/curl/CMake/FindQuiche.cmake @@ -0,0 +1,67 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 quiche library +# +# Input variables: +# +# - `QUICHE_INCLUDE_DIR`: The quiche include directory. +# - `QUICHE_LIBRARY`: Path to `quiche` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `QUICHE_VERSION`: Version of 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") +endif() + +if(QUICHE_FOUND) + string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}") + 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") + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Quiche + REQUIRED_VARS + QUICHE_INCLUDE_DIR + QUICHE_LIBRARY + ) + + if(QUICHE_FOUND) + set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR}) + set(QUICHE_LIBRARIES ${QUICHE_LIBRARY}) + endif() + + mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY) +endif() diff --git a/deps/curl/CMake/FindRustls.cmake b/deps/curl/CMake/FindRustls.cmake new file mode 100644 index 00000000..0e065b00 --- /dev/null +++ b/deps/curl/CMake/FindRustls.cmake @@ -0,0 +1,101 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 Rustls library +# +# Input variables: +# +# - `RUSTLS_INCLUDE_DIR`: The Rustls include directory. +# - `RUSTLS_LIBRARY`: Path to `rustls` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `RUSTLS_VERSION`: Version of 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") +endif() + +if(RUSTLS_FOUND) + string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}") + message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")") +else() + find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h") + find_library(RUSTLS_LIBRARY NAMES "rustls") + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Rustls + REQUIRED_VARS + RUSTLS_INCLUDE_DIR + RUSTLS_LIBRARY + ) + + if(RUSTLS_FOUND) + set(RUSTLS_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR}) + set(RUSTLS_LIBRARIES ${RUSTLS_LIBRARY}) + endif() + + mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY) +endif() + +if(APPLE) + find_library(SECURITY_FRAMEWORK "Security") + mark_as_advanced(SECURITY_FRAMEWORK) + if(NOT SECURITY_FRAMEWORK) + message(FATAL_ERROR "Security framework not found") + endif() + list(APPEND RUSTLS_LIBRARIES "-framework Security") + + find_library(FOUNDATION_FRAMEWORK "Foundation") + mark_as_advanced(FOUNDATION_FRAMEWORK) + if(NOT FOUNDATION_FRAMEWORK) + message(FATAL_ERROR "Foundation framework not found") + endif() + list(APPEND RUSTLS_LIBRARIES "-framework Foundation") +elseif(NOT WIN32) + find_library(_pthread_library "pthread") + if(_pthread_library) + list(APPEND RUSTLS_LIBRARIES "pthread") + endif() + mark_as_advanced(_pthread_library) + + find_library(_dl_library "dl") + if(_dl_library) + list(APPEND RUSTLS_LIBRARIES "dl") + endif() + mark_as_advanced(_dl_library) + + find_library(_math_library "m") + if(_math_library) + list(APPEND RUSTLS_LIBRARIES "m") + endif() + mark_as_advanced(_math_library) +endif() diff --git a/deps/curl/CMake/FindWolfSSH.cmake b/deps/curl/CMake/FindWolfSSH.cmake new file mode 100644 index 00000000..98de656b --- /dev/null +++ b/deps/curl/CMake/FindWolfSSH.cmake @@ -0,0 +1,65 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 wolfSSH library +# +# Input variables: +# +# - `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory. +# - `WOLFSSH_LIBRARY`: Path to `wolfssh` library. +# +# Result variables: +# +# - `WOLFSSH_FOUND`: System has wolfSSH. +# - `WOLFSSH_INCLUDE_DIRS`: The wolfSSH include directories. +# - `WOLFSSH_LIBRARIES`: The wolfSSH library names. +# - `WOLFSSH_VERSION`: Version of wolfSSH. + +find_path(WOLFSSH_INCLUDE_DIR NAMES "wolfssh/ssh.h") +find_library(WOLFSSH_LIBRARY NAMES "wolfssh" "libwolfssh") + +unset(WOLFSSH_VERSION CACHE) +if(WOLFSSH_INCLUDE_DIR AND EXISTS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h") + set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSH_VERSION_STRING[\t ]+\"([^\"]*)\"") + file(STRINGS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(WOLFSSH_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WolfSSH + REQUIRED_VARS + WOLFSSH_INCLUDE_DIR + WOLFSSH_LIBRARY + VERSION_VAR + WOLFSSH_VERSION +) + +if(WOLFSSH_FOUND) + set(WOLFSSH_INCLUDE_DIRS ${WOLFSSH_INCLUDE_DIR}) + set(WOLFSSH_LIBRARIES ${WOLFSSH_LIBRARY}) +endif() + +mark_as_advanced(WOLFSSH_INCLUDE_DIR WOLFSSH_LIBRARY) diff --git a/deps/curl/CMake/FindWolfSSL.cmake b/deps/curl/CMake/FindWolfSSL.cmake index d67c0eb2..8f6f9646 100644 --- a/deps/curl/CMake/FindWolfSSL.cmake +++ b/deps/curl/CMake/FindWolfSSL.cmake @@ -21,16 +21,76 @@ # SPDX-License-Identifier: curl # ########################################################################### -find_path(WolfSSL_INCLUDE_DIR NAMES wolfssl/ssl.h) -find_library(WolfSSL_LIBRARY NAMES wolfssl) -mark_as_advanced(WolfSSL_INCLUDE_DIR WolfSSL_LIBRARY) +# Find the wolfSSL library +# +# Input variables: +# +# - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory. +# - `WOLFSSL_LIBRARY`: Path to `wolfssl` library. +# +# Result variables: +# +# - `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_CFLAGS`: Required compiler flags. +# - `WOLFSSL_VERSION`: Version of wolfSSL. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WolfSSL - REQUIRED_VARS WolfSSL_INCLUDE_DIR WolfSSL_LIBRARY +if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR) + message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.") + set(WOLFSSL_INCLUDE_DIR "${WolfSSL_INCLUDE_DIR}") +endif() +if(DEFINED WolfSSL_LIBRARY AND NOT DEFINED WOLFSSL_LIBRARY) + message(WARNING "WolfSSL_LIBRARY is deprecated, use WOLFSSL_LIBRARY instead.") + set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}") +endif() + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED WOLFSSL_INCLUDE_DIR AND + NOT DEFINED WOLFSSL_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(WOLFSSL "wolfssl") +endif() + +if(WOLFSSL_FOUND) + string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}") + 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") + + unset(WOLFSSL_VERSION CACHE) + if(WOLFSSL_INCLUDE_DIR AND EXISTS "${WOLFSSL_INCLUDE_DIR}/wolfssl/version.h") + set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSL_VERSION_STRING[\t ]+\"([^\"]*)\"") + file(STRINGS "${WOLFSSL_INCLUDE_DIR}/wolfssl/version.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(WOLFSSL_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(WolfSSL + REQUIRED_VARS + WOLFSSL_INCLUDE_DIR + WOLFSSL_LIBRARY + VERSION_VAR + WOLFSSL_VERSION ) -if(WolfSSL_FOUND) - set(WolfSSL_INCLUDE_DIRS ${WolfSSL_INCLUDE_DIR}) - set(WolfSSL_LIBRARIES ${WolfSSL_LIBRARY}) + if(WOLFSSL_FOUND) + set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR}) + set(WOLFSSL_LIBRARIES ${WOLFSSL_LIBRARY}) + endif() + + mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY) +endif() + +if(NOT WIN32) + find_library(_math_library "m") + if(_math_library) + list(APPEND WOLFSSL_LIBRARIES "m") # for log and pow + endif() + mark_as_advanced(_math_library) endif() diff --git a/deps/curl/CMake/FindZstd.cmake b/deps/curl/CMake/FindZstd.cmake index 0ea9e0c8..7b0f5575 100644 --- a/deps/curl/CMake/FindZstd.cmake +++ b/deps/curl/CMake/FindZstd.cmake @@ -21,58 +21,79 @@ # SPDX-License-Identifier: curl # ########################################################################### +# Find the zstd library +# +# Input variables: +# +# - `ZSTD_INCLUDE_DIR`: The zstd include directory. +# - `ZSTD_LIBRARY`: Path to `zstd` library. +# +# Result variables: +# +# - `ZSTD_FOUND`: System has zstd. +# - `ZSTD_INCLUDE_DIRS`: The zstd include directories. +# - `ZSTD_LIBRARIES`: The zstd library names. +# - `ZSTD_VERSION`: Version of zstd. -#[=======================================================================[.rst: -FindZstd ----------- - -Find the zstd library - -Result Variables -^^^^^^^^^^^^^^^^ - -``Zstd_FOUND`` - System has zstd -``Zstd_INCLUDE_DIRS`` - The zstd include directories. -``Zstd_LIBRARIES`` - The libraries needed to use zstd -#]=======================================================================] - -if(UNIX) - find_package(PkgConfig QUIET) - pkg_search_module(PC_Zstd libzstd) +if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR) + message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.") + set(ZSTD_INCLUDE_DIR "${Zstd_INCLUDE_DIR}") +endif() +if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY) + message(WARNING "Zstd_LIBRARY is deprecated, use ZSTD_LIBRARY instead.") + set(ZSTD_LIBRARY "${Zstd_LIBRARY}") endif() -find_path(Zstd_INCLUDE_DIR zstd.h +if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_ZSTD "libzstd") +endif() + +find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h" HINTS - ${PC_Zstd_INCLUDEDIR} - ${PC_Zstd_INCLUDE_DIRS} + ${PC_ZSTD_INCLUDEDIR} + ${PC_ZSTD_INCLUDE_DIRS} ) -find_library(Zstd_LIBRARY NAMES zstd +find_library(ZSTD_LIBRARY NAMES "zstd" HINTS - ${PC_Zstd_LIBDIR} - ${PC_Zstd_LIBRARY_DIRS} + ${PC_ZSTD_LIBDIR} + ${PC_ZSTD_LIBRARY_DIRS} ) -if(Zstd_INCLUDE_DIR) - file(READ "${Zstd_INCLUDE_DIR}/zstd.h" _zstd_header) - string(REGEX MATCH ".*define ZSTD_VERSION_MAJOR *([0-9]+).*define ZSTD_VERSION_MINOR *([0-9]+).*define ZSTD_VERSION_RELEASE *([0-9]+)" _zstd_ver "${_zstd_header}") - set(Zstd_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") +if(PC_ZSTD_VERSION) + set(ZSTD_VERSION ${PC_ZSTD_VERSION}) +elseif(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h") + set(_version_regex1 "#[\t ]*define[ \t]+ZSTD_VERSION_MAJOR[ \t]+([0-9]+).*") + set(_version_regex2 "#[\t ]*define[ \t]+ZSTD_VERSION_MINOR[ \t]+([0-9]+).*") + set(_version_regex3 "#[\t ]*define[ \t]+ZSTD_VERSION_RELEASE[ \t]+([0-9]+).*") + file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str1 REGEX "${_version_regex1}") + file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str2 REGEX "${_version_regex2}") + file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str3 REGEX "${_version_regex3}") + string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}") + string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}") + string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}") + set(ZSTD_VERSION "${_version_str1}.${_version_str2}.${_version_str3}") + unset(_version_regex1) + unset(_version_regex2) + unset(_version_regex3) + unset(_version_str1) + unset(_version_str2) + unset(_version_str3) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Zstd REQUIRED_VARS - Zstd_LIBRARY - Zstd_INCLUDE_DIR - VERSION_VAR Zstd_VERSION + ZSTD_INCLUDE_DIR + ZSTD_LIBRARY + VERSION_VAR + ZSTD_VERSION ) -if(Zstd_FOUND) - set(Zstd_LIBRARIES ${Zstd_LIBRARY}) - set(Zstd_INCLUDE_DIRS ${Zstd_INCLUDE_DIR}) +if(ZSTD_FOUND) + set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR}) + set(ZSTD_LIBRARIES ${ZSTD_LIBRARY}) endif() -mark_as_advanced(Zstd_INCLUDE_DIRS Zstd_LIBRARIES) +mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY) diff --git a/deps/curl/CMake/Macros.cmake b/deps/curl/CMake/Macros.cmake index d5439fcc..7877f4c9 100644 --- a/deps/curl/CMake/Macros.cmake +++ b/deps/curl/CMake/Macros.cmake @@ -21,60 +21,62 @@ # SPDX-License-Identifier: curl # ########################################################################### -#File defines convenience macros for available feature testing +# File defines convenience macros for available feature testing # Check if header file exists and add it to the list. # This macro is intended to be called multiple times with a sequence of # possibly dependent header files. Some headers depend on others to be # compiled correctly. -macro(check_include_file_concat FILE VARIABLE) - check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE}) - if(${VARIABLE}) - set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE}) - set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}") +macro(check_include_file_concat _file _variable) + check_include_files("${CURL_INCLUDES};${_file}" ${_variable}) + if(${_variable}) + list(APPEND CURL_INCLUDES ${_file}) endif() endmacro() # For other curl specific tests, use this macro. -macro(curl_internal_test CURL_TEST) - if(NOT DEFINED "${CURL_TEST}") - set(MACRO_CHECK_FUNCTION_DEFINITIONS - "-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}") +# Return result in variable: CURL_TEST_OUTPUT +macro(curl_internal_test _curl_test) + if(NOT DEFINED "${_curl_test}") + string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}") if(CMAKE_REQUIRED_LIBRARIES) - set(CURL_TEST_ADD_LIBRARIES + set(_curl_test_add_libraries "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") endif() - message(STATUS "Performing Test ${CURL_TEST}") - try_compile(${CURL_TEST} - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${CURL_TEST_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT) - if(${CURL_TEST}) - set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}") - message(STATUS "Performing Test ${CURL_TEST} - Success") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing Test ${CURL_TEST} passed with the following output:\n" - "${OUTPUT}\n") + message(STATUS "Performing Test ${_curl_test}") + try_compile(${_curl_test} + ${PROJECT_BINARY_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c" + CMAKE_FLAGS + "-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${_cmake_required_definitions}" + "${_curl_test_add_libraries}" + OUTPUT_VARIABLE CURL_TEST_OUTPUT) + if(${_curl_test}) + set(${_curl_test} 1 CACHE INTERNAL "Curl test") + message(STATUS "Performing Test ${_curl_test} - Success") else() - message(STATUS "Performing Test ${CURL_TEST} - Failed") - set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Performing Test ${CURL_TEST} failed with the following output:\n" - "${OUTPUT}\n") + set(${_curl_test} "" CACHE INTERNAL "Curl test") + message(STATUS "Performing Test ${_curl_test} - Failed") endif() endif() endmacro() -macro(optional_dependency DEPENDENCY) - set(CURL_${DEPENDENCY} AUTO CACHE STRING "Build curl with ${DEPENDENCY} support (AUTO, ON or OFF)") - set_property(CACHE CURL_${DEPENDENCY} PROPERTY STRINGS AUTO ON OFF) +macro(curl_dependency_option _dependency) + set(CURL_${_dependency} "AUTO" CACHE STRING "Build curl with ${_dependency} support (AUTO, ON or OFF)") + set_property(CACHE CURL_${_dependency} PROPERTY STRINGS "AUTO" "ON" "OFF") - if(CURL_${DEPENDENCY} STREQUAL AUTO) - find_package(${DEPENDENCY}) - elseif(CURL_${DEPENDENCY}) - find_package(${DEPENDENCY} REQUIRED) + if(CURL_${_dependency} STREQUAL "AUTO") + find_package(${_dependency}) + elseif(CURL_${_dependency}) + find_package(${_dependency} REQUIRED) endif() endmacro() + +# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_LINK_OPTIONS. +macro(curl_required_libpaths _libpaths_arg) + set(_libpaths "${_libpaths_arg}") + foreach(_libpath IN LISTS _libpaths) + list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}") + endforeach() +endmacro() diff --git a/deps/curl/CMake/OtherTests.cmake b/deps/curl/CMake/OtherTests.cmake index 7701c0ee..2e5b62f6 100644 --- a/deps/curl/CMake/OtherTests.cmake +++ b/deps/curl/CMake/OtherTests.cmake @@ -25,26 +25,27 @@ include(CheckCSourceCompiles) include(CheckCSourceRuns) include(CheckTypeSize) -macro(add_header_include check header) - if(${check}) +macro(add_header_include _check _header) + if(${_check}) set(_source_epilogue "${_source_epilogue} - #include <${header}>") + #include <${_header}>") endif() endmacro() set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE) - set(CMAKE_EXTRA_INCLUDE_FILES) + cmake_push_check_state() + unset(CMAKE_EXTRA_INCLUDE_FILES) if(WIN32) set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") - set(CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN") set(CMAKE_REQUIRED_LIBRARIES "ws2_32") elseif(HAVE_SYS_SOCKET_H) set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") endif() check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE) set(HAVE_STRUCT_SOCKADDR_STORAGE ${HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE}) + cmake_pop_check_state() endif() if(NOT WIN32) @@ -75,39 +76,6 @@ check_c_source_compiles("${_source_epilogue} unset(CMAKE_TRY_COMPILE_TARGET_TYPE) -if(NOT CMAKE_CROSSCOMPILING AND NOT APPLE) - set(_source_epilogue "#undef inline") - add_header_include(HAVE_SYS_POLL_H "sys/poll.h") - add_header_include(HAVE_POLL_H "poll.h") - check_c_source_runs("${_source_epilogue} - #include - #include - int main(void) - { - if(0 != poll(0, 0, 10)) { - return 1; /* fail */ - } - else { - /* detect the 10.12 poll() breakage */ - struct timeval before, after; - int rc; - size_t us; - - gettimeofday(&before, NULL); - rc = poll(NULL, 0, 500); - gettimeofday(&after, NULL); - - us = (after.tv_sec - before.tv_sec) * 1000000 + - (after.tv_usec - before.tv_usec); - - if(us < 400000) { - return 1; - } - } - return 0; - }" HAVE_POLL_FINE) -endif() - # Detect HAVE_GETADDRINFO_THREADSAFE if(WIN32) @@ -122,7 +90,7 @@ elseif(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "SunOS") set(HAVE_GETADDRINFO_THREADSAFE TRUE) -elseif(CMAKE_SYSTEM_NAME MATCHES "BSD") +elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD") set(HAVE_GETADDRINFO_THREADSAFE FALSE) endif() @@ -137,7 +105,7 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE) #ifdef h_errno return 0; #else - force compilation error + #error force compilation error #endif }" HAVE_H_ERRNO) @@ -158,7 +126,7 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE) #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) return 0; #else - force compilation error + #error force compilation error #endif }" HAVE_H_ERRNO_SBS_ISSUE_7) endif() diff --git a/deps/curl/CMake/PickyWarnings.cmake b/deps/curl/CMake/PickyWarnings.cmake index d82bbb1d..b62f97f1 100644 --- a/deps/curl/CMake/PickyWarnings.cmake +++ b/deps/curl/CMake/PickyWarnings.cmake @@ -23,10 +23,27 @@ ########################################################################### include(CheckCCompilerFlag) -unset(WPICKY) +unset(_picky) -if(CURL_WERROR AND CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) - set(WPICKY "${WPICKY} -pedantic-errors") +if(CURL_WERROR AND + ((CMAKE_COMPILER_IS_GNUCC AND + NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND + NOT CMAKE_VERSION VERSION_LESS 3.23.0) OR # to avoid check_symbol_exists() conflicting with GCC -pedantic-errors + CMAKE_C_COMPILER_ID MATCHES "Clang")) + list(APPEND _picky "-pedantic-errors") + if(MSVC) # clang-cl + list(APPEND _picky "-Wno-language-extension-token") # Override default error to make __int64 size detection pass + endif() +endif() + +if(APPLE AND + (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6) OR + (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.3)) + list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3 +endif() + +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95 endif() if(PICKY_COMPILER) @@ -35,29 +52,29 @@ if(PICKY_COMPILER) # https://clang.llvm.org/docs/DiagnosticsReference.html # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html - # WPICKY_ENABLE = Options we want to enable as-is. - # WPICKY_DETECT = Options we want to test first and enable if available. + # _picky_enable = Options we want to enable as-is. + # _picky_detect = Options we want to test first and enable if available. # Prefer the -Wextra alias with clang. if(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(WPICKY_ENABLE "-Wextra") + set(_picky_enable "-Wextra") else() - set(WPICKY_ENABLE "-W") + set(_picky_enable "-W") endif() - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Wall -pedantic ) # ---------------------------------- # Add new options here, if in doubt: # ---------------------------------- - set(WPICKY_DETECT + set(_picky_detect ) # Assume these options always exist with both clang and gcc. # Require clang 3.0 / gcc 2.95 or later. - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Wbad-function-cast # clang 2.7 gcc 2.95 -Wconversion # clang 2.7 gcc 2.95 -Winline # clang 1.0 gcc 1.0 @@ -75,7 +92,7 @@ if(PICKY_COMPILER) ) # Always enable with clang, version dependent with gcc - set(WPICKY_COMMON_OLD + set(_picky_common_old -Waddress # clang 2.7 gcc 4.3 -Wattributes # clang 2.7 gcc 4.1 -Wcast-align # clang 1.0 gcc 4.2 @@ -90,13 +107,13 @@ if(PICKY_COMPILER) -Wmissing-noreturn # clang 2.7 gcc 4.1 -Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0) -Wno-system-headers # clang 1.0 gcc 3.0 - # -Wpadded # clang 2.9 gcc 4.1 # Not used because we cannot change public structs + # -Wpadded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs -Wold-style-definition # clang 2.7 gcc 3.4 -Wredundant-decls # clang 2.7 gcc 4.1 -Wsign-conversion # clang 2.9 gcc 4.3 -Wno-error=sign-conversion # FIXME -Wstrict-prototypes # clang 1.0 gcc 3.3 - # -Wswitch-enum # clang 2.7 gcc 4.1 # Not used because this basically disallows default case + # -Wswitch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case -Wtype-limits # clang 2.7 gcc 4.3 -Wunreachable-code # clang 2.7 gcc 4.1 # -Wunused-macros # clang 2.7 gcc 4.1 # Not practical @@ -104,7 +121,7 @@ if(PICKY_COMPILER) -Wvla # clang 2.8 gcc 4.3 ) - set(WPICKY_COMMON + set(_picky_common -Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3 -Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0 -Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0 @@ -112,51 +129,55 @@ if(PICKY_COMPILER) ) if(CMAKE_C_COMPILER_ID MATCHES "Clang") - list(APPEND WPICKY_ENABLE - ${WPICKY_COMMON_OLD} + list(APPEND _picky_enable + ${_picky_common_old} -Wshift-sign-overflow # clang 2.9 -Wshorten-64-to-32 # clang 1.0 - -Wlanguage-extension-token # clang 3.0 -Wformat=2 # clang 3.0 gcc 4.8 ) + if(NOT MSVC) + list(APPEND _picky_enable + -Wlanguage-extension-token # clang 3.0 # Avoid for clang-cl to allow __int64 + ) + endif() # Enable based on compiler version if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6) OR (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.3)) - list(APPEND WPICKY_ENABLE - ${WPICKY_COMMON} - -Wunreachable-code-break # clang 3.5 appleclang 6.0 + list(APPEND _picky_enable + ${_picky_common} + # -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds -Wheader-guard # clang 3.4 appleclang 5.1 -Wsometimes-uninitialized # clang 3.2 appleclang 4.6 ) endif() if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.9) OR (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.3)) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Wcomma # clang 3.9 appleclang 8.3 -Wmissing-variable-declarations # clang 3.2 appleclang 4.6 ) endif() if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) OR (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.3)) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Wassign-enum # clang 7.0 appleclang 10.3 -Wextra-semi-stmt # clang 7.0 appleclang 10.3 ) endif() if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) OR (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.4)) - list(APPEND WPICKY_ENABLE - -Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # we have silencing markup for clang 10.0 and above only + list(APPEND _picky_enable + -Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # We do silencing for clang 10.0 and above only ) endif() else() # gcc - list(APPEND WPICKY_DETECT - ${WPICKY_COMMON} + list(APPEND _picky_detect + ${_picky_common} ) # Enable based on compiler version if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3) - list(APPEND WPICKY_ENABLE - ${WPICKY_COMMON_OLD} + list(APPEND _picky_enable + ${_picky_common_old} -Wclobbered # gcc 4.3 -Wmissing-parameter-type # gcc 4.3 -Wold-style-declaration # gcc 4.3 @@ -165,22 +186,22 @@ if(PICKY_COMPILER) ) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND MINGW) - list(APPEND WPICKY_ENABLE - -Wno-pedantic-ms-format # gcc 4.5 (mingw-only) + list(APPEND _picky_enable + -Wno-pedantic-ms-format # gcc 4.5 (MinGW-only) ) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Wformat=2 # clang 3.0 gcc 4.8 ) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Warray-bounds=2 -ftree-vrp # clang 3.0 gcc 5.0 (clang default: -Warray-bounds) ) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Wduplicated-cond # gcc 6.0 -Wnull-dereference # clang 3.0 gcc 6.0 (clang default) -fdelete-null-pointer-checks @@ -189,17 +210,16 @@ if(PICKY_COMPILER) ) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Walloc-zero # gcc 7.0 -Wduplicated-branches # gcc 7.0 - -Wformat-overflow=2 # gcc 7.0 -Wformat-truncation=2 # gcc 7.0 -Wimplicit-fallthrough # clang 4.0 gcc 7.0 -Wrestrict # gcc 7.0 ) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) - list(APPEND WPICKY_ENABLE + list(APPEND _picky_enable -Warith-conversion # gcc 10.0 ) endif() @@ -207,26 +227,39 @@ if(PICKY_COMPILER) # - foreach(_CCOPT IN LISTS WPICKY_ENABLE) - set(WPICKY "${WPICKY} ${_CCOPT}") + foreach(_ccopt IN LISTS _picky_enable) + list(APPEND _picky "${_ccopt}") endforeach() - foreach(_CCOPT IN LISTS WPICKY_DETECT) - # surprisingly, CHECK_C_COMPILER_FLAG needs a new variable to store each new - # test result in. - string(MAKE_C_IDENTIFIER "OPT${_CCOPT}" _optvarname) + foreach(_ccopt IN LISTS _picky_detect) + # Use a unique variable name 1. for meaningful log output 2. to have a fresh, undefined variable for each detection + string(MAKE_C_IDENTIFIER "OPT${_ccopt}" _optvarname) # GCC only warns about unknown -Wno- options if there are also other diagnostic messages, # so test for the positive form instead - string(REPLACE "-Wno-" "-W" _CCOPT_ON "${_CCOPT}") - check_c_compiler_flag(${_CCOPT_ON} ${_optvarname}) + string(REPLACE "-Wno-" "-W" _ccopt_on "${_ccopt}") + check_c_compiler_flag(${_ccopt_on} ${_optvarname}) if(${_optvarname}) - set(WPICKY "${WPICKY} ${_CCOPT}") + list(APPEND _picky "${_ccopt}") endif() endforeach() endif() endif() -if(WPICKY) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WPICKY}") - message(STATUS "Picky compiler options:${WPICKY}") +# clang-cl +if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC) + if(CMAKE_VERSION VERSION_LESS 3.12) + set(_picky_tmp "") + foreach(_ccopt IN LISTS _picky) + list(APPEND _picky_tmp "/clang:${_ccopt}") + endforeach() + set(_picky ${_picky_tmp}) + else() + list(TRANSFORM _picky PREPEND "/clang:") + endif() +endif() + +if(_picky) + string(REPLACE ";" " " _picky "${_picky}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_picky}") + message(STATUS "Picky compiler options: ${_picky}") endif() diff --git a/deps/curl/CMake/Platforms/WindowsCache.cmake b/deps/curl/CMake/Platforms/WindowsCache.cmake index d3391d92..0997ef3e 100644 --- a/deps/curl/CMake/Platforms/WindowsCache.cmake +++ b/deps/curl/CMake/Platforms/WindowsCache.cmake @@ -41,6 +41,10 @@ if(MINGW) set(HAVE_SYS_PARAM_H 1) set(HAVE_SYS_TIME_H 1) set(HAVE_GETTIMEOFDAY 1) + set(HAVE_STRINGS_H 1) # wrapper to string.h + set(HAVE_UTIME_H 1) # wrapper to sys/utime.h + set(HAVE_DIRENT_H 1) + set(HAVE_OPENDIR 1) else() set(HAVE_LIBGEN_H 0) set(HAVE_STRCASECMP 0) @@ -48,6 +52,10 @@ else() set(HAVE_SYS_PARAM_H 0) set(HAVE_SYS_TIME_H 0) set(HAVE_GETTIMEOFDAY 0) + set(HAVE_STRINGS_H 0) + set(HAVE_UTIME_H 0) + set(HAVE_DIRENT_H 0) + set(HAVE_OPENDIR 0) if(MSVC) set(HAVE_UNISTD_H 0) set(HAVE_LOCALE_H 1) @@ -80,6 +88,7 @@ set(HAVE_FREEADDRINFO 1) set(HAVE_FCHMOD 0) set(HAVE_SOCKETPAIR 0) set(HAVE_SENDMSG 0) +set(HAVE_SENDMMSG 0) set(HAVE_ALARM 0) set(HAVE_FCNTL 0) set(HAVE_GETPPID 0) @@ -88,17 +97,17 @@ set(HAVE_GETPWUID_R 0) set(HAVE_STRERROR_R 0) set(HAVE_SIGINTERRUPT 0) set(HAVE_PIPE 0) +set(HAVE_EVENTFD 0) set(HAVE_IF_NAMETOINDEX 0) set(HAVE_GETRLIMIT 0) set(HAVE_SETRLIMIT 0) set(HAVE_FSETXATTR 0) -set(HAVE_LIBSOCKET 0) set(HAVE_SETLOCALE 1) set(HAVE_SETMODE 1) +set(HAVE__SETMODE 1) set(HAVE_GETPEERNAME 1) set(HAVE_GETSOCKNAME 1) set(HAVE_GETHOSTNAME 1) -set(HAVE_LIBZ 0) set(HAVE_RECV 1) set(HAVE_SEND 1) @@ -113,14 +122,15 @@ set(HAVE_IFADDRS_H 0) set(HAVE_IO_H 1) set(HAVE_NETDB_H 0) set(HAVE_NETINET_IN_H 0) +set(HAVE_NETINET_IN6_H 0) set(HAVE_NETINET_TCP_H 0) set(HAVE_NETINET_UDP_H 0) set(HAVE_NET_IF_H 0) set(HAVE_IOCTL_SIOCGIFADDR 0) set(HAVE_POLL_H 0) -set(HAVE_POLL_FINE 0) +set(HAVE_POLL 0) set(HAVE_PWD_H 0) -set(HAVE_STRINGS_H 0) # mingw-w64 has it (wrapper to string.h) +set(HAVE_SYS_EVENTFD_H 0) set(HAVE_SYS_FILIO_H 0) set(HAVE_SYS_WAIT_H 0) set(HAVE_SYS_IOCTL_H 0) @@ -135,9 +145,9 @@ set(HAVE_SYS_UN_H 0) set(HAVE_SYS_UTIME_H 1) set(HAVE_TERMIOS_H 0) set(HAVE_TERMIO_H 0) -set(HAVE_UTIME_H 0) # mingw-w64 has it (wrapper to sys/utime.h) +set(HAVE_LINUX_TCP_H 0) -set(HAVE_FSEEKO 0) +set(HAVE_FSEEKO 0) # mingw-w64 2.0.0 and newer has it set(HAVE__FSEEKI64 1) set(HAVE_SOCKET 1) set(HAVE_SELECT 1) @@ -156,9 +166,7 @@ set(HAVE_GMTIME_R 0) set(HAVE_GETHOSTBYNAME_R 0) set(HAVE_SIGNAL 1) set(HAVE_SIGACTION 0) -set(HAVE_LINUX_TCP_H 0) set(HAVE_GLIBC_STRERROR_R 0) -set(HAVE_MACH_ABSOLUTE_TIME 0) set(HAVE_GETIFADDRS 0) set(HAVE_FCNTL_O_NONBLOCK 0) set(HAVE_IOCTLSOCKET 1) @@ -168,7 +176,6 @@ set(HAVE_IOCTLSOCKET_FIONBIO 1) set(HAVE_IOCTL_FIONBIO 0) set(HAVE_SETSOCKOPT_SO_NONBLOCK 0) set(HAVE_POSIX_STRERROR_R 0) -set(HAVE_BUILTIN_AVAILABLE 0) set(HAVE_MSG_NOSIGNAL 0) set(HAVE_STRUCT_TIMEVAL 1) set(HAVE_STRUCT_SOCKADDR_STORAGE 1) diff --git a/deps/curl/CMake/Utilities.cmake b/deps/curl/CMake/Utilities.cmake index 84a40f4e..0ecfa312 100644 --- a/deps/curl/CMake/Utilities.cmake +++ b/deps/curl/CMake/Utilities.cmake @@ -24,12 +24,12 @@ # File containing various utilities # Returns number of arguments that evaluate to true -function(count_true output_count_var) +function(count_true _output_count_var) set(lst_len 0) foreach(option_var IN LISTS ARGN) if(${option_var}) math(EXPR lst_len "${lst_len} + 1") endif() endforeach() - set(${output_count_var} ${lst_len} PARENT_SCOPE) + set(${_output_count_var} ${lst_len} PARENT_SCOPE) endfunction() diff --git a/deps/curl/CMake/cmake_uninstall.cmake.in b/deps/curl/CMake/cmake_uninstall.cmake.in index 47aec8d4..d1f746fc 100644 --- a/deps/curl/CMake/cmake_uninstall.cmake.in +++ b/deps/curl/CMake/cmake_uninstall.cmake.in @@ -30,20 +30,20 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX) endif() message(${CMAKE_INSTALL_PREFIX}) -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" _files) +string(REGEX REPLACE "\n" ";" _files "${_files}") +foreach(_file ${_files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${_file}") + if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}") exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${_file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval - ) + ) if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}") endif() else() - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + message(STATUS "File $ENV{DESTDIR}${_file} does not exist.") endif() endforeach() diff --git a/deps/curl/CMake/curl-config.cmake.in b/deps/curl/CMake/curl-config.cmake.in index 9adb96e0..aa9eb51f 100644 --- a/deps/curl/CMake/curl-config.cmake.in +++ b/deps/curl/CMake/curl-config.cmake.in @@ -23,12 +23,19 @@ ########################################################################### @PACKAGE_INIT@ -include(CMakeFindDependencyMacro) -if(@USE_OPENSSL@) - find_dependency(OpenSSL @OPENSSL_VERSION_MAJOR@) +if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) # Keep in sync with root CMakeLists.txt + set(_curl_use_pkgconfig_default ON) +else() + set(_curl_use_pkgconfig_default OFF) endif() -if(@USE_ZLIB@) - find_dependency(ZLIB @ZLIB_VERSION_MAJOR@) +option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies" ${_curl_use_pkgconfig_default}) + +include(CMakeFindDependencyMacro) +if("@USE_OPENSSL@") + find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@") +endif() +if("@HAVE_LIBZ@") + find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@") endif() include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") @@ -38,3 +45,7 @@ check_required_components("@PROJECT_NAME@") if(NOT TARGET @PROJECT_NAME@::libcurl) add_library(@PROJECT_NAME@::libcurl ALIAS @PROJECT_NAME@::@LIB_SELECTED@) endif() + +# For compatibility with CMake's FindCURL.cmake +set(CURL_LIBRARIES @PROJECT_NAME@::libcurl) +set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/deps/curl/CMakeLists.txt b/deps/curl/CMakeLists.txt index 656aa7c7..796ce8ad 100644 --- a/deps/curl/CMakeLists.txt +++ b/deps/curl/CMakeLists.txt @@ -24,11 +24,11 @@ # by Tetetest and Sukender (Benoit Neil) # Note: By default this CMake build script detects the version of some -# dependencies using `check_symbol_exists`. Those checks do not work -# in the case that both CURL and its dependency are included as -# sub-projects in a larger build using `FetchContent`. To support -# that case, additional variables may be defined by the parent -# project, ideally in the "extra" find package redirect file: +# dependencies using `check_symbol_exists`. Those checks do not work in +# the case that both CURL and its dependency are included as sub-projects +# in a larger build using `FetchContent`. To support that case, additional +# variables may be defined by the parent project, ideally in the "extra" +# find package redirect file: # https://cmake.org/cmake/help/latest/module/FetchContent.html#integrating-with-find-package # # The following variables are available: @@ -36,95 +36,189 @@ # HAVE_OPENSSL_SRP: `SSL_CTX_set_srp_username` present in OpenSSL/wolfSSL # HAVE_GNUTLS_SRP: `gnutls_srp_verifier` present in GnuTLS # HAVE_SSL_CTX_SET_QUIC_METHOD: `SSL_CTX_set_quic_method` present in OpenSSL/wolfSSL -# HAVE_QUICHE_CONN_SET_QLOG_FD: `quiche_conn_set_qlog_fd` present in QUICHE +# HAVE_QUICHE_CONN_SET_QLOG_FD: `quiche_conn_set_qlog_fd` present in quiche +# HAVE_ECH: ECH API checks for OpenSSL, BoringSSL or wolfSSL # # For each of the above variables, if the variable is DEFINED (either -# to ON or OFF), the symbol detection will be skipped. If the -# variable is NOT DEFINED, the symbol detection will be performed. +# to ON or OFF), the symbol detection is skipped. If the variable is +# NOT DEFINED, the symbol detection is performed. cmake_minimum_required(VERSION 3.7...3.16 FATAL_ERROR) message(STATUS "Using CMake version ${CMAKE_VERSION}") +# Collect command-line arguments for buildinfo.txt. +# Must reside at the top of the script to work as expected. +get_cmake_property(_cache_vars CACHE_VARIABLES) +unset(_cmake_args) +foreach(_cache_var ${_cache_vars}) + get_property(_cache_var_helpstring CACHE ${_cache_var} PROPERTY HELPSTRING) + if(_cache_var_helpstring STREQUAL "No help, variable specified on the command line.") + get_property(_cache_var_type CACHE ${_cache_var} PROPERTY TYPE) + if(_cache_var_type STREQUAL "UNINITIALIZED") + set(_cache_var_type) + else() + set(_cache_var_type ":${_cache_var_type}") + endif() + set(_cmake_args "${_cmake_args} -D${_cache_var}${_cache_var_type}=\"${${_cache_var}}\"") + endif() +endforeach() + +function(curl_dumpvars) # Dump all defined variables with their values + message("::group::CMake Variable Dump") + get_cmake_property(_vars VARIABLES) + foreach(_var ${_vars}) + message("${_var} = ${${_var}}") + endforeach() + message("::endgroup::") +endfunction() + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}") include(Utilities) include(Macros) include(CMakeDependentOption) include(CheckCCompilerFlag) -project(CURL C) +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/curl/curlver.h" _curl_version_h_contents REGEX "#define LIBCURL_VERSION( |_NUM )") +string(REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*" _curl_version ${_curl_version_h_contents}) +string(REGEX REPLACE "[^\"]+\"" "" _curl_version ${_curl_version}) +string(REGEX MATCH "#define LIBCURL_VERSION_NUM 0x[0-9a-fA-F]+" _curl_version_num ${_curl_version_h_contents}) +string(REGEX REPLACE "[^0]+0x" "" _curl_version_num ${_curl_version_num}) +unset(_curl_version_h_contents) -file(STRINGS ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS REGEX "#define LIBCURL_VERSION( |_NUM )") -string(REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*" - CURL_VERSION ${CURL_VERSION_H_CONTENTS}) -string(REGEX REPLACE "[^\"]+\"" "" CURL_VERSION ${CURL_VERSION}) -string(REGEX MATCH "#define LIBCURL_VERSION_NUM 0x[0-9a-fA-F]+" - CURL_VERSION_NUM ${CURL_VERSION_H_CONTENTS}) -string(REGEX REPLACE "[^0]+0x" "" CURL_VERSION_NUM ${CURL_VERSION_NUM}) +message(STATUS "curl version=[${_curl_version}]") +string(REGEX REPLACE "([0-9]+\.[0-9]+\.[0-9]+).+" "\\1" _curl_version_sem "${_curl_version}") +project(CURL + VERSION "${_curl_version_sem}" + LANGUAGES C) -# Setup package meta-data -# SET(PACKAGE "curl") -message(STATUS "curl version=[${CURL_VERSION}]") -# SET(PACKAGE_TARNAME "curl") -# SET(PACKAGE_NAME "curl") -# SET(PACKAGE_VERSION "-") -# SET(PACKAGE_STRING "curl-") -# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/") -set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}") -if(CMAKE_C_COMPILER_TARGET) - set(OS "\"${CMAKE_C_COMPILER_TARGET}\"") -else() - set(OS "\"${CMAKE_SYSTEM_NAME}\"") +unset(_target_flags) +if(APPLE) + set(_target_flags "${_target_flags} APPLE") +endif() +if(UNIX) + set(_target_flags "${_target_flags} UNIX") +endif() +if(BSD) + set(_target_flags "${_target_flags} BSD") +endif() +if(WIN32) + set(_target_flags "${_target_flags} WIN32") +endif() +if(CYGWIN) + set(_target_flags "${_target_flags} CYGWIN") +endif() +if(MSYS) + set(_target_flags "${_target_flags} MSYS") +endif() +if(CMAKE_COMPILER_IS_GNUCC) + set(_target_flags "${_target_flags} GCC") +endif() +if(MINGW) + set(_target_flags "${_target_flags} MINGW") +endif() +if(MSVC) + set(_target_flags "${_target_flags} MSVC") +endif() +if(VCPKG_TOOLCHAIN) + set(_target_flags "${_target_flags} VCPKG") +endif() +if(CMAKE_CROSSCOMPILING) + set(_target_flags "${_target_flags} CROSS") +endif() +message(STATUS "CMake platform flags:${_target_flags}") + +if(CMAKE_CROSSCOMPILING) + message(STATUS "Cross-compiling: " + "${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR} -> " + "${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}") endif() -include_directories(${CURL_SOURCE_DIR}/include) +if(CMAKE_C_COMPILER_TARGET) + set(CURL_OS "\"${CMAKE_C_COMPILER_TARGET}\"") +else() + set(CURL_OS "\"${CMAKE_SYSTEM_NAME}\"") +endif() -set(CMAKE_UNITY_BUILD_BATCH_SIZE 0) +include_directories("${PROJECT_SOURCE_DIR}/include") + +if(NOT DEFINED CMAKE_UNITY_BUILD_BATCH_SIZE) + set(CMAKE_UNITY_BUILD_BATCH_SIZE 0) +endif() option(CURL_WERROR "Turn compiler warnings into errors" OFF) option(PICKY_COMPILER "Enable picky compiler options" ON) -option(BUILD_CURL_EXE "Set to ON to build curl executable." ON) +option(BUILD_CURL_EXE "Build curl executable" ON) option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(BUILD_STATIC_LIBS "Build static libraries" OFF) option(BUILD_STATIC_CURL "Build curl executable with static libcurl" OFF) -option(ENABLE_ARES "Set to ON to enable c-ares support" OFF) -option(CURL_DISABLE_INSTALL "Set to ON to disable installation targets" OFF) +option(ENABLE_ARES "Enable c-ares support" OFF) +option(CURL_DISABLE_INSTALL "Disable installation targets" OFF) if(WIN32) - option(CURL_STATIC_CRT "Set to ON to build libcurl with static CRT on Windows (/MT)." OFF) - option(ENABLE_UNICODE "Set to ON to use the Unicode version of the Windows API functions" OFF) - set(CURL_TARGET_WINDOWS_VERSION "" CACHE STRING "Minimum target Windows version as hex string") - if(CURL_TARGET_WINDOWS_VERSION) - add_definitions(-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}) - list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}) - set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}") + option(CURL_STATIC_CRT "Build libcurl with static CRT with MSVC (/MT)" OFF) + if(CURL_STATIC_CRT AND MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") endif() + + option(ENABLE_UNICODE "Use the Unicode version of the Windows API functions" OFF) if(ENABLE_UNICODE) - add_definitions(-DUNICODE -D_UNICODE) + add_definitions("-DUNICODE" "-D_UNICODE") if(MINGW) - add_compile_options(-municode) + add_compile_options("-municode") endif() endif() + + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN") # Apply to all feature checks + + set(CURL_TARGET_WINDOWS_VERSION "" CACHE STRING "Minimum target Windows version as hex string") + if(CURL_TARGET_WINDOWS_VERSION) + add_definitions("-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}") + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}") # Apply to all feature checks + endif() + + # Detect actual value of _WIN32_WINNT and store as HAVE_WIN32_WINNT + curl_internal_test(HAVE_WIN32_WINNT) + if(HAVE_WIN32_WINNT) + string(REGEX MATCH ".*_WIN32_WINNT=0x[0-9a-fA-F]+" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") + string(REGEX REPLACE ".*_WIN32_WINNT=" "" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") + string(REGEX REPLACE "0x([0-9a-f][0-9a-f][0-9a-f])$" "0x0\\1" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") # pad to 4 digits + string(TOLOWER "${CURL_TEST_OUTPUT}" HAVE_WIN32_WINNT) + message(STATUS "Found _WIN32_WINNT=${HAVE_WIN32_WINNT}") + endif() + # Avoid storing HAVE_WIN32_WINNT in CMake cache + unset(HAVE_WIN32_WINNT CACHE) endif() -option(CURL_LTO "Turn on compiler Link Time Optimizations" OFF) +option(CURL_LTO "Enable compiler Link Time Optimizations" OFF) -cmake_dependent_option(ENABLE_THREADED_RESOLVER "Set to ON to enable threaded DNS lookup" - ON "NOT ENABLE_ARES" - OFF) - -option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF) -option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" OFF) +cmake_dependent_option(ENABLE_THREADED_RESOLVER "Enable threaded DNS lookup" + ON "NOT ENABLE_ARES" + OFF) include(PickyWarnings) +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") # Required for sendmmsg() +endif() + +option(ENABLE_DEBUG "Enable curl debug features (for developing curl itself)" OFF) if(ENABLE_DEBUG) - # DEBUGBUILD will be defined only for Debug builds - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$:DEBUGBUILD>) - set(ENABLE_CURLDEBUG ON) + message(WARNING "This curl build is Debug-enabled, do not use in production.") +endif() +option(ENABLE_CURLDEBUG "Enable TrackMemory debug feature" ${ENABLE_DEBUG}) + +if(MSVC) + set(ENABLE_CURLDEBUG OFF) # FIXME: TrackMemory + MSVC fails test 558 and 1330. Tested with static build, Debug mode. +endif() + +if(ENABLE_DEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "DEBUGBUILD") endif() if(ENABLE_CURLDEBUG) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "CURLDEBUG") endif() # For debug libs and exes, add "-d" postfix @@ -144,120 +238,146 @@ elseif(BUILD_STATIC_CURL AND NOT BUILD_STATIC_LIBS) set(BUILD_STATIC_CURL OFF) endif() -# lib flavour selected for curl tool +# Lib flavour selected for curl tool if(BUILD_STATIC_CURL) set(LIB_SELECTED_FOR_EXE ${LIB_STATIC}) else() set(LIB_SELECTED_FOR_EXE ${LIB_SHARED}) endif() -# lib flavour selected for example and test programs. +# Lib flavour selected for example and test programs. if(BUILD_SHARED_LIBS) set(LIB_SELECTED ${LIB_SHARED}) else() set(LIB_SELECTED ${LIB_STATIC}) endif() -# initialize CURL_LIBS +# Override to force-disable or force-enable the use of pkg-config. +if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) # Keep in sync with CMake/curl-config.cmake.in + set(_curl_use_pkgconfig_default ON) +else() + set(_curl_use_pkgconfig_default OFF) +endif() +option(CURL_USE_PKGCONFIG "Enable pkg-config to detect dependencies" ${_curl_use_pkgconfig_default}) + +# Initialize variables collecting dependency libs, paths, pkg-config names. 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_LIBRARY}) + find_package(Cares REQUIRED) + list(APPEND CURL_LIBS ${CARES_LIBRARIES}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libcares") + add_definitions("-DCARES_NO_DEPRECATED") # Ignore c-ares deprecation warnings endif() include(CurlSymbolHiding) -option(CURL_ENABLE_EXPORT_TARGET "to enable cmake export target" ON) +option(CURL_ENABLE_EXPORT_TARGET "Enable CMake export target" ON) mark_as_advanced(CURL_ENABLE_EXPORT_TARGET) -option(CURL_DISABLE_ALTSVC "disables alt-svc support" OFF) +option(CURL_DISABLE_ALTSVC "Disable alt-svc support" OFF) mark_as_advanced(CURL_DISABLE_ALTSVC) -option(CURL_DISABLE_SRP "disables TLS-SRP support" OFF) +option(CURL_DISABLE_SRP "Disable TLS-SRP support" OFF) mark_as_advanced(CURL_DISABLE_SRP) -option(CURL_DISABLE_COOKIES "disables cookies support" OFF) +option(CURL_DISABLE_COOKIES "Disable cookies support" OFF) mark_as_advanced(CURL_DISABLE_COOKIES) -option(CURL_DISABLE_BASIC_AUTH "disables Basic authentication" OFF) +option(CURL_DISABLE_BASIC_AUTH "Disable Basic authentication" OFF) mark_as_advanced(CURL_DISABLE_BASIC_AUTH) -option(CURL_DISABLE_BEARER_AUTH "disables Bearer authentication" OFF) +option(CURL_DISABLE_BEARER_AUTH "Disable Bearer authentication" OFF) mark_as_advanced(CURL_DISABLE_BEARER_AUTH) -option(CURL_DISABLE_DIGEST_AUTH "disables Digest authentication" OFF) +option(CURL_DISABLE_DIGEST_AUTH "Disable Digest authentication" OFF) mark_as_advanced(CURL_DISABLE_DIGEST_AUTH) -option(CURL_DISABLE_KERBEROS_AUTH "disables Kerberos authentication" OFF) +option(CURL_DISABLE_KERBEROS_AUTH "Disable Kerberos authentication" OFF) mark_as_advanced(CURL_DISABLE_KERBEROS_AUTH) -option(CURL_DISABLE_NEGOTIATE_AUTH "disables negotiate authentication" OFF) +option(CURL_DISABLE_NEGOTIATE_AUTH "Disable negotiate authentication" OFF) mark_as_advanced(CURL_DISABLE_NEGOTIATE_AUTH) -option(CURL_DISABLE_AWS "disables AWS-SIG4" OFF) +option(CURL_DISABLE_AWS "Disable aws-sigv4" OFF) mark_as_advanced(CURL_DISABLE_AWS) -option(CURL_DISABLE_DICT "disables DICT" OFF) +option(CURL_DISABLE_DICT "Disable DICT" OFF) mark_as_advanced(CURL_DISABLE_DICT) -option(CURL_DISABLE_DOH "disables DNS-over-HTTPS" OFF) +option(CURL_DISABLE_DOH "Disable DNS-over-HTTPS" OFF) mark_as_advanced(CURL_DISABLE_DOH) -option(CURL_DISABLE_FILE "disables FILE" OFF) +option(CURL_DISABLE_FILE "Disable FILE" OFF) mark_as_advanced(CURL_DISABLE_FILE) -cmake_dependent_option(CURL_DISABLE_FORM_API "disables form api" OFF - "NOT CURL_DISABLE_MIME" ON) -mark_as_advanced(CURL_DISABLE_FORM_API) -option(CURL_DISABLE_FTP "disables FTP" OFF) +option(CURL_DISABLE_FTP "Disable FTP" OFF) mark_as_advanced(CURL_DISABLE_FTP) -option(CURL_DISABLE_GETOPTIONS "disables curl_easy_options API for existing options to curl_easy_setopt" OFF) +option(CURL_DISABLE_GETOPTIONS "Disable curl_easy_options API for existing options to curl_easy_setopt" OFF) mark_as_advanced(CURL_DISABLE_GETOPTIONS) -option(CURL_DISABLE_GOPHER "disables Gopher" OFF) +option(CURL_DISABLE_GOPHER "Disable Gopher" OFF) mark_as_advanced(CURL_DISABLE_GOPHER) -option(CURL_DISABLE_HEADERS_API "disables headers-api support" OFF) +option(CURL_DISABLE_HEADERS_API "Disable headers-api support" OFF) mark_as_advanced(CURL_DISABLE_HEADERS_API) -option(CURL_DISABLE_HSTS "disables HSTS support" OFF) +option(CURL_DISABLE_HSTS "Disable HSTS support" OFF) mark_as_advanced(CURL_DISABLE_HSTS) -option(CURL_DISABLE_HTTP "disables HTTP" OFF) +option(CURL_DISABLE_HTTP "Disable HTTP" OFF) mark_as_advanced(CURL_DISABLE_HTTP) -option(CURL_DISABLE_HTTP_AUTH "disables all HTTP authentication methods" OFF) +option(CURL_DISABLE_HTTP_AUTH "Disable all HTTP authentication methods" OFF) mark_as_advanced(CURL_DISABLE_HTTP_AUTH) -option(CURL_DISABLE_IMAP "disables IMAP" OFF) +option(CURL_DISABLE_IMAP "Disable IMAP" OFF) mark_as_advanced(CURL_DISABLE_IMAP) -option(CURL_DISABLE_LDAP "disables LDAP" OFF) +option(CURL_DISABLE_LDAP "Disable LDAP" OFF) mark_as_advanced(CURL_DISABLE_LDAP) -option(CURL_DISABLE_LDAPS "disables LDAPS" OFF) +option(CURL_DISABLE_LDAPS "Disable LDAPS" ${CURL_DISABLE_LDAP}) mark_as_advanced(CURL_DISABLE_LDAPS) -option(CURL_DISABLE_LIBCURL_OPTION "disables --libcurl option from the curl tool" OFF) +option(CURL_DISABLE_LIBCURL_OPTION "Disable --libcurl option from the curl tool" OFF) mark_as_advanced(CURL_DISABLE_LIBCURL_OPTION) -option(CURL_DISABLE_MIME "disables MIME support" OFF) +option(CURL_DISABLE_MIME "Disable MIME support" OFF) mark_as_advanced(CURL_DISABLE_MIME) -option(CURL_DISABLE_MQTT "disables MQTT" OFF) -mark_as_advanced(CURL_DISABLE_BINDLOCAL) -option(CURL_DISABLE_BINDLOCAL "disables local binding support" OFF) +cmake_dependent_option(CURL_DISABLE_FORM_API "Disable form-api" + OFF "NOT CURL_DISABLE_MIME" + ON) +mark_as_advanced(CURL_DISABLE_FORM_API) +option(CURL_DISABLE_MQTT "Disable MQTT" OFF) mark_as_advanced(CURL_DISABLE_MQTT) -option(CURL_DISABLE_NETRC "disables netrc parser" OFF) +option(CURL_DISABLE_BINDLOCAL "Disable local binding support" OFF) +mark_as_advanced(CURL_DISABLE_BINDLOCAL) +option(CURL_DISABLE_NETRC "Disable netrc parser" OFF) mark_as_advanced(CURL_DISABLE_NETRC) -option(CURL_DISABLE_NTLM "disables NTLM support" OFF) +option(CURL_DISABLE_NTLM "Disable NTLM support" OFF) mark_as_advanced(CURL_DISABLE_NTLM) -option(CURL_DISABLE_PARSEDATE "disables date parsing" OFF) +option(CURL_DISABLE_PARSEDATE "Disable date parsing" OFF) mark_as_advanced(CURL_DISABLE_PARSEDATE) -option(CURL_DISABLE_POP3 "disables POP3" OFF) +option(CURL_DISABLE_POP3 "Disable POP3" OFF) mark_as_advanced(CURL_DISABLE_POP3) -option(CURL_DISABLE_PROGRESS_METER "disables built-in progress meter" OFF) +option(CURL_DISABLE_PROGRESS_METER "Disable built-in progress meter" OFF) mark_as_advanced(CURL_DISABLE_PROGRESS_METER) -option(CURL_DISABLE_PROXY "disables proxy support" OFF) +option(CURL_DISABLE_PROXY "Disable proxy support" OFF) mark_as_advanced(CURL_DISABLE_PROXY) -option(CURL_DISABLE_RTSP "disables RTSP" OFF) +option(CURL_DISABLE_IPFS "Disable IPFS" OFF) +mark_as_advanced(CURL_DISABLE_IPFS) +option(CURL_DISABLE_RTSP "Disable RTSP" OFF) +mark_as_advanced(CURL_DISABLE_SHA512_256) +option(CURL_DISABLE_SHA512_256 "Disable SHA-512/256 hash algorithm" OFF) mark_as_advanced(CURL_DISABLE_RTSP) -option(CURL_DISABLE_SHUFFLE_DNS "disables shuffle DNS feature" OFF) +option(CURL_DISABLE_SHUFFLE_DNS "Disable shuffle DNS feature" OFF) mark_as_advanced(CURL_DISABLE_SHUFFLE_DNS) -option(CURL_DISABLE_SMB "disables SMB" OFF) +option(CURL_DISABLE_SMB "Disable SMB" OFF) mark_as_advanced(CURL_DISABLE_SMB) -option(CURL_DISABLE_SMTP "disables SMTP" OFF) +option(CURL_DISABLE_SMTP "Disable SMTP" OFF) mark_as_advanced(CURL_DISABLE_SMTP) -option(CURL_DISABLE_SOCKETPAIR "disables 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_TELNET "disables Telnet" OFF) +option(CURL_DISABLE_WEBSOCKETS "Disable WebSocket" OFF) +mark_as_advanced(CURL_DISABLE_WEBSOCKETS) +option(CURL_DISABLE_TELNET "Disable Telnet" OFF) mark_as_advanced(CURL_DISABLE_TELNET) -option(CURL_DISABLE_TFTP "disables TFTP" OFF) +option(CURL_DISABLE_TFTP "Disable TFTP" OFF) mark_as_advanced(CURL_DISABLE_TFTP) -option(CURL_DISABLE_VERBOSE_STRINGS "disables verbose strings" OFF) +option(CURL_DISABLE_VERBOSE_STRINGS "Disable verbose strings" OFF) mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS) +if(CURL_DISABLE_HTTP) + set(CURL_DISABLE_IPFS ON) + set(CURL_DISABLE_RTSP ON) + set(CURL_DISABLE_ALTSVC ON) + set(CURL_DISABLE_HSTS ON) +endif() + # Corresponds to HTTP_ONLY in lib/curl_setup.h -option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF) +option(HTTP_ONLY "Disable all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF) mark_as_advanced(HTTP_ONLY) if(HTTP_ONLY) @@ -270,6 +390,7 @@ if(HTTP_ONLY) set(CURL_DISABLE_LDAPS ON) set(CURL_DISABLE_MQTT ON) set(CURL_DISABLE_POP3 ON) + set(CURL_DISABLE_IPFS ON) set(CURL_DISABLE_RTSP ON) set(CURL_DISABLE_SMB ON) set(CURL_DISABLE_SMTP ON) @@ -277,25 +398,27 @@ if(HTTP_ONLY) set(CURL_DISABLE_TFTP ON) endif() -option(ENABLE_IPV6 "Define if you want to enable IPv6 support" ON) +if(WINDOWS_STORE) + set(CURL_DISABLE_TELNET ON) # telnet code needs fixing to compile for UWP. +endif() + +option(ENABLE_IPV6 "Enable IPv6 support" ON) mark_as_advanced(ENABLE_IPV6) if(ENABLE_IPV6 AND NOT WIN32) include(CheckStructHasMember) - check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" - HAVE_SOCKADDR_IN6_SIN6_ADDR) - check_struct_has_member("struct sockaddr_in6" sin6_scope_id "netinet/in.h" - HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) + check_struct_has_member("struct sockaddr_in6" "sin6_addr" "netinet/in.h" HAVE_SOCKADDR_IN6_SIN6_ADDR) + check_struct_has_member("struct sockaddr_in6" "sin6_scope_id" "netinet/in.h" HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) if(NOT HAVE_SOCKADDR_IN6_SIN6_ADDR) message(WARNING "struct sockaddr_in6 not available, disabling IPv6 support") # Force the feature off as this name is used as guard macro... - set(ENABLE_IPV6 OFF - CACHE BOOL "Define if you want to enable IPv6 support" FORCE) + set(ENABLE_IPV6 OFF CACHE BOOL "Enable IPv6 support" FORCE) endif() - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT ENABLE_ARES) - set(use_core_foundation_and_core_services ON) + if(APPLE AND NOT ENABLE_ARES) + set(_use_core_foundation_and_core_services ON) find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration") + mark_as_advanced(SYSTEMCONFIGURATION_FRAMEWORK) if(NOT SYSTEMCONFIGURATION_FRAMEWORK) message(FATAL_ERROR "SystemConfiguration framework not found") endif() @@ -303,11 +426,15 @@ if(ENABLE_IPV6 AND NOT WIN32) list(APPEND CURL_LIBS "-framework SystemConfiguration") endif() endif() +if(ENABLE_IPV6) + set(USE_IPV6 ON) +endif() find_package(Perl) -option(BUILD_LIBCURL_DOCS "to build libcurl man pages" ON) -option(ENABLE_CURL_MANUAL "to build the man page for curl and enable its -M/--manual option" ON) +option(BUILD_LIBCURL_DOCS "Build libcurl man pages" ON) +option(BUILD_MISC_DOCS "Build misc man pages (e.g. curl-config and mk-ca-bundle)" ON) +option(ENABLE_CURL_MANUAL "Build the man page for curl and enable its -M/--manual option" ON) if(ENABLE_CURL_MANUAL OR BUILD_LIBCURL_DOCS) if(PERL_FOUND) @@ -318,25 +445,19 @@ if(ENABLE_CURL_MANUAL OR BUILD_LIBCURL_DOCS) endif() endif() -if(CURL_STATIC_CRT) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") -endif() - # Disable warnings on Borland to avoid changing 3rd party code. if(BORLAND) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") endif() # If we are on AIX, do the _ALL_SOURCE magic -if(${CMAKE_SYSTEM_NAME} MATCHES AIX) - set(_ALL_SOURCE 1) +if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + add_definitions("-D_ALL_SOURCE") endif() # If we are on Haiku, make sure that the network library is brought in. -if(${CMAKE_SYSTEM_NAME} MATCHES Haiku) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lnetwork") +if(CMAKE_SYSTEM_NAME STREQUAL "Haiku") + list(APPEND CURL_LIBS "network") endif() # Include all the necessary files for macros @@ -349,9 +470,9 @@ include(CheckSymbolExists) include(CheckTypeSize) include(CheckCSourceCompiles) -# On windows preload settings +# Preload settings on Windows if(WIN32) - include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake) + include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake") endif() if(ENABLE_THREADED_RESOLVER) @@ -361,70 +482,87 @@ if(ENABLE_THREADED_RESOLVER) find_package(Threads REQUIRED) set(USE_THREADS_POSIX ${CMAKE_USE_PTHREADS_INIT}) set(HAVE_PTHREAD_H ${CMAKE_USE_PTHREADS_INIT}) - set(CURL_LIBS ${CURL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + list(APPEND CURL_LIBS ${CMAKE_THREAD_LIBS_INIT}) endif() endif() # Check for all needed libraries -check_library_exists("socket" "connect" "" HAVE_LIBSOCKET) -if(HAVE_LIBSOCKET) - set(CURL_LIBS "socket;${CURL_LIBS}") -endif() - -check_function_exists(gethostname HAVE_GETHOSTNAME) - -if(WIN32) - list(APPEND CURL_LIBS "ws2_32" "bcrypt") - if(USE_LIBRTMP) - list(APPEND CURL_LIBS "winmm") +if(NOT WIN32) + check_library_exists("socket" "connect" "" HAVE_LIBSOCKET) + if(HAVE_LIBSOCKET) + set(CURL_LIBS "socket;${CURL_LIBS}") endif() endif() -# check SSL libraries +check_function_exists("gethostname" HAVE_GETHOSTNAME) + +if(WIN32) + list(APPEND CURL_LIBS "ws2_32" "bcrypt") +endif() + +# Check SSL libraries option(CURL_ENABLE_SSL "Enable SSL support" ON) if(CURL_DEFAULT_SSL_BACKEND) - set(valid_default_ssl_backend FALSE) + set(_valid_default_ssl_backend FALSE) endif() if(APPLE) - cmake_dependent_option(CURL_USE_SECTRANSP "Enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF) + cmake_dependent_option(CURL_USE_SECTRANSP "Enable Apple OS native SSL/TLS (Secure Transport)" OFF CURL_ENABLE_SSL OFF) endif() if(WIN32) - cmake_dependent_option(CURL_USE_SCHANNEL "Enable Windows native SSL/TLS" OFF CURL_ENABLE_SSL OFF) + cmake_dependent_option(CURL_USE_SCHANNEL "Enable Windows native SSL/TLS (Schannel)" OFF CURL_ENABLE_SSL OFF) option(CURL_WINDOWS_SSPI "Enable SSPI on Windows" ${CURL_USE_SCHANNEL}) endif() cmake_dependent_option(CURL_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) cmake_dependent_option(CURL_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF) cmake_dependent_option(CURL_USE_WOLFSSL "Enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF) cmake_dependent_option(CURL_USE_GNUTLS "Enable GnuTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) +cmake_dependent_option(CURL_USE_RUSTLS "Enable Rustls for SSL/TLS" OFF CURL_ENABLE_SSL OFF) -set(openssl_default ON) -if(WIN32 OR CURL_USE_SECTRANSP OR CURL_USE_SCHANNEL OR CURL_USE_MBEDTLS OR CURL_USE_WOLFSSL) - set(openssl_default OFF) +if(WIN32 OR + CURL_USE_SECTRANSP OR + CURL_USE_SCHANNEL OR + CURL_USE_MBEDTLS OR + CURL_USE_BEARSSL OR + CURL_USE_WOLFSSL OR + CURL_USE_GNUTLS OR + CURL_USE_RUSTLS) + set(_openssl_default OFF) +else() + set(_openssl_default ON) +endif() +cmake_dependent_option(CURL_USE_OPENSSL "Enable OpenSSL for SSL/TLS" ${_openssl_default} CURL_ENABLE_SSL OFF) +option(USE_OPENSSL_QUIC "Use OpenSSL and nghttp3 libraries for HTTP/3 support" OFF) +if(USE_OPENSSL_QUIC AND NOT CURL_USE_OPENSSL) + message(WARNING "OpenSSL QUIC has been requested, but without enabling OpenSSL. Will not enable QUIC.") + set(USE_OPENSSL_QUIC OFF) endif() -cmake_dependent_option(CURL_USE_OPENSSL "Enable OpenSSL for SSL/TLS" ${openssl_default} CURL_ENABLE_SSL OFF) option(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG "Disable automatic loading of OpenSSL configuration" OFF) -count_true(enabled_ssl_options_count +count_true(_enabled_ssl_options_count CURL_USE_SCHANNEL CURL_USE_SECTRANSP CURL_USE_OPENSSL CURL_USE_MBEDTLS CURL_USE_BEARSSL CURL_USE_WOLFSSL + CURL_USE_GNUTLS + CURL_USE_RUSTLS ) -if(enabled_ssl_options_count GREATER "1") +if(_enabled_ssl_options_count GREATER 1) set(CURL_WITH_MULTI_SSL ON) +elseif(_enabled_ssl_options_count EQUAL 0) + set(CURL_DISABLE_HSTS ON) endif() if(CURL_USE_SCHANNEL) - set(SSL_ENABLED ON) - set(USE_SCHANNEL ON) # Windows native SSL/TLS support - set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL implies CURL_WINDOWS_SSPI + set(_ssl_enabled ON) + set(USE_SCHANNEL ON) # Windows native SSL/TLS support + set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL implies CURL_WINDOWS_SSPI if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "schannel") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() endif() if(CURL_WINDOWS_SSPI) @@ -432,121 +570,177 @@ if(CURL_WINDOWS_SSPI) endif() if(CURL_USE_SECTRANSP) - set(use_core_foundation_and_core_services ON) + set(_use_core_foundation_and_core_services ON) find_library(SECURITY_FRAMEWORK "Security") + mark_as_advanced(SECURITY_FRAMEWORK) if(NOT SECURITY_FRAMEWORK) - message(FATAL_ERROR "Security framework not found") + message(FATAL_ERROR "Security framework not found") endif() - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_SECTRANSP ON) list(APPEND CURL_LIBS "-framework Security") if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "secure-transport") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() + + message(WARNING "Secure Transport does not support TLS 1.3.") endif() -if(use_core_foundation_and_core_services) +if(_use_core_foundation_and_core_services) find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation") + mark_as_advanced(COREFOUNDATION_FRAMEWORK) find_library(CORESERVICES_FRAMEWORK "CoreServices") + mark_as_advanced(CORESERVICES_FRAMEWORK) if(NOT COREFOUNDATION_FRAMEWORK) - message(FATAL_ERROR "CoreFoundation framework not found") + message(FATAL_ERROR "CoreFoundation framework not found") endif() if(NOT CORESERVICES_FRAMEWORK) - message(FATAL_ERROR "CoreServices framework not found") + message(FATAL_ERROR "CoreServices framework not found") endif() - list(APPEND CURL_LIBS "-framework CoreFoundation -framework CoreServices") + list(APPEND CURL_LIBS "-framework CoreFoundation" "-framework CoreServices") endif() if(CURL_USE_OPENSSL) find_package(OpenSSL REQUIRED) - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_OPENSSL ON) - # Depend on OpenSSL via imported targets if supported by the running - # version of CMake. This allows our dependents to get our dependencies - # transitively. - if(NOT CMAKE_VERSION VERSION_LESS 3.4) - list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) - else() - list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) - include_directories(${OPENSSL_INCLUDE_DIR}) - endif() + # 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") if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() + set(_curl_ca_bundle_supported TRUE) + cmake_push_check_state() set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) if(NOT DEFINED HAVE_BORINGSSL) - check_symbol_exists(OPENSSL_IS_BORINGSSL "openssl/base.h" HAVE_BORINGSSL) + check_symbol_exists("OPENSSL_IS_BORINGSSL" "openssl/base.h" HAVE_BORINGSSL) endif() if(NOT DEFINED HAVE_AWSLC) - check_symbol_exists(OPENSSL_IS_AWSLC "openssl/base.h" HAVE_AWSLC) + check_symbol_exists("OPENSSL_IS_AWSLC" "openssl/base.h" HAVE_AWSLC) endif() + cmake_pop_check_state() endif() if(CURL_USE_MBEDTLS) find_package(MbedTLS REQUIRED) - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_MBEDTLS ON) list(APPEND CURL_LIBS ${MBEDTLS_LIBRARIES}) - include_directories(${MBEDTLS_INCLUDE_DIRS}) + list(APPEND CURL_LIBDIRS ${MBEDTLS_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "mbedtls") + include_directories(SYSTEM ${MBEDTLS_INCLUDE_DIRS}) + link_directories(${MBEDTLS_LIBRARY_DIRS}) + if(MBEDTLS_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MBEDTLS_CFLAGS}") + endif() if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "mbedtls") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() + set(_curl_ca_bundle_supported TRUE) endif() if(CURL_USE_BEARSSL) find_package(BearSSL REQUIRED) - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_BEARSSL ON) - list(APPEND CURL_LIBS ${BEARSSL_LIBRARY}) - include_directories(${BEARSSL_INCLUDE_DIRS}) + list(APPEND CURL_LIBS ${BEARSSL_LIBRARIES}) + include_directories(SYSTEM ${BEARSSL_INCLUDE_DIRS}) if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "bearssl") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() + set(_curl_ca_bundle_supported TRUE) + + message(WARNING "BearSSL does not support TLS 1.3.") endif() if(CURL_USE_WOLFSSL) find_package(WolfSSL REQUIRED) - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_WOLFSSL ON) - list(APPEND CURL_LIBS ${WolfSSL_LIBRARIES}) - include_directories(${WolfSSL_INCLUDE_DIRS}) + list(APPEND CURL_LIBS ${WOLFSSL_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${WOLFSSL_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "wolfssl") + include_directories(SYSTEM ${WOLFSSL_INCLUDE_DIRS}) + link_directories(${WOLFSSL_LIBRARY_DIRS}) + if(WOLFSSL_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WOLFSSL_CFLAGS}") + endif() if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "wolfssl") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() + set(_curl_ca_bundle_supported TRUE) endif() if(CURL_USE_GNUTLS) - find_package(GnuTLS REQUIRED) - set(SSL_ENABLED ON) + if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(GNUTLS "gnutls") + if(GNUTLS_FOUND) + set(GNUTLS_LIBRARIES ${GNUTLS_LINK_LIBRARIES}) + endif() + endif() + if(NOT GNUTLS_FOUND) + find_package(GnuTLS REQUIRED) + endif() + find_package(Nettle REQUIRED) + set(_ssl_enabled ON) set(USE_GNUTLS ON) - list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} "nettle") - include_directories(${GNUTLS_INCLUDE_DIRS}) + list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${NETTLE_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gnutls" "nettle") + include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS} ${NETTLE_INCLUDE_DIRS}) + link_directories(${NETTLE_LIBRARY_DIRS}) + if(NETTLE_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NETTLE_CFLAGS}") + endif() if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "gnutls") - set(valid_default_ssl_backend TRUE) + set(_valid_default_ssl_backend TRUE) endif() + set(_curl_ca_bundle_supported TRUE) if(NOT DEFINED HAVE_GNUTLS_SRP AND NOT CURL_DISABLE_SRP) cmake_push_check_state() set(CMAKE_REQUIRED_INCLUDES ${GNUTLS_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${GNUTLS_LIBRARIES}) - check_symbol_exists(gnutls_srp_verifier "gnutls/gnutls.h" HAVE_GNUTLS_SRP) + check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP) cmake_pop_check_state() endif() endif() -if(CURL_DEFAULT_SSL_BACKEND AND NOT valid_default_ssl_backend) +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") + include_directories(SYSTEM ${RUSTLS_INCLUDE_DIRS}) + link_directories(${RUSTLS_LIBRARY_DIRS}) + if(RUSTLS_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${RUSTLS_CFLAGS}") + endif() + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "rustls") + set(_valid_default_ssl_backend TRUE) + endif() + set(_curl_ca_bundle_supported TRUE) +endif() + +if(CURL_DEFAULT_SSL_BACKEND AND NOT _valid_default_ssl_backend) message(FATAL_ERROR "CURL_DEFAULT_SSL_BACKEND '${CURL_DEFAULT_SSL_BACKEND}' not enabled.") endif() @@ -554,52 +748,44 @@ endif() # and before calling openssl_check_symbol_exists(). set(HAVE_LIBZ OFF) -set(USE_ZLIB OFF) -optional_dependency(ZLIB) +curl_dependency_option(ZLIB) if(ZLIB_FOUND) set(HAVE_LIBZ ON) - set(USE_ZLIB ON) - # Depend on ZLIB via imported targets if supported by the running - # version of CMake. This allows our dependents to get our dependencies - # transitively. - if(NOT CMAKE_VERSION VERSION_LESS 3.4) - list(APPEND CURL_LIBS ZLIB::ZLIB) - else() - list(APPEND CURL_LIBS ${ZLIB_LIBRARIES}) - include_directories(${ZLIB_INCLUDE_DIRS}) - endif() - list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) + # 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") endif() -option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF) +option(CURL_BROTLI "Use brotli" OFF) set(HAVE_BROTLI OFF) if(CURL_BROTLI) find_package(Brotli REQUIRED) if(BROTLI_FOUND) set(HAVE_BROTLI ON) - set(CURL_LIBS "${BROTLI_LIBRARIES};${CURL_LIBS}") # For 'ld' linker. Emulate `list(PREPEND ...)` to stay compatible with \n") - endforeach() - - list(APPEND CMAKE_REQUIRED_DEFINITIONS -DLDAP_DEPRECATED=1) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB}) - set(CURL_LIBS "${CMAKE_LDAP_LIB};${CURL_LIBS}") + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DLDAP_DEPRECATED=1") + list(APPEND CMAKE_REQUIRED_LIBRARIES ${LDAP_LIBRARY}) + set(CURL_LIBS "${LDAP_LIBRARY};${CURL_LIBS}") + set(LIBCURL_PC_REQUIRES_PRIVATE "ldap;${LIBCURL_PC_REQUIRES_PRIVATE}") if(HAVE_LIBLBER) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB}) - set(CURL_LIBS "${CMAKE_LBER_LIB};${CURL_LIBS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES ${LDAP_LBER_LIBRARY}) + set(CURL_LIBS "${LDAP_LBER_LIBRARY};${CURL_LIBS}") endif() - check_c_source_compiles(" - ${_INCLUDE_STRING} - int main(int argc, char ** argv) - { - BerValue *bvp = NULL; - BerElement *bep = ber_init(bvp); - ber_free(bep, 1); - return 0; - }" NOT_NEED_LBER_H) - if(NOT_NEED_LBER_H) - set(NEED_LBER_H OFF) - else() - set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DNEED_LBER_H") - endif() - - check_function_exists(ldap_url_parse HAVE_LDAP_URL_PARSE) - check_function_exists(ldap_init_fd HAVE_LDAP_INIT_FD) - - unset(CMAKE_REQUIRED_LIBRARIES) + check_function_exists("ldap_url_parse" HAVE_LDAP_URL_PARSE) + check_function_exists("ldap_init_fd" HAVE_LDAP_INIT_FD) check_include_file("ldap_ssl.h" HAVE_LDAP_SSL_H) @@ -840,6 +1060,7 @@ if(NOT CURL_DISABLE_LDAP) set(HAVE_LDAP_SSL ON) endif() endif() + cmake_pop_check_state() endif() endif() @@ -851,69 +1072,137 @@ if(CURL_DISABLE_LDAP) endif() endif() -# Check for idn2 -option(USE_LIBIDN2 "Use libidn2 for IDN support" ON) -if(USE_LIBIDN2) - check_library_exists("idn2" "idn2_lookup_ul" "" HAVE_LIBIDN2) - if(HAVE_LIBIDN2) - set(CURL_LIBS "idn2;${CURL_LIBS}") - check_include_file_concat("idn2.h" HAVE_IDN2_H) - endif() -else() - set(HAVE_LIBIDN2 OFF) -endif() - if(WIN32) option(USE_WIN32_IDN "Use WinIDN for IDN support" OFF) if(USE_WIN32_IDN) list(APPEND CURL_LIBS "normaliz") endif() +else() + set(USE_WIN32_IDN OFF) endif() -#libpsl -option(CURL_USE_LIBPSL "Use libPSL" ON) +if(APPLE) + option(USE_APPLE_IDN "Use Apple built-in IDN support" OFF) + if(USE_APPLE_IDN) + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES "icucore") + check_symbol_exists("uidna_openUTS46" "unicode/uidna.h" HAVE_APPLE_IDN) + cmake_pop_check_state() + if(HAVE_APPLE_IDN) + list(APPEND CURL_LIBS "icucore" "iconv") + else() + set(USE_APPLE_IDN OFF) + endif() + endif() +else() + set(USE_APPLE_IDN OFF) +endif() + +# Check for libidn2 +option(USE_LIBIDN2 "Use libidn2 for IDN support" ON) +set(HAVE_IDN2_H OFF) +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;${LIBCURL_PC_REQUIRES_PRIVATE}") + include_directories(SYSTEM ${LIBIDN2_INCLUDE_DIRS}) + link_directories(${LIBIDN2_LIBRARY_DIRS}) + if(LIBIDN2_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBIDN2_CFLAGS}") + endif() + set(HAVE_IDN2_H 1) + set(HAVE_LIBIDN2 1) + endif() +endif() + +# libpsl +option(CURL_USE_LIBPSL "Use libpsl" ON) mark_as_advanced(CURL_USE_LIBPSL) set(USE_LIBPSL OFF) if(CURL_USE_LIBPSL) - find_package(LibPSL) + find_package(Libpsl) # TODO: add REQUIRED to match autotools if(LIBPSL_FOUND) - list(APPEND CURL_LIBS ${LIBPSL_LIBRARY}) - list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}") - include_directories("${LIBPSL_INCLUDE_DIR}") + list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libpsl") + include_directories(SYSTEM ${LIBPSL_INCLUDE_DIRS}) set(USE_LIBPSL ON) + else() + message(WARNING "libpsl is enabled, but not found.") endif() endif() -#libSSH2 -option(CURL_USE_LIBSSH2 "Use libSSH2" ON) +# libssh2 +option(CURL_USE_LIBSSH2 "Use libssh2" ON) mark_as_advanced(CURL_USE_LIBSSH2) set(USE_LIBSSH2 OFF) if(CURL_USE_LIBSSH2) - find_package(LibSSH2) + find_package(Libssh2) if(LIBSSH2_FOUND) - list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY}) - list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}") - include_directories("${LIBSSH2_INCLUDE_DIR}") + list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh2") + include_directories(SYSTEM ${LIBSSH2_INCLUDE_DIRS}) set(USE_LIBSSH2 ON) endif() endif() # libssh -option(CURL_USE_LIBSSH "Use libSSH" OFF) +option(CURL_USE_LIBSSH "Use libssh" OFF) mark_as_advanced(CURL_USE_LIBSSH) if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH) - find_package(libssh CONFIG) - if(libssh_FOUND) - message(STATUS "Found libssh ${libssh_VERSION}") - # Use imported target for include and library paths. - list(APPEND CURL_LIBS ssh) + find_package(Libssh REQUIRED) + if(LIBSSH_FOUND) + list(APPEND CURL_LIBS ${LIBSSH_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBSSH_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh") + include_directories(SYSTEM ${LIBSSH_INCLUDE_DIRS}) + link_directories(${LIBSSH_LIBRARY_DIRS}) + if(LIBSSH_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBSSH_CFLAGS}") + endif() set(USE_LIBSSH ON) endif() endif() -option(CURL_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is supported with CMake build)" OFF) +# wolfSSH +option(CURL_USE_WOLFSSH "Use wolfSSH" OFF) +mark_as_advanced(CURL_USE_WOLFSSH) +set(USE_WOLFSSH OFF) +if(NOT USE_LIBSSH2 AND NOT USE_LIBSSH AND CURL_USE_WOLFSSH) + if(USE_WOLFSSL) + find_package(WolfSSH) + if(WOLFSSH_FOUND) + list(APPEND CURL_LIBS ${WOLFSSH_LIBRARIES}) + include_directories(SYSTEM ${WOLFSSH_INCLUDE_DIRS}) + set(USE_WOLFSSH ON) + endif() + else() + message(WARNING "wolfSSH requires wolfSSL. Skipping.") + endif() +endif() + +option(CURL_USE_GSASL "Use libgsasl" OFF) +mark_as_advanced(CURL_USE_GSASL) +if(CURL_USE_GSASL) + find_package(Libgsasl REQUIRED) + if(LIBGSASL_FOUND) + list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libgsasl") + include_directories(SYSTEM ${LIBGSASL_INCLUDE_DIRS}) + link_directories(${LIBGSASL_LIBRARY_DIRS}) + if(LIBGSASL_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBGSASL_CFLAGS}") + endif() + set(USE_GSASL ON) + endif() +endif() + +option(CURL_USE_GSSAPI "Use GSSAPI implementation" OFF) mark_as_advanced(CURL_USE_GSSAPI) if(CURL_USE_GSSAPI) @@ -921,182 +1210,225 @@ if(CURL_USE_GSSAPI) set(HAVE_GSSAPI ${GSS_FOUND}) if(GSS_FOUND) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS}) - message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"") + string(REPLACE ";" " " GSS_CFLAGS "${GSS_CFLAGS}") + string(REPLACE ";" " " GSS_LDFLAGS "${GSS_LDFLAGS}") - list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIR}) - check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) - check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H) - check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H) + foreach(_dir IN LISTS GSS_LIBRARY_DIRS) + set(GSS_LDFLAGS "${GSS_LDFLAGS} -L\"${_dir}\"") + endforeach() - if(NOT GSS_FLAVOUR STREQUAL "Heimdal") - # MIT - set(_INCLUDE_LIST "") + if(NOT GSS_FLAVOUR STREQUAL "GNU") + set(_include_list "") + check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) if(HAVE_GSSAPI_GSSAPI_H) - list(APPEND _INCLUDE_LIST "gssapi/gssapi.h") - endif() - if(HAVE_GSSAPI_GSSAPI_GENERIC_H) - list(APPEND _INCLUDE_LIST "gssapi/gssapi_generic.h") - endif() - if(HAVE_GSSAPI_GSSAPI_KRB5_H) - list(APPEND _INCLUDE_LIST "gssapi/gssapi_krb5.h") + list(APPEND _include_list "gssapi/gssapi.h") endif() + check_include_files("${_include_list};gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H) - string(REPLACE ";" " " _COMPILER_FLAGS_STR "${GSS_COMPILER_FLAGS}") - string(REPLACE ";" " " _LINKER_FLAGS_STR "${GSS_LINKER_FLAGS}") + if(GSS_FLAVOUR STREQUAL "MIT") + check_include_files("${_include_list};gssapi/gssapi_krb5.h" _have_gssapi_gssapi_krb5_h) + if(HAVE_GSSAPI_GSSAPI_GENERIC_H) + list(APPEND _include_list "gssapi/gssapi_generic.h") + endif() + if(_have_gssapi_gssapi_krb5_h) + list(APPEND _include_list "gssapi/gssapi_krb5.h") + endif() - foreach(_dir ${GSS_LINK_DIRECTORIES}) - set(_LINKER_FLAGS_STR "${_LINKER_FLAGS_STR} -L\"${_dir}\"") - endforeach() - - if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE) - set(CMAKE_REQUIRED_FLAGS "${_COMPILER_FLAGS_STR} ${_LINKER_FLAGS_STR}") - set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES}) - check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" ${_INCLUDE_LIST} HAVE_GSS_C_NT_HOSTBASED_SERVICE) - unset(CMAKE_REQUIRED_LIBRARIES) - endif() - if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE) - set(HAVE_OLD_GSSMIT ON) + if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE) + set(CMAKE_REQUIRED_FLAGS "${GSS_CFLAGS} ${GSS_LDFLAGS}") + set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES}) + check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" "${_include_list}" HAVE_GSS_C_NT_HOSTBASED_SERVICE) + endif() + if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE) + set(HAVE_OLD_GSSMIT ON) + endif() endif() + unset(_include_list) endif() + cmake_pop_check_state() - include_directories(${GSS_INCLUDE_DIR}) - link_directories(${GSS_LINK_DIRECTORIES}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}") - string(REPLACE ";" " " GSS_LINKER_FLAGS "${GSS_LINKER_FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") - set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") + include_directories(SYSTEM ${GSS_INCLUDE_DIRS}) + link_directories(${GSS_LIBRARY_DIRS}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_CFLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LDFLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LDFLAGS}") list(APPEND CURL_LIBS ${GSS_LIBRARIES}) - + if(GSS_FLAVOUR STREQUAL "GNU") + set(HAVE_GSSGNU 1) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "mit-krb5-gssapi") + else() # Heimdal + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "heimdal-gssapi") + endif() else() - message(WARNING "GSSAPI support has been requested but no supporting libraries found. Skipping.") + message(WARNING "GSSAPI has been requested, but no supporting libraries found. Skipping.") endif() endif() -option(ENABLE_UNIX_SOCKETS "Define if you want Unix domain sockets support" ON) +# libuv +option(CURL_USE_LIBUV "Use libuv for event-based tests" OFF) +if(CURL_USE_LIBUV) + if(NOT ENABLE_DEBUG) + message(FATAL_ERROR "Using libuv without debug support enabled is useless") + endif() + find_package(Libuv REQUIRED) + if(LIBUV_FOUND) + list(APPEND CURL_LIBS ${LIBUV_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBUV_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libuv") + include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS}) + link_directories(${LIBUV_LIBRARY_DIRS}) + if(LIBUV_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUV_CFLAGS}") + endif() + set(USE_LIBUV ON) + set(HAVE_UV_H ON) + endif() +endif() + +option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF) +if(USE_LIBRTMP) + set(_extra_libs "rtmp") + if(WIN32) + list(APPEND _extra_libs "winmm") + endif() + openssl_check_symbol_exists("RTMP_Init" "librtmp/rtmp.h" HAVE_LIBRTMP "${_extra_libs}") + if(HAVE_LIBRTMP) + list(APPEND CURL_LIBS "rtmp") + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "librtmp") + if(WIN32) + list(APPEND CURL_LIBS "winmm") + endif() + else() + message(WARNING "librtmp has been requested, but not found or missing OpenSSL. Skipping.") + set(USE_LIBRTMP OFF) + endif() +endif() + +option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) if(ENABLE_UNIX_SOCKETS) - include(CheckStructHasMember) if(WIN32) set(USE_UNIX_SOCKETS ON) else() - check_struct_has_member("struct sockaddr_un" sun_path "sys/un.h" USE_UNIX_SOCKETS) + include(CheckStructHasMember) + check_struct_has_member("struct sockaddr_un" "sun_path" "sys/un.h" USE_UNIX_SOCKETS) endif() else() unset(USE_UNIX_SOCKETS CACHE) endif() - # # CA handling # -set(CURL_CA_BUNDLE "auto" CACHE STRING - "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") -set(CURL_CA_FALLBACK OFF CACHE BOOL - "Set ON to use built-in CA store of TLS backend. 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'.") +if(_curl_ca_bundle_supported) + set(CURL_CA_BUNDLE "auto" CACHE + STRING "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + set(CURL_CA_FALLBACK OFF CACHE BOOL + "Use built-in CA store of TLS backend. 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'.") + set(CURL_CA_EMBED "" CACHE + STRING "Path to the CA bundle to embed in the curl tool.") -if("${CURL_CA_BUNDLE}" STREQUAL "") - message(FATAL_ERROR "Invalid value of CURL_CA_BUNDLE. Use 'none', 'auto' or file path.") -elseif("${CURL_CA_BUNDLE}" STREQUAL "none") - unset(CURL_CA_BUNDLE CACHE) -elseif("${CURL_CA_BUNDLE}" STREQUAL "auto") - unset(CURL_CA_BUNDLE CACHE) - if(NOT CMAKE_CROSSCOMPILING) - set(CURL_CA_BUNDLE_AUTODETECT TRUE) + if(CURL_CA_BUNDLE STREQUAL "") + message(FATAL_ERROR "Invalid value of CURL_CA_BUNDLE. Use 'none', 'auto' or file path.") + elseif(CURL_CA_BUNDLE STREQUAL "none") + unset(CURL_CA_BUNDLE CACHE) + elseif(CURL_CA_BUNDLE STREQUAL "auto") + unset(CURL_CA_BUNDLE CACHE) + if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32) + set(_curl_ca_bundle_autodetect TRUE) + endif() + else() + set(CURL_CA_BUNDLE_SET TRUE) endif() -else() - set(CURL_CA_BUNDLE_SET TRUE) -endif() + mark_as_advanced(CURL_CA_BUNDLE_SET) -if("${CURL_CA_PATH}" STREQUAL "") - message(FATAL_ERROR "Invalid value of CURL_CA_PATH. Use 'none', 'auto' or directory path.") -elseif("${CURL_CA_PATH}" STREQUAL "none") - unset(CURL_CA_PATH CACHE) -elseif("${CURL_CA_PATH}" STREQUAL "auto") - unset(CURL_CA_PATH CACHE) - if(NOT CMAKE_CROSSCOMPILING) - set(CURL_CA_PATH_AUTODETECT TRUE) + if(CURL_CA_PATH STREQUAL "") + message(FATAL_ERROR "Invalid value of CURL_CA_PATH. Use 'none', 'auto' or directory path.") + elseif(CURL_CA_PATH STREQUAL "none") + unset(CURL_CA_PATH CACHE) + elseif(CURL_CA_PATH STREQUAL "auto") + unset(CURL_CA_PATH CACHE) + if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32) + set(_curl_ca_path_autodetect TRUE) + endif() + else() + set(CURL_CA_PATH_SET TRUE) endif() -else() - set(CURL_CA_PATH_SET TRUE) -endif() + mark_as_advanced(CURL_CA_PATH_SET) -if(CURL_CA_BUNDLE_SET AND CURL_CA_PATH_AUTODETECT) - # Skip autodetection of unset CA path because CA bundle is set explicitly -elseif(CURL_CA_PATH_SET AND CURL_CA_BUNDLE_AUTODETECT) - # Skip autodetection of unset CA bundle because CA path is set explicitly -elseif(CURL_CA_PATH_AUTODETECT OR CURL_CA_BUNDLE_AUTODETECT) - # first try autodetecting a CA bundle, then a CA path + if(CURL_CA_BUNDLE_SET AND _curl_ca_path_autodetect) + # Skip auto-detection of unset CA path because CA bundle is set explicitly + elseif(CURL_CA_PATH_SET AND _curl_ca_bundle_autodetect) + # Skip auto-detection of unset CA bundle because CA path is set explicitly + elseif(_curl_ca_bundle_autodetect OR _curl_ca_path_autodetect) + # First try auto-detecting a CA bundle, then a CA path - if(CURL_CA_BUNDLE_AUTODETECT) - set(SEARCH_CA_BUNDLE_PATHS - /etc/ssl/certs/ca-certificates.crt - /etc/pki/tls/certs/ca-bundle.crt - /usr/share/ssl/certs/ca-bundle.crt - /usr/local/share/certs/ca-root-nss.crt - /etc/ssl/cert.pem) + if(_curl_ca_bundle_autodetect) + foreach(_search_ca_bundle_path IN ITEMS + "/etc/ssl/certs/ca-certificates.crt" + "/etc/pki/tls/certs/ca-bundle.crt" + "/usr/share/ssl/certs/ca-bundle.crt" + "/usr/local/share/certs/ca-root-nss.crt" + "/etc/ssl/cert.pem") + 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") + break() + endif() + endforeach() + endif() - foreach(SEARCH_CA_BUNDLE_PATH ${SEARCH_CA_BUNDLE_PATHS}) - 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") - break() + if(_curl_ca_path_autodetect AND NOT CURL_CA_PATH_SET) + set(_search_ca_path "/etc/ssl/certs") + file(GLOB _curl_ca_files_found "${_search_ca_path}/[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") + if(_curl_ca_files_found) + 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") endif() - endforeach() + endif() endif() - if(CURL_CA_PATH_AUTODETECT AND (NOT CURL_CA_PATH_SET)) - if(EXISTS "/etc/ssl/certs") - set(CURL_CA_PATH "/etc/ssl/certs" 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") + set(CURL_CA_EMBED_SET FALSE) + if(BUILD_CURL_EXE AND NOT CURL_CA_EMBED STREQUAL "") + if(EXISTS "${CURL_CA_EMBED}") + set(CURL_CA_EMBED_SET TRUE) + message(STATUS "Found CA bundle to embed: ${CURL_CA_EMBED}") + else() + message(FATAL_ERROR "CA bundle to embed is missing: '${CURL_CA_EMBED}'") endif() endif() endif() -if(CURL_CA_PATH_SET AND - NOT USE_OPENSSL AND - NOT USE_WOLFSSL AND - NOT USE_GNUTLS AND - NOT USE_MBEDTLS) - message(STATUS - "CA path only supported by OpenSSL, wolfSSL, GnuTLS or mbedTLS. " - "Set CURL_CA_PATH=none or enable one of those TLS backends.") +if(WIN32) + option(CURL_DISABLE_CA_SEARCH "Disable unsafe CA bundle search in PATH on Windows" OFF) + option(CURL_CA_SEARCH_SAFE "Enable safe CA bundle search (within the curl tool directory) on Windows" OFF) endif() # Check for header files if(WIN32) - set(CURL_INCLUDES ${CURL_INCLUDES} "winsock2.h") - set(CURL_INCLUDES ${CURL_INCLUDES} "ws2tcpip.h") - set(CURL_INCLUDES ${CURL_INCLUDES} "windows.h") -endif() - -if(WIN32) - # detect actual value of _WIN32_WINNT and store as HAVE_WIN32_WINNT - curl_internal_test(HAVE_WIN32_WINNT) - if(HAVE_WIN32_WINNT) - string(REGEX MATCH ".*_WIN32_WINNT=0x[0-9a-fA-F]+" OUTPUT "${OUTPUT}") - string(REGEX REPLACE ".*_WIN32_WINNT=" "" OUTPUT "${OUTPUT}") - string(REGEX REPLACE "0x([0-9a-f][0-9a-f][0-9a-f])$" "0x0\\1" OUTPUT "${OUTPUT}") # pad to 4 digits - string(TOLOWER "${OUTPUT}" HAVE_WIN32_WINNT) - message(STATUS "Found _WIN32_WINNT=${HAVE_WIN32_WINNT}") - endif() - # avoid storing HAVE_WIN32_WINNT in CMake cache - unset(HAVE_WIN32_WINNT CACHE) + list(APPEND CURL_INCLUDES "winsock2.h") + list(APPEND CURL_INCLUDES "ws2tcpip.h") if(HAVE_WIN32_WINNT) - if(HAVE_WIN32_WINNT STRLESS "0x0501") + if(HAVE_WIN32_WINNT LESS 0x0501) # Windows XP is required for freeaddrinfo, getaddrinfo message(FATAL_ERROR "Building for Windows XP or newer is required.") endif() - # pre-fill detection results based on target OS version + # Pre-fill detection results based on target OS version if(MINGW OR MSVC) - if(HAVE_WIN32_WINNT STRLESS "0x0600") + if(HAVE_WIN32_WINNT LESS 0x0600) set(HAVE_INET_NTOP 0) set(HAVE_INET_PTON 0) else() # Windows Vista or newer @@ -1109,59 +1441,87 @@ if(WIN32) endif() endif() -check_include_file_concat("sys/filio.h" HAVE_SYS_FILIO_H) -check_include_file_concat("sys/wait.h" HAVE_SYS_WAIT_H) -check_include_file_concat("sys/ioctl.h" HAVE_SYS_IOCTL_H) -check_include_file_concat("sys/param.h" HAVE_SYS_PARAM_H) -check_include_file_concat("sys/poll.h" HAVE_SYS_POLL_H) -check_include_file_concat("sys/resource.h" HAVE_SYS_RESOURCE_H) +# Detect headers + +# Use check_include_file_concat() for headers required by subsequent +# check_include_file_concat() or check_symbol_exists() detections. +# Order for these is significant. +check_include_file("sys/eventfd.h" HAVE_SYS_EVENTFD_H) +check_include_file("sys/filio.h" HAVE_SYS_FILIO_H) +check_include_file("sys/wait.h" HAVE_SYS_WAIT_H) +check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H) +check_include_file("sys/param.h" HAVE_SYS_PARAM_H) +check_include_file("sys/poll.h" HAVE_SYS_POLL_H) +check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) check_include_file_concat("sys/select.h" HAVE_SYS_SELECT_H) check_include_file_concat("sys/socket.h" HAVE_SYS_SOCKET_H) -check_include_file_concat("sys/sockio.h" HAVE_SYS_SOCKIO_H) -check_include_file_concat("sys/stat.h" HAVE_SYS_STAT_H) +check_include_file("sys/sockio.h" HAVE_SYS_SOCKIO_H) +check_include_file("sys/stat.h" HAVE_SYS_STAT_H) check_include_file_concat("sys/time.h" HAVE_SYS_TIME_H) check_include_file_concat("sys/types.h" HAVE_SYS_TYPES_H) -check_include_file_concat("sys/un.h" HAVE_SYS_UN_H) -check_include_file_concat("sys/utime.h" HAVE_SYS_UTIME_H) -check_include_file_concat("sys/xattr.h" HAVE_SYS_XATTR_H) +check_include_file("sys/un.h" HAVE_SYS_UN_H) +check_include_file("sys/utime.h" HAVE_SYS_UTIME_H) +check_include_file("sys/xattr.h" HAVE_SYS_XATTR_H) + check_include_file_concat("arpa/inet.h" HAVE_ARPA_INET_H) -check_include_file_concat("fcntl.h" HAVE_FCNTL_H) +check_include_file("dirent.h" HAVE_DIRENT_H) +check_include_file("fcntl.h" HAVE_FCNTL_H) check_include_file_concat("ifaddrs.h" HAVE_IFADDRS_H) -check_include_file_concat("io.h" HAVE_IO_H) +check_include_file("io.h" HAVE_IO_H) check_include_file_concat("libgen.h" HAVE_LIBGEN_H) -check_include_file_concat("locale.h" HAVE_LOCALE_H) -check_include_file_concat("net/if.h" HAVE_NET_IF_H) +check_include_file("linux/tcp.h" HAVE_LINUX_TCP_H) +check_include_file("locale.h" HAVE_LOCALE_H) +check_include_file("net/if.h" HAVE_NET_IF_H) check_include_file_concat("netdb.h" HAVE_NETDB_H) check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H) -check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H) -check_include_file_concat("netinet/udp.h" HAVE_NETINET_UDP_H) -check_include_file("linux/tcp.h" HAVE_LINUX_TCP_H) - -check_include_file_concat("poll.h" HAVE_POLL_H) -check_include_file_concat("pwd.h" HAVE_PWD_H) -check_include_file_concat("stdatomic.h" HAVE_STDATOMIC_H) -check_include_file_concat("stdbool.h" HAVE_STDBOOL_H) -check_include_file_concat("strings.h" HAVE_STRINGS_H) -check_include_file_concat("stropts.h" HAVE_STROPTS_H) -check_include_file_concat("termio.h" HAVE_TERMIO_H) -check_include_file_concat("termios.h" HAVE_TERMIOS_H) +check_include_file("netinet/in6.h" HAVE_NETINET_IN6_H) +check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H) # sys/types.h (e.g. Cygwin) netinet/in.h +check_include_file_concat("netinet/udp.h" HAVE_NETINET_UDP_H) # sys/types.h (e.g. Cygwin) +check_include_file("poll.h" HAVE_POLL_H) +check_include_file("pwd.h" HAVE_PWD_H) +check_include_file("stdatomic.h" HAVE_STDATOMIC_H) +check_include_file("stdbool.h" HAVE_STDBOOL_H) +check_include_file("strings.h" HAVE_STRINGS_H) +check_include_file("stropts.h" HAVE_STROPTS_H) +check_include_file("termio.h" HAVE_TERMIO_H) +check_include_file("termios.h" HAVE_TERMIOS_H) check_include_file_concat("unistd.h" HAVE_UNISTD_H) -check_include_file_concat("utime.h" HAVE_UTIME_H) +check_include_file("utime.h" HAVE_UTIME_H) -check_type_size(size_t SIZEOF_SIZE_T) -check_type_size(ssize_t SIZEOF_SSIZE_T) -check_type_size("long long" SIZEOF_LONG_LONG) -check_type_size("long" SIZEOF_LONG) -check_type_size("int" SIZEOF_INT) -check_type_size("__int64" SIZEOF___INT64) -check_type_size("time_t" SIZEOF_TIME_T) -check_type_size("suseconds_t" SIZEOF_SUSECONDS_T) +if(CMAKE_SYSTEM_NAME MATCHES "AmigaOS") + check_include_file_concat("proto/bsdsocket.h" HAVE_PROTO_BSDSOCKET_H) +endif() + +# Pass these detection results to curl_internal_test() for use in CurlTests.c +# Add here all feature flags referenced from CurlTests.c +foreach(_variable IN ITEMS + HAVE_STDATOMIC_H + HAVE_STDBOOL_H + HAVE_STROPTS_H + HAVE_SYS_IOCTL_H + HAVE_SYS_SOCKET_H + HAVE_SYS_TYPES_H + HAVE_UNISTD_H + ) + if(${_variable}) + set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${_variable}") + endif() +endforeach() + +check_type_size("size_t" SIZEOF_SIZE_T) +check_type_size("ssize_t" SIZEOF_SSIZE_T) +check_type_size("long long" SIZEOF_LONG_LONG) +check_type_size("long" SIZEOF_LONG) +check_type_size("int" SIZEOF_INT) +check_type_size("__int64" SIZEOF___INT64) +check_type_size("time_t" SIZEOF_TIME_T) +check_type_size("suseconds_t" SIZEOF_SUSECONDS_T) if(NOT HAVE_SIZEOF_SSIZE_T) if(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) - set(ssize_t long) + set(ssize_t "long") endif() if(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) - set(ssize_t __int64) + set(ssize_t "__int64") endif() endif() # off_t is sized later, after the HAVE_FILE_OFFSET_BITS test @@ -1173,107 +1533,113 @@ if(SIZEOF_SUSECONDS_T) set(HAVE_SUSECONDS_T 1) endif() -if(NOT CMAKE_CROSSCOMPILING) - find_file(RANDOM_FILE urandom /dev) - mark_as_advanced(RANDOM_FILE) -endif() - # Check for some functions that are used if(WIN32) - set(CMAKE_REQUIRED_LIBRARIES ws2_32) + list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32") # Apply to all feature checks elseif(HAVE_LIBSOCKET) - set(CMAKE_REQUIRED_LIBRARIES socket) + list(APPEND CMAKE_REQUIRED_LIBRARIES "socket") # Apply to all feature checks endif() -check_symbol_exists(fnmatch "${CURL_INCLUDES};fnmatch.h" HAVE_FNMATCH) -check_symbol_exists(basename "${CURL_INCLUDES};string.h" HAVE_BASENAME) -check_symbol_exists(socket "${CURL_INCLUDES}" HAVE_SOCKET) -check_symbol_exists(sched_yield "${CURL_INCLUDES};sched.h" HAVE_SCHED_YIELD) -check_symbol_exists(socketpair "${CURL_INCLUDES}" HAVE_SOCKETPAIR) -check_symbol_exists(recv "${CURL_INCLUDES}" HAVE_RECV) -check_symbol_exists(send "${CURL_INCLUDES}" HAVE_SEND) -check_symbol_exists(sendmsg "${CURL_INCLUDES}" HAVE_SENDMSG) -check_symbol_exists(select "${CURL_INCLUDES}" HAVE_SELECT) -check_symbol_exists(strdup "${CURL_INCLUDES};string.h" HAVE_STRDUP) -check_symbol_exists(strtok_r "${CURL_INCLUDES};string.h" HAVE_STRTOK_R) -check_symbol_exists(strcasecmp "${CURL_INCLUDES};string.h" HAVE_STRCASECMP) -check_symbol_exists(stricmp "${CURL_INCLUDES};string.h" HAVE_STRICMP) -check_symbol_exists(strcmpi "${CURL_INCLUDES};string.h" HAVE_STRCMPI) -check_symbol_exists(memrchr "${CURL_INCLUDES};string.h" HAVE_MEMRCHR) -check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM) -check_symbol_exists(arc4random "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM) -check_symbol_exists(fcntl "${CURL_INCLUDES}" HAVE_FCNTL) -check_symbol_exists(getppid "${CURL_INCLUDES}" HAVE_GETPPID) -check_symbol_exists(utimes "${CURL_INCLUDES}" HAVE_UTIMES) +check_function_exists("fnmatch" HAVE_FNMATCH) +check_symbol_exists("basename" "${CURL_INCLUDES};string.h" HAVE_BASENAME) # libgen.h unistd.h +check_symbol_exists("opendir" "dirent.h" HAVE_OPENDIR) +check_function_exists("poll" HAVE_POLL) # poll.h +check_symbol_exists("socket" "${CURL_INCLUDES}" HAVE_SOCKET) # winsock2.h sys/socket.h +check_function_exists("sched_yield" HAVE_SCHED_YIELD) +check_symbol_exists("socketpair" "${CURL_INCLUDES}" HAVE_SOCKETPAIR) # sys/socket.h +check_symbol_exists("recv" "${CURL_INCLUDES}" HAVE_RECV) # proto/bsdsocket.h sys/types.h sys/socket.h +check_symbol_exists("send" "${CURL_INCLUDES}" HAVE_SEND) # proto/bsdsocket.h sys/types.h sys/socket.h +check_function_exists("sendmsg" HAVE_SENDMSG) +check_function_exists("sendmmsg" HAVE_SENDMMSG) +check_symbol_exists("select" "${CURL_INCLUDES}" HAVE_SELECT) # proto/bsdsocket.h sys/select.h sys/socket.h +check_symbol_exists("strdup" "string.h" HAVE_STRDUP) +check_symbol_exists("strtok_r" "string.h" HAVE_STRTOK_R) +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("memrchr" "string.h" HAVE_MEMRCHR) +check_symbol_exists("alarm" "unistd.h" HAVE_ALARM) +check_symbol_exists("fcntl" "fcntl.h" HAVE_FCNTL) +check_function_exists("getppid" HAVE_GETPPID) +check_function_exists("utimes" HAVE_UTIMES) -check_symbol_exists(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY) -check_symbol_exists(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET) -check_symbol_exists(sigsetjmp "${CURL_INCLUDES};setjmp.h" HAVE_SIGSETJMP) -check_symbol_exists(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R) -check_symbol_exists(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID) -check_symbol_exists(getpwuid_r "${CURL_INCLUDES}" HAVE_GETPWUID_R) -check_symbol_exists(geteuid "${CURL_INCLUDES}" HAVE_GETEUID) -check_symbol_exists(utime "${CURL_INCLUDES}" HAVE_UTIME) -check_symbol_exists(gmtime_r "${CURL_INCLUDES};stdlib.h;time.h" HAVE_GMTIME_R) +check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) # sys/time.h +check_symbol_exists("closesocket" "${CURL_INCLUDES}" HAVE_CLOSESOCKET) # winsock2.h +check_symbol_exists("sigsetjmp" "setjmp.h" HAVE_SIGSETJMP) +check_function_exists("getpass_r" HAVE_GETPASS_R) +check_function_exists("getpwuid" HAVE_GETPWUID) +check_function_exists("getpwuid_r" HAVE_GETPWUID_R) +check_function_exists("geteuid" HAVE_GETEUID) +check_function_exists("utime" HAVE_UTIME) +check_symbol_exists("gmtime_r" "stdlib.h;time.h" HAVE_GMTIME_R) -check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R) +check_symbol_exists("gethostbyname_r" "netdb.h" HAVE_GETHOSTBYNAME_R) -check_symbol_exists(signal "${CURL_INCLUDES};signal.h" HAVE_SIGNAL) -check_symbol_exists(strtoll "${CURL_INCLUDES};stdlib.h" HAVE_STRTOLL) -check_symbol_exists(strerror_r "${CURL_INCLUDES};stdlib.h;string.h" HAVE_STRERROR_R) -check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION) -check_symbol_exists(siginterrupt "${CURL_INCLUDES};signal.h" HAVE_SIGINTERRUPT) -check_symbol_exists(getaddrinfo "${CURL_INCLUDES};stdlib.h;string.h" HAVE_GETADDRINFO) -check_symbol_exists(getifaddrs "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS) -check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO) -check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE) -check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE) -check_symbol_exists(fseeko "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO) -check_symbol_exists(_fseeki64 "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64) -check_symbol_exists(getpeername "${CURL_INCLUDES}" HAVE_GETPEERNAME) -check_symbol_exists(getsockname "${CURL_INCLUDES}" HAVE_GETSOCKNAME) -check_symbol_exists(if_nametoindex "${CURL_INCLUDES}" HAVE_IF_NAMETOINDEX) -check_symbol_exists(getrlimit "${CURL_INCLUDES}" HAVE_GETRLIMIT) -check_symbol_exists(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE) -check_symbol_exists(setmode "${CURL_INCLUDES}" HAVE_SETMODE) -check_symbol_exists(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT) +check_symbol_exists("signal" "signal.h" HAVE_SIGNAL) +check_symbol_exists("strtoll" "stdlib.h" HAVE_STRTOLL) +check_symbol_exists("strerror_r" "stdlib.h;string.h" HAVE_STRERROR_R) +check_symbol_exists("sigaction" "signal.h" HAVE_SIGACTION) +check_symbol_exists("siginterrupt" "signal.h" HAVE_SIGINTERRUPT) +check_symbol_exists("getaddrinfo" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_GETADDRINFO) # ws2tcpip.h sys/socket.h netdb.h +check_symbol_exists("getifaddrs" "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS) # ifaddrs.h +check_symbol_exists("freeaddrinfo" "${CURL_INCLUDES}" HAVE_FREEADDRINFO) # ws2tcpip.h sys/socket.h netdb.h +check_function_exists("pipe" HAVE_PIPE) +check_function_exists("eventfd" HAVE_EVENTFD) +check_symbol_exists("ftruncate" "unistd.h" HAVE_FTRUNCATE) +check_function_exists("_fseeki64" HAVE__FSEEKI64) +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("if_nametoindex" HAVE_IF_NAMETOINDEX) # winsock2.h net/if.h +check_function_exists("getrlimit" HAVE_GETRLIMIT) +check_function_exists("setlocale" HAVE_SETLOCALE) +check_function_exists("setmode" HAVE_SETMODE) +check_function_exists("setrlimit" HAVE_SETRLIMIT) -if(HAVE_FSEEKO) - set(HAVE_DECL_FSEEKO 1) +if(WIN32 OR CYGWIN) + check_function_exists("_setmode" HAVE__SETMODE) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "AmigaOS") + check_symbol_exists("CloseSocket" "${CURL_INCLUDES}" HAVE_CLOSESOCKET_CAMEL) # sys/socket.h proto/bsdsocket.h +endif() + +if(NOT _ssl_enabled) + check_symbol_exists("arc4random" "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM) endif() if(NOT MSVC OR (MSVC_VERSION GREATER_EQUAL 1900)) - # earlier MSVC compilers had faulty snprintf implementations - check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) + # Earlier MSVC compilers had faulty snprintf implementations + check_function_exists("snprintf" HAVE_SNPRINTF) endif() -check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) -check_symbol_exists(inet_ntop "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_NTOP) +if(APPLE) + check_function_exists("mach_absolute_time" HAVE_MACH_ABSOLUTE_TIME) +endif() +check_symbol_exists("inet_ntop" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_NTOP) # arpa/inet.h if(MSVC AND (MSVC_VERSION LESS_EQUAL 1600)) set(HAVE_INET_NTOP OFF) endif() -check_symbol_exists(inet_pton "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_PTON) +check_symbol_exists("inet_pton" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_PTON) # arpa/inet.h -check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR) +check_symbol_exists("fsetxattr" "sys/xattr.h" HAVE_FSETXATTR) if(HAVE_FSETXATTR) - foreach(CURL_TEST HAVE_FSETXATTR_5 HAVE_FSETXATTR_6) - curl_internal_test(${CURL_TEST}) - endforeach() + curl_internal_test(HAVE_FSETXATTR_5) + curl_internal_test(HAVE_FSETXATTR_6) endif() -set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") -check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T) -set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T}) -set(CMAKE_EXTRA_INCLUDE_FILES "") - +cmake_push_check_state() if(WIN32) - set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") - check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY) - set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY}) - set(CMAKE_EXTRA_INCLUDE_FILES "") + set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") + check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY) + set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY}) +elseif(HAVE_SYS_SOCKET_H) + set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") + check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T) + set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T}) endif() +cmake_pop_check_state() # Do curl specific tests -foreach(CURL_TEST +foreach(_curl_test IN ITEMS HAVE_FCNTL_O_NONBLOCK HAVE_IOCTLSOCKET HAVE_IOCTLSOCKET_CAMEL @@ -1295,25 +1661,37 @@ foreach(CURL_TEST HAVE_FILE_OFFSET_BITS HAVE_ATOMIC ) - curl_internal_test(${CURL_TEST}) + curl_internal_test(${_curl_test}) endforeach() +cmake_push_check_state() if(HAVE_FILE_OFFSET_BITS) set(_FILE_OFFSET_BITS 64) - set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64") + set(CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") endif() -check_type_size("off_t" SIZEOF_OFF_T) +check_type_size("off_t" SIZEOF_OFF_T) -# include this header to get the type -set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include") +# 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) +# so we need to test fseeko after testing for _FILE_OFFSET_BITS +check_symbol_exists("fseeko" "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO) + +if(HAVE_FSEEKO) + set(HAVE_DECL_FSEEKO 1) +endif() + +# Include this header to get the type +cmake_push_check_state() +set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/include") set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h") -check_type_size("curl_off_t" SIZEOF_CURL_OFF_T) +check_type_size("curl_off_t" SIZEOF_CURL_OFF_T) set(CMAKE_EXTRA_INCLUDE_FILES "curl/curl.h") -check_type_size("curl_socket_t" SIZEOF_CURL_SOCKET_T) -set(CMAKE_EXTRA_INCLUDE_FILES "") +check_type_size("curl_socket_t" SIZEOF_CURL_SOCKET_T) +cmake_pop_check_state() # pop curl system headers +cmake_pop_check_state() # pop -D_FILE_OFFSET_BITS=64 if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) - # on not-Windows and not-crosscompiling, check for writable argv[] + # On non-Windows and not cross-compiling, check for writable argv[] include(CheckCSourceRuns) check_c_source_runs(" int main(int argc, char **argv) @@ -1324,56 +1702,40 @@ if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) }" HAVE_WRITABLE_ARGV) endif() -set(CMAKE_REQUIRED_FLAGS) - -option(ENABLE_WEBSOCKETS "Set to ON to enable EXPERIMENTAL websockets" OFF) - -if(ENABLE_WEBSOCKETS) - if(${SIZEOF_CURL_OFF_T} GREATER "4") - set(USE_WEBSOCKETS ON) - else() - message(WARNING "curl_off_t is too small to enable WebSockets") - endif() -endif() - -foreach(CURL_TEST - HAVE_GLIBC_STRERROR_R - HAVE_POSIX_STRERROR_R - ) - curl_internal_test(${CURL_TEST}) -endforeach() +curl_internal_test(HAVE_GLIBC_STRERROR_R) +curl_internal_test(HAVE_POSIX_STRERROR_R) # Check for reentrant -foreach(CURL_TEST +foreach(_curl_test IN ITEMS HAVE_GETHOSTBYNAME_R_3 HAVE_GETHOSTBYNAME_R_5 HAVE_GETHOSTBYNAME_R_6) - if(NOT ${CURL_TEST}) - if(${CURL_TEST}_REENTRANT) + if(NOT ${_curl_test}) + if(${_curl_test}_REENTRANT) set(NEED_REENTRANT 1) endif() endif() endforeach() if(NEED_REENTRANT) - foreach(CURL_TEST + foreach(_curl_test IN ITEMS HAVE_GETHOSTBYNAME_R_3 HAVE_GETHOSTBYNAME_R_5 HAVE_GETHOSTBYNAME_R_6) - set(${CURL_TEST} 0) - if(${CURL_TEST}_REENTRANT) - set(${CURL_TEST} 1) + set(${_curl_test} 0) + if(${_curl_test}_REENTRANT) + set(${_curl_test} 1) endif() endforeach() endif() if(NOT WIN32) - # Check clock_gettime(CLOCK_MONOTONIC, x) support - curl_internal_test(HAVE_CLOCK_GETTIME_MONOTONIC) + curl_internal_test(HAVE_CLOCK_GETTIME_MONOTONIC) # Check clock_gettime(CLOCK_MONOTONIC, x) support endif() -# Check compiler support of __builtin_available() -curl_internal_test(HAVE_BUILTIN_AVAILABLE) +if(APPLE) + curl_internal_test(HAVE_BUILTIN_AVAILABLE) # Check compiler support of __builtin_available() +endif() # Some other minor tests @@ -1384,31 +1746,31 @@ endif() # Check for nonblocking set(HAVE_DISABLED_NONBLOCKING 1) if(HAVE_FIONBIO OR - HAVE_IOCTLSOCKET OR - HAVE_IOCTLSOCKET_CASE OR - HAVE_O_NONBLOCK) - set(HAVE_DISABLED_NONBLOCKING) + HAVE_IOCTLSOCKET OR + HAVE_IOCTLSOCKET_CASE OR + HAVE_O_NONBLOCK) + unset(HAVE_DISABLED_NONBLOCKING) endif() if(CMAKE_COMPILER_IS_GNUCC AND APPLE) include(CheckCCompilerFlag) - check_c_compiler_flag(-Wno-long-double HAVE_C_FLAG_Wno_long_double) + check_c_compiler_flag("-Wno-long-double" HAVE_C_FLAG_Wno_long_double) if(HAVE_C_FLAG_Wno_long_double) - # The Mac version of GCC warns about use of long double. Disable it. - get_source_file_property(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS) - if(MPRINTF_COMPILE_FLAGS) - set(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double") + # The Mac version of GCC warns about use of long double. Disable it. + get_source_file_property(_mprintf_compile_flags "mprintf.c" COMPILE_FLAGS) + if(_mprintf_compile_flags) + set(_mprintf_compile_flags "${_mprintf_compile_flags} -Wno-long-double") else() - set(MPRINTF_COMPILE_FLAGS "-Wno-long-double") + set(_mprintf_compile_flags "-Wno-long-double") endif() - set_source_files_properties(mprintf.c PROPERTIES - COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS}) + set_source_files_properties("mprintf.c" PROPERTIES + COMPILE_FLAGS ${_mprintf_compile_flags}) endif() endif() include(CMake/OtherTests.cmake) -add_definitions(-DHAVE_CONFIG_H) +add_definitions("-DHAVE_CONFIG_H") # For Windows, all compilers used by CMake should support large files if(WIN32) @@ -1432,7 +1794,7 @@ if(MSVC) # Disable default manifest added by CMake set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") - add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + add_definitions("-D_CRT_SECURE_NO_DEPRECATE" "-D_CRT_NONSTDC_NO_DEPRECATE") if(CMAKE_C_FLAGS MATCHES "/W[0-4]") string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") else() @@ -1440,62 +1802,75 @@ if(MSVC) endif() # Use multithreaded compilation on VS 2008+ - if(MSVC_VERSION GREATER_EQUAL 1500) + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER_EQUAL 1500) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") endif() endif() if(CURL_WERROR) - if(MSVC_VERSION) + if(MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") else() - # this assumes clang or gcc style options + # This assumes clang or gcc style options set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") endif() endif() if(CURL_LTO) if(CMAKE_VERSION VERSION_LESS 3.9) - message(FATAL_ERROR "Requested LTO but your cmake version ${CMAKE_VERSION} is to old. You need at least 3.9") + message(FATAL_ERROR "LTO has been requested, but your cmake version ${CMAKE_VERSION} is to old. You need at least 3.9") endif() cmake_policy(SET CMP0069 NEW) include(CheckIPOSupported) - check_ipo_supported(RESULT CURL_HAS_LTO OUTPUT CURL_LTO_ERROR LANGUAGES C) + check_ipo_supported(RESULT CURL_HAS_LTO OUTPUT _lto_error LANGUAGES C) if(CURL_HAS_LTO) message(STATUS "LTO supported and enabled") else() - message(FATAL_ERROR "LTO was requested - but compiler doesn't support it\n${CURL_LTO_ERROR}") + message(FATAL_ERROR "LTO has been requested, but the compiler does not support it\n${_lto_error}") endif() endif() -# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it). -function(transform_makefile_inc INPUT_FILE OUTPUT_FILE) - file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT) - string(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) - string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) +# Ugly (but functional) way to include "Makefile.inc" by transforming it +# (= regenerate it). +function(transform_makefile_inc _input_file _output_file) + file(READ ${_input_file} _makefile_inc_text) + 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(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}) - string(REPLACE "!π!α!" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) + 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}) + string(REPLACE "!π!α!" "\n" _makefile_inc_text ${_makefile_inc_text}) - string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${} - string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts. - file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT}) - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${INPUT_FILE}") + # Replace $() with ${} + string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" _makefile_inc_text ${_makefile_inc_text}) + # Replace @@ with ${}, even if that may not be read by CMake scripts. + string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" _makefile_inc_text ${_makefile_inc_text}) + + file(WRITE ${_output_file} ${_makefile_inc_text}) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_input_file}") endfunction() include(GNUInstallDirs) -set(CURL_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +set(_install_cmake_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") -set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") -set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") -set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") +set(_generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(_project_config "${_generated_dir}/${PROJECT_NAME}Config.cmake") +set(_version_config "${_generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") + +option(BUILD_TESTING "Build tests" ON) +if(BUILD_TESTING AND PERL_FOUND AND NOT CURL_DISABLE_TESTS) + set(CURL_BUILD_TESTING ON) +else() + set(CURL_BUILD_TESTING OFF) +endif() if(HAVE_MANUAL_TOOLS) + set(CURL_MANPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.1") + set(CURL_ASCIIPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.txt") add_subdirectory(docs) endif() @@ -1505,173 +1880,221 @@ if(BUILD_CURL_EXE) add_subdirectory(src) endif() -cmake_dependent_option(BUILD_TESTING "Build tests" - ON "PERL_FOUND;NOT CURL_DISABLE_TESTS" - OFF) -if(BUILD_TESTING) +option(BUILD_EXAMPLES "Build libcurl examples" ON) +if(BUILD_EXAMPLES) + add_subdirectory(docs/examples) +endif() + +if(CURL_BUILD_TESTING) add_subdirectory(tests) endif() +# Helper to populate a list (_items) with a label when conditions +# (the remaining args) are satisfied +macro(_add_if _label) + # Needs to be a macro to allow this indirection + if(${ARGN}) + set(_items ${_items} "${_label}") + endif() +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 OR + USE_GNUTLS OR + USE_SECTRANSP OR + USE_WIN32_CRYPTO OR + (USE_WOLFSSL AND HAVE_WOLFSSL_DES_ECB_ENCRYPT))) + set(_use_curl_ntlm_core ON) +endif() + +# Clear list and try to detect available protocols +unset(_items) +_add_if("HTTP" NOT CURL_DISABLE_HTTP) +_add_if("HTTPS" NOT CURL_DISABLE_HTTP AND _ssl_enabled) +_add_if("FTP" NOT CURL_DISABLE_FTP) +_add_if("FTPS" NOT CURL_DISABLE_FTP AND _ssl_enabled) +_add_if("FILE" NOT CURL_DISABLE_FILE) +_add_if("TELNET" NOT CURL_DISABLE_TELNET) +_add_if("LDAP" NOT CURL_DISABLE_LDAP) +# CURL_DISABLE_LDAP implies CURL_DISABLE_LDAPS +_add_if("LDAPS" NOT CURL_DISABLE_LDAPS AND + ((USE_OPENLDAP AND _ssl_enabled) OR + (NOT USE_OPENLDAP AND HAVE_LDAP_SSL))) +_add_if("DICT" NOT CURL_DISABLE_DICT) +_add_if("TFTP" NOT CURL_DISABLE_TFTP) +_add_if("GOPHER" NOT CURL_DISABLE_GOPHER) +_add_if("GOPHERS" NOT CURL_DISABLE_GOPHER AND _ssl_enabled) +_add_if("POP3" NOT CURL_DISABLE_POP3) +_add_if("POP3S" NOT CURL_DISABLE_POP3 AND _ssl_enabled) +_add_if("IMAP" NOT CURL_DISABLE_IMAP) +_add_if("IMAPS" NOT CURL_DISABLE_IMAP AND _ssl_enabled) +_add_if("SMB" NOT CURL_DISABLE_SMB AND + _use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4)) +_add_if("SMBS" NOT CURL_DISABLE_SMB AND _ssl_enabled AND + _use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4)) +_add_if("SMTP" NOT CURL_DISABLE_SMTP) +_add_if("SMTPS" NOT CURL_DISABLE_SMTP AND _ssl_enabled) +_add_if("SCP" USE_LIBSSH2 OR USE_LIBSSH OR USE_WOLFSSH) +_add_if("SFTP" USE_LIBSSH2 OR USE_LIBSSH OR USE_WOLFSSH) +_add_if("IPFS" NOT CURL_DISABLE_IPFS) +_add_if("IPNS" NOT CURL_DISABLE_IPFS) +_add_if("RTSP" NOT CURL_DISABLE_RTSP) +_add_if("RTMP" USE_LIBRTMP) +_add_if("MQTT" NOT CURL_DISABLE_MQTT) +_add_if("WS" NOT CURL_DISABLE_WEBSOCKETS) +_add_if("WSS" NOT CURL_DISABLE_WEBSOCKETS AND _ssl_enabled) +if(_items) + list(SORT _items) +endif() +string(REPLACE ";" " " SUPPORT_PROTOCOLS "${_items}") +string(TOLOWER "${SUPPORT_PROTOCOLS}" _support_protocols_lower) +message(STATUS "Protocols: ${_support_protocols_lower}") + +# Clear list and try to detect available features +unset(_items) +_add_if("SSL" _ssl_enabled) +_add_if("IPv6" ENABLE_IPV6) +_add_if("UnixSockets" USE_UNIX_SOCKETS) +_add_if("libz" HAVE_LIBZ) +_add_if("brotli" HAVE_BROTLI) +_add_if("gsasl" USE_GSASL) +_add_if("zstd" HAVE_ZSTD) +_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32) +_add_if("IDN" (HAVE_LIBIDN2 AND HAVE_IDN2_H) OR + USE_WIN32_IDN OR + USE_APPLE_IDN) +_add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND + ((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) +_add_if("SSPI" USE_WINDOWS_SSPI) +_add_if("GSS-API" HAVE_GSSAPI) +_add_if("alt-svc" NOT CURL_DISABLE_ALTSVC) +_add_if("HSTS" NOT CURL_DISABLE_HSTS) +_add_if("SPNEGO" NOT CURL_DISABLE_NEGOTIATE_AUTH AND + (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) +_add_if("Kerberos" NOT CURL_DISABLE_KERBEROS_AUTH AND + (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) +_add_if("NTLM" NOT (CURL_DISABLE_NTLM) AND + (_use_curl_ntlm_core OR USE_WINDOWS_SSPI)) +_add_if("TLS-SRP" USE_TLS_SRP) +_add_if("HTTP2" USE_NGHTTP2) +_add_if("HTTP3" USE_NGTCP2 OR USE_QUICHE OR USE_MSH3 OR USE_OPENSSL_QUIC) +_add_if("MultiSSL" CURL_WITH_MULTI_SSL) +_add_if("HTTPS-proxy" _ssl_enabled AND (USE_OPENSSL OR USE_GNUTLS + OR USE_SCHANNEL OR USE_RUSTLS OR USE_BEARSSL OR + USE_MBEDTLS OR USE_SECTRANSP OR + (USE_WOLFSSL AND HAVE_WOLFSSL_FULL_BIO))) +_add_if("Unicode" ENABLE_UNICODE) +_add_if("threadsafe" HAVE_ATOMIC OR + (USE_THREADS_POSIX AND HAVE_PTHREAD_H) OR + (WIN32 AND HAVE_WIN32_WINNT GREATER_EQUAL 0x0600)) +_add_if("Debug" ENABLE_DEBUG) +_add_if("TrackMemory" ENABLE_CURLDEBUG) +_add_if("ECH" _ssl_enabled AND HAVE_ECH) +_add_if("PSL" USE_LIBPSL) +_add_if("CAcert" CURL_CA_EMBED_SET) +if(_items) + if(NOT CMAKE_VERSION VERSION_LESS 3.13) + list(SORT _items CASE INSENSITIVE) + else() + list(SORT _items) + endif() +endif() +string(REPLACE ";" " " SUPPORT_FEATURES "${_items}") +message(STATUS "Features: ${SUPPORT_FEATURES}") + +# Clear list and collect SSL backends +unset(_items) +_add_if("Schannel" _ssl_enabled AND USE_SCHANNEL) +_add_if("OpenSSL" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0) +_add_if("OpenSSL v3+" _ssl_enabled AND USE_OPENSSL AND NOT OPENSSL_VERSION VERSION_LESS 3.0.0) +_add_if("Secure Transport" _ssl_enabled AND USE_SECTRANSP) +_add_if("mbedTLS" _ssl_enabled AND USE_MBEDTLS) +_add_if("BearSSL" _ssl_enabled AND USE_BEARSSL) +_add_if("wolfSSL" _ssl_enabled AND USE_WOLFSSL) +_add_if("GnuTLS" _ssl_enabled AND USE_GNUTLS) +_add_if("rustls" _ssl_enabled AND USE_RUSTLS) + +if(_items) + if(NOT CMAKE_VERSION VERSION_LESS 3.13) + list(SORT _items CASE INSENSITIVE) + else() + list(SORT _items) + endif() +endif() +string(REPLACE ";" " " SSL_BACKENDS "${_items}") +message(STATUS "Enabled SSL backends: ${SSL_BACKENDS}") +if(CURL_DEFAULT_SSL_BACKEND) + message(STATUS "Default SSL backend: ${CURL_DEFAULT_SSL_BACKEND}") +endif() + if(NOT CURL_DISABLE_INSTALL) - # Helper to populate a list (_items) with a label when conditions (the remaining - # args) are satisfied - macro(_add_if label) - # needs to be a macro to allow this indirection - if(${ARGN}) - set(_items ${_items} "${label}") - endif() - endmacro() - - # NTLM support requires crypto function adaptions from various SSL libs - if(NOT (CURL_DISABLE_NTLM) AND - (USE_OPENSSL OR USE_MBEDTLS OR USE_DARWINSSL OR USE_WIN32_CRYPTO OR USE_GNUTLS)) - set(use_curl_ntlm_core ON) - endif() - - # Clear list and try to detect available features - set(_items) - _add_if("SSL" SSL_ENABLED) - _add_if("IPv6" ENABLE_IPV6) - _add_if("UnixSockets" USE_UNIX_SOCKETS) - _add_if("libz" HAVE_LIBZ) - _add_if("brotli" HAVE_BROTLI) - _add_if("zstd" HAVE_ZSTD) - _add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32) - _add_if("IDN" HAVE_LIBIDN2 OR USE_WIN32_IDN) - _add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND - ((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) - _add_if("SSPI" USE_WINDOWS_SSPI) - _add_if("GSS-API" HAVE_GSSAPI) - _add_if("alt-svc" NOT CURL_DISABLE_ALTSVC) - _add_if("HSTS" NOT CURL_DISABLE_HSTS) - _add_if("SPNEGO" NOT CURL_DISABLE_NEGOTIATE_AUTH AND - (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) - _add_if("Kerberos" NOT CURL_DISABLE_KERBEROS_AUTH AND - (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) - _add_if("NTLM" NOT (CURL_DISABLE_NTLM) AND - (use_curl_ntlm_core OR USE_WINDOWS_SSPI)) - _add_if("NTLM_WB" NOT (CURL_DISABLE_NTLM) AND - (use_curl_ntlm_core OR USE_WINDOWS_SSPI) AND - NOT CURL_DISABLE_HTTP AND NTLM_WB_ENABLED) - _add_if("TLS-SRP" USE_TLS_SRP) - _add_if("HTTP2" USE_NGHTTP2) - _add_if("HTTP3" USE_NGTCP2 OR USE_QUICHE OR USE_OPENSSL_QUIC) - _add_if("MultiSSL" CURL_WITH_MULTI_SSL) - # TODO wolfSSL only support this from v5.0.0 onwards - _add_if("HTTPS-proxy" SSL_ENABLED AND (USE_OPENSSL OR USE_GNUTLS - OR USE_SCHANNEL OR USE_RUSTLS OR USE_BEARSSL OR - USE_MBEDTLS OR USE_SECTRANSP)) - _add_if("unicode" ENABLE_UNICODE) - _add_if("threadsafe" HAVE_ATOMIC OR - (USE_THREADS_POSIX AND HAVE_PTHREAD_H) OR - (WIN32 AND HAVE_WIN32_WINNT GREATER_EQUAL 0x600)) - _add_if("PSL" USE_LIBPSL) - string(REPLACE ";" " " SUPPORT_FEATURES "${_items}") - message(STATUS "Enabled features: ${SUPPORT_FEATURES}") - - # Clear list and try to detect available protocols - set(_items) - _add_if("HTTP" NOT CURL_DISABLE_HTTP) - _add_if("IPFS" NOT CURL_DISABLE_HTTP) - _add_if("IPNS" NOT CURL_DISABLE_HTTP) - _add_if("HTTPS" NOT CURL_DISABLE_HTTP AND SSL_ENABLED) - _add_if("FTP" NOT CURL_DISABLE_FTP) - _add_if("FTPS" NOT CURL_DISABLE_FTP AND SSL_ENABLED) - _add_if("FILE" NOT CURL_DISABLE_FILE) - _add_if("TELNET" NOT CURL_DISABLE_TELNET) - _add_if("LDAP" NOT CURL_DISABLE_LDAP) - # CURL_DISABLE_LDAP implies CURL_DISABLE_LDAPS - _add_if("LDAPS" NOT CURL_DISABLE_LDAPS AND - ((USE_OPENLDAP AND SSL_ENABLED) OR - (NOT USE_OPENLDAP AND HAVE_LDAP_SSL))) - _add_if("DICT" NOT CURL_DISABLE_DICT) - _add_if("TFTP" NOT CURL_DISABLE_TFTP) - _add_if("GOPHER" NOT CURL_DISABLE_GOPHER) - _add_if("GOPHERS" NOT CURL_DISABLE_GOPHER AND SSL_ENABLED) - _add_if("POP3" NOT CURL_DISABLE_POP3) - _add_if("POP3S" NOT CURL_DISABLE_POP3 AND SSL_ENABLED) - _add_if("IMAP" NOT CURL_DISABLE_IMAP) - _add_if("IMAPS" NOT CURL_DISABLE_IMAP AND SSL_ENABLED) - _add_if("SMB" NOT CURL_DISABLE_SMB AND - use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4)) - _add_if("SMBS" NOT CURL_DISABLE_SMB AND SSL_ENABLED AND - use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4)) - _add_if("SMTP" NOT CURL_DISABLE_SMTP) - _add_if("SMTPS" NOT CURL_DISABLE_SMTP AND SSL_ENABLED) - _add_if("SCP" USE_LIBSSH2 OR USE_LIBSSH) - _add_if("SFTP" USE_LIBSSH2 OR USE_LIBSSH) - _add_if("RTSP" NOT CURL_DISABLE_RTSP) - _add_if("RTMP" USE_LIBRTMP) - _add_if("MQTT" NOT CURL_DISABLE_MQTT) - _add_if("WS" USE_WEBSOCKETS) - _add_if("WSS" USE_WEBSOCKETS) - if(_items) - list(SORT _items) - endif() - string(REPLACE ";" " " SUPPORT_PROTOCOLS "${_items}") - message(STATUS "Enabled protocols: ${SUPPORT_PROTOCOLS}") - - # Clear list and collect SSL backends - set(_items) - _add_if("Schannel" SSL_ENABLED AND USE_SCHANNEL) - _add_if("OpenSSL" SSL_ENABLED AND USE_OPENSSL) - _add_if("Secure Transport" SSL_ENABLED AND USE_SECTRANSP) - _add_if("mbedTLS" SSL_ENABLED AND USE_MBEDTLS) - _add_if("BearSSL" SSL_ENABLED AND USE_BEARSSL) - _add_if("wolfSSL" SSL_ENABLED AND USE_WOLFSSL) - _add_if("GnuTLS" SSL_ENABLED AND USE_GNUTLS) - - if(_items) - list(SORT _items) - endif() - string(REPLACE ";" " " SSL_BACKENDS "${_items}") - message(STATUS "Enabled SSL backends: ${SSL_BACKENDS}") - if(CURL_DEFAULT_SSL_BACKEND) - message(STATUS "Default SSL backend: ${CURL_DEFAULT_SSL_BACKEND}") - endif() - # curl-config needs the following options to be set. set(CC "${CMAKE_C_COMPILER}") - # TODO probably put a -D... options here? + # TODO: probably put a -D... options here? set(CONFIGURE_OPTIONS "") - set(CURLVERSION "${CURL_VERSION}") + set(CURLVERSION "${_curl_version}") + set(VERSIONNUM "${_curl_version_num}") + set(prefix "${CMAKE_INSTALL_PREFIX}") set(exec_prefix "\${prefix}") - set(includedir "\${prefix}/include") + if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR}) + set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + endif() + if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) + set(libdir "${CMAKE_INSTALL_LIBDIR}") + else() + set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + endif() set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") - set(LIBCURL_LIBS "") - set(libdir "${CMAKE_INSTALL_PREFIX}/lib") + # "a" (Linux) or "lib" (Windows) + string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") - # For processing full path libraries into -L and -l ld options, - # the directories that go with the -L option are cached, so they - # only get added once per such directory. - set(_libcurl_libs_dirs) - # To avoid getting unnecessary -L options for known system directories, - # _libcurl_libs_dirs is seeded with them. - foreach(_libdir ${CMAKE_SYSTEM_PREFIX_PATH}) + set(_ldflags "") + set(LIBCURL_PC_LIBS_PRIVATE "") + + # Avoid getting unnecessary -L options for known system directories. + unset(_sys_libdirs) + foreach(_libdir IN LISTS CMAKE_SYSTEM_PREFIX_PATH) if(_libdir MATCHES "/$") set(_libdir "${_libdir}lib") else() set(_libdir "${_libdir}/lib") endif() if(IS_DIRECTORY "${_libdir}") - list(APPEND _libcurl_libs_dirs "${_libdir}") + list(APPEND _sys_libdirs "${_libdir}") endif() if(DEFINED CMAKE_LIBRARY_ARCHITECTURE) set(_libdir "${_libdir}/${CMAKE_LIBRARY_ARCHITECTURE}") if(IS_DIRECTORY "${_libdir}") - list(APPEND _libcurl_libs_dirs "${_libdir}") + list(APPEND _sys_libdirs "${_libdir}") endif() endif() endforeach() - foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) + foreach(_libdir IN LISTS CURL_LIBDIRS) + list(FIND _sys_libdirs "${_libdir}" _libdir_index) + if(_libdir_index LESS 0) + list(APPEND _ldflags "-L${_libdir}") + endif() + endforeach() + + unset(_implicit_libs) + if(NOT MINGW AND NOT UNIX) + set(_implicit_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES}) + endif() + + foreach(_lib IN LISTS _implicit_libs CURL_LIBS) if(TARGET "${_lib}") set(_libname "${_lib}") get_target_property(_imported "${_libname}" IMPORTED) if(NOT _imported) # Reading the LOCATION property on non-imported target will error out. - # Assume the user won't need this information in the .pc file. + # Assume the user will not need this information in the .pc file. continue() endif() get_target_property(_lib "${_libname}" LOCATION) @@ -1680,129 +2103,210 @@ if(NOT CURL_DISABLE_INSTALL) continue() endif() endif() - if(_lib MATCHES "^-") - set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}") + 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 - string(REGEX REPLACE "^(.*)/[^/]*$" "\\1" _libdir "${_lib}") - string(REGEX REPLACE "^.*/([^/.]*).*$" "\\1" _libname "${_lib}") + get_filename_component(_libdir ${_lib} DIRECTORY) + get_filename_component(_libname ${_lib} NAME_WE) if(_libname MATCHES "^lib") - list(FIND _libcurl_libs_dirs "${_libdir}" _libdir_index) + list(FIND _sys_libdirs "${_libdir}" _libdir_index) if(_libdir_index LESS 0) - list(APPEND _libcurl_libs_dirs "${_libdir}") - set(LIBCURL_LIBS "${LIBCURL_LIBS} -L${_libdir}") + list(APPEND _ldflags "-L${_libdir}") endif() string(REGEX REPLACE "^lib" "" _libname "${_libname}") - set(LIBCURL_LIBS "${LIBCURL_LIBS} -l${_libname}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") else() - set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") endif() else() - set(LIBCURL_LIBS "${LIBCURL_LIBS} -l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") endif() endforeach() + + if(LIBCURL_PC_REQUIRES_PRIVATE) + string(REPLACE ";" "," LIBCURL_PC_REQUIRES_PRIVATE "${LIBCURL_PC_REQUIRES_PRIVATE}") + endif() + if(LIBCURL_PC_LIBS_PRIVATE) + string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") + endif() + if(_ldflags) + list(REMOVE_DUPLICATES _ldflags) + string(REPLACE ";" " " _ldflags "${_ldflags}") + set(LDFLAGS "${LDFLAGS} ${_ldflags}") + string(STRIP "${LDFLAGS}" LDFLAGS) + endif() + set(LIBCURL_PC_CFLAGS_PRIVATE "-DCURL_STATICLIB") + + # Merge pkg-config private fields into public ones when static-only if(BUILD_SHARED_LIBS) - set(ENABLE_SHARED "yes") - set(LIBCURL_NO_SHARED "") - set(CPPFLAG_CURL_STATICLIB "") + set(ENABLE_SHARED "yes") + set(LIBCURL_PC_REQUIRES "") + set(LIBCURL_PC_LIBS "") + set(LIBCURL_PC_CFLAGS "") else() - set(ENABLE_SHARED "no") - set(LIBCURL_NO_SHARED "${LIBCURL_LIBS}") - set(CPPFLAG_CURL_STATICLIB "-DCURL_STATICLIB") + set(ENABLE_SHARED "no") + set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}") + set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}") + set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}") endif() if(BUILD_STATIC_LIBS) - set(ENABLE_STATIC "yes") + set(ENABLE_STATIC "yes") else() - set(ENABLE_STATIC "no") + set(ENABLE_STATIC "no") endif() - # "a" (Linux) or "lib" (Windows) - string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(prefix "${CMAKE_INSTALL_PREFIX}") - # Set this to "yes" to append all libraries on which -lcurl is dependent - set(REQUIRE_LIB_DEPS "no") - # SUPPORT_FEATURES - # SUPPORT_PROTOCOLS - set(VERSIONNUM "${CURL_VERSION_NUM}") - # Finally generate a "curl-config" matching this config - # Use: - # * ENABLE_SHARED - # * ENABLE_STATIC - configure_file("${CURL_SOURCE_DIR}/curl-config.in" - "${CURL_BINARY_DIR}/curl-config" @ONLY) - install(FILES "${CURL_BINARY_DIR}/curl-config" - DESTINATION ${CMAKE_INSTALL_BINDIR} - PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) + # Generate a "curl-config" matching this config. + # Consumed variables: + # CC + # CONFIGURE_OPTIONS + # CURLVERSION + # CURL_CA_BUNDLE + # ENABLE_SHARED + # ENABLE_STATIC + # exec_prefix + # includedir + # LDFLAGS + # LIBCURL_PC_CFLAGS + # LIBCURL_PC_LIBS_PRIVATE + # libdir + # libext + # prefix + # SSL_BACKENDS + # SUPPORT_FEATURES + # SUPPORT_PROTOCOLS + # VERSIONNUM + configure_file( + "${PROJECT_SOURCE_DIR}/curl-config.in" + "${PROJECT_BINARY_DIR}/curl-config" @ONLY) + install(FILES "${PROJECT_BINARY_DIR}/curl-config" + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) - # Finally generate a pkg-config file matching this config - configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in" - "${CURL_BINARY_DIR}/libcurl.pc" @ONLY) - install(FILES "${CURL_BINARY_DIR}/libcurl.pc" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + # Generate a pkg-config file matching this config. + # Consumed variables: + # CURLVERSION + # exec_prefix + # includedir + # LDFLAGS + # LIBCURL_PC_CFLAGS + # LIBCURL_PC_CFLAGS_PRIVATE + # LIBCURL_PC_LIBS + # LIBCURL_PC_LIBS_PRIVATE + # LIBCURL_PC_REQUIRES + # LIBCURL_PC_REQUIRES_PRIVATE + # libdir + # prefix + # SUPPORT_FEATURES + # SUPPORT_PROTOCOLS + # Documentation: + # https://people.freedesktop.org/~dbn/pkg-config-guide.html + # https://manpages.debian.org/unstable/pkgconf/pkg-config.1.en.html + # https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html + # https://www.msys2.org/docs/pkgconfig/ + configure_file( + "${PROJECT_SOURCE_DIR}/libcurl.pc.in" + "${PROJECT_BINARY_DIR}/libcurl.pc" @ONLY) + install(FILES "${PROJECT_BINARY_DIR}/libcurl.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - # install headers - install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h") + # Install headers + install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/curl" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") include(CMakePackageConfigHelpers) write_basic_package_version_file( - "${version_config}" - VERSION ${CURL_VERSION} - COMPATIBILITY SameMajorVersion - ) - file(READ "${version_config}" generated_version_config) - file(WRITE "${version_config}" - "if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\") + "${_version_config}" + VERSION ${_curl_version} + COMPATIBILITY SameMajorVersion) + file(READ "${_version_config}" _generated_version_config) + file(WRITE "${_version_config}" " + if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\") # Version 8 satisfies version 7... requirements set(PACKAGE_FIND_VERSION_MAJOR 8) set(PACKAGE_FIND_VERSION_COUNT 1) - endif() - ${generated_version_config}" - ) + endif() + ${_generated_version_config}") - # Use: - # * TARGETS_EXPORT_NAME - # * PROJECT_NAME - configure_package_config_file(CMake/curl-config.cmake.in - "${project_config}" - INSTALL_DESTINATION ${CURL_INSTALL_CMAKE_DIR} - ) + # Consumed custom variables: + # LIB_SELECTED + # TARGETS_EXPORT_NAME + # USE_OPENSSL + # HAVE_LIBZ + configure_package_config_file("CMake/curl-config.cmake.in" + "${_project_config}" + INSTALL_DESTINATION ${_install_cmake_dir} + PATH_VARS CMAKE_INSTALL_INCLUDEDIR) if(CURL_ENABLE_EXPORT_TARGET) - install( - EXPORT "${TARGETS_EXPORT_NAME}" - NAMESPACE "${PROJECT_NAME}::" - DESTINATION ${CURL_INSTALL_CMAKE_DIR} - ) + install(EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${PROJECT_NAME}::" + DESTINATION ${_install_cmake_dir}) endif() - install( - FILES ${version_config} ${project_config} - DESTINATION ${CURL_INSTALL_CMAKE_DIR} - ) + install(FILES ${_version_config} ${_project_config} + DESTINATION ${_install_cmake_dir}) # Workaround for MSVS10 to avoid the Dialog Hell # FIXME: This could be removed with future version of CMake. if(MSVC_VERSION EQUAL 1600) - set(CURL_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/CURL.sln") - if(EXISTS "${CURL_SLN_FILENAME}") - file(APPEND "${CURL_SLN_FILENAME}" "\n# This should be regenerated!\n") + set(_curl_sln_filename "${CMAKE_CURRENT_BINARY_DIR}/CURL.sln") + if(EXISTS "${_curl_sln_filename}") + file(APPEND "${_curl_sln_filename}" "\n# This should be regenerated!\n") endif() endif() if(NOT TARGET curl_uninstall) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake - IMMEDIATE @ONLY) + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake" + IMMEDIATE @ONLY) add_custom_target(curl_uninstall - COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake) + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake") endif() + + install(FILES "${PROJECT_SOURCE_DIR}/scripts/mk-ca-bundle.pl" + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + + # The `-DEV` part is important + string(REGEX REPLACE "([0-9]+\.[0-9]+)\.([0-9]+.*)" "\\2" CPACK_PACKAGE_VERSION_PATCH "${_curl_version}") + set(CPACK_GENERATOR "TGZ") + include(CPack) +endif() + +# Save build info for test runner to pick up and log +if(CMAKE_OSX_SYSROOT) + set(_cmake_sysroot ${CMAKE_OSX_SYSROOT}) +elseif(CMAKE_SYSROOT) + set(_cmake_sysroot ${CMAKE_SYSROOT}) +endif() +set(_buildinfo "\ +buildinfo.configure.tool: cmake +buildinfo.configure.command: ${CMAKE_COMMAND} +buildinfo.configure.version: ${CMAKE_VERSION} +buildinfo.configure.args:${_cmake_args} +buildinfo.configure.generator: ${CMAKE_GENERATOR} +buildinfo.configure.make: ${CMAKE_MAKE_PROGRAM} +buildinfo.host.cpu: ${CMAKE_HOST_SYSTEM_PROCESSOR} +buildinfo.host.os: ${CMAKE_HOST_SYSTEM_NAME} +buildinfo.target.cpu: ${CMAKE_SYSTEM_PROCESSOR} +buildinfo.target.os: ${CMAKE_SYSTEM_NAME} +buildinfo.target.flags:${_target_flags} +buildinfo.compiler: ${CMAKE_C_COMPILER_ID} +buildinfo.compiler.version: ${CMAKE_C_COMPILER_VERSION} +buildinfo.sysroot: ${_cmake_sysroot} +") +file(WRITE "${PROJECT_BINARY_DIR}/buildinfo.txt" "# This is a generated file. Do not edit.\n${_buildinfo}") +if(NOT "$ENV{CURL_BUILDINFO}$ENV{CURL_CI}$ENV{CI}" STREQUAL "") + message(STATUS "\n${_buildinfo}") endif() diff --git a/deps/curl/Dockerfile b/deps/curl/Dockerfile new file mode 100644 index 00000000..3f9ea1ba --- /dev/null +++ b/deps/curl/Dockerfile @@ -0,0 +1,41 @@ +# Copyright (C) Daniel Stenberg, , et al. +# +# SPDX-License-Identifier: curl + +# Self-contained build environment to match the release environment. +# +# Build and set the timestamp for the date corresponding to the release +# +# docker build --build-arg SOURCE_DATE_EPOCH=1711526400 --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t curl/curl . +# +# Then run commands from within the build environment, for example +# +# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl autoreconf -fi +# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./configure --without-ssl --without-libpsl +# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl make +# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./scripts/maketgz 8.7.1 +# +# or get into a shell in the build environment, for example +# +# docker run --rm -it -u $(id -u):$(id -g) -v (pwd):/usr/src -w /usr/src curl/curl bash +# $ autoreconf -fi +# $ ./configure --without-ssl --without-libpsl +# $ make +# $ ./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:d83056144b2dd301730d2739635c8cbdeaaae20d6887146434184f8c060f03ce + +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 && \ + rm -rf /var/lib/apt/lists/* + +ARG UID=1000 GID=1000 + +RUN groupadd --gid $UID dev && \ + useradd --uid $UID --gid dev --shell /bin/bash --create-home dev + +USER dev:dev + +ARG SOURCE_DATE_EPOCH +ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-1} diff --git a/deps/curl/GIT-INFO.md b/deps/curl/GIT-INFO.md index 825476c9..71a8b037 100644 --- a/deps/curl/GIT-INFO.md +++ b/deps/curl/GIT-INFO.md @@ -27,16 +27,6 @@ In environments that don't support configure (i.e. Windows), do this: ## REQUIREMENTS -For `autoreconf` and `configure` (not `buildconf.bat`) to work, you need the -following software installed: +See [docs/INTERNALS.md][0] for requirement details. - o autoconf 2.57 (or later) - o automake 1.7 (or later) - o libtool 1.4.2 (or later) - o GNU m4 (required by autoconf) - o perl - -If you don't have perl and don't want to install it, you can rename the source -file `src/tool_hugehelp.c.cvs` to `src/tool_hugehelp.c` and avoid having to -generate this file. This will give you a stubbed version of the file that -doesn't contain actual content. +[0]: docs/INTERNALS.md diff --git a/deps/curl/MacOSX-Framework b/deps/curl/MacOSX-Framework deleted file mode 100644 index 5ac53763..00000000 --- a/deps/curl/MacOSX-Framework +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash -#*************************************************************************** -# _ _ ____ _ -# 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 performs all of the steps needed to build a -# universal binary libcurl.framework for Mac OS X 10.4 or greater. -# -# Hendrik Visage: -# Generalizations added since Snowleopard (10.6) do not include -# the 10.4u SDK. -# -# Also note: -# 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support -#If you need to have PPC64 support then change below to 1 -PPC64_NEEDED=0 -# Apple does not support building for PPC anymore in Xcode 4 and later. -# If you're using Xcode 3 or earlier and need PPC support, then change -# the setting below to 1 -PPC_NEEDED=0 - -# For me the default is to develop for the platform I am on, and if you -#desire compatibility with older versions then change USE_OLD to 1 :) -USE_OLD=0 - -VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h` -FRAMEWORK_VERSION=Versions/Release-$VERSION - -#I also wanted to "copy over" the system, and thus the reason I added the -# version to Versions/Release-7.20.1 etc. -# now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it -# and setup the right paths to this version, leaving the system version -# "intact", so you can "fix" it later with the links to Versions/A/... - -DEVELOPER_PATH=`xcode-select --print-path` -# Around Xcode 4.3, SDKs were moved from the Developer folder into the -# MacOSX.platform folder -if test -d "$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"; then - SDK_PATH="$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs" -else - SDK_PATH="$DEVELOPER_PATH/SDKs" -fi -OLD_SDK=`ls $SDK_PATH|head -1` -NEW_SDK=`ls -r $SDK_PATH|head -1` - -if test "0"$USE_OLD -gt 0 -then - SDK32=$OLD_SDK -else - SDK32=$NEW_SDK -fi - -MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//` - -SDK32_DIR=$SDK_PATH/$SDK32 -MINVER32='-mmacosx-version-min='$MACVER -if test $PPC_NEEDED -gt 0; then - ARCHES32='-arch i386 -arch ppc' -else - ARCHES32='-arch i386' -fi - -if test $PPC64_NEEDED -gt 0 -then - SDK64=10.5 - ARCHES64='-arch x86_64 -arch ppc64' - SDK64=`ls $SDK_PATH | grep "10\.5" | head -1` -else - ARCHES64='-arch x86_64' - #We "know" that 10.4 and earlier do not support 64bit - OLD_SDK64=`ls $SDK_PATH | grep -v "10\.[0-4]" | head -1` - NEW_SDK64=`ls -r $SDK_PATH | grep -v "10\.[0-4][^0-9]" | head -1` - if test $USE_OLD -gt 0 - then - SDK64=$OLD_SDK64 - else - SDK64=$NEW_SDK64 - fi -fi - -SDK64_DIR=$SDK_PATH/$SDK64 -MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//` - -MINVER64='-mmacosx-version-min='$MACVER64 - -if test ! -z $SDK32; then - echo "----Configuring libcurl for 32 bit universal framework..." - make clean - ./configure --disable-dependency-tracking --disable-static --with-gssapi --with-secure-transport \ - CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32" \ - LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 -Wl,-headerpad_max_install_names" \ - CC=$CC - - echo "----Building 32 bit libcurl..." - make -j `sysctl -n hw.logicalcpu_max` - - echo "----Creating 32 bit framework..." - rm -r libcurl.framework - mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources - cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl - install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl - cp lib/libcurl.plist libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist - mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl - cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl - pushd libcurl.framework - ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl - ln -fs ${FRAMEWORK_VERSION}/Resources Resources - ln -fs ${FRAMEWORK_VERSION}/Headers Headers - cd Versions - ln -fs $(basename "${FRAMEWORK_VERSION}") Current - - echo Testing for SDK64 - if test -d $SDK64_DIR; then - echo entering... - popd - make clean - echo "----Configuring libcurl for 64 bit universal framework..." - ./configure --disable-dependency-tracking --disable-static --with-gssapi --with-secure-transport \ - CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64" \ - LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 -Wl,-headerpad_max_install_names" \ - CC=$CC - - echo "----Building 64 bit libcurl..." - make -j `sysctl -n hw.logicalcpu_max` - - echo "----Appending 64 bit framework to 32 bit framework..." - cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 - install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 - cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 - pwd - lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl - rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 - fi - - pwd - lipo -info libcurl.framework/${FRAMEWORK_VERSION}/libcurl - echo "libcurl.framework is built and can now be included in other projects." - echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks." -else - echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4/5/6 SDK installed." -fi diff --git a/deps/curl/Makefile.am b/deps/curl/Makefile.am index 658189e4..be3f520b 100644 --- a/deps/curl/Makefile.am +++ b/deps/curl/Makefile.am @@ -34,16 +34,24 @@ CMAKE_DIST = \ CMake/CurlTests.c \ CMake/FindBearSSL.cmake \ CMake/FindBrotli.cmake \ - CMake/FindCARES.cmake \ + CMake/FindCares.cmake \ CMake/FindGSS.cmake \ - CMake/FindLibPSL.cmake \ - CMake/FindLibSSH2.cmake \ + CMake/FindLibgsasl.cmake \ + CMake/FindLibidn2.cmake \ + CMake/FindLibpsl.cmake \ + CMake/FindLibssh.cmake \ + CMake/FindLibssh2.cmake \ + CMake/FindLibuv.cmake \ CMake/FindMbedTLS.cmake \ CMake/FindMSH3.cmake \ + CMake/FindMbedTLS.cmake \ CMake/FindNGHTTP2.cmake \ CMake/FindNGHTTP3.cmake \ CMake/FindNGTCP2.cmake \ - CMake/FindQUICHE.cmake \ + CMake/FindNettle.cmake \ + CMake/FindQuiche.cmake \ + CMake/FindRustls.cmake \ + CMake/FindWolfSSH.cmake \ CMake/FindWolfSSL.cmake \ CMake/FindZstd.cmake \ CMake/Macros.cmake \ @@ -53,64 +61,16 @@ CMAKE_DIST = \ CMake/Utilities.cmake \ CMakeLists.txt -VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl -VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist -VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc -VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl -VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist -VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc - -VC14_10_LIBTMPL = projects/Windows/VC14.10/lib/libcurl.tmpl -VC14_10_LIBVCXPROJ = projects/Windows/VC14.10/lib/libcurl.vcxproj.dist -VC14_10_LIBVCXPROJ_DEPS = $(VC14_10_LIBTMPL) Makefile.am lib/Makefile.inc -VC14_10_SRCTMPL = projects/Windows/VC14.10/src/curl.tmpl -VC14_10_SRCVCXPROJ = projects/Windows/VC14.10/src/curl.vcxproj.dist -VC14_10_SRCVCXPROJ_DEPS = $(VC14_10_SRCTMPL) Makefile.am src/Makefile.inc - -VC14_20_LIBTMPL = projects/Windows/VC14.20/lib/libcurl.tmpl -VC14_20_LIBVCXPROJ = projects/Windows/VC14.20/lib/libcurl.vcxproj.dist -VC14_20_LIBVCXPROJ_DEPS = $(VC14_20_LIBTMPL) Makefile.am lib/Makefile.inc -VC14_20_SRCTMPL = projects/Windows/VC14.20/src/curl.tmpl -VC14_20_SRCVCXPROJ = projects/Windows/VC14.20/src/curl.vcxproj.dist -VC14_20_SRCVCXPROJ_DEPS = $(VC14_20_SRCTMPL) Makefile.am src/Makefile.inc - -VC14_30_LIBTMPL = projects/Windows/VC14.30/lib/libcurl.tmpl -VC14_30_LIBVCXPROJ = projects/Windows/VC14.30/lib/libcurl.vcxproj.dist -VC14_30_LIBVCXPROJ_DEPS = $(VC14_30_LIBTMPL) Makefile.am lib/Makefile.inc -VC14_30_SRCTMPL = projects/Windows/VC14.30/src/curl.tmpl -VC14_30_SRCVCXPROJ = projects/Windows/VC14.30/src/curl.vcxproj.dist -VC14_30_SRCVCXPROJ_DEPS = $(VC14_30_SRCTMPL) Makefile.am src/Makefile.inc - VC_DIST = projects/README.md \ projects/build-openssl.bat \ projects/build-wolfssl.bat \ projects/checksrc.bat \ - projects/Windows/VC14/curl-all.sln \ - projects/Windows/VC14/lib/libcurl.sln \ - projects/Windows/VC14/lib/libcurl.vcxproj.filters \ - projects/Windows/VC14/src/curl.sln \ - projects/Windows/VC14/src/curl.vcxproj.filters \ - projects/Windows/VC14.10/curl-all.sln \ - projects/Windows/VC14.10/lib/libcurl.sln \ - projects/Windows/VC14.10/lib/libcurl.vcxproj.filters \ - projects/Windows/VC14.10/src/curl.sln \ - projects/Windows/VC14.10/src/curl.vcxproj.filters \ - projects/Windows/VC14.20/curl-all.sln \ - projects/Windows/VC14.20/lib/libcurl.sln \ - projects/Windows/VC14.20/lib/libcurl.vcxproj.filters \ - projects/Windows/VC14.20/src/curl.sln \ - projects/Windows/VC14.20/src/curl.vcxproj.filters \ - projects/Windows/VC14.30/curl-all.sln \ - projects/Windows/VC14.30/lib/libcurl.sln \ - projects/Windows/VC14.30/lib/libcurl.vcxproj.filters \ - projects/Windows/VC14.30/src/curl.sln \ - projects/Windows/VC14.30/src/curl.vcxproj.filters \ projects/generate.bat \ projects/wolfssl_options.h \ projects/wolfssl_override.props WINBUILD_DIST = winbuild/README.md winbuild/gen_resp_file.bat \ - winbuild/MakefileBuild.vc winbuild/Makefile.vc + winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat PLAN9_DIST = plan9/include/mkfile \ plan9/include/mkfile \ @@ -122,20 +82,21 @@ PLAN9_DIST = plan9/include/mkfile \ plan9/src/mkfile.inc \ plan9/src/mkfile -EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ - RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework $(CMAKE_DIST) \ - $(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST) lib/libcurl.vers.in buildconf.bat \ - libcurl.def +EXTRA_DIST = CHANGES.md COPYING Makefile.dist \ + RELEASE-NOTES $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) \ + $(PLAN9_DIST) buildconf.bat Dockerfile CLEANFILES = $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) \ $(VC14_10_LIBVCXPROJ) $(VC14_10_SRCVCXPROJ) \ $(VC14_20_LIBVCXPROJ) $(VC14_20_SRCVCXPROJ) \ $(VC14_30_LIBVCXPROJ) $(VC14_30_SRCVCXPROJ) +DISTCLEANFILES = buildinfo.txt + bin_SCRIPTS = curl-config SUBDIRS = lib docs src scripts -DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs +DIST_SUBDIRS = $(SUBDIRS) tests packages include docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc @@ -146,8 +107,8 @@ include src/Makefile.inc dist-hook: rm -rf $(top_builddir)/tests/log - find $(distdir) -name "*.dist" -exec rm {} \; - (distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \ + find $(distdir) -name "*.dist" -a \! -name Makefile.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//`; \ cp -p $$file $(distdir)$$strip; \ @@ -157,7 +118,13 @@ check: test examples check-docs if CROSSCOMPILING test-full: test +test-nonflaky: test test-torture: test +test-event: test +test-am: test +test-ci: test +pytest: test +pytest-ci: test test: @echo "NOTICE: we can't run the tests when cross-compiling!" @@ -185,6 +152,12 @@ test-am: test-ci: @(cd tests; $(MAKE) all ci-test) +pytest: + @(cd tests; $(MAKE) all default-pytest) + +pytest-ci: + @(cd tests; $(MAKE) all ci-pytest) + endif examples: @@ -235,7 +208,7 @@ pkgadd: cd $(srcdir)/packages/Solaris && $(MAKE) package # -# Build a cygwin binary tarball installation file +# Build a Cygwin binary tarball installation file # resulting .tar.bz2 file will end up at packages/Win32/cygwin cygwinbin: $(MAKE) -C packages/Win32/cygwin cygwinbin @@ -274,268 +247,6 @@ checksrc: (cd docs/examples && $(MAKE) checksrc) (cd packages && $(MAKE) checksrc) -.PHONY: vc-ide - -vc-ide: $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS) \ - $(VC14_10_LIBVCXPROJ_DEPS) $(VC14_10_SRCVCXPROJ_DEPS) \ - $(VC14_20_LIBVCXPROJ_DEPS) $(VC14_20_SRCVCXPROJ_DEPS) \ - $(VC14_30_LIBVCXPROJ_DEPS) $(VC14_30_SRCVCXPROJ_DEPS) - @(win32_lib_srcs='$(LIB_CFILES)'; \ - win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \ - win32_lib_rc='$(LIB_RCFILES)'; \ - win32_lib_vauth_srcs='$(LIB_VAUTH_CFILES)'; \ - win32_lib_vauth_hdrs='$(LIB_VAUTH_HFILES)'; \ - win32_lib_vquic_srcs='$(LIB_VQUIC_CFILES)'; \ - win32_lib_vquic_hdrs='$(LIB_VQUIC_HFILES)'; \ - win32_lib_vssh_srcs='$(LIB_VSSH_CFILES)'; \ - win32_lib_vssh_hdrs='$(LIB_VSSH_HFILES)'; \ - win32_lib_vtls_srcs='$(LIB_VTLS_CFILES)'; \ - win32_lib_vtls_hdrs='$(LIB_VTLS_HFILES)'; \ - win32_src_srcs='$(CURL_CFILES)'; \ - win32_src_hdrs='$(CURL_HFILES)'; \ - win32_src_rc='$(CURL_RCFILES)'; \ - win32_src_x_srcs='$(CURLX_CFILES)'; \ - win32_src_x_hdrs='$(CURLX_HFILES) ../lib/config-win32.h'; \ - \ - sorted_lib_srcs=`for file in $$win32_lib_srcs; do echo $$file; done | sort`; \ - sorted_lib_hdrs=`for file in $$win32_lib_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vauth_srcs=`for file in $$win32_lib_vauth_srcs; do echo $$file; done | sort`; \ - sorted_lib_vauth_hdrs=`for file in $$win32_lib_vauth_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vquic_srcs=`for file in $$win32_lib_vquic_srcs; do echo $$file; done | sort`; \ - sorted_lib_vquic_hdrs=`for file in $$win32_lib_vquic_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vssh_srcs=`for file in $$win32_lib_vssh_srcs; do echo $$file; done | sort`; \ - sorted_lib_vssh_hdrs=`for file in $$win32_lib_vssh_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vtls_srcs=`for file in $$win32_lib_vtls_srcs; do echo $$file; done | sort`; \ - sorted_lib_vtls_hdrs=`for file in $$win32_lib_vtls_hdrs; do echo $$file; done | sort`; \ - sorted_src_srcs=`for file in $$win32_src_srcs; do echo $$file; done | sort`; \ - sorted_src_hdrs=`for file in $$win32_src_hdrs; do echo $$file; done | sort`; \ - sorted_src_x_srcs=`for file in $$win32_src_x_srcs; do echo $$file; done | sort`; \ - sorted_src_x_hdrs=`for file in $$win32_src_x_hdrs; do echo $$file; done | sort`; \ - \ - awk_code='\ -function gen_element(type, dir, file)\ -{\ - sub(/vauth\//, "", file);\ - sub(/vquic\//, "", file);\ - sub(/vssh\//, "", file);\ - sub(/vtls\//, "", file);\ -\ - spaces=" ";\ - if(dir == "lib\\vauth" ||\ - dir == "lib\\vquic" ||\ - dir == "lib\\vssh" ||\ - dir == "lib\\vtls")\ - tabs=" ";\ - else\ - tabs=" ";\ -\ - if(type == "dsp") {\ - printf("# Begin Source File\r\n");\ - printf("\r\n");\ - printf("SOURCE=..\\..\\..\\..\\%s\\%s\r\n", dir, file);\ - printf("# End Source File\r\n");\ - }\ - else if(type == "vcproj1") {\ - printf("%s\r\n",\ - tabs, dir, file);\ - printf("%s\r\n", tabs);\ - }\ - else if(type == "vcproj2") {\ - printf("%s\r\n", tabs);\ - printf("%s\r\n", tabs);\ - }\ - else if(type == "vcxproj") {\ - i = index(file, ".");\ - ext = substr(file, i == 0 ? 0 : i + 1);\ -\ - if(ext == "c")\ - printf("%s\r\n",\ - spaces, dir, file);\ - else if(ext == "h")\ - printf("%s\r\n",\ - spaces, dir, file);\ - else if(ext == "rc")\ - printf("%s\r\n",\ - spaces, dir, file);\ - }\ -}\ -\ -{\ -\ - if($$0 == "CURL_LIB_C_FILES") {\ - split(lib_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_H_FILES") {\ - split(lib_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_RC_FILES") {\ - split(lib_rc, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VAUTH_C_FILES") {\ - split(lib_vauth_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VAUTH_H_FILES") {\ - split(lib_vauth_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VQUIC_C_FILES") {\ - split(lib_vquic_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vquic", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VQUIC_H_FILES") {\ - split(lib_vquic_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vquic", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VSSH_C_FILES") {\ - split(lib_vssh_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vssh", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VSSH_H_FILES") {\ - split(lib_vssh_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vssh", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VTLS_C_FILES") {\ - split(lib_vtls_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VTLS_H_FILES") {\ - split(lib_vtls_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_C_FILES") {\ - split(src_srcs, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_H_FILES") {\ - split(src_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_RC_FILES") {\ - split(src_rc, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_X_C_FILES") {\ - split(src_x_srcs, arr);\ - for(val in arr) {\ - sub(/..\/lib\//, "", arr[val]);\ - gen_element(proj_type, "lib", arr[val]);\ - }\ - }\ - else if($$0 == "CURL_SRC_X_H_FILES") {\ - split(src_x_hdrs, arr);\ - for(val in arr) {\ - sub(/..\/lib\//, "", arr[val]);\ - gen_element(proj_type, "lib", arr[val]);\ - }\ - }\ - else\ - printf("%s\r\n", $$0);\ -}';\ - \ - echo "generating '$(VC14_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \ - -v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \ - -v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \ - -v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_10_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \ - -v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \ - -v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \ - -v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_10_LIBTMPL) > $(VC14_10_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_10_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_10_SRCTMPL) > $(VC14_10_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_20_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \ - -v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \ - -v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \ - -v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_20_LIBTMPL) > $(VC14_20_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_20_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_20_SRCTMPL) > $(VC14_20_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_30_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vquic_srcs="$$sorted_lib_vquic_srcs" \ - -v lib_vquic_hdrs="$$sorted_lib_vquic_hdrs" \ - -v lib_vssh_srcs="$$sorted_lib_vssh_srcs" \ - -v lib_vssh_hdrs="$$sorted_lib_vssh_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_30_LIBTMPL) > $(VC14_30_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_30_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_30_SRCTMPL) > $(VC14_30_SRCVCXPROJ) || { exit 1; };) - tidy: (cd src && $(MAKE) tidy) (cd lib && $(MAKE) tidy) diff --git a/deps/curl/Makefile.dist b/deps/curl/Makefile.dist index 3db331a4..e9132040 100644 --- a/deps/curl/Makefile.dist +++ b/deps/curl/Makefile.dist @@ -66,6 +66,6 @@ ca-bundle: scripts/mk-ca-bundle.pl @echo "generate a fresh ca-bundle.crt" @perl $< -b -l -u lib/ca-bundle.crt -ca-firefox: lib/firefox-db2pem.sh +ca-firefox: scripts/firefox-db2pem.sh @echo "generate a fresh ca-bundle.crt" - ./lib/firefox-db2pem.sh lib/ca-bundle.crt + ./scripts/firefox-db2pem.sh lib/ca-bundle.crt diff --git a/deps/curl/README.md b/deps/curl/README.md index 8e586626..703e0e2a 100644 --- a/deps/curl/README.md +++ b/deps/curl/README.md @@ -6,26 +6,29 @@ 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. Find out how to use curl by reading [the curl.1 man -page](https://curl.se/docs/manpage.html) or [the MANUAL -document](https://curl.se/docs/manual.html). Find out how to install Curl -by reading [the INSTALL document](https://curl.se/docs/install.html). +Curl is a command-line tool for transferring data specified with URL syntax. +Learn how to use curl by reading [the +manpage](https://curl.se/docs/manpage.html) or [everything +curl](https://everything.curl.dev/). + +Find out how to install curl by reading [the INSTALL +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.3 man -page](https://curl.se/libcurl/c/libcurl.html) to learn how. +be used by your software. Read [the libcurl +manpage](https://curl.se/libcurl/c/libcurl.html) to learn how. -You can find answers to the most frequent questions we get in [the FAQ -document](https://curl.se/docs/faq.html). +## Open Source -Study [the COPYING file](https://curl.se/docs/copyright.html) for -distribution terms. +curl is Open Source and is distributed under an MIT-like +[license](https://curl.se/docs/copyright.html). ## Contact -If you have problems, questions, ideas or suggestions, please contact us by -posting to a suitable [mailing list](https://curl.se/mail/). +Contact us on a suitable [mailing list](https://curl.se/mail/) or +use GitHub [issues](https://github.com/curl/curl/issues)/ +[pull requests](https://github.com/curl/curl/pulls)/ +[discussions](https://github.com/curl/curl/discussions). All contributors to the project are listed in [the THANKS document](https://curl.se/docs/thanks.html). @@ -37,17 +40,14 @@ applications using (lib)curl visit [the support page](https://curl.se/support.ht ## Website -Visit the [curl website](https://curl.se/) for the latest news and -downloads. +Visit the [curl website](https://curl.se/) for the latest news and downloads. -## Git +## Source code -To download the latest source from the Git server, do this: +Download the latest source from the Git server: git clone https://github.com/curl/curl.git -(you will get a directory named curl created, filled with the source code) - ## Security problems Report suspected security problems via [our HackerOne @@ -61,7 +61,7 @@ distribution terms. ## Backers -Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/curl#section-contribute). +Thank you to all our backers 🙏 [Become a backer](https://opencollective.com/curl#section-contribute). ## Sponsors diff --git a/deps/curl/RELEASE-NOTES b/deps/curl/RELEASE-NOTES index 2a3f0533..790e44c3 100644 --- a/deps/curl/RELEASE-NOTES +++ b/deps/curl/RELEASE-NOTES @@ -1,300 +1,546 @@ -curl and libcurl 8.7.0 +curl and libcurl 8.11.0 - Public curl releases: 255 - Command line options: 258 - curl_easy_setopt() options: 304 - Public functions in libcurl: 93 - Contributors: 3112 + Public curl releases: 262 + Command line options: 266 + curl_easy_setopt() options: 306 + Public functions in libcurl: 94 + Contributors: 3263 This release includes the following changes: - o configure: add --disable-docs flag [16] - o CURLINFO_USED_PROXY: return bool whether the proxy was used [24] - o digest: support SHA-512/256 - o DoH: add trace configuration [61] - o write-out: add '%{proxy_used}' + o curl: --create-dirs works for --dump-header as well [4] + o gtls: Add P12 format support [9] + o ipfs: add options to disable [8] + o TLS: TLSv1.3 earlydata support for curl [140] + o WebSockets: make support official (non-experimental) [106] This release includes the following bugfixes: - o _VARIABLES.md: improve the description [105] - o ALTSVC.md: correct a typo [14] - o asyn-ares: fix data race warning [88] - o asyn-thread: use wakeup_close to close the read descriptor [1] - o badwords: use hostname, not host name [46] - o BINDINGS: add mcurl, the python binding [67] - o bufq: writing into a softlimit queue cannot be partial [49] - o c-hyper: add header collection writer in hyper builds [70] - o cd2nroff: gen: make `\>` in input to render as plain '>' in output - o cd2nroff: remove backticks from titles - o checksrc.pl: fix handling .checksrc with CRLF [43] - o cmake: add USE_OPENSSL_QUIC support [21] - o cmake: add warning for using TLS libraries without 1.3 support [25] - o cmake: enable `ENABLE_CURL_MANUAL` by default [112] - o cmake: fix `CURL_WINDOWS_SSPI=ON` with Schannel disabled [117] - o cmake: fix function description in comment [47] - o cmake: fix install for older CMake versions [53] - o cmake: fix libcurl.pc and curl-config library specifications [115] - o cmdline-docs/Makefile: avoid using a fixed temp file name [5] - o cmdline-docs: quote and angle bracket cleanup [45] - o cmdline-opts/_EXITCODES: sync with libcurl-errors [80] - o cmdline-opts/_VERSION: provide %VERSION correctly [87] - o configure.ac: find libpsl with pkg-config [79] - o configure: add warning for using TLS libraries without 1.3 support [26] - o configure: build & install shell completions when enabled [85] - o configure: do not link with nghttp3 unless necessary [7] - o configure: Don't build shell completions when disabled [68] - o configure: Don't make shell completions without perl [83] - o connect.c: fix typo [17] - o CONTRIBUTE: update the section on documentation format [96] - o cookie.md: provide an example sending a fixed cookie [13] - o cookie: if psl fails, reject the cookie [107] - o curl: exit on config file parser errors [40] - o curl: when allocating variables, add the name into the struct [37] - o curl_setup.h: add curl_uint64_t internal type - o curldown: fix email address in Copyright [89] - o CURLOPT_POSTQUOTE.md: fix typo [36] - o CURLOPT_SSL_CTX_FUNCTION.md: no promises of lifetime after return [104] - o CURLOPT_WRITEFUNCTION.md: typo fix [41] - o digest: add check for hashing error [111] - o dist: make sure the http tests are in the tarball [29] - o docs: add missing slashes to SChannel client certificate documentation [11] - o docs: add necessary setup for nghttp3 [51] - o docs: ascii version of manpage without nroff [121] - o docs: dist curl*.1 and install without perl [64] - o docs: make curldown do angle brackets like markdown [54] - o docs: make sure curl.1 is included in dist tarballs [35] - o docs: update minimal binary size in INSTALL.md - o docs: use present tense [103] - o examples: use present tense in comments [97] - o file: use xfer buf for file:// transfers [23] - o fopen: fix narrowing conversion warning on 32-bit Android [100] - o form-string.md: correct the example [4] - o ftp: do lineend conversions in client writer [32] - o ftp: fix socket wait activity in ftp_domore_getsock [28] - o ftp: tracing improvements [33] - o ftp: treat a 226 arriving before data as a signal to read data [19] - o gen.pl: make the "manpageification" faster [95] - o gen: make `\>` in input to render as plain '>' in output [78] - o getparam: make --ftp-ssl work again [90] - o GIT-INFO: convert to markdown [114] - o header.md: remove backslash, make nicer markdown [48] - o HTTP/2: write response directly [12] - o http2: fix push discard [124] - o http2: push headers better cleanup [113] - o HTTP3.md: adjust the OpenSSL QUIC install instructions [34] - o http: better error message for HTTP/1.x response without status line [86] - o http: move headers collecting to writer [71] - o http_chunks: fix the accounting of consumed bytes [22] - o http_chunks: remove unused 'endptr' variable [58] - o https-proxy: use IP address and cert with ip in alt names [50] - o hyper: implement unpausing via client reader [98] - o lib582: remove code causing warning that is never run [38] - o lib: add `void *ctx` to reader/writer instances [122] - o lib: convert Curl_get_line to use dynbuf [42] - o lib: Curl_read/Curl_write clarifications [101] - o lib: enhance client reader resume + rewind [92] - o lib: initialize output pointers to NULL before calling strto[ff,l,ul] [63] - o lib: remove curl_mimepart object when CURL_DISABLE_MIME [72] - o libcurl-docs: cleanups - o libcurl-security.md: Active FTP passes on the local IP address [6] - o libssh/libssh2: return error on too big range [75] - o MANUAL.md: fix typo [66] - o mbedtls: fix building when MBEDTLS_X509_REMOVE_INFO flag is defined [27] - o mbedtls: use mbedtls_ssl_conf_{min|max}_tls_version [59] - o md4: include strdup.h for the memdup proto [10] - o mime: add client reader [126] - o misc: fix typos in docs and lib [84] - o mkhelp: simplify the generated hugehelp program [120] - o mprintf: fix format prefix I32/I64 for windows compilers [77] - o multi: add xfer_buf to multi handle [30] - o multi: fix multi_sock handling of select_bits [81] - o multi: make add_handle free any multi_easy [102] - o ngtcp2: no recvbuf for stream [108] - o ntml_wb: fix buffer type typo [2] - o OpenSSL QUIC: adapt to v3.3.x [65] - o openssl-quic: check on Windows that socket conv to int is possible [8] - o openssl-quic: fix BIO leak and Windows warning [93] - o openssl-quic: fix unity build, casing, indentation [94] - o OS400: avoid using awk in the build scripts [20] - o paramhlp: fix CRLF-stripping files with "-d @file" [116] - o proxy1.0.md: fix example [15] - o pytest: adapt to API change [106] - o rustls: make curl compile with 0.12.0 [73] - o schannel: fix hang on unexpected server close [57] - o scripts: fix cijobs.pl for Azure and GHA - o sendf: ignore response body to HEAD [18] - o setopt: fix check for CURLOPT_PROXY_TLSAUTH_TYPE value [76] - o setopt: fix disabling all protocols [99] - o sha512_256: add support for GnuTLS and OpenSSL [110] - o smtp: fix STARTTLS [91] - o strtoofft: fix the overflow check [74] - o test1165: improve pattern matching [60] - o tests: support setting/using blank content env variables - o TIMER_STARTTRANSFER: set the same for everyone [82] - o tool_cb_hdr: only parse etag + content-disposition for 2xx [9] - o tool_operate: change precedence of server Retry-After time [44] - o tool_operate: do not set CURLOPT_QUICK_EXIT in debug builds [3] - o trace-config.md: remove the mutexed options list [119] - o transfer.c: break receive loop in speed limited transfers [125] - o transfer: improve Windows SO_SNDBUF update limit [56] - o urldata: move authneg bit from conn to Curl_easy [69] - o version: allow building with ancient libpsl [52] - o vtls: fix tls proxy peer verification [55] - o vtls: revert "receive max buffer" + add test case [39] - o websocket: fix curl_ws_recv() [62] - o write-out.md: clarify error handling details [31] + o alt-svc: honor data->state.httpwant [19] + o altsvc: avoid using local buffer and memcpy [124] + o asyn-ares: remove typecast, fix expire [113] + o autotools: add support for 'unity' builds, enable in CI [15] + o bearssl: avoid strpcy() when generating TLS version log message [120] + o bearssl: improved session handling, test exceptions [233] + o bufq: unwrite fix [121] + o build: add `ldap` to `libcurl.pc` `Requires:` [139] + o build: add pytest targets [71] + o build: clarify CA embed is for curl tool, mark default, improve summary [72] + o build: detect and use `_setmode()` with Cygwin/MSYS, also use on Windows [136] + o build: disable warning `-Wunreachable-code-break` [195] + o build: fix cross-compile check for poll with bionic [70] + o build: fix possible `-Wformat-overflow` in lib557 [85] + o build: limit arc4random detection to no-SSL configs [43] + o build: show if CA bundle to embed was found [83] + o build: tidy up and improve versioned-symbols options [5] + o build: tidy up deprecation suppression, enable warnings for clang [12] + o checksrc: add check for spaces around logical AND operators [220] + o checksrc: Added checks for colon operator in ternary expressions [77] + o checksrc: check for spaces around '?', '>' and '<' [46] + o ci: dump `curl_config.h` to log in all jobs [199] + o CI: run with standard mod_http2 [214] + o cmake, Makefile.mk: use -isystem for headers, silence BearSSL issues [37] + o cmake/FindCares: fix version detection for c-ares 1.34.1 [209] + o cmake/FindNGTCP2: use library path as hint for finding crypto module [40] + o cmake: add missed variable to comment + o cmake: add native `pkg-config` detection for mbedTLS, MSH3, Quiche, Rustls, wolfSSL [149] + o cmake: allow building tests in unity mode [31] + o cmake: allow manual configuration for LDAP [144] + o cmake: apply `WIN32_LEAN_AND_MEAN` to all feature checks + o cmake: avoid setting `BUILD_TESTING` [179] + o cmake: clear package version after `pkg-config` detection [207] + o cmake: delete unused NEED_LBER_H, HAVE_LDAP_H [38] + o cmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H` [132] + o cmake: detect GNU GSS [127] + o cmake: disable default OpenSSL if BearSSL, GnuTLS or Rustls is enabled [44] + o cmake: do not propagate unused `HAVE_GSSAPI_GSSAPI_KRB5_H` to C [131] + o cmake: document `-D` and env build options [208] + o cmake: drop obsolete items from `TODO` and `INSTALL-CMAKE` [228] + o cmake: drop redundant assignments [49] + o cmake: drop redundant zlib var, rename function (internals) [50] + o cmake: expand CURL_USE_PKGCONFIG to non-cross MINGW [13] + o cmake: fix broken dependency chain for cmdline-opts, tidy-ups [11] + o cmake: fix compile warnings for clang-cl [218] + o cmake: fix missing spacing in log message [205] + o cmake: limit `CURL_STATIC_CRT` to MSVC [217] + o cmake: make `test-ci` target skip building dependencies [88] + o cmake: mark as advanced some internal Find* variables [212] + o cmake: readd `generate-curl.1` dependency for `src` just in case [86] + o cmake: replace `check_include_file_concat()` for LDAP and GSS detection [143] + o cmake: replace `CURL_*_DIR` with `{PROJECT,CMAKE_CURRENT}_*_DIR` [211] + o cmake: require quictls (or fork) when using msh3 on non-Windows [14] + o cmake: separate target for examples, optimize CI, fix fallouts [16] + o cmake: set version for `project()` and add CPack support [123] + o cmake: stop adding dependency headers to global `CMAKE_REQUIRED_INCLUDES` [146] + o cmake: sync torture test parallelism with autotools [35] + o cmake: tidy up `CURL_DISABLE_FORM_API` initialization [225] + o cmake: tidy up and shorten symbol hiding initialization [213] + o cmake: tidy up line order + o cmake: tidy up picky warning initialization [215] + o cmake: tidy-ups and rebase fixups [191] + o cmake: tweaks around debug mode and hidden symbols [194] + o cmake: untangle feature detection interdependencies [198] + o cmake: use `list(APPEND)` on `CURL_INCLUDES` [223] + o cmake: use OpenSSL for LDAP detection only if available [102] + o cmake: use the `BSD` variable [210] + o configure: add GSS to `libcurl.pc` `Depends:` [126] + o configure: catch Apple in more target triplets [6] + o configure: drop duplicate feature checks for `poll()`, `if_nametoindex()` [135] + o configure: drop unused bare `socket.h` detection [133] + o configure: improve help string for some options [78] + o conncache: find bundle again in case it is removed [129] + o conncache: more efficient implementation of cpool_remove_bundle [176] + o cookie: overhaul and cleanup [142] + o curl-rustls.m4: set linker flags to allow rustls build on macos [186] + o curl.h: remove the struct pointer for CURL/CURLSH/CURLM typedefs [174] + o curl: add build options for safe/no CA bundle search (Windows) [26] + o curl: detect ECH support dynamically, not at build time [230] + o curl_multi_perform.md: fix typo [224] + o curl_trc: fix build with verbose messages disabled [79] + o curl_url_set.md: document HOST handling when URL is parsed [2] + o curl_ws_recv.md: the 'meta' pointer is only returned on success [221] + o curl_ws_recv: return recv 0 and point meta to NULL on all errors [222] + o CURLMOPT_PIPELINING.md: clarify that CURLPIPE_NOTHING is not default [54] + o CURLOPT_APPEND.md: goes for SFTP as well [128] + o CURLOPT_HEADERFUNCTION.md: do not modify the passed in buffer [107] + o DISABLED: disable test 1060 with hyper [154] + o DISTROS: avoid use of "very" + o Dockerfile: update Docker digest to d830561 [226] + o docs/cmdline-opts: GnuTLS supports PKCS#11 URI in --cert option [101] + o docs: clarify FTP over HTTP proxy functionality somewhat [203] + o docs: fix a typo in some cipher options + o ech: spelling, whitespace, say `--ech` default config [137] + o ftp: fix 0-length last write on upload from stdin [76] + o ftp: move listen handling to socket filter [183] + o GHA: optimize test prereq steps [188] + o gnutls: use session cache for QUIC [196] + o hsts: avoid the local buffer and memcpy on lookup [125] + o hsts: improve subdomain handling [158] + o hsts: support "implied LWS" properly around max-age [229] + o http2: auto reset stream on server eos [147] + o http_aws_sigv4: avoid local buffer and strcpy [92] + o INSTALL-CMAKE.md: mention focus on shared libraries [73] + o INSTALL-CMAKE: fix punctuation and a typo + o INSTALL.md: fix a typo that slipped in to RISC OS + o json.md: cli-option `--json` is an alias of `--data-binary` [89] + o lib, src, tests: added space around ternary expressions [56] + o lib/cw-out: initialize 'flush_all' directly [62] + o lib/src: white space edits to comply better with code style [47] + o lib: avoid assigning 'result' temporarily [97] + o lib: fix disabled-verbose-strings + enable-debug build warnings + o lib: fix unity builds with BearSSL, MSH3, Quiche, OmniOS [32] + o lib: move curl_path.[ch] into vssh/ [182] + o lib: msnprintf tidy-ups [245] + o lib: remove Curl_ prefix from static functions [202] + o lib: remove function pointer typecasts for hmac/sha256/md5 [175] + o lib: use bool/TRUE/FALSE properly [48] + o libcurl/opts: improve phrasing for connection cap related options [145] + o libssh.c: handle EGAINS during proto-connect correctly [23] + o libssh2: delete duplicate `break` [190] + o libssh2: put the readdir buffers into struct [170] + o libssh2: use the Curl_* memory functions to avoid memdebug [22] + o libssh2: use the filename buffer when getting the homedir [169] + o libtests: generate the lib1521 atomically [148] + o mbedTLS: fix handling of TLSv1.3 sessions [184] + o mbedtls: handle session as blobs [234] + o mk-lib1521: fix the long return code check [204] + o mprintf: do not ignore length modifiers of `%o`, `%x`, `%X` [164] + o mprintf: treat `%o` as unsigned, add tests for `%o`, `%x`, `%X` [162] + o mqtt: fix mqtt.md wording and add clearer explanation [172] + o multi.c: make stronger check for paused transfer before asserting [24] + o multi.c: warn/assert on stall only without timer [80] + o multi: avoid reading whole struct pointer from pointer [10] + o multi: convert Curl_follow to static multi_follow [141] + o multi: make curl_multi_cleanup invalidate magic latter [159] + o multi: make multi_handle_timeout use the connect timeout [98] + o multi: split multi_runsingle into sub functions [200] + o negotiate: conditional check around GSS & SSL specific code [1] + o netrc: cache the netrc file in memory [138] + o ngtcp2: set max window size to 10x of initial (128KB) [232] + o openssl quic: populate x509 store before handshake [117] + o openssl: convert a memcpy to dynbuf use [57] + o openssl: improve retries on shutdown [151] + o openssl: remove two strcpy() calls [64] + o OS400: don't delete source files when building with debug [235] + o packages/OS400/curlmain: remove the strncpy calls [155] + o processhelp.pm: improve taskkill calls (Windows) [52] + o pytest: fix run against multissl curl [236] + o pytest: improve pytest_07_42a reliability [118] + o pytest: include `buildinfo.txt` in the output [189] + o pytest: show curl features and protocols [150] + o quic: use send/recvmmsg when available [93] + o quic: use the session cache with wolfSSL as well [231] + o request: on shutdown send, proceed normally on timeout [18] + o runtests.md: suggest a value for -j for torture tests + o runtests: add comment for handle64 pathsep requirement + o runtests: drop unused code for old/classic-mingw support [87] + o runtests: pass single backslashes with Windows Perl [243] + o runtests: use deterministic sort for `TESTINFO` lines [201] + o schannel: ignore error on recv beyond close notify [167] + o schannel: reclassify extra-verbose schannel_recv messages [153] + o select: use poll() if existing, avoid poll() with no sockets [75] + o sendf: add condition to max-filesize check [3] + o server/mqttd: fix two memory leaks [178] + o setopt: avoid superfluous length checks before strcmp() [105] + o setopt: return error for bad input to CURLOPT_RTSP_REQUEST [240] + o setopt_cptr: make overflow check only done when needed [241] + o singleuse: make `git grep` faster, add Apple `nm` support [109] + o smb: do not redefine `getpid` on Windows [187] + o smb: replace use of strcpy() with snprintf() [122] + o socks_gssapi: switch to dynbuf from buffer with strcpy [42] + o source: avoid use of 'very' in comments + o src/lib: remove redundant ternary operators [244] + o src: guard for double declaration of `curl_ca_embed` in unity builds [166] + o sws: fix unused static function with `TCP_NODELAY` undefined [134] + o telnet: avoid two strcpy() by pointing to the strings instead [99] + o test1035: convert host name back to utf8 as should be [63] + o test1515: add tracing and more debug info [119] + o test1540: add debug logging [58] + o test190: replace %FTPTIME2 with a fixed value [34] + o test1915: add tracing and connect timeout [114] + o test1915: remove wrong comment + o test2502: add libtest debug tracing [60] + o test504: fix handling on pending connect [59] + o testrun: explicitly set proper IP address for stunnel listen/connect [61] + o tests/http: fix ubuntu GnuTLS CI failures [161] + o tests/scorecard: allow remote server test [171] + o tests/server/util.c: remove use of strncpy [156] + o tests/valgrind.pm: fix warnings with no valgrind report to show [25] + o tests/valgrind.supp: remove a travis suppression, add a Debian [116] + o tests: add and use `%PERL` variable to refer to the Perl binary [82] + o tests: add codeset-utf8 as a feature [66] + o tests: add file: tests with existing files [45] + o tests: allow pytests to run in out-of-tree builds [192] + o tests: capture stdin to get the vsftpd version number [165] + o tests: change Python code style to pass ruff checks + o tests: check http/2 and http/3 server responsiveness [28] + o tests: delete duplicate macro check [53] + o tests: enable additional ruff Python lint options + o tests: fix `%POSIX_PWD` on native Windows Perl [111] + o tests: fix callback signatures to please UndefinedBehaviorSanitizer [173] + o tests: Fix FILEFORMAT directive [206] + o tests: fix keyword for test1411 + o tests: fix shell quoting on native Windows Perl [110] + o tests: fix some Python typing issues + o tests: fixup `checkcmd` `PATH` on non-unixy platforms [108] + o tests: improve mqtt server handling [27] + o tests: introduce %CLIENT6IP-NB [67] + o tests: let openssl generate random cert serials [91] + o tests: libtests and unit tests need explicit #include memdebug [7] + o tests: make precheck for HTTP on 127.0.0.1 into a feature [68] + o tests: Only log warnings or worse by default in smbserver [33] + o tests: postcheck is now in verify [69] + o tests: remove all valgrind disable instructions [21] + o tests: remove debug requirement on 38 tests [100] + o tests: remove the %FTPTIME3 variable [41] + o tests: replace `%PWD` with `%FILE_PWD` for `file://` [84] + o tests: replace `%PWD` with `%SSH_PWD` in SCP/SFTP tests [112] + o tests: replace hard-coded `/dev/null` with variable [81] + o tests: simplify `pathhelp.pm`, avoid using external tools [95] + o tests: speed up builds with single-binary test bundles [29] + o tests: testrunner fairness [39] + o tests: testrunner reliability improvements [55] + o tests: use '-4' where needed [17] + o tftp: avoid two memcpy/strcpy [94] + o tidy-up: rename CURL_WINDOWS_APP to CURL_WINDOWS_UWP [36] + o tls: avoid abusing CURLE_SSL_ENGINE_INITFAILED [246] + o tool: support --show-headers AND --remote-header-name [103] + o tool_doswin: simplify; remove unused options and strncpy calls [65] + o tool_getparam: drop unused time() call [177] + o tool_getparam: replace two uses of strncpy(), ban strncpy [157] + o tool_operate: make --skip-existing work for --parallel [180] + o tool_operate: reuse the schannel backend check [130] + o tool_xattr: create the user.creator xattr attribute [197] + o unit1660: fix unreachable code warning in no-SSL builds [30] + o url: connection reuse on h3 connections [20] + o url: use same credentials on redirect [181] + o urlapi: drop unused header [51] + o urlapi: normalize the IPv6 address [115] + o version: minor cleanups [152] + o version: say quictls in MSH3 builds [219] + o vquic: fix compiler warning with gcc + MUSL [168] + o vtls: convert Curl_pin_peer_pubkey to use dynbuf [74] + o vtls: convert pubkey_pem_to_der to use dynbuf [90] + o warnless: remove curlx_sktosi and curlx_sitosk [104] + o winbuild/README: consolidate command prompt section [193] + o winbuild/README: document how to clean a build [163] + o winbuild: add initial wolfSSL support [227] + o wolfssl: convert malloc + memcpys to dynbuf for cipher string [96] + o wolfSSL: fix handling of TLSv1.3 sessions [185] + o wolfssl: use old version API without openssl extra [160] This release includes the following known bugs: - o see docs/KNOWN_BUGS (https://curl.se/docs/knownbugs.html) + See docs/KNOWN_BUGS (https://curl.se/docs/knownbugs.html) + +For all changes ever done in curl: + + See https://curl.se/changes.html Planned upcoming removals include: - o support for space-separated NOPROXY patterns + o Hyper support + o TLS libraries not supporting TLS 1.3 See https://curl.se/dev/deprecate.html for details This release would not have looked like this without help, code, reports and advice from friends like these: - 5533asdg on github, Andreas Kiefer, av223119 on github, Boris Verkhovskiy, - Brett Buddin, Chris Webb, Dan Fandrich, Daniel Gustafsson, Daniel Stenberg, - Daniel Szmulewicz, dependabot[bot], Dirk Hünniger, Dmitry Karpov, - Dmitry Tretyakov, edmcln on github, Erik Schnetter, Evgeny Grin (Karlson2k), - Fabian Vogt, Fabrice Fontaine, Faraz Fallahi, Gisle Vanem, Harry Sintonen, - HsiehYuho on github, Jan Macku, Jiawen Geng, Joel Depooter, Jon Rumsey, - Jordan Brown, Karthikdasari0423, Konstantin Vlasov, kpcyrd, - Lars Kellogg-Stedman, LeeRiva, Louis Solofrizzo, Lukáš Zaoral, Marcel Raad, - Michael Forney, Michael Kaufmann, Michał Antoniak, Nikita Taranov, - Patrick Monnerat, Paweł Witas, Peter Krefting, RainRat, Ramiro Garcia, - Ray Satiro, Richard Levitte, Robert Moreton, Rudi Heitbaum, - Ryan Carsten Schmidt, Scott Mutter, Scott Talbert, Sebastian Neubauer, - Sergey Bronnikov, Simon K, Stefan Eissing, Tal Regev, Viktor Szakats, - vulnerabilityspotter on hackerone - (59 contributors) + ad-chaos on github, Aki Sakurai, Baruch Siach, Chris Stubbs, Colton Willey, + Dan Fandrich, Daniel Stenberg, Denis Goleshchikhin, Deniz Sökmen, + dependabot[bot], Dylam De La Torre, Emanuel Komínek, Gabriel Marin, + Ian Spence, jkamp-aws on github, John Haugabook, Jon Rumsey, Kai Pastor, + Kazuho Oku, lomberd2 on github, MacKenzie, Marwan Yassini, Max Dymond, + Michael Kaufmann, Montg0mery on github, Moritz Knüsel, Nemos2024 on github, + newfunction, Nicolas George, Pavel Kropachev, Pierre-Etienne Meunier, + ralfjunker on github, Rasmus Melchior Jacobsen, Ray Satiro, renovate[bot], + Robert Maynard, Sebastian Walz, Sinkevich Artem, Stefan Eissing, Tal Regev, + Tatsuhiro Tsujikawa, Tobias Bora, Tobias Wendorff, Venkat Krishna R, + Viktor Szakats, Vollstrecker on github, vvb2060 on github, Yedaya Katsman, + zjyhjqs + (49 contributors) References to bug reports and discussions on issues: - [1] = https://curl.se/bug/?i=12836 - [2] = https://curl.se/bug/?i=12825 - [3] = https://curl.se/bug/?i=12834 - [4] = https://curl.se/bug/?i=12822 - [5] = https://curl.se/bug/?i=12829 - [6] = https://curl.se/bug/?i=12867 - [7] = https://curl.se/bug/?i=12833 - [8] = https://curl.se/bug/?i=12861 - [9] = https://curl.se/bug/?i=12866 - [10] = https://curl.se/bug/?i=12849 - [11] = https://curl.se/bug/?i=12854 - [12] = https://curl.se/bug/?i=12828 - [13] = https://curl.se/bug/?i=12868 - [14] = https://curl.se/bug/?i=12852 - [15] = https://curl.se/bug/?i=12856 - [16] = https://curl.se/bug/?i=12832 - [17] = https://curl.se/bug/?i=12858 - [18] = https://curl.se/mail/lib-2024-02/0000.html - [19] = https://curl.se/bug/?i=12823 - [20] = https://curl.se/bug/?i=12826 - [21] = https://curl.se/bug/?i=13034 - [22] = https://curl.se/bug/?i=12937 - [23] = https://curl.se/bug/?i=12750 - [24] = https://curl.se/bug/?i=12719 - [25] = https://curl.se/bug/?i=12900 - [26] = https://curl.se/bug/?i=12900 - [27] = https://curl.se/bug/?i=12904 - [28] = https://curl.se/bug/?i=12901 - [29] = https://curl.se/bug/?i=12914 - [30] = https://curl.se/bug/?i=12805 - [31] = https://curl.se/bug/?i=12909 - [32] = https://curl.se/bug/?i=12878 - [33] = https://curl.se/bug/?i=12902 - [34] = https://curl.se/bug/?i=12896 - [35] = https://curl.se/bug/?i=12892 - [36] = https://curl.se/bug/?i=12926 - [37] = https://curl.se/bug/?i=12891 - [38] = https://curl.se/bug/?i=12890 - [39] = https://curl.se/bug/?i=12885 - [40] = https://curl.se/mail/archive-2024-02/0008.html - [41] = https://curl.se/bug/?i=12889 - [42] = https://curl.se/bug/?i=12846 - [43] = https://curl.se/bug/?i=12924 - [44] = https://curl.se/mail/archive-2024-01/0022.html - [45] = https://curl.se/bug/?i=12884 - [46] = https://curl.se/bug/?i=12888 - [47] = https://curl.se/bug/?i=12879 - [48] = https://curl.se/bug/?i=12877 - [49] = https://curl.se/bug/?i=13020 - [50] = https://curl.se/bug/?i=12838 - [51] = https://curl.se/bug/?i=12859 - [52] = https://curl.se/mail/archive-2024-02/0004.html - [53] = https://curl.se/bug/?i=12920 - [54] = https://curl.se/bug/?i=12869 - [55] = https://curl.se/bug/?i=12831 - [56] = https://curl.se/bug/?i=12911 - [57] = https://curl.se/bug/?i=12894 - [58] = https://curl.se/bug/?i=12996 - [59] = https://curl.se/bug/?i=12905 - [60] = https://curl.se/bug/?i=12903 - [61] = https://curl.se/bug/?i=12411 - [62] = https://curl.se/bug/?i=12945 - [63] = https://curl.se/bug/?i=12995 - [64] = https://curl.se/bug/?i=12921 - [65] = https://curl.se/bug/?i=12933 - [66] = https://curl.se/bug/?i=12965 - [67] = https://curl.se/bug/?i=12962 - [68] = https://curl.se/bug/?i=13027 - [69] = https://curl.se/bug/?i=12949 - [70] = https://curl.se/bug/?i=12880 - [71] = https://curl.se/bug/?i=12880 - [72] = https://curl.se/bug/?i=12948 - [73] = https://curl.se/bug/?i=12989 - [74] = https://curl.se/bug/?i=12990 - [75] = https://curl.se/bug/?i=12983 - [76] = https://curl.se/bug/?i=12981 - [77] = https://curl.se/bug/?i=12944 - [78] = https://curl.se/bug/?i=12977 - [79] = https://curl.se/bug/?i=12947 - [80] = https://curl.se/bug/?i=13015 - [81] = https://curl.se/bug/?i=12971 - [82] = https://curl.se/bug/?i=13052 - [83] = https://curl.se/bug/?i=13022 - [84] = https://curl.se/bug/?i=13019 - [85] = https://curl.se/bug/?i=12906 - [86] = https://curl.se/bug/?i=13045 - [87] = https://curl.se/bug/?i=13008 - [88] = https://curl.se/bug/?i=13065 - [89] = https://curl.se/bug/?i=12997 - [90] = https://curl.se/bug/?i=13006 - [91] = https://curl.se/bug/?i=13048 - [92] = https://curl.se/bug/?i=13026 - [93] = https://curl.se/bug/?i=13043 - [94] = https://curl.se/bug/?i=13044 - [95] = https://curl.se/bug/?i=13041 - [96] = https://curl.se/bug/?i=13046 - [97] = https://curl.se/bug/?i=13003 - [98] = https://curl.se/bug/?i=13075 - [99] = https://curl.se/bug/?i=13004 - [100] = https://curl.se/bug/?i=12998 - [101] = https://curl.se/bug/?i=12964 - [102] = https://curl.se/bug/?i=12992 - [103] = https://curl.se/bug/?i=13001 - [104] = https://curl.se/bug/?i=12999 - [105] = https://curl.se/bug/?i=13040 - [106] = https://curl.se/bug/?i=13037 - [107] = https://curl.se/bug/?i=13033 - [108] = https://curl.se/bug/?i=13073 - [110] = https://curl.se/bug/?i=13070 - [111] = https://curl.se/bug/?i=13072 - [112] = https://curl.se/bug/?i=13028 - [113] = https://curl.se/bug/?i=13054 - [114] = https://curl.se/bug/?i=13074 - [115] = https://curl.se/bug/?i=6169 - [116] = https://curl.se/bug/?i=13063 - [117] = https://curl.se/bug/?i=13061 - [119] = https://curl.se/bug/?i=13031 - [120] = https://curl.se/bug/?i=13047 - [121] = https://curl.se/bug/?i=13047 - [122] = https://curl.se/bug/?i=13035 - [124] = https://curl.se/bug/?i=13055 - [125] = https://curl.se/mail/lib-2024-03/0001.html - [126] = https://curl.se/bug/?i=13039 + [1] = https://curl.se/bug/?i=14938 + [2] = https://curl.se/bug/?i=14942 + [3] = https://curl.se/bug/?i=14958 + [4] = https://curl.se/bug/?i=14941 + [5] = https://curl.se/bug/?i=14818 + [6] = https://curl.se/bug/?i=14728 + [7] = https://curl.se/bug/?i=15007 + [8] = https://curl.se/bug/?i=14824 + [9] = https://curl.se/bug/?i=14991 + [10] = https://curl.se/bug/?i=15063 + [11] = https://curl.se/bug/?i=14883 + [12] = https://curl.se/bug/?i=14789 + [13] = https://curl.se/bug/?i=14658 + [14] = https://curl.se/bug/?i=15003 + [15] = https://curl.se/bug/?i=14815 + [16] = https://curl.se/bug/?i=14906 + [17] = https://curl.se/bug/?i=15060 + [18] = https://curl.se/bug/?i=14843 + [19] = https://curl.se/bug/?i=14966 + [20] = https://curl.se/bug/?i=14890 + [21] = https://curl.se/bug/?i=14983 + [22] = https://curl.se/bug/?i=14984 + [23] = https://curl.se/bug/?i=14982 + [24] = https://curl.se/bug/?i=14981 + [25] = https://curl.se/bug/?i=14977 + [26] = https://curl.se/bug/?i=14582 + [27] = https://curl.se/bug/?i=15059 + [28] = https://curl.se/bug/?i=15058 + [29] = https://curl.se/bug/?i=14772 + [30] = https://curl.se/bug/?i=14971 + [31] = https://curl.se/bug/?i=14765 + [32] = https://curl.se/bug/?i=14932 + [33] = https://curl.se/bug/?i=14950 + [34] = https://curl.se/bug/?i=15056 + [35] = https://curl.se/bug/?i=14969 + [36] = https://curl.se/bug/?i=14881 + [37] = https://curl.se/bug/?i=14763 + [38] = https://curl.se/bug/?i=14690 + [39] = https://curl.se/bug/?i=14967 + [40] = https://github.com/curl/curl-for-win/blob/8b8909e1206de1dcca356a8dd33eb1e4ffeea7fd/curl.sh#L289 + [41] = https://curl.se/bug/?i=15064 + [42] = https://curl.se/bug/?i=15057 + [43] = https://curl.se/bug/?i=14909 + [44] = https://curl.se/bug/?i=14828 + [45] = https://curl.se/bug/?i=15045 + [46] = https://curl.se/bug/?i=14921 + [47] = https://curl.se/bug/?i=14921 + [48] = https://curl.se/bug/?i=15123 + [49] = https://curl.se/bug/?i=14924 + [50] = https://curl.se/bug/?i=14918 + [51] = https://curl.se/bug/?i=14867 + [52] = https://curl.se/bug/?i=14959 + [53] = https://curl.se/bug/?i=14963 + [54] = https://curl.se/bug/?i=14961 + [55] = https://curl.se/bug/?i=14960 + [56] = https://curl.se/bug/?i=14912 + [57] = https://curl.se/bug/?i=15049 + [58] = https://curl.se/bug/?i=15055 + [59] = https://curl.se/bug/?i=15054 + [60] = https://curl.se/bug/?i=15053 + [61] = https://curl.se/bug/?i=15051 + [62] = https://curl.se/bug/?i=15044 + [63] = https://curl.se/bug/?i=15050 + [64] = https://curl.se/bug/?i=15052 + [65] = https://curl.se/bug/?i=15047 + [66] = https://curl.se/bug/?i=15039 + [67] = https://curl.se/bug/?i=15039 + [68] = https://curl.se/bug/?i=15039 + [69] = https://curl.se/bug/?i=15046 + [70] = https://curl.se/bug/?i=15013 + [71] = https://curl.se/bug/?i=15034 + [72] = https://curl.se/bug/?i=15035 + [73] = https://curl.se/bug/?i=14845 + [74] = https://curl.se/bug/?i=15126 + [75] = https://curl.se/bug/?i=15096 + [76] = https://curl.se/bug/?i=15101 + [77] = https://curl.se/bug/?i=14990 + [78] = https://curl.se/bug/?i=15033 + [79] = https://curl.se/bug/?i=15026 + [80] = https://curl.se/bug/?i=15028 + [81] = https://curl.se/bug/?i=15098 + [82] = https://curl.se/bug/?i=15097 + [83] = https://curl.se/bug/?i=15027 + [84] = https://curl.se/bug/?i=15090 + [85] = https://curl.se/bug/?i=15012 + [86] = https://curl.se/bug/?i=15088 + [87] = https://curl.se/bug/?i=15087 + [88] = https://curl.se/bug/?i=15001 + [89] = https://curl.se/bug/?i=15197 + [90] = https://curl.se/bug/?i=15126 + [91] = https://curl.se/bug/?i=15129 + [92] = https://curl.se/bug/?i=15200 + [93] = https://curl.se/bug/?i=14880 + [94] = https://curl.se/bug/?i=15199 + [95] = https://curl.se/bug/?i=15111 + [96] = https://curl.se/bug/?i=15124 + [97] = https://curl.se/bug/?i=15122 + [98] = https://curl.se/bug/?i=15100 + [99] = https://curl.se/bug/?i=15198 + [100] = https://curl.se/bug/?i=15114 + [101] = https://curl.se/bug/?i=15075 + [102] = https://curl.se/bug/?i=15077 + [103] = https://curl.se/bug/?i=15110 + [104] = https://curl.se/bug/?i=15153 + [105] = https://curl.se/bug/?i=15192 + [106] = https://curl.se/bug/?i=14936 + [107] = https://curl.se/bug/?i=15148 + [108] = https://curl.se/bug/?i=15106 + [109] = https://curl.se/bug/?i=15070 + [110] = https://curl.se/bug/?i=15105 + [111] = https://curl.se/bug/?i=15104 + [112] = https://curl.se/bug/?i=15103 + [113] = https://curl.se/bug/?i=15145 + [114] = https://curl.se/bug/?i=15107 + [115] = https://curl.se/bug/?i=15143 + [116] = https://curl.se/bug/?i=15142 + [117] = https://curl.se/bug/?i=15137 + [118] = https://curl.se/bug/?i=15138 + [119] = https://curl.se/bug/?i=15140 + [120] = https://curl.se/bug/?i=15194 + [121] = https://curl.se/bug/?i=15136 + [122] = https://curl.se/bug/?i=15196 + [123] = https://curl.se/bug/?i=15281 + [124] = https://curl.se/bug/?i=15191 + [125] = https://curl.se/bug/?i=15190 + [126] = https://curl.se/bug/?i=15177 + [127] = https://curl.se/bug/?i=15176 + [128] = https://curl.se/bug/?i=15181 + [129] = https://curl.se/bug/?i=15185 + [130] = https://curl.se/bug/?i=15323 + [131] = https://curl.se/bug/?i=15174 + [132] = https://curl.se/bug/?i=15172 + [133] = https://curl.se/bug/?i=15173 + [134] = https://curl.se/bug/?i=15171 + [135] = https://curl.se/bug/?i=15170 + [136] = https://curl.se/bug/?i=15169 + [137] = https://curl.se/bug/?i=15167 + [138] = https://curl.se/bug/?i=15248 + [139] = https://curl.se/bug/?i=15163 + [140] = https://curl.se/bug/?i=15211 + [141] = https://curl.se/bug/?i=15260 + [142] = https://curl.se/bug/?i=15247 + [143] = https://curl.se/bug/?i=15157 + [144] = https://curl.se/bug/?i=15255 + [145] = https://curl.se/bug/?i=15324 + [146] = https://curl.se/bug/?i=15252 + [147] = https://curl.se/bug/?i=15316 + [148] = https://curl.se/bug/?i=15258 + [149] = https://curl.se/bug/?i=15193 + [150] = https://curl.se/bug/?i=15452 + [151] = https://curl.se/bug/?i=15321 + [152] = https://curl.se/bug/?i=15393 + [153] = https://curl.se/bug/?i=14826 + [154] = https://curl.se/bug/?i=15319 + [155] = https://curl.se/bug/?i=15214 + [156] = https://curl.se/bug/?i=15213 + [157] = https://curl.se/bug/?i=15212 + [158] = https://curl.se/bug/?i=15210 + [159] = https://curl.se/bug/?i=15201 + [160] = https://curl.se/bug/?i=15205 + [161] = https://curl.se/bug/?i=15310 + [162] = https://curl.se/bug/?i=15348 + [163] = https://curl.se/bug/?i=15291 + [164] = https://curl.se/bug/?i=15348 + [165] = https://curl.se/bug/?i=15278 + [166] = https://curl.se/bug/?i=15307 + [167] = https://curl.se/bug/?i=15381 + [168] = https://curl.se/bug/?i=15303 + [169] = https://curl.se/bug/?i=15285 + [170] = https://curl.se/bug/?i=15285 + [171] = https://curl.se/bug/?i=15415 + [172] = https://curl.se/bug/?i=15451 + [173] = https://curl.se/bug/?i=15289 + [174] = https://curl.se/bug/?i=15289 + [175] = https://curl.se/bug/?i=15289 + [176] = https://curl.se/bug/?i=15292 + [177] = https://curl.se/bug/?i=15420 + [178] = https://curl.se/bug/?i=15290 + [179] = https://curl.se/bug/?i=15351 + [180] = https://curl.se/bug/?i=15261 + [181] = https://curl.se/bug/?i=15262 + [182] = https://curl.se/bug/?i=15284 + [183] = https://curl.se/bug/?i=14798 + [184] = https://curl.se/bug/?i=15245 + [185] = https://curl.se/bug/?i=15243 + [186] = https://curl.se/bug/?i=15175 + [187] = https://curl.se/bug/?i=15263 + [188] = https://curl.se/bug/?i=15275 + [189] = https://curl.se/bug/?i=15279 + [190] = https://curl.se/bug/?i=15384 + [191] = https://curl.se/bug/?i=15271 + [192] = https://curl.se/bug/?i=15257 + [193] = https://curl.se/bug/?i=15313 + [194] = https://curl.se/bug/?i=15414 + [195] = https://curl.se/bug/?i=15416 + [196] = https://curl.se/bug/?i=15265 + [197] = https://curl.se/bug/?i=15237 + [198] = https://curl.se/bug/?i=15164 + [199] = https://curl.se/bug/?i=15266 + [200] = https://curl.se/bug/?i=15418 + [201] = https://curl.se/bug/?i=15374 + [202] = https://curl.se/bug/?i=15419 + [203] = https://curl.se/bug/?i=15417 + [204] = https://curl.se/bug/?i=15372 + [205] = https://curl.se/bug/?i=15411 + [206] = https://curl.se/bug/?i=15371 + [207] = https://curl.se/bug/?i=15409 + [208] = https://curl.se/bug/?i=14885 + [209] = https://curl.se/bug/?i=15368 + [210] = https://curl.se/bug/?i=15367 + [211] = https://curl.se/bug/?i=15331 + [212] = https://curl.se/bug/?i=15407 + [213] = https://curl.se/bug/?i=15400 + [214] = https://curl.se/bug/?i=15353 + [215] = https://curl.se/bug/?i=15404 + [217] = https://curl.se/bug/?i=15403 + [218] = https://curl.se/bug/?i=15337 + [219] = https://curl.se/bug/?i=15335 + [220] = https://curl.se/bug/?i=15144 + [221] = https://curl.se/bug/?i=15340 + [222] = https://curl.se/bug/?i=15342 + [223] = https://curl.se/bug/?i=15399 + [224] = https://curl.se/bug/?i=15339 + [225] = https://curl.se/bug/?i=15394 + [226] = https://curl.se/bug/?i=15315 + [227] = https://curl.se/bug/?i=15264 + [228] = https://curl.se/bug/?i=15405 + [229] = https://curl.se/bug/?i=15330 + [230] = https://curl.se/bug/?i=15402 + [231] = https://curl.se/bug/?i=15358 + [232] = https://curl.se/bug/?i=15392 + [233] = https://curl.se/bug/?i=15395 + [234] = https://curl.se/bug/?i=15398 + [235] = https://curl.se/bug/?i=15445 + [236] = https://curl.se/bug/?i=15443 + [240] = https://curl.se/bug/?i=15440 + [241] = https://curl.se/bug/?i=15439 + [243] = https://curl.se/bug/?i=15436 + [244] = https://curl.se/bug/?i=15435 + [245] = https://curl.se/bug/?i=15434 + [246] = https://curl.se/bug/?i=15430 diff --git a/deps/curl/REUSE.toml b/deps/curl/REUSE.toml new file mode 100644 index 00000000..e242452d --- /dev/null +++ b/deps/curl/REUSE.toml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: curl +# SPDX-FileCopyrightText: Daniel Stenberg, , et al. + +# This file describes the licensing and copyright situation for files that +# cannot be annotated directly, for example because of being simply +# uncommentable. Unless this is the case, a file should be annotated directly. +# +# This follows the REUSE specification: https://reuse.software/spec-3.2/#reusetoml + +version = 1 +SPDX-PackageName = "curl" +SPDX-PackageDownloadLocation = "https://curl.se/" + +[[annotations]] +path = [ + ".mailmap", + "docs/FAQ", + "docs/INSTALL", + "docs/KNOWN_BUGS", + "docs/libcurl/symbols-in-versions", + "docs/MAIL-ETIQUETTE", + "docs/options-in-versions", + "docs/THANKS", + "docs/TODO", + "GIT-INFO.md", + "lib/libcurl.vers.in", + "lib/libcurl.def", + "packages/OS400/README.OS400", + "packages/vms/build_vms.com", + "packages/vms/curl_release_note_start.txt", + "packages/vms/curlmsg.sdl", + "packages/vms/macro32_exactcase.patch", + "packages/vms/readme", + "plan9/README", + "projects/Windows/**", "projects/wolfssl_override.props", + "README", + "RELEASE-NOTES", + "renovate.json", + "tests/certs/**", + "tests/data/test**", + "tests/stunnel.pem", + "tests/valgrind.supp", + # checksrc control files + "docs/examples/.checksrc", + "lib/.checksrc", + "lib/vauth/.checksrc", + "lib/vquic/.checksrc", + "lib/vssh/.checksrc", + "lib/vtls/.checksrc", + "src/.checksrc", + "tests/libtest/.checksrc", + "tests/server/.checksrc", +] +SPDX-FileCopyrightText = "Daniel Stenberg, , et al." +SPDX-License-Identifier = "curl" +# If there is licensing/copyright information in or next to these files, prefer that +precedence = "closest" diff --git a/deps/curl/SECURITY.md b/deps/curl/SECURITY.md index dbce1b52..64e0d2fe 100644 --- a/deps/curl/SECURITY.md +++ b/deps/curl/SECURITY.md @@ -14,3 +14,16 @@ If you have found or just suspect a security problem somewhere in curl or libcurl, report it on [HackerOne](https://hackerone.com/curl). We treat security issues with confidentiality until controlled and disclosed responsibly. + +## OpenSSF Best Practices + +curl has achieved Gold status on the Open Source Security Foundation (OpenSSF) +[Best Practices](https://bestpractices.dev/) (formerly Core Infrastructure +Initiative Best Practices), reflecting its adherence to rigorous +security and best practice standards. This achievement highlights curl's +comprehensive documentation, secure development processes, effective change +control mechanisms, and strong maintenance routines. Meeting these criteria +demonstrates curl's commitment to security and reliability, ensuring the +project's sustainability and trustworthiness. This underscores curl's role as +a leader in open-source software practices. More information can be found on +[curl's OpenSSF Best Practices project page](https://www.bestpractices.dev/projects/63). diff --git a/deps/curl/acinclude.m4 b/deps/curl/acinclude.m4 index a44ae350..0c17ba5e 100644 --- a/deps/curl/acinclude.m4 +++ b/deps/curl/acinclude.m4 @@ -49,9 +49,9 @@ AC_DEFUN([CURL_CHECK_DEF], [ AC_PREPROC_IFELSE([ AC_LANG_SOURCE( ifelse($2,,,[$2])[[ -#ifdef $1 -CURL_DEF_TOKEN $1 -#endif + #ifdef $1 + CURL_DEF_TOKEN $1 + #endif ]]) ],[ tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ @@ -89,14 +89,14 @@ AC_DEFUN([CURL_CHECK_DEF_CC], [ AC_COMPILE_IFELSE([ AC_LANG_SOURCE( ifelse($2,,,[$2])[[ -int main (void) -{ -#ifdef $1 - return 0; -#else - force compilation error -#endif -} + int main(void) + { + #ifdef $1 + return 0; + #else + #error force compilation error + #endif + } ]]) ],[ tst_symbol_defined="yes" @@ -123,16 +123,16 @@ AC_DEFUN([CURL_CHECK_LIB_XNET], [ tst_lib_xnet_required="no" AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ -int main (void) -{ -#if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) - return 0; -#elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) - return 0; -#else - force compilation error -#endif -} + int main(void) + { + #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) + return 0; + #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) + return 0; + #else + #error force compilation error + #endif + } ]]) ],[ tst_lib_xnet_required="yes" @@ -179,11 +179,11 @@ AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ -#ifdef _WIN32 - int dummy=1; -#else - Not a native Windows build target. -#endif + #ifdef _WIN32 + int dummy=1; + #else + #error Not a native Windows build target. + #endif ]]) ],[ curl_cv_native_windows="yes" @@ -205,21 +205,21 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [ AC_CACHE_CHECK([for lber.h], [curl_cv_header_lber_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #include ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); @@ -237,24 +237,24 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [ # AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #include ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); @@ -285,24 +285,24 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP], [ AC_CACHE_CHECK([for ldap.h], [curl_cv_header_ldap_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #include ]],[[ LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); int res = ldap_unbind(ldp); @@ -331,27 +331,27 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [ AC_CACHE_CHECK([for ldap_ssl.h], [curl_cv_header_ldap_ssl_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif + #include ]],[[ LDAP *ldp = ldapssl_init("0.0.0.0", LDAPS_PORT, 1); ]]) @@ -416,17 +416,17 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [ fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#ifdef HAVE_WINBER_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include + #ifdef HAVE_WINBER_H + #include + #endif + #endif ]],[[ BERVAL *bvp = NULL; BerElement *bep = ber_init(bvp); @@ -504,7 +504,7 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ '-llber -lldap' \ '-lldapssl -lldapx -lldapsdk' \ '-lldapsdk -lldapx -lldapssl' \ - '-lldap -llber -lssl -lcrypto' ; do + '-lldap -llber -lssl -lcrypto'; do if test "$curl_cv_ldap_LIBS" = "unknown"; then if test -z "$x_nlibs"; then @@ -514,29 +514,29 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); @@ -565,6 +565,7 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ else LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" fi + LIBCURL_PC_REQUIRES_PRIVATE="ldap $LIBCURL_PC_REQUIRES_PRIVATE" AC_MSG_RESULT([$curl_cv_ldap_LIBS]) ;; esac @@ -580,29 +581,29 @@ dnl hosts have it, but AIX 4.3 is one known exception. AC_DEFUN([TYPE_SOCKADDR_STORAGE], [ AC_CHECK_TYPE([struct sockaddr_storage], - AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, - [if struct sockaddr_storage is defined]), , + AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, + [if struct sockaddr_storage is defined]), , [ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #endif ]) ]) @@ -618,21 +619,21 @@ AC_DEFUN([CURL_CHECK_FUNC_RECV], [ AC_MSG_CHECKING([for recv]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -$curl_includes_bsdsocket -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + $curl_includes_bsdsocket + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #endif ]],[[ recv(0, 0, 0, 0); ]]) @@ -645,9 +646,9 @@ $curl_includes_bsdsocket ]) # if test "$curl_cv_recv" = "yes"; then - AC_DEFINE_UNQUOTED(HAVE_RECV, 1, - [Define to 1 if you have the recv function.]) - curl_cv_func_recv="yes" + AC_DEFINE_UNQUOTED(HAVE_RECV, 1, + [Define to 1 if you have the recv function.]) + curl_cv_func_recv="yes" else AC_MSG_ERROR([Unable to link function recv]) fi @@ -666,21 +667,21 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [ AC_MSG_CHECKING([for send]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -$curl_includes_bsdsocket -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + $curl_includes_bsdsocket + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #endif ]],[[ send(0, 0, 0, 0); ]]) @@ -710,20 +711,20 @@ AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [ AC_CACHE_CHECK([for MSG_NOSIGNAL], [curl_cv_msg_nosignal], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #endif ]],[[ int flag=MSG_NOSIGNAL; ]]) @@ -752,23 +753,23 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ AC_CACHE_CHECK([for struct timeval], [curl_cv_struct_timeval], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_TIME_H + #include + #endif + #include + #ifdef HAVE_SYS_SOCKET_H + #include + #endif ]],[[ struct timeval ts; ts.tv_sec = 0; @@ -804,26 +805,26 @@ AC_DEFUN([TYPE_IN_ADDR_T], [ if test "$curl_cv_in_addr_t_equiv" = "unknown"; then AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #endif ]],[[ $t data = inet_addr ("1.2.3.4"); ]]) @@ -843,26 +844,26 @@ AC_DEFUN([TYPE_IN_ADDR_T], [ ;; esac ],[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #endif ]) ]) @@ -878,13 +879,13 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ if test "x$dontwant_rt" = "xno" ; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_TIME_H + #include + #endif + #include ]],[[ struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); @@ -912,13 +913,13 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [ if test "x$dontwant_rt" = "xno" ; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_TIME_H + #include + #endif + #include ]],[[ struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts); @@ -958,13 +959,13 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_TIME_H + #include + #endif + #include ]],[[ struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); @@ -1004,14 +1005,14 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ AC_MSG_CHECKING([if monotonic clock_gettime works]) CURL_RUN_IFELSE([ AC_LANG_PROGRAM([[ -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include + #include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_TIME_H + #include + #endif + #include ]],[[ struct timespec ts; if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) @@ -1089,26 +1090,6 @@ AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [ ]) -dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE]) -dnl ------------------------------------------------- -dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor -dnl symbol that can be further used in custom template configuration -dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third -dnl argument for the description. Symbol definitions done with this -dnl macro are intended to be exclusively used in handcrafted *.h.in -dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one -dnl prevents autoheader generation and insertion of symbol template -dnl stub and definition into the first configuration header file. Do -dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each -dnl one serves different functional needs. - -AC_DEFUN([CURL_DEFINE_UNQUOTED], [ -cat >>confdefs.h <<_EOF -[@%:@define] $1 ifelse($#, 2, [$2], 1) -_EOF -]) - - dnl CURL_CHECK_FUNC_SELECT dnl ------------------------------------------------- dnl Test if the socket select() function is available. @@ -1121,31 +1102,31 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ AC_MSG_CHECKING([for select]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -#ifndef _WIN32 -#ifdef HAVE_SYS_SELECT_H -#include -#elif defined(HAVE_UNISTD_H) -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -$curl_includes_bsdsocket -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_TIME_H + #include + #endif + #include + #ifndef _WIN32 + #ifdef HAVE_SYS_SELECT_H + #include + #elif defined(HAVE_UNISTD_H) + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + $curl_includes_bsdsocket + #endif ]],[[ select(0, 0, 0, 0, 0); ]]) @@ -1184,11 +1165,11 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [ dnl point also is available run-time! AC_MSG_CHECKING([run-time libs availability]) CURL_RUN_IFELSE([ -int main() -{ - return 0; -} -], + int main() + { + return 0; + } + ], 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]) @@ -1217,7 +1198,7 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [ AC_ARG_WITH(ca-bundle, AS_HELP_STRING([--with-ca-bundle=FILE], -[Path to a file containing CA certificates (example: /etc/ca-bundle.crt)]) + [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]), [ want_ca="$withval" @@ -1228,7 +1209,7 @@ AS_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), [ want_ca="unset" ]) AC_ARG_WITH(ca-path, AS_HELP_STRING([--with-ca-path=DIRECTORY], -[Path to a directory containing CA certificates stored individually, with \ + [Absolute path to a directory containing CA certificates stored individually, with \ 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)]) @@ -1256,24 +1237,19 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), capath="no" elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then dnl --with-ca-path given - if test "x$OPENSSL_ENABLED" != "x1" -a \ - "x$GNUTLS_ENABLED" != "x1" -a \ - "x$MBEDTLS_ENABLED" != "x1" -a \ - "x$WOLFSSL_ENABLED" != "x1"; then - AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS, mbedTLS or wolfSSL]) - fi capath="$want_capath" ca="no" else - dnl first try autodetecting a CA bundle , then a CA path - dnl both autodetections can be skipped by --without-ca-* + dnl First try auto-detecting a CA bundle, then a CA path. + dnl Both auto-detections can be skipped by --without-ca-* ca="no" capath="no" - if test "x$cross_compiling" != "xyes"; then + if test "x$cross_compiling" != "xyes" -a \ + "x$curl_cv_native_windows" != "xyes"; 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 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 @@ -1296,12 +1272,7 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), fi AC_MSG_NOTICE([want $want_capath ca $ca]) if test "x$want_capath" = "xunset"; then - if test "x$OPENSSL_ENABLED" = "x1" -o \ - "x$GNUTLS_ENABLED" = "x1" -o \ - "x$MBEDTLS_ENABLED" = "x1" -o \ - "x$WOLFSSL_ENABLED" = "x1"; then - check_capath="/etc/ssl/certs" - fi + check_capath="/etc/ssl/certs" fi else dnl no option given and cross-compiling @@ -1334,7 +1305,7 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), fi if test "x$ca" != "xno"; then - CURL_CA_BUNDLE='"'$ca'"' + CURL_CA_BUNDLE="$ca" AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle]) AC_SUBST(CURL_CA_BUNDLE) AC_MSG_RESULT([$ca]) @@ -1348,10 +1319,10 @@ AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), AC_MSG_RESULT([no]) fi - AC_MSG_CHECKING([whether to use builtin CA store of SSL library]) + AC_MSG_CHECKING([whether to use built-in CA store of SSL library]) AC_ARG_WITH(ca-fallback, -AS_HELP_STRING([--with-ca-fallback], [Use the built in CA store of the SSL library]) -AS_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the SSL library]), +AS_HELP_STRING([--with-ca-fallback], [Use the built-in CA store of the SSL library]) +AS_HELP_STRING([--without-ca-fallback], [Don't use the built-in CA store of the SSL library]), [ 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]) @@ -1363,28 +1334,59 @@ AS_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL or GnuTLS]) fi - AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built in CA store of SSL library ]) + AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built-in CA store of SSL library]) + fi +]) + + +dnl CURL_CHECK_CA_EMBED +dnl ------------------------------------------------- +dnl Check if a ca-bundle should be embedded + +AC_DEFUN([CURL_CHECK_CA_EMBED], [ + + AC_MSG_CHECKING([CA cert bundle path to embed in the curl tool]) + + 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]), + [ + want_ca_embed="$withval" + if test "x$want_ca_embed" = "xyes"; then + AC_MSG_ERROR([--with-ca-embed=FILE requires a path to the CA bundle]) + fi + ], + [ 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 + CURL_CA_EMBED="$want_ca_embed" + AC_SUBST(CURL_CA_EMBED) + AC_MSG_RESULT([$want_ca_embed]) + else + AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_WIN32_LARGEFILE dnl ------------------------------------------------- -dnl Check if curl's WIN32 large file will be used +dnl Check if curl's Win32 large file will be used AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl - AC_MSG_CHECKING([whether build target supports WIN32 file API]) + AC_MSG_CHECKING([whether build target supports Win32 file API]) curl_win32_file_api="no" if test "$curl_cv_native_windows" = "yes"; then if test x"$enable_largefile" != "xno"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ -#if !defined(_WIN32_WCE) && (defined(__MINGW32__) || defined(_MSC_VER)) - int dummy=1; -#else - WIN32 large file API not supported. -#endif + #if !defined(_WIN32_WCE) && (defined(__MINGW32__) || defined(_MSC_VER)) + int dummy=1; + #else + #error Win32 large file API not supported. + #endif ]]) ],[ curl_win32_file_api="win32_large_files" @@ -1394,11 +1396,11 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ -#if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER) - int dummy=1; -#else - WIN32 small file API not supported. -#endif + #if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER) + int dummy=1; + #else + #error Win32 small file API not supported. + #endif ]]) ],[ curl_win32_file_api="win32_small_files" @@ -1426,21 +1428,21 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ dnl CURL_CHECK_WIN32_CRYPTO dnl ------------------------------------------------- -dnl Check if curl's WIN32 crypto lib can be used +dnl Check if curl's Win32 crypto lib can be used AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl - AC_MSG_CHECKING([whether build target supports WIN32 crypto API]) + AC_MSG_CHECKING([whether build target supports Win32 crypto API]) curl_win32_crypto_api="no" if test "$curl_cv_native_windows" = "yes"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include + #undef inline + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include ]],[[ HCRYPTPROV hCryptProv; if(CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, @@ -1474,10 +1476,10 @@ dnl variable while checking PKG_CONFIG_LIBDIR dnl AC_DEFUN([CURL_EXPORT_PCDIR], [ - if test -n "$1"; then - PKG_CONFIG_LIBDIR="$1" - export PKG_CONFIG_LIBDIR - fi + if test -n "$1"; then + PKG_CONFIG_LIBDIR="$1" + export PKG_CONFIG_LIBDIR + fi ]) dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir]) @@ -1492,71 +1494,101 @@ dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir. dnl AC_DEFUN([CURL_CHECK_PKGCONFIG], [ - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], + [$PATH:/usr/bin:/usr/local/bin]) + fi + + if test "x$PKGCONFIG" != "xno"; then + AC_MSG_CHECKING([for $1 options with pkg-config]) + dnl ask pkg-config about $1 + itexists=`CURL_EXPORT_PCDIR([$2]) dnl + $PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + dnl pkg-config does not have info about the given module! set the + dnl variable to 'no' + PKGCONFIG="no" + AC_MSG_RESULT([no]) else - AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], - [$PATH:/usr/bin:/usr/local/bin]) - fi - - if test "x$PKGCONFIG" != "xno"; then - AC_MSG_CHECKING([for $1 options with pkg-config]) - dnl ask pkg-config about $1 - itexists=`CURL_EXPORT_PCDIR([$2]) dnl - $PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1` - - if test -z "$itexists"; then - dnl pkg-config does not have info about the given module! set the - dnl variable to 'no' - PKGCONFIG="no" - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([found]) - fi + AC_MSG_RESULT([found]) fi + fi ]) -dnl CURL_GENERATE_CONFIGUREHELP_PM +dnl CURL_PREPARE_CONFIGUREHELP_PM dnl ------------------------------------------------- -dnl Generate test harness configurehelp.pm module, defining and +dnl Prepare test harness configurehelp.pm module, defining and dnl initializing some perl variables with values which are known dnl when the configure script runs. For portability reasons, test dnl harness needs information on how to run the C preprocessor. -AC_DEFUN([CURL_GENERATE_CONFIGUREHELP_PM], [ +AC_DEFUN([CURL_PREPARE_CONFIGUREHELP_PM], [ AC_REQUIRE([AC_PROG_CPP])dnl tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null` if test -z "$tmp_cpp"; then tmp_cpp='cpp' fi - cat >./tests/configurehelp.pm <<_EOF -[@%:@] This is a generated file. Do not edit. - -package configurehelp; - -use strict; -use warnings; -use Exporter; - -use vars qw( - @ISA - @EXPORT_OK - \$Cpreprocessor - ); - -@ISA = qw(Exporter); - -@EXPORT_OK = qw( - \$Cpreprocessor - ); - -\$Cpreprocessor = '$tmp_cpp'; - -1; -_EOF + AC_SUBST(CURL_CPP, $tmp_cpp) ]) + +dnl CURL_PREPARE_BUILDINFO +dnl ------------------------------------------------- +dnl Save build info for test runner to pick up and log + +AC_DEFUN([CURL_PREPARE_BUILDINFO], [ + curl_pflags="" + case $host in + *-apple-*) curl_pflags="${curl_pflags} APPLE";; + esac + if test "$curl_cv_native_windows" = 'yes'; then + curl_pflags="${curl_pflags} WIN32" + else + case $host in + *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*) + curl_pflags="${curl_pflags} UNIX";; + esac + case $host in + *-*-*bsd*) + curl_pflags="${curl_pflags} BSD";; + esac + fi + if test "$curl_cv_cygwin" = 'yes'; then + curl_pflags="${curl_pflags} CYGWIN" + fi + case $host_os in + msys*) curl_pflags="${curl_pflags} MSYS";; + esac + if test "x$compiler_id" = 'xGNU_C'; then + curl_pflags="${curl_pflags} GCC" + fi + case $host_os in + mingw*) curl_pflags="${curl_pflags} MINGW";; + esac + if test "x$cross_compiling" = 'xyes'; then + curl_pflags="${curl_pflags} CROSS" + fi + squeeze curl_pflags + curl_buildinfo=" +buildinfo.configure.tool: configure +buildinfo.configure.args: $ac_configure_args +buildinfo.host: $build +buildinfo.host.cpu: $build_cpu +buildinfo.host.os: $build_os +buildinfo.target: $host +buildinfo.target.cpu: $host_cpu +buildinfo.target.os: $host_os +buildinfo.target.flags: $curl_pflags +buildinfo.compiler: $compiler_id +buildinfo.compiler.version: $compiler_ver +buildinfo.sysroot: $lt_sysroot" +]) + + dnl CURL_CPP_P dnl dnl Check if $cpp -P should be used for extract define values due to gcc 5 @@ -1615,8 +1647,8 @@ dnl AC_DEFUN([CURL_DARWIN_CFLAGS], [ tst_cflags="no" - case $host_os in - darwin*) + case $host in + *-apple-*) tst_cflags="yes" ;; esac @@ -1649,14 +1681,13 @@ AC_DEFUN([CURL_SUPPORTS_BUILTIN_AVAILABLE], [ AC_MSG_CHECKING([to see if the compiler supports __builtin_available()]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include ]],[[ - if (__builtin_available(macOS 10.8, iOS 5.0, *)) {} + if(__builtin_available(macOS 10.12, iOS 5.0, *)) {} ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_BUILTIN_AVAILABLE, 1, - [Define to 1 if you have the __builtin_available function.]) + [Define to 1 if you have the __builtin_available function.]) ],[ AC_MSG_RESULT([no]) ]) diff --git a/deps/curl/appveyor.sh b/deps/curl/appveyor.sh index 87c9d572..46501437 100644 --- a/deps/curl/appveyor.sh +++ b/deps/curl/appveyor.sh @@ -29,43 +29,57 @@ set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail # build if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then - openssl_root_win='C:/OpenSSL-v30-Win64' + openssl_root_win='C:/OpenSSL-v33-Win64' else openssl_root_win='C:/OpenSSL-v111-Win64' fi -openssl_root="$(cygpath -u "${openssl_root_win}")" +openssl_root="$(cygpath "${openssl_root_win}")" if [ "${BUILD_SYSTEM}" = 'CMake' ]; then options='' [[ "${TARGET:-}" = *'ARM64'* ]] && SKIP_RUN='ARM64 architecture' + [ -n "${TOOLSET:-}" ] && options+=" -T ${TOOLSET}" [ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}" - [ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}" + [ -n "${CURLDEBUG:-}" ] && options+=" -DENABLE_CURLDEBUG=${CURLDEBUG}" [ "${PRJ_CFG}" = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' [ "${PRJ_CFG}" = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' [[ "${PRJ_GEN}" = *'Visual Studio'* ]] && options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false' - # Fails to run without this run due to missing MSVCR90.dll - [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ] && options+=' -DCURL_STATIC_CRT=ON' + if [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ]; then + [ "${DEBUG}" = 'ON' ] && [ "${SHARED}" = 'ON' ] && SKIP_RUN='Crash on startup in ENABLE_DEBUG=ON shared builds' + # Fails to run without this due to missing MSVCR90.dll / MSVCR90D.dll + options+=' -DCURL_STATIC_CRT=ON' + fi # shellcheck disable=SC2086 cmake -B _bld "-G${PRJ_GEN}" ${TARGET:-} ${options} \ "-DCURL_USE_OPENSSL=${OPENSSL}" \ "-DCURL_USE_SCHANNEL=${SCHANNEL}" \ "-DHTTP_ONLY=${HTTP_ONLY}" \ "-DBUILD_SHARED_LIBS=${SHARED}" \ - "-DBUILD_TESTING=${TESTING}" \ - "-DENABLE_WEBSOCKETS=${WEBSOCKETS:-}" \ "-DCMAKE_UNITY_BUILD=${UNITY}" \ + '-DCURL_TEST_BUNDLES=ON' \ '-DCURL_WERROR=ON' \ "-DENABLE_DEBUG=${DEBUG}" \ "-DENABLE_UNICODE=${ENABLE_UNICODE}" \ - '-DCMAKE_INSTALL_PREFIX=C:/CURL' \ - "-DCMAKE_BUILD_TYPE=${PRJ_CFG}" + '-DCMAKE_INSTALL_PREFIX=C:/curl' \ + "-DCMAKE_BUILD_TYPE=${PRJ_CFG}" \ + '-DCURL_USE_LIBPSL=OFF' + if false; then + cat _bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true + fi + echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true # shellcheck disable=SC2086 - cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --clean-first -- ${BUILD_OPT:-} + if ! cmake --build _bld --config "${PRJ_CFG}" --parallel 2 -- ${BUILD_OPT:-}; then + if [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ]; then + find . -name BuildLog.htm -exec dos2unix '{}' + + find . -name BuildLog.htm -exec cat '{}' + + fi + false + fi if [ "${SHARED}" = 'ON' ]; then - cp -f -p _bld/lib/*.dll _bld/src/ + PATH="$PWD/_bld/lib:$PATH" fi if [ "${OPENSSL}" = 'ON' ]; then - cp -f -p "${openssl_root}"/*.dll _bld/src/ + PATH="$PWD/_bld/lib:${openssl_root}:$PATH" fi curl='_bld/src/curl.exe' elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then @@ -100,56 +114,34 @@ EOF rm _make.bat ) curl="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe" -elif [ "${BUILD_SYSTEM}" = 'autotools' ]; then - autoreconf -fi - ( - mkdir _bld - cd _bld - # shellcheck disable=SC2086 - ../configure ${CONFIG_ARGS:-} - make -j2 V=1 - make -j2 V=1 examples - cd tests - make -j2 V=1 - ) - curl='_bld/src/curl.exe' fi find . -name '*.exe' -o -name '*.dll' if [ -z "${SKIP_RUN:-}" ]; then - "${curl}" --version + "${curl}" --disable --version else echo "Skip running curl.exe. Reason: ${SKIP_RUN}" fi -if false; then - for log in CMakeFiles/CMakeConfigureLog.yaml CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log; do - [ -r "_bld/${log}" ] && cat "_bld/${log}" - done -fi +# build tests -if [ "${TESTING}" = 'ON' ] && [ "${BUILD_SYSTEM}" = 'CMake' ]; then +if [[ "${TFLAGS}" != 'skipall' ]] && \ + [ "${BUILD_SYSTEM}" = 'CMake' ]; then cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps fi -# test +# run tests -if [ "${TESTING}" = 'ON' ]; then - export TFLAGS='' - if [ -x "$(cygpath -u "${WINDIR}/System32/curl.exe")" ]; then - TFLAGS+=" -ac $(cygpath -u "${WINDIR}/System32/curl.exe")" - elif [ -x "$(cygpath -u "C:/msys64/usr/bin/curl.exe")" ]; then - TFLAGS+=" -ac $(cygpath -u "C:/msys64/usr/bin/curl.exe")" +if [[ "${TFLAGS}" != 'skipall' ]] && \ + [[ "${TFLAGS}" != 'skiprun' ]]; then + if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then + TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" + elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then + TFLAGS+=" -ac $(cygpath 'C:/msys64/usr/bin/curl.exe')" fi - TFLAGS+=" ${DISABLED_TESTS:-}" + TFLAGS+=' -j0' if [ "${BUILD_SYSTEM}" = 'CMake' ]; then - ls _bld/lib/*.dll >/dev/null 2>&1 && cp -f -p _bld/lib/*.dll _bld/tests/libtest/ cmake --build _bld --config "${PRJ_CFG}" --target test-ci - elif [ "${BUILD_SYSTEM}" = 'autotools' ]; then - ( - cd _bld - make -j2 V=1 test-ci - ) else ( TFLAGS="-a -p !flaky -r -rm ${TFLAGS}" @@ -158,3 +150,10 @@ if [ "${TESTING}" = 'ON' ]; then ) fi fi + +# build examples + +if [[ "${EXAMPLES}" = 'ON' ]] && \ + [ "${BUILD_SYSTEM}" = 'CMake' ]; then + cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target curl-examples +fi diff --git a/deps/curl/appveyor.yml b/deps/curl/appveyor.yml index 7fd1a662..8209cd11 100644 --- a/deps/curl/appveyor.yml +++ b/deps/curl/appveyor.yml @@ -31,24 +31,37 @@ version: 7.50.0.{build} environment: - UNITY: 'OFF' + UNITY: 'ON' OPENSSL: 'OFF' DEBUG: 'ON' SHARED: 'OFF' + HTTP_ONLY: 'OFF' + TFLAGS: 'skiprun' + EXAMPLES: 'OFF' + matrix: - # generated CMake-based Visual Studio Release builds - - job_name: 'CMake, VS2008, Release, x86, Schannel, Build-only' + + # generated CMake-based Visual Studio builds + + - job_name: 'CMake, VS2008, Release, x86, Schannel, Shared, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 9 2008' PRJ_CFG: Release + DEBUG: 'OFF' SCHANNEL: 'ON' ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' SHARED: 'ON' - TESTING: 'OFF' - DISABLED_TESTS: '' - - job_name: 'CMake, VS2022, Release, x64, OpenSSL 3, WebSockets, Unity, Build-only' + - job_name: 'CMake, VS2008, Debug, x86, Schannel, Shared, Build-tests & examples' + APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + BUILD_SYSTEM: CMake + PRJ_GEN: 'Visual Studio 9 2008' + PRJ_CFG: Debug + SCHANNEL: 'ON' + ENABLE_UNICODE: 'OFF' + SHARED: 'ON' + EXAMPLES: 'ON' + - job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.3, Shared, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 17 2022' @@ -57,13 +70,8 @@ environment: OPENSSL: 'ON' SCHANNEL: 'OFF' ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' SHARED: 'ON' - TESTING: 'OFF' - DISABLED_TESTS: '' - WEBSOCKETS: 'ON' - UNITY: 'ON' - - job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-only' + - job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 17 2022' @@ -71,21 +79,17 @@ environment: PRJ_CFG: Release SCHANNEL: 'ON' ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' - TESTING: 'OFF' - DISABLED_TESTS: '' - # generated CMake-based Visual Studio Debug builds - - job_name: 'CMake, VS2010, Debug, x64, no SSL, Static' + DEBUG: 'OFF' + CURLDEBUG: 'ON' + - job_name: 'CMake, VS2010, Debug, x64, Schannel, Static, Build-tests & examples' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 10 2010 Win64' PRJ_CFG: Debug - SCHANNEL: 'OFF' + SCHANNEL: 'ON' ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477' - - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode' + EXAMPLES: 'ON' + - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests & examples, clang-cl' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 17 2022' @@ -93,10 +97,27 @@ environment: PRJ_CFG: Debug SCHANNEL: 'ON' ENABLE_UNICODE: 'ON' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477' - - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static' + EXAMPLES: 'ON' + TOOLSET: 'ClangCl' + - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests' + APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' + BUILD_SYSTEM: CMake + 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' + APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' + BUILD_SYSTEM: CMake + PRJ_GEN: 'Visual Studio 17 2022' + TARGET: '-A x64' + PRJ_CFG: Release + SCHANNEL: 'ON' + ENABLE_UNICODE: 'ON' + SHARED: 'ON' + CURLDEBUG: 'OFF' + - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 17 2022' @@ -104,10 +125,7 @@ environment: PRJ_CFG: Debug SCHANNEL: 'OFF' ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477' - - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only' + - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake PRJ_GEN: 'Visual Studio 17 2022' @@ -116,167 +134,68 @@ environment: SCHANNEL: 'OFF' ENABLE_UNICODE: 'OFF' HTTP_ONLY: 'ON' - TESTING: 'ON' - DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477' - # generated CMake-based MSYS Makefiles builds (mingw cross-compiling) - - job_name: 'CMake, mingw-w64, gcc 13, Debug, x64, Schannel, Static, Unicode, Unity' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' - BUILD_SYSTEM: CMake - PRJ_GEN: 'MSYS Makefiles' - PRJ_CFG: Debug - SCHANNEL: 'ON' - ENABLE_UNICODE: 'ON' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477' - ADD_PATH: 'C:/msys64/mingw64/bin' - MSYS2_ARG_CONV_EXCL: '/*' - BUILD_OPT: -k - UNITY: 'ON' - - job_name: 'CMake, mingw-w64, gcc 7, Debug, x64, Schannel, Static, Unicode' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - BUILD_SYSTEM: CMake - PRJ_GEN: 'MSYS Makefiles' - PRJ_CFG: Debug - SCHANNEL: 'ON' - ENABLE_UNICODE: 'ON' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477' - ADD_PATH: 'C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin' - MSYS2_ARG_CONV_EXCL: '/*' - BUILD_OPT: -k - - job_name: 'CMake, mingw-w64, gcc 9, Debug, x64, Schannel, Static, Unity' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - BUILD_SYSTEM: CMake - PRJ_GEN: 'MSYS Makefiles' - PRJ_CFG: Debug - SCHANNEL: 'ON' - ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - # test 286 disabled due to https://github.com/curl/curl/issues/12040 - DISABLED_TESTS: '~286 !1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477' - ADD_PATH: 'C:/msys64/mingw64/bin' - MSYS2_ARG_CONV_EXCL: '/*' - BUILD_OPT: -k - UNITY: 'ON' - - job_name: 'CMake, mingw-w64, gcc 6, Debug, x86, Schannel, Static' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - BUILD_SYSTEM: CMake - PRJ_GEN: 'MSYS Makefiles' - PRJ_CFG: Debug - SCHANNEL: 'ON' - ENABLE_UNICODE: 'OFF' - HTTP_ONLY: 'OFF' - TESTING: 'ON' - DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477' - ADD_PATH: 'C:/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin' - MSYS2_ARG_CONV_EXCL: '/*' - BUILD_OPT: -k + # winbuild-based builds + - job_name: 'winbuild, VS2015, Debug, x64, OpenSSL 1.1.1, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: winbuild_vs2015 DEBUG: 'yes' PATHPART: debug - TESTING: 'OFF' ENABLE_UNICODE: 'no' - job_name: 'winbuild, VS2015, Release, x64, OpenSSL 1.1.1, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: winbuild_vs2015 DEBUG: 'no' PATHPART: release - TESTING: 'OFF' ENABLE_UNICODE: 'no' - job_name: 'winbuild, VS2017, Debug, x64, OpenSSL 1.1.1, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: winbuild_vs2017 DEBUG: 'yes' PATHPART: debug - TESTING: 'OFF' ENABLE_UNICODE: 'no' - job_name: 'winbuild, VS2017, Release, x64, OpenSSL 1.1.1, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: winbuild_vs2017 DEBUG: 'no' PATHPART: release - TESTING: 'OFF' ENABLE_UNICODE: 'no' - job_name: 'winbuild, VS2015, Debug, x64, OpenSSL 1.1.1, Unicode, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: winbuild_vs2015 DEBUG: 'yes' PATHPART: debug - TESTING: 'OFF' ENABLE_UNICODE: 'yes' - job_name: 'winbuild, VS2015, Release, x64, OpenSSL 1.1.1, Unicode, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' BUILD_SYSTEM: winbuild_vs2015 DEBUG: 'no' PATHPART: release - TESTING: 'OFF' ENABLE_UNICODE: 'yes' - job_name: 'winbuild, VS2017, Debug, x64, OpenSSL 1.1.1, Unicode, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: winbuild_vs2017 DEBUG: 'yes' PATHPART: debug - TESTING: 'OFF' ENABLE_UNICODE: 'yes' - job_name: 'winbuild, VS2017, Release, x64, OpenSSL 1.1.1, Unicode, Build-only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: winbuild_vs2017 DEBUG: 'no' PATHPART: release - TESTING: 'OFF' ENABLE_UNICODE: 'yes' + # generated VisualStudioSolution-based builds - - job_name: 'VisualStudioSolution, VS2017, Debug, x86, Schannel, Build-only' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + + - 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' - TESTING: 'OFF' - VC_VERSION: VC14.10 - # autotools-based builds (NOT mingw cross-compiling, but msys2 native) - - job_name: 'autotools, msys2, Debug, x86_64, no Proxy, no SSL' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - BUILD_SYSTEM: autotools - TESTING: 'ON' - DISABLED_TESTS: '!19 !1233' - CONFIG_ARGS: '--enable-debug --enable-werror --disable-threaded-resolver --disable-proxy --without-ssl --enable-websockets --without-libpsl' - - job_name: 'autotools, msys2, Debug, x86_64, no SSL' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - BUILD_SYSTEM: autotools - TESTING: 'ON' - DISABLED_TESTS: '!19 !504 !704 !705 !1233' - CONFIG_ARGS: '--enable-debug --enable-werror --disable-threaded-resolver --without-ssl --enable-websockets --without-libpsl' - - job_name: 'autotools, msys2, Release, x86_64, no SSL' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - BUILD_SYSTEM: autotools - TESTING: 'ON' - DISABLED_TESTS: '!19 !504 !704 !705 !1233' - CONFIG_ARGS: '--enable-warnings --enable-werror --without-ssl --enable-websockets --without-libpsl' - # autotools-based Cygwin build - - job_name: 'autotools, cygwin, Debug, x86_64, no SSL' - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' - BUILD_SYSTEM: autotools - TESTING: 'ON' - DISABLED_TESTS: '' - ADD_SHELL: 'C:/cygwin64/bin' - CONFIG_ARGS: '--enable-debug --enable-werror --disable-threaded-resolver --without-ssl --enable-websockets --without-libpsl' + VC_VERSION: VC12 install: - - ps: | - if($env:ADD_SHELL -ne $null) { - $env:PATH = "$env:ADD_SHELL;$env:PATH" - } - else { - $env:PATH = "C:/msys64/usr/bin;$env:PATH" - } - if($env:ADD_PATH -ne $null) { - $env:PATH = "$env:ADD_PATH;$env:PATH" - } + - ps: $env:PATH = "C:/msys64/usr/bin;$env:PATH" build_script: - cmd: sh -c ./appveyor.sh @@ -291,15 +210,13 @@ branches: skip_commits: files: - - '.azure-pipelines.yml' - '.circleci/*' - - '.cirrus.yml' - '.github/**/*' - 'packages/**/*' - 'plan9/**/*' -artifacts: - - path: '**/curl.exe' - name: curl - - path: '**/*curl*.dll' - name: libcurl dll +#artifacts: +# - path: '**/curl.exe' +# name: curl +# - path: '**/*curl*.dll' +# name: libcurl dll diff --git a/deps/curl/configure.ac b/deps/curl/configure.ac index 49371a75..58ce834e 100644 --- a/deps/curl/configure.ac +++ b/deps/curl/configure.ac @@ -44,6 +44,7 @@ AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) CURL_CHECK_OPTION_DEBUG +AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes) CURL_CHECK_OPTION_OPTIMIZE CURL_CHECK_OPTION_WARNINGS CURL_CHECK_OPTION_WERROR @@ -51,6 +52,7 @@ CURL_CHECK_OPTION_CURLDEBUG CURL_CHECK_OPTION_SYMBOL_HIDING CURL_CHECK_OPTION_ARES CURL_CHECK_OPTION_RT +CURL_CHECK_OPTION_HTTPSRR CURL_CHECK_OPTION_ECH XC_CHECK_PATH_SEPARATOR @@ -166,13 +168,13 @@ 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)" - curl_ws_msg="no (--enable-websockets)" ssl_backends= curl_h1_msg="enabled (internal)" curl_h2_msg="no (--with-nghttp2)" @@ -273,7 +275,7 @@ AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to 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)]),[ +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 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL" @@ -291,7 +293,7 @@ AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to 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]),[ +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 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls" @@ -303,22 +305,32 @@ 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"$OPT_TEST_NGHTTPX" = "Xno" ; then - TEST_NGHTTPX="" + if test X"$OPT_TEST_NGHTTPX" = "Xno"; then + TEST_NGHTTPX="" fi ) AC_SUBST(TEST_NGHTTPX) -CADDY=caddy +CADDY=/usr/bin/caddy AC_ARG_WITH(test-caddy,dnl AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]), CADDY=$withval - if test X"$OPT_CADDY" = "Xno" ; then - CADDY="" + if test X"$OPT_CADDY" = "Xno"; then + CADDY="" fi ) AC_SUBST(CADDY) +VSFTPD=/usr/sbin/vsftpd +AC_ARG_WITH(test-vsftpd,dnl +AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]), + VSFTPD=$withval + if test X"$OPT_VSFTPD" = "Xno"; then + VSFTPD="" + fi +) +AC_SUBST(VSFTPD) + dnl we'd like a httpd+apachectl as test server dnl HTTPD_ENABLED="maybe" @@ -406,7 +418,7 @@ Select from these: --with-bearssl --with-gnutls --with-mbedtls - --with-openssl (also works for BoringSSL and libressl) + --with-openssl (also works for BoringSSL and LibreSSL) --with-rustls --with-schannel --with-secure-transport @@ -424,7 +436,7 @@ dnl AC_CANONICAL_HOST dnl Get system canonical name -AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) +AC_DEFINE_UNQUOTED(CURL_OS, "${host}", [cpu-machine-OS]) # Silence warning: ar: 'u' modifier ignored since 'D' is the default AC_SUBST(AR_FLAGS, [cr]) @@ -479,26 +491,16 @@ AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB], # targeting a static library and not building its shared counterpart. # -CPPFLAG_CURL_STATICLIB= +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 - CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB' + LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}" fi -AC_SUBST([CPPFLAG_CURL_STATICLIB]) +AC_SUBST([LIBCURL_PC_CFLAGS]) -# Determine whether all dependent libraries must be specified when linking -if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" -then - REQUIRE_LIB_DEPS=no -else - REQUIRE_LIB_DEPS=yes -fi -AC_SUBST(REQUIRE_LIB_DEPS) -AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes) - -dnl check if there's a way to force code inline -AC_C_INLINE - dnl ********************************************************************** dnl platform/compiler/architecture specific checks/flags dnl ********************************************************************** @@ -531,6 +533,8 @@ 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 + CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" fi fi AC_SUBST(CURL_CFLAG_EXTRAS) @@ -540,9 +544,6 @@ CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH CURL_CHECK_COMPILER_SYMBOL_HIDING -CURL_CHECK_CURLDEBUG -AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) - 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 @@ -572,6 +573,14 @@ case $host_os in ;; esac +# In order to detect support of sendmmsg(), we need to escape the POSIX +# jail by defining _GNU_SOURCE or will not expose it. +case $host_os in + linux*) + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + ;; +esac + dnl Build unit tests when option --enable-debug is given. if test "x$want_debug" = "xyes" && test "x$supports_unittests" = "xyes"; then @@ -589,8 +598,17 @@ CURL_CHECK_WIN32_LARGEFILE CURL_CHECK_WIN32_CRYPTO CURL_DARWIN_CFLAGS -CURL_DARWIN_SYSTEMCONFIGURATION -CURL_SUPPORTS_BUILTIN_AVAILABLE + +case $host in + *-apple-*) + CURL_SUPPORTS_BUILTIN_AVAILABLE + ;; +esac + +curl_cv_cygwin='no' +case $host_os in + cygwin*|msys*) curl_cv_cygwin='yes';; +esac AM_CONDITIONAL([HAVE_WINDRES], [test "$curl_cv_native_windows" = "yes" && test -n "${RC}"]) @@ -600,6 +618,52 @@ if test "$curl_cv_native_windows" = "yes"; then [AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])]) fi +dnl ---------------------------------------- +dnl whether use "unity" mode for lib and src +dnl ---------------------------------------- + +want_unity='no' +AC_MSG_CHECKING([whether to build libcurl and curl in "unity" mode]) +AC_ARG_ENABLE(unity, +AS_HELP_STRING([--enable-unity],[Enable unity mode]) +AS_HELP_STRING([--disable-unity],[Disable unity (default)]), +[ case "$enableval" in + yes) + want_unity='yes' + AC_MSG_RESULT([yes]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac ], + AC_MSG_RESULT([no]) +) + +AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes']) + +dnl ----------------------- +dnl whether to bundle tests +dnl ----------------------- + +want_test_bundles='no' +AC_MSG_CHECKING([whether to build tests into single-binary bundles]) +AC_ARG_ENABLE(test-bundles, +AS_HELP_STRING([--enable-test-bundles],[Enable test bundles]) +AS_HELP_STRING([--disable-test-bundles],[Disable test bundles (default)]), +[ case "$enableval" in + yes) + want_test_bundles='yes' + AC_MSG_RESULT([yes]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac ], + AC_MSG_RESULT([no]) +) + +AM_CONDITIONAL([USE_TEST_BUNDLES], [test "$want_test_bundles" = 'yes']) + dnl ************************************************************ dnl switch off particular protocols dnl @@ -609,26 +673,29 @@ AS_HELP_STRING([--enable-http],[Enable HTTP support]) AS_HELP_STRING([--disable-http],[Disable HTTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) - disable_http="yes" - AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP]) - AC_SUBST(CURL_DISABLE_HTTP, [1]) - AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) - AC_SUBST(CURL_DISABLE_RTSP, [1]) - dnl toggle off alt-svc too when HTTP is disabled - AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) - AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS]) - curl_h1_msg="no (--enable-http, --with-hyper)" - curl_altsvc_msg="no"; - curl_hsts_msg="no (--enable-hsts)"; - enable_altsvc="no" - hsts="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) + disable_http="yes" + AC_MSG_WARN([disable HTTP disables FTP over proxy, IPFS and RTSP]) + AC_SUBST(CURL_DISABLE_HTTP, [1]) + AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS]) + AC_SUBST(CURL_DISABLE_IPFS, [1]) + AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) + AC_SUBST(CURL_DISABLE_RTSP, [1]) + dnl toggle off alt-svc too when HTTP is disabled + AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) + AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS]) + curl_h1_msg="no (--enable-http, --with-hyper)" + curl_altsvc_msg="no"; + curl_hsts_msg="no (--enable-hsts)"; + enable_altsvc="no" + hsts="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support ftp]) AC_ARG_ENABLE(ftp, @@ -636,14 +703,15 @@ AS_HELP_STRING([--enable-ftp],[Enable FTP support]) AS_HELP_STRING([--disable-ftp],[Disable FTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) - AC_SUBST(CURL_DISABLE_FTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) + AC_SUBST(CURL_DISABLE_FTP, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support file]) AC_ARG_ENABLE(file, @@ -651,14 +719,41 @@ AS_HELP_STRING([--enable-file],[Enable FILE support]) AS_HELP_STRING([--disable-file],[Disable FILE support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) - AC_SUBST(CURL_DISABLE_FILE, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) + AC_SUBST(CURL_DISABLE_FILE, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support IPFS]) +AC_ARG_ENABLE(ipfs, +AS_HELP_STRING([--enable-ipfs],[Enable IPFS support]) +AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS]) + AC_SUBST(CURL_DISABLE_IPFS, [1]) + ;; + *) + if test x$CURL_DISABLE_HTTP = x1; then + AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!) + else + AC_MSG_RESULT(yes) + curl_ipfs_msg="enabled" + fi + ;; + esac ], + if test "x$CURL_DISABLE_HTTP" != "x1"; then + AC_MSG_RESULT(yes) + curl_ipfs_msg="enabled" + else + AC_MSG_RESULT(no) + fi ) AC_MSG_CHECKING([whether to support ldap]) AC_ARG_ENABLE(ldap, @@ -666,19 +761,19 @@ AS_HELP_STRING([--enable-ldap],[Enable LDAP support]) AS_HELP_STRING([--disable-ldap],[Disable LDAP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) - AC_SUBST(CURL_DISABLE_LDAP, [1]) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) + AC_SUBST(CURL_DISABLE_LDAP, [1]) + ;; yes) - ldap_askedfor="yes" - AC_MSG_RESULT(yes) - ;; + ldap_askedfor="yes" + AC_MSG_RESULT(yes) + ;; *) - AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(yes) + ;; esac ],[ - AC_MSG_RESULT(yes) ] + AC_MSG_RESULT(yes) ] ) AC_MSG_CHECKING([whether to support ldaps]) AC_ARG_ENABLE(ldaps, @@ -686,30 +781,31 @@ AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - ;; - *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then - AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - else - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) - AC_SUBST(HAVE_LDAP_SSL, [1]) - fi - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + AC_SUBST(CURL_DISABLE_LDAPS, [1]) + ;; + *) + if test "x$CURL_DISABLE_LDAP" = "x1"; then + AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + AC_SUBST(CURL_DISABLE_LDAPS, [1]) + else + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) + AC_SUBST(HAVE_LDAP_SSL, [1]) + fi + ;; esac ],[ - if test "x$CURL_DISABLE_LDAP" = "x1" ; then - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - else - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) - AC_SUBST(HAVE_LDAP_SSL, [1]) - fi ] + if test "x$CURL_DISABLE_LDAP" = "x1"; then + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + AC_SUBST(CURL_DISABLE_LDAPS, [1]) + else + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) + AC_SUBST(HAVE_LDAP_SSL, [1]) + fi ] ) dnl ********************************************************************** @@ -751,7 +847,7 @@ if test X"$want_hyper" != Xno; then CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) $PKGCONFIG --libs-only-l hyper` CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl @@ -782,7 +878,7 @@ if test X"$want_hyper" != Xno; then AC_CHECK_LIB(hyper, hyper_io_new, [ - AC_CHECK_HEADERS(hyper.h, + AC_CHECK_HEADERS(hyper.h, experimental="$experimental Hyper" AC_MSG_NOTICE([Hyper support is experimental]) curl_h1_msg="enabled (Hyper)" @@ -791,8 +887,9 @@ if test X"$want_hyper" != Xno; then AC_SUBST(USE_HYPER, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER" export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]), - ) + AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE hyper" + ) ], for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do if test -f "$d/libhyper.a"; then @@ -815,25 +912,25 @@ AS_HELP_STRING([--enable-rtsp],[Enable RTSP support]) AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) - AC_SUBST(CURL_DISABLE_RTSP, [1]) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) + AC_SUBST(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 - ;; + 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 + if test "x$CURL_DISABLE_HTTP" != "x1"; then + AC_MSG_RESULT(yes) + curl_rtsp_msg="enabled" + else + AC_MSG_RESULT(no) + fi ) fi @@ -843,15 +940,16 @@ AS_HELP_STRING([--enable-proxy],[Enable proxy support]) AS_HELP_STRING([--disable-proxy],[Disable proxy support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) - AC_SUBST(CURL_DISABLE_PROXY, [1]) - https_proxy="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) + AC_SUBST(CURL_DISABLE_PROXY, [1]) + https_proxy="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support dict]) @@ -860,44 +958,49 @@ AS_HELP_STRING([--enable-dict],[Enable DICT support]) AS_HELP_STRING([--disable-dict],[Disable DICT support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) - AC_SUBST(CURL_DISABLE_DICT, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) + AC_SUBST(CURL_DISABLE_DICT, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) + AC_MSG_CHECKING([whether to support telnet]) AC_ARG_ENABLE(telnet, AS_HELP_STRING([--enable-telnet],[Enable TELNET support]) AS_HELP_STRING([--disable-telnet],[Disable TELNET support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) - AC_SUBST(CURL_DISABLE_TELNET, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) + AC_SUBST(CURL_DISABLE_TELNET, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) + AC_MSG_CHECKING([whether to support tftp]) AC_ARG_ENABLE(tftp, AS_HELP_STRING([--enable-tftp],[Enable TFTP support]) AS_HELP_STRING([--disable-tftp],[Disable TFTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) - AC_SUBST(CURL_DISABLE_TFTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) + AC_SUBST(CURL_DISABLE_TFTP, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support pop3]) @@ -906,48 +1009,49 @@ AS_HELP_STRING([--enable-pop3],[Enable POP3 support]) AS_HELP_STRING([--disable-pop3],[Disable POP3 support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) - AC_SUBST(CURL_DISABLE_POP3, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) + AC_SUBST(CURL_DISABLE_POP3, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) - AC_MSG_CHECKING([whether to support imap]) AC_ARG_ENABLE(imap, AS_HELP_STRING([--enable-imap],[Enable IMAP support]) AS_HELP_STRING([--disable-imap],[Disable IMAP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) - AC_SUBST(CURL_DISABLE_IMAP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) + AC_SUBST(CURL_DISABLE_IMAP, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) - AC_MSG_CHECKING([whether to support smb]) AC_ARG_ENABLE(smb, AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support]) AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS]) - AC_SUBST(CURL_DISABLE_SMB, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS]) + AC_SUBST(CURL_DISABLE_SMB, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support smtp]) @@ -956,14 +1060,15 @@ AS_HELP_STRING([--enable-smtp],[Enable SMTP support]) AS_HELP_STRING([--disable-smtp],[Disable SMTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) - AC_SUBST(CURL_DISABLE_SMTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) + AC_SUBST(CURL_DISABLE_SMTP, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support gopher]) @@ -972,14 +1077,15 @@ AS_HELP_STRING([--enable-gopher],[Enable Gopher support]) AS_HELP_STRING([--disable-gopher],[Disable Gopher support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) - AC_SUBST(CURL_DISABLE_GOPHER, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) + AC_SUBST(CURL_DISABLE_GOPHER, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support mqtt]) @@ -988,36 +1094,15 @@ AS_HELP_STRING([--enable-mqtt],[Enable MQTT support]) AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT]) - AC_SUBST(CURL_DISABLE_MQTT, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT]) + AC_SUBST(CURL_DISABLE_MQTT, [1]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(no) -) - -dnl ********************************************************************** -dnl Check whether to build documentation -dnl ********************************************************************** - -AC_MSG_CHECKING([whether to build documentation]) -AC_ARG_ENABLE(docs, -AS_HELP_STRING([--enable-docs],[Enable documentation]) -AS_HELP_STRING([--disable-docs],[Disable documentation]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - BUILD_DOCS=0 - curl_docs_msg="no" - ;; - *) AC_MSG_RESULT(yes) - BUILD_DOCS=1 - ;; - esac ], - AC_MSG_RESULT(yes) - BUILD_DOCS=1 + AC_MSG_RESULT(no) ) dnl ********************************************************************** @@ -1030,18 +1115,45 @@ AS_HELP_STRING([--enable-manual],[Enable built-in manual]) AS_HELP_STRING([--disable-manual],[Disable built-in manual]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - ;; - *) AC_MSG_RESULT(yes) - USE_MANUAL="1" - ;; + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + USE_MANUAL="1" + ;; esac ], - AC_MSG_RESULT(yes) - USE_MANUAL="1" + AC_MSG_RESULT(yes) + USE_MANUAL="1" ) dnl The actual use of the USE_MANUAL variable is done much later in this dnl script to allow other actions to disable it as well. +dnl ********************************************************************** +dnl Check whether to build documentation +dnl ********************************************************************** + +AC_MSG_CHECKING([whether to build documentation]) +AC_ARG_ENABLE(docs, +AS_HELP_STRING([--enable-docs],[Enable documentation]) +AS_HELP_STRING([--disable-docs],[Disable documentation]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + BUILD_DOCS=0 + dnl disable manual too because it needs built documentation + USE_MANUAL=0 + curl_docs_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + BUILD_DOCS=1 + ;; + esac ], + AC_MSG_RESULT(yes) + BUILD_DOCS=1 +) + + dnl ************************************************************ dnl disable C code generation support dnl @@ -1051,14 +1163,15 @@ AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation sup AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) - curl_libcurl_msg="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) + curl_libcurl_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ********************************************************************** @@ -1070,51 +1183,58 @@ AC_ARG_ENABLE(libgcc, AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]), [ case "$enableval" in yes) - LIBS="-lgcc $LIBS" - AC_MSG_RESULT(yes) - ;; - *) AC_MSG_RESULT(no) - ;; + LIBS="-lgcc $LIBS" + AC_MSG_RESULT(yes) + ;; + *) + AC_MSG_RESULT(no) + ;; esac ], - AC_MSG_RESULT(no) + AC_MSG_RESULT(no) ) CURL_CHECK_LIB_XNET dnl gethostbyname without lib or in the nsl lib? AC_CHECK_FUNC(gethostbyname, - [HAVE_GETHOSTBYNAME="1" - ], - [ AC_CHECK_LIB(nsl, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lnsl $LIBS" - ]) - ]) + [ + HAVE_GETHOSTBYNAME="1" + ], + [ + AC_CHECK_LIB(nsl, gethostbyname, + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lnsl $LIBS" + ] + ) + ] +) -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl gethostbyname in the socket lib? AC_CHECK_LIB(socket, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lsocket $LIBS" - ]) + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lsocket $LIBS" + ] + ) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl gethostbyname in the watt lib? AC_CHECK_LIB(watt, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - CPPFLAGS="-I/dev/env/WATT_ROOT/inc" - LDFLAGS="-L/dev/env/WATT_ROOT/lib" - LIBS="-lwatt $LIBS" - ]) + [ + HAVE_GETHOSTBYNAME="1" + CPPFLAGS="-I${WATT_ROOT}/inc" + LDFLAGS="-L${WATT_ROOT}/lib" + LIBS="-lwatt $LIBS" + ] + ) fi dnl At least one system has been identified to require BOTH nsl and socket dnl libs at the same time to link properly. -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) my_ac_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" @@ -1132,9 +1252,8 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl This is for winsock systems +if test "$HAVE_GETHOSTBYNAME" != "1"; then + dnl This is for Winsock systems if test "$curl_cv_native_windows" = "yes"; then winsock_LIB="-lws2_32" if test ! -z "$winsock_LIB"; then @@ -1143,12 +1262,12 @@ then 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 + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif ]],[[ gethostbyname("localhost"); ]]) @@ -1164,14 +1283,13 @@ then fi fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl This is for Minix 3.1 AC_MSG_CHECKING([for gethostbyname for Minix 3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -/* Older Minix versions may need here instead */ -#include + /* Older Minix versions may need here instead */ + #include ]],[[ gethostbyname("localhost"); ]]) @@ -1183,14 +1301,13 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl This is for eCos with a stubbed DNS implementation AC_MSG_CHECKING([for gethostbyname for eCos]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include + #include + #include ]],[[ gethostbyname("localhost"); ]]) @@ -1202,8 +1319,7 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set -then +if test "$HAVE_GETHOSTBYNAME" != "1" -o "${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([ @@ -1229,13 +1345,14 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl gethostbyname in the network lib - for Haiku OS AC_CHECK_LIB(network, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lnetwork $LIBS" - ]) + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lnetwork $LIBS" + ] + ) fi if test "$HAVE_GETHOSTBYNAME" != "1"; then @@ -1276,19 +1393,19 @@ ZLIB_LIBS="" AC_ARG_WITH(zlib, AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) AS_HELP_STRING([--without-zlib],[disable use of zlib]), - [OPT_ZLIB="$withval"]) + [OPT_ZLIB="$withval"]) -if test "$OPT_ZLIB" = "no" ; then - AC_MSG_WARN([zlib disabled]) +if test "$OPT_ZLIB" = "no"; then + AC_MSG_WARN([zlib disabled]) else - if test "$OPT_ZLIB" = "yes" ; then + if test "$OPT_ZLIB" = "yes"; then OPT_ZLIB="" fi - if test -z "$OPT_ZLIB" ; then + if test -z "$OPT_ZLIB"; then CURL_CHECK_PKGCONFIG(zlib) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then ZLIB_LIBS="`$PKGCONFIG --libs-only-l zlib`" if test -n "$ZLIB_LIBS"; then LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" @@ -1307,37 +1424,45 @@ else dnl people have it in the default path AC_CHECK_LIB(z, inflateEnd, - dnl libz found, set the variable - [HAVE_LIBZ="1" - ZLIB_LIBS="-lz" - LIBS="$ZLIB_LIBS $LIBS"], - dnl if no lib found, try /usr/local - [OPT_ZLIB="/usr/local"]) + dnl libz found, set the variable + [ + HAVE_LIBZ="1" + ZLIB_LIBS="-lz" + LIBS="$ZLIB_LIBS $LIBS" + ], + dnl if no lib found, try /usr/local + [ + OPT_ZLIB="/usr/local" + ] + ) fi fi dnl Add a nonempty path to the compiler flags if test -n "$OPT_ZLIB"; then - CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" - LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" + CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" + LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" fi AC_CHECK_HEADER(zlib.h, [ - dnl zlib.h was found - HAVE_ZLIB_H="1" - dnl if the lib wasn't found already, try again with the new paths - if test "$HAVE_LIBZ" != "1"; then - AC_CHECK_LIB(z, gzread, - [ - dnl the lib was found! - HAVE_LIBZ="1" - ZLIB_LIBS="-lz" - LIBS="$ZLIB_LIBS $LIBS" - ], - [ CPPFLAGS=$clean_CPPFLAGS - LDFLAGS=$clean_LDFLAGS]) - fi + dnl zlib.h was found + HAVE_ZLIB_H="1" + dnl if the lib wasn't found already, try again with the new paths + if test "$HAVE_LIBZ" != "1"; then + AC_CHECK_LIB(z, gzread, + [ + dnl the lib was found! + HAVE_LIBZ="1" + ZLIB_LIBS="-lz" + LIBS="$ZLIB_LIBS $LIBS" + ], + [ + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS + ] + ) + fi ], [ dnl zlib.h was not found, restore the flags @@ -1345,23 +1470,20 @@ else LDFLAGS=$clean_LDFLAGS] ) - if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" - then + if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"; then AC_MSG_WARN([configure found only the libz lib, not the header file!]) HAVE_LIBZ="" CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS ZLIB_LIBS="" - elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" - then + elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"; then AC_MSG_WARN([configure found only the libz header file, not the lib!]) CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS ZLIB_LIBS="" - elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" - then + elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"; then dnl both header and lib were found! AC_SUBST(HAVE_LIBZ) AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) @@ -1370,6 +1492,7 @@ else dnl replace 'HAVE_LIBZ' in the automake makefile.ams AMFIXLIB="1" AC_MSG_NOTICE([found both libz and libz.h header]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE zlib" curl_zlib_msg="enabled" fi fi @@ -1398,26 +1521,26 @@ if test X"$OPT_BROTLI" != Xno; then CLEANLIBS="$LIBS" case "$OPT_BROTLI" in - yes) - dnl --with-brotli (without path) used - CURL_CHECK_PKGCONFIG(libbrotlidec) + yes) + dnl --with-brotli (without path) used + CURL_CHECK_PKGCONFIG(libbrotlidec) - if test "$PKGCONFIG" != "no" ; then - LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec` - LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec` - CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec` - version=`$PKGCONFIG --modversion libbrotlidec` - DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'` - fi + if test "$PKGCONFIG" != "no"; then + LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec` + LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec` + CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec` + version=`$PKGCONFIG --modversion libbrotlidec` + DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'` + fi - ;; - off) - dnl no --with-brotli option given, just check default places - ;; - *) - dnl use the given --with-brotli spot - PREFIX_BROTLI=$OPT_BROTLI - ;; + ;; + off) + dnl no --with-brotli option given, just check default places + ;; + *) + dnl use the given --with-brotli spot + PREFIX_BROTLI=$OPT_BROTLI + ;; esac dnl if given with a prefix, we set -L and -I based on that @@ -1448,16 +1571,17 @@ 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 to prevent further configure tests to fail due to this + 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 to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH]) - fi + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH]) + fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libbrotlidec" else dnl no brotli, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -1484,26 +1608,26 @@ if test X"$OPT_ZSTD" != Xno; then CLEANLIBS="$LIBS" case "$OPT_ZSTD" in - yes) - dnl --with-zstd (without path) used - CURL_CHECK_PKGCONFIG(libzstd) + yes) + dnl --with-zstd (without path) used + CURL_CHECK_PKGCONFIG(libzstd) - if test "$PKGCONFIG" != "no" ; then - LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd` - LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd` - CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd` - version=`$PKGCONFIG --modversion libzstd` - DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'` - fi + if test "$PKGCONFIG" != "no"; then + LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd` + LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd` + CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd` + version=`$PKGCONFIG --modversion libzstd` + DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'` + fi - ;; - off) - dnl no --with-zstd option given, just check default places - ;; - *) - dnl use the given --with-zstd spot - PREFIX_ZSTD=$OPT_ZSTD - ;; + ;; + off) + dnl no --with-zstd option given, just check default places + ;; + *) + dnl use the given --with-zstd spot + PREFIX_ZSTD=$OPT_ZSTD + ;; esac dnl if given with a prefix, we set -L and -I based on that @@ -1534,17 +1658,18 @@ 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 CURL_LIBRARY_PATH to prevent further configure tests to fail due to - dnl this + 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 CURL_LIBRARY_PATH to prevent further configure tests to fail due to + dnl this - if test "x$cross_compiling" != "xyes"; then - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH]) - fi + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH]) + fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libzstd" else dnl no zstd, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -1560,20 +1685,20 @@ dnl ********************************************************************** LDAPLIBNAME="" AC_ARG_WITH(ldap-lib, AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), - [LDAPLIBNAME="$withval"]) + [LDAPLIBNAME="$withval"]) LBERLIBNAME="" AC_ARG_WITH(lber-lib, AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), - [LBERLIBNAME="$withval"]) + [LBERLIBNAME="$withval"]) -if test x$CURL_DISABLE_LDAP != x1 ; then +if test x$CURL_DISABLE_LDAP != x1; then CURL_CHECK_HEADER_LBER CURL_CHECK_HEADER_LDAP CURL_CHECK_HEADER_LDAP_SSL - if test -z "$LDAPLIBNAME" ; then + if test -z "$LDAPLIBNAME"; then if test "$curl_cv_native_windows" = "yes"; then dnl Windows uses a single and unique LDAP library name LDAPLIBNAME="wldap32" @@ -1581,7 +1706,7 @@ if test x$CURL_DISABLE_LDAP != x1 ; then fi fi - if test "$LDAPLIBNAME" ; then + if test "$LDAPLIBNAME"; then AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [ if test -n "$ldap_askedfor"; then AC_MSG_ERROR([couldn't detect the LDAP libraries]) @@ -1609,12 +1734,12 @@ if test x$CURL_DISABLE_LDAP != x1 ; then fi fi -if test x$CURL_DISABLE_LDAP != x1 ; then +if test x$CURL_DISABLE_LDAP != x1; then - if test "$LBERLIBNAME" ; then + 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). - if test "$LBERLIBNAME" != "no" ; then + if test "$LBERLIBNAME" != "no"; 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]) @@ -1625,7 +1750,7 @@ if test x$CURL_DISABLE_LDAP != x1 ; then fi fi -if test x$CURL_DISABLE_LDAP != x1 ; then +if test x$CURL_DISABLE_LDAP != x1; then AC_CHECK_FUNCS([ldap_url_parse \ ldap_init_fd]) @@ -1643,8 +1768,8 @@ if test x$CURL_DISABLE_LDAP != x1 ; then fi fi -if test x$CURL_DISABLE_LDAPS != x1 ; then - curl_ldaps_msg="enabled" +if test x$CURL_DISABLE_LDAPS != x1; then + curl_ldaps_msg="enabled" fi dnl ********************************************************************** @@ -1657,36 +1782,37 @@ AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support]) AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - ipv6=yes - ;; + AC_MSG_RESULT(no) + ipv6=no + ;; + *) + AC_MSG_RESULT(yes) + ipv6=yes + ;; esac ], AC_RUN_IFELSE([AC_LANG_SOURCE([[ -/* are AF_INET6 and sockaddr_in6 available? */ -#include -#ifdef _WIN32 -#include -#include -#else -#include -#include -#if defined (__TANDEM) -# include -#endif -#endif + /* are AF_INET6 and sockaddr_in6 available? */ + #include + #ifdef _WIN32 + #include + #include + #else + #include + #include + #if defined (__TANDEM) + # include + #endif + #endif -int main(void) -{ - struct sockaddr_in6 s; - (void)s; - return socket(AF_INET6, SOCK_STREAM, 0) < 0; -} -]]) -], + int main(void) + { + struct sockaddr_in6 s; + (void)s; + return socket(AF_INET6, SOCK_STREAM, 0) < 0; + } + ]]) + ], AC_MSG_RESULT(yes) ipv6=yes, AC_MSG_RESULT(no) @@ -1697,31 +1823,31 @@ int main(void) if test "$ipv6" = yes; then curl_ipv6_msg="enabled" - AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) + AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) IPV6_ENABLED=1 AC_SUBST(IPV6_ENABLED) AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include -#ifdef _WIN32 -#include -#include -#else -#include -#if defined (__TANDEM) -# include -#endif -#endif -]], [[ - struct sockaddr_in6 s; - s.sin6_scope_id = 0; -]])], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) - ], [ + #include + #ifdef _WIN32 + #include + #include + #else + #include + #if defined (__TANDEM) + # include + #endif + #endif + ]], [[ + struct sockaddr_in6 s; + s.sin6_scope_id = 0; + ]])], [ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) + ], [ AC_MSG_RESULT([no]) - ]) + ]) fi dnl ********************************************************************** @@ -1752,17 +1878,17 @@ int main(int argc, char **argv) curl_cv_writable_argv=cross ]) case $curl_cv_writable_argv in -yes) - AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) - AC_MSG_RESULT(yes) - ;; -no) - AC_MSG_RESULT(no) - ;; -*) - AC_MSG_RESULT(no) - AC_MSG_WARN([the previous check could not be made default was used]) - ;; + yes) + AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) + AC_MSG_RESULT(yes) + ;; + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(no) + AC_MSG_WARN([the previous check could not be made default was used]) + ;; esac dnl ********************************************************************** @@ -1773,31 +1899,31 @@ dnl check for GSS-API stuff in the /usr as default GSSAPI_ROOT="/usr" AC_ARG_WITH(gssapi-includes, - AS_HELP_STRING([--with-gssapi-includes=DIR], - [Specify location of GSS-API headers]), - [ GSSAPI_INCS="-I$withval" - want_gss="yes" ] + AS_HELP_STRING([--with-gssapi-includes=DIR], [Specify location of GSS-API headers]), [ + GSSAPI_INCS="-I$withval" + want_gss="yes" + ] ) AC_ARG_WITH(gssapi-libs, - AS_HELP_STRING([--with-gssapi-libs=DIR], - [Specify location of GSS-API libs]), - [ GSSAPI_LIB_DIR="-L$withval" - want_gss="yes" ] + AS_HELP_STRING([--with-gssapi-libs=DIR], [Specify location of GSS-API libs]), [ + GSSAPI_LIB_DIR="-L$withval" + want_gss="yes" + ] ) 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 - want_gss="yes" - if test x"$GSSAPI_ROOT" = xyes; then - dnl if yes, then use default root - GSSAPI_ROOT="/usr" + AS_HELP_STRING([--with-gssapi=DIR], [Where to look for GSS-API]), [ + GSSAPI_ROOT="$withval" + if test x"$GSSAPI_ROOT" != xno; then + want_gss="yes" + if test x"$GSSAPI_ROOT" = xyes; then + dnl if yes, then use default root + GSSAPI_ROOT="/usr" + fi fi - fi -]) + ] +) : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} @@ -1812,15 +1938,15 @@ if test x"$want_gss" = xyes; then 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 - GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` - elif test "$PKGCONFIG" != "no" ; then - GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi` - elif test -f "$KRB5CONFIG"; then - GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` - elif test "$GSSAPI_ROOT" != "yes"; then - GSSAPI_INCS="-I$GSSAPI_ROOT/include" - fi + if test -n "$host_alias" -a -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` + elif test -f "$KRB5CONFIG"; then + GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` + elif test "$GSSAPI_ROOT" != "yes"; then + GSSAPI_INCS="-I$GSSAPI_ROOT/include" + fi fi CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" @@ -1839,30 +1965,30 @@ if test x"$want_gss" = xyes; then [], [not_mit=1], [ -AC_INCLUDES_DEFAULT -#ifdef HAVE_GSSAPI_GSSAPI_H -#include -#endif + AC_INCLUDES_DEFAULT + #ifdef HAVE_GSSAPI_GSSAPI_H + #include + #endif ]) if test "x$not_mit" = "x1"; then dnl MIT not found, check for Heimdal AC_CHECK_HEADER(gssapi.h, - [], - [ - dnl no header found, disabling GSS - want_gss=no - AC_MSG_WARN(disabling GSS-API support since no header files were found) - ] - ) + [], + [ + dnl no header found, disabling GSS + want_gss=no + AC_MSG_WARN(disabling GSS-API support since no header files were found) + ] + ) else dnl MIT found dnl check if we have a really old MIT Kerberos version (<= 1.2) AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include -#include + #include + #include + #include ]],[[ gss_import_name( (OM_uint32 *)0, @@ -1893,58 +2019,65 @@ if test x"$want_gss" = xyes; then LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" LIBS="-lgss $LIBS" elif test -z "$GSSAPI_LIB_DIR"; then - case $host in - *-*-darwin*) + case $host in + *-apple-*) LIBS="-lgssapi_krb5 -lresolv $LIBS" ;; - *) + *) 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 - dnl krb5-config doesn't 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" - elif test "$PKGCONFIG" != "no" ; then - gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi` - LIBS="$gss_libs $LIBS" + dnl krb5-config doesn't 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" + elif test "$PKGCONFIG" != "no"; then + gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi` + LIBS="$gss_libs $LIBS" elif test -f "$KRB5CONFIG"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything - dnl into LIBS - gss_libs=`$KRB5CONFIG --libs gssapi` - LIBS="$gss_libs $LIBS" + dnl krb5-config doesn't have --libs-only-L or similar, put everything + dnl into LIBS + gss_libs=`$KRB5CONFIG --libs gssapi` + LIBS="$gss_libs $LIBS" else - case $host in - *-hp-hpux*) + case $host in + *-hp-hpux*) gss_libname="gss" ;; - *) + *) gss_libname="gssapi" ;; - esac + esac - if test "$GSSAPI_ROOT" != "yes"; then - LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" - LIBS="-l$gss_libname $LIBS" - else - LIBS="-l$gss_libname $LIBS" - fi + if test "$GSSAPI_ROOT" != "yes"; then + LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" + LIBS="-l$gss_libname $LIBS" + else + LIBS="-l$gss_libname $LIBS" + fi fi ;; - esac + esac else - LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" - case $host in - *-hp-hpux*) + LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" + case $host in + *-hp-hpux*) LIBS="-lgss $LIBS" ;; - *) + *) LIBS="-lgssapi $LIBS" ;; - esac + esac + fi + if test -n "$gnu_gss"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gss" + elif test "x$not_mit" = "x1"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE heimdal-gssapi" + else + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mit-krb5-gssapi" fi else CPPFLAGS="$save_CPPFLAGS" @@ -2015,51 +2148,47 @@ if test "x$curl_cv_native_windows" = "xyes"; then LIBS="-lbcrypt $LIBS" fi -case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED" -in -x) - AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more. +case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED" in + x) + AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more. Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl or --with-rustls to address this.]) - ;; -x1) - # one SSL backend is enabled - AC_SUBST(SSL_ENABLED) - SSL_ENABLED="1" - AC_MSG_NOTICE([built with one SSL backend]) - ;; -xD) - # explicitly built without TLS - ;; -xD*) - AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library + ;; + x1) + # one SSL backend is enabled + AC_SUBST(SSL_ENABLED) + SSL_ENABLED="1" + AC_MSG_NOTICE([built with one SSL backend]) + ;; + xD) + # explicitly built without TLS + ;; + xD*) + AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library (e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl, --with-rustls). Since these are conflicting parameters, verify which is the desired one and drop the other.]) - ;; -*) - # more than one SSL backend is enabled - AC_SUBST(SSL_ENABLED) - SSL_ENABLED="1" - AC_SUBST(CURL_WITH_MULTI_SSL) - CURL_WITH_MULTI_SSL="1" - AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends]) - AC_MSG_NOTICE([built with multiple SSL backends]) - ;; + ;; + *) + # more than one SSL backend is enabled + AC_SUBST(SSL_ENABLED) + SSL_ENABLED="1" + AC_SUBST(CURL_WITH_MULTI_SSL) + CURL_WITH_MULTI_SSL="1" + AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends]) + AC_MSG_NOTICE([built with multiple SSL backends]) + ;; esac if test -n "$ssl_backends"; then curl_ssl_msg="enabled ($ssl_backends)" fi -if test no = "$VALID_DEFAULT_SSL_BACKEND" -then - if test -n "$SSL_ENABLED" - then +if test no = "$VALID_DEFAULT_SSL_BACKEND"; 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 yes = "$VALID_DEFAULT_SSL_BACKEND"; then AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend]) fi @@ -2069,6 +2198,53 @@ dnl ********************************************************************** if test -n "$check_for_ca_bundle"; then CURL_CHECK_CA_BUNDLE + CURL_CHECK_CA_EMBED +fi + +AM_CONDITIONAL(CURL_CA_EMBED_SET, test "x$CURL_CA_EMBED" != "x") + +dnl ---------------------- +dnl check unsafe CA search +dnl ---------------------- + +if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_CHECKING([whether to enable unsafe CA bundle search in PATH on Windows]) + AC_ARG_ENABLE(ca-search, +AS_HELP_STRING([--enable-ca-search],[Enable unsafe CA bundle search in PATH on Windows (default)]) +AS_HELP_STRING([--disable-ca-search],[Disable unsafe CA bundle search in PATH on Windows]), + [ case "$enableval" in + no) + AC_MSG_RESULT([no]) + AC_DEFINE(CURL_DISABLE_CA_SEARCH, 1, [If unsafe CA bundle search in PATH on Windows is disabled]) + ;; + *) + AC_MSG_RESULT([yes]) + ;; + esac ], + AC_MSG_RESULT([yes]) + ) +fi + +dnl -------------------- +dnl check safe CA search +dnl -------------------- + +if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_CHECKING([whether to enable safe CA bundle search (within the curl tool directory) on Windows]) + AC_ARG_ENABLE(ca-search-safe, +AS_HELP_STRING([--enable-ca-search-safe],[Enable safe CA bundle search]) +AS_HELP_STRING([--disable-ca-search-safe],[Disable safe CA bundle search (default)]), + [ case "$enableval" in + yes) + AC_MSG_RESULT([yes]) + AC_DEFINE(CURL_CA_SEARCH_SAFE, 1, [If safe CA bundle search is enabled]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac ], + AC_MSG_RESULT([no]) + ) fi dnl ********************************************************************** @@ -2089,29 +2265,25 @@ if test X"$OPT_LIBPSL" != Xno; then CLEANLIBS="$LIBS" case "$OPT_LIBPSL" in - yes) - dnl --with-libpsl (without path) used - CURL_CHECK_PKGCONFIG(libpsl) + yes|off) + dnl --with-libpsl (without path) used + CURL_CHECK_PKGCONFIG(libpsl) - if test "$PKGCONFIG" != "no" ; then - LIB_PSL=`$PKGCONFIG --libs-only-l libpsl` - LD_PSL=`$PKGCONFIG --libs-only-L libpsl` - CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl` - else - dnl no libpsl pkg-config found + if test "$PKGCONFIG" != "no"; then + LIB_PSL=`$PKGCONFIG --libs-only-l libpsl` + LD_PSL=`$PKGCONFIG --libs-only-L libpsl` + CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl` + else + dnl no libpsl pkg-config found + LIB_PSL="-lpsl" + fi + + ;; + *) + dnl use the given --with-libpsl spot LIB_PSL="-lpsl" - fi - - ;; - off) - dnl no --with-libpsl option given, just check default places - LIB_PSL="-lpsl" - ;; - *) - dnl use the given --with-libpsl spot - LIB_PSL="-lpsl" - PREFIX_PSL=$OPT_LIBPSL - ;; + PREFIX_PSL=$OPT_LIBPSL + ;; esac dnl if given with a prefix, we set -L and -I based on that @@ -2126,12 +2298,13 @@ if test X"$OPT_LIBPSL" != Xno; then AC_CHECK_LIB(psl, psl_builtin, [ - AC_CHECK_HEADERS(libpsl.h, + AC_CHECK_HEADERS(libpsl.h, curl_psl_msg="enabled" LIBPSL_ENABLED=1 AC_DEFINE(USE_LIBPSL, 1, [if libpsl is in use]) AC_SUBST(USE_LIBPSL, [1]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libpsl" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2139,8 +2312,7 @@ if test X"$OPT_LIBPSL" != Xno; then LIBS=$CLEANLIBS ) - if test X"$OPT_LIBPSL" != Xoff && - test "$LIBPSL_ENABLED" != "1"; then + if test "$LIBPSL_ENABLED" != "1"; then AC_MSG_ERROR([libpsl libs and/or directories were not found where specified!]) fi fi @@ -2152,18 +2324,19 @@ dnl Check for libgsasl dnl ********************************************************************** AC_ARG_WITH(libgsasl, - AS_HELP_STRING([--without-libgsasl], - [disable libgsasl support for SCRAM]), - with_libgsasl=$withval, - with_libgsasl=yes) + AS_HELP_STRING([--without-libgsasl], + [disable libgsasl support for SCRAM]), + with_libgsasl=$withval, + with_libgsasl=yes) if test $with_libgsasl != "no"; then AC_SEARCH_LIBS(gsasl_init, gsasl, [curl_gsasl_msg="enabled"; - AC_DEFINE([USE_GSASL], [1], [GSASL support enabled]) - ], + AC_DEFINE([USE_GSASL], [1], [GSASL support enabled]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libgsasl" + ], [curl_gsasl_msg="no (libgsasl not found)"; - AC_MSG_WARN([libgsasl was not found]) - ] + AC_MSG_WARN([libgsasl was not found]) + ] ) fi AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"]) @@ -2172,10 +2345,10 @@ AC_ARG_WITH(libmetalink,, AC_MSG_ERROR([--with-libmetalink and --without-libmetalink no longer work!])) dnl ********************************************************************** -dnl Check for the presence of LIBSSH2 libraries and headers +dnl Check for the presence of libssh2 libraries and headers dnl ********************************************************************** -dnl Default to compiler & linker defaults for LIBSSH2 files & libraries. +dnl Default to compiler & linker defaults for libssh2 files & libraries. OPT_LIBSSH2=off AC_ARG_WITH(libssh2,dnl AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) @@ -2202,26 +2375,26 @@ if test X"$OPT_LIBSSH2" != Xno; then CLEANLIBS="$LIBS" case "$OPT_LIBSSH2" in - yes) - dnl --with-libssh2 (without path) used - CURL_CHECK_PKGCONFIG(libssh2) + yes) + dnl --with-libssh2 (without path) used + CURL_CHECK_PKGCONFIG(libssh2) - if test "$PKGCONFIG" != "no" ; then - LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` - LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` - CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` - version=`$PKGCONFIG --modversion libssh2` - DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'` - fi + if test "$PKGCONFIG" != "no"; then + LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` + LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` + CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` + version=`$PKGCONFIG --modversion libssh2` + DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'` + fi - ;; - off) - dnl no --with-libssh2 option given, just check default places - ;; - *) - dnl use the given --with-libssh2 spot - PREFIX_SSH2=$OPT_LIBSSH2 - ;; + ;; + off) + dnl no --with-libssh2 option given, just check default places + ;; + *) + dnl use the given --with-libssh2 spot + PREFIX_SSH2=$OPT_LIBSSH2 + ;; esac dnl if given with a prefix, we set -L and -I based on that @@ -2240,29 +2413,30 @@ if test X"$OPT_LIBSSH2" != Xno; then AC_CHECK_LIB(ssh2, libssh2_session_block_directions) AC_CHECK_HEADER(libssh2.h, - curl_ssh_msg="enabled (libSSH2)" + curl_ssh_msg="enabled (libssh2)" LIBSSH2_ENABLED=1 - AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use]) + AC_DEFINE(USE_LIBSSH2, 1, [if libssh2 is in use]) AC_SUBST(USE_LIBSSH2, [1]) ) if test X"$OPT_LIBSSH2" != Xoff && test "$LIBSSH2_ENABLED" != "1"; then - AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!]) + AC_MSG_ERROR([libssh2 libs and/or directories were not found where specified!]) fi if test "$LIBSSH2_ENABLED" = "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 to prevent further configure tests to fail due to this + 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 to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH]) - fi + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH]) + fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh2" else dnl no libssh2, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2276,26 +2450,26 @@ elif test X"$OPT_LIBSSH" != Xno; then CLEANLIBS="$LIBS" case "$OPT_LIBSSH" in - yes) - dnl --with-libssh (without path) used - CURL_CHECK_PKGCONFIG(libssh) + yes) + dnl --with-libssh (without path) used + CURL_CHECK_PKGCONFIG(libssh) - if test "$PKGCONFIG" != "no" ; then - LIB_SSH=`$PKGCONFIG --libs-only-l libssh` - LD_SSH=`$PKGCONFIG --libs-only-L libssh` - CPP_SSH=`$PKGCONFIG --cflags-only-I libssh` - version=`$PKGCONFIG --modversion libssh` - DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'` - fi + if test "$PKGCONFIG" != "no"; then + LIB_SSH=`$PKGCONFIG --libs-only-l libssh` + LD_SSH=`$PKGCONFIG --libs-only-L libssh` + CPP_SSH=`$PKGCONFIG --cflags-only-I libssh` + version=`$PKGCONFIG --modversion libssh` + DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'` + fi - ;; - off) - dnl no --with-libssh option given, just check default places - ;; - *) - dnl use the given --with-libssh spot - PREFIX_SSH=$OPT_LIBSSH - ;; + ;; + off) + dnl no --with-libssh option given, just check default places + ;; + *) + dnl use the given --with-libssh spot + PREFIX_SSH=$OPT_LIBSSH + ;; esac dnl if given with a prefix, we set -L and -I based on that @@ -2313,29 +2487,34 @@ elif test X"$OPT_LIBSSH" != Xno; then AC_CHECK_LIB(ssh, ssh_new) AC_CHECK_HEADER(libssh/libssh.h, - curl_ssh_msg="enabled (libSSH)" + curl_ssh_msg="enabled (libssh)" LIBSSH_ENABLED=1 - AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use]) + AC_DEFINE(USE_LIBSSH, 1, [if libssh is in use]) AC_SUBST(USE_LIBSSH, [1]) ) if test X"$OPT_LIBSSH" != Xoff && test "$LIBSSH_ENABLED" != "1"; then - AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!]) + AC_MSG_ERROR([libssh libs and/or directories were not found where specified!]) fi if test "$LIBSSH_ENABLED" = "1"; then - 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 to prevent further configure tests to fail due to this - - if test "x$cross_compiling" != "xyes"; then - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH]) - fi + if test "$curl_cv_native_windows" = "yes"; then + dnl for if_nametoindex + 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 to prevent further configure tests to fail due to this + + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH]) + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh" else dnl no libssh, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2348,11 +2527,10 @@ elif test X"$OPT_WOLFSSH" != Xno; then CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" - if test "$OPT_WOLFSSH" != yes; then - WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config" - LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`" - CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`" + WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config" + LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`" + CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`" fi AC_CHECK_LIB(wolfssh, wolfSSH_Init) @@ -2363,7 +2541,6 @@ elif test X"$OPT_WOLFSSH" != Xno; then AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use]) AC_SUBST(USE_WOLFSSH, [1]) ) - fi dnl ********************************************************************** @@ -2384,32 +2561,32 @@ if test X"$OPT_LIBRTMP" != Xno; then CLEANLIBS="$LIBS" case "$OPT_LIBRTMP" in - yes) - dnl --with-librtmp (without path) used - CURL_CHECK_PKGCONFIG(librtmp) + yes) + dnl --with-librtmp (without path) used + CURL_CHECK_PKGCONFIG(librtmp) - if test "$PKGCONFIG" != "no" ; then - LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` - LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` - CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` - version=`$PKGCONFIG --modversion librtmp` - DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'` - else - dnl To avoid link errors, we do not allow --librtmp without - dnl a pkgconfig file - AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) - fi + if test "$PKGCONFIG" != "no"; then + LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` + LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` + CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` + version=`$PKGCONFIG --modversion librtmp` + DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'` + else + dnl To avoid link errors, we do not allow --librtmp without + 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 - LIB_RTMP="-lrtmp" - ;; - *) - dnl use the given --with-librtmp spot - LIB_RTMP="-lrtmp" - PREFIX_RTMP=$OPT_LIBRTMP - ;; + ;; + off) + dnl no --with-librtmp option given, just check default places + LIB_RTMP="-lrtmp" + ;; + *) + dnl use the given --with-librtmp spot + LIB_RTMP="-lrtmp" + PREFIX_RTMP=$OPT_LIBRTMP + ;; esac dnl if given with a prefix, we set -L and -I based on that @@ -2425,12 +2602,13 @@ if test X"$OPT_LIBRTMP" != Xno; then AC_CHECK_LIB(rtmp, RTMP_Init, [ - AC_CHECK_HEADERS(librtmp/rtmp.h, + AC_CHECK_HEADERS(librtmp/rtmp.h, curl_rtmp_msg="enabled (librtmp)" LIBRTMP_ENABLED=1 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) AC_SUBST(USE_LIBRTMP, [1]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE librtmp" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2442,7 +2620,6 @@ if test X"$OPT_LIBRTMP" != Xno; then test "$LIBRTMP_ENABLED" != "1"; then AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) fi - fi dnl ********************************************************************** @@ -2455,149 +2632,203 @@ AC_ARG_ENABLE(versioned-symbols, AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library]) AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]), [ case "$enableval" in - yes) AC_MSG_RESULT(yes) + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) AC_MSG_CHECKING([if libraries can be versioned]) GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` if test -z "$GLD"; then - AC_MSG_RESULT(no) - AC_MSG_WARN([You need an ld version supporting the --version-script option]) + AC_MSG_RESULT(no) + AC_MSG_WARN([You need an ld version supporting the --version-script option]) else - AC_MSG_RESULT(yes) - if test "x$CURL_WITH_MULTI_SSL" = "x1"; then - versioned_symbols_flavour="MULTISSL_" - elif test "x$OPENSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="OPENSSL_" - elif test "x$GNUTLS_ENABLED" = "x1"; then - versioned_symbols_flavour="GNUTLS_" - elif test "x$WOLFSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="WOLFSSL_" - elif test "x$SCHANNEL_ENABLED" = "x1"; then - versioned_symbols_flavour="SCHANNEL_" - elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then - versioned_symbols_flavour="SECURE_TRANSPORT_" - else - versioned_symbols_flavour="" - fi - versioned_symbols="yes" + AC_MSG_RESULT(yes) + if test "x$enableval" != "xyes"; then + versioned_symbols_flavour="$enableval" + elif test "x$CURL_WITH_MULTI_SSL" = "x1"; then + versioned_symbols_flavour="MULTISSL_" + elif test "x$OPENSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="OPENSSL_" + elif test "x$MBEDTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="MBEDTLS_" + elif test "x$BEARSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="BEARSSL_" + elif test "x$WOLFSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="WOLFSSL_" + elif test "x$GNUTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="GNUTLS_" + elif test "x$RUSTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="RUSTLS_" + else + versioned_symbols_flavour="" + fi + versioned_symbols="yes" fi ;; - *) AC_MSG_RESULT(no) - ;; esac ], [ -AC_MSG_RESULT(no) + AC_MSG_RESULT(no) ] ) -AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR], - ["$versioned_symbols_flavour"]) +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']) -dnl Update .plist file with current version -AC_SUBST([CURL_PLIST_VERSION], - ["$CURLVERSION"]) +dnl ---------------------------- +dnl check Windows Unicode option +dnl ---------------------------- + +want_winuni="no" +if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_CHECKING([whether to enable Windows Unicode (Windows native builds only)]) + AC_ARG_ENABLE(windows-unicode, +AS_HELP_STRING([--enable-windows-unicode],[Enable Windows Unicode]) +AS_HELP_STRING([--disable-windows-unicode],[Disable Windows Unicode (default)]), + [ case "$enableval" in + yes) + CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE" + want_winuni="yes" + AC_MSG_RESULT([yes]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac ], + AC_MSG_RESULT([no]) + ) +fi + +AM_CONDITIONAL([USE_UNICODE], [test "$want_winuni" = "yes"]) dnl ------------------------------------------------- -dnl check winidn option before other IDN libraries +dnl check WinIDN option before other IDN libraries dnl ------------------------------------------------- -AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) -OPT_WINIDN="default" -AC_ARG_WITH(winidn, +tst_links_winidn='no' +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, AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN]) AS_HELP_STRING([--without-winidn], [disable Windows native IDN]), - OPT_WINIDN=$withval) -case "$OPT_WINIDN" in - no|default) - dnl --without-winidn option used or configure option not specified - want_winidn="no" - AC_MSG_RESULT([no]) - ;; - yes) - dnl --with-winidn option used without path - want_winidn="yes" - want_winidn_path="default" - AC_MSG_RESULT([yes]) - ;; - *) - dnl --with-winidn option used with path - want_winidn="yes" - want_winidn_path="$withval" - AC_MSG_RESULT([yes ($withval)]) - ;; -esac + OPT_WINIDN=$withval) + case "$OPT_WINIDN" in + no|default) + dnl --without-winidn option used or configure option not specified + want_winidn="no" + AC_MSG_RESULT([no]) + ;; + yes) + dnl --with-winidn option used without path + want_winidn="yes" + want_winidn_path="default" + AC_MSG_RESULT([yes]) + ;; + *) + dnl --with-winidn option used with path + want_winidn="yes" + want_winidn_path="$withval" + AC_MSG_RESULT([yes ($withval)]) + ;; + esac -if test "$want_winidn" = "yes"; then - dnl winidn library support has been requested - clean_CFLAGS="$CFLAGS" - clean_CPPFLAGS="$CPPFLAGS" - clean_LDFLAGS="$LDFLAGS" - clean_LIBS="$LIBS" - WINIDN_LIBS="-lnormaliz" - WINIDN_CPPFLAGS="" - # - if test "$want_winidn_path" != "default"; then - dnl path has been specified - dnl pkg-config not available or provides no info - WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" - WINIDN_CPPFLAGS="-I$want_winidn_path/include" - WINIDN_DIR="$want_winidn_path/lib$libsuff" - fi - # - dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600) - #error - #endif - ]]) - ],[ - ],[ - CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'` - CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'` - CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'` - CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'` - WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600" - ]) - # - CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" - LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" - LIBS="$WINIDN_LIBS $LIBS" - # - AC_MSG_CHECKING([if IdnToUnicode can be linked]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - IdnToUnicode(0, NULL, 0, NULL, 0); - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_winidn="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_winidn="no" - ]) - # - if test "$tst_links_winidn" = "yes"; then - AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) - AC_SUBST([IDN_ENABLED], [1]) - curl_idn_msg="enabled (Windows-native)" - else - AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) - CFLAGS="$clean_CFLAGS" - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" + if test "$want_winidn" = "yes"; then + dnl WinIDN library support has been requested + clean_CPPFLAGS="$CPPFLAGS" + clean_LDFLAGS="$LDFLAGS" + clean_LIBS="$LIBS" + WINIDN_LIBS="-lnormaliz" + WINIDN_CPPFLAGS="" + # + if test "$want_winidn_path" != "default"; then + dnl path has been specified + dnl pkg-config not available or provides no info + WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" + WINIDN_CPPFLAGS="-I$want_winidn_path/include" + fi + # + CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" + LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" + LIBS="$WINIDN_LIBS $LIBS" + # + AC_MSG_CHECKING([if IdnToUnicode can be linked]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]],[[ + #if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \ + (!defined(WINVER) || WINVER < 0x600) + WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags, + const WCHAR *lpASCIICharStr, + int cchASCIIChar, + WCHAR *lpUnicodeCharStr, + int cchUnicodeChar); + #endif + IdnToUnicode(0, NULL, 0, NULL, 0); + ]]) + ],[ + AC_MSG_RESULT([yes]) + tst_links_winidn="yes" + ],[ + AC_MSG_RESULT([no]) + tst_links_winidn="no" + ]) + # + if test "$tst_links_winidn" = "yes"; then + AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) + AC_SUBST([IDN_ENABLED], [1]) + curl_idn_msg="enabled (Windows-native)" + else + AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) + CPPFLAGS="$clean_CPPFLAGS" + LDFLAGS="$clean_LDFLAGS" + LIBS="$clean_LIBS" + fi fi fi dnl ********************************************************************** -dnl Check for the presence of IDN libraries and headers +dnl Check for the presence of AppleIDN +dnl ********************************************************************** + +tst_links_appleidn='no' +case $host in + *-apple-*) + AC_MSG_CHECKING([whether to build with Apple IDN]) + OPT_IDN="default" + AC_ARG_WITH(apple-idn, +AS_HELP_STRING([--with-apple-idn],[Enable AppleIDN]) +AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]), + [OPT_IDN=$withval]) + case "$OPT_IDN" in + yes) + dnl --with-apple-idn option used + AC_MSG_RESULT([yes, check]) + AC_CHECK_LIB(icucore, uidna_openUTS46, + [ + AC_CHECK_HEADERS(unicode/uidna.h, + curl_idn_msg="enabled (AppleIDN)" + AC_DEFINE(USE_APPLE_IDN, 1, [if AppleIDN]) + AC_SUBST(USE_APPLE_IDN, [1]) + AC_SUBST([IDN_ENABLED], [1]) + LIBS="-licucore -liconv $LIBS" + tst_links_appleidn='yes' + ) + ]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + ;; +esac + +dnl ********************************************************************** +dnl Check for the presence of libidn2 dnl ********************************************************************** AC_MSG_CHECKING([whether to build with libidn2]) @@ -2608,7 +2839,10 @@ AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]), [OPT_IDN=$withval]) if test "x$tst_links_winidn" = "xyes"; then want_idn="no" - AC_MSG_RESULT([no (using winidn instead)]) + AC_MSG_RESULT([no (using WinIDN instead)]) +elif test "x$tst_links_appleidn" = "xyes"; then + want_idn="no" + AC_MSG_RESULT([no (using AppleIDN instead)]) else case "$OPT_IDN" in no) @@ -2717,11 +2951,13 @@ if test "$want_idn" = "yes"; then export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH]) fi + LIBCURL_PC_REQUIRES_PRIVATE="libidn2 $LIBCURL_PC_REQUIRES_PRIVATE" else - AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) + AC_MSG_WARN([Cannot find libidn2]) CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" LIBS="$clean_LIBS" + want_idn="no" fi fi @@ -2767,7 +3003,7 @@ if test X"$want_nghttp2" != Xno; then CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) $PKGCONFIG --libs-only-l libnghttp2` AC_MSG_NOTICE([-l is $LIB_H2]) @@ -2802,16 +3038,17 @@ if test X"$want_nghttp2" != Xno; then # >= 1.15.0 AC_CHECK_LIB(nghttp2, nghttp2_session_get_stream_local_window_size, [ - AC_CHECK_HEADERS(nghttp2/nghttp2.h, + AC_CHECK_HEADERS(nghttp2/nghttp2.h, curl_h2_msg="enabled (nghttp2)" NGHTTP2_ENABLED=1 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use]) AC_SUBST(USE_NGHTTP2, [1]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp2" + ) - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH]) + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH]) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2866,7 +3103,7 @@ if test X"$want_tcp2" != Xno; then CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) $PKGCONFIG --libs-only-l libngtcp2` AC_MSG_NOTICE([-l is $LIB_TCP2]) @@ -2888,14 +3125,15 @@ if test X"$want_tcp2" != Xno; then fi AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned, [ - AC_CHECK_HEADERS(ngtcp2/ngtcp2.h, + AC_CHECK_HEADERS(ngtcp2/ngtcp2.h, NGTCP2_ENABLED=1 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use]) AC_SUBST(USE_NGTCP2, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2911,7 +3149,6 @@ if test X"$want_tcp2" != Xno; then AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.]) fi fi - fi if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BORINGSSL" != "x1"; then @@ -2922,7 +3159,7 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS CURL_CHECK_PKGCONFIG(libngtcp2_crypto_quictls, $want_tcp2_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) $PKGCONFIG --libs-only-l libngtcp2_crypto_quictls` AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS]) @@ -2944,14 +3181,15 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS fi AC_CHECK_LIB(ngtcp2_crypto_quictls, ngtcp2_crypto_recv_client_initial_cb, [ - AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, NGTCP2_ENABLED=1 AC_DEFINE(USE_NGTCP2_CRYPTO_QUICTLS, 1, [if ngtcp2_crypto_quictls is in use]) AC_SUBST(USE_NGTCP2_CRYPTO_QUICTLS, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_quictls" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -2977,7 +3215,7 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS CURL_CHECK_PKGCONFIG(libngtcp2_crypto_boringssl, $want_tcp2_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) $PKGCONFIG --libs-only-l libngtcp2_crypto_boringssl` AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_BORINGSSL]) @@ -2999,14 +3237,15 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS fi AC_CHECK_LIB(ngtcp2_crypto_boringssl, ngtcp2_crypto_recv_client_initial_cb, [ - AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, NGTCP2_ENABLED=1 AC_DEFINE(USE_NGTCP2_CRYPTO_BORINGSSL, 1, [if ngtcp2_crypto_boringssl is in use]) AC_SUBST(USE_NGTCP2_CRYPTO_BORINGSSL, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_BORINGSSL" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_BORINGSSL to CURL_LIBRARY_PATH]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_boringssl" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -3032,7 +3271,7 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls` AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS]) @@ -3054,14 +3293,15 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then fi AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb, [ - AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, NGTCP2_ENABLED=1 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use]) AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_gnutls" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -3087,7 +3327,7 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl` AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL]) @@ -3109,14 +3349,15 @@ if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then fi AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb, [ - AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, NGTCP2_ENABLED=1 AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use]) AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_wolfssl" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -3166,8 +3407,8 @@ if test "x$want_openssl_quic" = "xyes"; then if test "$NGTCP2_ENABLED" = 1; then AC_MSG_ERROR([--with-openssl-quic and --with-ngtcp2 are mutually exclusive]) fi - if test "$HAVE_OPENSSL_QUIC" != 1; then - AC_MSG_ERROR([--with-openssl-quic requires quic support in OpenSSL]) + 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]) AC_SUBST(USE_OPENSSL_QUIC, [1]) @@ -3209,6 +3450,11 @@ esac curl_http3_msg="no (--with-nghttp3)" if test X"$want_nghttp3" != Xno; then + if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; 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 + dnl backup the pre-nghttp3 variables CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" @@ -3216,7 +3462,7 @@ if test X"$want_nghttp3" != Xno; then CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) $PKGCONFIG --libs-only-l libnghttp3` AC_MSG_NOTICE([-l is $LIB_NGHTTP3]) @@ -3238,13 +3484,14 @@ if test X"$want_nghttp3" != Xno; then fi AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned, [ - AC_CHECK_HEADERS(nghttp3/nghttp3.h, + AC_CHECK_HEADERS(nghttp3/nghttp3.h, AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use]) AC_SUBST(USE_NGHTTP3, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3" export CURL_LIBRARY_PATH AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH]) - ) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp3" + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -3260,7 +3507,6 @@ if test X"$want_nghttp3" != Xno; then AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.]) fi fi - fi dnl ********************************************************************** @@ -3335,7 +3581,7 @@ if test X"$want_quiche" != Xno; then CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path) - if test "$PKGCONFIG" != "no" ; then + if test "$PKGCONFIG" != "no"; then LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) $PKGCONFIG --libs-only-l quiche` AC_MSG_NOTICE([-l is $LIB_QUICHE]) @@ -3357,7 +3603,7 @@ if test X"$want_quiche" != Xno; then fi AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting, [ - AC_CHECK_HEADERS(quiche.h, + AC_CHECK_HEADERS(quiche.h, experimental="$experimental HTTP3" AC_MSG_NOTICE([HTTP3 support is experimental]) curl_h3_msg="enabled (quiche)" @@ -3367,13 +3613,14 @@ if test X"$want_quiche" != Xno; then AC_CHECK_FUNCS([quiche_conn_set_qlog_fd]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE" export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]), + AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE quiche", [], [ -AC_INCLUDES_DEFAULT -#include + AC_INCLUDES_DEFAULT + #include ] - ) + ) ], dnl not found, revert back to clean variables AC_MSG_ERROR([couldn't use quiche]) @@ -3389,7 +3636,7 @@ AC_INCLUDES_DEFAULT fi dnl ********************************************************************** -dnl Check for msh3 (QUIC) +dnl Check for msh3/msquic (QUIC) dnl ********************************************************************** OPT_MSH3="no" @@ -3428,7 +3675,7 @@ if test X"$want_msh3" != Xno; then AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-msh3 a no-no]) fi if test "$OPENSSL_ENABLED" != "1"; then - AC_MSG_ERROR([msh3 requires OpenSSL]) + AC_MSG_ERROR([msh3/msquic requires OpenSSL]) fi fi @@ -3455,16 +3702,17 @@ if test X"$want_msh3" != Xno; then AC_CHECK_LIB(msh3, MsH3ApiOpen, [ - AC_CHECK_HEADERS(msh3.h, + AC_CHECK_HEADERS(msh3.h, curl_h3_msg="enabled (msh3)" MSH3_ENABLED=1 AC_DEFINE(USE_MSH3, 1, [if msh3 is in use]) AC_SUBST(USE_MSH3, [1]) CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3" export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]), + AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libmsh3" experimental="$experimental HTTP3" - ) + ) ], dnl not found, revert back to clean variables LDFLAGS=$CLEANLDFLAGS @@ -3473,6 +3721,93 @@ if test X"$want_msh3" != Xno; then ) fi +dnl ********************************************************************** +dnl libuv is only ever used for debug purposes +dnl ********************************************************************** + +OPT_LIBUV=no +AC_ARG_WITH(libuv, +AS_HELP_STRING([--with-libuv=PATH],[Enable libuv]) +AS_HELP_STRING([--without-libuv],[Disable libuv]), + [OPT_LIBUV=$withval]) +case "$OPT_LIBUV" in + no) + dnl --without-libuv option used + want_libuv="no" + ;; + yes) + dnl --with-libuv option used without path + want_libuv="default" + want_libuv_path="" + ;; + *) + dnl --with-libuv option used with path + want_libuv="yes" + want_libuv_path="$withval" + ;; +esac + +if test X"$want_libuv" != Xno; then + if test x$want_debug != xyes; then + AC_MSG_ERROR([Using libuv without debug support enabled is useless]) + fi + + dnl backup the pre-libuv variables + CLEANLDFLAGS="$LDFLAGS" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + CURL_CHECK_PKGCONFIG(libuv, $want_libuv_path) + + if test "$PKGCONFIG" != "no"; then + LIB_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) + $PKGCONFIG --libs-only-l libuv` + AC_MSG_NOTICE([-l is $LIB_LIBUV]) + + CPP_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) dnl + $PKGCONFIG --cflags-only-I libuv` + AC_MSG_NOTICE([-I is $CPP_LIBUV]) + + LD_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) + $PKGCONFIG --libs-only-L libuv` + AC_MSG_NOTICE([-L is $LD_LIBUV]) + + LDFLAGS="$LDFLAGS $LD_LIBUV" + CPPFLAGS="$CPPFLAGS $CPP_LIBUV" + LIBS="$LIB_LIBUV $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_LIBUV=`echo $LD_LIBUV | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(uv, uv_default_loop, + [ + AC_CHECK_HEADERS(uv.h, + LIBUV_ENABLED=1 + AC_DEFINE(USE_LIBUV, 1, [if libuv is in use]) + AC_SUBST(USE_LIBUV, [1]) + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LIBUV" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_LIBUV to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libuv" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + else + dnl no libuv pkg-config found, deal with it + if test X"$want_libuv" != Xdefault; 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.]) + fi + fi + +fi + dnl ********************************************************************** dnl Check for zsh completion path dnl ********************************************************************** @@ -3515,8 +3850,8 @@ case "$OPT_FISH_FPATH" in yes) dnl --with-fish-functions-dir option used without path CURL_CHECK_PKGCONFIG(fish) - if test "$PKGCONFIG" != "no" ; then - FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)" + if test "$PKGCONFIG" != "no"; then + FISH_FUNCTIONS_DIR=`$PKGCONFIG --variable completionsdir fish` else FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d" fi @@ -3533,42 +3868,42 @@ 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 ones as default-headers when checking for the rest! AC_CHECK_HEADERS( - sys/types.h \ - sys/time.h \ - sys/select.h \ - sys/socket.h \ - sys/ioctl.h \ - unistd.h \ - stdlib.h \ - arpa/inet.h \ - net/if.h \ - netinet/in.h \ - netinet/in6.h \ - sys/un.h \ - linux/tcp.h \ - netinet/tcp.h \ - netinet/udp.h \ - netdb.h \ - sys/sockio.h \ - sys/stat.h \ - sys/param.h \ - termios.h \ - termio.h \ - fcntl.h \ - io.h \ - pwd.h \ - utime.h \ - sys/utime.h \ - sys/poll.h \ - poll.h \ - socket.h \ - sys/resource.h \ - libgen.h \ - locale.h \ - stdbool.h \ - sys/filio.h \ - sys/wait.h \ - setjmp.h, + sys/types.h \ + sys/time.h \ + sys/select.h \ + sys/socket.h \ + sys/ioctl.h \ + unistd.h \ + stdlib.h \ + arpa/inet.h \ + net/if.h \ + netinet/in.h \ + netinet/in6.h \ + sys/un.h \ + linux/tcp.h \ + netinet/tcp.h \ + netinet/udp.h \ + netdb.h \ + sys/sockio.h \ + sys/stat.h \ + sys/param.h \ + termios.h \ + termio.h \ + fcntl.h \ + io.h \ + pwd.h \ + utime.h \ + sys/utime.h \ + sys/poll.h \ + poll.h \ + sys/resource.h \ + libgen.h \ + locale.h \ + stdbool.h \ + sys/filio.h \ + sys/wait.h \ + sys/eventfd.h \ + setjmp.h, dnl to do if not found [], dnl to do if found @@ -3593,10 +3928,10 @@ dnl default includes #include #endif #ifdef HAVE_NETINET_IN6_H -#include +#include /* is this really required to detect other headers? */ #endif #ifdef HAVE_SYS_UN_H -#include +#include /* is this really required to detect other headers? */ #endif ] ) @@ -3626,9 +3961,9 @@ CURL_SIZEOF(curl_socket_t, [ 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" + [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 @@ -3637,7 +3972,7 @@ fi # check for ssize_t AC_CHECK_TYPE(ssize_t, , - AC_DEFINE(ssize_t, int, [the signed version of size_t])) + AC_DEFINE(ssize_t, int, [the signed version of size_t])) # check for bool type AC_CHECK_TYPE([bool],[ @@ -3654,12 +3989,12 @@ AC_CHECK_TYPE([bool],[ # check for sa_family_t AC_CHECK_TYPE(sa_family_t, - AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]), - [ - # The windows name? - AC_CHECK_TYPE(ADDRESS_FAMILY, - AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]), - AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]), + AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]), + [ + # The Windows name? + AC_CHECK_TYPE(ADDRESS_FAMILY, + AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]), + AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]), [ #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN @@ -3671,7 +4006,7 @@ AC_CHECK_TYPE(sa_family_t, #include #endif ]) - ], + ], [ #ifdef HAVE_SYS_SOCKET_H #include @@ -3734,7 +4069,6 @@ CURL_CHECK_FUNC_GETHOSTBYNAME_R CURL_CHECK_FUNC_GETHOSTNAME CURL_CHECK_FUNC_GETPEERNAME CURL_CHECK_FUNC_GETSOCKNAME -CURL_CHECK_FUNC_IF_NAMETOINDEX CURL_CHECK_FUNC_GETIFADDRS CURL_CHECK_FUNC_GMTIME_R CURL_CHECK_FUNC_INET_NTOP @@ -3743,7 +4077,6 @@ CURL_CHECK_FUNC_IOCTL CURL_CHECK_FUNC_IOCTLSOCKET CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL CURL_CHECK_FUNC_MEMRCHR -CURL_CHECK_FUNC_POLL CURL_CHECK_FUNC_SIGACTION CURL_CHECK_FUNC_SIGINTERRUPT CURL_CHECK_FUNC_SIGNAL @@ -3760,9 +4093,9 @@ CURL_CHECK_FUNC_STRTOLL case $host in *msdosdjgpp) - ac_cv_func_pipe=no - skipcheck_pipe=yes - AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) + ac_cv_func_pipe=no + skipcheck_pipe=yes + AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) ;; esac @@ -3772,9 +4105,8 @@ AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Se AC_CHECK_FUNCS([\ _fseeki64 \ - arc4random \ + eventfd \ fnmatch \ - fseeko \ geteuid \ getpass_r \ getppid \ @@ -3785,56 +4117,49 @@ AC_CHECK_FUNCS([\ if_nametoindex \ mach_absolute_time \ pipe \ + poll \ sched_yield \ sendmsg \ + sendmmsg \ setlocale \ setmode \ setrlimit \ snprintf \ utime \ utimes \ -],[ -],[ - func="$ac_func" - eval skipcheck=\$skipcheck_$func - if test "x$skipcheck" != "xyes"; then - AC_MSG_CHECKING([deeper for $func]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ - $func (); - ]]) - ],[ - AC_MSG_RESULT([yes]) - eval "ac_cv_func_$func=yes" - AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1], - [Define to 1 if you have the $func function.]) - ],[ - AC_MSG_RESULT([but still no]) - ]) - fi ]) -dnl On Android, the only way to know if fseeko can be used is to see if it is -dnl declared or not (for this API level), as the symbol always exists in the -dnl lib. -AC_CHECK_DECL([fseeko], - [AC_DEFINE([HAVE_DECL_FSEEKO], [1], - [Define to 1 if you have the fseeko declaration])], - [], - [[#include ]]) +if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then + AC_CHECK_FUNCS([_setmode]) +fi + +if test -z "$ssl_backends"; then + AC_CHECK_FUNCS([arc4random]) +fi + +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 + dnl declared or not (for this API level), as the symbol always exists in the + dnl lib. + AC_CHECK_DECL([fseeko], + [AC_DEFINE([HAVE_DECL_FSEEKO], [1], + [Define to 1 if you have the fseeko declaration])], + [], + [[#include ]]) +fi CURL_CHECK_NONBLOCKING_SOCKET -AC_PATH_PROG( PERL, perl, , - $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) -AC_SUBST(PERL) +if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then + AC_PATH_PROG(PERL, perl,, + $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin) + AC_SUBST(PERL) -if test -z "$PERL"; then - dnl if perl was not found then disable building docs - AC_MSG_WARN([disabling documentation]) - BUILD_DOCS=0 - curl_docs_msg="no" + if test -z "$PERL"; then + AC_MSG_ERROR([perl was not found, needed for docs, manual and CA embed]) + fi fi dnl set variable for use in automakefile(s) @@ -3845,7 +4170,6 @@ dnl If the manual variable still is set, then we go with providing a built-in dnl manual if test "$USE_MANUAL" = "1"; then - AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual]) curl_manual_msg="enabled" fi @@ -3854,16 +4178,12 @@ AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) CURL_CHECK_LIB_ARES -if test "x$curl_cv_native_windows" != "xyes" && - test "x$enable_shared" = "xyes"; then - build_libhostname=yes -else - build_libhostname=no -fi -AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes) - if test "x$want_ares" != xyes; then CURL_CHECK_OPTION_THREADED_RESOLVER + + if test "$ipv6" = yes; then + CURL_DARWIN_SYSTEMCONFIGURATION + fi fi dnl ************************************************************ @@ -3872,19 +4192,36 @@ dnl AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver]) AC_ARG_ENABLE(pthreads, AS_HELP_STRING([--enable-pthreads], - [Enable POSIX threads (default for threaded resolver)]) + [Enable POSIX threads (default for threaded resolver)]) AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]), [ case "$enableval" in - no) AC_MSG_RESULT(no) - want_pthreads=no - ;; - *) AC_MSG_RESULT(yes) - want_pthreads=yes - ;; + no) + AC_MSG_RESULT(no) + want_pthreads=no + ;; + *) + AC_MSG_RESULT(yes) + want_pthreads=yes + ;; esac ], [ - AC_MSG_RESULT(auto) - want_pthreads=auto - ] + default_pthreads=1 + if test "$curl_cv_native_windows" = "yes"; then + default_pthreads=0 + else + case $host_os in + msdos*) + default_pthreads=0 + ;; + esac + fi + if test "$default_pthreads" = '0'; then + AC_MSG_RESULT(no) + want_pthreads=no + else + AC_MSG_RESULT(auto) + want_pthreads=auto + fi + ] ) dnl turn off pthreads if rt is disabled @@ -3911,7 +4248,7 @@ if test "$want_pthreads" != "no"; then AC_CHECK_HEADER(pthread.h, [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have ]) save_CFLAGS="$CFLAGS" - dnl When statically linking against boringssl, -lpthread is added to LIBS. + dnl When statically linking against BoringSSL, -lpthread is added to LIBS. dnl Make sure to that this does not pass the check below, we really want dnl -pthread in CFLAGS as recommended for GCC. This also ensures that dnl lib1541 and lib1565 tests are built with these options. Otherwise @@ -3923,47 +4260,45 @@ if test "$want_pthreads" != "no"; then AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] ) LIBS="$save_LIBS" - dnl on HPUX, life is more complicated... + dnl on HP-UX, life is more complicated... case $host in - *-hp-hpux*) - dnl it doesn't actually work without -lpthread - USE_THREADS_POSIX="" - ;; - *) - ;; + *-hp-hpux*) + dnl it doesn't actually work without -lpthread + USE_THREADS_POSIX="" + ;; + *) + ;; esac dnl if it wasn't found without lib, search for it in pthread lib - if test "$USE_THREADS_POSIX" != "1" - then + if test "$USE_THREADS_POSIX" != "1"; then # assign PTHREAD for pkg-config use PTHREAD=" -pthread" case $host in - *-ibm-aix*) - dnl Check if compiler is xlC - COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` - if test x"$COMPILER_VERSION" = "x"; then - CFLAGS="$CFLAGS -pthread" - else - CFLAGS="$CFLAGS -qthreaded" - fi - ;; - powerpc-*amigaos*) - dnl No -pthread option, but link with -lpthread - PTHREAD=" -lpthread" - ;; - *) - CFLAGS="$CFLAGS -pthread" - ;; + *-ibm-aix*) + dnl Check if compiler is xlC + COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` + if test x"$COMPILER_VERSION" = "x"; then + CFLAGS="$CFLAGS -pthread" + else + CFLAGS="$CFLAGS -qthreaded" + fi + ;; + powerpc-*amigaos*) + dnl No -pthread option, but link with -lpthread + PTHREAD=" -lpthread" + ;; + *) + CFLAGS="$CFLAGS -pthread" + ;; esac AC_CHECK_LIB(pthread, pthread_create, [USE_THREADS_POSIX=1], [ CFLAGS="$save_CFLAGS"]) fi - if test "x$USE_THREADS_POSIX" = "x1" - then + if test "x$USE_THREADS_POSIX" = "x1"; then AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) curl_res_msg="POSIX threaded" fi @@ -3985,6 +4320,12 @@ if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then fi fi +AC_CHECK_HEADER(dirent.h, + [ AC_DEFINE(HAVE_DIRENT_H, 1, [if you have ]) + AC_CHECK_FUNC(opendir, AC_DEFINE(HAVE_OPENDIR, 1, [if you have opendir]) ) + ] +) + CURL_CONVERT_INCLUDE_TO_ISYSTEM dnl ************************************************************ @@ -3996,14 +4337,15 @@ AS_HELP_STRING([--enable-verbose],[Enable verbose strings]) AS_HELP_STRING([--disable-verbose],[Disable verbose strings]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) - curl_verbose_msg="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) + curl_verbose_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4015,31 +4357,31 @@ AS_HELP_STRING([--enable-sspi],[Enable SSPI]) AS_HELP_STRING([--disable-sspi],[Disable SSPI]), [ case "$enableval" in yes) - if test "$curl_cv_native_windows" = "yes"; then - AC_MSG_RESULT(yes) - AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) - AC_SUBST(USE_WINDOWS_SSPI, [1]) - curl_sspi_msg="enabled" - else - AC_MSG_RESULT(no) - AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) - fi - ;; + if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) + AC_SUBST(USE_WINDOWS_SSPI, [1]) + curl_sspi_msg="enabled" + else + AC_MSG_RESULT(no) + AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) + fi + ;; *) - if test "x$SCHANNEL_ENABLED" = "x1"; then - # --with-schannel implies --enable-sspi - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; + if test "x$SCHANNEL_ENABLED" = "x1"; then + # --with-schannel implies --enable-sspi + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ;; esac ], - if test "x$SCHANNEL_ENABLED" = "x1"; then - # --with-schannel implies --enable-sspi - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi + if test "x$SCHANNEL_ENABLED" = "x1"; then + # --with-schannel implies --enable-sspi + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi ) dnl ************************************************************ @@ -4051,14 +4393,15 @@ AS_HELP_STRING([--enable-basic-auth],[Enable basic authentication (default)]) AS_HELP_STRING([--disable-basic-auth],[Disable basic authentication]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_BASIC_AUTH, 1, [to disable basic authentication]) - CURL_DISABLE_BASIC_AUTH=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_BASIC_AUTH, 1, [to disable basic authentication]) + CURL_DISABLE_BASIC_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4070,14 +4413,15 @@ AS_HELP_STRING([--enable-bearer-auth],[Enable bearer authentication (default)]) AS_HELP_STRING([--disable-bearer-auth],[Disable bearer authentication]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_BEARER_AUTH, 1, [to disable bearer authentication]) - CURL_DISABLE_BEARER_AUTH=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_BEARER_AUTH, 1, [to disable bearer authentication]) + CURL_DISABLE_BEARER_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4089,14 +4433,15 @@ AS_HELP_STRING([--enable-digest-auth],[Enable digest authentication (default)]) AS_HELP_STRING([--disable-digest-auth],[Disable digest authentication]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_DIGEST_AUTH, 1, [to disable digest authentication]) - CURL_DISABLE_DIGEST_AUTH=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DIGEST_AUTH, 1, [to disable digest authentication]) + CURL_DISABLE_DIGEST_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4108,14 +4453,15 @@ AS_HELP_STRING([--enable-kerberos-auth],[Enable kerberos authentication (default AS_HELP_STRING([--disable-kerberos-auth],[Disable kerberos authentication]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_KERBEROS_AUTH, 1, [to disable kerberos authentication]) - CURL_DISABLE_KERBEROS_AUTH=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_KERBEROS_AUTH, 1, [to disable kerberos authentication]) + CURL_DISABLE_KERBEROS_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4127,17 +4473,17 @@ AS_HELP_STRING([--enable-negotiate-auth],[Enable negotiate authentication (defau AS_HELP_STRING([--disable-negotiate-auth],[Disable negotiate authentication]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_NEGOTIATE_AUTH, 1, [to disable negotiate authentication]) - CURL_DISABLE_NEGOTIATE_AUTH=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_NEGOTIATE_AUTH, 1, [to disable negotiate authentication]) + CURL_DISABLE_NEGOTIATE_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) - dnl ************************************************************ dnl disable aws dnl @@ -4147,14 +4493,15 @@ AS_HELP_STRING([--enable-aws],[Enable AWS sig support (default)]) AS_HELP_STRING([--disable-aws],[Disable AWS sig support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable AWS sig support]) - CURL_DISABLE_AWS=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable AWS sig support]) + CURL_DISABLE_AWS=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4166,20 +4513,17 @@ AS_HELP_STRING([--enable-ntlm],[Enable NTLM support]) AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support]) - CURL_DISABLE_NTLM=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support]) + CURL_DISABLE_NTLM=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) -CURL_CHECK_OPTION_NTLM_WB - -CURL_CHECK_NTLM_WB - dnl ************************************************************ dnl disable TLS-SRP authentication dnl @@ -4189,21 +4533,22 @@ AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication]) AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - want_tls_srp=no - ;; - *) AC_MSG_RESULT(yes) - want_tls_srp=yes - ;; + AC_MSG_RESULT(no) + want_tls_srp=no + ;; + *) + AC_MSG_RESULT(yes) + want_tls_srp=yes + ;; esac ], - AC_MSG_RESULT(yes) - want_tls_srp=yes + AC_MSG_RESULT(yes) + want_tls_srp=yes ) -if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then - AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) - USE_TLS_SRP=1 - curl_tls_srp_msg="enabled" +if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1"); then + AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) + USE_TLS_SRP=1 + curl_tls_srp_msg="enabled" fi dnl ************************************************************ @@ -4214,16 +4559,18 @@ AC_ARG_ENABLE(unix-sockets, AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets]) AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), [ case "$enableval" in - no) AC_MSG_RESULT(no) - want_unix_sockets=no - ;; - *) AC_MSG_RESULT(yes) - want_unix_sockets=yes - ;; + no) + AC_MSG_RESULT(no) + want_unix_sockets=no + ;; + *) + AC_MSG_RESULT(yes) + want_unix_sockets=yes + ;; esac ], [ - AC_MSG_RESULT(auto) - want_unix_sockets=auto - ] + AC_MSG_RESULT(auto) + want_unix_sockets=auto + ] ) if test "x$want_unix_sockets" != "xno"; then if test "x$curl_cv_native_windows" = "xyes"; then @@ -4254,13 +4601,14 @@ AS_HELP_STRING([--enable-cookies],[Enable cookies support]) AS_HELP_STRING([--disable-cookies],[Disable cookies support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4272,13 +4620,14 @@ AS_HELP_STRING([--enable-socketpair],[Enable socketpair support]) AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4290,13 +4639,14 @@ AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support]) AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4308,13 +4658,14 @@ AS_HELP_STRING([--enable-doh],[Enable DoH support]) AS_HELP_STRING([--disable-doh],[Disable DoH support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4326,13 +4677,14 @@ AS_HELP_STRING([--enable-mime],[Enable mime API support]) AS_HELP_STRING([--disable-mime],[Disable mime API support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4344,13 +4696,14 @@ AS_HELP_STRING([--enable-bindlocal],[Enable local binding support]) AS_HELP_STRING([--disable-bindlocal],[Disable local binding support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_BINDLOCAL, 1, [disable local binding support]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_BINDLOCAL, 1, [disable local binding support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4361,13 +4714,15 @@ AC_ARG_ENABLE(form-api, AS_HELP_STRING([--enable-form-api],[Enable form API support]) AS_HELP_STRING([--disable-form-api],[Disable form API support]), [ case "$enableval" in - no) AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) - ;; - *) AC_MSG_RESULT(yes) - test "$enable_mime" = no && - AC_MSG_ERROR(MIME support needs to be enabled in order to enable form API support) - ;; + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) + ;; + *) + AC_MSG_RESULT(yes) + test "$enable_mime" = no && + AC_MSG_ERROR(MIME support needs to be enabled in order to enable form API support) + ;; esac ], [ if test "$enable_mime" = no; then @@ -4388,13 +4743,14 @@ AS_HELP_STRING([--enable-dateparse],[Enable date parsing]) AS_HELP_STRING([--disable-dateparse],[Disable date parsing]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4406,13 +4762,14 @@ AS_HELP_STRING([--enable-netrc],[Enable netrc parsing]) AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4424,13 +4781,33 @@ AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter]) AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable SHA-512/256 hash algorithm +dnl +AC_MSG_CHECKING([whether to support the SHA-512/256 hash algorithm]) +AC_ARG_ENABLE(sha512-256, +AS_HELP_STRING([--enable-sha512-256],[Enable SHA-512/256 hash algorithm (default)]) +AS_HELP_STRING([--disable-sha512-256],[Disable SHA-512/256 hash algorithm]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SHA512_256, 1, [disable SHA-512/256 hash algorithm]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4442,13 +4819,14 @@ AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling]) AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4460,13 +4838,14 @@ AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options]) AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4478,15 +4857,16 @@ AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support]) AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) - curl_altsvc_msg="no"; - enable_altsvc="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) + curl_altsvc_msg="no"; + enable_altsvc="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ @@ -4497,15 +4877,16 @@ AC_ARG_ENABLE(headers-api, AS_HELP_STRING([--enable-headers-api],[Enable headers-api support]) AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]), [ case "$enableval" in - no) AC_MSG_RESULT(no) - curl_headers_msg="no (--enable-headers-api)" - AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api]) - ;; + no) + AC_MSG_RESULT(no) + curl_headers_msg="no (--enable-headers-api)" + AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api]) + ;; *) - AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl only check for HSTS if there's SSL present @@ -4519,13 +4900,14 @@ AS_HELP_STRING([--enable-hsts],[Enable HSTS support]) AS_HELP_STRING([--disable-hsts],[Disable HSTS support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - hsts="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + hsts="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT($hsts) + AC_MSG_RESULT($hsts) ) else AC_MSG_NOTICE([disables HSTS due to lack of SSL]) @@ -4537,6 +4919,16 @@ if test "x$hsts" != "xyes"; then AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc]) fi + +dnl ************************************************************* +dnl check whether HTTPSRR support if desired +dnl +if test "x$want_httpsrr" != "xno"; then + AC_MSG_RESULT([HTTPSRR support is available]) + AC_DEFINE(USE_HTTPSRR, 1, [enable HTTPS RR support]) + experimental="$experimental HTTPSRR" +fi + dnl ************************************************************* dnl check whether ECH support, if desired, is actually available dnl @@ -4547,18 +4939,28 @@ if test "x$want_ech" != "xno"; then ECH_ENABLED=0 ECH_SUPPORT='' - dnl OpenSSL with a chosen ECH function should be enough - dnl so more exhaustive checking seems unnecessary for now + dnl check for OpenSSL if test "x$OPENSSL_ENABLED" = "x1"; then - AC_CHECK_FUNCS(SSL_get_ech_status, - ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)" + AC_CHECK_FUNCS(SSL_ech_set1_echconfig, + ECH_SUPPORT="ECH support available via OpenSSL with SSL_ech_set1_echconfig" + ECH_ENABLED=1) + fi + dnl check for BoringSSL equivalent + if test "x$OPENSSL_ENABLED" = "x1"; then + AC_CHECK_FUNCS(SSL_set1_ech_config_list, + ECH_SUPPORT="ECH support available via BoringSSL with SSL_set1_ech_config_list" + ECH_ENABLED=1) + fi + if test "x$WOLFSSL_ENABLED" = "x1"; then + AC_CHECK_FUNCS(wolfSSL_CTX_GenerateEchConfig, + ECH_SUPPORT="ECH support available via wolfSSL with wolfSSL_CTX_GenerateEchConfig" ECH_ENABLED=1) - - dnl add 'elif' chain here for additional implementations fi dnl now deal with whatever we found if test "x$ECH_ENABLED" = "x1"; then + dnl force pre-requisites for ECH + AC_DEFINE(USE_HTTPSRR, 1, [force HTTPS RR support for ECH]) AC_DEFINE(USE_ECH, 1, [if ECH support is available]) AC_MSG_RESULT($ECH_SUPPORT) experimental="$experimental ECH" @@ -4574,37 +4976,39 @@ if test "x$OPENSSL_ENABLED" = "x1"; then AC_CHECK_FUNCS([SSL_set0_wbio]) fi -dnl ************************************************************* -dnl WebSockets -dnl -AC_MSG_CHECKING([whether to support WebSockets]) -AC_ARG_ENABLE(websockets, -AS_HELP_STRING([--enable-websockets],[Enable WebSockets support]) -AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ;; - *) - if test ${ac_cv_sizeof_curl_off_t} -gt 4; then - AC_MSG_RESULT(yes) - curl_ws_msg="enabled" - AC_DEFINE_UNQUOTED(USE_WEBSOCKETS, [1], [enable websockets support]) - SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" - if test "x$SSL_ENABLED" = "x1"; then - SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS" - fi - experimental="$experimental Websockets" - else - 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]) - fi - ;; - esac ], - AC_MSG_RESULT(no) -) - +if test "x$CURL_DISABLE_HTTP" != "x1"; then + dnl ************************************************************* + dnl WebSockets + dnl + AC_MSG_CHECKING([whether to support WebSockets]) + AC_ARG_ENABLE(websockets, + AS_HELP_STRING([--enable-websockets],[Enable WebSockets support]) + AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]), + [ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) + AC_SUBST(CURL_DISABLE_WEBSOCKETS, [1]) + ;; + *) + if test ${ac_cv_sizeof_curl_off_t} -gt 4; then + AC_MSG_RESULT(yes) + else + 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_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) + AC_SUBST(CURL_DISABLE_WEBSOCKETS, [1]) + fi + ;; + esac ], + AC_MSG_RESULT(yes) + ) +else + AC_MSG_WARN([WebSockets disabled because HTTP is disabled]) + AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) + AC_SUBST(CURL_DISABLE_WEBSOCKETS, [1]) +fi dnl ************************************************************ dnl hiding of library internal symbols @@ -4614,9 +5018,9 @@ CURL_CONFIGURE_SYMBOL_HIDING dnl dnl All the library dependencies put into $LIB apply to libcurl only. dnl -LIBCURL_LIBS="$LIBS$PTHREAD" +LIBCURL_PC_LIBS_PRIVATE="$LIBS$PTHREAD" -AC_SUBST(LIBCURL_LIBS) +AC_SUBST(LIBCURL_PC_LIBS_PRIVATE) AC_SUBST(CURL_NETWORK_LIBS) AC_SUBST(CURL_NETWORK_AND_TIME_LIBS) @@ -4637,13 +5041,21 @@ dnl to let curl-config output the static libraries correctly ENABLE_STATIC="$enable_static" AC_SUBST(ENABLE_STATIC) -dnl merge the pkg-config Libs.private field into Libs when static-only +squeeze LIBCURL_PC_REQUIRES_PRIVATE +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 - LIBCURL_NO_SHARED=$LIBCURL_LIBS + LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE + LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE else - LIBCURL_NO_SHARED= + LIBCURL_PC_REQUIRES= + LIBCURL_PC_LIBS= fi -AC_SUBST(LIBCURL_NO_SHARED) +AC_SUBST(LIBCURL_PC_REQUIRES) +AC_SUBST(LIBCURL_PC_LIBS) rm $compilersh @@ -4692,7 +5104,7 @@ if test "x$curl_psl_msg" = "xenabled"; then fi if test "x$curl_gsasl_msg" = "xenabled"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL" + SUPPORT_FEATURES="$SUPPORT_FEATURES gsasl" fi if test "x$enable_altsvc" = "xyes"; then @@ -4726,11 +5138,6 @@ if test "x$CURL_DISABLE_NTLM" != "x1"; then if test "x$use_curl_ntlm_core" = "xyes" \ -o "x$USE_WINDOWS_SSPI" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" - - if test "x$CURL_DISABLE_HTTP" != "x1" -a \ - "x$NTLM_WB_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" - fi fi fi @@ -4781,8 +5188,10 @@ else AC_MSG_RESULT([no]) fi -if test "x$ECH_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES ECH" +if test "x$OPENSSL_ENABLED" = "x1" -o -n "$SSL_ENABLED"; then + if test "x$ECH_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES ECH" + fi fi if test ${ac_cv_sizeof_curl_off_t} -gt 4; then @@ -4807,20 +5216,40 @@ else #endif ]]) ],[ - SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" ],[ ]) fi +if test "x$want_winuni" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Unicode" +fi +if test "x$want_debug" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Debug" +fi +if test "x$want_curldebug" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES TrackMemory" +fi +if test "x$CURL_CA_EMBED" != "x"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES CAcert" + CURL_CA_EMBED_msg="$CURL_CA_EMBED" +else + CURL_CA_EMBED_msg='no' +fi + dnl replace spaces with newlines dnl sort the lines dnl replace the newlines back to spaces -SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '` +if sort -f /dev/null 2>&1; then + SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort -f | tr '\012' ' '` +else + SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '` +fi AC_SUBST(SUPPORT_FEATURES) dnl For supported protocols in pkg-config file if test "x$CURL_DISABLE_HTTP" != "x1"; then - SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP IPFS IPNS" + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" fi @@ -4897,12 +5326,21 @@ fi if test "x$USE_WOLFSSH" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi +if test "x$CURL_DISABLE_IPFS" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IPFS IPNS" +fi if test "x$CURL_DISABLE_RTSP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi if test "x$USE_LIBRTMP" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" fi +if test "x$CURL_DISABLE_WEBSOCKETS" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" + if test "x$SSL_ENABLED" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS" + fi +fi dnl replace spaces with newlines dnl sort the lines @@ -4919,7 +5357,7 @@ squeeze DEFS squeeze LDFLAGS squeeze LIBS -squeeze LIBCURL_LIBS +squeeze LIBCURL_PC_LIBS_PRIVATE squeeze CURL_NETWORK_LIBS squeeze CURL_NETWORK_AND_TIME_LIBS @@ -4936,38 +5374,41 @@ if test "x$want_curldebug_assumed" = "xyes" && ac_configure_args="$ac_configure_args --enable-curldebug" fi -AC_CONFIG_FILES([Makefile \ - docs/Makefile \ - docs/examples/Makefile \ - docs/libcurl/Makefile \ - docs/libcurl/opts/Makefile \ - docs/cmdline-opts/Makefile \ - include/Makefile \ - include/curl/Makefile \ - src/Makefile \ - lib/Makefile \ - scripts/Makefile \ - lib/libcurl.vers \ - lib/libcurl.plist \ - tests/Makefile \ - tests/config \ - tests/certs/Makefile \ - tests/certs/scripts/Makefile \ - tests/data/Makefile \ - tests/server/Makefile \ - tests/libtest/Makefile \ - tests/unit/Makefile \ - tests/http/config.ini \ - tests/http/Makefile \ - tests/http/clients/Makefile \ - packages/Makefile \ - packages/vms/Makefile \ - curl-config \ - libcurl.pc +CURL_PREPARE_CONFIGUREHELP_PM + +AC_CONFIG_FILES([\ + Makefile \ + docs/Makefile \ + docs/examples/Makefile \ + docs/libcurl/Makefile \ + docs/libcurl/opts/Makefile \ + docs/cmdline-opts/Makefile \ + include/Makefile \ + include/curl/Makefile \ + src/Makefile \ + lib/Makefile \ + scripts/Makefile \ + lib/libcurl.vers \ + tests/Makefile \ + tests/config \ + tests/configurehelp.pm \ + tests/certs/Makefile \ + tests/certs/scripts/Makefile \ + tests/data/Makefile \ + tests/server/Makefile \ + tests/libtest/Makefile \ + tests/unit/Makefile \ + tests/http/config.ini \ + tests/http/Makefile \ + tests/http/clients/Makefile \ + packages/Makefile \ + packages/vms/Makefile \ + curl-config \ + libcurl.pc ]) AC_OUTPUT -CURL_GENERATE_CONFIGUREHELP_PM +SUPPORT_PROTOCOLS_LOWER=`echo "$SUPPORT_PROTOCOLS" | tr A-Z a-z` AC_MSG_NOTICE([Configured to build curl/libcurl: @@ -4975,6 +5416,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: Install prefix: ${prefix} Compiler: ${CC} CFLAGS: ${CFLAGS} + CFLAGS extras: ${CURL_CFLAG_EXTRAS} CPPFLAGS: ${CPPFLAGS} LDFLAGS: ${LDFLAGS} LIBS: ${LIBS} @@ -5001,9 +5443,11 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: SSPI: ${curl_sspi_msg} ca cert bundle: ${ca}${ca_warning} ca cert path: ${capath}${capath_warning} + ca cert embed: ${CURL_CA_EMBED_msg} ca fallback: ${with_ca_fallback} LDAP: ${curl_ldap_msg} LDAPS: ${curl_ldaps_msg} + IPFS/IPNS: ${curl_ipfs_msg} RTSP: ${curl_rtsp_msg} RTMP: ${curl_rtmp_msg} PSL: ${curl_psl_msg} @@ -5014,20 +5458,26 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: HTTP2: ${curl_h2_msg} HTTP3: ${curl_h3_msg} ECH: ${curl_ech_msg} - WebSockets: ${curl_ws_msg} - Protocols: ${SUPPORT_PROTOCOLS} + Protocols: ${SUPPORT_PROTOCOLS_LOWER} Features: ${SUPPORT_FEATURES} ]) -non13=`echo "$TLSCHOICE" | grep -Ei 'bearssl|secure-transport|mbedtls'`; +# grep -o would simplify this, but is nonportable +[non13=`echo "$TLSCHOICE" | $AWK '{split("bearssl secure-transport", a); for (i in a) if(match(tolower($0), a[i])) print a[i];}'`] if test -n "$non13"; then - cat >&2 << _EOF - WARNING: A selected TLS library ($TLSCHOICE) does not support TLS 1.3! -_EOF + for a in $non13; do + AC_MSG_WARN([$a is enabled for TLS but it does not support TLS 1.3]) + done fi if test -n "$experimental"; then - cat >&2 << _EOF - WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution! -_EOF + for a in $experimental; do + AC_MSG_WARN([$a is enabled but marked EXPERIMENTAL. Use with caution!]) + done +fi + +CURL_PREPARE_BUILDINFO +echo "[@%:@] This is a generated file. Do not edit.${curl_buildinfo}" > ./buildinfo.txt +if test -n "$CURL_BUILDINFO$CURL_CI$CI"; then + AC_MSG_NOTICE([${curl_buildinfo}]) fi diff --git a/deps/curl/curl-config.in b/deps/curl/curl-config.in index 54f92d93..2dc40edc 100644 --- a/deps/curl/curl-config.in +++ b/deps/curl/curl-config.in @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | @@ -23,174 +23,173 @@ # ########################################################################### -prefix="@prefix@" -exec_prefix=@exec_prefix@ -includedir=@includedir@ -cppflag_curl_staticlib=@CPPFLAG_CURL_STATICLIB@ +# shellcheck disable=SC2006 + +prefix='@prefix@' +# Used in 'libdir' +# shellcheck disable=SC2034 +exec_prefix="@exec_prefix@" +# shellcheck disable=SC2034 +includedir="@includedir@" +cppflag_curl_staticlib='@LIBCURL_PC_CFLAGS@' usage() { - cat <&2 - exit 1 - fi - ;; + --ssl-backends) + echo '@SSL_BACKENDS@' + ;; - --configure) - echo @CONFIGURE_OPTIONS@ - ;; + --static-libs) + if test 'X@ENABLE_STATIC@' != 'Xno'; then + echo "@libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_PC_LIBS_PRIVATE@" + else + echo 'curl was built with static libraries disabled' >&2 + exit 1 + fi + ;; - *) - echo "unknown option: $1" - usage 1 - ;; - esac - shift + --configure) + echo @CONFIGURE_OPTIONS@ + ;; + + *) + echo "unknown option: $1" + usage 1 + ;; + esac + shift done exit 0 diff --git a/deps/curl/docs/.gitignore b/deps/curl/docs/.gitignore index a087be74..31ca7656 100644 --- a/deps/curl/docs/.gitignore +++ b/deps/curl/docs/.gitignore @@ -4,3 +4,4 @@ *.1 *.3 +RELEASE-TOOLS.md.dist diff --git a/deps/curl/docs/ALTSVC.md b/deps/curl/docs/ALTSVC.md deleted file mode 100644 index 92343aee..00000000 --- a/deps/curl/docs/ALTSVC.md +++ /dev/null @@ -1,44 +0,0 @@ -# Alt-Svc - -curl features support for the Alt-Svc: HTTP header. - -## Enable Alt-Svc in build - -`./configure --enable-alt-svc` - -(enabled by default since 7.73.0) - -## Standard - -[RFC 7838](https://datatracker.ietf.org/doc/html/rfc7838) - -# Alt-Svc cache file format - -This is a text based file with one line per entry and each line consists of nine -space separated fields. - -## Example - - h2 quic.tech 8443 h3-22 quic.tech 8443 "20190808 06:18:37" 0 0 - -## Fields - -1. The ALPN id for the source origin -2. The hostname for the source origin -3. The port number for the source origin -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. -8. Boolean (1 or 0) if "persist" was set for this entry -9. Integer priority value (not currently used) - -If the hostname is an IPv6 numerical address, it is stored with brackets such -as `[::1]`. - -# TODO - -- handle multiple response headers, when one of them says `clear` (should - override them all) -- using `Age:` value for caching age as per spec -- `CURLALTSVC_IMMEDIATELY` support diff --git a/deps/curl/docs/BINDINGS.md b/deps/curl/docs/BINDINGS.md index 060586fd..e6287761 100644 --- a/deps/curl/docs/BINDINGS.md +++ b/deps/curl/docs/BINDINGS.md @@ -1,3 +1,9 @@ + + libcurl bindings ================ @@ -57,7 +63,7 @@ Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang [Hollywood](https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn -[Java](https://github.com/pjlegato/curl-java) +[Java](https://github.com/covers1624/curl4j) [Julia](https://github.com/JuliaWeb/LibCURL.jl) Written by Amit Murthy @@ -138,3 +144,5 @@ Ruby: [curb](https://github.com/taf2/curb) written by Ross Bamford, [XBLite](https://web.archive.org/web/20060426150418/perso.wanadoo.fr/xblite/libraries.html) Written by David Szafranski [Xojo](https://github.com/charonn0/RB-libcURL) Written by Andrew Lambert + +[Zig](https://github.com/jiacai2050/zig-curl) Written by Jiacai Liu, both easy and multi API are supported. diff --git a/deps/curl/docs/BUG-BOUNTY.md b/deps/curl/docs/BUG-BOUNTY.md index 3cb4024a..399c4cfe 100644 --- a/deps/curl/docs/BUG-BOUNTY.md +++ b/deps/curl/docs/BUG-BOUNTY.md @@ -1,3 +1,9 @@ + + # The curl bug bounty The curl project runs a bug bounty program in association with @@ -61,6 +67,13 @@ infrastructure. The curl security team is the sole arbiter if a reported flaw is subject to a bounty or not. +## Third parties + +The curl bug bounty does not cover flaws in third party dependencies +(libraries) used by curl or libcurl. If the bug triggers because of curl +behaving wrongly or abusing a third party dependency, the problem is rather in +curl and not in the dependency and then the bounty might cover the problem. + ## How are vulnerabilities graded? The grading of each reported vulnerability that makes a reward claim is diff --git a/deps/curl/docs/BUGS.md b/deps/curl/docs/BUGS.md index 9a3a30ad..8a3ef82e 100644 --- a/deps/curl/docs/BUGS.md +++ b/deps/curl/docs/BUGS.md @@ -1,3 +1,9 @@ + + # BUGS ## There are still bugs diff --git a/deps/curl/docs/CIPHERS-TLS12.md b/deps/curl/docs/CIPHERS-TLS12.md new file mode 100644 index 00000000..d67c62ba --- /dev/null +++ b/deps/curl/docs/CIPHERS-TLS12.md @@ -0,0 +1,336 @@ + + +# TLS 1.2 cipher suites + +| Id | IANA name | OpenSSL name | RFC | +|--------|-----------------------------------------------|------------------------------------|--------------------| +| 0x0001 | TLS_RSA_WITH_NULL_MD5 | NULL-MD5 | [RFC5246] | +| 0x0002 | TLS_RSA_WITH_NULL_SHA | NULL-SHA | [RFC5246] | +| 0x0003 | TLS_RSA_EXPORT_WITH_RC4_40_MD5 | EXP-RC4-MD5 | [RFC4346][RFC6347] | +| 0x0004 | TLS_RSA_WITH_RC4_128_MD5 | RC4-MD5 | [RFC5246][RFC6347] | +| 0x0005 | TLS_RSA_WITH_RC4_128_SHA | RC4-SHA | [RFC5246][RFC6347] | +| 0x0006 | TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 | EXP-RC2-CBC-MD5 | [RFC4346] | +| 0x0007 | TLS_RSA_WITH_IDEA_CBC_SHA | IDEA-CBC-SHA | [RFC8996] | +| 0x0008 | TLS_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DES-CBC-SHA | [RFC4346] | +| 0x0009 | TLS_RSA_WITH_DES_CBC_SHA | DES-CBC-SHA | [RFC8996] | +| 0x000A | TLS_RSA_WITH_3DES_EDE_CBC_SHA | DES-CBC3-SHA | [RFC5246] | +| 0x000B | TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA | EXP-DH-DSS-DES-CBC-SHA | [RFC4346] | +| 0x000C | TLS_DH_DSS_WITH_DES_CBC_SHA | DH-DSS-DES-CBC-SHA | [RFC8996] | +| 0x000D | TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA | DH-DSS-DES-CBC3-SHA | [RFC5246] | +| 0x000E | TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DH-RSA-DES-CBC-SHA | [RFC4346] | +| 0x000F | TLS_DH_RSA_WITH_DES_CBC_SHA | DH-RSA-DES-CBC-SHA | [RFC8996] | +| 0x0010 | TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA | DH-RSA-DES-CBC3-SHA | [RFC5246] | +| 0x0011 | TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA | EXP-DHE-DSS-DES-CBC-SHA | [RFC4346] | +| 0x0012 | TLS_DHE_DSS_WITH_DES_CBC_SHA | DHE-DSS-DES-CBC-SHA | [RFC8996] | +| 0x0013 | TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA | DHE-DSS-DES-CBC3-SHA | [RFC5246] | +| 0x0014 | TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DHE-RSA-DES-CBC-SHA | [RFC4346] | +| 0x0015 | TLS_DHE_RSA_WITH_DES_CBC_SHA | DHE-RSA-DES-CBC-SHA | [RFC8996] | +| 0x0016 | TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA | DHE-RSA-DES-CBC3-SHA | [RFC5246] | +| 0x0017 | TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 | EXP-ADH-RC4-MD5 | [RFC4346][RFC6347] | +| 0x0018 | TLS_DH_anon_WITH_RC4_128_MD5 | ADH-RC4-MD5 | [RFC5246][RFC6347] | +| 0x0019 | TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA | EXP-ADH-DES-CBC-SHA | [RFC4346] | +| 0x001A | TLS_DH_anon_WITH_DES_CBC_SHA | ADH-DES-CBC-SHA | [RFC8996] | +| 0x001B | TLS_DH_anon_WITH_3DES_EDE_CBC_SHA | ADH-DES-CBC3-SHA | [RFC5246] | +| 0x001C | | FZA-NULL-SHA | | +| 0x001D | | FZA-FZA-CBC-SHA | | +| 0x001E | TLS_KRB5_WITH_DES_CBC_SHA | KRB5-DES-CBC-SHA | [RFC2712] | +| 0x001F | TLS_KRB5_WITH_3DES_EDE_CBC_SHA | KRB5-DES-CBC3-SHA | [RFC2712] | +| 0x0020 | TLS_KRB5_WITH_RC4_128_SHA | KRB5-RC4-SHA | [RFC2712][RFC6347] | +| 0x0021 | TLS_KRB5_WITH_IDEA_CBC_SHA | KRB5-IDEA-CBC-SHA | [RFC2712] | +| 0x0022 | TLS_KRB5_WITH_DES_CBC_MD5 | KRB5-DES-CBC-MD5 | [RFC2712] | +| 0x0023 | TLS_KRB5_WITH_3DES_EDE_CBC_MD5 | KRB5-DES-CBC3-MD5 | [RFC2712] | +| 0x0024 | TLS_KRB5_WITH_RC4_128_MD5 | KRB5-RC4-MD5 | [RFC2712][RFC6347] | +| 0x0025 | TLS_KRB5_WITH_IDEA_CBC_MD5 | KRB5-IDEA-CBC-MD5 | [RFC2712] | +| 0x0026 | TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA | EXP-KRB5-DES-CBC-SHA | [RFC2712] | +| 0x0027 | TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA | EXP-KRB5-RC2-CBC-SHA | [RFC2712] | +| 0x0028 | TLS_KRB5_EXPORT_WITH_RC4_40_SHA | EXP-KRB5-RC4-SHA | [RFC2712][RFC6347] | +| 0x0029 | TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 | EXP-KRB5-DES-CBC-MD5 | [RFC2712] | +| 0x002A | TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 | EXP-KRB5-RC2-CBC-MD5 | [RFC2712] | +| 0x002B | TLS_KRB5_EXPORT_WITH_RC4_40_MD5 | EXP-KRB5-RC4-MD5 | [RFC2712][RFC6347] | +| 0x002C | TLS_PSK_WITH_NULL_SHA | PSK-NULL-SHA | [RFC4785] | +| 0x002D | TLS_DHE_PSK_WITH_NULL_SHA | DHE-PSK-NULL-SHA | [RFC4785] | +| 0x002E | TLS_RSA_PSK_WITH_NULL_SHA | RSA-PSK-NULL-SHA | [RFC4785] | +| 0x002F | TLS_RSA_WITH_AES_128_CBC_SHA | AES128-SHA | [RFC5246] | +| 0x0030 | TLS_DH_DSS_WITH_AES_128_CBC_SHA | DH-DSS-AES128-SHA | [RFC5246] | +| 0x0031 | TLS_DH_RSA_WITH_AES_128_CBC_SHA | DH-RSA-AES128-SHA | [RFC5246] | +| 0x0032 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA | DHE-DSS-AES128-SHA | [RFC5246] | +| 0x0033 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA | DHE-RSA-AES128-SHA | [RFC5246] | +| 0x0034 | TLS_DH_anon_WITH_AES_128_CBC_SHA | ADH-AES128-SHA | [RFC5246] | +| 0x0035 | TLS_RSA_WITH_AES_256_CBC_SHA | AES256-SHA | [RFC5246] | +| 0x0036 | TLS_DH_DSS_WITH_AES_256_CBC_SHA | DH-DSS-AES256-SHA | [RFC5246] | +| 0x0037 | TLS_DH_RSA_WITH_AES_256_CBC_SHA | DH-RSA-AES256-SHA | [RFC5246] | +| 0x0038 | TLS_DHE_DSS_WITH_AES_256_CBC_SHA | DHE-DSS-AES256-SHA | [RFC5246] | +| 0x0039 | TLS_DHE_RSA_WITH_AES_256_CBC_SHA | DHE-RSA-AES256-SHA | [RFC5246] | +| 0x003A | TLS_DH_anon_WITH_AES_256_CBC_SHA | ADH-AES256-SHA | [RFC5246] | +| 0x003B | TLS_RSA_WITH_NULL_SHA256 | NULL-SHA256 | [RFC5246] | +| 0x003C | TLS_RSA_WITH_AES_128_CBC_SHA256 | AES128-SHA256 | [RFC5246] | +| 0x003D | TLS_RSA_WITH_AES_256_CBC_SHA256 | AES256-SHA256 | [RFC5246] | +| 0x003E | TLS_DH_DSS_WITH_AES_128_CBC_SHA256 | DH-DSS-AES128-SHA256 | [RFC5246] | +| 0x003F | TLS_DH_RSA_WITH_AES_128_CBC_SHA256 | DH-RSA-AES128-SHA256 | [RFC5246] | +| 0x0040 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 | DHE-DSS-AES128-SHA256 | [RFC5246] | +| 0x0041 | TLS_RSA_WITH_CAMELLIA_128_CBC_SHA | CAMELLIA128-SHA | [RFC5932] | +| 0x0042 | TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA | DH-DSS-CAMELLIA128-SHA | [RFC5932] | +| 0x0043 | TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA | DH-RSA-CAMELLIA128-SHA | [RFC5932] | +| 0x0044 | TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA | DHE-DSS-CAMELLIA128-SHA | [RFC5932] | +| 0x0045 | TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA | DHE-RSA-CAMELLIA128-SHA | [RFC5932] | +| 0x0046 | TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA | ADH-CAMELLIA128-SHA | [RFC5932] | +| 0x0060 | | EXP1024-RC4-MD5 | | +| 0x0061 | | EXP1024-RC2-CBC-MD5 | | +| 0x0062 | | EXP1024-DES-CBC-SHA | | +| 0x0063 | | EXP1024-DHE-DSS-DES-CBC-SHA | | +| 0x0064 | | EXP1024-RC4-SHA | | +| 0x0065 | | EXP1024-DHE-DSS-RC4-SHA | | +| 0x0066 | | DHE-DSS-RC4-SHA | | +| 0x0067 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 | DHE-RSA-AES128-SHA256 | [RFC5246] | +| 0x0068 | TLS_DH_DSS_WITH_AES_256_CBC_SHA256 | DH-DSS-AES256-SHA256 | [RFC5246] | +| 0x0069 | TLS_DH_RSA_WITH_AES_256_CBC_SHA256 | DH-RSA-AES256-SHA256 | [RFC5246] | +| 0x006A | TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 | DHE-DSS-AES256-SHA256 | [RFC5246] | +| 0x006B | TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 | DHE-RSA-AES256-SHA256 | [RFC5246] | +| 0x006C | TLS_DH_anon_WITH_AES_128_CBC_SHA256 | ADH-AES128-SHA256 | [RFC5246] | +| 0x006D | TLS_DH_anon_WITH_AES_256_CBC_SHA256 | ADH-AES256-SHA256 | [RFC5246] | +| 0x0080 | | GOST94-GOST89-GOST89 | | +| 0x0081 | | GOST2001-GOST89-GOST89 | | +| 0x0082 | | GOST94-NULL-GOST94 | | +| 0x0083 | | GOST2001-NULL-GOST94 | | +| 0x0084 | TLS_RSA_WITH_CAMELLIA_256_CBC_SHA | CAMELLIA256-SHA | [RFC5932] | +| 0x0085 | TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA | DH-DSS-CAMELLIA256-SHA | [RFC5932] | +| 0x0086 | TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA | DH-RSA-CAMELLIA256-SHA | [RFC5932] | +| 0x0087 | TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA | DHE-DSS-CAMELLIA256-SHA | [RFC5932] | +| 0x0088 | TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA | DHE-RSA-CAMELLIA256-SHA | [RFC5932] | +| 0x0089 | TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA | ADH-CAMELLIA256-SHA | [RFC5932] | +| 0x008A | TLS_PSK_WITH_RC4_128_SHA | PSK-RC4-SHA | [RFC4279][RFC6347] | +| 0x008B | TLS_PSK_WITH_3DES_EDE_CBC_SHA | PSK-3DES-EDE-CBC-SHA | [RFC4279] | +| 0x008C | TLS_PSK_WITH_AES_128_CBC_SHA | PSK-AES128-CBC-SHA | [RFC4279] | +| 0x008D | TLS_PSK_WITH_AES_256_CBC_SHA | PSK-AES256-CBC-SHA | [RFC4279] | +| 0x008E | TLS_DHE_PSK_WITH_RC4_128_SHA | DHE-PSK-RC4-SHA | [RFC4279][RFC6347] | +| 0x008F | TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA | DHE-PSK-3DES-EDE-CBC-SHA | [RFC4279] | +| 0x0090 | TLS_DHE_PSK_WITH_AES_128_CBC_SHA | DHE-PSK-AES128-CBC-SHA | [RFC4279] | +| 0x0091 | TLS_DHE_PSK_WITH_AES_256_CBC_SHA | DHE-PSK-AES256-CBC-SHA | [RFC4279] | +| 0x0092 | TLS_RSA_PSK_WITH_RC4_128_SHA | RSA-PSK-RC4-SHA | [RFC4279][RFC6347] | +| 0x0093 | TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA | RSA-PSK-3DES-EDE-CBC-SHA | [RFC4279] | +| 0x0094 | TLS_RSA_PSK_WITH_AES_128_CBC_SHA | RSA-PSK-AES128-CBC-SHA | [RFC4279] | +| 0x0095 | TLS_RSA_PSK_WITH_AES_256_CBC_SHA | RSA-PSK-AES256-CBC-SHA | [RFC4279] | +| 0x0096 | TLS_RSA_WITH_SEED_CBC_SHA | SEED-SHA | [RFC4162] | +| 0x0097 | TLS_DH_DSS_WITH_SEED_CBC_SHA | DH-DSS-SEED-SHA | [RFC4162] | +| 0x0098 | TLS_DH_RSA_WITH_SEED_CBC_SHA | DH-RSA-SEED-SHA | [RFC4162] | +| 0x0099 | TLS_DHE_DSS_WITH_SEED_CBC_SHA | DHE-DSS-SEED-SHA | [RFC4162] | +| 0x009A | TLS_DHE_RSA_WITH_SEED_CBC_SHA | DHE-RSA-SEED-SHA | [RFC4162] | +| 0x009B | TLS_DH_anon_WITH_SEED_CBC_SHA | ADH-SEED-SHA | [RFC4162] | +| 0x009C | TLS_RSA_WITH_AES_128_GCM_SHA256 | AES128-GCM-SHA256 | [RFC5288] | +| 0x009D | TLS_RSA_WITH_AES_256_GCM_SHA384 | AES256-GCM-SHA384 | [RFC5288] | +| 0x009E | TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 | DHE-RSA-AES128-GCM-SHA256 | [RFC5288] | +| 0x009F | TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 | DHE-RSA-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A0 | TLS_DH_RSA_WITH_AES_128_GCM_SHA256 | DH-RSA-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A1 | TLS_DH_RSA_WITH_AES_256_GCM_SHA384 | DH-RSA-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A2 | TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 | DHE-DSS-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A3 | TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 | DHE-DSS-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A4 | TLS_DH_DSS_WITH_AES_128_GCM_SHA256 | DH-DSS-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A5 | TLS_DH_DSS_WITH_AES_256_GCM_SHA384 | DH-DSS-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A6 | TLS_DH_anon_WITH_AES_128_GCM_SHA256 | ADH-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A7 | TLS_DH_anon_WITH_AES_256_GCM_SHA384 | ADH-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A8 | TLS_PSK_WITH_AES_128_GCM_SHA256 | PSK-AES128-GCM-SHA256 | [RFC5487] | +| 0x00A9 | TLS_PSK_WITH_AES_256_GCM_SHA384 | PSK-AES256-GCM-SHA384 | [RFC5487] | +| 0x00AA | TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 | DHE-PSK-AES128-GCM-SHA256 | [RFC5487] | +| 0x00AB | TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 | DHE-PSK-AES256-GCM-SHA384 | [RFC5487] | +| 0x00AC | TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 | RSA-PSK-AES128-GCM-SHA256 | [RFC5487] | +| 0x00AD | TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 | RSA-PSK-AES256-GCM-SHA384 | [RFC5487] | +| 0x00AE | TLS_PSK_WITH_AES_128_CBC_SHA256 | PSK-AES128-CBC-SHA256 | [RFC5487] | +| 0x00AF | TLS_PSK_WITH_AES_256_CBC_SHA384 | PSK-AES256-CBC-SHA384 | [RFC5487] | +| 0x00B0 | TLS_PSK_WITH_NULL_SHA256 | PSK-NULL-SHA256 | [RFC5487] | +| 0x00B1 | TLS_PSK_WITH_NULL_SHA384 | PSK-NULL-SHA384 | [RFC5487] | +| 0x00B2 | TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 | DHE-PSK-AES128-CBC-SHA256 | [RFC5487] | +| 0x00B3 | TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 | DHE-PSK-AES256-CBC-SHA384 | [RFC5487] | +| 0x00B4 | TLS_DHE_PSK_WITH_NULL_SHA256 | DHE-PSK-NULL-SHA256 | [RFC5487] | +| 0x00B5 | TLS_DHE_PSK_WITH_NULL_SHA384 | DHE-PSK-NULL-SHA384 | [RFC5487] | +| 0x00B6 | TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 | RSA-PSK-AES128-CBC-SHA256 | [RFC5487] | +| 0x00B7 | TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 | RSA-PSK-AES256-CBC-SHA384 | [RFC5487] | +| 0x00B8 | TLS_RSA_PSK_WITH_NULL_SHA256 | RSA-PSK-NULL-SHA256 | [RFC5487] | +| 0x00B9 | TLS_RSA_PSK_WITH_NULL_SHA384 | RSA-PSK-NULL-SHA384 | [RFC5487] | +| 0x00BA | TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 | CAMELLIA128-SHA256 | [RFC5932] | +| 0x00BD | TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 | DHE-DSS-CAMELLIA128-SHA256 | [RFC5932] | +| 0x00BE | TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 | DHE-RSA-CAMELLIA128-SHA256 | [RFC5932] | +| 0x00BF | TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 | ADH-CAMELLIA128-SHA256 | [RFC5932] | +| 0x00C0 | TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 | CAMELLIA256-SHA256 | [RFC5932] | +| 0x00C3 | TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 | DHE-DSS-CAMELLIA256-SHA256 | [RFC5932] | +| 0x00C4 | TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 | DHE-RSA-CAMELLIA256-SHA256 | [RFC5932] | +| 0x00C5 | TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 | ADH-CAMELLIA256-SHA256 | [RFC5932] | +| 0x00FF | TLS_EMPTY_RENEGOTIATION_INFO_SCSV | | [RFC5746] | +| 0x5600 | TLS_FALLBACK_SCSV | | [RFC7507] | +| 0xC001 | TLS_ECDH_ECDSA_WITH_NULL_SHA | ECDH-ECDSA-NULL-SHA | [RFC8422] | +| 0xC002 | TLS_ECDH_ECDSA_WITH_RC4_128_SHA | ECDH-ECDSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC003 | TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA | ECDH-ECDSA-DES-CBC3-SHA | [RFC8422] | +| 0xC004 | TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA | ECDH-ECDSA-AES128-SHA | [RFC8422] | +| 0xC005 | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA | ECDH-ECDSA-AES256-SHA | [RFC8422] | +| 0xC006 | TLS_ECDHE_ECDSA_WITH_NULL_SHA | ECDHE-ECDSA-NULL-SHA | [RFC8422] | +| 0xC007 | TLS_ECDHE_ECDSA_WITH_RC4_128_SHA | ECDHE-ECDSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC008 | TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA | ECDHE-ECDSA-DES-CBC3-SHA | [RFC8422] | +| 0xC009 | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA | ECDHE-ECDSA-AES128-SHA | [RFC8422] | +| 0xC00A | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA | ECDHE-ECDSA-AES256-SHA | [RFC8422] | +| 0xC00B | TLS_ECDH_RSA_WITH_NULL_SHA | ECDH-RSA-NULL-SHA | [RFC8422] | +| 0xC00C | TLS_ECDH_RSA_WITH_RC4_128_SHA | ECDH-RSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC00D | TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA | ECDH-RSA-DES-CBC3-SHA | [RFC8422] | +| 0xC00E | TLS_ECDH_RSA_WITH_AES_128_CBC_SHA | ECDH-RSA-AES128-SHA | [RFC8422] | +| 0xC00F | TLS_ECDH_RSA_WITH_AES_256_CBC_SHA | ECDH-RSA-AES256-SHA | [RFC8422] | +| 0xC010 | TLS_ECDHE_RSA_WITH_NULL_SHA | ECDHE-RSA-NULL-SHA | [RFC8422] | +| 0xC011 | TLS_ECDHE_RSA_WITH_RC4_128_SHA | ECDHE-RSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC012 | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA | ECDHE-RSA-DES-CBC3-SHA | [RFC8422] | +| 0xC013 | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA | ECDHE-RSA-AES128-SHA | [RFC8422] | +| 0xC014 | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA | ECDHE-RSA-AES256-SHA | [RFC8422] | +| 0xC015 | TLS_ECDH_anon_WITH_NULL_SHA | AECDH-NULL-SHA | [RFC8422] | +| 0xC016 | TLS_ECDH_anon_WITH_RC4_128_SHA | AECDH-RC4-SHA | [RFC8422][RFC6347] | +| 0xC017 | TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA | AECDH-DES-CBC3-SHA | [RFC8422] | +| 0xC018 | TLS_ECDH_anon_WITH_AES_128_CBC_SHA | AECDH-AES128-SHA | [RFC8422] | +| 0xC019 | TLS_ECDH_anon_WITH_AES_256_CBC_SHA | AECDH-AES256-SHA | [RFC8422] | +| 0xC01A | TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA | SRP-3DES-EDE-CBC-SHA | [RFC5054] | +| 0xC01B | TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA | SRP-RSA-3DES-EDE-CBC-SHA | [RFC5054] | +| 0xC01C | TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA | SRP-DSS-3DES-EDE-CBC-SHA | [RFC5054] | +| 0xC01D | TLS_SRP_SHA_WITH_AES_128_CBC_SHA | SRP-AES-128-CBC-SHA | [RFC5054] | +| 0xC01E | TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA | SRP-RSA-AES-128-CBC-SHA | [RFC5054] | +| 0xC01F | TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA | SRP-DSS-AES-128-CBC-SHA | [RFC5054] | +| 0xC020 | TLS_SRP_SHA_WITH_AES_256_CBC_SHA | SRP-AES-256-CBC-SHA | [RFC5054] | +| 0xC021 | TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA | SRP-RSA-AES-256-CBC-SHA | [RFC5054] | +| 0xC022 | TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA | SRP-DSS-AES-256-CBC-SHA | [RFC5054] | +| 0xC023 | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | ECDHE-ECDSA-AES128-SHA256 | [RFC5289] | +| 0xC024 | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 | ECDHE-ECDSA-AES256-SHA384 | [RFC5289] | +| 0xC025 | TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 | ECDH-ECDSA-AES128-SHA256 | [RFC5289] | +| 0xC026 | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 | ECDH-ECDSA-AES256-SHA384 | [RFC5289] | +| 0xC027 | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | ECDHE-RSA-AES128-SHA256 | [RFC5289] | +| 0xC028 | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 | ECDHE-RSA-AES256-SHA384 | [RFC5289] | +| 0xC029 | TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 | ECDH-RSA-AES128-SHA256 | [RFC5289] | +| 0xC02A | TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 | ECDH-RSA-AES256-SHA384 | [RFC5289] | +| 0xC02B | TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | ECDHE-ECDSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC02C | TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 | ECDHE-ECDSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC02D | TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 | ECDH-ECDSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC02E | TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 | ECDH-ECDSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC02F | TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | ECDHE-RSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC030 | TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | ECDHE-RSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC031 | TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 | ECDH-RSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC032 | TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 | ECDH-RSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC033 | TLS_ECDHE_PSK_WITH_RC4_128_SHA | ECDHE-PSK-RC4-SHA | [RFC5489][RFC6347] | +| 0xC034 | TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA | ECDHE-PSK-3DES-EDE-CBC-SHA | [RFC5489] | +| 0xC035 | TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA | ECDHE-PSK-AES128-CBC-SHA | [RFC5489] | +| 0xC036 | TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA | ECDHE-PSK-AES256-CBC-SHA | [RFC5489] | +| 0xC037 | TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 | ECDHE-PSK-AES128-CBC-SHA256 | [RFC5489] | +| 0xC038 | TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 | ECDHE-PSK-AES256-CBC-SHA384 | [RFC5489] | +| 0xC039 | TLS_ECDHE_PSK_WITH_NULL_SHA | ECDHE-PSK-NULL-SHA | [RFC5489] | +| 0xC03A | TLS_ECDHE_PSK_WITH_NULL_SHA256 | ECDHE-PSK-NULL-SHA256 | [RFC5489] | +| 0xC03B | TLS_ECDHE_PSK_WITH_NULL_SHA384 | ECDHE-PSK-NULL-SHA384 | [RFC5489] | +| 0xC03C | TLS_RSA_WITH_ARIA_128_CBC_SHA256 | ARIA128-SHA256 | [RFC6209] | +| 0xC03D | TLS_RSA_WITH_ARIA_256_CBC_SHA384 | ARIA256-SHA384 | [RFC6209] | +| 0xC044 | TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 | DHE-RSA-ARIA128-SHA256 | [RFC6209] | +| 0xC045 | TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 | DHE-RSA-ARIA256-SHA384 | [RFC6209] | +| 0xC048 | TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 | ECDHE-ECDSA-ARIA128-SHA256 | [RFC6209] | +| 0xC049 | TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 | ECDHE-ECDSA-ARIA256-SHA384 | [RFC6209] | +| 0xC04A | TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 | ECDH-ECDSA-ARIA128-SHA256 | [RFC6209] | +| 0xC04B | TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 | ECDH-ECDSA-ARIA256-SHA384 | [RFC6209] | +| 0xC04C | TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 | ECDHE-ARIA128-SHA256 | [RFC6209] | +| 0xC04D | TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 | ECDHE-ARIA256-SHA384 | [RFC6209] | +| 0xC04E | TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 | ECDH-ARIA128-SHA256 | [RFC6209] | +| 0xC04F | TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 | ECDH-ARIA256-SHA384 | [RFC6209] | +| 0xC050 | TLS_RSA_WITH_ARIA_128_GCM_SHA256 | ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC051 | TLS_RSA_WITH_ARIA_256_GCM_SHA384 | ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC052 | TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 | DHE-RSA-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC053 | TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 | DHE-RSA-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC056 | TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 | DHE-DSS-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC057 | TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 | DHE-DSS-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC05C | TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 | ECDHE-ECDSA-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC05D | TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 | ECDHE-ECDSA-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC05E | TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 | ECDH-ECDSA-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC05F | TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 | ECDH-ECDSA-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC060 | TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 | ECDHE-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC061 | TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 | ECDHE-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC062 | TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 | ECDH-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC063 | TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 | ECDH-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC064 | TLS_PSK_WITH_ARIA_128_CBC_SHA256 | PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC065 | TLS_PSK_WITH_ARIA_256_CBC_SHA384 | PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC066 | TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 | DHE-PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC067 | TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 | DHE-PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC068 | TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 | RSA-PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC069 | TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 | RSA-PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC06A | TLS_PSK_WITH_ARIA_128_GCM_SHA256 | PSK-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC06B | TLS_PSK_WITH_ARIA_256_GCM_SHA384 | PSK-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC06C | TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 | DHE-PSK-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC06D | TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 | DHE-PSK-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC06E | TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 | RSA-PSK-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC06F | TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 | RSA-PSK-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC070 | TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 | ECDHE-PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC071 | TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 | ECDHE-PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC072 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-ECDSA-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC073 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-ECDSA-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC074 | TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDH-ECDSA-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC075 | TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDH-ECDSA-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC076 | TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-RSA-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC077 | TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-RSA-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC078 | TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDH-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC079 | TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDH-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC07A | TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 | CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC07B | TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 | CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC07C | TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | DHE-RSA-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC07D | TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | DHE-RSA-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC086 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDHE-ECDSA-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC087 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDHE-ECDSA-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC088 | TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDH-ECDSA-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC089 | TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDH-ECDSA-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC08A | TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDHE-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC08B | TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDHE-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC08C | TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDH-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC08D | TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDH-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC08E | TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 | PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC08F | TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 | PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC090 | TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 | DHE-PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC091 | TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 | DHE-PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC092 | TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 | RSA-PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC093 | TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 | RSA-PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC094 | TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 | PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC095 | TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 | PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC096 | TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | DHE-PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC097 | TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 | DHE-PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC098 | TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 | RSA-PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC099 | TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 | RSA-PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC09A | TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC09B | TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC09C | TLS_RSA_WITH_AES_128_CCM | AES128-CCM | [RFC6655] | +| 0xC09D | TLS_RSA_WITH_AES_256_CCM | AES256-CCM | [RFC6655] | +| 0xC09E | TLS_DHE_RSA_WITH_AES_128_CCM | DHE-RSA-AES128-CCM | [RFC6655] | +| 0xC09F | TLS_DHE_RSA_WITH_AES_256_CCM | DHE-RSA-AES256-CCM | [RFC6655] | +| 0xC0A0 | TLS_RSA_WITH_AES_128_CCM_8 | AES128-CCM8 | [RFC6655] | +| 0xC0A1 | TLS_RSA_WITH_AES_256_CCM_8 | AES256-CCM8 | [RFC6655] | +| 0xC0A2 | TLS_DHE_RSA_WITH_AES_128_CCM_8 | DHE-RSA-AES128-CCM8 | [RFC6655] | +| 0xC0A3 | TLS_DHE_RSA_WITH_AES_256_CCM_8 | DHE-RSA-AES256-CCM8 | [RFC6655] | +| 0xC0A4 | TLS_PSK_WITH_AES_128_CCM | PSK-AES128-CCM | [RFC6655] | +| 0xC0A5 | TLS_PSK_WITH_AES_256_CCM | PSK-AES256-CCM | [RFC6655] | +| 0xC0A6 | TLS_DHE_PSK_WITH_AES_128_CCM | DHE-PSK-AES128-CCM | [RFC6655] | +| 0xC0A7 | TLS_DHE_PSK_WITH_AES_256_CCM | DHE-PSK-AES256-CCM | [RFC6655] | +| 0xC0A8 | TLS_PSK_WITH_AES_128_CCM_8 | PSK-AES128-CCM8 | [RFC6655] | +| 0xC0A9 | TLS_PSK_WITH_AES_256_CCM_8 | PSK-AES256-CCM8 | [RFC6655] | +| 0xC0AA | TLS_PSK_DHE_WITH_AES_128_CCM_8 | DHE-PSK-AES128-CCM8 | [RFC6655] | +| 0xC0AB | TLS_PSK_DHE_WITH_AES_256_CCM_8 | DHE-PSK-AES256-CCM8 | [RFC6655] | +| 0xC0AC | TLS_ECDHE_ECDSA_WITH_AES_128_CCM | ECDHE-ECDSA-AES128-CCM | [RFC7251] | +| 0xC0AD | TLS_ECDHE_ECDSA_WITH_AES_256_CCM | ECDHE-ECDSA-AES256-CCM | [RFC7251] | +| 0xC0AE | TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 | ECDHE-ECDSA-AES128-CCM8 | [RFC7251] | +| 0xC0AF | TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 | ECDHE-ECDSA-AES256-CCM8 | [RFC7251] | +| 0xC100 | TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC | GOST2012-KUZNYECHIK-KUZNYECHIKOMAC | [RFC9189] | +| 0xC101 | TLS_GOSTR341112_256_WITH_MAGMA_CTR_OMAC | GOST2012-MAGMA-MAGMAOMAC | [RFC9189] | +| 0xC102 | TLS_GOSTR341112_256_WITH_28147_CNT_IMIT | IANA-GOST2012-GOST8912-GOST8912 | [RFC9189] | +| 0xCC13 | | ECDHE-RSA-CHACHA20-POLY1305-OLD | | +| 0xCC14 | | ECDHE-ECDSA-CHACHA20-POLY1305-OLD | | +| 0xCC15 | | DHE-RSA-CHACHA20-POLY1305-OLD | | +| 0xCCA8 | TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-RSA-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCA9 | TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-ECDSA-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAA | TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | DHE-RSA-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAB | TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 | PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAC | TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAD | TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 | DHE-PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAE | TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 | RSA-PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xD001 | TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 | ECDHE-PSK-AES128-GCM-SHA256 | [RFC8442] | +| 0xE011 | | ECDHE-ECDSA-SM4-CBC-SM3 | | +| 0xE051 | | ECDHE-ECDSA-SM4-GCM-SM3 | | +| 0xE052 | | ECDHE-ECDSA-SM4-CCM-SM3 | | +| 0xFF00 | | GOST-MD5 | | +| 0xFF01 | | GOST-GOST94 | | +| 0xFF02 | | GOST-GOST89MAC | | +| 0xFF03 | | GOST-GOST89STREAM | | diff --git a/deps/curl/docs/CIPHERS.md b/deps/curl/docs/CIPHERS.md index 1fb85405..6e899e52 100644 --- a/deps/curl/docs/CIPHERS.md +++ b/deps/curl/docs/CIPHERS.md @@ -1,427 +1,189 @@ -# Ciphers + -TLS 1.3 ciphers are supported since curl 7.61 for OpenSSL 1.1.1+, and since -curl 7.85 for Schannel with options -[`CURLOPT_TLS13_CIPHERS`](https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html) -and +## curl cipher options + +With curl's option [`--tls13-ciphers`](https://curl.se/docs/manpage.html#--tls13-ciphers) -. If you are using a different SSL backend you can try setting TLS 1.3 cipher -suites by using the respective regular cipher option. +or +[`CURLOPT_TLS13_CIPHERS`](https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html) +users can control which cipher suites to consider when negotiating TLS 1.3 +connections. With option +[`--ciphers`](https://curl.se/docs/manpage.html#--ciphers) +or +[`CURLOPT_SSL_CIPHER_LIST`](https://curl.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html) +users can control which cipher suites to consider when negotiating +TLS 1.2 (1.1, 1.0) connections. -The names of the known ciphers differ depending on which TLS backend that -libcurl was built to use. This is an attempt to list known cipher names. +By default, curl may negotiate TLS 1.3 and TLS 1.2 connections, so the cipher +suites considered when negotiating a TLS connection are a union of the TLS 1.3 +and TLS 1.2 cipher suites. If you want curl to consider only TLS 1.3 cipher +suites for the connection, you have to set the minimum TLS version to 1.3 by +using [`--tlsv1.3`](https://curl.se/docs/manpage.html#--tlsv13) +or [`CURLOPT_SSLVERSION`](https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html) +with `CURL_SSLVERSION_TLSv1_3`. -## OpenSSL +Both the TLS 1.3 and TLS 1.2 cipher options expect a list of cipher suites +separated by colons (`:`). This list is parsed opportunistically, cipher suites +that are not recognized or implemented are ignored. As long as there is at +least one recognized cipher suite in the list, the list is considered valid. -(based on [OpenSSL docs](https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html)) +For both the TLS 1.3 and TLS 1.2 cipher options, the order in which the +cipher suites are specified determine the preference of them. When negotiating +a TLS connection the server picks a cipher suite from the intersection of the +cipher suites supported by the server and the cipher suites sent by curl. If +the server is configured to honor the client's cipher preference, the first +common cipher suite in the list sent by curl is chosen. -When specifying multiple cipher names, separate them with colon (`:`). +## TLS 1.3 cipher suites -### SSL3 cipher suites +Setting TLS 1.3 cipher suites is supported by curl with +OpenSSL (1.1.1+, curl 7.61.0+), LibreSSL (3.4.1+, curl 8.3.0+), +wolfSSL (curl 8.10.0+), mbedTLS (3.6.0+, curl 8.10.0+) and +Schannel (curl 7.85.0+). -`NULL-MD5` -`NULL-SHA` -`RC4-MD5` -`RC4-SHA` -`IDEA-CBC-SHA` -`DES-CBC3-SHA` -`DH-DSS-DES-CBC3-SHA` -`DH-RSA-DES-CBC3-SHA` -`DHE-DSS-DES-CBC3-SHA` -`DHE-RSA-DES-CBC3-SHA` -`ADH-RC4-MD5` -`ADH-DES-CBC3-SHA` +The list of cipher suites that can be used for the `--tls13-ciphers` option: +``` +TLS_AES_128_GCM_SHA256 +TLS_AES_256_GCM_SHA384 +TLS_CHACHA20_POLY1305_SHA256 +TLS_AES_128_CCM_SHA256 +TLS_AES_128_CCM_8_SHA256 +``` -### TLS v1.0 cipher suites +### wolfSSL notes -`NULL-MD5` -`NULL-SHA` -`RC4-MD5` -`RC4-SHA` -`IDEA-CBC-SHA` -`DES-CBC3-SHA` -`DHE-DSS-DES-CBC3-SHA` -`DHE-RSA-DES-CBC3-SHA` -`ADH-RC4-MD5` -`ADH-DES-CBC3-SHA` +In addition to above list the following cipher suites can be used: +`TLS_SM4_GCM_SM3` `TLS_SM4_CCM_SM3` `TLS_SHA256_SHA256` `TLS_SHA384_SHA384`. +Usage of these cipher suites is not recommended. (The last two cipher suites +are NULL ciphers, offering no encryption whatsoever.) -### AES cipher suites from RFC 3268, extending TLS v1.0 +### Schannel notes -`AES128-SHA` -`AES256-SHA` -`DH-DSS-AES128-SHA` -`DH-DSS-AES256-SHA` -`DH-RSA-AES128-SHA` -`DH-RSA-AES256-SHA` -`DHE-DSS-AES128-SHA` -`DHE-DSS-AES256-SHA` -`DHE-RSA-AES128-SHA` -`DHE-RSA-AES256-SHA` -`ADH-AES128-SHA` -`ADH-AES256-SHA` +Schannel does not support setting individual TLS 1.3 cipher suites directly. +To support `--tls13-ciphers` curl emulates it by adding or restricting +algorithms to use. Due to this the specified order of preference of the +cipher suites is not taken into account. -### SEED cipher suites from RFC 4162, extending TLS v1.0 +## TLS 1.2 (1.1, 1.0) cipher suites -`SEED-SHA` -`DH-DSS-SEED-SHA` -`DH-RSA-SEED-SHA` -`DHE-DSS-SEED-SHA` -`DHE-RSA-SEED-SHA` -`ADH-SEED-SHA` +Setting TLS 1.2 cipher suites is supported by curl with OpenSSL, LibreSSL, +BoringSSL, mbedTLS (curl 8.8.0+), wolfSSL (curl 7.53.0+), +Secure Transport (curl 7.77.0+) and BearSSL (curl 7.83.0+). Schannel does not +support setting cipher suites directly, but does support setting algorithms +(curl 7.61.0+), see Schannel notes below. -### GOST cipher suites, extending TLS v1.0 +For TLS 1.2 cipher suites there are multiple naming schemes, the two most used +are with OpenSSL names (e.g. `ECDHE-RSA-AES128-GCM-SHA256`) and IANA names +(e.g. `TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256`). IANA names of TLS 1.2 cipher +suites look similar to TLS 1.3 cipher suite names, to distinguish them note +that TLS 1.2 names contain `_WITH_`, while TLS 1.3 names do not. When setting +TLS 1.2 cipher suites with curl it is recommended that you use OpenSSL names +as these are most widely recognized by the supported SSL backends. -`GOST94-GOST89-GOST89` -`GOST2001-GOST89-GOST89` -`GOST94-NULL-GOST94` -`GOST2001-NULL-GOST94` +The complete list of cipher suites that may be considered for the `--ciphers` +option is extensive, it consists of more than 300 ciphers suites. However, +nowadays for most of them their usage is discouraged, and support for a lot of +them have been removed from the various SSL backends, if ever implemented at +all. -### Elliptic curve cipher suites +A shortened list (based on [recommendations by +Mozilla](https://wiki.mozilla.org/Security/Server_Side_TLS)) of cipher suites, +which are (mostly) supported by all SSL backends, that can be used for the +`--ciphers` option: +``` +ECDHE-ECDSA-AES128-GCM-SHA256 +ECDHE-RSA-AES128-GCM-SHA256 +ECDHE-ECDSA-AES256-GCM-SHA384 +ECDHE-RSA-AES256-GCM-SHA384 +ECDHE-ECDSA-CHACHA20-POLY1305 +ECDHE-RSA-CHACHA20-POLY1305 +DHE-RSA-AES128-GCM-SHA256 +DHE-RSA-AES256-GCM-SHA384 +DHE-RSA-CHACHA20-POLY1305 +ECDHE-ECDSA-AES128-SHA256 +ECDHE-RSA-AES128-SHA256 +ECDHE-ECDSA-AES128-SHA +ECDHE-RSA-AES128-SHA +ECDHE-ECDSA-AES256-SHA384 +ECDHE-RSA-AES256-SHA384 +ECDHE-ECDSA-AES256-SHA +ECDHE-RSA-AES256-SHA +DHE-RSA-AES128-SHA256 +DHE-RSA-AES256-SHA256 +AES128-GCM-SHA256 +AES256-GCM-SHA384 +AES128-SHA256 +AES256-SHA256 +AES128-SHA +AES256-SHA +DES-CBC3-SHA +``` -`ECDHE-RSA-NULL-SHA` -`ECDHE-RSA-RC4-SHA` -`ECDHE-RSA-DES-CBC3-SHA` -`ECDHE-RSA-AES128-SHA` -`ECDHE-RSA-AES256-SHA` -`ECDHE-ECDSA-NULL-SHA` -`ECDHE-ECDSA-RC4-SHA` -`ECDHE-ECDSA-DES-CBC3-SHA` -`ECDHE-ECDSA-AES128-SHA` -`ECDHE-ECDSA-AES256-SHA` -`AECDH-NULL-SHA` -`AECDH-RC4-SHA` -`AECDH-DES-CBC3-SHA` -`AECDH-AES128-SHA` -`AECDH-AES256-SHA` +See this [list](https://github.com/curl/curl/blob/master/docs/CIPHERS-TLS12.md) +for a complete list of TLS 1.2 cipher suites. -### TLS v1.2 cipher suites +### OpenSSL notes -`NULL-SHA256` -`AES128-SHA256` -`AES256-SHA256` -`AES128-GCM-SHA256` -`AES256-GCM-SHA384` -`DH-RSA-AES128-SHA256` -`DH-RSA-AES256-SHA256` -`DH-RSA-AES128-GCM-SHA256` -`DH-RSA-AES256-GCM-SHA384` -`DH-DSS-AES128-SHA256` -`DH-DSS-AES256-SHA256` -`DH-DSS-AES128-GCM-SHA256` -`DH-DSS-AES256-GCM-SHA384` -`DHE-RSA-AES128-SHA256` -`DHE-RSA-AES256-SHA256` -`DHE-RSA-AES128-GCM-SHA256` -`DHE-RSA-AES256-GCM-SHA384` -`DHE-DSS-AES128-SHA256` -`DHE-DSS-AES256-SHA256` -`DHE-DSS-AES128-GCM-SHA256` -`DHE-DSS-AES256-GCM-SHA384` -`ECDHE-RSA-AES128-SHA256` -`ECDHE-RSA-AES256-SHA384` -`ECDHE-RSA-AES128-GCM-SHA256` -`ECDHE-RSA-AES256-GCM-SHA384` -`ECDHE-ECDSA-AES128-SHA256` -`ECDHE-ECDSA-AES256-SHA384` -`ECDHE-ECDSA-AES128-GCM-SHA256` -`ECDHE-ECDSA-AES256-GCM-SHA384` -`ADH-AES128-SHA256` -`ADH-AES256-SHA256` -`ADH-AES128-GCM-SHA256` -`ADH-AES256-GCM-SHA384` -`AES128-CCM` -`AES256-CCM` -`DHE-RSA-AES128-CCM` -`DHE-RSA-AES256-CCM` -`AES128-CCM8` -`AES256-CCM8` -`DHE-RSA-AES128-CCM8` -`DHE-RSA-AES256-CCM8` -`ECDHE-ECDSA-AES128-CCM` -`ECDHE-ECDSA-AES256-CCM` -`ECDHE-ECDSA-AES128-CCM8` -`ECDHE-ECDSA-AES256-CCM8` +In addition to specifying a list of cipher suites, OpenSSL also accepts a +format with specific cipher strings (like `TLSv1.2`, `AESGCM`, `CHACHA20`) and +`!`, `-` and `+` operators. Refer to the +[OpenSSL cipher documentation](https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-list-format) +for further information on that format. -### Camellia HMAC-Based cipher suites from RFC 6367, extending TLS v1.2 +### Schannel notes -`ECDHE-ECDSA-CAMELLIA128-SHA256` -`ECDHE-ECDSA-CAMELLIA256-SHA384` -`ECDHE-RSA-CAMELLIA128-SHA256` -`ECDHE-RSA-CAMELLIA256-SHA384` +Schannel does not support setting individual TLS 1.2 cipher suites directly. +It only allows the enabling and disabling of encryption algorithms. These are +in the form of `CALG_xxx`, see the [Schannel `ALG_ID` +documentation](https://docs.microsoft.com/windows/desktop/SecCrypto/alg-id) +for a list of these algorithms. Also, (since curl 7.77.0) +`SCH_USE_STRONG_CRYPTO` can be given to pass that flag to Schannel, lookup the +[documentation for the Windows version in +use](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel) +to see how that affects the cipher suite selection. When not specifying the +`--chiphers` and `--tl13-ciphers` options curl passes this flag by default. -### TLS 1.3 cipher suites +## Examples -(Note these ciphers are set with `CURLOPT_TLS13_CIPHERS` and `--tls13-ciphers`) +```sh +curl \ + --tls13-ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256 \ + --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\ +ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305 \ + https://example.com/ +``` +Restrict ciphers to `aes128-gcm` and `chacha20`. Works with OpenSSL, LibreSSL, +mbedTLS and wolfSSL. -`TLS_AES_256_GCM_SHA384` -`TLS_CHACHA20_POLY1305_SHA256` -`TLS_AES_128_GCM_SHA256` -`TLS_AES_128_CCM_8_SHA256` -`TLS_AES_128_CCM_SHA256` +```sh +curl \ + --tlsv1.3 \ + --tls13-ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256 \ + https://example.com/ +``` +Restrict to only TLS 1.3 with `aes128-gcm` and `chacha20` ciphers. Works with +OpenSSL, LibreSSL, mbedTLS, wolfSSL and Schannel. -## WolfSSL +```sh +curl \ + --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\ +ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305 \ + https://example.com/ +``` +Restrict TLS 1.2 ciphers to `aes128-gcm` and `chacha20`, use default TLS 1.3 +ciphers (if TLS 1.3 is available). Works with OpenSSL, LibreSSL, BoringSSL, +mbedTLS, wolfSSL, Secure Transport and BearSSL. -`RC4-SHA`, -`RC4-MD5`, -`DES-CBC3-SHA`, -`AES128-SHA`, -`AES256-SHA`, -`NULL-SHA`, -`NULL-SHA256`, -`DHE-RSA-AES128-SHA`, -`DHE-RSA-AES256-SHA`, -`DHE-PSK-AES256-GCM-SHA384`, -`DHE-PSK-AES128-GCM-SHA256`, -`PSK-AES256-GCM-SHA384`, -`PSK-AES128-GCM-SHA256`, -`DHE-PSK-AES256-CBC-SHA384`, -`DHE-PSK-AES128-CBC-SHA256`, -`PSK-AES256-CBC-SHA384`, -`PSK-AES128-CBC-SHA256`, -`PSK-AES128-CBC-SHA`, -`PSK-AES256-CBC-SHA`, -`DHE-PSK-AES128-CCM`, -`DHE-PSK-AES256-CCM`, -`PSK-AES128-CCM`, -`PSK-AES256-CCM`, -`PSK-AES128-CCM-8`, -`PSK-AES256-CCM-8`, -`DHE-PSK-NULL-SHA384`, -`DHE-PSK-NULL-SHA256`, -`PSK-NULL-SHA384`, -`PSK-NULL-SHA256`, -`PSK-NULL-SHA`, -`HC128-MD5`, -`HC128-SHA`, -`HC128-B2B256`, -`AES128-B2B256`, -`AES256-B2B256`, -`RABBIT-SHA`, -`NTRU-RC4-SHA`, -`NTRU-DES-CBC3-SHA`, -`NTRU-AES128-SHA`, -`NTRU-AES256-SHA`, -`AES128-CCM-8`, -`AES256-CCM-8`, -`ECDHE-ECDSA-AES128-CCM`, -`ECDHE-ECDSA-AES128-CCM-8`, -`ECDHE-ECDSA-AES256-CCM-8`, -`ECDHE-RSA-AES128-SHA`, -`ECDHE-RSA-AES256-SHA`, -`ECDHE-ECDSA-AES128-SHA`, -`ECDHE-ECDSA-AES256-SHA`, -`ECDHE-RSA-RC4-SHA`, -`ECDHE-RSA-DES-CBC3-SHA`, -`ECDHE-ECDSA-RC4-SHA`, -`ECDHE-ECDSA-DES-CBC3-SHA`, -`AES128-SHA256`, -`AES256-SHA256`, -`DHE-RSA-AES128-SHA256`, -`DHE-RSA-AES256-SHA256`, -`ECDH-RSA-AES128-SHA`, -`ECDH-RSA-AES256-SHA`, -`ECDH-ECDSA-AES128-SHA`, -`ECDH-ECDSA-AES256-SHA`, -`ECDH-RSA-RC4-SHA`, -`ECDH-RSA-DES-CBC3-SHA`, -`ECDH-ECDSA-RC4-SHA`, -`ECDH-ECDSA-DES-CBC3-SHA`, -`AES128-GCM-SHA256`, -`AES256-GCM-SHA384`, -`DHE-RSA-AES128-GCM-SHA256`, -`DHE-RSA-AES256-GCM-SHA384`, -`ECDHE-RSA-AES128-GCM-SHA256`, -`ECDHE-RSA-AES256-GCM-SHA384`, -`ECDHE-ECDSA-AES128-GCM-SHA256`, -`ECDHE-ECDSA-AES256-GCM-SHA384`, -`ECDH-RSA-AES128-GCM-SHA256`, -`ECDH-RSA-AES256-GCM-SHA384`, -`ECDH-ECDSA-AES128-GCM-SHA256`, -`ECDH-ECDSA-AES256-GCM-SHA384`, -`CAMELLIA128-SHA`, -`DHE-RSA-CAMELLIA128-SHA`, -`CAMELLIA256-SHA`, -`DHE-RSA-CAMELLIA256-SHA`, -`CAMELLIA128-SHA256`, -`DHE-RSA-CAMELLIA128-SHA256`, -`CAMELLIA256-SHA256`, -`DHE-RSA-CAMELLIA256-SHA256`, -`ECDHE-RSA-AES128-SHA256`, -`ECDHE-ECDSA-AES128-SHA256`, -`ECDH-RSA-AES128-SHA256`, -`ECDH-ECDSA-AES128-SHA256`, -`ECDHE-RSA-AES256-SHA384`, -`ECDHE-ECDSA-AES256-SHA384`, -`ECDH-RSA-AES256-SHA384`, -`ECDH-ECDSA-AES256-SHA384`, -`ECDHE-RSA-CHACHA20-POLY1305`, -`ECDHE-ECDSA-CHACHA20-POLY1305`, -`DHE-RSA-CHACHA20-POLY1305`, -`ECDHE-RSA-CHACHA20-POLY1305-OLD`, -`ECDHE-ECDSA-CHACHA20-POLY1305-OLD`, -`DHE-RSA-CHACHA20-POLY1305-OLD`, -`ADH-AES128-SHA`, -`QSH`, -`RENEGOTIATION-INFO`, -`IDEA-CBC-SHA`, -`ECDHE-ECDSA-NULL-SHA`, -`ECDHE-PSK-NULL-SHA256`, -`ECDHE-PSK-AES128-CBC-SHA256`, -`PSK-CHACHA20-POLY1305`, -`ECDHE-PSK-CHACHA20-POLY1305`, -`DHE-PSK-CHACHA20-POLY1305`, -`EDH-RSA-DES-CBC3-SHA`, - -## Schannel - -Schannel allows the enabling and disabling of encryption algorithms, but not -specific cipher suites, prior to TLS 1.3. The algorithms are -[defined](https://docs.microsoft.com/windows/desktop/SecCrypto/alg-id) by -Microsoft. - -The algorithms below are for TLS 1.2 and earlier. TLS 1.3 is covered in the -next section. - -There is also the case that the selected algorithm is not supported by the -protocol or does not match the ciphers offered by the server during the SSL -negotiation. In this case curl returns error -`CURLE_SSL_CONNECT_ERROR (35) SEC_E_ALGORITHM_MISMATCH` -and the request fails. - -`CALG_MD2`, -`CALG_MD4`, -`CALG_MD5`, -`CALG_SHA`, -`CALG_SHA1`, -`CALG_MAC`, -`CALG_RSA_SIGN`, -`CALG_DSS_SIGN`, -`CALG_NO_SIGN`, -`CALG_RSA_KEYX`, -`CALG_DES`, -`CALG_3DES_112`, -`CALG_3DES`, -`CALG_DESX`, -`CALG_RC2`, -`CALG_RC4`, -`CALG_SEAL`, -`CALG_DH_SF`, -`CALG_DH_EPHEM`, -`CALG_AGREEDKEY_ANY`, -`CALG_HUGHES_MD5`, -`CALG_SKIPJACK`, -`CALG_TEK`, -`CALG_CYLINK_MEK`, -`CALG_SSL3_SHAMD5`, -`CALG_SSL3_MASTER`, -`CALG_SCHANNEL_MASTER_HASH`, -`CALG_SCHANNEL_MAC_KEY`, -`CALG_SCHANNEL_ENC_KEY`, -`CALG_PCT1_MASTER`, -`CALG_SSL2_MASTER`, -`CALG_TLS1_MASTER`, -`CALG_RC5`, -`CALG_HMAC`, -`CALG_TLS1PRF`, -`CALG_HASH_REPLACE_OWF`, -`CALG_AES_128`, -`CALG_AES_192`, -`CALG_AES_256`, -`CALG_AES`, -`CALG_SHA_256`, -`CALG_SHA_384`, -`CALG_SHA_512`, -`CALG_ECDH`, -`CALG_ECMQV`, -`CALG_ECDSA`, -`CALG_ECDH_EPHEM`, - -As of curl 7.77.0, you can also pass `SCH_USE_STRONG_CRYPTO` as a cipher name -to [constrain the set of available ciphers as specified in the Schannel -documentation](https://docs.microsoft.com/en-us/windows/win32/secauthn/tls-cipher-suites-in-windows-server-2022). -Note that the supported ciphers in this case follow the OS version, so if you -are running an outdated OS you might still be supporting weak ciphers. - -### TLS 1.3 cipher suites - -You can set TLS 1.3 ciphers for Schannel by using `CURLOPT_TLS13_CIPHERS` or -`--tls13-ciphers` with the names below. - -If TLS 1.3 cipher suites are set then libcurl adds or restricts Schannel TLS -1.3 algorithms automatically. Essentially, libcurl is emulating support for -individual TLS 1.3 cipher suites since Schannel does not support it directly. - -`TLS_AES_256_GCM_SHA384` -`TLS_AES_128_GCM_SHA256` -`TLS_CHACHA20_POLY1305_SHA256` -`TLS_AES_128_CCM_8_SHA256` -`TLS_AES_128_CCM_SHA256` - -Note if you set TLS 1.3 ciphers without also setting the minimum TLS version -to 1.3 then it is possible Schannel may negotiate an earlier TLS version and -cipher suite if your libcurl and OS settings allow it. You can set the minimum -TLS version by using `CURLOPT_SSLVERSION` or `--tlsv1.3`. - -## BearSSL - -BearSSL ciphers can be specified by either the OpenSSL name (`ECDHE-RSA-AES128-GCM-SHA256`) or the IANA name (`TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256`). - -Since BearSSL 0.1: - -`DES-CBC3-SHA` -`AES128-SHA` -`AES256-SHA` -`AES128-SHA256` -`AES256-SHA256` -`AES128-GCM-SHA256` -`AES256-GCM-SHA384` -`ECDH-ECDSA-DES-CBC3-SHA` -`ECDH-ECDSA-AES128-SHA` -`ECDH-ECDSA-AES256-SHA` -`ECDHE-ECDSA-DES-CBC3-SHA` -`ECDHE-ECDSA-AES128-SHA` -`ECDHE-ECDSA-AES256-SHA` -`ECDH-RSA-DES-CBC3-SHA` -`ECDH-RSA-AES128-SHA` -`ECDH-RSA-AES256-SHA` -`ECDHE-RSA-DES-CBC3-SHA` -`ECDHE-RSA-AES128-SHA` -`ECDHE-RSA-AES256-SHA` -`ECDHE-ECDSA-AES128-SHA256` -`ECDHE-ECDSA-AES256-SHA384` -`ECDH-ECDSA-AES128-SHA256` -`ECDH-ECDSA-AES256-SHA384` -`ECDHE-RSA-AES128-SHA256` -`ECDHE-RSA-AES256-SHA384` -`ECDH-RSA-AES128-SHA256` -`ECDH-RSA-AES256-SHA384` -`ECDHE-ECDSA-AES128-GCM-SHA256` -`ECDHE-ECDSA-AES256-GCM-SHA384` -`ECDH-ECDSA-AES128-GCM-SHA256` -`ECDH-ECDSA-AES256-GCM-SHA384` -`ECDHE-RSA-AES128-GCM-SHA256` -`ECDHE-RSA-AES256-GCM-SHA384` -`ECDH-RSA-AES128-GCM-SHA256` -`ECDH-RSA-AES256-GCM-SHA384` - -Since BearSSL 0.2: - -`ECDHE-RSA-CHACHA20-POLY1305` -`ECDHE-ECDSA-CHACHA20-POLY1305` - -Since BearSSL 0.6: - -`AES128-CCM` -`AES256-CCM` -`AES128-CCM8` -`AES256-CCM8` -`ECDHE-ECDSA-AES128-CCM` -`ECDHE-ECDSA-AES256-CCM` -`ECDHE-ECDSA-AES128-CCM8` -`ECDHE-ECDSA-AES256-CCM8` +## Further reading +- [OpenSSL cipher suite names documentation](https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-suite-names) +- [wolfSSL cipher support documentation](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter04.html#cipher-support) +- [mbedTLS cipher suites reference](https://mbed-tls.readthedocs.io/projects/api/en/development/api/file/ssl__ciphersuites_8h/) +- [Schannel cipher suites documentation](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel) +- [BearSSL supported crypto](https://www.bearssl.org/support.html) +- [Secure Transport cipher suite values](https://developer.apple.com/documentation/security/1550981-ssl_cipher_suite_values) +- [IANA cipher suites list](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4) +- [Wikipedia cipher suite article](https://en.wikipedia.org/wiki/Cipher_suite) diff --git a/deps/curl/docs/CMakeLists.txt b/deps/curl/docs/CMakeLists.txt index 9c0b3769..8a5c87f9 100644 --- a/deps/curl/docs/CMakeLists.txt +++ b/deps/curl/docs/CMakeLists.txt @@ -21,10 +21,26 @@ # SPDX-License-Identifier: curl # ########################################################################### -#add_subdirectory(examples) + if(BUILD_LIBCURL_DOCS) add_subdirectory(libcurl) endif() if(ENABLE_CURL_MANUAL AND BUILD_CURL_EXE) add_subdirectory(cmdline-opts) endif() + +if(BUILD_MISC_DOCS) + foreach(_man_misc IN ITEMS "curl-config" "mk-ca-bundle") + set(_man_target "${CMAKE_CURRENT_BINARY_DIR}/${_man_misc}.1") + add_custom_command(OUTPUT "${_man_target}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" "${_man_misc}.md" > "${_man_target}" + DEPENDS "${_man_misc}.md" + VERBATIM + ) + add_custom_target("curl-generate-${_man_misc}.1" ALL DEPENDS "${_man_target}") + if(NOT CURL_DISABLE_INSTALL) + install(FILES "${_man_target}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + endif() + endforeach() +endif() diff --git a/deps/curl/docs/CODE_OF_CONDUCT.md b/deps/curl/docs/CODE_OF_CONDUCT.md index 1f71c387..5c887818 100644 --- a/deps/curl/docs/CODE_OF_CONDUCT.md +++ b/deps/curl/docs/CODE_OF_CONDUCT.md @@ -1,3 +1,9 @@ + + Contributor Code of Conduct =========================== diff --git a/deps/curl/docs/CODE_REVIEW.md b/deps/curl/docs/CODE_REVIEW.md index 0776d30a..bee26a3f 100644 --- a/deps/curl/docs/CODE_REVIEW.md +++ b/deps/curl/docs/CODE_REVIEW.md @@ -1,3 +1,9 @@ + + # How to do code reviews for curl Anyone and everyone is encouraged and welcome to review code submissions in @@ -135,13 +141,13 @@ data. Where it comes from and where it goes. `size_t` is not a fixed size. `time_t` can be signed or unsigned and have different sizes. Relying on variable sizes is a red flag. -Also remember that endianness and >= 32 bit accesses to unaligned addresses +Also remember that endianness and >= 32-bit accesses to unaligned addresses are problematic areas. ## Integer overflows -Be careful about integer overflows. Some variable types can be either 32 bit -or 64 bit. Integer overflows must be detected and acted on *before* they +Be careful about integer overflows. Some variable types can be either 32-bit +or 64-bit. Integer overflows must be detected and acted on *before* they happen. ## Dangerous use of functions diff --git a/deps/curl/docs/CONTRIBUTE.md b/deps/curl/docs/CONTRIBUTE.md index 6288dac9..8860f87c 100644 --- a/deps/curl/docs/CONTRIBUTE.md +++ b/deps/curl/docs/CONTRIBUTE.md @@ -1,3 +1,9 @@ + + # Contributing to the curl project This document is intended to offer guidelines on how to best contribute to the @@ -18,7 +24,7 @@ Before posting to one of the curl mailing lists, please read up on the We also hang out on IRC in #curl on libera.chat If you are at all interested in the code side of things, consider clicking -'watch' on the [curl repo on GitHub](https://github.com/curl/curl) to be +'watch' on the [curl repository on GitHub](https://github.com/curl/curl) to be notified of pull requests and new issues posted there. ## License and copyright @@ -77,11 +83,11 @@ fix one bug at a time and send them as separate patches. ### Write Separate Changes -It is annoying when you get a huge patch from someone that is said to fix 511 -odd problems, but discussions and opinions do not agree with 510 of them - or -509 of them were already fixed in a different way. Then the person merging -this change needs to extract the single interesting patch from somewhere -within the huge pile of source, and that creates a lot of extra work. +It is annoying when you get a huge patch from someone that is said to fix 11 +odd problems, but discussions and opinions do not agree with 10 of them - or 9 +of them were already fixed in a different way. Then the person merging this +change needs to extract the single interesting patch from somewhere within the +huge pile of source, and that creates a lot of extra work. Preferably, each fix that corrects a problem should be in its own patch/commit with its own description/commit message stating exactly what they correct so @@ -123,9 +129,9 @@ If you do not have test cases or perhaps you have done something that is hard to write tests for, do explain exactly how you have otherwise tested and verified your changes. -## Submit Your Changes +# Submit Your Changes -### How to get your changes into the main sources +## Get your changes merged Ideally you file a [pull request on GitHub](https://github.com/curl/curl/pulls), but you can also send your plain @@ -147,7 +153,7 @@ fix nits/flaws. This is important. We take lack of replies as a sign that you are not anxious to get your patch accepted and we tend to simply drop such changes. -### About pull requests +## About pull requests With GitHub it is easy to send a [pull request](https://github.com/curl/curl/pulls) to the curl project to have @@ -179,7 +185,23 @@ checks and qualifications this pull request must also receive more "votes" of user support. More signs that people want this to happen. It could be in the form of messages saying so, or thumbs-up reactions on GitHub. -### Making quality changes +## When the pull request is approved + +If it does not seem to get approved when you think it is ready - feel free to +ask for approval. + +Once your pull request has been approved it can be merged by a maintainer. + +For new features, or changes, we require that the *feature window* is open for +the pull request to be merged. This is typically a three week period that +starts ten days after a previous release. New features submitted as pull +requests while the window is closed simply have to wait until it opens to get +merged. + +If time passes without your approved pull request gets merged: feel free to +ask what more you can do to make it happen. + +## Making quality changes Make the patch against as recent source versions as possible. @@ -187,48 +209,22 @@ If you have followed the tips in this document and your patch still has not been incorporated or responded to after some weeks, consider resubmitting it to the list or better yet: change it to a pull request. -### Commit messages +## Commit messages -A short guide to how to write git commit messages in the curl project. +How to write git commit messages in the curl project. ---- start ---- [area]: [short line describing the main effect] -- empty line -- [full description, no wider than 72 columns that describes as much as possible as to why this change is made, and possibly what things - it fixes and everything else that is related, with unwieldy URLs replaced - with references like [0], [1], etc.] - -- empty line -- - [[0] URL - Reference to a URL in the description, almost like Markdown; - the last numbered reference is followed by an -- empty line -- ] - [Follow-up to {shorthash} - if this fixes or continues a previous commit; - add a Ref: that commit's PR or issue if it's not a small, obvious fix; - followed by an -- empty line -- ] - [Bug: URL to the source of the report or more related discussion; use Fixes - for GitHub issues instead when that is appropriate] - [Approved-by: John Doe - credit someone who approved the PR; if you are - committing this for someone else using --author=... you do not need this - as you are implicitly approving it by committing] - [Authored-by: John Doe - credit the original author of the code; only use - this if you cannot use "git commit --author=..."] - [Signed-off-by: John Doe - we do not use this, but do not bother removing it] - [whatever-else-by: credit all helpers, finders, doers; try to use one of - the following keywords if at all possible, for consistency: - Acked-by:, Assisted-by:, Co-authored-by:, Found-by:, Reported-by:, - Reviewed-by:, Suggested-by:, Tested-by:] - [Ref: #1234 - if this is related to a GitHub issue or PR, possibly one that - has already been closed] - [Ref: URL to more information about the commit; use Bug: instead for - a reference to a bug on another bug tracker] - [Fixes #1234 - if this closes a GitHub issue; GitHub closes the issue once - this commit is merged] - [Closes #1234 - if this closes a GitHub PR; GitHub closes the PR once this - commit is merged] - ---- stop ---- + it fixes and everything else that is related, + -- end -- -The first line is a succinct description of the change: +The first line is a succinct description of the change and should ideally work +as a single line in the RELEASE NOTES. - - use the imperative, present tense: "change" not "changed" nor "changes" + - use the imperative, present tense: **change** not "changed" nor "changes" - do not capitalize the first letter - no period (.) at the end @@ -236,72 +232,66 @@ The `[area]` in the first line can be `http2`, `cookies`, `openssl` or similar. There is no fixed list to select from but using the same "area" as other related changes could make sense. -Do not forget to use commit --author=... if you commit someone else's work, and -make sure that you have your own user and email setup correctly in git before -you commit. +## Commit message keywords + +Use the following ways to improve the message and provide pointers to related +work. + +- `Follow-up to {shorthash}` - if this fixes or continues a previous commit; +add a `Ref:` that commit's PR or issue if it is not a small, obvious fix; +followed by an empty line + +- `Bug: URL` to the source of the report or more related discussion; use +`Fixes` for GitHub issues instead when that is appropriate. + +- `Approved-by: John Doe` - credit someone who approved the PR. + +- `Authored-by: John Doe` - credit the original author of the code; only use +this if you cannot use `git commit --author=...`. + +- `Signed-off-by: John Doe` - we do not use this, but do not bother removing + it. + +- `whatever-else-by:` credit all helpers, finders, doers; try to use one of +the following keywords if at all possible, for consistency: `Acked-by:`, +`Assisted-by:`, `Co-authored-by:`, `Found-by:`, `Reported-by:`, +`Reviewed-by:`, `Suggested-by:`, `Tested-by:`. + +- `Ref: #1234` - if this is related to a GitHub issue or PR, possibly one that +has already been closed. + +- `Ref: URL` to more information about the commit; use `Bug:` instead for a +reference to a bug on another bug tracker] + +- `Fixes #1234` - if this fixes a GitHub issue; GitHub closes the issue once +this commit is merged. + +- `Closes #1234` - if this merges a GitHub PR; GitHub closes the PR once this +commit is merged. + +Do not forget to use commit with `--author` if you commit someone else's work, +and make sure that you have your own user and email setup correctly in git +before you commit. Add whichever header lines as appropriate, with one line per person if more than one person was involved. There is no need to credit yourself unless you -are using --author=... which hides your identity. Do not include people's -email addresses in headers to avoid spam, unless they are already public from -a previous commit; saying `{userid} on github` is OK. +are using `--author` which hides your identity. Do not include people's email +addresses in headers to avoid spam, unless they are already public from a +previous commit; saying `{userid} on github` is OK. -### Write Access to git Repository +## Push Access If you are a frequent contributor, you may be given push access to the git repository and then you are able to push your changes straight into the git -repo instead of sending changes as pull requests or by mail as patches. +repository instead of sending changes as pull requests or by mail as patches. 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. -### How To Make a Patch with git - -You need to first checkout the repository: - - git clone https://github.com/curl/curl.git - -You then proceed and edit all the files you like and you commit them to your -local repository: - - git commit [file] - -As usual, group your commits so that you commit all changes at once that -constitute a logical change. - -Once you have done all your commits and you are happy with what you see, you -can make patches out of your changes that are suitable for mailing: - - git format-patch remotes/origin/master - -This creates files in your local directory named `NNNN-[name].patch` for each -commit. - -Now send those patches off to the curl-library list. You can of course opt to -do that with the 'git send-email' command. - -### How To Make a Patch without git - -Keep a copy of the unmodified curl sources. Make your changes in a separate -source tree. When you think you have something that you want to offer the -curl community, use GNU diff to generate patches. - -If you have modified a single file, try something like: - - diff -u unmodified-file.c my-changed-one.c > my-fixes.diff - -If you have modified several files, possibly in different directories, you -can use diff recursively: - - diff -ur curl-original-dir curl-modified-sources-dir > my-fixes.diff - -The GNU diff and GNU patch tools exist for virtually all platforms, including -all kinds of Unixes and Windows. - -### Useful resources +## Useful resources - [Webinar on getting code into cURL](https://www.youtube.com/watch?v=QmZ3W1d6LQI) -## Update copyright and license information +# Update copyright and license information There is a CI job called **REUSE compliance / check** that runs on every pull request and commit to verify that the *REUSE state* of all files are still @@ -309,9 +299,9 @@ fine. This means that all files need to have their license and copyright information clearly stated. Ideally by having the standard curl source code header, with -the SPDX-License-Identifier included. If the header does not work, you can use a -smaller header or add the information for a specific file to the `.reuse/dep5` -file. +the `SPDX-License-Identifier` included. If the header does not work, you can +use a smaller header or add the information for a specific file to the +`REUSE.toml` file. You can manually verify the copyright and compliance status by running the -`./scripts/copyright.pl` script in the root of the git repository. +[REUSE helper tool](https://github.com/fsfe/reuse-tool): `reuse lint` diff --git a/deps/curl/docs/CURL-DISABLE.md b/deps/curl/docs/CURL-DISABLE.md index 7978ed21..63de4026 100644 --- a/deps/curl/docs/CURL-DISABLE.md +++ b/deps/curl/docs/CURL-DISABLE.md @@ -1,3 +1,9 @@ + + # Code defines to disable features and protocols ## `CURL_DISABLE_ALTSVC` @@ -34,7 +40,11 @@ Disable support for the negotiate authentication methods. ## `CURL_DISABLE_AWS` -Disable **AWS-SIG4** support. +Disable **aws-sigv4** support. + +## `CURL_DISABLE_CA_SEARCH` + +Disable unsafe CA bundle search in PATH on Windows. ## `CURL_DISABLE_DICT` @@ -134,10 +144,19 @@ Disable the built-in progress meter Disable support for proxies +## `CURL_DISABLE_IPFS` + +Disable the IPFS/IPNS protocols. This affects the curl tool only, where +IPFS/IPNS protocol support is implemented. + ## `CURL_DISABLE_RTSP` Disable the RTSP protocol. +## `CURL_DISABLE_SHA512_256` + +Disable the SHA-512/256 hash algorithm. + ## `CURL_DISABLE_SHUFFLE_DNS` Disable the shuffle DNS feature @@ -166,3 +185,7 @@ Disable the TFTP protocol ## `CURL_DISABLE_VERBOSE_STRINGS` Disable verbose strings and error messages. + +## `CURL_DISABLE_WEBSOCKETS` + +Disable the WebSocket protocols. diff --git a/deps/curl/docs/CURLDOWN.md b/deps/curl/docs/CURLDOWN.md index 8440ef44..18c1cbc3 100644 --- a/deps/curl/docs/CURLDOWN.md +++ b/deps/curl/docs/CURLDOWN.md @@ -1,3 +1,9 @@ + + # curldown A markdown-like syntax for libcurl man pages. @@ -67,14 +73,38 @@ Each curldown starts with a header with meta-data: Title: CURLOPT_AWS_SIGV4 Section: 3 Source: libcurl + Protocol: + - HTTP See-also: - CURLOPT_HEADEROPT (3) - CURLOPT_HTTPAUTH (3) + TLS-backend: + - [name] + Added-in: [version or "n/a"] --- All curldown files *must* have all the headers present and at least one `See-also:` entry specified. +If the man page is for section 3 (library related). The `Protocol` list must +contain at least one protocol, which can be `*` if the option is virtually for +everything. If `*` is used, it must be the only listed protocol. Recognized +protocols are either URL schemes (in uppercase), `TLS` or `TCP`. + +If the `Protocol` list contains `TLS`, then there must also be a `TLS-backend` +list, specifying `All` or a list of what TLS backends that work with this +option. The available TLS backends are: + +- `BearSSL` +- `GnuTLS` +- `mbedTLS` +- `OpenSSL` (also covers BoringSSL, LibreSSL, quictls, AWS-LC and AmiSSL) +- `rustls` +- `Schannel` +- `Secure Transport` +- `wolfSSL` +- `All`: all TLS backends + Following the header in the file, is the manual page using markdown-like syntax: @@ -118,7 +148,15 @@ readable. To make sure curldown documents render correctly as markdown, all literal occurrences of `<` or `>` need to be escaped by a leading backslash. -## symbols +## Generating contents + +`# %PROTOCOLS%` - inserts a **PROTOCOLS** section based on the metadata +provided in the header. + +`# %AVAILABILITY%` - inserts an **AVAILABILITY** section based on the metadata +provided in the header. + +## Symbols All mentioned curl symbols that have their own man pages, like `curl_easy_perform(3)` are automatically rendered using italics in the output diff --git a/deps/curl/docs/DEPRECATE.md b/deps/curl/docs/DEPRECATE.md index 6b6b5b46..5e3551a4 100644 --- a/deps/curl/docs/DEPRECATE.md +++ b/deps/curl/docs/DEPRECATE.md @@ -1,3 +1,9 @@ + + # Items to be removed from future curl releases If any of these deprecated features is a cause for concern for you, please @@ -6,47 +12,56 @@ 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. -## NTLM_WB auth +## TLS libraries without 1.3 support -This NTLM authentication method is powered by a separate tool, -`ntlm_auth`. Barely anyone uses this method. It was always a quirky -implementation (including fork + exec), it has limited portability and we do -not test it in the test suite and CI. +curl drops support for TLS libraries without TLS 1.3 capability after May +2025. -We keep the native NTLM implementation. +It requires that a curl build using the library should be able to negotiate +and use TLS 1.3, or else it is not good enough. -Due to a mistake, the `NTLM_WB` functionality is missing in builds since 8.4.0 -(October 2023). It needs to be manually patched to work. See [PR -12479](https://github.com/curl/curl/pull/12479). +As of May 2024, the libraries that need to get fixed to remain supported after +May 2025 are: BearSSL and Secure Transport. -curl removes the support for NTLM_WB auth in April 2024. +## Hyper -## space-separated `NOPROXY` patterns +Hyper is an alternative HTTP backend for curl. It uses the hyper library and +could in theory be used for HTTP/1, HTTP/2 and even HTTP/3 in the future with +curl. -When specifying patterns/domain names for curl that should *not* go through a -proxy, the curl tool features the `--noproxy` command line option and the -library supports the `NO_PROXY` environment variable and the `CURLOPT_NOPROXY` -libcurl option. +The original plan and goal was that we would add this HTTP alternative (using +a memory-safe library) and that users could eventually build and use libcurl +exactly as previously but with parts of the core being more memory-safe. -They all set the same list of patterns. This list is documented to be a set of -**comma-separated** names, but can also be provided separated with just -space. The ability to just use spaces for this has never been documented but -some users may still have come to rely on this. +The hyper implementation ran into some snags and 10-15 tests and HTTP/2 +support have remained disabled with hyper. For these reasons, hyper support +has remained tagged EXPERIMENTAL. -Several other tools and utilities also parse the `NO_PROXY` environment -variable but do not consider a space to be a valid separator. Using spaces for -separator is probably less portable and might cause more friction than commas -do. Users should use commas for this for greater portability. +It is undoubtedly hard work to fix these remaining problems, as they typically +require both rust and C knowledge in addition to deep HTTP familiarity. There +does not seem to be that many persons interested or available for this +challenge. Meanwhile, there is little if any demand for hyper from existing +(lib)curl users. -curl removes the support for space-separated names in July 2024. +Finally: having support for hyper in curl has a significant cost: we need to +maintain and develop a lot of functionality and tests twice to make sure +libcurl works identically using either HTTP backend. -## past removals +The only way to keep hyper support in curl is to give it a good polish by +someone with time, skill and energy to spend on this task. + +Unless a significant overhaul has proven to be in progress, hyper support is +removed from curl in January 2025. + +## Past removals - Pipelining - axTLS - PolarSSL - NPN - - Support for systems without 64 bit data types + - Support for systems without 64-bit data types - NSS - gskit - - mingw v1 + - MinGW v1 + - NTLM_WB + - space-separated `NOPROXY` patterns diff --git a/deps/curl/docs/DISTROS.md b/deps/curl/docs/DISTROS.md new file mode 100644 index 00000000..93126afe --- /dev/null +++ b/deps/curl/docs/DISTROS.md @@ -0,0 +1,286 @@ + + +# curl distros + + + +Lots of organizations distribute curl packages to end users. This is a +collection of pointers to where to learn more about curl on and with each +distro. Those marked *Rolling Release* typically run the latest version of curl +and are therefore less likely to have back-ported patches to older versions. + +We discuss curl distro issues, patches and collaboration on the [curl-distros +mailing list](https://lists.haxx.se/listinfo/curl-distros) ([list +archives](https://curl.se/mail/list.cgi?list=curl-distros)). + +## AlmaLinux + +- curl package source and patches: https://git.almalinux.org/rpms/curl/ +- curl issues: https://bugs.almalinux.org/view_all_bug_page.php click Category and choose curl +- curl security: https://errata.almalinux.org/ search for curl + +## Alpine Linux + +- curl: https://pkgs.alpinelinux.org/package/edge/main/x86_64/curl +- curl issues: https://gitlab.alpinelinux.org/alpine/aports/-/issues +- curl security: https://security.alpinelinux.org/srcpkg/curl +- curl package source and patches: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/curl + +## Alt Linux + +- curl: http://www.sisyphus.ru/srpm/Sisyphus/curl +- curl patches: http://www.sisyphus.ru/ru/srpm/Sisyphus/curl/patches +- curl issues: http://www.sisyphus.ru/ru/srpm/Sisyphus/curl/bugs + +## Arch Linux + +*Rolling Release* + +- curl: https://archlinux.org/packages/core/x86_64/curl/ +- curl issues: https://gitlab.archlinux.org/archlinux/packaging/packages/curl/-/issues +- curl security: https://security.archlinux.org/package/curl +- curl wiki: https://wiki.archlinux.org/title/CURL + +## Buildroot + +*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 + +## Chimera + +- curl package source and patches: https://github.com/chimera-linux/cports/tree/master/main/curl + +## Clear Linux + +*Rolling Release* + +- curl: https://github.com/clearlinux-pkgs/curl +- curl issues: https://github.com/clearlinux/distribution/issues + +## Conary + +- curl: https://github.com/conan-io/conan-center-index/tree/master/recipes/libcurl +- curl issues: https://github.com/conan-io/conan-center-index/issues +- curl patches: https://github.com/conan-io/conan-center-index/tree/master/recipes/libcurl (in `all/patches/*`, if any) + +## conda-forge + +- curl: https://github.com/conda-forge/curl-feedstock +- curl issues: https://github.com/conda-forge/curl-feedstock/issues + +## CRUX + +- curl: https://crux.nu/portdb/?a=search&q=curl +- curl issues: https://git.crux.nu/ports/core/issues/?type=all&state=open&q=curl + +## curl-for-win + +(this is the official curl binaries for Windows shipped by the curl project) + +*Rolling Release* + +- curl: https://curl.se/windows/ +- curl patches: https://github.com/curl/curl-for-win/blob/main/curl.patch (if any) +- build-specific issues: https://github.com/curl/curl-for-win/issues + +Issues and patches for this are managed in the main curl project. + +## Cygwin + +- curl: https://cygwin.com/cgit/cygwin-packages/curl/tree/curl.cygport +- curl patches: https://cygwin.com/cgit/cygwin-packages/curl/tree +- curl issues: https://inbox.sourceware.org/cygwin/?q=s%3Acurl + +## Cygwin (cross mingw64) + +- mingw64-x86_64-curl: https://cygwin.com/cgit/cygwin-packages/mingw64-x86_64-curl/tree/mingw64-x86_64-curl.cygport +- mingw64-x86_64-curl patches: https://cygwin.com/cgit/cygwin-packages/mingw64-x86_64-curl/tree +- mingw64-x86_64-curl issues: https://inbox.sourceware.org/cygwin/?q=s%3Amingw64-x86_64-curl + +## Debian + +- curl: https://tracker.debian.org/pkg/curl +- curl issues: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=curl +- curl patches: https://udd.debian.org/patches.cgi?src=curl +- curl patches: https://salsa.debian.org/debian/curl (in debian/* branches, inside the folder debian/patches) + +## Fedora + +- curl: https://src.fedoraproject.org/rpms/curl +- curl issues: [bugzilla](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&classification=Fedora&product=Fedora&product=Fedora%20EPEL&component=curl) +- curl patches: [list of patches in package git](https://src.fedoraproject.org/rpms/curl/tree/rawhide) + +## FreeBSD + +- curl: https://cgit.freebsd.org/ports/tree/ftp/curl +- curl patches: https://cgit.freebsd.org/ports/tree/ftp/curl +- curl issues: https://bugs.freebsd.org/bugzilla/buglist.cgi?bug_status=__open__&order=Importance&product=Ports%20%26%20Packages&query_format=advanced&short_desc=curl&short_desc_type=allwordssubstr + +## Gentoo Linux + +*Rolling Release* + +- curl: https://packages.gentoo.org/packages/net-misc/curl +- curl issues: https://bugs.gentoo.org/buglist.cgi?quicksearch=net-misc/curl +- curl package sources and patches: https://gitweb.gentoo.org/repo/gentoo.git/tree/net-misc/curl/ + +## GNU Guix + +*Rolling Release* + +- curl: https://git.savannah.gnu.org/gitweb/?p=guix.git;a=blob;f=gnu/packages/curl.scm;hb=HEAD +- curl issues: https://issues.guix.gnu.org/search?query=curl + +## Homebrew + +*Rolling Release* + +- curl: https://formulae.brew.sh/formula/curl + +Homebrew's policy is that all patches and issues should be submitted upstream +unless it is specific to Homebrew's way of packaging software. + +## MacPorts + +*Rolling Release* + +- curl: https://github.com/macports/macports-ports/tree/master/net/curl +- curl issues: https://trac.macports.org/query?0_port=curl&0_port_mode=%7E&0_status=%21closed +- curl patches: https://github.com/macports/macports-ports/tree/master/net/curl/files + +## Mageia + +- 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 security: https://advisories.mageia.org/src_curl.html + +## MSYS2 + +*Rolling Release* + +- curl: https://github.com/msys2/MSYS2-packages/tree/master/curl +- curl issues: https://github.com/msys2/MSYS2-packages/issues +- curl patches: https://github.com/msys2/MSYS2-packages/tree/master/curl (`*.patch`) + +## MSYS2 (mingw-w64) + +*Rolling Release* + +- curl: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-curl +- curl issues: https://github.com/msys2/MINGW-packages/issues +- curl patches: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-curl (`*.patch`) + +## Muldersoft + +*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 + +## NixOS + +- curl: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/networking/curl/default.nix +- curl issues: https://github.com/NixOS/nixpkgs + +nixpkgs is the package repository used by the NixOS Linux distribution, but +can also be used on other distributions + +## OmniOS + +- curl: https://github.com/omniosorg/omnios-build/tree/master/build/curl +- curl issues: https://github.com/omniosorg/omnios-build/issues +- curl patches: https://github.com/omniosorg/omnios-build/tree/master/build/curl/patches + +## OpenIndiana + +- curl: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/web/curl +- curl issues: https://www.illumos.org/projects/openindiana/issues +- curl patches: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/web/curl/patches + +## OpenSUSE + +- curl source and patches: https://build.opensuse.org/package/show/openSUSE%3AFactory/curl + +## Oracle Solaris + +- curl: https://github.com/oracle/solaris-userland/tree/master/components/curl +- curl issues: https://support.oracle.com/ (requires support contract) +- curl patches: https://github.com/oracle/solaris-userland/tree/master/components/curl/patches + +## OpenEmbedded / Yocto Project + +*Rolling Release* + +- curl: https://layers.openembedded.org/layerindex/recipe/5765/ +- curl issues: https://bugzilla.yoctoproject.org/ +- curl patches: https://git.openembedded.org/openembedded-core/tree/meta/recipes-support/curl + +## PLD Linux + +- curl package source and patches: https://github.com/pld-linux/curl +- curl issues: https://bugs.launchpad.net/pld-linux?field.searchtext=curl&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field.assignee=&field.bug_reporter=&field.omit_dupes=on&field.has_patch=&field.has_no_package= + +## pkgsrc + +- curl: https://github.com/NetBSD/pkgsrc/tree/trunk/www/curl +- curl issues: https://github.com/NetBSD/pkgsrc/issues +- curl patches: https://github.com/NetBSD/pkgsrc/tree/trunk/www/curl/patches + +## Red Hat Enterprise Linux / CentOS Stream + +- curl: https://kojihub.stream.centos.org/koji/packageinfo?packageID=217 +- curl issues: https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12332745&issuetype=1&components=12377466&priority=10300 +- curl patches: https://gitlab.com/redhat/centos-stream/rpms/curl + +## Rocky Linux + +- curl: https://git.rockylinux.org/staging/rpms/curl/-/blob/r9/SPECS/curl.spec +- curl issues: https://bugs.rockylinux.org +- curl patches: https://git.rockylinux.org/staging/rpms/curl/-/tree/r9/SOURCES + +## SerenityOS + +- curl: https://github.com/SerenityOS/serenity/tree/master/Ports/curl +- curl issues: https://github.com/SerenityOS/serenity/issues?q=label%3Aports +- curl patches: https://github.com/SerenityOS/serenity/tree/master/Ports/curl/patches + +## SmartOS + +- curl: https://github.com/TritonDataCenter/illumos-extra/tree/master/curl +- curl issues: https://github.com/TritonDataCenter/illumos-extra/issues +- curl patches: https://github.com/TritonDataCenter/illumos-extra/tree/master/curl/Patches + +## SPACK + +- curl package source and patches: https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/curl + +## vcpkg + +*Rolling Release* + +- curl: https://github.com/microsoft/vcpkg/tree/master/ports/curl +- curl issues: https://github.com/microsoft/vcpkg/issues +- curl patches: https://github.com/microsoft/vcpkg/tree/master/ports/curl (`*.patch`) + +## Void Linux + +*Rolling Release* + +- curl: https://github.com/void-linux/void-packages/tree/master/srcpkgs/curl +- curl issues: https://github.com/void-linux/void-packages/issues +- curl patches: https://github.com/void-linux/void-packages/tree/master/srcpkgs/curl/patches + +## Wolfi + +*Rolling Release* + +- curl: https://github.com/wolfi-dev/os/blob/main/curl.yaml diff --git a/deps/curl/docs/EARLY-RELEASE.md b/deps/curl/docs/EARLY-RELEASE.md index 3e9a679a..e66dbbd4 100644 --- a/deps/curl/docs/EARLY-RELEASE.md +++ b/deps/curl/docs/EARLY-RELEASE.md @@ -1,3 +1,9 @@ + + # How to determine if an early patch release is warranted In the curl project we do releases every 8 weeks. Unless we break the cycle diff --git a/deps/curl/docs/ECH.md b/deps/curl/docs/ECH.md new file mode 100644 index 00000000..572292db --- /dev/null +++ b/deps/curl/docs/ECH.md @@ -0,0 +1,478 @@ + + +# Building curl with HTTPS-RR and ECH support + +We have added support for ECH to curl. It can use HTTPS RRs published in the +DNS if curl uses DoH, or else can accept the relevant ECHConfigList values +from the command line. This works with OpenSSL, wolfSSL or BoringSSL as the +TLS provider. + +This feature is EXPERIMENTAL. DO NOT USE IN PRODUCTION. + +This should however provide enough of a proof-of-concept to prompt an informed +discussion about a good path forward for ECH support in curl. + +## OpenSSL Build + +To build our ECH-enabled OpenSSL fork: + +```bash + cd $HOME/code + git clone https://github.com/defo-project/openssl + cd openssl + ./config --libdir=lib --prefix=$HOME/code/openssl-local-inst + ...stuff... + make -j8 + ...stuff (maybe go for coffee)... + make install_sw + ...a little bit of stuff... +``` + +To build curl ECH-enabled, making use of the above: + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + autoreconf -fi + LDFLAGS="-Wl,-rpath,$HOME/code/openssl-local-inst/lib/" ./configure --with-ssl=$HOME/code/openssl-local-inst --enable-ech --enable-httpsrr + ...lots of output... + WARNING: ECH HTTPSRR enabled but marked EXPERIMENTAL... + make + ...lots more output... +``` + +If you do not get that WARNING at the end of the ``configure`` command, then +ECH is not enabled, so go back some steps and re-do whatever needs re-doing:-) +If you want to debug curl then you should add ``--enable-debug`` to the +``configure`` command. + +In a recent (2024-05-20) build on one machine, configure failed to find the +ECH-enabled SSL library, apparently due to the existence of +``$HOME/code/openssl-local-inst/lib/pkgconfig`` as a directory containing +various settings. Deleting that directory worked around the problem but may +not be the best solution. + +## Using ECH and DoH + +Curl supports using DoH for A/AAAA lookups so it was relatively easy to add +retrieval of HTTPS RRs in that situation. To use ECH and DoH together: + +```bash + cd $HOME/code/curl + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl --ech true --doh-url https://one.one.one.one/dns-query https://defo.ie/ech-check.php + ... + SSL_ECH_STATUS: success good
+ ... +``` + +The output snippet above is within the HTML for the webpage, when things work. + +The above works for these test sites: + +```bash + 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 +``` + +The list above has 4 different server technologies, implemented by 3 different +parties, and includes a case (the port 8414 server) where HelloRetryRequest +(HRR) is forced. + +We currently support the following new curl command line arguments/options: + +- ``--ech `` - the ``config`` value can be one of: + - ``false`` says to not attempt ECH + - ``true`` says to attempt ECH, if possible + - ``grease`` if attempting ECH is not possible, then send a GREASE ECH extension + - ``hard`` hard-fail the connection if ECH cannot be attempted + - ``ecl:`` a base64 encoded ECHConfigList, rather than one accessed from the DNS + - ``pn:`` override the ``public_name`` from an ECHConfigList + +Note that in the above "attempt ECH" means the client emitting a TLS +ClientHello with a "real" ECH extension, but that does not mean that the +relevant server can succeed in decrypting, as things can fail for other +reasons. + +## Supplying an ECHConfigList on the command line + +To supply the ECHConfigList on the command line, you might need a bit of +cut-and-paste, e.g.: + +```bash + dig +short https defo.ie + 1 . ipv4hint=213.108.108.101 ech=AED+DQA8PAAgACD8WhlS7VwEt5bf3lekhHvXrQBGDrZh03n/LsNtAodbUAAEAAEAAQANY292ZXIuZGVmby5pZQAA ipv6hint=2a00:c6c0:0:116:5::10 +``` + +Then paste the base64 encoded ECHConfigList onto the curl command line: + +```bash + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl --ech ecl:AED+DQA8PAAgACD8WhlS7VwEt5bf3lekhHvXrQBGDrZh03n/LsNtAodbUAAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php + ... + SSL_ECH_STATUS: success good
+ ... +``` + +The output snippet above is within the HTML for the webpage. + +If you paste in the wrong ECHConfigList (it changes hourly for ``defo.ie``) you +should get an error like this: + +```bash + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl -vvv --ech ecl:AED+DQA8yAAgACDRMQo+qYNsNRNj+vfuQfFIkrrUFmM4vogucxKj/4nzYgAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php + ... + * OpenSSL/3.3.0: error:0A00054B:SSL routines::ech required + ... +``` + +There is a reason to want this command line option - for use before publishing +an ECHConfigList in the DNS as per the Internet-draft [A well-known URI for +publishing ECHConfigList values](https://datatracker.ietf.org/doc/draft-ietf-tls-wkech/). + +If you do use a wrong ECHConfigList value, then the server might return a +good value, via the ``retry_configs`` mechanism. You can see that value in +the verbose output, e.g.: + +```bash + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl -vvv --ech ecl:AED+DQA8yAAgACDRMQo+qYNsNRNj+vfuQfFIkrrUFmM4vogucxKj/4nzYgAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php + ... +* ECH: retry_configs AQD+DQA8DAAgACBvYqJy+Hgk33wh/ZLBzKSPgwxeop7gvojQzfASq7zeZQAEAAEAAQANY292ZXIuZGVmby5pZQAA/g0APEMAIAAgXkT5r4cYs8z19q5rdittyIX8gfQ3ENW4wj1fVoiJZBoABAABAAEADWNvdmVyLmRlZm8uaWUAAP4NADw2ACAAINXSE9EdXzEQIJZA7vpwCIQsWqsFohZARXChgPsnfI1kAAQAAQABAA1jb3Zlci5kZWZvLmllAAD+DQA8cQAgACASeiD5F+UoSnVoHvA2l1EifUVMFtbVZ76xwDqmMPraHQAEAAEAAQANY292ZXIuZGVmby5pZQAA +* ECH: retry_configs for defo.ie from cover.defo.ie, 319 + ... +``` + +At that point, you could copy the base64 encoded value above and try again. +For now, this only works for the OpenSSL and BoringSSL builds. + +## Default settings + +Curl has various ways to configure default settings, e.g. in ``$HOME/.curlrc``, +so one can set the DoH URL and enable ECH that way: + +```bash + cat ~/.curlrc + doh-url=https://one.one.one.one/dns-query + silent + ech=true +``` + +Note that when you use the system's curl command (rather than our ECH-enabled +build), it is liable to warn that ``ech`` is an unknown option. If that is an +issue (e.g. if some script re-directs stdout and stderr somewhere) then adding +the ``silent`` line above seems to be a good enough fix. (Though of +course, yet another script could depend on non-silent behavior, so you may have +to figure out what you prefer yourself.) That seems to have changed with the +latest build, previously ``silent=TRUE`` was what I used in ``~/.curlrc`` but +now that seems to cause a problem, so that the following line(s) are ignored. + +If you want to always use our OpenSSL build you can set ``LD_LIBRARY_PATH`` +in the environment: + +```bash + export LD_LIBRARY_PATH=$HOME/code/openssl +``` + +When you do the above, there can be a mismatch between OpenSSL versions +for applications that check that. A ``git push`` for example fails so you +should unset ``LD_LIBRARY_PATH`` before doing that or use a different shell. + +```bash + git push + OpenSSL version mismatch. Built against 30000080, you have 30200000 + ... +``` + +With all that setup as above the command line gets simpler: + +```bash + ./src/curl https://defo.ie/ech-check.php + ... + SSL_ECH_STATUS: success good
+ ... +``` + +The ``--ech true`` option is opportunistic, so tries to do ECH but does not fail if +the client for example cannot find any ECHConfig values. The ``--ech hard`` +option hard-fails if there is no ECHConfig found in DNS, so for now, that is not +a good option to set as a default. Once ECH has really been attempted by +the client, if decryption on the server side fails, then curl fails. + +## Code changes for ECH support when using DoH + +Code changes are ``#ifdef`` protected via ``USE_ECH`` or ``USE_HTTPSRR``: + +- ``USE_HTTPSRR`` is used for HTTPS RR retrieval code that could be generically + used should non-ECH uses for HTTPS RRs be identified, e.g. use of ALPN values +or IP address hints. + +- ``USE_ECH`` protects ECH specific code. + +There are various obvious code blocks for handling the new command line +arguments which are not described here, but should be fairly clear. + +As shown in the ``configure`` usage above, there are ``configure.ac`` changes +that allow separately dis/enabling ``USE_HTTPSRR`` and ``USE_ECH``. If ``USE_ECH`` +is enabled, then ``USE_HTTPSRR`` is forced. In both cases ``USE_DOH`` +is required. (There may be some configuration conflicts available for the +determined:-) + +The main functional change, as you would expect, is in ``lib/vtls/openssl.c`` +where an ECHConfig, if available from command line or DNS cache, is fed into +the OpenSSL library via the new APIs implemented in our OpenSSL fork for that +purpose. This code also implements the opportunistic (``--ech true``) or hard-fail +(``--ech hard``) logic. + +Other than that, the main additions are in ``lib/doh.c`` +where we reuse ``dohprobe()`` to retrieve an HTTPS RR value for the target +domain. If such a value is found, that is stored using a new ``doh_store_https()`` +function in a new field in the ``dohentry`` structure. + +The qname for the DoH query is modified if the port number is not 443, as +defined in the SVCB specification. + +When the DoH process has worked, ``Curl_doh_is_resolved()`` now also returns +the relevant HTTPS RR value data in the ``Curl_dns_entry`` structure. +That is later accessed when the TLS session is being established, if ECH is +enabled (from ``lib/vtls/openssl.c`` as described above). + +## Limitations + +Things that need fixing, but that can probably be ignored for the +moment: + +- We could easily add code to make use of an ``alpn=`` value found in an HTTPS + RR, passing that on to OpenSSL for use as the "inner" ALPN value, but have +yet to do that. + +Current limitations (more interesting than the above): + +- Only the first HTTPS RR value retrieved is actually processed as described + above, that could be extended in future, though picking the "right" HTTPS RR +could be non-trivial if multiple RRs are published - matching IP address hints +versus A/AAAA values might be a good basis for that. Last I checked though, +browsers supporting ECH did not handle multiple HTTPS RRs well, though that +needs re-checking as it has been a while. + +- It is unclear how one should handle any IP address hints found in an HTTPS RR. + It may be that a bit of consideration of how "multi-CDN" deployments might +emerge would provide good answers there, but for now, it is not clear how best +curl might handle those values when present in the DNS. + +- The SVCB/HTTPS RR specification supports a new "CNAME at apex" indirection + ("aliasMode") - the current code takes no account of that at all. One could +envisage implementing the equivalent of following CNAMEs in such cases, but +it is not clear if that'd be a good plan. (As of now, chrome browsers do not seem +to have any support for that "aliasMode" and we have not checked Firefox for that +recently.) + +- We have not investigated what related changes or additions might be needed + for applications using libcurl, as opposed to use of curl as a command line +tool. + +- We have not yet implemented tests as part of the usual curl test harness as +doing so would seem to require re-implementing an ECH-enabled server as part +of the curl test harness. For now, we have a ``./tests/ech_test.sh`` script +that attempts ECH with various test servers and with many combinations of the +allowed command line options. While that is a useful test and has find issues, +it is not comprehensive and we are not (as yet) sure what would be the right +level of coverage. When running that script you should not have a +``$HOME/.curlrc`` file that affects ECH or some of the negative tests could +produce spurious failures. + +## Building with cmake + +To build with cmake, assuming our ECH-enabled OpenSSL is as before: + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + mkdir build + cd build + cmake -DOPENSSL_ROOT_DIR=$HOME/code/openssl -DUSE_ECH=1 -DUSE_HTTPSRR=1 .. + ... + make + ... + [100%] Built target curl +``` + +The binary produced by the cmake build does not need any ECH-specific +``LD_LIBRARY_PATH`` setting. + +## BoringSSL build + +BoringSSL is also supported by curl and also supports ECH, so to build +with that, instead of our ECH-enabled OpenSSL: + +```bash + cd $HOME/code + git clone https://boringssl.googlesource.com/boringssl + cd boringssl + cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/code/boringssl/inst -DBUILD_SHARED_LIBS=1 + make + ... + make install +``` + +Then: + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + autoreconf -fi + LDFLAGS="-Wl,-rpath,$HOME/code/boringssl/inst/lib" ./configure --with-ssl=$HOME/code/boringssl/inst --enable-ech --enable-httpsrr + ...lots of output... + WARNING: ECH HTTPSRR enabled but marked EXPERIMENTAL. Use with caution. + make +``` + +The BoringSSL APIs are fairly similar to those in our ECH-enabled OpenSSL +fork, so code changes are also in ``lib/vtls/openssl.c``, protected +via ``#ifdef OPENSSL_IS_BORINGSSL`` and are mostly obvious API variations. + +The BoringSSL APIs however do not support the ``--ech pn:`` command line +variant as of now. + +## wolfSSL build + +wolfSSL also supports ECH and can be used by curl, so here's how: + +```bash + cd $HOME/code + git clone https://github.com/wolfSSL/wolfssl + cd wolfssl + ./autogen.sh + ./configure --prefix=$HOME/code/wolfssl/inst --enable-ech --enable-debug --enable-opensslextra + make + make install +``` + +The install prefix (``inst``) in the above causes wolfSSL to be installed there +and we seem to need that for the curl configure command to work out. The +``--enable-opensslextra`` turns out (after much faffing about;-) to be +important or else we get build problems with curl below. + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + autoreconf -fi + ./configure --with-wolfssl=$HOME/code/wolfssl/inst --enable-ech --enable-httpsrr + make +``` + +There are some known issues with the ECH implementation in wolfSSL: + +- The main issue is that the client currently handles HelloRetryRequest + incorrectly. [HRR issue](https://github.com/wolfSSL/wolfssl/issues/6802).) + The HRR issue means that the client does not work for + [this ECH test web site](https://tls-ech.dev) and any other similarly configured + sites. +- There is also an issue related to so-called middlebox compatibility mode. + [middlebox compatibility issue](https://github.com/wolfSSL/wolfssl/issues/6774) + +### Code changes to support wolfSSL + +There are what seem like oddball differences: + +- The DoH URL in``$HOME/.curlrc`` can use `1.1.1.1` for OpenSSL but has to be + `one.one.one.one` for wolfSSL. The latter works for both, so OK, we us that. +- There seems to be some difference in CA databases too - the wolfSSL version + does not like ``defo.ie``, whereas the system and OpenSSL ones do. We can + ignore that for our purposes via ``--insecure``/``-k`` but would need to fix + for a real setup. (Browsers do like those certificates though.) + +Then there are some functional code changes: + +- tweak to ``configure.ac`` to check if wolfSSL has ECH or not +- added code to ``lib/vtls/wolfssl.c`` mirroring what's done in the + OpenSSL equivalent above. +- wolfSSL does not support ``--ech false`` or the ``--ech pn:`` command line + argument. + +The lack of support for ``--ech false`` is because wolfSSL has decided to +always at least GREASE if built to support ECH. In other words, GREASE is +a compile time choice for wolfSSL, but a runtime choice for OpenSSL or +BoringSSL. (Both are reasonable.) + +## Additional notes + +### Supporting ECH without DoH + +All of the above only applies if DoH is being used. There should be a use-case +for ECH when DoH is not used by curl - if a system stub resolver supports DoT +or DoH, then, considering only ECH and the network threat model, it would make +sense for curl to support ECH without curl itself using DoH. The author for +example uses a combination of stubby+unbound as the system resolver listening +on localhost:53, so would fit this use-case. That said, it is unclear if +this is a niche that is worth trying to address. (The author is just as happy to +let curl use DoH to talk to the same public recursive that stubby might use:-) + +Assuming for the moment this is a use-case we would like to support, then if +DoH is not being used by curl, it is not clear at this time how to provide +support for ECH. One option would seem to be to extend the ``c-ares`` library +to support HTTPS RRs, but in that case it is not now clear whether such +changes would be attractive to the ``c-ares`` maintainers, nor whether the +"tag=value" extensibility inherent in the HTTPS/SVCB specification is a good +match for the ``c-ares`` approach of defining structures specific to decoded +answers for each supported RRtype. We are also not sure how many downstream +curl deployments actually make use of the ``c-ares`` library, which would +affect the utility of such changes. Another option might be to consider using +some other generic DNS library that does support HTTPS RRs, but it is unclear +if such a library could or would be used by all or almost all curl builds and +downstream releases of curl. + +Our current conclusion is that doing the above is likely best left until we +have some experience with the "using DoH" approach, so we are going to punt on +this for now. + +### Debugging + +Just a note to self as remembering this is a nuisance: + +```bash +LD_LIBRARY_PATH=$HOME/code/openssl:./lib/.libs gdb ./src/.libs/curl +``` + +### Localhost testing + +It can be useful to be able to run against a localhost OpenSSL ``s_server`` +for testing. We have published instructions for such +[localhost tests](https://github.com/defo-project/ech-dev-utils/blob/main/howtos/localhost-tests.md) +in another repository. Once you have that set up, you can start a server +and then run curl against that: + +```bash + cd $HOME/code/ech-dev-utils + ./scripts/echsvr.sh -d + ... +``` + +The ``echsvr.sh`` script supports many ECH-related options. Use ``echsvr.sh -h`` +for details. + +In another window: + +```bash + cd $HOME/code/curl/ + ./src/curl -vvv --insecure --connect-to foo.example.com:8443:localhost:8443 --ech ecl:AD7+DQA6uwAgACBix2B78sX+EQhEbxMspDOc8Z3xVS5aQpYP0Cxpc2AWPAAEAAEAAQALZXhhbXBsZS5jb20AAA== +``` + +### Automated use of ``retry_configs`` not supported so far... + +As of now we have not added support for using ``retry_config`` handling in the +application - for a command line tool, one can just use ``dig`` (or ``kdig``) +to get the HTTPS RR and pass the ECHConfigList from that on the command line, +if needed, or one can access the value from command line output in verbose more +and then reuse that in another invocation. + +Both our OpenSSL fork and BoringSSL have APIs for both controlling GREASE and +accessing and logging ``retry_configs``, it seems wolfSSL has neither. diff --git a/deps/curl/docs/EXPERIMENTAL.md b/deps/curl/docs/EXPERIMENTAL.md index ee26ac11..e8809424 100644 --- a/deps/curl/docs/EXPERIMENTAL.md +++ b/deps/curl/docs/EXPERIMENTAL.md @@ -1,3 +1,9 @@ + + # Experimental Some features and functionality in curl and libcurl are considered @@ -16,9 +22,52 @@ Experimental support in curl means: experimental. 5. Experimental features are clearly marked so in documentation. Beware. +## Graduation + +1. Each experimental feature should have a set of documented requirements of + what is needed for that feature to graduate. Graduation means being removed + from the list of experiments. +2. An experiment should NOT graduate if it needs test cases to be disabled, + unless they are for minor features that are clearly documented as not + provided by the experiment and then the disabling should be managed inside + each affected test case. + ## Experimental features right now - - The Hyper HTTP backend - - HTTP/3 support (using the quiche or msh3 backends) - - The rustls backend - - WebSocket +### The Hyper HTTP backend + +Graduation requirements: + +- HTTP/1 and HTTP/2 support, including multiplexing + +(Hyper is marked for deprecation. It cannot graduate.) + +### HTTP/3 support (non-ngtcp2 backends) + +Graduation requirements: + +- The used libraries should be considered out-of-beta with a reasonable + expectation of a stable API going forward. + +- Using HTTP/3 with the given build should perform without risking busy-loops + +### The Rustls backend + +Graduation requirements: + +- a reasonable expectation of a stable API going forward. + +## ECH + +Use of the HTTPS resource record and Encrypted Client Hello (ECH) when using +DoH + +Graduation requirements: + +- ECH support exists in at least one widely used TLS library apart from + BoringSSL and wolfSSL. + +- feedback from users saying that ECH works for their use cases + +- it has been given time to mature, so no earlier than April 2025 (twelve + months after being added here) diff --git a/deps/curl/docs/FAQ b/deps/curl/docs/FAQ index 1450a1e7..943a7419 100644 --- a/deps/curl/docs/FAQ +++ b/deps/curl/docs/FAQ @@ -56,7 +56,7 @@ FAQ 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 web page does not exist? + 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" @@ -65,7 +65,7 @@ FAQ 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 user names and passwords secret in curl command lines? + 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 @@ -84,12 +84,12 @@ FAQ 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.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 host names? + 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? @@ -407,7 +407,7 @@ FAQ 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 a error-prone process and one that also + 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. @@ -423,8 +423,8 @@ FAQ backends. curl can be built to use one of the following SSL alternatives: OpenSSL, - libressl, BoringSSL, AWS-LC, GnuTLS, wolfSSL, mbedTLS, Secure Transport - (native iOS/OS X), Schannel (native Windows), BearSSL or Rustls. They all + LibreSSL, BoringSSL, AWS-LC, GnuTLS, wolfSSL, mbedTLS, Secure Transport + (native iOS/macOS), Schannel (native Windows), BearSSL 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 @@ -566,7 +566,7 @@ FAQ 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 + 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). @@ -604,7 +604,7 @@ FAQ 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 + 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 @@ -624,7 +624,7 @@ FAQ 3.14 Does curl support JavaScript or PAC (automated proxy config)? - Many web pages do magic stuff using embedded JavaScript. curl and libcurl + 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. @@ -722,7 +722,7 @@ FAQ curl --header "Host: www.example.com" http://127.0.0.1/ - You can also opt to add faked host name entries to curl with the --resolve + 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: @@ -771,11 +771,10 @@ FAQ [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]"... But 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]" + 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 @@ -822,7 +821,7 @@ FAQ curl -g 'www.example.com/weirdname[].html' - 4.4 Why do I get downloaded data even though the web page does not exist? + 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 @@ -883,7 +882,7 @@ FAQ appreciate a detailed bug report from you that describes how we could go ahead and repeat this. - 4.7 How do I keep user names and passwords secret in curl command lines? + 4.7 How do I keep usernames and passwords secret in curl command lines? This problem has two sides: @@ -1100,7 +1099,7 @@ FAQ 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 web pages (that gets a 401 + 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 @@ -1175,11 +1174,11 @@ FAQ 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? + 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 ? + 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 @@ -1192,7 +1191,7 @@ FAQ 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 + 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. @@ -1252,14 +1251,14 @@ FAQ 'man ld.so' and 'man ld' will tell you more details - 5.9 How does libcurl resolve host names? + 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 host name resolve + - The non-IPv6 resolver that can use one of four different hostname resolve calls (depending on what your system supports): A - gethostbyname() @@ -1353,7 +1352,7 @@ FAQ 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 + 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. diff --git a/deps/curl/docs/FEATURES.md b/deps/curl/docs/FEATURES.md index bae38fb8..f3661549 100644 --- a/deps/curl/docs/FEATURES.md +++ b/deps/curl/docs/FEATURES.md @@ -1,3 +1,9 @@ + + # Features -- what curl can do ## curl tool @@ -6,7 +12,6 @@ - multiple URLs in a single command line - range "globbing" support: [0-13], {one,two,three} - multiple file upload on a single command line - - custom maximum transfer rate - redirect stderr - parallel transfers @@ -14,39 +19,74 @@ - URL RFC 3986 syntax - custom maximum download time - - custom least download speed acceptable + - custom lowest download speed acceptable - custom output result after completion - guesses protocol from hostname unless specified - - uses .netrc + - supports .netrc - progress bar with time statistics while downloading - - "standard" proxy environment variables support - - compiles on win32 (reported builds on 70+ operating systems) + - standard proxy environment variables support + - have run on 101 operating systems and 28 CPU architectures - selectable network interface for outgoing traffic - IPv6 support on Unix and Windows - - happy eyeballs dual-stack connects + - happy eyeballs dual-stack IPv4 + IPv6 connects - persistent connections - SOCKS 4 + 5 support, with or without local name resolving + - *pre-proxy* support, for *proxy chaining* - supports username and password in proxy environment variables - operations through HTTP proxy "tunnel" (using CONNECT) - replaceable memory functions (malloc, free, realloc, etc) - - asynchronous name resolving (6) + - asynchronous name resolving - both a push and a pull style interface - - international domain names (10) + - international domain names (IDN) + - transfer rate limiting + - stable API and ABI + - TCP keep alive + - TCP Fast Open + - DNS cache (that can be shared between transfers) + - non-blocking single-threaded parallel transfers + - Unix domain sockets to server or proxy + - DNS-over-HTTPS + - uses non-blocking name resolves + - selectable name resolver backend + +## URL API + + - parses RFC 3986 URLs + - generates URLs from individual components + - manages "redirects" + +## Header API + + - easy access to HTTP response headers, from all contexts + - named headers + - iterate over headers + +## TLS + + - selectable TLS backend(s) + - TLS False Start + - TLS version control + - TLS session resumption + - key pinning + - mutual authentication + - Use dedicated CA cert bundle + - Use OS-provided CA store + - separate TLS options for HTTPS proxy ## HTTP - HTTP/0.9 responses are optionally accepted - HTTP/1.0 - HTTP/1.1 - - HTTP/2, including multiplexing and server push (5) + - HTTP/2, including multiplexing and server push - GET - PUT - HEAD - POST - multipart formpost (RFC 1867-style) - - authentication: Basic, Digest, NTLM (9) and Negotiate (SPNEGO) (3) + - authentication: Basic, Digest, NTLM (9) and Negotiate (SPNEGO) to server and proxy - - resume (both GET and PUT) + - resume transfers - follow redirects - maximum amount of redirects to follow - custom HTTP request @@ -59,26 +99,30 @@ - proxy authentication - time conditions - via HTTP proxy, HTTPS proxy or SOCKS proxy + - HTTP/2 or HTTP/1.1 to HTTPS proxy - retrieve file modification date - - Content-Encoding support for deflate and gzip + - Content-Encoding support for deflate, gzip, brotli and zstd - "Transfer-Encoding: chunked" support in uploads - - automatic data compression (11) + - HSTS + - alt-svc + - ETags + - HTTP/1.1 trailers, both sending and getting -## HTTPS (1) +## HTTPS - - (all the HTTP features) - - HTTP/3 experimental support + - HTTP/3 - using client certificates - verify server certificate - via HTTP proxy, HTTPS proxy or SOCKS proxy - select desired encryption - - select usage of a specific SSL version + - select usage of a specific TLS version + - ECH ## FTP - download - authentication - - Kerberos 5 (12) + - Kerberos 5 - active/passive using PORT, EPRT, PASV or EPSV - single file size information (compare to HTTP HEAD) - 'type=' URL support @@ -96,20 +140,24 @@ - customizable to retrieve file modification date - no directory depth limit -## FTPS (1) +## FTPS - implicit `ftps://` support that use SSL on both connections - explicit "AUTH TLS" and "AUTH SSL" usage to "upgrade" plain `ftp://` connection to use SSL for both or one of the connections -## SCP (8) +## SSH (both SCP and SFTP) + - selectable SSH backend + - known hosts support + - public key fingerprinting - both password and public key auth -## SFTP (7) +## SFTP - both password and public key auth - with custom commands sent before/after the transfer + - directory listing ## TFTP @@ -122,7 +170,7 @@ - custom telnet options - stdin/stdout I/O -## LDAP (2) +## LDAP - full LDAP URL support @@ -145,8 +193,8 @@ ## SMTP - - authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (9), Kerberos 5 - (4) and External. + - authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, Kerberos 5 and + External - send emails - mail from support - mail size support @@ -154,7 +202,7 @@ - multiple recipients - via http-proxy -## SMTPS (1) +## SMTPS - implicit `smtps://` support - explicit "STARTTLS" usage to "upgrade" plain `smtp://` connections to use SSL @@ -163,15 +211,15 @@ ## POP3 - authentication: Clear Text, APOP and SASL - - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (9), - Kerberos 5 (4) and External. + - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, + Kerberos 5 and External - list emails - retrieve emails - enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP via custom requests - via http-proxy -## POP3S (1) +## POP3S - implicit `pop3s://` support - explicit `STLS` usage to "upgrade" plain `pop3://` connections to use SSL @@ -180,8 +228,8 @@ ## IMAP - authentication: Clear Text and SASL - - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (9), - Kerberos 5 (4) and External. + - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, + Kerberos 5 and External - list the folders of a mailbox - select a mailbox with support for verifying the `UIDVALIDITY` - fetch emails with support for specifying the UID and SECTION @@ -190,7 +238,7 @@ STORE, COPY and UID via custom requests - via http-proxy -## IMAPS (1) +## IMAPS - implicit `imaps://` support - explicit "STARTTLS" usage to "upgrade" plain `imap://` connections to use SSL @@ -199,21 +247,3 @@ ## MQTT - Subscribe to and publish topics using URL scheme `mqtt://broker/topic` - -## Footnotes - - 1. requires a TLS library - 2. requires OpenLDAP or WinLDAP - 3. requires a GSS-API implementation (such as Heimdal or MIT Kerberos) or - SSPI (native Windows) - 4. requires a GSS-API implementation, however, only Windows SSPI is - currently supported - 5. requires nghttp2 - 6. requires c-ares - 7. requires libssh2, libssh or wolfSSH - 8. requires libssh2 or libssh - 9. requires OpenSSL, GnuTLS, mbedTLS, Secure Transport or SSPI - (native Windows) - 10. requires libidn2 or Windows - 11. requires libz, brotli and/or zstd - 12. requires a GSS-API implementation (such as Heimdal or MIT Kerberos) diff --git a/deps/curl/docs/GOVERNANCE.md b/deps/curl/docs/GOVERNANCE.md index 4930b960..4ab52a9a 100644 --- a/deps/curl/docs/GOVERNANCE.md +++ b/deps/curl/docs/GOVERNANCE.md @@ -1,3 +1,9 @@ + + # Decision making in the curl project A rough guide to how we make decisions and who does what. @@ -107,6 +113,22 @@ persons. We invite new members when the team seems to need it, and we also expect to retire security team members as they "drift off" from the project or just find themselves unable to perform their duties there. +## Core team + +There is a curl core team. It currently has the same set of members as the +security team. It can also be reached on the security email address. + +The core team nominates and invites new members to the team when it sees fit. +There is no open member voting or formal ways to be a candidate. Active +participants in the curl project who want to join the core team can ask to +join. + +The core team is a board of advisors. It deals with project management +subjects that need confidentiality or for other reasons cannot be dealt with +and discussed in the open (for example reports of code of conduct violations). +Project matters should always as far as possible be discussed on open mailing +lists. + ## Server admins We run a web server, a mailing list and more on the curl project's primary diff --git a/deps/curl/docs/HELP-US.md b/deps/curl/docs/HELP-US.md index 15996d04..0619aec5 100644 --- a/deps/curl/docs/HELP-US.md +++ b/deps/curl/docs/HELP-US.md @@ -1,3 +1,9 @@ + + # How to get started helping out in the curl project We are always in need of more help. If you are new to the project and are diff --git a/deps/curl/docs/HISTORY.md b/deps/curl/docs/HISTORY.md index d28217ca..0ec3cd15 100644 --- a/deps/curl/docs/HISTORY.md +++ b/deps/curl/docs/HISTORY.md @@ -1,3 +1,9 @@ + + How curl Became Like This ========================= @@ -280,7 +286,7 @@ August: February: added support for the axTLS backend -April: added the cyassl backend (later renamed to WolfSSL) +April: added the cyassl backend (later renamed to wolfSSL) 2012 ---- @@ -413,14 +419,14 @@ April: added the cyassl backend (later renamed to WolfSSL) February 3: curl 7.75.0 ships with support for Hyper as an HTTP backend - March 31: curl 7.76.0 ships with support for rustls + March 31: curl 7.76.0 ships with support for Rustls July: HSTS is supported 2022 ---- - March: added --json, removed mesalink support +March: added --json, removed mesalink support Public curl releases: 206 Command line options: 245 @@ -431,7 +437,34 @@ April: added the cyassl backend (later renamed to WolfSSL) The curl.se website serves 16,500 GB/month over 462M requests, the official docker image has been pulled 4,098,015,431 times. +October: initial WebSocket support + 2023 ---- +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. + August: Dropped support for the NSS library + +September: added "variable" support in the command line tool. Dropped support +for the gskit TLS library. + +October: added support for IPFS via HTTP gateway + +December: HTTP/3 support with ngtcp2 is no longer experimental + +2024 +---- + +January: switched to "curldown" for all documentation + +April 24: the curl container has been pulled more than six billion times + +May: experimental support for ECH + +August 9: we adopted the wcurl tool into the curl organization diff --git a/deps/curl/docs/HSTS.md b/deps/curl/docs/HSTS.md deleted file mode 100644 index c1f433b2..00000000 --- a/deps/curl/docs/HSTS.md +++ /dev/null @@ -1,42 +0,0 @@ -# HSTS support - -HTTP Strict-Transport-Security. Added as experimental in curl -7.74.0. Supported "for real" since 7.77.0. - -## Standard - -[HTTP Strict Transport Security](https://datatracker.ietf.org/doc/html/rfc6797) - -## Behavior - -libcurl features an in-memory cache for HSTS hosts, so that subsequent -HTTP-only requests to a hostname present in the cache gets internally -"redirected" to the HTTPS version. - -## `curl_easy_setopt()` options: - - - `CURLOPT_HSTS_CTRL` - enable HSTS for this easy handle - - `CURLOPT_HSTS` - specify filename where to store the HSTS cache on close - (and possibly read from at startup) - -## curl command line options - - - `--hsts [filename]` - enable HSTS, use the file as HSTS cache. If filename - is `""` (no length) then no file is used, only in-memory cache. - -## HSTS cache file format - -Lines starting with `#` are ignored. - -For each hsts entry: - - [host name] "YYYYMMDD HH:MM:SS" - -The `[host name]` is dot-prefixed if it includes subdomains. - -The time stamp is when the entry expires. - -## Possible future additions - - - `CURLOPT_HSTS_PRELOAD` - provide a set of HSTS hostnames to load first - - ability to save to something else than a file diff --git a/deps/curl/docs/HTTP-COOKIES.md b/deps/curl/docs/HTTP-COOKIES.md index 174c4f53..38432d27 100644 --- a/deps/curl/docs/HTTP-COOKIES.md +++ b/deps/curl/docs/HTTP-COOKIES.md @@ -1,3 +1,9 @@ + + # HTTP Cookies ## Cookie overview diff --git a/deps/curl/docs/HTTP2.md b/deps/curl/docs/HTTP2.md deleted file mode 100644 index 1d6575b5..00000000 --- a/deps/curl/docs/HTTP2.md +++ /dev/null @@ -1,102 +0,0 @@ -HTTP/2 with curl -================ - -[HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt) -[http2 explained](https://daniel.haxx.se/http2/) - -Build prerequisites -------------------- - - nghttp2 - - OpenSSL, libressl, BoringSSL, GnuTLS, mbedTLS, wolfSSL or Schannel - with a new enough version. - -[nghttp2](https://nghttp2.org/) -------------------------------- - -libcurl uses this 3rd party library for the low level protocol handling -parts. The reason for this is that HTTP/2 is much more complex at that layer -than HTTP/1.1 (which we implement on our own) and that nghttp2 is an already -existing and well functional library. - -We require at least version 1.12.0. - -Over an http:// URL -------------------- - -If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl includes -an upgrade header in the initial request to the host to allow upgrading to -HTTP/2. - -Possibly we can later introduce an option that causes libcurl to fail if it is -not possible to upgrade. Possibly we introduce an option that makes libcurl -use HTTP/2 at once over http:// - -Over an https:// URL --------------------- - -If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl uses ALPN -to negotiate which protocol to continue with. Possibly introduce an option -that causes libcurl to fail if not possible to use HTTP/2. - -`CURL_HTTP_VERSION_2TLS` was added in 7.47.0 as a way to ask libcurl to prefer -HTTP/2 for HTTPS but stick to 1.1 by default for plain old HTTP connections. - -ALPN is the TLS extension that HTTP/2 is expected to use. - -`CURLOPT_SSL_ENABLE_ALPN` is offered to allow applications to explicitly -disable ALPN. - -Multiplexing ------------- - -Starting in 7.43.0, libcurl fully supports HTTP/2 multiplexing, which is the -term for doing multiple independent transfers over the same physical TCP -connection. - -To take advantage of multiplexing, you need to use the multi interface and set -`CURLMOPT_PIPELINING` to `CURLPIPE_MULTIPLEX`. With that bit set, libcurl -attempts to reuse existing HTTP/2 connections and just add a new stream over -that when doing subsequent parallel requests. - -While libcurl sets up a connection to an HTTP server there is a period during -which it does not know if it can pipeline or do multiplexing and if you add -new transfers in that period, libcurl defaults to starting new connections for -those transfers. With the new option `CURLOPT_PIPEWAIT` (added in 7.43.0), you -can ask that a transfer should rather wait and see in case there is a -connection for the same host in progress that might end up being possible to -multiplex on. It favors keeping the number of connections low to the cost of -slightly longer time to first byte transferred. - -Applications ------------- - -We hide HTTP/2's binary nature and convert received HTTP/2 traffic to headers -in HTTP 1.1 style. This allows applications to work unmodified. - -curl tool ---------- - -curl offers the `--http2` command line option to enable use of HTTP/2. - -curl offers the `--http2-prior-knowledge` command line option to enable use of -HTTP/2 without HTTP/1.1 Upgrade. - -Since 7.47.0, the curl tool enables HTTP/2 by default for HTTPS connections. - -curl tool limitations ---------------------- - -The command line tool does not support HTTP/2 server push. It supports -multiplexing when the parallel transfer option is used. - -HTTP Alternative Services -------------------------- - -Alt-Svc is an extension with a corresponding frame (ALTSVC) in HTTP/2 that -tells the client about an alternative "route" to the same content for the same -origin server that you get the response from. A browser or long-living client -can use that hint to create a new connection asynchronously. For libcurl, we -may introduce a way to bring such clues to the application and/or let a -subsequent request use the alternate route automatically. - -[Detailed in RFC 7838](https://datatracker.ietf.org/doc/html/rfc7838) diff --git a/deps/curl/docs/HTTP3.md b/deps/curl/docs/HTTP3.md index 783ab101..3ff73c8e 100644 --- a/deps/curl/docs/HTTP3.md +++ b/deps/curl/docs/HTTP3.md @@ -1,3 +1,9 @@ + + # HTTP3 (and QUIC) ## Resources @@ -45,7 +51,7 @@ Building curl with ngtcp2 involves 3 components: `ngtcp2` itself, `nghttp3` and 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*. -Build quictls +Build quictls: % git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl % cd openssl @@ -53,7 +59,7 @@ Build quictls % make % make install -Build nghttp3 +Build nghttp3: % cd .. % git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 @@ -64,7 +70,7 @@ Build nghttp3 % make % make install -Build ngtcp2 +Build ngtcp2: % cd .. % git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2 @@ -74,7 +80,7 @@ Build ngtcp2 % make % make install -Build curl +Build curl: % cd .. % git clone https://github.com/curl/curl @@ -88,7 +94,7 @@ For OpenSSL 3.0.0 or later builds on Linux for x86_64 architecture, substitute a ## Build with GnuTLS -Build GnuTLS +Build GnuTLS: % git clone --depth 1 https://gitlab.com/gnutls/gnutls.git % cd gnutls @@ -97,7 +103,7 @@ Build GnuTLS % make % make install -Build nghttp3 +Build nghttp3: % cd .. % git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 @@ -108,7 +114,7 @@ Build nghttp3 % make % make install -Build ngtcp2 +Build ngtcp2: % cd .. % git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2 @@ -118,7 +124,7 @@ Build ngtcp2 % make % make install -Build curl +Build curl: % cd .. % git clone https://github.com/curl/curl @@ -130,7 +136,7 @@ Build curl ## Build with wolfSSL -Build wolfSSL +Build wolfSSL: % git clone https://github.com/wolfSSL/wolfssl.git % cd wolfssl @@ -139,7 +145,7 @@ Build wolfSSL % make % make install -Build nghttp3 +Build nghttp3: % cd .. % git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 @@ -150,7 +156,7 @@ Build nghttp3 % make % make install -Build ngtcp2 +Build ngtcp2: % cd .. % git clone -b v1.2.0 https://github.com/ngtcp2/ngtcp2 @@ -160,7 +166,7 @@ Build ngtcp2 % make % make install -Build curl +Build curl: % cd .. % git clone https://github.com/curl/curl @@ -176,13 +182,14 @@ quiche support is **EXPERIMENTAL** Since the quiche build manages its dependencies, curl can be built against the latest version. You are *probably* able to build against their main branch, but in case of problems, we recommend their latest release tag. -## build +## Build Build quiche and BoringSSL: - % git clone --recursive -b 0.20.0 https://github.com/cloudflare/quiche + % git clone --recursive -b 0.22.0 https://github.com/cloudflare/quiche % cd quiche % cargo build --package quiche --release --features ffi,pkg-config-meta,qlog + % ln -s libquiche.so target/release/libquiche.so.0 % mkdir quiche/deps/boringssl/src/lib % ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/ @@ -203,16 +210,16 @@ Build curl: QUIC support is **EXPERIMENTAL** -Build OpenSSL 3.2.0 +Build OpenSSL 3.3.1: % cd .. - % git clone -b openssl-3.2.0 https://github.com/openssl/openssl + % git clone -b openssl-3.3.1 https://github.com/openssl/openssl % cd openssl - % ./config enable-tls1_3 --prefix= --libdir=/lib + % ./config enable-tls1_3 --prefix= --libdir=lib % make % make install -Build nghttp3 +Build nghttp3: % cd .. % git clone -b v1.1.0 https://github.com/ngtcp2/nghttp3 @@ -229,7 +236,7 @@ Build curl: % git clone https://github.com/curl/curl % cd curl % autoreconf -fi - % LDFLAGS="-Wl,-rpath,/lib" ./configure --with-openssl= --with-openssl-quic --with-nghttp3= + % LDFLAGS="-Wl,-rpath,/lib" ./configure --with-openssl= --with-openssl-quic --with-nghttp3= % make % make install @@ -238,9 +245,9 @@ You can build curl with cmake: % cd .. % git clone https://github.com/curl/curl % cd curl - % cmake . -B build -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON - % cmake --build build - % cmake --install build + % cmake . -B bld -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON + % cmake --build bld + % cmake --install bld If `make install` results in `Permission denied` error, you need to prepend it with `sudo`. @@ -310,15 +317,15 @@ directory, or copy `msquic.dll` and `msh3.dll` from that directory to the Use only HTTP/3: - curl --http3-only https://example.org:4433/ + % curl --http3-only https://example.org:4433/ Use HTTP/3 with fallback to HTTP/2 or HTTP/1.1 (see "HTTPS eyeballing" below): - curl --http3 https://example.org:4433/ + % curl --http3 https://example.org:4433/ Upgrade via Alt-Svc: - curl --alt-svc altsvc.cache https://curl.se/ + % curl --alt-svc altsvc.cache https://curl.se/ See this [list of public HTTP/3 servers](https://bagder.github.io/HTTP3-test/) @@ -376,7 +383,7 @@ ones. You can easily create huge local files like `truncate -s=8G 8GB` - they are huge but do not occupy that much space on disk since they are just big holes. -In a Debian setup you can install **apache2**. It runs on port 80 and has a +In a Debian setup you can install apache2. It runs on port 80 and has a document root in `/var/www/html`. Download the 8GB file from apache with `curl localhost/8GB -o dev/null` @@ -389,23 +396,23 @@ You can select either or both of these server solutions. ### nghttpx -Get, build and install **quictls**, **nghttp3** and **ngtcp2** as described +Get, build and install quictls, nghttp3 and ngtcp2 as described above. -Get, build and install **nghttp2**: +Get, build and install nghttp2: - git clone https://github.com/nghttp2/nghttp2.git - 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 - make && make install + % git clone https://github.com/nghttp2/nghttp2.git + % 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 + % make && make install Run the local h3 server on port 9443, make it proxy all traffic through to HTTP/1 on localhost port 80. For local toying, we can just use the test cert that exists in curl's test dir. - CERT=$CURLSRC/tests/stunnel.pem - $HOME/bin/nghttpx $CERT $CERT --backend=localhost,80 \ + % CERT=$CURLSRC/tests/stunnel.pem + % $HOME/bin/nghttpx $CERT $CERT --backend=localhost,80 \ --frontend="localhost,9443;quic" ### Caddy @@ -422,7 +429,7 @@ localhost:7443 { Then run Caddy: - ./caddy start + % ./caddy start Making requests to `https://localhost:7443` should tell you which protocol is being used. diff --git a/deps/curl/docs/INSTALL-CMAKE.md b/deps/curl/docs/INSTALL-CMAKE.md index a606fcb2..a74e1930 100644 --- a/deps/curl/docs/INSTALL-CMAKE.md +++ b/deps/curl/docs/INSTALL-CMAKE.md @@ -1,10 +1,8 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| + # Building with CMake @@ -18,23 +16,6 @@ instructions below for the platform you are building on. CMake builds can be configured either from the command line, or from one of CMake's GUIs. -# Current flaws in the curl CMake build - -Missing features in the CMake build: - - - Builds libcurl without large file support - - Does not support all SSL libraries (only OpenSSL, Schannel, Secure - Transport, and mbedTLS, WolfSSL) - - Does not allow different resolver backends (no c-ares build support) - - No RTMP support built - - Does not allow build curl and libcurl debug enabled - - Does not allow a custom CA bundle path - - Does not allow you to disable specific protocols from the build - - Does not find or use krb4 or GSS - - Rebuilds test files too eagerly, but still cannot run the tests - - Does not detect the correct `strerror_r` flavor when cross-compiling - (issue #1123) - # Configuring A CMake configuration of curl is similar to the autotools build of curl. @@ -68,6 +49,13 @@ If you want to build in the source tree, it is enough to do this: $ cmake . +### Build system generator selection + +You can override CMake's default by using `-G `. For example +on Windows with multiple build systems if you have MinGW-w64 then you could use +`-G "MinGW Makefiles"`. +[List of generator names](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html). + ## Using `ccmake` CMake comes with a curses based interface called `ccmake`. To run `ccmake` @@ -102,6 +90,25 @@ Build (you have to specify the build directory). $ cmake --build ../curl-build +## Static builds + +The CMake build setup is primarily done to work with shared/dynamic third +party dependencies. When linking with shared libraries, the dependency "chain" +is handled automatically by the library loader - on all modern systems. + +If you instead link with a static library, you need to provide all the +dependency libraries already at the link command line. + +Figuring out all the dependency libraries for a given library is hard, as it +might involve figuring out the dependencies of the dependencies and they vary +between platforms and can change between versions. + +When using static dependencies, the build scripts mostly assume that you, the +user, provide all the necessary additional dependency libraries as additional +arguments in the build. + +Building statically is not for the faint of heart. + ### Fallback for CMake before version 3.13 CMake before version 3.13 does not support the `--build` option. In that @@ -131,3 +138,226 @@ assumes that CMake generates `Makefile`: $ cd ../curl-build $ make install + +# CMake build options + +- `BUILD_CURL_EXE`: Build curl executable. Default: `ON` +- `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_STATIC_CURL`: Build curl executable with static libcurl. Default: `OFF` +- `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF` +- `BUILD_TESTING`: Build tests. Default: `ON` +- `CURL_DEFAULT_SSL_BACKEND`: Override default TLS backend in MultiSSL builds. + Accepted values in order of default priority: + `wolfssl`, `gnutls`, `mbedtls`, `openssl`, `secure-transport`, `schannel`, `bearssl`, `rustls` +- `CURL_ENABLE_EXPORT_TARGET`: Enable CMake export target. Default: `ON` +- `CURL_HIDDEN_SYMBOLS`: Hide libcurl internal symbols (=hide all symbols that are not officially external). Default: `ON` +- `CURL_LIBCURL_SOVERSION`: Enable libcurl SOVERSION. Default: `ON` for supported platforms +- `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF` +- `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `_` or `MULTISSL_` +- `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF` +- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`). Default: `OFF` +- `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string. +- `CURL_TEST_BUNDLES`: Bundle `libtest` and `unittest` tests into single binaries. Default: `OFF` +- `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF` +- `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature: Default: =`ENABLE_DEBUG` +- `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON` +- `ENABLE_DEBUG`: Enable curl debug features (for developing curl itself). Default: `OFF` +- `IMPORT_LIB_SUFFIX`: Import library suffix. Default: `_imp` +- `LIBCURL_OUTPUT_NAME`: Basename of the curl library. Default: `libcurl` +- `PICKY_COMPILER`: Enable picky compiler options. Default: `ON` +- `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty) + +## 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_FALLBACK`: Use built-in CA store of TLS backend. Default: `OFF` +- `CURL_CA_PATH`: Location of default CA path. 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 + +- `CURL_ENABLE_SSL`: Enable SSL support. Default: `ON` +- `CURL_WINDOWS_SSPI`: Enable SSPI on Windows. Default: =`CURL_USE_SCHANNEL` +- `ENABLE_IPV6`: Enable IPv6 support. Default: `ON` +- `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled +- `ENABLE_UNICODE`: Use the Unicode version of the Windows API functions. Default: `OFF` +- `ENABLE_UNIX_SOCKETS`: Enable Unix domain sockets support. Default: `ON` +- `USE_ECH`: Enable ECH support. Default: `OFF` +- `USE_HTTPSRR`: Enable HTTPS RR support for ECH (experimental). Default: `OFF` +- `USE_OPENSSL_QUIC`: Use OpenSSL and nghttp3 libraries for HTTP/3 support. Default: `OFF` + +## Disabling features + +- `CURL_DISABLE_ALTSVC`: Disable alt-svc support. Default: `OFF` +- `CURL_DISABLE_AWS`: Disable **aws-sigv4**. Default: `OFF` +- `CURL_DISABLE_BASIC_AUTH`: Disable Basic authentication. Default: `OFF` +- `CURL_DISABLE_BEARER_AUTH`: Disable Bearer authentication. Default: `OFF` +- `CURL_DISABLE_BINDLOCAL`: Disable local binding support. Default: `OFF` +- `CURL_DISABLE_CA_SEARCH`: Disable unsafe CA bundle search in PATH on Windows. Default: `OFF` +- `CURL_DISABLE_COOKIES`: Disable cookies support. Default: `OFF` +- `CURL_DISABLE_DICT`: Disable DICT. Default: `OFF` +- `CURL_DISABLE_DIGEST_AUTH`: Disable Digest authentication. Default: `OFF` +- `CURL_DISABLE_DOH`: Disable DNS-over-HTTPS. Default: `OFF` +- `CURL_DISABLE_FILE`: Disable FILE. Default: `OFF` +- `CURL_DISABLE_FORM_API`: Disable **form-api**: Default: =`CURL_DISABLE_MIME` +- `CURL_DISABLE_FTP`: Disable FTP. Default: `OFF` +- `CURL_DISABLE_GETOPTIONS`: Disable `curl_easy_options` API for existing options to `curl_easy_setopt`. Default: `OFF` +- `CURL_DISABLE_GOPHER`: Disable Gopher. Default: `OFF` +- `CURL_DISABLE_HEADERS_API`: Disable **headers-api** support. Default: `OFF` +- `CURL_DISABLE_HSTS`: Disable HSTS support. Default: `OFF` +- `CURL_DISABLE_HTTP`: Disable HTTP. Default: `OFF` +- `CURL_DISABLE_HTTP_AUTH`: Disable all HTTP authentication methods. Default: `OFF` +- `CURL_DISABLE_IMAP`: Disable IMAP. Default: `OFF` +- `CURL_DISABLE_INSTALL`: Disable installation targets. Default: `OFF` +- `CURL_DISABLE_IPFS`: Disable IPFS. Default: `OFF` +- `CURL_DISABLE_KERBEROS_AUTH`: Disable Kerberos authentication. Default: `OFF` +- `CURL_DISABLE_LDAP`: Disable LDAP. Default: `OFF` +- `CURL_DISABLE_LDAPS`: Disable LDAPS. Default: =`CURL_DISABLE_LDAP` +- `CURL_DISABLE_LIBCURL_OPTION`: Disable `--libcurl` option from the curl tool. Default: `OFF` +- `CURL_DISABLE_MIME`: Disable MIME support. Default: `OFF` +- `CURL_DISABLE_MQTT`: Disable MQTT. Default: `OFF` +- `CURL_DISABLE_NEGOTIATE_AUTH`: Disable negotiate authentication. Default: `OFF` +- `CURL_DISABLE_NETRC`: Disable netrc parser. Default: `OFF` +- `CURL_DISABLE_NTLM`: Disable NTLM support. Default: `OFF` +- `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG`: Disable automatic loading of OpenSSL configuration. Default: `OFF` +- `CURL_DISABLE_PARSEDATE`: Disable date parsing. Default: `OFF` +- `CURL_DISABLE_POP3`: Disable POP3. Default: `OFF` +- `CURL_DISABLE_PROGRESS_METER`: Disable built-in progress meter. Default: `OFF` +- `CURL_DISABLE_PROXY`: Disable proxy support. Default: `OFF` +- `CURL_DISABLE_RTSP`: Disable RTSP. Default: `OFF` +- `CURL_DISABLE_SHA512_256`: Disable SHA-512/256 hash algorithm. Default: `OFF` +- `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_SRP`: Disable TLS-SRP support. Default: `OFF` +- `CURL_DISABLE_TELNET`: Disable Telnet. Default: `OFF` +- `CURL_DISABLE_TFTP`: Disable TFTP. 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` + +## Environment + +- `CI`: Assume running under CI if set. +- `CURL_BUILDINFO`: Print `buildinfo.txt` if set. +- `CURL_CI`: Assume running under CI if set. + +## CMake options + +- `CMAKE_DEBUG_POSTFIX`: Default: `-d` +- `CMAKE_IMPORT_LIBRARY_SUFFIX` (see CMake) +- `CMAKE_INSTALL_BINDIR` (see CMake) +- `CMAKE_INSTALL_INCLUDEDIR` (see CMake) +- `CMAKE_INSTALL_LIBDIR` (see CMake) +- `CMAKE_INSTALL_PREFIX` (see CMake) +- `CMAKE_STATIC_LIBRARY_SUFFIX` (see CMake) +- `CMAKE_UNITY_BUILD_BATCH_SIZE`: Set the number of sources in a "unity" unit. Default: `0` (all) +- `CMAKE_UNITY_BUILD`: Enable "unity" (aka jumbo) builds. Default: `OFF` + +Details via CMake +[variables](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) and +[install directories](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html). + +## Dependencies + +- `CURL_BROTLI`: Use brotli. Default: `OFF` +- `CURL_USE_BEARSSL`: Enable BearSSL for SSL/TLS. Default: `OFF` +- `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_LIBPSL`: Use libpsl. Default: `ON` +- `CURL_USE_LIBSSH2`: Use libssh2. Default: `ON` +- `CURL_USE_LIBSSH`: Use libssh. Default: `OFF` +- `CURL_USE_LIBUV`: Use libuv for event-based tests. Default: `OFF` +- `CURL_USE_MBEDTLS`: Enable mbedTLS for SSL/TLS. Default: `OFF` +- `CURL_USE_OPENSSL`: Enable OpenSSL for SSL/TLS. Default: `ON` if no other TLS backend was enabled. +- `CURL_USE_PKGCONFIG`: Enable `pkg-config` to detect dependencies. Default: `ON` for Unix, vcpkg, MinGW if not cross-compiling. +- `CURL_USE_RUSTLS`: Enable Rustls for SSL/TLS. Default: `OFF` +- `CURL_USE_SCHANNEL`: Enable Windows native SSL/TLS (Schannel). Default: `OFF` +- `CURL_USE_SECTRANSP`: Enable Apple OS native SSL/TLS (Secure Transport). Default: `OFF` +- `CURL_USE_WOLFSSH`: Use wolfSSH. Default: `OFF` +- `CURL_USE_WOLFSSL`: Enable wolfSSL for SSL/TLS. Default: `OFF` +- `CURL_ZLIB`: Use zlib (`ON`, `OFF` or `AUTO`). Default: `AUTO` +- `CURL_ZSTD`: Use zstd. Default: `OFF` +- `ENABLE_ARES`: Enable c-ares support. Default: `OFF` +- `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF` +- `USE_LIBIDN2`: Use libidn2 for IDN support. Default: `ON` +- `USE_LIBRTMP`: Enable librtmp from rtmpdump. Default: `OFF` +- `USE_MSH3`: Use msh3/msquic library for HTTP/3 support. Default: `OFF` +- `USE_NGHTTP2`: Use nghttp2 library. Default: `ON` +- `USE_NGTCP2`: Use ngtcp2 and nghttp3 libraries for HTTP/3 support. Default: `OFF` +- `USE_QUICHE`: Use quiche library for HTTP/3 support. Default: `OFF` +- `USE_WIN32_IDN`: Use WinIDN for IDN support. Default: `OFF` +- `USE_WIN32_LDAP`: Use Windows LDAP implementation. Default: `ON` + +## Dependency options (via CMake) + +- `OPENSSL_ROOT_DIR`: Set this variable to the root installation of OpenSSL (and forks). +- `ZLIB_INCLUDE_DIR`: The zlib include directory. +- `ZLIB_LIBRARY`: Path to `zlib` library. + +## Dependency options + +- `PERL_EXECUTABLE` Perl binary used throughout the build and tests. +- `BEARSSL_INCLUDE_DIR`: The BearSSL include directory. +- `BEARSSL_LIBRARY`: Path to `bearssl` 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. +- `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. +- `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. +- `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. +- `MSH3_INCLUDE_DIR`: The msh3 include directory. +- `MSH3_LIBRARY`: Path to `msh3` library. +- `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. +- `NETTLE_INCLUDE_DIR`: The nettle include directory. +- `NETTLE_LIBRARY`: Path to `nettle` library. +- `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. +- `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory. +- `WOLFSSH_LIBRARY`: Path to `wolfssh` library. +- `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. + +## Test tools + +- `APACHECTL`: Default: `apache2ctl` +- `APXS`: Default: `apxs` +- `CADDY`: Default: `caddy` +- `HTTPD_NGHTTPX`: Default: `nghttpx` +- `HTTPD`: Default: `apache2` +- `TEST_NGHTTPX`: Default: `nghttpx` +- `VSFTPD`: Default: `vsftps` diff --git a/deps/curl/docs/INSTALL.md b/deps/curl/docs/INSTALL.md index 7971b1ab..bfcbd2e7 100644 --- a/deps/curl/docs/INSTALL.md +++ b/deps/curl/docs/INSTALL.md @@ -1,4 +1,10 @@ -# how to install curl and libcurl + + +# How to install curl and libcurl ## Installing Binary Packages @@ -134,7 +140,7 @@ These options are provided to select the TLS backend to use. - BearSSL: `--with-bearssl` - GnuTLS: `--with-gnutls`. - mbedTLS: `--with-mbedtls` - - OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, libressl, and quictls) + - OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls) - rustls: `--with-rustls` - Schannel: `--with-schannel` - Secure Transport: `--with-secure-transport` @@ -148,7 +154,17 @@ conflicting identical symbol names. When you build with multiple TLS backends, you can select the active one at runtime when curl starts up. -## configure finding libs in wrong directory +## MultiSSL and HTTP/3 + +HTTP/3 needs QUIC and QUIC needs TLS. Building libcurl with HTTP/3 and QUIC +support is not compatible with the MultiSSL feature: they are mutually +exclusive. If you need MultiSSL in your build, you cannot have HTTP/3 support +and vice versa. + +libcurl can only use a single TLS library with QUIC and that *same* TLS +library needs to be used for the other TLS using protocols. + +## Configure finding libs in wrong directory When the configure script checks for third-party libraries, it adds those directories to the `LDFLAGS` variable and then tries linking to see if it @@ -237,7 +253,7 @@ Note: The pre-processor settings can be found using the Visual Studio IDE under "Project -> Properties -> Configuration Properties -> C/C++ -> Preprocessor". -## Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds +## Using BSD-style lwIP instead of Winsock TCP/IP stack in Windows builds In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack it is necessary to make the definition of the preprocessor symbol `USE_LWIPSOCK` @@ -505,14 +521,14 @@ disabling support for some feature (run `./configure --help` to see them all): - `--disable-mime` (MIME API) - `--disable-netrc` (.netrc file) - `--disable-ntlm` (NTLM authentication) - - `--disable-ntlm-wb` (NTLM WinBind) + - `--disable-ntlm-wb` (NTLM winbind) - `--disable-progress-meter` (graphical progress meter in library) - `--disable-proxy` (HTTP and SOCKS proxies) - `--disable-pthreads` (multi-threading) - `--disable-socketpair` (socketpair for asynchronous name resolving) - `--disable-threaded-resolver` (threaded name resolver) - `--disable-tls-srp` (Secure Remote Password authentication for TLS) - - `--disable-unix-sockets` (UNIX sockets) + - `--disable-unix-sockets` (Unix sockets) - `--disable-verbose` (eliminates debugging strings and error code strings) - `--disable-versioned-symbols` (versioned symbols) - `--enable-symbol-hiding` (eliminates unneeded symbols in the shared library) @@ -554,18 +570,18 @@ that are not automatically detected: 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! +and runs on, that is not listed, please let us know. ## 101 Operating Systems AIX, AmigaOS, Android, ArcoOS, Aros, Atari FreeMiNT, BeOS, Blackberry 10, Blackberry Tablet OS, Cell OS, CheriBSD, Chrome OS, Cisco IOS, DG/UX, Dragonfly BSD, DR DOS, eCOS, FreeBSD, FreeDOS, FreeRTOS, Fuchsia, Garmin OS, - Genode, Haiku, HardenedBSD, HP-UX, Hurd, Illumos, Integrity, iOS, ipadOS, IRIX, + Genode, Haiku, HardenedBSD, HP-UX, Hurd, illumos, Integrity, iOS, ipadOS, IRIX, Linux, Lua RTOS, Mac OS 9, macOS, Mbed, Meego, Micrium, MINIX, Moblin, MorphOS, MPE/iX, MS-DOS, NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo Switch, NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, OS/400, OS21, Plan 9, - PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, RICS OS, ROS, RTEMS, + PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, RISC OS, ROS, RTEMS, Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS, ucLinux, Ultrix, UNICOS, UnixWare, VMS, vxWorks, watchOS, Wear OS, WebOS, Wii system software, Wii U, diff --git a/deps/curl/docs/INTERNALS.md b/deps/curl/docs/INTERNALS.md index b1a095fe..ae77f0e5 100644 --- a/deps/curl/docs/INTERNALS.md +++ b/deps/curl/docs/INTERNALS.md @@ -1,3 +1,9 @@ + + # curl internals The canonical libcurl internals documentation is now in the [everything @@ -29,7 +35,7 @@ versions of libs and build tools. - MIT Kerberos 1.2.4 - Heimdal ? - nghttp2 1.15.0 - - WinSock 2.2 (on Windows 95+ and Windows CE .NET 4.1+) + - Winsock 2.2 (on Windows 95+ and Windows CE .NET 4.1+) ## Build tools @@ -41,7 +47,7 @@ versions of libs and build tools. - GNU Autoconf 2.59 - GNU Automake 1.7 - GNU M4 1.4 - - perl 5.6 + - perl 5.8 - roffit 0.5 - cmake 3.7 diff --git a/deps/curl/docs/IPFS.md b/deps/curl/docs/IPFS.md index 65c0f5da..82dae943 100644 --- a/deps/curl/docs/IPFS.md +++ b/deps/curl/docs/IPFS.md @@ -1,3 +1,9 @@ + + # IPFS For an overview about IPFS, visit the [IPFS project site](https://ipfs.tech/). diff --git a/deps/curl/docs/KNOWN_BUGS b/deps/curl/docs/KNOWN_BUGS index f4ced4d8..5a1e5eea 100644 --- a/deps/curl/docs/KNOWN_BUGS +++ b/deps/curl/docs/KNOWN_BUGS @@ -12,13 +12,11 @@ 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 - 1.2 hyper is slow - 1.5 Expect-100 meets 417 2. TLS - 2.1 IMAPS connection fails with rustls error + 2.1 IMAPS connection fails with Rustls error 2.3 Unable to use PKCS12 certificate with Secure Transport - 2.4 Secure Transport will not import PKCS#12 client certificates without a password + 2.4 Secure Transport does not import PKCS#12 client certificates without a password 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 @@ -27,33 +25,31 @@ problems may have been fixed or changed somewhat since this was written. 3. Email protocols 3.1 IMAP SEARCH ALL truncated response 3.2 No disconnect command - 3.3 POP3 expects "CRLF.CRLF" eob for some single-line responses 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 building for old macOS fails with gcc - 5.5 cannot handle Unicode arguments in non-Unicode builds on Windows - 5.6 cygwin: make install installs curl-config.1 twice - 5.9 Utilize Requires.private directives in libcurl.pc + 5.3 LDFLAGS passed too late making libs linked incorrectly + 5.6 Cygwin: make install installs curl-config.1 twice 5.11 configure --with-gssapi with Heimdal is ignored on macOS 5.12 flaky CI builds 5.13 long paths are not fully supported on Windows - 5.14 Windows Unicode builds use homedir in current locale 5.15 Unicode on Windows 6. Authentication - 6.1 NTLM authentication and unicode 6.2 MIT Kerberos for Windows build 6.3 NTLM in system context uses wrong name 6.5 NTLM does not support password with § character 6.6 libcurl can fail to try alternatives with --proxy-any 6.7 Do not clear digest for single realm + 6.8 Heimdal memory leaks 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 @@ -61,12 +57,7 @@ problems may have been fixed or changed somewhat since this was written. 6.13 Negotiate against Hadoop HDFS 7. FTP - 7.1 FTP upload fails if remembered dir is deleted - 7.2 Implicit FTPS upload timeout - 7.3 FTP with NOBODY and FAILONERROR 7.4 FTP with ACCT - 7.5 FTPS upload, FileZilla, GnuTLS and close_notify - 7.11 FTPS upload data loss with TLS 1.3 7.12 FTPS directory listing hangs on Windows with Schannel 9. SFTP and SCP @@ -74,15 +65,19 @@ problems may have been fixed or changed somewhat since this was written. 9.2 wolfssh: publickey auth does not work 9.3 Remote recursive folder creation with SFTP 9.4 libssh blocking and infinite loop problem - 9.5 cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" + 9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" 10. SOCKS - 10.3 FTPS over SOCKS 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.3 TFTP tests fail on OpenBSD 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 12. LDAP 12.1 OpenLDAP hangs after returning results @@ -99,20 +94,22 @@ problems may have been fixed or changed somewhat since this was written. 15.3 unusable tool_hugehelp.c with MinGW 15.6 uses -lpthread instead of Threads::Threads 15.7 generated .pc file contains strange entries - 15.11 ExternalProject_Add does not set CURL_CA_PATH 15.13 CMake build with MIT Kerberos does not work 16. aws-sigv4 - 16.1 aws-sigv4 does not sign requests with * correctly + 16.2 aws-sigv4 does not handle multipart/form-data correctly + 16.3 aws-sigv4 has problems with particular URLs 16.6 aws-sigv4 does not behave well with AWS VPC Lattice 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 19. RTSP 19.1 Some methods do not support response bodies @@ -121,22 +118,9 @@ problems may have been fixed or changed somewhat since this was written. 1. HTTP -1.2 hyper is slow - - When curl is built to use hyper for HTTP, it is unnecessary slow. - - https://github.com/curl/curl/issues/11203 - -1.5 Expect-100 meets 417 - - If an upload using Expect: 100-continue receives an HTTP 417 response, it - ought to be automatically resent without the Expect:. A workaround is for - the client application to redo the transfer after disabling Expect:. - https://curl.se/mail/archive-2008-02/0043.html - 2. TLS -2.1 IMAPS connection fails with rustls error +2.1 IMAPS connection fails with Rustls error https://github.com/curl/curl/issues/10457 @@ -144,7 +128,7 @@ problems may have been fixed or changed somewhat since this was written. See https://github.com/curl/curl/issues/5403 -2.4 Secure Transport will not import PKCS#12 client certificates without a password +2.4 Secure Transport does not import PKCS#12 client certificates without a password libcurl calls SecPKCS12Import with the PKCS#12 client certificate, but that function rejects certificates that do not have a password. @@ -188,12 +172,6 @@ problems may have been fixed or changed somewhat since this was written. 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.3 POP3 expects "CRLF.CRLF" eob for some single-line responses - - You have to tell libcurl not to expect a body, when dealing with one line - response commands. Please see the POP3 examples and test cases which show - this for the NOOP and DELE commands. https://curl.se/bug/?i=740 - 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 @@ -213,6 +191,25 @@ problems may have been fixed or changed somewhat since this was written. 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 @@ -225,38 +222,22 @@ problems may have been fixed or changed somewhat since this was written. 5.2 curl-config --libs contains private details - "curl-config --libs" will 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. + "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 building for old macOS fails with gcc +5.3 LDFLAGS passed too late making libs linked incorrectly - Building curl for certain old macOS versions fails when gcc is used. We - command using clang in those cases. + 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/11441 + See https://github.com/curl/curl/issues/14893 -5.5 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. And, 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 - -5.6 cygwin: make install installs curl-config.1 twice +5.6 Cygwin: make install installs curl-config.1 twice https://github.com/curl/curl/issues/8839 -5.9 Utilize Requires.private directives in libcurl.pc - - https://github.com/curl/curl/issues/864 - 5.11 configure --with-gssapi with Heimdal is ignored on macOS ... unless you also pass --with-gssapi-libs @@ -276,45 +257,58 @@ problems may have been fixed or changed somewhat since this was written. 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: + 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.14 Windows Unicode builds use homedir in current locale +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. + 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 -5.15 Unicode on Windows + Cannot handle Unicode arguments in non-Unicode builds on Windows - Passing in a unicode filename with -o: + 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://github.com/curl/curl/issues/11461 + https://curl.se/bug/?i=345 + https://curl.se/bug/?i=731 + https://curl.se/bug/?i=3747 - Passing in unicode character with -d: + NTLM authentication and Unicode - https://github.com/curl/curl/issues/12231 - -6. Authentication - -6.1 NTLM authentication and unicode - - NTLM authentication involving unicode user name or password only works - properly if built with UNICODE defined together with the Schannel - backend. The original problem was mentioned in: + 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.2 MIT Kerberos for Windows build libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's @@ -324,8 +318,8 @@ problems may have been fixed or changed somewhat since this was written. 6.3 NTLM in system context uses wrong name NTLM authentication using SSPI (on Windows) when (lib)curl is running in - "system context" will make it use wrong(?) user name - at least when compared - to what winhttp does. See https://curl.se/bug/view.cgi?id=535 + "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 § character @@ -334,11 +328,11 @@ problems may have been fixed or changed somewhat since this was written. 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 will cause libcurl to abort trying other options if the - failed method has a higher preference than the alternatives. As an example, + 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 will not proceed to try authentication - using NTLM. + fails to set up Kerberos authentication does not proceed to try + authentication using NTLM. https://github.com/curl/curl/issues/876 @@ -346,6 +340,13 @@ problems may have been fixed or changed somewhat since this was written. https://github.com/curl/curl/issues/3267 +6.8 Heimdal memory leaks + + Running test 2077 and 2078 with curl built to do GSS with Heimdal causes + valgrind errors (memory leak). + + https://github.com/curl/curl/issues/14446 + 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 @@ -381,62 +382,19 @@ problems may have been fixed or changed somewhat since this was written. 7. FTP -7.1 FTP upload fails if remembered dir is deleted - - curl's FTP code assumes that the directory it entered in a previous transfer - still exists when it comes back to do a second transfer, and does not respond - well if it was indeed deleted in the mean time. - - https://github.com/curl/curl/issues/12181 - -7.2 Implicit FTPS upload timeout - - https://github.com/curl/curl/issues/11720 - -7.3 FTP with NOBODY and FAILONERROR - - It seems sensible to be able to use CURLOPT_NOBODY and CURLOPT_FAILONERROR - with FTP to detect if a file exists or not, but it is not working: - https://curl.se/mail/lib-2008-07/0295.html - 7.4 FTP with ACCT When doing an operation over FTP that requires the ACCT command (but not when - logging in), the operation will fail since libcurl does not detect this and - thus fails to issue the correct command: - https://curl.se/bug/view.cgi?id=635 - -7.5 FTPS upload, FileZilla, GnuTLS and close_notify - - An issue where curl does not send the TLS alert close_notify, which triggers - the wrath of GnuTLS in FileZilla server, and a FTP reply 426 ECONNABORTED. - - https://github.com/curl/curl/issues/11383 - -7.11 FTPS upload data loss with TLS 1.3 - - During FTPS upload curl does not attempt to read TLS handshake messages sent - after the initial handshake. OpenSSL servers running TLS 1.3 may send such a - message. When curl closes the upload connection if unread data has been - received (such as a TLS handshake message) then the TCP protocol sends an - RST to the server, which may cause the server to discard or truncate the - upload if it has not read all sent data yet, and then return an error to curl - on the control channel connection. - - Since 7.78.0 this is mostly fixed. curl will do a single read before closing - TLS connections (which causes the TLS library to read handshake messages), - however there is still possibility of an RST if more messages need to be read - or a message arrives after the read but before close (network race condition). - - https://github.com/curl/curl/issues/6149 + 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's very likely some changes to curl - since then fixed the issues. None of the reported issues can be reproduced any - longer. + 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. @@ -471,32 +429,40 @@ problems may have been fixed or changed somewhat since this was written. 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 will be stuck, even if curl is configured with a timeout. + 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!" +9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" - Running SCP and SFTP tests on cygwin makes this warning message appear. + Running SCP and SFTP tests on Cygwin makes this warning message appear. https://github.com/curl/curl/issues/11244 10. SOCKS -10.3 FTPS over SOCKS - - libcurl does not support FTPS over a SOCKS proxy. - - 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 - only. But you only have IPv4 connectivity. libcurl will correctly fail with - CURLE_COULDNT_CONNECT. But the error buffer set by CURLOPT_ERRORBUFFER + 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.3 TFTP tests fail on OpenBSD + + When adding an OpenBSD job with tests to GHA, some tests consistently fail + to run. + + See https://github.com/curl/curl/issues/13623 + 11.4 HTTP test server 'connection-monitor' problems The 'connection-monitor' feature of the sws HTTP test server does not work @@ -512,6 +478,23 @@ problems may have been fixed or changed somewhat since this was written. 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. + 12. LDAP 12.1 OpenLDAP hangs after returning results @@ -553,8 +536,8 @@ problems may have been fixed or changed somewhat since this was written. 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 will try the first port, use that and - then subsequently fail anyway if that was actually in use. + 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 @@ -566,12 +549,6 @@ problems may have been fixed or changed somewhat since this was written. https://github.com/curl/curl/issues/11158 -15.2 support build with GnuTLS - -15.3 unusable tool_hugehelp.c with MinGW - - see https://github.com/curl/curl/issues/3125 - 15.6 uses -lpthread instead of Threads::Threads See https://github.com/curl/curl/issues/6166 @@ -583,13 +560,6 @@ problems may have been fixed or changed somewhat since this was written. See https://github.com/curl/curl/issues/6167 -15.11 ExternalProject_Add does not set CURL_CA_PATH - - CURL_CA_BUNDLE and CURL_CA_PATH are not set properly when cmake's - ExternalProject_Add is used to build curl as a dependency. - - See https://github.com/curl/curl/issues/6313 - 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 @@ -603,9 +573,13 @@ problems may have been fixed or changed somewhat since this was written. 16. aws-sigv4 -16.1 aws-sigv4 does not sign requests with * correctly +16.2 aws-sigv4 does not handle multipart/form-data correctly - https://github.com/curl/curl/issues/7559 + https://github.com/curl/curl/issues/13351 + +16.3 aws-sigv4 has problems with particular URLs + + https://github.com/curl/curl/issues/13058 16.6 aws-sigv4 does not behave well with AWS VPC Lattice @@ -620,9 +594,9 @@ problems may have been fixed or changed somewhat since this was written. 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 will - be found readable when considered for reuse and that makes curl think it is - dead and then it will be closed and a new connection gets created instead. + 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. @@ -634,18 +608,34 @@ problems may have been fixed or changed somewhat since this was written. See https://github.com/curl/curl/issues/5119 +17.4 HTTP/2 + TLS spends a lot of time in recv + + It has been observered 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 + 19. RTSP 19.1 Some methods do not support response bodies The RTSP implementation is written to assume that a number of RTSP methods - will always get responses without bodies, even though there seems to be no + 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/deps/curl/docs/MAIL-ETIQUETTE b/deps/curl/docs/MAIL-ETIQUETTE deleted file mode 100644 index d42a6f0d..00000000 --- a/deps/curl/docs/MAIL-ETIQUETTE +++ /dev/null @@ -1,284 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -MAIL ETIQUETTE - - 1. About the lists - 1.1 Mailing Lists - 1.2 Netiquette - 1.3 Do Not Mail a Single Individual - 1.4 Subscription Required - 1.5 Moderation of new posters - 1.6 Handling trolls and spam - 1.7 How to unsubscribe - 1.8 I posted, now what? - 1.9 Your emails are public - - 2. Sending mail - 2.1 Reply or New Mail - 2.2 Reply to the List - 2.3 Use a Sensible Subject - 2.4 Do Not Top-Post - 2.5 HTML is not for mails - 2.6 Quoting - 2.7 Digest - 2.8 Please Tell Us How You Solved The Problem - -============================================================================== - -1. About the lists - - 1.1 Mailing Lists - - The mailing lists we have are all listed and described at - https://curl.se/mail/ - - Each mailing list is targeted to a specific set of users and subjects, - please use the one or the ones that suit you the most. - - Each mailing list has hundreds up to thousands of readers, meaning that each - mail sent is received and read by a large number of people. People from - various cultures, regions, religions and continents. - - 1.2 Netiquette - - Netiquette is a common term for how to behave on the Internet. Of course, in - each particular group and subculture there are differences in what is - acceptable and what is considered good manners. - - This document outlines what we in the curl project consider to be good - etiquette, and primarily this focus on how to behave on and how to use our - mailing lists. - - 1.3 Do Not Mail a Single Individual - - Many people send one question to one person. One person gets many mails, and - there is only one person who can give you a reply. The question may be - something that other people would also like to ask. These other people have - no way to read the reply, but to ask the one person the question. The one - person consequently gets overloaded with mail. - - If you really want to contact an individual and perhaps pay for his or her - services, by all means go ahead, but if it's just another curl question, - take it to a suitable list instead. - - 1.4 Subscription Required - - All curl mailing lists require that you are subscribed to allow a mail to go - through to all the subscribers. - - If you post without being subscribed (or from a different mail address than - the one you are subscribed with), your mail is simply silently discarded. - You have to subscribe first, then post. - - The reason for this unfortunate and strict subscription policy is of course - to stop spam from pestering the lists. - - 1.5 Moderation of new posters - - Several of the curl mailing lists automatically make all posts from new - subscribers be moderated. After you have subscribed and sent your first mail - to a list, that mail is not let through to the list until a mailing list - administrator has verified that it is OK and permits it to get posted. - - Once a first post has been made that proves the sender is actually talking - about curl-related subjects, the moderation "flag" is switched off and - future posts go through without being moderated. - - The reason for this moderation policy is that we do suffer from spammers who - actually subscribe and send spam to our lists. - - 1.6 Handling trolls and spam - - Despite our good intentions and hard work to keep spam off the lists and to - maintain a friendly and positive atmosphere, there are times when spam and - or trolls get through. - - Troll - "someone who posts inflammatory, extraneous, or off-topic messages - in an online community" - - Spam - "use of electronic messaging systems to send unsolicited bulk - messages" - - No matter what, we NEVER EVER respond to trolls or spammers on the list. If - you believe the list admin should do something in particular, contact them - off-list. The subject is taken care of as much as possible to prevent - repeated offenses, but responding on the list to such messages never leads - to anything good and only puts the light even more on the offender: which - was the entire purpose of it getting sent to the list in the first place. - - Do not feed the trolls. - - 1.7 How to unsubscribe - - You can unsubscribe the same way you subscribed in the first place. You go - to the page for the particular mailing list you are subscribed to and you enter - your email address and password and press the unsubscribe button. - - Also, the instructions to unsubscribe are included in the headers of every - mail that is sent out to all curl related mailing lists and there is a footer - in each mail that links to the "admin" page on which you can unsubscribe and - change other options. - - You NEVER EVER email the mailing list requesting someone else to take you off - the list. - - 1.8 I posted, now what? - - If you are not subscribed with the same email address that you used to send - the email, your post is silently discarded. - - If you posted for the first time to the mailing list, you first need to wait - for an administrator to allow your email to go through (moderated). This - normally happens quickly but in case we are asleep, you may have to wait a - few hours. - - Once your email goes through it is sent out to several hundred or even - thousands of recipients. Your email may cover an area that not that many - people know about or are interested in. Or possibly the person who knows - about it is on vacation or under a heavy work load right now. You may have - to wait for a response and you should not expect to get a response at all. - Ideally, you get an answer within a couple of days. - - You do yourself and all of us a service when you include as many details as - possible already in your first email. Mention your operating system and - environment. Tell us which curl version you are using and tell us what you - did, what happened and what you expected would happen. Preferably, show us - what you did with details enough to allow others to help point out the - problem or repeat the steps in their locations. - - Failing to include details only delays responses and make people respond and - ask for more details and you have to send follow-up emails that include - them. - - Expect the responses to primarily help YOU debug the issue, or ask YOU - questions that can lead you or others towards a solution or explanation to - whatever you experience. - - If you are a repeat offender to the guidelines outlined in this document, - chances are that people ignore you and your chances to get responses in the - future greatly diminish. - - 1.9 Your emails are public - - Your email, its contents and all its headers and the details in those - headers are received by every subscriber of the mailing list that you send - your email to. - - Your email as sent to a curl mailing list ends up in mail archives, on the - curl website and elsewhere, for others to see and read. Today and in the - future. In addition to the archives, the mail is sent out to thousands of - individuals. There is no way to undo a sent email. - - When sending emails to a curl mailing list, do not include sensitive - information such as user names and passwords; use fake ones, temporary ones - or just remove them completely from the mail. Note that this includes base64 - encoded HTTP Basic auth headers. - - This public nature of the curl mailing lists makes automatically inserted mail - footers about mails being "private" or "only meant for the recipient" or - similar even more silly than usual. Because they are absolutely not private - when sent to a public mailing list. - - -2. Sending mail - - 2.1 Reply or New Mail - - Please do not reply to an existing message as a short-cut to post a message - to the lists. - - Many mail programs and web archivers use information within mails to keep - them together as "threads", as collections of posts that discuss a certain - subject. If you do not intend to reply on the same or similar subject, do not - just hit reply on an existing mail and change the subject, create a new mail. - - 2.2 Reply to the List - - When replying to a message from the list, make sure that you do "group - reply" or "reply to all", and not just reply to the author of the single - mail you reply to. - - We are actively discouraging replying back to the single person by setting - the Reply-To: field in outgoing mails back to the mailing list address, - making it harder for people to mail the author directly, if only by mistake. - - 2.3 Use a Sensible Subject - - Please use a subject of the mail that makes sense and that is related to the - contents of your mail. It makes it a lot easier to find your mail afterwards - and it makes it easier to track mail threads and topics. - - 2.4 Do Not Top-Post - - If you reply to a message, do not use top-posting. Top-posting is when you - write the new text at the top of a mail and you insert the previous quoted - mail conversation below. It forces users to read the mail in a backwards - order to properly understand it. - - This is why top posting is so bad (in top posting order): - - A: Because it messes up the order in which people normally read text. - Q: Why is top-posting such a bad thing? - A: Top-posting. - Q: What is the most annoying thing in email? - - Apart from the screwed up read order (especially when mixed together in a - thread when someone responds using the mandated bottom-posting style), it - also makes it impossible to quote only parts of the original mail. - - When you reply to a mail. You let the mail client insert the previous mail - quoted. Then you put the cursor on the first line of the mail and you move - down through the mail, deleting all parts of the quotes that do not add - context for your comments. When you want to add a comment you do so, inline, - right after the quotes that relate to your comment. Then you continue - downwards again. - - When most of the quotes have been removed and you have added your own words, - you are done. - - 2.5 HTML is not for mails - - Please switch off those HTML encoded messages. You can mail all those funny - mails to your friends. We speak plain text mails. - - 2.6 Quoting - - Quote as little as possible. Just enough to provide the context you cannot - leave out. A lengthy description can be found here: - - https://www.netmeister.org/news/learn2quote.html - - 2.7 Digest - - We allow subscribers to subscribe to the "digest" version of the mailing - lists. A digest is a collection of mails lumped together in one single mail. - - Should you decide to reply to a mail sent out as a digest, there are two - things you MUST consider if you really really cannot subscribe normally - instead: - - Cut off all mails and chatter that is not related to the mail you want to - reply to. - - Change the subject name to something sensible and related to the subject, - preferably even the actual subject of the single mail you wanted to reply to - - 2.8 Please Tell Us How You Solved The Problem - - Many people mail questions to the list, people spend some of their time and - make an effort in providing good answers to these questions. - - If you are the one who asks, please consider responding once more in case - one of the hints was what solved your problems. The guys who write answers - feel good to know that they provided a good answer and that you fixed the - problem. Far too often, the person who asked the question is never heard from - again, and we never get to know if they are gone because the problem was - solved or perhaps because the problem was unsolvable. - - Getting the solution posted also helps other users that experience the same - problem(s). They get to see (possibly in the web archives) that the - suggested fixes actually have helped at least one person. diff --git a/deps/curl/docs/MAIL-ETIQUETTE.md b/deps/curl/docs/MAIL-ETIQUETTE.md new file mode 100644 index 00000000..3de77b17 --- /dev/null +++ b/deps/curl/docs/MAIL-ETIQUETTE.md @@ -0,0 +1,258 @@ + + +# Mail etiquette + +## About the lists + +### Mailing Lists + +The mailing lists we have are all listed and described on the [curl +website](https://curl.se/mail/). + +Each mailing list is targeted to a specific set of users and subjects, please +use the one or the ones that suit you the most. + +Each mailing list has hundreds up to thousands of readers, meaning that each +mail sent is received and read by a large number of people. People from +various cultures, regions, religions and continents. + +### Netiquette + +Netiquette is a common term for how to behave on the Internet. Of course, in +each particular group and subculture there are differences in what is +acceptable and what is considered good manners. + +This document outlines what we in the curl project consider to be good +etiquette, and primarily this focus on how to behave on and how to use our +mailing lists. + +### Do Not Mail a Single Individual + +Many people send one question to one person. One person gets many mails, and +there is only one person who can give you a reply. The question may be +something that other people would also like to ask. These other people have no +way to read the reply, but to ask the one person the question. The one person +consequently gets overloaded with mail. + +If you really want to contact an individual and perhaps pay for his or her +services, by all means go ahead, but if it is just another curl question, take +it to a suitable list instead. + +### Subscription Required + +All curl mailing lists require that you are subscribed to allow a mail to go +through to all the subscribers. + +If you post without being subscribed (or from a different mail address than +the one you are subscribed with), your mail is simply silently discarded. You +have to subscribe first, then post. + +The reason for this unfortunate and strict subscription policy is of course to +stop spam from pestering the lists. + +### Moderation of new posters + +Several of the curl mailing lists automatically make all posts from new +subscribers be moderated. After you have subscribed and sent your first mail +to a list, that mail is not let through to the list until a mailing list +administrator has verified that it is OK and permits it to get posted. + +Once a first post has been made that proves the sender is actually talking +about curl-related subjects, the moderation "flag" is switched off and future +posts go through without being moderated. + +The reason for this moderation policy is that we do suffer from spammers who +actually subscribe and send spam to our lists. + +### Handling trolls and spam + +Despite our good intentions and hard work to keep spam off the lists and to +maintain a friendly and positive atmosphere, there are times when spam and or +trolls get through. + +Troll - "someone who posts inflammatory, extraneous, or off-topic messages in +an online community" + +Spam - "use of electronic messaging systems to send unsolicited bulk messages" + +No matter what, we NEVER EVER respond to trolls or spammers on the list. If +you believe the list admin should do something in particular, contact them +off-list. The subject is taken care of as much as possible to prevent repeated +offenses, but responding on the list to such messages never leads to anything +good and only puts the light even more on the offender: which was the entire +purpose of it getting sent to the list in the first place. + +Do not feed the trolls. + +### How to unsubscribe + +You can unsubscribe the same way you subscribed in the first place. You go to +the page for the particular mailing list you are subscribed to and you enter +your email address and password and press the unsubscribe button. + +Also, the instructions to unsubscribe are included in the headers of every +mail that is sent out to all curl related mailing lists and there is a footer +in each mail that links to the "admin" page on which you can unsubscribe and +change other options. + +You NEVER EVER email the mailing list requesting someone else to take you off +the list. + +### I posted, now what? + +If you are not subscribed with the same email address that you used to send +the email, your post is silently discarded. + +If you posted for the first time to the mailing list, you first need to wait +for an administrator to allow your email to go through (moderated). This +normally happens quickly but in case we are asleep, you may have to wait a few +hours. + +Once your email goes through it is sent out to several hundred or even +thousands of recipients. Your email may cover an area that not that many +people know about or are interested in. Or possibly the person who knows about +it is on vacation or under a heavy work load right now. You may have to wait +for a response and you should not expect to get a response at all. Ideally, +you get an answer within a couple of days. + +You do yourself and all of us a service when you include as many details as +possible already in your first email. Mention your operating system and +environment. Tell us which curl version you are using and tell us what you +did, what happened and what you expected would happen. Preferably, show us +what you did with details enough to allow others to help point out the problem +or repeat the steps in their locations. + +Failing to include details only delays responses and make people respond and +ask for more details and you have to send follow-up emails that include them. + +Expect the responses to primarily help YOU debug the issue, or ask YOU +questions that can lead you or others towards a solution or explanation to +whatever you experience. + +If you are a repeat offender to the guidelines outlined in this document, +chances are that people ignore you and your chances to get responses in the +future greatly diminish. + +### Your emails are public + +Your email, its contents and all its headers and the details in those headers +are received by every subscriber of the mailing list that you send your email +to. + +Your email as sent to a curl mailing list ends up in mail archives, on the +curl website and elsewhere, for others to see and read. Today and in the +future. In addition to the archives, the mail is sent out to thousands of +individuals. There is no way to undo a sent email. + +When sending emails to a curl mailing list, do not include sensitive +information such as usernames and passwords; use fake ones, temporary ones or +just remove them completely from the mail. Note that this includes base64 +encoded HTTP Basic auth headers. + +This public nature of the curl mailing lists makes automatically inserted mail +footers about mails being "private" or "only meant for the recipient" or +similar even more silly than usual. Because they are absolutely not private +when sent to a public mailing list. + +## Sending mail + +### Reply or New Mail + +Please do not reply to an existing message as a short-cut to post a message to +the lists. + +Many mail programs and web archivers use information within mails to keep them +together as "threads", as collections of posts that discuss a certain subject. +If you do not intend to reply on the same or similar subject, do not just hit +reply on an existing mail and change the subject, create a new mail. + +### Reply to the List + +When replying to a message from the list, make sure that you do "group reply" +or "reply to all", and not just reply to the author of the single mail you +reply to. + +We are actively discouraging replying to the single person by setting the +correct field in outgoing mails back asking for replies to get sent to the +mailing list address, making it harder for people to reply to the author only +by mistake. + +### Use a Sensible Subject + +Please use a subject of the mail that makes sense and that is related to the +contents of your mail. It makes it a lot easier to find your mail afterwards +and it makes it easier to track mail threads and topics. + +### Do Not Top-Post + +If you reply to a message, do not use top-posting. Top-posting is when you +write the new text at the top of a mail and you insert the previous quoted +mail conversation below. It forces users to read the mail in a backwards order +to properly understand it. + +This is why top posting is so bad (in top posting order): + + A: Because it messes up the order in which people normally read text. + Q: Why is top-posting such a bad thing? + A: Top-posting. + Q: What is the most annoying thing in email? + +Apart from the screwed up read order (especially when mixed together in a +thread when someone responds using the mandated bottom-posting style), it also +makes it impossible to quote only parts of the original mail. + +When you reply to a mail. You let the mail client insert the previous mail +quoted. Then you put the cursor on the first line of the mail and you move +down through the mail, deleting all parts of the quotes that do not add +context for your comments. When you want to add a comment you do so, inline, +right after the quotes that relate to your comment. Then you continue +downwards again. + +When most of the quotes have been removed and you have added your own words, +you are done. + +### HTML is not for mails + +Please switch off those HTML encoded messages. You can mail all those funny +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). + +### Digest + +We allow subscribers to subscribe to the "digest" version of the mailing +lists. A digest is a collection of mails lumped together in one single mail. + +Should you decide to reply to a mail sent out as a digest, there are two +things you MUST consider if you really, really cannot subscribe normally +instead: + +Cut off all mails and chatter that is not related to the mail you want to +reply to. + +Change the subject name to something sensible and related to the subject, +preferably even the actual subject of the single mail you wanted to reply to + +### Please Tell Us How You Solved The Problem + +Many people mail questions to the list, people spend some of their time and +make an effort in providing good answers to these questions. + +If you are the one who asks, please consider responding once more in case one +of the hints was what solved your problems. The guys who write answers feel +good to know that they provided a good answer and that you fixed the problem. +Far too often, the person who asked the question is never heard from again, +and we never get to know if they are gone because the problem was solved or +perhaps because the problem was unsolvable. + +Getting the solution posted also helps other users that experience the same +problem(s). They get to see (possibly in the web archives) that the suggested +fixes actually have helped at least one person. diff --git a/deps/curl/docs/MANUAL.md b/deps/curl/docs/MANUAL.md index 3ce86941..35a94484 100644 --- a/deps/curl/docs/MANUAL.md +++ b/deps/curl/docs/MANUAL.md @@ -1,3 +1,9 @@ + + # curl tutorial ## Simple Usage @@ -268,7 +274,7 @@ To get even more details and information on what curl does, try using the `--trace` or `--trace-ascii` options with a given filename to log to, like this: - curl --trace trace.txt www.haxx.se + curl --trace my-trace.txt www.haxx.se ## Detailed Information @@ -303,7 +309,8 @@ Post a simple `name` and `phone` guestbook. 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 + curl --data-urlencode "name=Rafael Sagula&phone=3320780" + http://www.example.com/guest.cgi How to post a form with curl, lesson #1: @@ -337,7 +344,8 @@ 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 + curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" + http://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 diff --git a/deps/curl/docs/Makefile.am b/deps/curl/docs/Makefile.am index b3a09811..e8f2d55b 100644 --- a/deps/curl/docs/Makefile.am +++ b/deps/curl/docs/Makefile.am @@ -28,9 +28,9 @@ if BUILD_DOCS # if we disable man page building, ignore these MK_CA_DOCS = mk-ca-bundle.1 CURLCONF_DOCS = curl-config.1 +man_MANS = curl-config.1 endif -man_MANS = curl-config.1 CURLPAGES = curl-config.md mk-ca-bundle.md SUBDIRS = . cmdline-opts libcurl @@ -40,64 +40,72 @@ if BUILD_DOCS CLEANFILES = mk-ca-bundle.1 curl-config.1 endif +INTERNALDOCS = \ + internals/BUFQ.md \ + internals/BUFREF.md \ + internals/CHECKSRC.md \ + internals/CLIENT-READERS.md \ + internals/CLIENT-WRITERS.md \ + internals/CODE_STYLE.md \ + internals/CONNECTION-FILTERS.md \ + internals/DYNBUF.md \ + internals/HASH.md \ + internals/HYPER.md \ + internals/LLIST.md \ + internals/MQTT.md \ + internals/NEW-PROTOCOL.md \ + internals/README.md \ + internals/SPLAY.md \ + internals/WEBSOCKET.md + EXTRA_DIST = \ $(CURLPAGES) \ - $(CURLCONF_DOCS) \ - ALTSVC.md \ + $(INTERNALDOCS) \ BINDINGS.md \ - BUFREF.md \ BUG-BOUNTY.md \ BUGS.md \ - CHECKSRC.md \ CIPHERS.md \ + CIPHERS-TLS12.md \ CMakeLists.txt \ CODE_OF_CONDUCT.md \ CODE_REVIEW.md \ - CODE_STYLE.md \ - CLIENT-READERS.md \ - CLIENT-WRITERS.md \ - CONNECTION-FILTERS.md \ CONTRIBUTE.md \ CURL-DISABLE.md \ CURLDOWN.md \ DEPRECATE.md \ - DYNBUF.md \ + DISTROS.md \ EARLY-RELEASE.md \ + ECH.md \ EXPERIMENTAL.md \ FAQ \ FEATURES.md \ GOVERNANCE.md \ HELP-US.md \ HISTORY.md \ - HSTS.md \ HTTP-COOKIES.md \ - HTTP2.md \ HTTP3.md \ - HYPER.md \ INSTALL \ INSTALL-CMAKE.md \ INSTALL.md \ INTERNALS.md \ + IPFS.md \ KNOWN_BUGS \ - MAIL-ETIQUETTE \ - MQTT.md \ - NEW-PROTOCOL.md \ + MAIL-ETIQUETTE.md \ + MANUAL.md \ options-in-versions \ - PARALLEL-TRANSFERS.md \ README.md \ RELEASE-PROCEDURE.md \ RUSTLS.md \ ROADMAP.md \ SECURITY-ADVISORY.md \ + SPONSORS.md \ SSL-PROBLEMS.md \ SSLCERTS.md \ - THANKS \ - TODO \ + THANKS TODO \ TheArtOfHttpScripting.md \ URL-SYNTAX.md \ VERSIONS.md \ - VULN-DISCLOSURE-POLICY.md \ - WEBSOCKET.md + VULN-DISCLOSURE-POLICY.md CD2NROFF = $(top_srcdir)/scripts/cd2nroff $< >$@ @@ -108,7 +116,7 @@ CD2_ = $(CD2_0) SUFFIXES = .1 .md -all: $(MK_CA_DOCS) +all: $(MK_CA_DOCS) $(CURLCONF_DOCS) .md.1: $(CD2)$(CD2NROFF) diff --git a/deps/curl/docs/PARALLEL-TRANSFERS.md b/deps/curl/docs/PARALLEL-TRANSFERS.md deleted file mode 100644 index c086f14a..00000000 --- a/deps/curl/docs/PARALLEL-TRANSFERS.md +++ /dev/null @@ -1,50 +0,0 @@ -# Parallel transfers - -curl 7.66.0 introduced support for doing multiple transfers simultaneously; in -parallel. - -## -Z, --parallel - -When this command line option is used, curl performs the transfers given to it -at the same time. It does up to `--parallel-max` concurrent transfers, with a -default value of 50. - -## Progress meter - -The progress meter that is displayed when doing parallel transfers is -completely different than the regular one used for each single transfer. - - It shows: - - o percent download (if known, which means *all* transfers need to have a - known size) - o percent upload (if known, with the same caveat as for download) - o total amount of downloaded data - o total amount of uploaded data - o number of transfers to perform - o number of concurrent transfers being transferred right now - o number of transfers queued up waiting to start - o total time all transfers are expected to take (if sizes are known) - o current time the transfers have spent so far - o estimated time left (if sizes are known) - o current transfer speed (the faster of upload/download speeds measured over - the last few seconds) - -Example: - - DL% UL% Dled Uled Xfers Live Qd Total Current Left Speed - 72 -- 37.9G 0 101 30 23 0:00:55 0:00:34 0:00:22 2752M - -## Behavior differences - -Connections are shared fine between different easy handles, but the -"authentication contexts" are not. For example doing HTTP Digest auth with one -handle for a particular transfer and then continue on with another handle that -reuses the same connection, the second handle cannot send the necessary -Authorization header at once since the context is only kept in the original -easy handle. - -To fix this, the authorization state could be made possible to share with the -share API as well, as a context per origin + path (realm?) basically. - -Visible in test 153, 1412 and more. diff --git a/deps/curl/docs/README.md b/deps/curl/docs/README.md index 59f4bd14..22d96ea9 100644 --- a/deps/curl/docs/README.md +++ b/deps/curl/docs/README.md @@ -1,3 +1,9 @@ + + ![curl logo](https://curl.se/logo/curl-logo.svg) # Documentation diff --git a/deps/curl/docs/RELEASE-PROCEDURE.md b/deps/curl/docs/RELEASE-PROCEDURE.md index 2b5cbb88..043e3afd 100644 --- a/deps/curl/docs/RELEASE-PROCEDURE.md +++ b/deps/curl/docs/RELEASE-PROCEDURE.md @@ -1,11 +1,15 @@ + + curl release procedure - how to do a release ============================================ in the source code repo ----------------------- -- run `./scripts/copyright.pl` and correct possible omissions - - edit `RELEASE-NOTES` to be accurate - update `docs/THANKS` @@ -16,9 +20,7 @@ in the source code repo tag and we use underscores instead of dots in the version number. Make sure the tag is GPG signed (using -s). -- run `./maketgz 7.34.0` to build the release tarballs. It is important that - you run this on a machine with the correct set of autotools etc installed as - this is what is shipped and used by most users on \*nix like systems. +- run `./scripts/dmaketgz 7.34.0` to build the release tarballs. - push the git commits and the new tag @@ -106,11 +108,11 @@ Coming dates Based on the description above, here are some planned release dates (at the time of this writing): -- October 11, 2023 -- December 6, 2023 -- January 31, 2024 -- March 27, 2024 -- May 22, 2024 -- July 17, 2024 - September 11, 2024 - November 6, 2024 +- January 8, 2025 +- March 5, 2025 +- April 30, 2025 +- June 25, 2025 +- August 20, 2025 +- October 15, 2025 diff --git a/deps/curl/docs/ROADMAP.md b/deps/curl/docs/ROADMAP.md index 46429383..abf306b3 100644 --- a/deps/curl/docs/ROADMAP.md +++ b/deps/curl/docs/ROADMAP.md @@ -1,24 +1,17 @@ + + # curl the next few years - perhaps Roadmap of things Daniel Stenberg wants to work on next. It is intended to serve as a guideline for others for information, feedback and possible participation. -## "Complete" the HTTP/3 support +## WebSocket -curl has experimental support for HTTP/3 since a good while back. There are -some functionality missing and once the final specs are published we want to -eventually remove the "experimental" label from this functionality. +Agree that it is a good enough API and remove the EXPERIMENTAL label. -## HTTPS DNS records - -As a DNS version of alt-svc and also a pre-requisite for ECH (see below). - -See: https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https-02 - -## ECH (Encrypted Client Hello - formerly known as ESNI) - - See Daniel's post on [Support of Encrypted - SNI](https://curl.se/mail/lib-2019-03/0000.html) on the mailing list. - - Initial work exists in [PR 4011](https://github.com/curl/curl/pull/4011) +## diff --git a/deps/curl/docs/RUSTLS.md b/deps/curl/docs/RUSTLS.md index 3515e166..47af01a5 100644 --- a/deps/curl/docs/RUSTLS.md +++ b/deps/curl/docs/RUSTLS.md @@ -1,26 +1,36 @@ + + # Rustls [Rustls is a TLS backend written in Rust](https://docs.rs/rustls/). Curl can be built to use it as an alternative to OpenSSL or other TLS backends. We use the [rustls-ffi C bindings](https://github.com/rustls/rustls-ffi/). This -version of curl depends on version v0.12.0 of rustls-ffi. +version of curl depends on version v0.14.0 of rustls-ffi. -# Building with rustls +# Building with Rustls First, [install Rust](https://rustup.rs/). Next, check out, build, and install the appropriate version of rustls-ffi: - % cargo install cbindgen - % git clone https://github.com/rustls/rustls-ffi -b v0.12.0 + % git clone https://github.com/rustls/rustls-ffi -b v0.14.0 % cd rustls-ffi % make % make DESTDIR=${HOME}/rustls-ffi-built/ install -Now configure and build curl with rustls: +Now configure and build curl with Rustls: % git clone https://github.com/curl/curl % cd curl % autoreconf -fi % ./configure --with-rustls=${HOME}/rustls-ffi-built % make + +See the [rustls-ffi README] for more information on cryptography providers and +their build/platform requirements. + +[rustls-ffi README]: https://github.com/rustls/rustls-ffi/blob/main/README.md#cryptography-provide diff --git a/deps/curl/docs/SECURITY-ADVISORY.md b/deps/curl/docs/SECURITY-ADVISORY.md index 8d908a8c..efb0e049 100644 --- a/deps/curl/docs/SECURITY-ADVISORY.md +++ b/deps/curl/docs/SECURITY-ADVISORY.md @@ -1,3 +1,9 @@ + + # Anatomy of a curl security advisory As described in the [Security Process](https://curl.se/dev/secprocess.html) diff --git a/deps/curl/docs/SPONSORS.md b/deps/curl/docs/SPONSORS.md new file mode 100644 index 00000000..c9cf42a7 --- /dev/null +++ b/deps/curl/docs/SPONSORS.md @@ -0,0 +1,47 @@ + + +# curl sponsors + +A sponsor is someone who donates money or resources to the curl project for no +specific service in return. + +curl accepts donations via [GitHub sponsors](https://github.com/sponsors/curl) +and [Open Collective](https://opencollective.com/curl). + +An even better way to contribute to the project might be to pay an engineer or +two to spend work hours on curl related tasks. + +We promise to use donated funds for things and activities that we believe are +beneficial for the project and its development. That includes but is not +limited to bug-bounties, developer conferences, infrastructure, development, +services and hardware. + +Recurring donations above a certain amount of money puts the sponsor at a +named sponsor level: **Silver**, **Gold**, **Platinum** or **Top**. + +Sponsors on a named level can provide their logo image and preferred URL and +get recognition on the curl website's [sponsor +page](https://curl.se/sponsors.html). + +- **Silver Sponsor** at least 100 USD/month +- **Gold Sponsor** at least 500 USD/month +- **Platinum Sponsor** at least 1000 USD/month +- **Top Sponsor** outstanding extra valuable help + +## Sponsor requirements + +A named level sponsor is entitled a logo and link on the curl website assuming +the company, brand and link are not deemed unsuitable. The curl team reserves +the right to make that decision at its own discretion. + +Sponsors may be denied a website presence for example if involved with drugs, +gambling, pornography, social media manipulation etc. + +## Past Sponsors + +Sponsors that stop paying are considered *Past Sponsors* and are not displayed +on the sponsor page anymore. We thank you for your contributions. diff --git a/deps/curl/docs/SSL-PROBLEMS.md b/deps/curl/docs/SSL-PROBLEMS.md index 86262222..620392c4 100644 --- a/deps/curl/docs/SSL-PROBLEMS.md +++ b/deps/curl/docs/SSL-PROBLEMS.md @@ -1,8 +1,8 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| + # SSL problems @@ -44,7 +44,7 @@ when connecting to make the connection succeed. An additional complication can be that modern SSL libraries sometimes are - built with support for older SSL and TLS versions disabled! + built with support for older SSL and TLS versions disabled. All versions of SSL and the TLS versions before 1.2 are considered insecure and should be avoided. Use TLS 1.2 or later. diff --git a/deps/curl/docs/SSLCERTS.md b/deps/curl/docs/SSLCERTS.md index caac51c4..300039c7 100644 --- a/deps/curl/docs/SSLCERTS.md +++ b/deps/curl/docs/SSLCERTS.md @@ -1,154 +1,123 @@ -SSL Certificate Verification -============================ + -SSL is the old name. It is called TLS these days. +# TLS Certificate Verification -Native SSL ----------- +## Native vs file based -If libcurl was built with Schannel or Secure Transport support (the native SSL -libraries included in Windows and Mac OS X), then this does not apply to -you. Scroll down for details on how the OS-native engines handle SSL -certificates. If you are not sure, then run "curl -V" and read the results. If -the version string says `Schannel` in it, then it was built with Schannel -support. +If curl was built with Schannel or Secure Transport support, then curl uses +the system native CA store for verification. All other TLS libraries use a +file based CA store by default. -It is about trust ------------------ +## Verification -This system is about trust. In your local CA certificate store you have certs -from *trusted* Certificate Authorities that you then can use to verify that -the server certificates you see are valid. They are signed by one of the -certificate authorities you trust. +Every trusted server certificate is digitally signed by a Certificate +Authority, a CA. -Which certificate authorities do you trust? You can decide to trust the same -set of companies your operating system trusts, or the set one of the known -browsers trust. That is basically trust via someone else you trust. You should -just be aware that modern operating systems and browsers are setup to trust -*hundreds* of companies and in recent years several certificate authorities -have been found untrustworthy. +In your local CA store you have a collection of certificates from *trusted* +certificate authorities that TLS clients like curl use to verify servers. -Certificate Verification ------------------------- - -libcurl performs peer SSL certificate verification by default. This is done -by using a CA certificate store that the SSL library can use to make sure the -peer's server certificate is valid. +curl does certificate verification by default. This is done by verifying the +signature and making sure the certificate was crafted for the server name +provided in the URL. If you communicate with HTTPS, FTPS or other TLS-using servers using -certificates in the CA store, you can be sure that the remote server really is -the one it claims to be. +certificates signed by a CA whose certificate is present in the store, you can +be sure that the remote server really is the one it claims to be. -If the remote server uses a self-signed certificate, if you do not install a CA -cert store, if the server uses a certificate signed by a CA that is not +If the remote server uses a self-signed certificate, if you do not install a +CA cert store, if the server uses a certificate signed by a CA that is not included in the store you use or if the remote host is an impostor -impersonating your favorite site, and you want to transfer files from this -server, do one of the following: +impersonating your favorite site, the certificate check fails and reports an +error. - 1. Tell libcurl to *not* verify the peer. With libcurl you disable this with - `curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);` +If you think it wrongly failed the verification, consider one of the following +sections. - With the curl command line tool, you disable this with `-k`/`--insecure`. +### Skip verification - 2. Get a CA certificate that can verify the remote server and use the proper - option to point out this CA cert for verification when connecting. For - libcurl hackers: `curl_easy_setopt(curl, CURLOPT_CAINFO, cacert);` +Tell curl to *not* verify the peer with `-k`/`--insecure`. - With the curl command line tool: `--cacert [file]` +We **strongly** recommend this is avoided and that even if you end up doing +this for experimentation or development, **never** skip verification in +production. - 3. Add the CA cert for your server to the existing default CA certificate - store. The default CA certificate store can be changed at compile time with - the following configure options: +### Use a custom CA store - `--with-ca-bundle=FILE`: use the specified file as the CA certificate - store. CA certificates need to be concatenated in PEM format into this - file. +Get a CA certificate that can verify the remote server and use the proper +option to point out this CA cert for verification when connecting - for this +specific transfer only. - `--with-ca-path=PATH`: use the specified path as CA certificate store. CA - certificates need to be stored as individual PEM files in this directory. - You may need to run c_rehash after adding files there. +With the curl command line tool: `--cacert [file]` - If neither of the two options is specified, configure tries to auto-detect - a setting. It's also possible to explicitly not set any default store but - rely on the built in default the crypto library may provide instead. You - can achieve that by passing both `--without-ca-bundle` and - `--without-ca-path` to the configure script. +If you use the curl command line tool without a native CA store, then you can +specify your own CA cert file by setting the environment variable +`CURL_CA_BUNDLE` to the path of your choice. - If you use Internet Explorer, this is one way to get extract the CA cert - for a particular server: +If you are using the curl command line tool on Windows, curl searches for a CA +cert file named `curl-ca-bundle.crt` in these directories and in this order: + 1. application's directory + 2. current working directory + 3. Windows System directory (e.g. C:\Windows\System32) + 4. Windows Directory (e.g. C:\Windows) + 5. all directories along %PATH% - - View the certificate by double-clicking the padlock - - Find out where the CA certificate is kept (Certificate> - Authority Information Access>URL) - - Get a copy of the crt file using curl - - Convert it from crt to PEM using the OpenSSL tool: - `openssl x509 -inform DES -in yourdownloaded.crt -out outcert.pem -text` - - Add the `outcert.pem` to the CA certificate store or use it stand-alone - as described below. +curl 8.11.0 added a build-time option to disable this search behavior, and +another option to restrict search to the application's directory. - If you use the `openssl` tool, this is one way to get extract the CA cert - for a particular server: +### Use the native store - - `openssl s_client -showcerts -servername server -connect server:443 > cacert.pem` - - type "quit", followed by the "ENTER" key - - The certificate has `BEGIN CERTIFICATE` and `END CERTIFICATE` markers. - - If you want to see the data in the certificate, you can do: `openssl - x509 -inform PEM -in certfile -text -out certdata` where `certfile` is - the cert you extracted from logfile. Look in `certdata`. - - If you want to trust the certificate, you can add it to your CA - certificate store or use it stand-alone as described. Just remember that - the security is no better than the way you obtained the certificate. +In several environments, in particular on Windows, you can ask curl to use the +system's native CA store when verifying the certificate. - 4. If you are using the curl command line tool and the TLS backend is not - Schannel then you can specify your own CA cert file by setting the - environment variable `CURL_CA_BUNDLE` to the path of your choice. +With the curl command line tool: `--ca-native`. - If you are using the curl command line tool on Windows, curl searches for - a CA cert file named "curl-ca-bundle.crt" in these directories and in this - order: - 1. application's directory - 2. current working directory - 3. Windows System directory (e.g. C:\windows\system32) - 4. Windows Directory (e.g. C:\windows) - 5. all directories along %PATH% +### Modify the CA store - 5. Get another CA cert bundle. One option is to extract the one a recent - Firefox browser uses by running 'make ca-bundle' in the curl build tree - root, or possibly download a version that was generated this way for you: - [CA Extract](https://curl.se/docs/caextract.html) +Add the CA cert for your server to the existing default CA certificate store. -Neglecting to use one of the above methods when dealing with a server using a -certificate that is not signed by one of the certificates in the installed CA -certificate store, causes SSL to report an error (`certificate verify failed`) -during the handshake and SSL then refuses further communication with that -server. +Usually you can figure out the path to the local CA store by looking at the +verbose output that `curl -v` shows when you connect to an HTTPS site. -Certificate Verification with Schannel and Secure Transport ------------------------------------------------------------ +### Change curl's default CA store -If libcurl was built with Schannel (Microsoft's native TLS engine) or Secure -Transport (Apple's native TLS engine) support, then libcurl still performs -peer certificate verification, but instead of using a CA cert bundle, it uses -the certificates that are built into the OS. These are the same certificates -that appear in the Internet Options control panel (under Windows) or Keychain -Access application (under OS X). Any custom security rules for certificates -are honored. +The default CA certificate store curl uses is set at build time. When you +build curl you can point out your preferred path. + +### Extract CA cert from a server + + curl -w %{certs} https://example.com > cacert.pem + +The certificate has `BEGIN CERTIFICATE` and `END CERTIFICATE` markers. + +### Get the Mozilla CA store + +Download a version of the Firefox CA store converted to PEM format on the [CA +Extract](https://curl.se/docs/caextract.html) page. It always features the +latest Firefox bundle. + +## Native CA store + +If curl was built with Schannel, Secure Transport or were instructed to use +the native CA Store, then curl uses the certificates that are built into the +OS. These are the same certificates that appear in the Internet Options +control panel (under Windows) or Keychain Access application (under macOS). +Any custom security rules for certificates are honored. Schannel runs CRL checks on certificates unless peer verification is disabled. Secure Transport on iOS runs OCSP checks on certificates unless peer -verification is disabled. Secure Transport on OS X runs either OCSP or CRL +verification is disabled. Secure Transport on macOS runs either OCSP or CRL checks on certificates if those features are enabled, and this behavior can be adjusted in the preferences of Keychain Access. -HTTPS proxy ------------ +## HTTPS proxy -Since version 7.52.0, curl can do HTTPS to the proxy separately from the -connection to the server. This TLS connection is handled separately from the -server connection so instead of `--insecure` and `--cacert` to control the +curl can do HTTPS to the proxy separately from the connection to the server. +This TLS connection is handled and verified separately from the server +connection so instead of `--insecure` and `--cacert` to control the certificate verification, you use `--proxy-insecure` and `--proxy-cacert`. With these options, you make sure that the TLS connection and the trust of the proxy can be kept totally separate from the TLS connection to the server. diff --git a/deps/curl/docs/THANKS b/deps/curl/docs/THANKS index 84f3520a..66cba949 100644 --- a/deps/curl/docs/THANKS +++ b/deps/curl/docs/THANKS @@ -11,6 +11,7 @@ 1ocalhost on github 3dyd on github 3eka on github +5533asdg on github 8U61ife on github a1346054 on github Aaro Koskinen @@ -18,6 +19,7 @@ Aaron Oneal Aaron Orenstein Aaron Scarisbrick aasivov on github +Abdullah Alyan Abhinav Singh Abram Pousada accountantM on github @@ -49,10 +51,12 @@ Ajit Dhumale Akhil Kedia Akhilesh Nema Aki Koskinen +Aki Sakurai Akos Pasztory Akshay Vernekar Alain Danteny Alain Miniussi +Alan Coopersmith Alan Jenkins Alan Pinstein Albert Chin-A-Young @@ -65,6 +69,7 @@ Aleksandar Milivojevic Aleksander Mazur Aleksandr Krotov Aleksey Tulinov +alervd on github Ales Mlakar Ales Novak Alessandro Ghedini @@ -90,6 +95,7 @@ Alex Nichols Alex Potapenko Alex Rousskov Alex Samorukov +Alex Snast Alex Suykov Alex Vinnik Alex Xu @@ -106,6 +112,7 @@ Alexander Krasnostavsky Alexander Lazic Alexander Pepper Alexander Peslyak +Alexander Shtuchkin Alexander Sinditskiy Alexander Traud Alexander V. Tikhonov @@ -156,6 +163,7 @@ Andreas Falkenhahn Andreas Farber Andreas Fischer Andreas Huebner +Andreas Kiefer Andreas Kostyrka Andreas Malzahn Andreas Ntaflos @@ -178,6 +186,7 @@ Andrei Sedoi Andrei Valeriu BICA Andrei Virtosu Andrej E Baranov +Andrew Andrew Barnert Andrew Barnes Andrew Benham @@ -187,6 +196,7 @@ Andrew de los Reyes Andrew Francis Andrew Fuller Andrew Ishchuk +Andrew Kaster Andrew Krieger Andrew Kurushin Andrew Lambert @@ -203,6 +213,8 @@ Andrés García Andy Alt Andy Cedilnik Andy Fiddaman +Andy Pan +Andy Reitz Andy Serpa Andy Stamp Andy Tsouladze @@ -221,6 +233,7 @@ Anthony Hu Anthony Ramine Anthony Shaw Antoine Aubert +Antoine Bollengier Antoine Calando Antoine du Hamel Antoine Pietri @@ -239,6 +252,7 @@ apparentorder on github April King arainchik on github Archangel_SDY on github +Arjan van de Ven Arkadiusz Miskiewicz Armel Asselin Arnaud Compan @@ -262,8 +276,12 @@ AtariDreams on github Ates Goral atjg on github Augustus Saunders +Aurélien Pierre Austin Green +Austin Moore +av223119 on github Avery Fay +awesomekosm on github awesomenode on github Axel Chong Axel Morawietz @@ -330,6 +348,7 @@ Bertrand Demiddelaer Bertrand Simonnet beslick5 on github Bevan Weiss +Bhanu Prakash Bill Doyle Bill Egert Bill Hoffman @@ -350,6 +369,7 @@ Björn Stenberg black-desk on github Blaise Potard Blake Burkhart +blankie bnfp on github Bo Anderson Bob Relyea @@ -379,18 +399,21 @@ BratSinot on github Brendan Jurd Brennan Kinney Brent Beardsley +Brett Buddin Brian Akins Brian Bergeron Brian Carpenter Brian Chaplin Brian Childs Brian Chrisman +Brian Clemens Brian Dessent Brian E. Gallew Brian Green Brian Inglis Brian J. Murrell Brian Lund +brian m. carlson Brian Nixon Brian Prodoehl Brian R Duffy @@ -431,6 +454,7 @@ Captain Basil Carie Pointer Carl Zogheib Carlo Alberto +Carlo Cabrera Carlo Cannas Carlo Marcelo Arenas Belón Carlo Teubner @@ -446,6 +470,7 @@ cbartl on github cclauss on github Cering on github Cesar Eduardo Barros +Ch40zz on github Chad Monroe Chandrakant Bagul Chara White @@ -454,6 +479,7 @@ Charles Kerr Charles Romestant Charlie C Chen Prog +chensong1211 on github Cherish98 on github Chester Liu Chih-Chung Chang @@ -475,12 +501,15 @@ Chris Paulson-Ellis Chris Roberts Chris Sauer Chris Smowton +Chris Swan Chris Talbot +Chris Webb Chris Young Christian Fillion Christian Grothoff Christian Heimes Christian Hesse +Christian Heusel Christian Hägele Christian Krause Christian Kurz @@ -503,6 +532,7 @@ Christopher R. Palmer Christopher Reid Christopher Sauer Christopher Stone +chrysos349 on github Chungtsun Li Ciprian Badescu civodul on github @@ -517,6 +547,7 @@ Clifford Wolf Clint Clayton Cloudogu Siebels Clément Notin +CMD cmfrolick on github codesniffer13 on github Cody Jones @@ -528,6 +559,7 @@ Colin Blair Colin Cross Colin Hogben Colin Leroy +Colin Leroy-Mira Colin O'Dell Colin Watson Colm Buckley @@ -561,6 +593,7 @@ d912e3 on github Da-Yoon Chung daboul on github Dag Ekengren +Dagfinn Ilmari Mannsåker Dagobert Michelsen Daiki Ueno Dair Grant @@ -576,6 +609,7 @@ Dan Fandrich Dan Johnson Dan Kenigsberg Dan Locks +Dan McDonald Dan McNulty Dan Nelson Dan Petitt @@ -591,6 +625,7 @@ Daniel Faust Daniel Gustafsson Daniel Hallberg Daniel Hwang +Daniel J. H. Daniel Jeliński Daniel Johnson Daniel Kahn Gillmor @@ -600,6 +635,7 @@ Daniel Kurečka Daniel Lee Hwang Daniel Lublin Daniel Marjamäki +Daniel McCarney Daniel Melani Daniel Mentz Daniel Romero @@ -609,6 +645,7 @@ Daniel Shahaf Daniel Silverstone Daniel Steinberg Daniel Stenberg +Daniel Szmulewicz Daniel Theron Daniel Valenzuela Daniel Woelfel @@ -619,6 +656,7 @@ Darryl House Darshan Mody Darío Hereñú dasimx on github +DasKutti on github Dave Cottlehuber Dave Dribin Dave Halbakken @@ -663,6 +701,7 @@ David Phillips David Rosenstrauch David Ryskalczyk David Sanderson +David Sardari David Schweikert David Shaw David Strauss @@ -696,6 +735,8 @@ Derzsi Dániel Desmond O. Chang destman on github Detlef Schmier +Dexter Gerig +dfdity on github Dheeraj Sangamkar Didier Brisebourg Diego Bes @@ -715,6 +756,7 @@ Diogo Teles Sant'Anna Dion Williams Dirk Eddelbuettel Dirk Feytons +Dirk Hünniger Dirk Manske Dirk Rosenkranz Dirk Wetter @@ -742,16 +784,19 @@ Dmitry S. Baikov Dmitry Tretyakov Dmitry Wagin dnivras on github +dogma Dolbneff A.V Domen Kožar Domenico Andreoli Dominick Meglio Dominik Hölzl Dominik Klemba +Dominik Piątkowski Dominik Thalhammer Dominique Leuenberger Don J Olmstead Dongliang Mu +Dorian Craps Doron Behar Doug Kaufman Doug Porter @@ -790,6 +835,7 @@ ed0d2b2ce19451f2 Eddie Lumpkin Edgaras Janušauskas Edin Kadribasic +edmcln on github Edmond Yu Edoardo Lolletti Eduard Bloch @@ -811,6 +857,7 @@ Eli Schwartz Elia Tufarolo Elliot Killick Elliot Saba +Elliott Balsley Ellis Pritchard Elmira A Semenova Elms @@ -844,6 +891,7 @@ Eric Melville Eric Mertens Eric Murphy Eric Musser +Eric Norris Eric Rautman Eric Rescorla Eric Ridge @@ -862,6 +910,7 @@ Erik Janssen Erik Johansson Erik Minekus Erik Olsson +Erik Schnetter Erik Stenlund Ernest Beinrohr Ernst Sjöstrand @@ -879,6 +928,7 @@ Evert Pot Evgeny Grin (Karlson2k) Evgeny Turnaev eXeC64 on github +extrimexxx on github Eygene Ryabinkin Eylem Ugurel Fabian Fischer @@ -886,12 +936,14 @@ Fabian Frank Fabian Hiernaux Fabian Keil Fabian Ruff +Fabian Vogt Fabian Yamaguchi Fabrice Fontaine Fabrizio Ammollo Fahim Chandurwala Faizur Rahman Faraz Fallahi +farazrbx on github Farzin on github Fata Nugraha Fawad Mirza @@ -901,6 +953,7 @@ Federico Bianchi Federico Pellegrin Fedor Karpelevitch Fedor Korotkov +feelingseas on github FeignClaims on github Feist Josselin Felipe Gasper @@ -954,11 +1007,14 @@ FuccDucc on github Fujii Hironori fullincome on github fundawang on github +fuzzard Gabe Gabriel Corona Gabriel Kuri +Gabriel Marin Gabriel Simmer Gabriel Sjoberg +Gaelan Steele Gambit Communications Ganesh Kamath gaoxingwang on github @@ -1012,14 +1068,17 @@ Glenn Sheridan Glenn Strauss godmar on github Godwin Stewart +Gonçalo Carvalho Google Inc. Gordon Marler +Gordon Parke Gorilla Maguila Goro FUJI Gou Lingfeng Graham Campbell Grant Erickson Grant Pannell +graywolf on github Greg Hewgill Greg Morse Greg Onufer @@ -1035,8 +1094,10 @@ Gregory Szorc Griffin Downs Grigory Entin Grisha Levit +Gruber Glass Guenole Bescon Guido Berhoerster +Guilherme Puida Guillaume Algis Guillaume Arluison guitared on github @@ -1045,6 +1106,7 @@ Gunter Knauf guoxinvmware on github Gustaf Hui Gustavo Grieco +Gusted Guy Poizat GwanYeong Kim Gwen Shapira @@ -1057,6 +1119,7 @@ Hagai Auro Haibo Huang Hakan Sunay Halil Hamish Mackenzie +hammlee96 on github hamstergene on github Han Han Han Qiao @@ -1073,6 +1136,7 @@ Hans-Jurgen May Hao Wu Hardeep Singh Haris Okanovic +Harmen Stoppels Harold Stuart Harry Mallon Harry Sarson @@ -1108,11 +1172,13 @@ Hiroki Kurosawa Hirotaka Tagawa Ho-chi Chen Hoi-Ho Chan +Hongfei Li Hongli Lai Hongyi Zhao Howard Blaise Howard Chu hsiao yi +HsiehYuho on github htasta on github Hubert Kario Hugh Macdonald @@ -1169,7 +1235,9 @@ Isaac Boukris Isaiah Norton Ishan SinghLevett Ithubg on github +Ivan Ivan Avdeev +Ivan Kuchin Ivan Tsybulin ivanfywang IvanoG on github @@ -1196,6 +1264,7 @@ Jakub Bochenski Jakub Jelen Jakub Wilk Jakub Zakrzewski +James Abbatiello James Atwill James Brown James Bursa @@ -1231,6 +1300,7 @@ Jan Venekamp Jan Verbeek Jan-Piet Mens JanB on github +janedenone on github janko-js on github Janne Blomqvist Janne Johansson @@ -1241,6 +1311,7 @@ Jari Sundell jasal82 on github Jason Baietto Jason Glasgow +Jason Hood Jason Juang Jason Lee Jason Liu @@ -1253,6 +1324,7 @@ Javier Navarro Javier Sixto Jay Austin Jay Dommaschk +Jay Guerette Jay Wu Jayesh A Shah Jaz Fresh @@ -1314,6 +1386,9 @@ Jesse Noller Jesse Tan jethrogb on github jhoyla on github +Jiacai Liu +Jiang Wenjian +Jiawen Geng Jie He Jiehong on github Jilayne Lovejoy @@ -1329,11 +1404,14 @@ Jiri Dvorak Jiri Hruska Jiri Jaburek Jishan Shaikh +Jiwoo Park +Jiří Bok Jiří Malák jmdavitt on github jnbr on github Jocelyn Jaubert Jochem Broekhoff +Joe Birr-Pixton Joe Halpin Joe Malicki Joe Mason @@ -1347,6 +1425,7 @@ Johan Anderson Johan Lantz Johan Nilsson Johan van Selst +Johann Sebastian Schicho Johann150 on github Johannes Bauer Johannes Ernst @@ -1416,8 +1495,10 @@ Jonatan Lander Jonatan Vela Jonathan Cardoso Machado Jonathan Hseu +Jonathan Matthews Jonathan Moerman Jonathan Nieder +Jonathan Perkin Jonathan Watt Jonathan Wernberg Jongki Suwandi @@ -1454,6 +1535,7 @@ Judson Bishop Juergen Hoetzel Juergen Wilke Jukka Pihl +Julian K. Julian Montes Julian Noble Julian Ospald @@ -1487,6 +1569,7 @@ jzinn on github János Fekete Jérémy Rabasco Jérémy Rocher +Jérôme Leclercq Jörg Mueller-Tolk Jörn Hartroth Jürgen Gmach @@ -1498,7 +1581,9 @@ Kai Noda Kai Pastor Kai Sommerfeld Kai-Uwe Rommel +Kailun Qin Kalle Vahlman +kalvdans on github Kamil Dudka Kane York Kang Lin @@ -1509,8 +1594,7 @@ Kari Pahula Karl Chen Karl Moerder Karol Pietrzak -Kartatz on Github -Karthikdasari0423 +Kartatz on github Karthikdasari0423 on github Kartik Mahajan Kaspar Brand @@ -1518,6 +1602,7 @@ Katie Wang Katsuhiko YOSHIDA Kazuho Oku kchow-FTNT on github +Keerthi Timmaraju Kees Cook Kees Dekker Keitagit-kun on github @@ -1538,6 +1623,7 @@ Kev Jackson Kevin Adler Kevin Baughman Kevin Burke +Kevin Daudt Kevin Fisk Kevin Ji Kevin Lussier @@ -1554,6 +1640,7 @@ Kimmo Kinnunen kirbyn17 on hackerone Kirill Efimov Kirill Marchuk +kit-ty-kate on github Kjell Ericson Kjetil Jacobsen Klaus Crusius @@ -1565,10 +1652,13 @@ Koichi Shiraishi kokke on github Konstantin Isakov Konstantin Kushnir +Konstantin Kuzov +Konstantin Vlasov KotlinIsland on github kotoriのねこ kouzhudong on github Kovalkov Dmitrii +kpcyrd on github kreshano on github Kris Kennaway Krishnendu Majumdar @@ -1608,6 +1698,7 @@ Lars Francke Lars Gustafsson Lars J. Aas Lars Johannesen +Lars Kellogg-Stedman Lars Nilsson Lars Torben Wilson Lau @@ -1622,6 +1713,8 @@ Lawrence Wagerfield Leah Neukirchen Lealem Amedie Leandro Coutinho +Lee Li +LeeRiva Legoff Vincent Lehel Bernadt Leif W @@ -1665,9 +1758,11 @@ Lluís Batlle i Rossell locpyl-tidnyd on github Loganaden Velvindron Loic Dachary +lolbinarycat on github LoRd_MuldeR Loren Kirkby Lorenzo Miniero +Louis Solofrizzo Loïc Yhuel lRoccoon on github Luan Cestari @@ -1677,6 +1772,7 @@ Luca Niccoli Lucas Adamski Lucas Clemente Vella Lucas Holt +Lucas Nussbaum Lucas Pardue Lucas Servén Marín Lucas Severo @@ -1692,6 +1788,8 @@ Luke Amery Luke Call Luke Dashjr Luke Granger-Brown +Luke Hamburg +Lukáš Zaoral luminixinc on github Luo Jinghua Luong Dinh Dung @@ -1707,6 +1805,7 @@ Maciej Puzio Maciej W. Rozycki madblobfish on github MaeIsBad on github +magisterquis on hackerone Mahmoud Samir Fayed Maks Naumov Maksim Arhipov @@ -1748,6 +1847,7 @@ Marco Maggi Marcos Diazr Marcus Hoffmann Marcus Klein +Marcus Müller Marcus Sundberg Marcus T Marcus Webster @@ -1806,6 +1906,7 @@ Martin Jansen Martin Kammerhofer Martin Kepplinger Martin Lemke +Martin Peck Martin Schmatz Martin Skinner Martin Staael @@ -1815,6 +1916,7 @@ Martin V Martin Vejnár Martin Waleczek Martin Ågren +martinevsky Marty Kuhrt Maruko Masaya Suzuki @@ -1856,6 +1958,7 @@ Matthew Whitehead Matthias Bolte Matthias Gatto Matthias Naegler +Matthieu Baerts Mattias Fornander Matus Uzak Maurice Barnum @@ -1864,6 +1967,7 @@ Mauro Iorio Mauro Rappa Maurício Meneghini Fauth Max Dymond +Max Faxälv Max Katsev Max Kellermann Max Khon @@ -1883,11 +1987,12 @@ Median Median Stride mehatzri on github Mehmet Bozkurt Mekonikum +Mel Zuser Melissa Mears Melroy van den Berg Mert Yazıcıoğlu Mettgut Jamalla -Micah Snyder) +Micah Snyder Michael Afanasiev Michael Anti Michael Baentsch @@ -1914,6 +2019,7 @@ Michael Kolechkin Michael Kujawa Michael König Michael Lee +Michael Litwak Michael Maltese Michael Mealling Michael Mueller @@ -1990,6 +2096,8 @@ momala454 on github Momoka Yamamoto MonkeybreadSoftware on github moohoorama on github +Morgan Willcock +Moritz Buhl Morten Minde Neergaard Mostyn Bramley-Moore Moti Avrahami @@ -2028,11 +2136,11 @@ Neil Bowers Neil Dunbar Neil Kolban Neil Spring +nekopsykose on github neutric on github nevv on HackerOne/curl Niall McGee Niall O'Reilly -niallor on github nian6324 on github nianxuejie on github Nic Roets @@ -2062,6 +2170,7 @@ Nicolás Ojeda Bär Niels Martignène Niels van Tongeren Nikita Schmidt +Nikita Taranov Nikitinskit Dmitriy Niklas Angebrand Niklas Hambüchen @@ -2113,6 +2222,7 @@ Oliver Schindler Oliver Urbann oliverpool on github Olivier Berger +Olivier Bonaventure Olivier Brunel Omar Ramadan omau on github @@ -2134,6 +2244,7 @@ Oscar Norlander Oskar Liljeblad Oskar Sigvardsson Oumph on github +Outvi V ovidiu-benea on github Ozan Cansel P R Schaffner @@ -2161,12 +2272,14 @@ Patrick Rapin Patrick Schlangen Patrick Scott Patrick Smith +Patrick Steinhardt Patrick Watson Patrik Thunstrom Pau Garcia i Quiles Paul B. Omta Paul Donohue Paul Dreik +Paul Gilmartin Paul Groke Paul Harrington Paul Harris @@ -2188,6 +2301,7 @@ Paulo Roberto Tomasi Pavel Cenek Pavel Gushchin Pavel Kalyugin +Pavel Kropachev Pavel Löbl Pavel Mayorov Pavel Orehov @@ -2200,6 +2314,7 @@ Pawel A. Gajda Pawel Kierski Paweł Kowalski Paweł Wegner +Paweł Witas PBudmark on github Pedro Henrique Pedro Larroy @@ -2212,6 +2327,7 @@ Per Jensen Per Lundberg Per Malmberg Per Nilsson +Pete Cordell Pete Lomax Peter Bray Peter Forret @@ -2221,6 +2337,7 @@ Peter Goodman Peter Heuchert Peter Hjalmarsson Peter Korsgaard +Peter Krefting Peter Körner Peter Lamare Peter Lamberg @@ -2295,6 +2412,7 @@ pszemus on github pszlazak on github puckipedia on github Puneet Pawaia +Pēteris Caune qiandu2006 on github Quagmire Quanah Gibson-Mount @@ -2313,18 +2431,23 @@ Rafael Sagula Rafayel Mkrtchyan Rafaël Carré Rafał Mikrut +Rahul Krishna M Rainer Canavan Rainer Jung Rainer Koenig Rainer Müller +RainRat Raito Bezarius Rajesh Naganathan Rajkumar Mandal Ralf S. Engelschall +ralfjunker on github Ralph Beckmann Ralph Langendam Ralph Mitchell Ram Krushna Mishra +Ramiro Garcia +rampageX on github ramsay-jones on github Ran Mozes RanBarLavie on github @@ -2334,12 +2457,14 @@ Randy Armstrong Randy McMurchy Raphael Gozzo Rasmus Melchior Jacobsen +Rasmus Thomsen Raul Onitza-Klugman Ravi Pratap Ray Dassen Ray Pekowski Ray Satiro Razvan Cojocaru +Razvan Pricope rcombs on github Red Hat Product Security Reed Loden @@ -2357,10 +2482,13 @@ Renaud Guillard Renaud Lehoux Rene Bernhardt Rene Rebe +renovate[bot] +renovate[bot] Reuven Wachtfogel RevaliQaQ on github Reza Arbab Rianov Viacheslav +riastradh on github Ricardo Cadime Ricardo Gomes Ricardo M. Correia @@ -2430,6 +2558,7 @@ Robert Foreman Robert Iakobashvili Robert Kolcun Robert Linden +Robert Moreton Robert Olson Robert Prag Robert Ronto @@ -2478,6 +2607,7 @@ roughtex on github Roy Bellingan Roy Li Roy Shan +Rudi Heitbaum Rui LIU Rui Pinheiro Rune Kleveland @@ -2486,10 +2616,10 @@ Ruslan Gazizov Rutger Broekhoff Rutger Hofman Ruurd Beerstra -RuurdBeerstra on github rwmjones on github Ryan Beck-Buysse Ryan Braud +Ryan Carsten Schmidt Ryan Chan Ryan Mast Ryan Nelson @@ -2512,6 +2642,7 @@ Salvatore Sorrentino Sam Deane Sam Hurst Sam James +Sam Jessup Sam Roth Sam Schanken Samanta Navarro @@ -2528,6 +2659,7 @@ SandakovMM on github Sander Gates Sandor Feldi Sandro Jaeckel +Sanjay Pujare Santhana Todatry Santino Keupp Saqib Ali @@ -2538,6 +2670,7 @@ Sascha Zengler Satadru Pramanik Satana de Sant'Ana Saul good +saurabhsingh-dev on github Saurav Babu sayrer on github SBKarr on github @@ -2547,6 +2680,8 @@ Scott Barrett Scott Cantor Scott Davis Scott McCreary +Scott Mutter +Scott Talbert sd0 on hackerone Sean Boudreau Sean Burford @@ -2555,8 +2690,10 @@ Sean McArthur Sean Miller Sean Molenaar Sebastiaan van Erk +Sebastian Andersson Sebastian Haglund Sebastian Mundry +Sebastian Neubauer Sebastian Pohlschmidt Sebastian Rasmussen Sebastian Sterk @@ -2583,6 +2720,7 @@ Sergio Mijatovic Sergio-IME on github sergio-nsk on github Serj Kalichev +Sertonix SerusDev on github Seshubabu Pasam Seth Mos @@ -2620,13 +2758,14 @@ Simon Chalifoux Simon Dick Simon H. Simon Josefsson +Simon K Simon Legner Simon Liu Simon Warta simplerobot on github Siva Sivaraman +Slaven Rezić SLDiggie on github -Smackd0wn Smackd0wn on github smuellerDD on github sn on hackerone @@ -2635,6 +2774,7 @@ Sohom Datta Somnath Kundu Song Ma Sonia Subramanian +southernedge on github Spacen Jasset Spezifant on github Spiridonoff A.V @@ -2647,6 +2787,7 @@ Stadler Stephan Stan Hu Stan van de Burgt Stanislav Ivochkin +Stanislav Lange Stanislav Zidek Stanley Wucw Stathis Kapnidis @@ -2669,6 +2810,7 @@ Stefan Tomanek Stefan Ulrich Stefan Yohansson Stefano Simonelli +Steffen Kieß Steinar H. Gunderson steini2000 on github Stepan Broz @@ -2682,6 +2824,7 @@ Stephane Pellegrino Stephen Boost Stephen Brokenshire Stephen Collyer +Stephen Farrell Stephen Kick Stephen M. Coakley Stephen More @@ -2733,6 +2876,7 @@ T200proX7 on github Tadej Vengust Tae Hyoung Ahn Taiyu Len +Tal Regev Taneli Vähäkangas Tanguy Fautre Taras Kushnir @@ -2768,6 +2912,7 @@ Thomas L. Shinnick Thomas Lopatic Thomas M. DuBuisson Thomas Petazzoni +Thomas Pyle Thomas Ruecker Thomas Schwinge Thomas Taylor @@ -2780,6 +2925,7 @@ Thorsten Klein Thorsten Schöning Tiit Pikma Till Maas +Till Wegmüller Tim Ansell Tim Baker Tim Bartley @@ -2797,6 +2943,7 @@ Tim Stack Tim Starling Tim Tassonis Tim Verhoeven +Tim Yuer Timmy Schierling Timo Lange Timo Sirainen @@ -2860,10 +3007,12 @@ Tommy Chiang Tommy Odom Tommy Petty Tommy Tam +tomy2105 on github Ton Voon Toni Moreno Tony Kelman tonystz on Github +Toon Claes Toon Verwaest Tor Arntsen Torben Dannhauer @@ -2880,6 +3029,8 @@ Trivikram Kamat Troels Walsted Hansen Troy Engel trrui-huawei +Trumeet on github +Trzik on github Tseng Jun Tuomas Siipola Tuomo Rinne @@ -2911,14 +3062,17 @@ Vasiliy Ulyanov Vasily Lobaskin Vasy Okhin Venkat Akella +Venkat Krishna R Venkataramana Mokkapati Vicente Garcia +Victor Kislov Victor Magierski Victor Snezhko Victor Vieux VictorVG on github Vijay Panghal Vikram Saxena +Viktor Petersson Viktor Szakats Vilhelm Prytz Ville Skyttä @@ -2950,7 +3104,8 @@ Vojtěch Král Volker Schmid Vsevolod Novikov vshmuk on hackerone -vvb2060 +vulnerabilityspotter on hackerone +vuonganh1993 on github vvb2060 on github Vyron Tsingaras Vítor Galvão @@ -2983,6 +3138,7 @@ William A. Rowe Jr William Ahern William Desportes William Tang +Winni Neessen wmsch on github wncboy on github Wojciech Zwiefka @@ -3006,6 +3162,7 @@ XmiliaH on github xnynx on github xtonik on github xwxbug on github +XYenon Xì Gà Yaakov Selkowitz Yadhu Krishna M @@ -3028,6 +3185,7 @@ yiyuaner on github Ymir1711 on github Yonggang Luo Yongkang Huang +Yoshimasa Ohno Younes El-karama youngchopin on github Yousuke Kimoto @@ -3043,8 +3201,7 @@ Yusuke Nakamura Yves Arrouye Yves Lejeune YX Hao -z2-2z on github -z2_ on hackerone +z2_ Zachary Seguin Zdenek Pavlas Zekun Ni @@ -3064,6 +3221,7 @@ zhihaoy on github Zhouyihai Ding ZimCodes on github zloi-user on github +zmcx16 on github Zmey Petroff Zvi Har'El zzq1015 on github @@ -3075,11 +3233,14 @@ zzq1015 on github Štefan Kremeň Борис Верховский Коваленко Анатолий Викторович +наб Никита Дорохин ウさん 不确定 加藤郁之 南宫雪珊 左潇峰 +李四 梦终无痕 積丹尼 Dan Jacobson +罗朝辉 diff --git a/deps/curl/docs/THANKS-filter b/deps/curl/docs/THANKS-filter index 732ccfe7..ac771924 100644 --- a/deps/curl/docs/THANKS-filter +++ b/deps/curl/docs/THANKS-filter @@ -137,3 +137,19 @@ s/Dan Fandrich\./Dan Fandrich/ s/GitHub$// s/pszlazak$/pszlazak on github/ s/Randall$/Randall S. Becker/ +s/talregev on github/Tal Regev/ +s/daniel-j-h/Daniel J. H./ +s/hongfei.li/Hongfei Li/ +s/z2_ on hackerone/z2_/ +s/z2-2z on github/z2_/ +s/janedenone on hackerone/janedenone on github/ +s/Benjamin Riefenstahl Mecom/Benjamin Riefenstahl/ +s/Micah Snyder)/Micah Snyder/ +s/\#14922// +s/vvb2060\z/vvb2060 on github/ +s/kartatz\z/Kartatz on github/i +s/Karthikdasari0423\z/Karthikdasari0423 on github/ +s/niallor on github/Niall O'Reilly/ +s/RuurdBeerstra on github/Ruurd Beerstra/ +s/Smackd0wn\z/Smackd0wn on github/ +s/Testclutch// diff --git a/deps/curl/docs/TODO b/deps/curl/docs/TODO index c82c78a5..b8d1f419 100644 --- a/deps/curl/docs/TODO +++ b/deps/curl/docs/TODO @@ -20,15 +20,16 @@ 1.1 TFO support on Windows 1.2 Consult %APPDATA% also for .netrc 1.3 struct lifreq - 1.4 Better and more sharing + 1.4 alt-svc sharing 1.5 get rid of PATH_MAX - 1.6 native IDN support on macOS + 1.6 thread-safe sharing 1.8 CURLOPT_RESOLVE for any port number 1.9 Cache negative name resolves 1.10 auto-detect proxy 1.11 minimize dependencies with dynamically loaded modules 1.12 updated DNS server while running 1.13 c-ares and CURLOPT_OPENSOCKETFUNCTION + 1.14 connect to multiple IPs in parallel 1.15 Monitor connections in the connection pool 1.16 Try to URL encode given URL 1.17 Add support for IRIs @@ -58,14 +59,10 @@ 3. Documentation 3.1 Improve documentation about fork safety - 3.2 Provide cmake config-file 4. FTP 4.1 HOST - 4.2 Alter passive/active on failure and retry - 4.3 Earlier bad letter detection - 4.4 Support CURLOPT_PREQUOTE for dir listings too - 4.5 ASCII support + 4.4 Support CURLOPT_PREQUOTE for directories listings 4.6 GSSAPI via Windows SSPI 4.7 STAT for LIST without data connection 4.8 Passive transfer could try other IP addresses @@ -95,6 +92,7 @@ 9. IMAP 9.1 Enhanced capability support + 9.2 upload unread 10. LDAP 10.1 SASL based authentication mechanisms @@ -109,13 +107,12 @@ 11.4 Create remote directories 12. FILE - 12.1 Directory listing for FILE: + 12.1 Directory listing on non-POSIX 13. TLS 13.1 TLS-PSK with OpenSSL - 13.2 Provide mutex locking API + 13.2 TLS channel binding 13.3 Defeat TLS fingerprinting - 13.4 Cache/share OpenSSL contexts 13.5 Export session ids 13.6 Provide callback for cert verification 13.7 Less memory massaging with Schannel @@ -123,13 +120,11 @@ 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.12 Reduce CA certificate bundle reparsing 13.13 Make sure we forbid TLS 1.3 post-handshake authentication 13.14 Support the clienthello extension 13.15 Select signature algorithms - - 14. GnuTLS - 14.2 check connection + 13.16 Share the CA cache + 13.17 Add missing features to TLS backends 15. Schannel 15.1 Extend support for client certificate authentication @@ -154,25 +149,25 @@ 18.4 --proxycommand 18.5 UTF-8 filenames in Content-Disposition 18.6 Option to make -Z merge lined based outputs on stdout - 18.8 Consider convenience options for JSON and XML? + 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.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 Ratelimit or wait between serial requests + 18.13 Acknowledge Ratelimit headers 18.14 --dry-run 18.15 --retry should resume 18.16 send only part of --data - 18.17 consider file name from the redirected URL with -O ? + 18.17 consider filename from the redirected URL with -O ? 18.18 retry on network is unreachable 18.19 expand ~/ in config files - 18.20 host name sections in config files + 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 file names + 18.27 -J and -O with %-encoded filenames 18.28 -J with -C - 18.29 --retry and transfer timeouts @@ -181,23 +176,25 @@ 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 - 19.6 build curl with Windows Unicode support 20. Test suite 20.1 SSL tunnel 20.2 nicer lacking perl message 20.3 more protocols supported 20.4 more platforms supported - 20.5 Add support for concurrent connections 20.6 Use the RFC 6265 test suite - 20.7 Support LD_PRELOAD on macOS 20.8 Run web-platform-tests URL tests 21. MQTT 21.1 Support rate-limiting + 21.2 Support MQTTS + 21.3 Handle network blocks 22. TFTP - 22.1 TFTP doesn't convert LF to CRLF for mode=netascii + 22.1 TFTP does not convert LF to CRLF for mode=netascii + + 23. Gopher + 23.1 Handle network blocks ============================================================================== @@ -206,7 +203,7 @@ 1.1 TFO support on Windows libcurl supports the CURLOPT_TCP_FASTOPEN option since 7.49.0 for Linux and - Mac OS. Windows supports TCP Fast Open starting with Windows 10, version 1607 + 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 @@ -226,7 +223,7 @@ SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete. To support IPv6 interface addresses for network interfaces properly. -1.4 Better and more sharing +1.4 alt-svc sharing The share interface could benefit from allowing the alt-svc cache to be possible to share between easy handles. @@ -251,21 +248,18 @@ 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 native IDN support on macOS +1.6 thread-safe sharing - On recent macOS versions, the getaddrinfo() function itself has built-in IDN - support. By setting the AI_CANONNAME flag, the function will return the - encoded name in the ai_canonname struct field in the returned information. - This could be used by curl on macOS when built without a separate IDN library - and an IDN host name is used in a URL. - - See initial work in https://github.com/curl/curl/pull/5371 + 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.8 CURLOPT_RESOLVE for any port number This option allows applications to set a replacement IP address for a given host + port pair. Consider making support for providing a replacement address - for the host name on all port numbers. + for the hostname on all port numbers. See https://github.com/curl/curl/issues/1264 @@ -306,14 +300,26 @@ 1.13 c-ares and CURLOPT_OPENSOCKETFUNCTION - curl will create most sockets via the CURLOPT_OPENSOCKETFUNCTION callback and + 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. + 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.14 connect to multiple IPs in parallel + + curl currently implements the happy eyeball algorithm for connecting to the + IPv4 and IPv6 alternatives for a host in parallel, sticking with the + connection that "wins". We could implement a similar algorithm per individual + IP family as well when there are multiple available addresses: start with the + first address, then start a second attempt N milliseconds after and then a + third another N milliseconds later. That way there would be less waiting when + the first IP has problems. It also improves the connection timeout value + handling for multiple address situations. + 1.15 Monitor connections in the connection pool libcurl's connection cache or pool holds a number of open connections for the @@ -340,7 +346,7 @@ 1.17 Add support for IRIs - IRIs (RFC 3987) allow localized, non-ascii, names in the URL. To properly + 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". @@ -460,7 +466,7 @@ 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. + - 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 @@ -476,6 +482,8 @@ - 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 @@ -496,8 +504,8 @@ 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 will not trigger the relevant - QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP. + 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 @@ -537,45 +545,22 @@ See https://github.com/curl/curl/issues/6968 -3.2 Provide cmake config-file - - A config-file package is a set of files provided by us to allow applications - to write cmake scripts to find and use libcurl easier. See - https://github.com/curl/curl/issues/885 - 4. FTP 4.1 HOST - HOST is a command for a client to tell which host name to use, to offer FTP + 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 Alter passive/active on failure and retry - - When trying to connect passively to a server which only supports active - connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the - connection. There could be a way to fallback to an active connection (and - vice versa). https://curl.se/bug/feature.cgi?id=1754793 - -4.3 Earlier bad letter detection - - Make the detection of (bad) %0d and %0a codes in FTP URL parts earlier in the - process to avoid doing a resolve and connect in vain. - -4.4 Support CURLOPT_PREQUOTE for dir listings too +4.4 Support CURLOPT_PREQUOTE for directions listings The lack of support is mostly an oversight and requires the FTP state machine to get updated to get fixed. https://github.com/curl/curl/issues/8602 -4.5 ASCII support - - FTP ASCII transfers do not follow RFC 959. They do not convert the data - accordingly. - 4.6 GSSAPI via Windows SSPI In addition to currently supporting the SASL GSSAPI mechanism (Kerberos V5) @@ -605,10 +590,10 @@ 5.1 Provide the error body from a CONNECT response - When curl receives a body response from a CONNECT request to a proxy, it will - always just read and ignore 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? + 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 @@ -635,7 +620,7 @@ 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 host name given in the URL. It could be extended to allow + 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. @@ -680,7 +665,7 @@ 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 will not + into the main transfer loop. Until this is done, the multi interface does not work for telnet. 6.3 feature negotiation debug data @@ -735,6 +720,12 @@ Add the ability, for an application that uses libcurl, to obtain the list of capabilities returned from the CAPABILITY command. +9.2 upload unread + + Uploads over IMAP currently always set the email as "read" (or "seen"). It + would be good to offer a way for users to select for uploads to remain + unread. + 10. LDAP 10.1 SASL based authentication mechanisms @@ -758,7 +749,7 @@ 10.4 Certificate-Based Authentication - LDAPS not possible with MAC and Windows with Certificate-Based Authentication + LDAPS not possible with macOS and Windows with Certificate-Based Authentication https://github.com/curl/curl/issues/9641 @@ -786,11 +777,11 @@ 12. FILE -12.1 Directory listing for FILE: - - Add support for listing the contents of a directory accessed with FILE. The - output should probably be the same as/similar to FTP. +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 @@ -803,11 +794,22 @@ https://github.com/curl/curl/issues/5081 -13.2 Provide mutex locking API +13.2 TLS channel binding - Provide a libcurl API for setting mutex callbacks in the underlying SSL - library, so that the same application code can use mutex-locking - independently of OpenSSL or GnutTLS being used. + 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 @@ -815,24 +817,6 @@ sometimes possible to circumvent TLS fingerprinting by servers. The TLS extension order is of course not the only way to fingerprint a client. - See https://github.com/curl/curl/issues/8119 - -13.4 Cache/share OpenSSL contexts - - "Look at SSL cafile - quick traces look to me like these are done on every - request as well, when they should only be necessary once per SSL context (or - once per handle)". The major improvement we can rather easily do is to make - sure we do not create and kill a new SSL "context" for every request, but - instead make one for every connection and reuse that SSL context in the same - style connections are reused. It will make us use slightly more memory but it - will libcurl do less creations and deletions of SSL contexts. - - Technically, the "caching" is probably best implemented by getting added to - the share interface so that easy handles who want to and can reuse the - context specify that by sharing with the right properties set. - - https://github.com/curl/curl/issues/1110 - 13.5 Export session ids Add an interface to libcurl that enables "session IDs" to get @@ -892,19 +876,12 @@ 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.a + --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.12 Reduce CA certificate bundle reparsing - - When using the OpenSSL backend, curl will load and reparse the CA bundle at - the creation of the "SSL context" when it sets up a connection to do a TLS - handshake. A more effective way would be to somehow cache the CA bundle to - avoid it having to be repeatedly reloaded and reparsed. - - See https://github.com/curl/curl/issues/9379 - 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 @@ -930,12 +907,18 @@ https://github.com/curl/curl/issues/12982 -14. GnuTLS +13.16 Share the CA cache -14.2 check connection + 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 a way to check if the connection seems to be alive, to correspond to the - SSL_peak() way we use with OpenSSL. +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. 15. Schannel @@ -955,10 +938,10 @@ 15.4 Add option to allow abrupt server closure - libcurl w/schannel will error 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. + 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 @@ -984,7 +967,7 @@ 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 will instead always create a new connection for + 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" @@ -994,7 +977,7 @@ 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 will not notice and will not + 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... @@ -1062,24 +1045,15 @@ 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 will not "merge" and send complete lines fine but may send + 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.8 Consider convenience options for JSON and XML? +18.7 specify which response codes that make -f/--fail return error - Could we add `--xml` or `--json` to add headers needed to call rest API: - - `--xml` adds -H 'Content-Type: application/xml' -H "Accept: application/xml" and - `--json` adds -H 'Content-Type: application/json' -H "Accept: application/json" - - Setting Content-Type when doing a GET or any other method without a body - would be a bit strange I think - so maybe only add CT for requests with body? - Maybe plain `--xml` and ` --json` are a bit too brief and generic. Maybe - `--http-json` etc? - - See https://github.com/curl/curl/issues/5203 + 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 @@ -1093,7 +1067,7 @@ See https://github.com/curl/curl/issues/221 -18.10 improve how curl works in a windows console window +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 @@ -1105,7 +1079,7 @@ 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's + 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 @@ -1118,12 +1092,10 @@ 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 Ratelimit or wait between serial requests +18.13 Acknowledge Ratelimit headers Consider a command line option that can make curl do multiple serial requests - slow, potentially with a (random) wait between transfers. There is also a - proposed set of standard HTTP headers to let servers let the client adapt to - its rate limits: + while acknowledging server specified rate limits: https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/ See https://github.com/curl/curl/issues/5406 @@ -1153,22 +1125,22 @@ See https://github.com/curl/curl/issues/1200 -18.17 consider file name from the redirected URL with -O ? +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 file name is not extracted and used from the newly redirected-to URL - even if the new URL may have a much more sensible file name. + 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 file name that might get overwritten. But maybe a new option + 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 file name to use so it already + 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 file name part at all since - then the current code path will error out with an error message, and we cannot - *know* already at that point if curl will be redirected to a URL that has a - file name... + 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 @@ -1190,10 +1162,10 @@ See https://github.com/curl/curl/issues/2317 -18.20 host name sections in config files +18.20 hostname sections in config files config files would be more powerful if they could set different - configurations depending on used URLs, host name or possibly origin. Then a + 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. @@ -1231,7 +1203,7 @@ - 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 will let + 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. @@ -1252,11 +1224,11 @@ 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 file names +18.27 -J and -O with %-encoded filenames - -J/--remote-header-name does not decode %-encoded file names. RFC 6266 details + -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 + 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. @@ -1265,15 +1237,15 @@ -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 will not add decoding to -O without the user asking for it with - some other means as well, since -O has always been documented to use the name - exactly as specified in the URL. + 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 file name (and thus its + 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 @@ -1282,8 +1254,8 @@ 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 will truncate and restart at the - original position where it was at before the previous failed attempt. See + 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 @@ -1303,12 +1275,13 @@ curl. 19.3 Do not use GNU libtool on OpenBSD - When compiling curl on OpenBSD with "--enable-debug" it will give 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. + + 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 @@ -1323,13 +1296,6 @@ See https://github.com/curl/curl/issues/7753 -19.6 build curl with Windows Unicode support - - The user wants an easier way to tell autotools to build curl with Windows - Unicode support, like ./configure --enable-windows-unicode - - See https://github.com/curl/curl/issues/7229 - 20. Test suite 20.1 SSL tunnel @@ -1350,38 +1316,18 @@ 20.4 more platforms supported - Make the test suite work on more platforms. OpenBSD and Mac OS. Remove + Make the test suite work on more platforms. OpenBSD and macOS. Remove fork()s and it should become even more portable. -20.5 Add support for concurrent connections - - Tests 836, 882 and 938 were designed to verify that separate connections are - not used when using different login credentials in protocols that should not - reuse a connection under such circumstances. - - Unfortunately, ftpserver.pl does not appear to support multiple concurrent - connections. The read while() loop seems to loop until it receives a - disconnect from the client, where it then enters the waiting for connections - loop. When the client opens a second connection to the server, the first - connection has not been dropped (unless it has been forced - which we - should not do in these tests) and thus the wait for connections loop is never - entered to receive the second connection. - 20.6 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'd be really awesome if someone would write a script/setup that would run - curl with that test suite and detect deviances. Ideally, that would even be + 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.7 Support LD_PRELOAD on macOS - - LD_RELOAD does not work on macOS, but there are tests which require it to run - properly. Look into making the preload support in runtests.pl portable such - that it uses DYLD_INSERT_LIBRARIES on macOS. - 20.8 Run web-platform-tests URL tests Run web-platform-tests URL tests and compare results with browsers on wpt.fyi @@ -1398,9 +1344,17 @@ 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. + 22. TFTP -22.1 TFTP doesn't convert LF to CRLF for mode=netascii +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 @@ -1408,3 +1362,11 @@ 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/deps/curl/docs/TheArtOfHttpScripting.md b/deps/curl/docs/TheArtOfHttpScripting.md index 4e111a3e..f4efd11b 100644 --- a/deps/curl/docs/TheArtOfHttpScripting.md +++ b/deps/curl/docs/TheArtOfHttpScripting.md @@ -1,3 +1,9 @@ + + # The Art Of Scripting HTTP Requests Using Curl ## Background @@ -565,19 +571,19 @@ Curl supports encrypted fetches when built to use a TLS library and it can be built to use one out of a fairly large set of libraries - `curl -V` shows - which one your curl was built to use (if any!). To get a page from an HTTPS + which one your curl was built to use (if any). To get a page from an HTTPS server, simply run curl like: curl https://secure.example.com ## Certificates - In the HTTPS world, you use certificates to validate that you are the one - you claim to be, as an addition to normal passwords. Curl supports client- - side certificates. All certificates are locked with a pass phrase, which you - need to enter before the certificate can be used by curl. The pass phrase - can be specified on the command line or if not, entered interactively when - curl queries for it. Use a certificate with curl on an HTTPS server like: + In the HTTPS world, you use certificates to validate that you are the one you + claim to be, as an addition to normal passwords. Curl supports client- side + certificates. All certificates are locked with a passphrase, which you need + to enter before the certificate can be used by curl. The passphrase can be + specified on the command line or if not, entered interactively when curl + queries for it. Use a certificate with curl on an HTTPS server like: curl --cert mycert.pem https://secure.example.com diff --git a/deps/curl/docs/URL-SYNTAX.md b/deps/curl/docs/URL-SYNTAX.md index 67f9bdbc..61682f42 100644 --- a/deps/curl/docs/URL-SYNTAX.md +++ b/deps/curl/docs/URL-SYNTAX.md @@ -1,3 +1,9 @@ + + # URL syntax and their use in curl ## Specifications @@ -26,7 +32,7 @@ unlikely that multiple parsers treat URLs the same way. Due to the inherent differences between URL parser implementations, it is considered a security risk to mix different implementations and assume the -same behavior! +same behavior. For example, if you use one parser to check if a URL uses a good hostname or the correct auth field, and then pass on that same URL to a *second* parser, @@ -61,7 +67,7 @@ and curl using scripts remain working. curl's URL parser allows a few deviations from the spec in order to inter-operate better with URLs that appear in the wild. -### spaces +### Spaces A URL provided to curl cannot contain spaces. They need to be provided URL encoded to be accepted in a URL by curl. @@ -71,12 +77,12 @@ client where a resource has been redirected to, sometimes contain spaces. This is a violation of RFC 3986 but is fine in the WHATWG spec. curl handles these by re-encoding them to `%20`. -### non-ASCII +### Non-ASCII Byte values in a provided URL that are outside of the printable ASCII range are percent-encoded by curl. -### multiple slashes +### Multiple slashes An absolute URL always starts with a "scheme" followed by a colon. For all the schemes curl supports, the colon must be followed by two slashes according to @@ -102,7 +108,7 @@ Based on what the hostname starts with, curl "guesses" what protocol to use: - `pop3.` means POP3 - all other means HTTP -### globbing letters +### Globbing letters The curl command line tool supports "globbing" of URLs. It means that you can create ranges and lists using `[N-M]` and `{one,two,three}` sequences. The @@ -191,7 +197,7 @@ Transitional Processing. The two standards have a huge overlap but differ slightly, perhaps most famously in how they deal with the German "double s" (`ß`). -When winidn is used, curl uses IDNA 2003 Transitional Processing, like the rest +When WinIDN is used, curl uses IDNA 2003 Transitional Processing, like the rest of Windows. ## Port number @@ -220,7 +226,7 @@ directory listing for the root / home directory is returned. FTP servers typically put the user in its "home directory" after login, which then differs between users. To explicitly specify the root directory of an FTP server, start the path with double slash `//` or `/%2f` (2F is the hexadecimal -value of the ascii code for the slash). +value of the ASCII code for the slash). ## FILE diff --git a/deps/curl/docs/VERSIONS.md b/deps/curl/docs/VERSIONS.md index fc21749e..a3159aa6 100644 --- a/deps/curl/docs/VERSIONS.md +++ b/deps/curl/docs/VERSIONS.md @@ -1,3 +1,9 @@ + + Version Numbers and Releases ============================ diff --git a/deps/curl/docs/VULN-DISCLOSURE-POLICY.md b/deps/curl/docs/VULN-DISCLOSURE-POLICY.md index 5f10bc8b..fa379cf5 100644 --- a/deps/curl/docs/VULN-DISCLOSURE-POLICY.md +++ b/deps/curl/docs/VULN-DISCLOSURE-POLICY.md @@ -1,3 +1,9 @@ + + # curl vulnerability disclosure policy This document describes how security vulnerabilities are handled in the curl @@ -59,7 +65,8 @@ announcement. [SECURITY-ADVISORY](https://curl.se/dev/advisory.html) for help on creating the advisory. -- Request a CVE number from HackerOne +- Request a CVE Id for the issue. curl is a CNA (CVE Numbering Authority) and + can request its own numbers. - Update the "security advisory" with the CVE number. @@ -255,7 +262,7 @@ data. We consider this functionality a best-effort and omissions are not security vulnerabilities. - not all systems allow the arguments to be blanked in the first place - - since curl blanks the argument itself they area readable for a short moment + - 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 @@ -291,3 +298,18 @@ is curl working as designed and is not a curl security problem. 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. + +## NULL dereferences and crashes + +If a malicious server can trigger a NULL dereference in curl or otherwise +cause curl to crash (and nothing worse), chances are big that we do not +consider that a security problem. + +Malicious servers can already cause considerable harm and denial of service +like scenarios without having to trigger such code paths. For example by +stalling, being terribly slow or by delivering enormous amounts of data. +Additionally, applications are expected to handle "normal" crashes without +that being the end of the world. + +There need to be more and special circumstances to treat such problems as +security issues. diff --git a/deps/curl/docs/cmdline-opts/.gitignore b/deps/curl/docs/cmdline-opts/.gitignore index 16213ffa..8d42e2c5 100644 --- a/deps/curl/docs/cmdline-opts/.gitignore +++ b/deps/curl/docs/cmdline-opts/.gitignore @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: curl -curl.txt \ No newline at end of file +curl.txt diff --git a/deps/curl/docs/cmdline-opts/CMakeLists.txt b/deps/curl/docs/cmdline-opts/CMakeLists.txt index 6a3a1c5f..f6a94756 100644 --- a/deps/curl/docs/cmdline-opts/CMakeLists.txt +++ b/deps/curl/docs/cmdline-opts/CMakeLists.txt @@ -21,19 +21,22 @@ # SPDX-License-Identifier: curl # ########################################################################### -set(MANPAGE "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.1") -set(ASCIIPAGE "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt") - -# Load DPAGES and OTHERPAGES from shared file +# Get 'DPAGES' variable transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -add_custom_command(OUTPUT "${MANPAGE}" - COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" "./gen.pl" mainpage ${DPAGES} > "${MANPAGE}" - COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" "./gen.pl" ascii ${DPAGES} > "${ASCIIPAGE}" +add_custom_command(OUTPUT "${CURL_MANPAGE}" "${CURL_ASCIIPAGE}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/managen" mainpage ${DPAGES} > "${CURL_MANPAGE}" + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/managen" ascii ${DPAGES} > "${CURL_ASCIIPAGE}" + DEPENDS + "${PROJECT_SOURCE_DIR}/scripts/managen" + ${DPAGES} VERBATIM ) -add_custom_target(generate-curl.1 ALL DEPENDS "${MANPAGE}") + +add_custom_target(generate-curl.1 ALL DEPENDS "${CURL_MANPAGE}") + if(NOT CURL_DISABLE_INSTALL) - install(FILES "${MANPAGE}" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + install(FILES "${CURL_MANPAGE}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") endif() diff --git a/deps/curl/docs/cmdline-opts/MANPAGE.md b/deps/curl/docs/cmdline-opts/MANPAGE.md index 16c20360..3e2e7151 100644 --- a/deps/curl/docs/cmdline-opts/MANPAGE.md +++ b/deps/curl/docs/cmdline-opts/MANPAGE.md @@ -6,7 +6,7 @@ # curl man page generator -This is the curl man page generator. It generates a single nroff man page +`managen` is the curl man page generator. It generates a single nroff man page output from the set of sources files in this directory. The `mainpage.idx` file lists all files that are rendered in that order to @@ -45,7 +45,7 @@ A line that starts with ``. Help: (short text for the --help output for this option) Long: (long form name, without dashes) Magic: (description of "magic" options) - Multi: single/append/boolean/mutex/custom (if used more than once) + Multi: single/append/boolean/mutex/custom/per-URL (if used more than once) Mutexed: (space separated list of options this overrides, no dashes) Protocols: (space separated list for which protocols this option works) Requires: (space separated list of features this requires, no dashes) @@ -103,11 +103,16 @@ getting spellchecked by CI jobs): `%DATE`, `%VERSION` and `%GLOBALS`. ## Generate -`./gen.pl mainpage` +`managen mainpage [list of markdown option file names]` This command outputs a single huge nroff file, meant to become `curl.1`. The full curl man page. -`./gen.pl listhelp` +`managen ascii [list of markdown option file names]` + +This command outputs a single text file, meant to become `curl.txt`. The full +curl man page in text format, used to build `tool_hugehelp.c`. + +`managen listhelp` Generates a full `curl --help` output for all known command line options. diff --git a/deps/curl/docs/cmdline-opts/Makefile.am b/deps/curl/docs/cmdline-opts/Makefile.am index 476c932f..b087e385 100644 --- a/deps/curl/docs/cmdline-opts/Makefile.am +++ b/deps/curl/docs/cmdline-opts/Makefile.am @@ -27,32 +27,37 @@ AUTOMAKE_OPTIONS = foreign no-dependencies MANPAGE = curl.1 ASCIIPAGE = curl.txt -man_MANS = $(MANPAGE) - include Makefile.inc -EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(SUPPORT) CMakeLists.txt mainpage.idx +EXTRA_DIST = $(DPAGES) MANPAGE.md $(SUPPORT) CMakeLists.txt mainpage.idx GEN = $(GN_$(V)) GN_0 = @echo " GENERATE" $@; GN_1 = 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 +INCDIR=$(top_srcdir)/include + if BUILD_DOCS CLEANFILES = $(MANPAGE) $(ASCIIPAGE) +man_MANS = $(MANPAGE) all: $(MANPAGE) $(ASCIIPAGE) endif -$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl - $(GEN)(rm -f $(MANPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl mainpage $(DPAGES)) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE)) +$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN) + $(GEN)(rm -f $(MANPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) mainpage $(DPAGES) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE)) -$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl - $(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE)) +$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN) + $(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE)) listhelp: - ./gen.pl listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c + $(MANAGEN) -d $(srcdir) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c -dist-hook: $(MANPAGE) - cp $(MANPAGE) $(MANPAGE).dist +listcats: + @$(MANAGEN) listcats $(DPAGES) diff --git a/deps/curl/docs/cmdline-opts/Makefile.inc b/deps/curl/docs/cmdline-opts/Makefile.inc index 428cc3ba..3bcffa49 100644 --- a/deps/curl/docs/cmdline-opts/Makefile.inc +++ b/deps/curl/docs/cmdline-opts/Makefile.inc @@ -89,7 +89,9 @@ DPAGES = \ doh-cert-status.md \ doh-insecure.md \ doh-url.md \ + dump-ca-embed.md \ dump-header.md \ + ech.md \ egd-file.md \ engine.md \ etag-compare.md \ @@ -132,14 +134,15 @@ DPAGES = \ http3.md \ http3-only.md \ ignore-content-length.md \ - include.md \ insecure.md \ interface.md \ + ip-tos.md \ ipfs-gateway.md \ ipv4.md \ ipv6.md \ json.md \ junk-session-cookies.md \ + keepalive-cnt.md \ keepalive-time.md \ key-type.md \ key.md \ @@ -160,6 +163,7 @@ DPAGES = \ max-redirs.md \ max-time.md \ metalink.md \ + mptcp.md \ negotiate.md \ netrc-file.md \ netrc-optional.md \ @@ -247,7 +251,9 @@ DPAGES = \ sasl-ir.md \ service-name.md \ show-error.md \ + show-headers.md \ silent.md \ + skip-existing.md \ socks4.md \ socks4a.md \ socks5-basic.md \ @@ -275,6 +281,7 @@ DPAGES = \ tftp-blksize.md \ tftp-no-options.md \ time-cond.md \ + tls-earlydata.md \ tls-max.md \ tls13-ciphers.md \ tlsauthtype.md \ @@ -301,5 +308,6 @@ DPAGES = \ variable.md \ verbose.md \ version.md \ + vlan-priority.md \ write-out.md \ xattr.md diff --git a/deps/curl/docs/cmdline-opts/_ENVIRONMENT.md b/deps/curl/docs/cmdline-opts/_ENVIRONMENT.md index af60ac8d..02561193 100644 --- a/deps/curl/docs/cmdline-opts/_ENVIRONMENT.md +++ b/deps/curl/docs/cmdline-opts/_ENVIRONMENT.md @@ -87,7 +87,7 @@ names named after the destination connection id (in hex). Do note that these files can become rather large. Works with the ngtcp2 and quiche QUIC backends. ## `SHELL` -Used on VMS when trying to detect if using a **DCL** or a **unix** shell. +Used on VMS when trying to detect if using a **DCL** or a **Unix** shell. ## `SSL_CERT_DIR` If set, it is used as the --capath value. This environment variable is ignored @@ -101,8 +101,8 @@ if Schannel is used as the TLS backend. If you set this environment variable to a filename, curl stores TLS secrets from its connections in that file when invoked to enable you to analyze the TLS traffic in real time using network analyzing tools such as Wireshark. This -works with the following TLS backends: OpenSSL, libressl, BoringSSL, GnuTLS -and wolfSSL. +works with the following TLS backends: OpenSSL, LibreSSL (TLS 1.2 max), +BoringSSL, GnuTLS and wolfSSL. ## `USERPROFILE` On Windows, this variable is used when trying to find the home directory. If diff --git a/deps/curl/docs/cmdline-opts/_EXITCODES.md b/deps/curl/docs/cmdline-opts/_EXITCODES.md index c5a928b5..a16f4752 100644 --- a/deps/curl/docs/cmdline-opts/_EXITCODES.md +++ b/deps/curl/docs/cmdline-opts/_EXITCODES.md @@ -105,7 +105,7 @@ Too many redirects. When following redirects, curl hit the maximum amount. ## 48 Unknown option specified to libcurl. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Read up in the -manual! +manual. ## 49 Malformed telnet option. ## 52 diff --git a/deps/curl/docs/cmdline-opts/_OPTIONS.md b/deps/curl/docs/cmdline-opts/_OPTIONS.md index 106298e7..b6b75b3f 100644 --- a/deps/curl/docs/cmdline-opts/_OPTIONS.md +++ b/deps/curl/docs/cmdline-opts/_OPTIONS.md @@ -1,6 +1,7 @@ # OPTIONS + Options start with one or two dashes. Many of the options require an additional value next to them. If provided text does not start with a dash, it is presumed to be and treated as a URL. @@ -24,3 +25,5 @@ clean option state, except for the options that are global. Global options retain their values and meaning even after --next. The following options are global: `%GLOBALS`. + +# ALL OPTIONS diff --git a/deps/curl/docs/cmdline-opts/_PROTOCOLS.md b/deps/curl/docs/cmdline-opts/_PROTOCOLS.md index 201c080b..af7019ab 100644 --- a/deps/curl/docs/cmdline-opts/_PROTOCOLS.md +++ b/deps/curl/docs/cmdline-opts/_PROTOCOLS.md @@ -45,7 +45,9 @@ curl supports SMB version 1 for upload and download. Uploading contents to an SMTP server means sending an email. With or without TLS. ## TELNET -Telling curl to fetch a telnet URL starts an interactive session where it -sends what it reads on stdin and outputs what the server sends it. +Fetching a telnet URL starts an interactive session where it sends what it +reads on stdin and outputs what the server sends it. ## TFTP curl can do TFTP downloads and uploads. +## WS(S) +WebSocket done over HTTP/1. WSS implies that it works over HTTPS. diff --git a/deps/curl/docs/cmdline-opts/_VARIABLES.md b/deps/curl/docs/cmdline-opts/_VARIABLES.md index aa6a8ae4..e46b6755 100644 --- a/deps/curl/docs/cmdline-opts/_VARIABLES.md +++ b/deps/curl/docs/cmdline-opts/_VARIABLES.md @@ -11,12 +11,12 @@ variable `name` inserted, or a blank if the name does not exist as a variable. Insert `{{` verbatim in the string by prefixing it with a backslash, like `\{{`. -You an access and expand environment variables by first importing them. You -can select to either require the environment variable to be set or you can -provide a default value in case it is not already set. Plain --variable %name -imports the variable called 'name' but exits with an error if that environment +You access and expand environment variables by first importing them. You +select to either require the environment variable to be set or you can provide +a default value in case it is not already set. Plain `--variable %name` +imports the variable called `name` but exits with an error if that environment variable is not already set. To provide a default value if it is not set, use ---variable %name=content or --variable %name@content. +`--variable %name=content` or `--variable %name@content`. Example. Get the USER environment variable into the URL, fail if USER is not set: diff --git a/deps/curl/docs/cmdline-opts/alt-svc.md b/deps/curl/docs/cmdline-opts/alt-svc.md index a30aff7b..257f4d5b 100644 --- a/deps/curl/docs/cmdline-opts/alt-svc.md +++ b/deps/curl/docs/cmdline-opts/alt-svc.md @@ -17,9 +17,9 @@ Example: # `--alt-svc` -This option enables the alt-svc parser in curl. If the filename points to an -existing alt-svc cache file, that gets used. After a completed transfer, the -cache is saved to the filename again if it has been modified. +Enable the alt-svc parser. If the filename points to an existing alt-svc cache +file, that gets used. After a completed transfer, the cache is saved to the +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. diff --git a/deps/curl/docs/cmdline-opts/anyauth.md b/deps/curl/docs/cmdline-opts/anyauth.md index 150e069e..31b27c4a 100644 --- a/deps/curl/docs/cmdline-opts/anyauth.md +++ b/deps/curl/docs/cmdline-opts/anyauth.md @@ -17,10 +17,10 @@ Example: # `--anyauth` -Tells curl to figure out authentication method by itself, and use the most -secure one the remote site claims to support. This is done by first doing a -request and checking the response-headers, thus possibly inducing an extra -network round-trip. This is used instead of setting a specific authentication +Figure out authentication method automatically, and use the most secure one +the remote site claims to support. This is done by first doing a request and +checking the response-headers, thus possibly inducing an extra network +round-trip. This option is used instead of setting a specific authentication method, which you can do with --basic, --digest, --ntlm, and --negotiate. Using --anyauth is not recommended if you do uploads from stdin, since it may diff --git a/deps/curl/docs/cmdline-opts/aws-sigv4.md b/deps/curl/docs/cmdline-opts/aws-sigv4.md index 1b390924..517cc1c5 100644 --- a/deps/curl/docs/cmdline-opts/aws-sigv4.md +++ b/deps/curl/docs/cmdline-opts/aws-sigv4.md @@ -3,8 +3,8 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: aws-sigv4 Protocols: HTTP -Arg: -Help: Use AWS V4 signature authentication +Arg: +Help: AWS V4 signature auth Category: auth http Added: 7.75.0 Multi: single diff --git a/deps/curl/docs/cmdline-opts/basic.md b/deps/curl/docs/cmdline-opts/basic.md index 34b01917..16acd4cb 100644 --- a/deps/curl/docs/cmdline-opts/basic.md +++ b/deps/curl/docs/cmdline-opts/basic.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: basic -Help: Use HTTP Basic Authentication +Help: HTTP Basic Authentication Protocols: HTTP Category: auth Added: 7.10.6 @@ -15,8 +15,8 @@ Example: # `--basic` -Tells curl to use HTTP Basic authentication with the remote host. This is the -default and this option is usually pointless, unless you use it to override a +Use HTTP Basic authentication with the remote host. This method is the default +and this option is usually pointless, unless you use it to override a previously set option that sets a different authentication method (such as --ntlm, --digest, or --negotiate). diff --git a/deps/curl/docs/cmdline-opts/ca-native.md b/deps/curl/docs/cmdline-opts/ca-native.md index d0b4bfa5..3d773a8c 100644 --- a/deps/curl/docs/cmdline-opts/ca-native.md +++ b/deps/curl/docs/cmdline-opts/ca-native.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ca-native -Help: Use CA certificates from the native OS +Help: Load CA certs from the OS Protocols: TLS Category: tls Added: 8.2.0 @@ -10,6 +10,7 @@ Multi: boolean See-also: - cacert - capath + - dump-ca-embed - insecure Example: - --ca-native $URL @@ -17,10 +18,10 @@ Example: # `--ca-native` -Tells curl to use the CA store from the native operating system to verify the -peer. By default, curl otherwise uses a CA store provided in a single file or -directory, but when using this option it interfaces the operating system's -own vault. +Use the CA store from the native operating system to verify the peer. By +default, curl otherwise uses a CA store provided in a single file or +directory, but when using this option it interfaces the operating system's own +vault. This option works for curl on Windows when built to use OpenSSL, wolfSSL (added in 8.3.0) or GnuTLS (added in 8.5.0). When curl on Windows is built to diff --git a/deps/curl/docs/cmdline-opts/cacert.md b/deps/curl/docs/cmdline-opts/cacert.md index 7b1b2174..00c277e2 100644 --- a/deps/curl/docs/cmdline-opts/cacert.md +++ b/deps/curl/docs/cmdline-opts/cacert.md @@ -10,6 +10,7 @@ Added: 7.5 Multi: single See-also: - capath + - dump-ca-embed - insecure Example: - --cacert CA-file.txt $URL @@ -17,19 +18,22 @@ Example: # `--cacert` -Tells curl to use the specified certificate file to verify the peer. The file -may contain multiple CA certificates. The certificate(s) must be in PEM -format. Normally curl is built to use a default file for this, so this option -is typically used to alter that default file. +Use the specified certificate file to verify the peer. The file may contain +multiple CA certificates. The certificate(s) must be in PEM format. Normally +curl is built to use a default file for this, so this option is typically used +to alter that default file. curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is set and the TLS backend is not Schannel, and uses the given path as a path to a CA cert bundle. This option overrides that variable. -The windows version of curl automatically looks for a CA certs file named +(Windows) curl automatically looks for a CA certs file named 'curl-ca-bundle.crt', either in the same directory as curl.exe, or in the Current Working Directory, or in any folder along your PATH. +curl 8.11.0 added a build-time option to disable this search behavior, and +another option to restrict search to the application's directory. + (iOS and macOS only) If curl is built against Secure Transport, then this option is supported for backward compatibility with other SSL engines, but it should not be set. If the option is not set, then curl uses the certificates diff --git a/deps/curl/docs/cmdline-opts/capath.md b/deps/curl/docs/cmdline-opts/capath.md index ecd28df2..51be39e2 100644 --- a/deps/curl/docs/cmdline-opts/capath.md +++ b/deps/curl/docs/cmdline-opts/capath.md @@ -10,6 +10,7 @@ Added: 7.9.8 Multi: single See-also: - cacert + - dump-ca-embed - insecure Example: - --capath /local/directory $URL @@ -17,12 +18,12 @@ Example: # `--capath` -Tells curl to use the specified certificate directory to verify the -peer. Multiple paths can be provided by separating them with ":" (e.g. -"path1:path2:path3"). The certificates must be in PEM format, and if curl is -built against OpenSSL, the directory must have been processed using the -c_rehash utility supplied with OpenSSL. Using --capath can allow -OpenSSL-powered curl to make SSL-connections much more efficiently than using ---cacert if the --cacert file contains many CA certificates. +Use the specified certificate directory to verify the peer. Multiple paths can +be provided by separated with colon (`:`) (e.g. `path1:path2:path3`). The +certificates must be in PEM format, and if curl is built against OpenSSL, the +directory must have been processed using the c_rehash utility supplied with +OpenSSL. Using --capath can allow OpenSSL-powered curl to make SSL-connections +much more efficiently than using --cacert if the --cacert file contains many +CA certificates. If this option is set, the default capath value is ignored. diff --git a/deps/curl/docs/cmdline-opts/cert-status.md b/deps/curl/docs/cmdline-opts/cert-status.md index bfbd3af8..8b6e57b9 100644 --- a/deps/curl/docs/cmdline-opts/cert-status.md +++ b/deps/curl/docs/cmdline-opts/cert-status.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: cert-status Protocols: TLS Added: 7.41.0 -Help: Verify the status of the server cert via OCSP-staple +Help: Verify server cert status OCSP-staple Category: tls Multi: boolean See-also: @@ -15,11 +15,11 @@ Example: # `--cert-status` -Tells curl to verify the status of the server certificate by using the -Certificate Status Request (aka. OCSP stapling) TLS extension. +Verify the status of the server certificate by using the Certificate Status +Request (aka. OCSP stapling) TLS extension. If this option is enabled and the server sends an invalid (e.g. expired) response, if the response suggests that the server certificate has been revoked, or no response at all is received, the verification fails. -This is currently only implemented in the OpenSSL and GnuTLS backends. +This support is currently only implemented in the OpenSSL and GnuTLS backends. diff --git a/deps/curl/docs/cmdline-opts/cert-type.md b/deps/curl/docs/cmdline-opts/cert-type.md index a0030a59..d78ab8fa 100644 --- a/deps/curl/docs/cmdline-opts/cert-type.md +++ b/deps/curl/docs/cmdline-opts/cert-type.md @@ -18,8 +18,8 @@ Example: # `--cert-type` -Tells curl what type the provided client certificate is using. PEM, DER, ENG -and P12 are recognized types. +Set type of the provided client certificate. PEM, DER, ENG and P12 are +recognized types. The default type depends on the TLS backend and is usually PEM, however for Secure Transport and Schannel it is P12. If --cert is a pkcs11: URI then ENG is diff --git a/deps/curl/docs/cmdline-opts/cert.md b/deps/curl/docs/cmdline-opts/cert.md index b9630b95..d5d19a39 100644 --- a/deps/curl/docs/cmdline-opts/cert.md +++ b/deps/curl/docs/cmdline-opts/cert.md @@ -19,13 +19,13 @@ Example: # `--cert` -Tells curl to use the specified client certificate file when getting a file -with HTTPS, FTPS or another SSL-based protocol. The certificate must be in -PKCS#12 format if using Secure Transport, or PEM format if using any other -engine. If the optional password is not specified, it is queried for on -the terminal. Note that this option assumes a certificate file that is the -private key and the client certificate concatenated. See --cert and --key to -specify them independently. +Use the specified client certificate file when getting a file with HTTPS, FTPS +or another SSL-based protocol. The certificate must be in PKCS#12 format if +using Secure Transport, or PEM format if using any other engine. If the +optional password is not specified, it is queried for on the terminal. Note +that this option assumes a certificate file that is the private key and the +client certificate concatenated. See --cert and --key to specify them +independently. In the \ portion of the argument, you must escape the character `:` as `\:` so that it is not recognized as the password delimiter. Similarly, @@ -39,6 +39,10 @@ PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option is set as `pkcs11` if none was provided and the --cert-type option is set as `ENG` if none was provided. +If curl is built against GnuTLS library, a PKCS#11 URI can be used to specify +a certificate located in a PKCS#11 device. A string beginning with `pkcs11:` +is interpreted as a PKCS#11 URI. + (iOS and macOS only) If curl is built against Secure Transport, then the certificate string can either be the name of a certificate/private key in the system or user keychain, or the path to a PKCS#12-encoded certificate and diff --git a/deps/curl/docs/cmdline-opts/ciphers.md b/deps/curl/docs/cmdline-opts/ciphers.md index 9d7e0c6f..6a597a2c 100644 --- a/deps/curl/docs/cmdline-opts/ciphers.md +++ b/deps/curl/docs/cmdline-opts/ciphers.md @@ -2,23 +2,24 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ciphers -Arg: -Help: SSL ciphers to use +Arg: +Help: TLS 1.2 (1.1, 1.0) ciphers to use Protocols: TLS Category: tls Added: 7.9 Multi: single See-also: - - tlsv1.3 - tls13-ciphers - proxy-ciphers + - curves Example: - - --ciphers ECDHE-ECDSA-AES256-CCM8 $URL + - --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 $URL --- # `--ciphers` -Specifies which ciphers to use in the connection. The list of ciphers must -specify valid ciphers. Read up on SSL cipher list details on this URL: +Specifies which cipher suites to use in the connection if it negotiates +TLS 1.2 (1.1, 1.0). The list of ciphers suites must specify valid ciphers. +Read up on cipher suite details on this URL: https://curl.se/docs/ssl-ciphers.html diff --git a/deps/curl/docs/cmdline-opts/compressed-ssh.md b/deps/curl/docs/cmdline-opts/compressed-ssh.md index c52e5a7a..b404f62d 100644 --- a/deps/curl/docs/cmdline-opts/compressed-ssh.md +++ b/deps/curl/docs/cmdline-opts/compressed-ssh.md @@ -15,5 +15,5 @@ Example: # `--compressed-ssh` -Enables built-in SSH compression. -This is a request, not an order; the server may or may not do it. +Enables built-in SSH compression. This is a request, not an order; the server +may or may not do it. diff --git a/deps/curl/docs/cmdline-opts/config.md b/deps/curl/docs/cmdline-opts/config.md index 181825ac..1281a3d9 100644 --- a/deps/curl/docs/cmdline-opts/config.md +++ b/deps/curl/docs/cmdline-opts/config.md @@ -38,7 +38,8 @@ is treated as a comment. Only write one option per physical line in the config file. A single line is required to be no more than 10 megabytes (since 8.2.0). -Specify the filename to --config as '-' to make curl read the file from stdin. +Specify the filename to --config as minus "-" to make curl read the file from +stdin. Note that to be able to specify a URL in the config file, you need to specify it using the --url option, and not by simply writing the URL on its own diff --git a/deps/curl/docs/cmdline-opts/connect-timeout.md b/deps/curl/docs/cmdline-opts/connect-timeout.md index f7281b09..dc5f9270 100644 --- a/deps/curl/docs/cmdline-opts/connect-timeout.md +++ b/deps/curl/docs/cmdline-opts/connect-timeout.md @@ -2,9 +2,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: connect-timeout -Arg: -Help: Maximum time allowed for connection -Category: connection +Arg: +Help: Maximum time allowed to connect +Category: connection timeout Added: 7.7 Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/connect-to.md b/deps/curl/docs/cmdline-opts/connect-to.md index 7cd0aa85..57825616 100644 --- a/deps/curl/docs/cmdline-opts/connect-to.md +++ b/deps/curl/docs/cmdline-opts/connect-to.md @@ -3,9 +3,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: connect-to Arg: -Help: Connect to host +Help: Connect to host2 instead of host1 Added: 7.49.0 -Category: connection +Category: connection dns Multi: append See-also: - resolve @@ -16,15 +16,25 @@ Example: # `--connect-to` -For a request to the given `HOST1:PORT1` pair, connect to `HOST2:PORT2` -instead. This option is suitable to direct requests at a specific server, -e.g. at a specific cluster node in a cluster of servers. This option is only -used to establish the network connection. It does NOT affect the hostname/port -that is used for TLS/SSL (e.g. SNI, certificate verification) or for the -application protocols. `HOST1` and `PORT1` may be the empty string, meaning -"any host/port". `HOST2` and `PORT2` may also be the empty string, meaning -"use the request's original host/port". +For a request intended for the `HOST1:PORT1` pair, connect to `HOST2:PORT2` +instead. This option is only used to establish the network connection. It does +NOT affect the hostname/port number that is used for TLS/SSL (e.g. SNI, +certificate verification) or for the application protocols. + +`HOST1` and `PORT1` may be empty strings, meaning any host or any port number. +`HOST2` and `PORT2` may also be empty strings, meaning use the request's +original hostname and port number. A hostname specified to this option is compared as a string, so it needs to match the name used in request URL. It can be either numerical such as `127.0.0.1` or the full host name such as `example.org`. + +Example: redirect connects from the example.com hostname to 127.0.0.1 +independently of port number: + + curl --connect-to example.com::127.0.0.1: https://example.com/ + +Example: redirect connects from all hostnames to 127.0.0.1 independently of +port number: + + curl --connect-to ::127.0.0.1: http://example.com/ diff --git a/deps/curl/docs/cmdline-opts/continue-at.md b/deps/curl/docs/cmdline-opts/continue-at.md index 67a79fd7..978cafc0 100644 --- a/deps/curl/docs/cmdline-opts/continue-at.md +++ b/deps/curl/docs/cmdline-opts/continue-at.md @@ -17,10 +17,10 @@ Example: # `--continue-at` -Continue/Resume a previous file transfer at the given offset. The given offset -is the exact number of bytes that are skipped, counting from the beginning -of the source file before it is transferred to the destination. If used with -uploads, the FTP server command SIZE is not used by curl. +Resume a previous transfer from the given byte offset. The given offset is the +exact number of bytes that are skipped, counting from the beginning of the +source file before it is transferred to the destination. If used with uploads, +the FTP server command SIZE is not used by curl. -Use "-C -" to tell curl to automatically find out where/how to resume the +Use "-C -" to instruct curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out. diff --git a/deps/curl/docs/cmdline-opts/cookie-jar.md b/deps/curl/docs/cmdline-opts/cookie-jar.md index f4331a48..49a9440b 100644 --- a/deps/curl/docs/cmdline-opts/cookie-jar.md +++ b/deps/curl/docs/cmdline-opts/cookie-jar.md @@ -5,12 +5,13 @@ Short: c Long: cookie-jar Arg: Protocols: HTTP -Help: Write cookies to after operation +Help: Save cookies to after operation Category: http Added: 7.9 Multi: single See-also: - cookie + - junk-session-cookies Example: - -c store-here.txt $URL - -c store-here.txt -b read-these $URL @@ -20,9 +21,10 @@ Example: Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies from its in-memory cookie storage to the -given file at the end of operations. If no cookies are known, no data is -written. The file is created using the Netscape cookie file format. If you set -the filename to a single dash, "-", the cookies are written to stdout. +given file at the end of operations. Even if no cookies are known, a file is +created so that it removes any formerly existing cookies from the file. The +file uses the Netscape cookie file format. If you set the filename to a single +minus, "-", the cookies are written to stdout. The file specified with --cookie-jar is only used for output. No cookies are read from the file. To read cookies, use the --cookie option. Both options diff --git a/deps/curl/docs/cmdline-opts/cookie.md b/deps/curl/docs/cmdline-opts/cookie.md index 0676d80f..50f977e7 100644 --- a/deps/curl/docs/cmdline-opts/cookie.md +++ b/deps/curl/docs/cmdline-opts/cookie.md @@ -5,7 +5,7 @@ Short: b Long: cookie Arg: Protocols: HTTP -Help: Send cookies from string/file +Help: Send cookies from string/load from file Category: http Added: 4.9 Multi: append @@ -21,28 +21,31 @@ Example: # `--cookie` -Pass the data to the HTTP server in the Cookie header. It is supposedly the -data previously received from the server in a "Set-Cookie:" line. The data -should be in the format "NAME1=VALUE1; NAME2=VALUE2". This makes curl use the -cookie header with this content explicitly in all outgoing request(s). If -multiple requests are done due to authentication, followed redirects or -similar, they all get this cookie passed on. +This option has two slightly separate cookie sending functions. -If no '=' symbol is used in the argument, it is instead treated as a filename -to read previously stored cookie from. This option also activates the cookie -engine which makes curl record incoming cookies, which may be handy if you are -using this in combination with the --location option or do multiple URL -transfers on the same invoke. +Either: pass the exact data to send to the HTTP server in the Cookie header. +It is supposedly data previously received from the server in a `Set-Cookie:` +line. The data should be in the format `NAME1=VALUE1; NAME2=VALUE2`. When +given a set of specific cookies, curl populates its cookie header with this +content explicitly in all outgoing request(s). If multiple requests are done +due to authentication, followed redirects or similar, they all get this cookie +header passed on. -If the filename is exactly a minus ("-"), curl instead reads the contents from -stdin. If the filename is an empty string ("") and is the only cookie input, -curl activates the cookie engine without any cookies. +Or: If no `=` symbol is used in the argument, it is instead treated as a +filename to read previously stored cookie from. This option also activates the +cookie engine which makes curl record incoming cookies, which may be handy if +you are using this in combination with the --location option or do multiple +URL transfers on the same invoke. + +If the filename is a single minus ("-"), curl reads the contents from stdin. +If the filename is an empty string ("") and is the only cookie input, curl +activates the cookie engine without any cookies. The file format of the file to read cookies from should be plain HTTP headers (Set-Cookie style) or the Netscape/Mozilla cookie file format. The file specified with --cookie is only used as input. No cookies are written -to the file. To store cookies, use the --cookie-jar option. +to that file. To store cookies, use the --cookie-jar option. If you use the Set-Cookie file format and do not specify a domain then the cookie is not sent since the domain never matches. To address this, set a diff --git a/deps/curl/docs/cmdline-opts/create-dirs.md b/deps/curl/docs/cmdline-opts/create-dirs.md index fcbeb334..89d24f76 100644 --- a/deps/curl/docs/cmdline-opts/create-dirs.md +++ b/deps/curl/docs/cmdline-opts/create-dirs.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: create-dirs Help: Create necessary local directory hierarchy -Category: curl +Category: output Added: 7.10.3 Multi: boolean See-also: @@ -21,6 +21,6 @@ mentioned with the --output option combined with the path possibly set with --output-dir. If the combined output filename uses no directory, or if the directories it mentions already exist, no directories are created. -Created directories are made with mode 0750 on unix style file systems. +Created directories are made with mode 0750 on Unix-style file systems. To create remote directories when using FTP or SFTP, try --ftp-create-dirs. diff --git a/deps/curl/docs/cmdline-opts/crlf.md b/deps/curl/docs/cmdline-opts/crlf.md index 81a14ef6..c3688411 100644 --- a/deps/curl/docs/cmdline-opts/crlf.md +++ b/deps/curl/docs/cmdline-opts/crlf.md @@ -17,5 +17,3 @@ Example: Convert line feeds to carriage return plus line feeds in upload. Useful for **MVS (OS/390)**. - -(SMTP added in 7.40.0) diff --git a/deps/curl/docs/cmdline-opts/crlfile.md b/deps/curl/docs/cmdline-opts/crlfile.md index 16bd7b35..a762af09 100644 --- a/deps/curl/docs/cmdline-opts/crlfile.md +++ b/deps/curl/docs/cmdline-opts/crlfile.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: crlfile Arg: Protocols: TLS -Help: Use this CRL list +Help: Certificate Revocation list Added: 7.19.7 Category: tls Multi: single diff --git a/deps/curl/docs/cmdline-opts/curves.md b/deps/curl/docs/cmdline-opts/curves.md index 99f1ad48..9473aeaa 100644 --- a/deps/curl/docs/cmdline-opts/curves.md +++ b/deps/curl/docs/cmdline-opts/curves.md @@ -2,8 +2,8 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: curves -Arg: -Help: (EC) TLS key exchange algorithm(s) to request +Arg: +Help: (EC) TLS key exchange algorithms to request Protocols: TLS Added: 7.73.0 Category: tls @@ -16,10 +16,10 @@ Example: # `--curves` -Tells curl to request specific curves to use during SSL session establishment -according to RFC 8422, 5.1. Multiple algorithms can be provided by separating -them with `:` (e.g. `X25519:P-521`). The parameter is available identically in -the OpenSSL `s_client` and `s_server` utilities. +Set specific curves to use during SSL session establishment according to RFC +8422, 5.1. Multiple algorithms can be provided by separating them with `:` +(e.g. `X25519:P-521`). The parameter is available identically in the OpenSSL +`s_client` and `s_server` utilities. --curves allows a OpenSSL powered curl to make SSL-connections with exactly the (EC) curve requested by the client, avoiding nontransparent client/server diff --git a/deps/curl/docs/cmdline-opts/data-ascii.md b/deps/curl/docs/cmdline-opts/data-ascii.md index 124dee13..5763d81f 100644 --- a/deps/curl/docs/cmdline-opts/data-ascii.md +++ b/deps/curl/docs/cmdline-opts/data-ascii.md @@ -18,4 +18,4 @@ Example: # `--data-ascii` -This is just an alias for --data. +This option is just an alias for --data. diff --git a/deps/curl/docs/cmdline-opts/data-binary.md b/deps/curl/docs/cmdline-opts/data-binary.md index 3d563fbd..4c5e4da8 100644 --- a/deps/curl/docs/cmdline-opts/data-binary.md +++ b/deps/curl/docs/cmdline-opts/data-binary.md @@ -16,11 +16,12 @@ Example: # `--data-binary` -This posts data exactly as specified with no extra processing whatsoever. +Post data exactly as specified with no extra processing whatsoever. -If you start the data with the letter @, the rest should be a filename. Data -is posted in a similar manner as --data does, except that newlines and -carriage returns are preserved and conversions are never done. +If you start the data with the letter @, the rest should be a filename. +`@-` makes curl read the data from stdin. Data is posted in a similar +manner as --data does, except that newlines and carriage returns are +preserved and conversions are never done. Like --data the default content-type sent to the server is application/x-www-form-urlencoded. If you want the data to be treated as diff --git a/deps/curl/docs/cmdline-opts/data-raw.md b/deps/curl/docs/cmdline-opts/data-raw.md index 2cb46938..1033678b 100644 --- a/deps/curl/docs/cmdline-opts/data-raw.md +++ b/deps/curl/docs/cmdline-opts/data-raw.md @@ -17,5 +17,5 @@ Example: # `--data-raw` -This posts data similarly to --data but without the special -interpretation of the @ character. +Post data similarly to --data but without the special interpretation of the @ +character. diff --git a/deps/curl/docs/cmdline-opts/data-urlencode.md b/deps/curl/docs/cmdline-opts/data-urlencode.md index 733530a5..b4680e61 100644 --- a/deps/curl/docs/cmdline-opts/data-urlencode.md +++ b/deps/curl/docs/cmdline-opts/data-urlencode.md @@ -20,32 +20,32 @@ Example: # `--data-urlencode` -This posts data, similar to the other --data options with the exception -that this performs URL-encoding. +Post data, similar to the other --data options with the exception that this +performs URL-encoding. To be CGI-compliant, the \ part should begin with a *name* followed by a separator and a content specification. The \ part can be passed to curl using one of the following syntaxes: ## content -This makes curl URL-encode the content and pass that on. Just be careful -so that the content does not contain any = or @ symbols, as that makes -the syntax match one of the other cases below! +URL-encode the content and pass that on. Just be careful so that the content +does not contain any `=` or `@` symbols, as that makes the syntax match one of +the other cases below. ## =content -This makes curl URL-encode the content and pass that on. The preceding = -symbol is not included in the data. +URL-encode the content and pass that on. The preceding `=` symbol is not +included in the data. ## name=content -This makes curl URL-encode the content part and pass that on. Note that -the name part is expected to be URL-encoded already. +URL-encode the content part and pass that on. Note that the name part is +expected to be URL-encoded already. ## @filename -This makes curl load data from the given file (including any newlines), -URL-encode that data and pass it on in the POST. +load data from the given file (including any newlines), URL-encode that data +and pass it on in the POST. Using `@-` makes curl read the data from stdin. ## name@filename -This makes curl load data from the given file (including any newlines), -URL-encode that data and pass it on in the POST. The name part gets an equal -sign appended, resulting in *name=urlencoded-file-content*. Note that the -name is expected to be URL-encoded already. +load data from the given file (including any newlines), URL-encode that data +and pass it on in the POST. The name part gets an equal sign appended, +resulting in *name=urlencoded-file-content*. Note that the name is expected to +be URL-encoded already. diff --git a/deps/curl/docs/cmdline-opts/data.md b/deps/curl/docs/cmdline-opts/data.md index ebe2347d..6b6e7028 100644 --- a/deps/curl/docs/cmdline-opts/data.md +++ b/deps/curl/docs/cmdline-opts/data.md @@ -24,7 +24,7 @@ Example: Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the -submit button. This makes curl pass the data to the server using the +submit button. This option makes curl pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to --form. --data-raw is almost the same but does not have a special interpretation of diff --git a/deps/curl/docs/cmdline-opts/delegation.md b/deps/curl/docs/cmdline-opts/delegation.md index 3d6cff89..c874a2b5 100644 --- a/deps/curl/docs/cmdline-opts/delegation.md +++ b/deps/curl/docs/cmdline-opts/delegation.md @@ -17,8 +17,7 @@ Example: # `--delegation` -Set LEVEL to tell the server what it is allowed to delegate when it -comes to user credentials. +Set LEVEL what curl is allowed to delegate when it comes to user credentials. ## none Do not allow any delegation. diff --git a/deps/curl/docs/cmdline-opts/digest.md b/deps/curl/docs/cmdline-opts/digest.md index 5bba975d..04c5a79a 100644 --- a/deps/curl/docs/cmdline-opts/digest.md +++ b/deps/curl/docs/cmdline-opts/digest.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: digest -Help: Use HTTP Digest Authentication +Help: HTTP Digest Authentication Protocols: HTTP Mutexed: basic ntlm negotiate Category: proxy auth http @@ -18,6 +18,6 @@ Example: # `--digest` -Enables HTTP Digest authentication. This is an authentication scheme that -prevents the password from being sent over the wire in clear text. Use this in -combination with the normal --user option to set username and password. +Enables HTTP Digest authentication. This authentication scheme avoids sending +the password over the wire in clear text. Use this in combination with the +normal --user option to set username and password. diff --git a/deps/curl/docs/cmdline-opts/disable-eprt.md b/deps/curl/docs/cmdline-opts/disable-eprt.md index 80ae0569..b6e6c6da 100644 --- a/deps/curl/docs/cmdline-opts/disable-eprt.md +++ b/deps/curl/docs/cmdline-opts/disable-eprt.md @@ -16,11 +16,11 @@ Example: # `--disable-eprt` -Tell curl to disable the use of the EPRT and LPRT commands when doing active -FTP transfers. Curl normally first attempts to use EPRT before using PORT, but -with this option, it uses PORT right away. EPRT is an extension to the -original FTP protocol, and does not work on all servers, but enables more -functionality in a better way than the traditional PORT command. +Disable the use of the EPRT and LPRT commands when doing active FTP transfers. +Curl normally first attempts to use EPRT before using PORT, but with this +option, it uses PORT right away. EPRT is an extension to the original FTP +protocol, and does not work on all servers, but enables more functionality in +a better way than the traditional PORT command. --eprt can be used to explicitly enable EPRT again and --no-eprt is an alias for --disable-eprt. diff --git a/deps/curl/docs/cmdline-opts/disable-epsv.md b/deps/curl/docs/cmdline-opts/disable-epsv.md index f4a8de8c..7667c795 100644 --- a/deps/curl/docs/cmdline-opts/disable-epsv.md +++ b/deps/curl/docs/cmdline-opts/disable-epsv.md @@ -16,9 +16,9 @@ Example: # `--disable-epsv` -Tell curl to disable the use of the EPSV command when doing passive FTP -transfers. Curl normally first attempts to use EPSV before PASV, but with this -option, it does not try EPSV. +Disable the use of the EPSV command when doing passive FTP transfers. Curl +normally first attempts to use EPSV before PASV, but with this option, it does +not try EPSV. --epsv can be used to explicitly enable EPSV again and --no-epsv is an alias for --disable-epsv. diff --git a/deps/curl/docs/cmdline-opts/disable.md b/deps/curl/docs/cmdline-opts/disable.md index e22a2bb4..1370b91d 100644 --- a/deps/curl/docs/cmdline-opts/disable.md +++ b/deps/curl/docs/cmdline-opts/disable.md @@ -18,6 +18,3 @@ Example: If used as the **first** parameter on the command line, the *curlrc* config file is not read or used. See the --config for details on the default config file search path. - -Prior to 7.50.0 curl supported the short option name *q* but not the long -option name *disable*. diff --git a/deps/curl/docs/cmdline-opts/disallow-username-in-url.md b/deps/curl/docs/cmdline-opts/disallow-username-in-url.md index faa4d883..012f2d0d 100644 --- a/deps/curl/docs/cmdline-opts/disallow-username-in-url.md +++ b/deps/curl/docs/cmdline-opts/disallow-username-in-url.md @@ -14,5 +14,5 @@ Example: # `--disallow-username-in-url` -This tells curl to exit if passed a URL containing a username. This is probably -most useful when the URL is being provided at runtime or similar. +Exit with error if passed a URL containing a username. Probably most useful +when the URL is being provided at runtime or similar. diff --git a/deps/curl/docs/cmdline-opts/dns-interface.md b/deps/curl/docs/cmdline-opts/dns-interface.md index ee2bb829..aee7400b 100644 --- a/deps/curl/docs/cmdline-opts/dns-interface.md +++ b/deps/curl/docs/cmdline-opts/dns-interface.md @@ -18,6 +18,6 @@ Example: # `--dns-interface` -Tell curl to send outgoing DNS requests through the given interface. This -option is a counterpart to --interface (which does not affect DNS). The -supplied string must be an interface name (not an address). +Send outgoing DNS requests through the given interface. This option is a +counterpart to --interface (which does not affect DNS). The supplied string +must be an interface name (not an address). diff --git a/deps/curl/docs/cmdline-opts/dns-ipv4-addr.md b/deps/curl/docs/cmdline-opts/dns-ipv4-addr.md index ff4163bc..4a43cb1d 100644 --- a/deps/curl/docs/cmdline-opts/dns-ipv4-addr.md +++ b/deps/curl/docs/cmdline-opts/dns-ipv4-addr.md @@ -18,6 +18,6 @@ Example: # `--dns-ipv4-addr` -Tell curl to bind to a specific IP address when making IPv4 DNS requests, so -that the DNS requests originate from this address. The argument should be a -single IPv4 address. +Bind to a specific IP address when making IPv4 DNS requests, so that the DNS +requests originate from this address. The argument should be a single IPv4 +address. diff --git a/deps/curl/docs/cmdline-opts/dns-ipv6-addr.md b/deps/curl/docs/cmdline-opts/dns-ipv6-addr.md index 7d4d1c1f..71123117 100644 --- a/deps/curl/docs/cmdline-opts/dns-ipv6-addr.md +++ b/deps/curl/docs/cmdline-opts/dns-ipv6-addr.md @@ -18,6 +18,6 @@ Example: # `--dns-ipv6-addr` -Tell curl to bind to a specific IP address when making IPv6 DNS requests, so -that the DNS requests originate from this address. The argument should be a -single IPv6 address. +Bind to a specific IP address when making IPv6 DNS requests, so that the DNS +requests originate from this address. The argument should be a single IPv6 +address. diff --git a/deps/curl/docs/cmdline-opts/doh-cert-status.md b/deps/curl/docs/cmdline-opts/doh-cert-status.md index efa9da75..920c5b43 100644 --- a/deps/curl/docs/cmdline-opts/doh-cert-status.md +++ b/deps/curl/docs/cmdline-opts/doh-cert-status.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: doh-cert-status -Help: Verify the status of the DoH server cert via OCSP-staple +Help: Verify DoH server cert status OCSP-staple Added: 7.76.0 Category: dns tls Multi: boolean @@ -15,3 +15,12 @@ Example: # `--doh-cert-status` Same as --cert-status but used for DoH (DNS-over-HTTPS). + +Verifies the status of the DoH servers' certificate by using the Certificate +Status Request (aka. OCSP stapling) TLS extension. + +If this option is enabled and the DoH server sends an invalid (e.g. expired) +response, if the response suggests that the server certificate has been +revoked, or no response at all is received, the verification fails. + +This support is currently only implemented in the OpenSSL and GnuTLS backends. diff --git a/deps/curl/docs/cmdline-opts/doh-insecure.md b/deps/curl/docs/cmdline-opts/doh-insecure.md index 684428dd..72f3cb77 100644 --- a/deps/curl/docs/cmdline-opts/doh-insecure.md +++ b/deps/curl/docs/cmdline-opts/doh-insecure.md @@ -8,10 +8,20 @@ Category: dns tls Multi: boolean See-also: - doh-url + - insecure + - proxy-insecure Example: - --doh-insecure --doh-url https://doh.example $URL --- # `--doh-insecure` -Same as --insecure but used for DoH (DNS-over-HTTPS). +By default, every connection curl makes to a DoH server is verified to be +secure before the transfer takes place. This option tells curl to skip the +verification step and proceed without checking. + +**WARNING**: using this option makes the DoH transfer and name resolution +insecure. + +This option is equivalent to --insecure and --proxy-insecure but used for DoH +(DNS-over-HTTPS) only. diff --git a/deps/curl/docs/cmdline-opts/doh-url.md b/deps/curl/docs/cmdline-opts/doh-url.md index 23754cac..0f745af3 100644 --- a/deps/curl/docs/cmdline-opts/doh-url.md +++ b/deps/curl/docs/cmdline-opts/doh-url.md @@ -11,6 +11,7 @@ See-also: - doh-insecure Example: - --doh-url https://doh.example $URL + - --doh-url https://doh.example --resolve doh.example:443:192.0.2.1 $URL --- # `--doh-url` @@ -23,5 +24,7 @@ name lookups take place over SSL. However, the certificate verification settings are not inherited but are controlled separately via --doh-insecure and --doh-cert-status. +By default, DoH is bypassed when initially looking up DNS records of the DoH server. You can specify the IP address(es) of the DoH server with --resolve to avoid this. + This option is unset if an empty string "" is used as the URL. (Added in 7.85.0) diff --git a/deps/curl/docs/cmdline-opts/dump-ca-embed.md b/deps/curl/docs/cmdline-opts/dump-ca-embed.md new file mode 100644 index 00000000..2ad12301 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/dump-ca-embed.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dump-ca-embed +Help: Write the embedded CA bundle to standard output +Protocols: TLS +Category: http proxy tls +Added: 8.10.0 +Multi: boolean +See-also: + - ca-native + - cacert + - capath + - proxy-ca-native + - proxy-cacert + - proxy-capath +Example: + - --dump-ca-embed +--- + +# `--dump-ca-embed` + +Write the CA bundle embedded in curl to standard output, then quit. + +If curl was not built with a default CA bundle embedded, the output is empty. diff --git a/deps/curl/docs/cmdline-opts/dump-header.md b/deps/curl/docs/cmdline-opts/dump-header.md index 42d3e85e..bdb0e874 100644 --- a/deps/curl/docs/cmdline-opts/dump-header.md +++ b/deps/curl/docs/cmdline-opts/dump-header.md @@ -13,15 +13,23 @@ See-also: - output Example: - --dump-header store.txt $URL + - --dump-header - $URL -o save --- # `--dump-header` Write the received protocol headers to the specified file. If no headers are -received, the use of this option creates an empty file. +received, the use of this option creates an empty file. Specify `-` as +filename (a single minus) to have it written to stdout. + +Starting in curl 8.10.0, specify `%` (a single percent sign) as filename +writes the output to stderr. When used in FTP, the FTP server response lines are considered being "headers" and thus are saved there. +Starting in curl 8.11.0, using the --create-dirs option can also create +missing directory components for the path provided in --dump-header. + Having multiple transfers in one set of operations (i.e. the URLs in one --next clause), appends them to the same file, separated by a blank line. diff --git a/deps/curl/docs/cmdline-opts/ech.md b/deps/curl/docs/cmdline-opts/ech.md new file mode 100644 index 00000000..61faca67 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/ech.md @@ -0,0 +1,54 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ech +Arg: +Help: Configure ECH +Added: 8.8.0 +Category: tls +Protocols: HTTPS +Multi: single +See-also: + - doh-url +Example: + - --ech true $URL +--- + +# `--ech` + +Specifies how to do ECH (Encrypted Client Hello). + +The values allowed for \ can be: + +## "false" (default) + +Do not attempt ECH + +## "grease" + +Send a GREASE ECH extension + +## "true" + +Attempt ECH if possible, but do not fail if ECH is not attempted. +(The connection fails if ECH is attempted but fails.) + +## "hard" + +Attempt ECH and fail if that is not possible. +ECH only works with TLS 1.3 and also requires using +DoH or providing an ECHConfigList on the command line. + +## "ecl:" + +A base64 encoded ECHConfigList that is used for ECH. + +## "pn:" + +A name to use to over-ride the `public_name` field of an ECHConfigList +(only available with OpenSSL TLS support) + +## Errors + +Most errors cause error +*CURLE_ECH_REQUIRED* (101). diff --git a/deps/curl/docs/cmdline-opts/egd-file.md b/deps/curl/docs/cmdline-opts/egd-file.md index b68b7d49..ef16b996 100644 --- a/deps/curl/docs/cmdline-opts/egd-file.md +++ b/deps/curl/docs/cmdline-opts/egd-file.md @@ -5,7 +5,7 @@ Long: egd-file Arg: Help: EGD socket path for random data Protocols: TLS -Category: tls +Category: deprecated Added: 7.7 Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/etag-compare.md b/deps/curl/docs/cmdline-opts/etag-compare.md index 11c1d0e8..d69cbdf3 100644 --- a/deps/curl/docs/cmdline-opts/etag-compare.md +++ b/deps/curl/docs/cmdline-opts/etag-compare.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: etag-compare Arg: -Help: Pass an ETag from a file as a custom header +Help: Load ETag from file Protocols: HTTP Added: 7.68.0 Category: http @@ -17,14 +17,11 @@ Example: # `--etag-compare` -This option makes a conditional HTTP request for the specific ETag read -from the given file by sending a custom If-None-Match header using the -stored ETag. +Make a conditional HTTP request for the specific ETag read from the given file +by sending a custom If-None-Match header using the stored ETag. -For correct results, make sure that the specified file contains only a -single line with the desired ETag. An empty file is parsed as an empty -ETag. +For correct results, make sure that the specified file contains only a single +line with the desired ETag. An empty file is parsed as an empty ETag. -Use the option --etag-save to first save the ETag from a response, and -then use this option to compare against the saved ETag in a subsequent -request. +Use the option --etag-save to first save the ETag from a response, and then +use this option to compare against the saved ETag in a subsequent request. diff --git a/deps/curl/docs/cmdline-opts/etag-save.md b/deps/curl/docs/cmdline-opts/etag-save.md index f6fb14a5..aa346ada 100644 --- a/deps/curl/docs/cmdline-opts/etag-save.md +++ b/deps/curl/docs/cmdline-opts/etag-save.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: etag-save Arg: -Help: Parse ETag from a request and save it to a file +Help: Parse incoming ETag and save to a file Protocols: HTTP Added: 7.68.0 Category: http @@ -16,7 +16,7 @@ Example: # `--etag-save` -This option saves an HTTP ETag to the specified file. An ETag is a -caching related header, usually returned in a response. +Save an HTTP ETag to the specified file. An ETag is a caching related header, +usually returned in a response. If no ETag is sent by the server, an empty file is created. diff --git a/deps/curl/docs/cmdline-opts/expect100-timeout.md b/deps/curl/docs/cmdline-opts/expect100-timeout.md index 9554568a..80cf4eba 100644 --- a/deps/curl/docs/cmdline-opts/expect100-timeout.md +++ b/deps/curl/docs/cmdline-opts/expect100-timeout.md @@ -6,7 +6,7 @@ Arg: Help: How long to wait for 100-continue Protocols: HTTP Added: 7.47.0 -Category: http +Category: http timeout Multi: single See-also: - connect-timeout @@ -18,8 +18,8 @@ Example: Maximum time in seconds that you allow curl to wait for a 100-continue response when curl emits an Expects: 100-continue header in its request. By -default curl waits one second. This option accepts decimal values! When -curl stops waiting, it continues as if the response has been received. +default curl waits one second. This option accepts decimal values. When curl +stops waiting, it continues as if a response was received. -The decimal value needs to provided using a dot (.) as decimal separator - not -the local version even if it might be using another separator. +The decimal value needs to be provided using a dot (`.`) as decimal separator - +not the local version even if it might be using another separator. diff --git a/deps/curl/docs/cmdline-opts/fail-early.md b/deps/curl/docs/cmdline-opts/fail-early.md index 40a2e012..67edbf91 100644 --- a/deps/curl/docs/cmdline-opts/fail-early.md +++ b/deps/curl/docs/cmdline-opts/fail-early.md @@ -2,9 +2,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: fail-early -Help: Fail on first transfer error, do not continue +Help: Fail on first transfer error Added: 7.52.0 -Category: curl +Category: curl global Multi: boolean Scope: global See-also: diff --git a/deps/curl/docs/cmdline-opts/fail-with-body.md b/deps/curl/docs/cmdline-opts/fail-with-body.md index e340cb03..670959ba 100644 --- a/deps/curl/docs/cmdline-opts/fail-with-body.md +++ b/deps/curl/docs/cmdline-opts/fail-with-body.md @@ -19,9 +19,9 @@ Example: Return an error on server errors where the HTTP response code is 400 or greater). In normal cases when an HTTP server fails to deliver a document, it -returns an HTML document stating so (which often also describes why and -more). This flag allows curl to output and save that content but also to -return error 22. +returns an HTML document stating so (which often also describes why and more). +This option allows curl to output and save that content but also to return +error 22. This is an alternative option to --fail which makes curl fail for the same circumstances but without saving the content. diff --git a/deps/curl/docs/cmdline-opts/fail.md b/deps/curl/docs/cmdline-opts/fail.md index b8de4ebb..0c8db136 100644 --- a/deps/curl/docs/cmdline-opts/fail.md +++ b/deps/curl/docs/cmdline-opts/fail.md @@ -18,11 +18,17 @@ Example: # `--fail` -Fail fast with no output at all on server errors. This is useful to enable -scripts and users to better deal with failed attempts. In normal cases when an -HTTP server fails to deliver a document, it returns an HTML document stating -so (which often also describes why and more). This flag prevents curl from -outputting that and return error 22. +Fail with error code 22 and with no response body output at all for HTTP +transfers returning HTTP response codes at 400 or greater. + +In normal cases when an HTTP server fails to deliver a document, it returns a +body of text stating so (which often also describes why and more) and a 4xx +HTTP response code. This command line option prevents curl from outputting +that data and instead returns error 22 early. By default, curl does not +consider HTTP response codes to indicate failure. + +To get both the error code and also save the content, use --fail-with-body +instead. This method is not fail-safe and there are occasions where non-successful response codes slip through, especially when authentication is involved diff --git a/deps/curl/docs/cmdline-opts/false-start.md b/deps/curl/docs/cmdline-opts/false-start.md index d2697da5..c6c44ad5 100644 --- a/deps/curl/docs/cmdline-opts/false-start.md +++ b/deps/curl/docs/cmdline-opts/false-start.md @@ -15,10 +15,9 @@ Example: # `--false-start` -Tells curl to use false start during the TLS handshake. False start is a mode -where a TLS client starts sending application data before verifying the -server's Finished message, thus saving a round trip when performing a full -handshake. +Use false start during the TLS handshake. False start is a mode where a TLS +client starts sending application data before verifying the server's Finished +message, thus saving a round trip when performing a full handshake. -This is currently only implemented in the Secure Transport (on iOS 7.0 or -later, or OS X 10.9 or later) backend. +This functionality is currently only implemented in the Secure Transport (on +iOS 7.0 or later, or macOS 10.9 or later) backend. diff --git a/deps/curl/docs/cmdline-opts/form-escape.md b/deps/curl/docs/cmdline-opts/form-escape.md index d405bef9..0f93fde7 100644 --- a/deps/curl/docs/cmdline-opts/form-escape.md +++ b/deps/curl/docs/cmdline-opts/form-escape.md @@ -2,10 +2,10 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: form-escape -Help: Escape multipart form field/filenames using backslash -Protocols: HTTP +Help: Escape form fields using backslash +Protocols: HTTP imap smtp Added: 7.81.0 -Category: http upload +Category: http upload post Multi: single See-also: - form @@ -15,5 +15,5 @@ Example: # `--form-escape` -Tells curl to pass on names of multipart form fields and files using -backslash-escaping instead of percent-encoding. +Pass on names of multipart form fields and files using backslash-escaping +instead of percent-encoding. diff --git a/deps/curl/docs/cmdline-opts/form-string.md b/deps/curl/docs/cmdline-opts/form-string.md index 3c1f7b53..e58ad625 100644 --- a/deps/curl/docs/cmdline-opts/form-string.md +++ b/deps/curl/docs/cmdline-opts/form-string.md @@ -5,7 +5,7 @@ Long: form-string Help: Specify multipart MIME data Protocols: HTTP SMTP IMAP Arg: -Category: http upload +Category: http upload post smtp imap Added: 7.13.2 Multi: append See-also: diff --git a/deps/curl/docs/cmdline-opts/form.md b/deps/curl/docs/cmdline-opts/form.md index 44d958a4..17bfcac0 100644 --- a/deps/curl/docs/cmdline-opts/form.md +++ b/deps/curl/docs/cmdline-opts/form.md @@ -7,7 +7,7 @@ Arg: Help: Specify multipart MIME data Protocols: HTTP SMTP IMAP Mutexed: data head upload-file -Category: http upload +Category: http upload post imap smtp Added: 5.0 Multi: append See-also: @@ -20,12 +20,12 @@ Example: # `--form` -For HTTP protocol family, this lets curl emulate a filled-in form in which a -user has pressed the submit button. This causes curl to POST data using the -Content-Type multipart/form-data according to RFC 2388. +For the HTTP protocol family, emulate a filled-in form in which a user has +pressed the submit button. This makes curl POST data using the Content-Type +multipart/form-data according to RFC 2388. -For SMTP and IMAP protocols, this is the means to compose a multipart mail -message to transmit. +For SMTP and IMAP protocols, this composes a multipart mail message to +transmit. This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the filename with an @ sign. To just get the content part from @@ -34,11 +34,11 @@ a file, prefix the filename with the symbol \<. The difference between @ and while the \< makes a text field and just get the contents for that text field from a file. -Tell curl to read content from stdin instead of a file by using - as -filename. This goes for both @ and \< constructs. When stdin is used, the -contents is buffered in memory first by curl to determine its size and allow a -possible resend. Defining a part's data from a named non-regular file (such as -a named pipe or similar) is not subject to buffering and is instead read at +Read content from stdin instead of a file by using a single "-" as filename. +This goes for both @ and \< constructs. When stdin is used, the contents is +buffered in memory first by curl to determine its size and allow a possible +resend. Defining a part's data from a named non-regular file (such as a named +pipe or similar) is not subject to buffering and is instead read at transmission time; since the full size is unknown before the transfer starts, such data is sent as chunks by HTTP and rejected by IMAP. @@ -56,8 +56,8 @@ text field, but get the contents for it from a local file: curl -F "story=, et al. SPDX-License-Identifier: curl Long: ftp-pasv -Help: Use PASV/EPSV instead of PORT +Help: Send PASV/EPSV instead of PORT Protocols: FTP Added: 7.11.0 Category: ftp diff --git a/deps/curl/docs/cmdline-opts/ftp-port.md b/deps/curl/docs/cmdline-opts/ftp-port.md index c7fb37a8..ff6d41c1 100644 --- a/deps/curl/docs/cmdline-opts/ftp-port.md +++ b/deps/curl/docs/cmdline-opts/ftp-port.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ftp-port Arg:
-Help: Use PORT instead of PASV +Help: Send PORT instead of PASV Short: P Protocols: FTP Category: ftp @@ -21,10 +21,10 @@ Example: # `--ftp-port` Reverses the default initiator/listener roles when connecting with FTP. This -option makes curl use active mode. curl then tells the server to connect back -to the client's specified address and port, while passive mode asks the server -to setup an IP address and port for it to connect to. \ should be -one of: +option makes curl use active mode. curl then commands the server to connect +back to the client's specified address and port, while passive mode asks the +server to setup an IP address and port for it to connect to. \ +should be one of: ## interface e.g. **eth0** to specify which interface's IP address you want to use (Unix only) diff --git a/deps/curl/docs/cmdline-opts/ftp-pret.md b/deps/curl/docs/cmdline-opts/ftp-pret.md index accbc226..48c48e3e 100644 --- a/deps/curl/docs/cmdline-opts/ftp-pret.md +++ b/deps/curl/docs/cmdline-opts/ftp-pret.md @@ -16,6 +16,6 @@ Example: # `--ftp-pret` -Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers, -mainly drftpd, require this non-standard command for directory listings as -well as up and downloads in PASV mode. +Send a PRET command before PASV (and EPSV). Certain FTP servers, mainly +drftpd, require this non-standard command for directory listings as well as up +and downloads in PASV mode. diff --git a/deps/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md b/deps/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md index ef94b34a..dfa546d1 100644 --- a/deps/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md +++ b/deps/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md @@ -15,9 +15,9 @@ Example: # `--ftp-skip-pasv-ip` -Tell curl to not use the IP address the server suggests in its response to -curl's PASV command when curl connects the data connection. Instead curl -reuses the same IP address it already uses for the control connection. +Do not use the IP address the server suggests in its response to curl's PASV +command when curl connects the data connection. Instead curl reuses the same +IP address it already uses for the control connection. This option is enabled by default (added in 7.74.0). diff --git a/deps/curl/docs/cmdline-opts/ftp-ssl-control.md b/deps/curl/docs/cmdline-opts/ftp-ssl-control.md index ace1ab29..a68359a7 100644 --- a/deps/curl/docs/cmdline-opts/ftp-ssl-control.md +++ b/deps/curl/docs/cmdline-opts/ftp-ssl-control.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ftp-ssl-control -Help: Require SSL/TLS for FTP login, clear for transfer +Help: Require TLS for login, clear for transfer Protocols: FTP Added: 7.16.0 Category: ftp tls diff --git a/deps/curl/docs/cmdline-opts/get.md b/deps/curl/docs/cmdline-opts/get.md index f8c8cf2f..ac0560ab 100644 --- a/deps/curl/docs/cmdline-opts/get.md +++ b/deps/curl/docs/cmdline-opts/get.md @@ -5,7 +5,7 @@ Long: get Short: G Help: Put the post data in the URL and use GET Protocols: HTTP -Category: http upload +Category: http Added: 7.8.1 Multi: boolean See-also: @@ -19,10 +19,10 @@ Example: # `--get` -When used, this option makes all data specified with --data, --data-binary -or --data-urlencode to be used in an HTTP GET request instead of the POST -request that otherwise would be used. The data is appended to the URL -with a '?' separator. +When used, this option makes all data specified with --data, --data-binary or +--data-urlencode to be used in an HTTP GET request instead of the POST request +that otherwise would be used. curl appends the provided data to the URL as a +query string. If used in combination with --head, the POST data is instead appended to the URL with a HEAD request. diff --git a/deps/curl/docs/cmdline-opts/globoff.md b/deps/curl/docs/cmdline-opts/globoff.md index dc3fc2ef..3c8c3414 100644 --- a/deps/curl/docs/cmdline-opts/globoff.md +++ b/deps/curl/docs/cmdline-opts/globoff.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: globoff Short: g -Help: Disable URL sequences and ranges using {} and [] +Help: Disable URL globbing with {} and [] Category: curl Added: 7.6 Multi: boolean @@ -16,7 +16,7 @@ Example: # `--globoff` -This option switches off the "URL globbing parser". When you set this option, -you can specify URLs that contain the letters {}[] without having curl itself +Switch off the URL globbing function. When you set this option, you can +specify URLs that contain the letters {}[] without having curl itself interpret them. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. diff --git a/deps/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md b/deps/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md index 0ee2cd72..f4b492db 100644 --- a/deps/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md +++ b/deps/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md @@ -2,10 +2,10 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: happy-eyeballs-timeout-ms -Arg: -Help: Time for IPv6 before trying IPv4 +Arg: +Help: Time for IPv6 before IPv4 Added: 7.59.0 -Category: connection +Category: connection timeout Multi: single See-also: - max-time diff --git a/deps/curl/docs/cmdline-opts/haproxy-clientip.md b/deps/curl/docs/cmdline-opts/haproxy-clientip.md index 470d556f..fde085a9 100644 --- a/deps/curl/docs/cmdline-opts/haproxy-clientip.md +++ b/deps/curl/docs/cmdline-opts/haproxy-clientip.md @@ -2,8 +2,8 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: haproxy-clientip -Arg: -Help: Sets client IP in HAProxy PROXY protocol v1 header +Arg: +Help: Set address in HAProxy PROXY Protocols: HTTP Added: 8.2.0 Category: http proxy diff --git a/deps/curl/docs/cmdline-opts/haproxy-protocol.md b/deps/curl/docs/cmdline-opts/haproxy-protocol.md index 0170039c..26456c80 100644 --- a/deps/curl/docs/cmdline-opts/haproxy-protocol.md +++ b/deps/curl/docs/cmdline-opts/haproxy-protocol.md @@ -15,9 +15,9 @@ Example: # `--haproxy-protocol` -Send a HAProxy PROXY protocol v1 header at the beginning of the -connection. This is used by some load balancers and reverse proxies to -indicate the client's true IP address and port. +Send a HAProxy PROXY protocol v1 header at the beginning of the connection. +This is used by some load balancers and reverse proxies to indicate the +client's true IP address and port. This option is primarily useful when sending test requests to a service that expects this header. diff --git a/deps/curl/docs/cmdline-opts/head.md b/deps/curl/docs/cmdline-opts/head.md index be4dbb87..353ef9a0 100644 --- a/deps/curl/docs/cmdline-opts/head.md +++ b/deps/curl/docs/cmdline-opts/head.md @@ -18,6 +18,6 @@ Example: # `--head` -Fetch the headers only! HTTP-servers feature the command HEAD which this uses -to get nothing but the header of a document. When used on an FTP or FILE file, +Fetch the headers only. HTTP-servers feature the command HEAD which this uses +to get nothing but the header of a document. When used on an FTP or FILE URL, curl displays the file size and last modification time only. diff --git a/deps/curl/docs/cmdline-opts/header.md b/deps/curl/docs/cmdline-opts/header.md index 13ca4cb3..17219f38 100644 --- a/deps/curl/docs/cmdline-opts/header.md +++ b/deps/curl/docs/cmdline-opts/header.md @@ -46,14 +46,14 @@ other safe guards. That includes white space and control characters. This option can take an argument in @filename style, which then adds a header for each line in the input file. Using @- makes curl read the header file from -stdin. Added in 7.55.0. +stdin. (Added in 7.55.0) Please note that most anti-spam utilities check the presence and value of several MIME mail headers: these are `From:`, `To:`, `Date:` and `Subject:` among others and should be added with this option. -You need --proxy-header to send custom headers intended for an HTTP -proxy. Added in 7.37.0. +You need --proxy-header to send custom headers intended for an HTTP proxy. +(Added in 7.37.0) Passing on a "Transfer-Encoding: chunked" header when doing an HTTP request with a request body, makes curl send the data using chunked encoding. diff --git a/deps/curl/docs/cmdline-opts/help.md b/deps/curl/docs/cmdline-opts/help.md index 6ef812d3..122c55cd 100644 --- a/deps/curl/docs/cmdline-opts/help.md +++ b/deps/curl/docs/cmdline-opts/help.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: help -Arg: +Arg: Short: h Help: Get help for commands Category: important curl @@ -12,16 +12,28 @@ See-also: - verbose Example: - --help all + - --help --insecure + - --help -f --- # `--help` -Usage help. This lists all curl command line options within the given -**category**. +Usage help. Provide help for the subject given as an optional argument. -If no argument is provided, curl displays only the most important command line +If no argument is provided, curl displays the most important command line arguments. -For category **all**, curl displays help for all options. +The argument can either be a **category** or a **command line option**. When a +category is provided, curl shows all command line options within the given +category. Specify category `all` to list all available options. -If **category** is specified, curl displays all available help categories. +If `category` is specified, curl displays all available help categories. + +If the provided subject is instead an existing command line option, specified +either in its short form with a single dash and a single letter, or in the +long form with two dashes and a longer name, curl displays a help text for +that option in the terminal. + +The help output is extensive for some options. + +If the provided command line option is not known, curl says so. diff --git a/deps/curl/docs/cmdline-opts/hostpubmd5.md b/deps/curl/docs/cmdline-opts/hostpubmd5.md index 15add357..5d480a5b 100644 --- a/deps/curl/docs/cmdline-opts/hostpubmd5.md +++ b/deps/curl/docs/cmdline-opts/hostpubmd5.md @@ -3,10 +3,10 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: hostpubmd5 Arg: -Help: Acceptable MD5 hash of the host public key +Help: Acceptable MD5 hash of host public key Protocols: SFTP SCP Added: 7.17.1 -Category: sftp scp +Category: sftp scp ssh Multi: single See-also: - hostpubsha256 diff --git a/deps/curl/docs/cmdline-opts/hostpubsha256.md b/deps/curl/docs/cmdline-opts/hostpubsha256.md index b1faaf86..35aa8ff7 100644 --- a/deps/curl/docs/cmdline-opts/hostpubsha256.md +++ b/deps/curl/docs/cmdline-opts/hostpubsha256.md @@ -3,10 +3,10 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: hostpubsha256 Arg: -Help: Acceptable SHA256 hash of the host public key +Help: Acceptable SHA256 hash of host public key Protocols: SFTP SCP Added: 7.80.0 -Category: sftp scp +Category: sftp scp ssh Multi: single See-also: - hostpubmd5 diff --git a/deps/curl/docs/cmdline-opts/hsts.md b/deps/curl/docs/cmdline-opts/hsts.md index 320377f4..9cae80c2 100644 --- a/deps/curl/docs/cmdline-opts/hsts.md +++ b/deps/curl/docs/cmdline-opts/hsts.md @@ -16,9 +16,9 @@ Example: # `--hsts` -This option enables HSTS for the transfer. If the filename points to an -existing HSTS cache file, that is used. After a completed transfer, the cache -is saved to the filename again if it has been modified. +Enable HSTS for the transfer. If the filename points to an existing HSTS cache +file, that is used. After a completed transfer, the cache is saved to the +filename again if it has been modified. If curl is told to use HTTP:// for a transfer involving a hostname that exists in the HSTS cache, it upgrades the transfer to use HTTPS. Each HSTS cache diff --git a/deps/curl/docs/cmdline-opts/http0.9.md b/deps/curl/docs/cmdline-opts/http0.9.md index a2896164..54ef3231 100644 --- a/deps/curl/docs/cmdline-opts/http0.9.md +++ b/deps/curl/docs/cmdline-opts/http0.9.md @@ -18,7 +18,7 @@ Example: # `--http0.9` -Tells curl to be fine with HTTP version 0.9 response. +Accept an HTTP version 0.9 response. HTTP/0.9 is a response without headers and therefore you can also connect with this to non-HTTP servers and still get a response since curl simply diff --git a/deps/curl/docs/cmdline-opts/http1.0.md b/deps/curl/docs/cmdline-opts/http1.0.md index fb7d907d..b810ccf3 100644 --- a/deps/curl/docs/cmdline-opts/http1.0.md +++ b/deps/curl/docs/cmdline-opts/http1.0.md @@ -19,5 +19,4 @@ Example: # `--http1.0` -Tells curl to use HTTP version 1.0 instead of using its internally preferred -HTTP version. +Use HTTP version 1.0 instead of using its internally preferred HTTP version. diff --git a/deps/curl/docs/cmdline-opts/http1.1.md b/deps/curl/docs/cmdline-opts/http1.1.md index 3c4fe303..a223da1f 100644 --- a/deps/curl/docs/cmdline-opts/http1.1.md +++ b/deps/curl/docs/cmdline-opts/http1.1.md @@ -18,4 +18,4 @@ Example: # `--http1.1` -Tells curl to use HTTP version 1.1. +Use HTTP version 1.1. This is the default with HTTP:// URLs. diff --git a/deps/curl/docs/cmdline-opts/http2-prior-knowledge.md b/deps/curl/docs/cmdline-opts/http2-prior-knowledge.md index 80a52141..5dffe26a 100644 --- a/deps/curl/docs/cmdline-opts/http2-prior-knowledge.md +++ b/deps/curl/docs/cmdline-opts/http2-prior-knowledge.md @@ -19,7 +19,11 @@ Example: # `--http2-prior-knowledge` -Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1 -Upgrade. It requires prior knowledge that the server supports HTTP/2 straight -away. HTTPS requests still do HTTP/2 the standard way with negotiated protocol +Issue a non-TLS HTTP requests using HTTP/2 directly without HTTP/1.1 Upgrade. +It requires prior knowledge that the server supports HTTP/2 straight away. +HTTPS requests still do HTTP/2 the standard way with negotiated protocol version in the TLS handshake. + +Since 8.10.0 if this option is set for an HTTPS request then the application +layer protocol version (ALPN) offered to the server is only HTTP/2. Prior to +that both HTTP/1.1 and HTTP/2 were offered. diff --git a/deps/curl/docs/cmdline-opts/http2.md b/deps/curl/docs/cmdline-opts/http2.md index db4cf346..ae4d2697 100644 --- a/deps/curl/docs/cmdline-opts/http2.md +++ b/deps/curl/docs/cmdline-opts/http2.md @@ -20,7 +20,7 @@ Example: # `--http2` -Tells curl to use HTTP version 2. +Use HTTP/2. For HTTPS, this means curl negotiates HTTP/2 in the TLS handshake. curl does this by default. diff --git a/deps/curl/docs/cmdline-opts/http3.md b/deps/curl/docs/cmdline-opts/http3.md index d30c7bd9..b5272a60 100644 --- a/deps/curl/docs/cmdline-opts/http3.md +++ b/deps/curl/docs/cmdline-opts/http3.md @@ -19,15 +19,17 @@ Example: # `--http3` -Tells curl to try HTTP/3 to the host in the URL, but fallback to earlier -HTTP versions if the HTTP/3 connection establishment fails. HTTP/3 is only +Attempt HTTP/3 to the host in the URL, but fallback to earlier HTTP versions +if the HTTP/3 connection establishment fails or is slow. HTTP/3 is only available for HTTPS and not for HTTP URLs. This option allows a user to avoid using the Alt-Svc method of upgrading to -HTTP/3 when you know that the target speaks HTTP/3 on the given host and port. +HTTP/3 when you know or suspect that the target speaks HTTP/3 on the given +host and port. When asked to use HTTP/3, curl issues a separate attempt to use older HTTP versions with a slight delay, so if the HTTP/3 transfer fails or is slow, curl -still tries to proceed with an older HTTP version. +still tries to proceed with an older HTTP version. The fallback performs the +regular negotiation between HTTP/1 and HTTP/2. Use --http3-only for similar functionality *without* a fallback. diff --git a/deps/curl/docs/cmdline-opts/include.md b/deps/curl/docs/cmdline-opts/include.md deleted file mode 100644 index aedf5da0..00000000 --- a/deps/curl/docs/cmdline-opts/include.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -c: Copyright (C) Daniel Stenberg, , et al. -SPDX-License-Identifier: curl -Long: include -Short: i -Help: Include protocol response headers in the output -Protocols: HTTP FTP -Category: important verbose -Added: 4.8 -Multi: boolean -See-also: - - verbose -Example: - - -i $URL ---- - -# `--include` - -Include response headers in the output. HTTP response headers can include -things like server name, cookies, date of the document, HTTP version and -more... With non-HTTP protocols, the "headers" are other server communication. - -To view the request headers, consider the --verbose option. - -Prior to 7.75.0 curl did not print the headers if --fail was used in -combination with this option and there was error reported by server. diff --git a/deps/curl/docs/cmdline-opts/insecure.md b/deps/curl/docs/cmdline-opts/insecure.md index b1c056b4..6b7009f2 100644 --- a/deps/curl/docs/cmdline-opts/insecure.md +++ b/deps/curl/docs/cmdline-opts/insecure.md @@ -5,7 +5,7 @@ Long: insecure Short: k Help: Allow insecure server connections Protocols: TLS SFTP SCP -Category: tls sftp scp +Category: tls sftp scp ssh Added: 7.10 Multi: boolean See-also: diff --git a/deps/curl/docs/cmdline-opts/interface.md b/deps/curl/docs/cmdline-opts/interface.md index c938fd27..539e3927 100644 --- a/deps/curl/docs/cmdline-opts/interface.md +++ b/deps/curl/docs/cmdline-opts/interface.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: interface Arg: -Help: Use network INTERFACE (or address) +Help: Use network interface Category: connection Added: 7.3 Multi: single @@ -11,15 +11,41 @@ See-also: - dns-interface Example: - --interface eth0 $URL + - --interface "host!10.0.0.1" $URL + - --interface "if!enp3s0" $URL --- # `--interface` -Perform an operation using a specified interface. You can enter interface -name, IP address or hostname. An example could look like: +Perform the operation using a specified interface. You can enter interface +name, IP address or hostname. If you prefer to be specific, you can use the +following special syntax: - curl --interface eth0:1 https://www.example.com/ +## if! -On Linux it can be used to specify a **VRF**, but the binary needs to either -have **CAP_NET_RAW** or to be run as root. More information about Linux -**VRF**: https://www.kernel.org/doc/Documentation/networking/vrf.txt +Interface name. If the provided name does not match an existing interface, +curl returns with error 45. + +## host! + +IP address or hostname. + +## ifhost!! + +Interface name and IP address or hostname. This syntax requires libcurl 8.9.0 +or later. + +If the provided name does not match an existing interface, curl returns with +error 45. + +## + +curl does not support using network interface names for this option on +Windows. + +That name resolve operation if a hostname is provided does **not** use +DNS-over-HTTPS even if --doh-url is set. + +On Linux this option can be used to specify a **VRF** (Virtual Routing and +Forwarding) device, but the binary then needs to either have the +**CAP_NET_RAW** capability set or to be run as root. diff --git a/deps/curl/docs/cmdline-opts/ip-tos.md b/deps/curl/docs/cmdline-opts/ip-tos.md new file mode 100644 index 00000000..3d6473f3 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/ip-tos.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ip-tos +Arg: +Help: Set IP Type of Service or Traffic Class +Added: 8.9.0 +Category: connection +Protocols: All +Multi: single +See-also: + - tcp-nodelay + - vlan-priority +Example: + - --ip-tos CS5 $URL +--- + +# `--ip-tos` + +Set Type of Service (TOS) for IPv4 or Traffic Class for IPv6. + +The values allowed for \ can be a numeric value between 1 and 255 +or one of the following: + +CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13, AF21, AF22, AF23, +AF31, AF32, AF33, AF41, AF42, AF43, EF, VOICE-ADMIT, ECT1, ECT0, CE, LE, +LOWCOST, LOWDELAY, THROUGHPUT, RELIABILITY, MINCOST diff --git a/deps/curl/docs/cmdline-opts/ipfs-gateway.md b/deps/curl/docs/cmdline-opts/ipfs-gateway.md index 63429d83..e5e8b10b 100644 --- a/deps/curl/docs/cmdline-opts/ipfs-gateway.md +++ b/deps/curl/docs/cmdline-opts/ipfs-gateway.md @@ -6,7 +6,7 @@ Arg: Help: Gateway for IPFS Protocols: IPFS Added: 8.4.0 -Category: ipfs +Category: curl Multi: single See-also: - help @@ -24,7 +24,8 @@ if a `~/.ipfs/gateway` file holding the gateway URL exists. If you run a local IPFS node, this gateway is by default available under `http://localhost:8080`. A full example URL would look like: - curl --ipfs-gateway http://localhost:8080 ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi + curl --ipfs-gateway http://localhost:8080 \ + ipfs://bafybeigagd5nmnn2iys2f3 There are many public IPFS gateways. See for example: https://ipfs.github.io/public-gateway-checker/ diff --git a/deps/curl/docs/cmdline-opts/ipv4.md b/deps/curl/docs/cmdline-opts/ipv4.md index 70bbc0f1..b790cc65 100644 --- a/deps/curl/docs/cmdline-opts/ipv4.md +++ b/deps/curl/docs/cmdline-opts/ipv4.md @@ -20,5 +20,5 @@ Example: # `--ipv4` -This option tells curl to use IPv4 addresses only when resolving hostnames, -and not for example try IPv6. +Use IPv4 addresses only when resolving hostnames, and not for example try +IPv6. diff --git a/deps/curl/docs/cmdline-opts/ipv6.md b/deps/curl/docs/cmdline-opts/ipv6.md index fbacbec3..547f4917 100644 --- a/deps/curl/docs/cmdline-opts/ipv6.md +++ b/deps/curl/docs/cmdline-opts/ipv6.md @@ -20,5 +20,9 @@ Example: # `--ipv6` -This option tells curl to use IPv6 addresses only when resolving hostnames, -and not for example try IPv4. +Use IPv6 addresses only when resolving hostnames, and not for example try +IPv4. + +Your resolver may respond to an IPv6-only resolve request by returning IPv6 +addresses that contain "mapped" IPv4 addresses for compatibility purposes. +macOS is known to do this. diff --git a/deps/curl/docs/cmdline-opts/json.md b/deps/curl/docs/cmdline-opts/json.md index 8056e62e..7763d81e 100644 --- a/deps/curl/docs/cmdline-opts/json.md +++ b/deps/curl/docs/cmdline-opts/json.md @@ -24,7 +24,7 @@ Example: Sends the specified JSON data in a POST request to the HTTP server. --json works as a shortcut for passing on these three options: - --data [arg] + --data-binary [arg] --header "Content-Type: application/json" --header "Accept: application/json" diff --git a/deps/curl/docs/cmdline-opts/keepalive-cnt.md b/deps/curl/docs/cmdline-opts/keepalive-cnt.md new file mode 100644 index 00000000..e56c976e --- /dev/null +++ b/deps/curl/docs/cmdline-opts/keepalive-cnt.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: keepalive-cnt +Arg: +Help: Maximum number of keepalive probes +Added: 8.9.0 +Category: connection +Multi: single +See-also: + - keepalive-time + - no-keepalive +Example: + - --keepalive-cnt 3 $URL +--- + +# `--keepalive-cnt` + +Set the maximum number of keepalive probes TCP should send but get no response +before dropping the connection. This option is usually used in conjunction +with --keepalive-time. + +This option is supported on Linux, *BSD/macOS, Windows \>=10.0.16299, Solaris +11.4, and recent AIX, HP-UX and more. This option has no effect if +--no-keepalive is used. + +If unspecified, the option defaults to 9. diff --git a/deps/curl/docs/cmdline-opts/keepalive-time.md b/deps/curl/docs/cmdline-opts/keepalive-time.md index ce3d0f03..4b10ff6f 100644 --- a/deps/curl/docs/cmdline-opts/keepalive-time.md +++ b/deps/curl/docs/cmdline-opts/keepalive-time.md @@ -5,10 +5,11 @@ Long: keepalive-time Arg: Help: Interval time for keepalive probes Added: 7.18.0 -Category: connection +Category: connection timeout Multi: single See-also: - no-keepalive + - keepalive-cnt - max-time Example: - --keepalive-time 20 $URL @@ -16,13 +17,14 @@ Example: # `--keepalive-time` -This option sets the time a connection needs to remain idle before sending -keepalive probes and the time between individual keepalive probes. It is -currently effective on operating systems offering the `TCP_KEEPIDLE` and -`TCP_KEEPINTVL` socket options (meaning Linux, recent AIX, HP-UX and more). -Keepalive is used by the TCP stack to detect broken networks on idle -connections. The number of missed keepalive probes before declaring the -connection down is OS dependent and is commonly 9 or 10. This option has no -effect if --no-keepalive is used. +Set the time a connection needs to remain idle before sending keepalive probes +and the time between individual keepalive probes. It is currently effective on +operating systems offering the `TCP_KEEPIDLE` and `TCP_KEEPINTVL` socket +options (meaning Linux, *BSD/macOS, Windows, Solaris, and recent AIX, HP-UX and more). +Keepalive is used by the TCP stack to detect broken networks on idle connections. +The number of missed keepalive probes before declaring the connection down is OS +dependent and is commonly 8 (*BSD/macOS/AIX), 9 (Linux/AIX) or 5/10 (Windows), and +this number can be changed by specifying the curl option `keepalive-cnt`. +Note that this option has no effect if --no-keepalive is used. If unspecified, the option defaults to 60 seconds. diff --git a/deps/curl/docs/cmdline-opts/libcurl.md b/deps/curl/docs/cmdline-opts/libcurl.md index 4b3c13d4..e37e5aa0 100644 --- a/deps/curl/docs/cmdline-opts/libcurl.md +++ b/deps/curl/docs/cmdline-opts/libcurl.md @@ -3,9 +3,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: libcurl Arg: -Help: Dump libcurl equivalent code of this command line +Help: Generate libcurl code for this command line Added: 7.16.1 -Category: curl +Category: curl global Multi: single Scope: global See-also: @@ -18,4 +18,4 @@ Example: Append this option to any ordinary curl command line, and you get libcurl-using C source code written to the file that does the equivalent of -what your command-line operation does! +what your command-line operation does. diff --git a/deps/curl/docs/cmdline-opts/limit-rate.md b/deps/curl/docs/cmdline-opts/limit-rate.md index ab94c2f2..273a2ce5 100644 --- a/deps/curl/docs/cmdline-opts/limit-rate.md +++ b/deps/curl/docs/cmdline-opts/limit-rate.md @@ -20,8 +20,8 @@ Example: # `--limit-rate` Specify the maximum transfer rate you want curl to use - for both downloads -and uploads. This feature is useful if you have a limited pipe and you would like -your transfer not to use your entire bandwidth. To make it slower than it +and uploads. This feature is useful if you have a limited pipe and you would +like your transfer not to use your entire bandwidth. To make it slower than it otherwise would be. The given speed is measured in bytes/second, unless a suffix is appended. diff --git a/deps/curl/docs/cmdline-opts/list-only.md b/deps/curl/docs/cmdline-opts/list-only.md index 52f0b6fc..2800a8f7 100644 --- a/deps/curl/docs/cmdline-opts/list-only.md +++ b/deps/curl/docs/cmdline-opts/list-only.md @@ -3,10 +3,10 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: list-only Short: l -Protocols: FTP POP3 SFTP +Protocols: FTP POP3 SFTP FILE Help: List only mode Added: 4.0 -Category: ftp pop3 sftp +Category: ftp pop3 sftp file Multi: boolean See-also: - quote @@ -17,27 +17,27 @@ Example: # `--list-only` -(FTP) -When listing an FTP directory, this switch forces a name-only view. This is -especially useful if the user wants to machine-parse the contents of an FTP -directory since the normal directory view does not use a standard look or -format. When used like this, the option causes an NLST command to be sent to -the server instead of LIST. +When listing an FTP directory, force a name-only view. Maybe particularly +useful if the user wants to machine-parse the contents of an FTP directory +since the normal directory view does not use a standard look or format. When +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. -(SFTP) 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 contents of an SFTP directory since the normal directory view provides more information than just filenames. -(POP3) When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message-id exists on the server and what size it is. +For FILE, this option has no effect yet as directories are always listed in +this mode. + Note: When combined with --request, this option can be used to send a UIDL command instead, so the user may use the email's unique identifier rather than its message-id to make the request. diff --git a/deps/curl/docs/cmdline-opts/local-port.md b/deps/curl/docs/cmdline-opts/local-port.md index ef01a7c0..b8c0d3fd 100644 --- a/deps/curl/docs/cmdline-opts/local-port.md +++ b/deps/curl/docs/cmdline-opts/local-port.md @@ -2,8 +2,8 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: local-port -Arg: -Help: Force use of RANGE for local port numbers +Arg: +Help: Use a local port number within RANGE Added: 7.15.2 Category: connection Multi: single diff --git a/deps/curl/docs/cmdline-opts/location-trusted.md b/deps/curl/docs/cmdline-opts/location-trusted.md index 050cd9db..06458a46 100644 --- a/deps/curl/docs/cmdline-opts/location-trusted.md +++ b/deps/curl/docs/cmdline-opts/location-trusted.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: location-trusted -Help: Like --location, and send auth to other hosts +Help: As --location, but send secrets to other hosts Protocols: HTTP Category: http auth Added: 7.10.4 @@ -11,11 +11,16 @@ See-also: - user Example: - --location-trusted -u user:password $URL + - --location-trusted -H "Cookie: session=abc" $URL --- # `--location-trusted` -Like --location, but allows sending the name + password to all hosts that the -site may redirect to. This may or may not introduce a security breach if the -site redirects you to a site to which you send your authentication info -(which is clear-text in the case of HTTP Basic authentication). +Instructs curl to like --location follow HTTP redirects, but permits it to +send credentials and other secrets along to other hosts than the initial one. + +This may or may not introduce a security breach if the site redirects you to a +site to which you send this sensitive data to. Another host means that one or +more of hostname, protocol scheme or port number changed. + +This option also allows curl to pass long cookies set explicitly with --header. diff --git a/deps/curl/docs/cmdline-opts/location.md b/deps/curl/docs/cmdline-opts/location.md index 62e3d470..dbdcd5bd 100644 --- a/deps/curl/docs/cmdline-opts/location.md +++ b/deps/curl/docs/cmdline-opts/location.md @@ -20,11 +20,12 @@ Example: If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option makes curl redo the request on the new place. If used together with ---include or --head, headers from all requested pages are shown. +--show-headers or --head, headers from all requested pages are shown. -When authentication is used, curl only sends its credentials to the initial -host. If a redirect takes curl to a different host, it does not get the -user+password pass on. See also --location-trusted on how to change this. +When authentication is used, or send cookie with `-H Cookie:`, curl only sends +its credentials to the initial host. If a redirect takes curl to a different +host, it does not get the credentials pass on. See --location-trusted on how +to change this. Limit the amount of redirects to follow by using the --max-redirs option. diff --git a/deps/curl/docs/cmdline-opts/login-options.md b/deps/curl/docs/cmdline-opts/login-options.md index fdeeda52..fc8292a2 100644 --- a/deps/curl/docs/cmdline-opts/login-options.md +++ b/deps/curl/docs/cmdline-opts/login-options.md @@ -6,7 +6,7 @@ Arg: Protocols: IMAP LDAP POP3 SMTP Help: Server login options Added: 7.34.0 -Category: imap pop3 smtp auth +Category: imap pop3 smtp auth ldap Multi: single See-also: - user diff --git a/deps/curl/docs/cmdline-opts/mail-auth.md b/deps/curl/docs/cmdline-opts/mail-auth.md index 3692c159..deabb38b 100644 --- a/deps/curl/docs/cmdline-opts/mail-auth.md +++ b/deps/curl/docs/cmdline-opts/mail-auth.md @@ -12,7 +12,7 @@ See-also: - mail-rcpt - mail-from Example: - - --mail-auth user@example.come -T mail smtp://example.com/ + - --mail-auth user@example.com -T mail smtp://example.com/ --- # `--mail-auth` diff --git a/deps/curl/docs/cmdline-opts/mail-rcpt-allowfails.md b/deps/curl/docs/cmdline-opts/mail-rcpt-allowfails.md index 1b670adb..a82948bb 100644 --- a/deps/curl/docs/cmdline-opts/mail-rcpt-allowfails.md +++ b/deps/curl/docs/cmdline-opts/mail-rcpt-allowfails.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: mail-rcpt-allowfails -Help: Allow RCPT TO command to fail for some recipients +Help: Allow RCPT TO command to fail Protocols: SMTP Added: 7.69.0 Category: smtp diff --git a/deps/curl/docs/cmdline-opts/max-filesize.md b/deps/curl/docs/cmdline-opts/max-filesize.md index 998359cf..cf2ac653 100644 --- a/deps/curl/docs/cmdline-opts/max-filesize.md +++ b/deps/curl/docs/cmdline-opts/max-filesize.md @@ -16,9 +16,11 @@ Example: # `--max-filesize` -Specify the maximum size (in bytes) of a file to download. If the file -requested is larger than this value, the transfer does not start and curl -returns with exit code 63. +When set to a non-zero value, it specifies the maximum size (in bytes) of a +file to download. If the file requested is larger than this value, the +transfer does not start and curl returns with exit code 63. + +Setting the maximum value to zero disables the limit. A size modifier may be used. For example, Appending 'k' or 'K' counts the number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it diff --git a/deps/curl/docs/cmdline-opts/max-time.md b/deps/curl/docs/cmdline-opts/max-time.md index ad8bdedc..dd5fb23a 100644 --- a/deps/curl/docs/cmdline-opts/max-time.md +++ b/deps/curl/docs/cmdline-opts/max-time.md @@ -3,9 +3,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: max-time Short: m -Arg: +Arg: Help: Maximum time allowed for transfer -Category: connection +Category: connection timeout Added: 4.0 Multi: single See-also: @@ -18,13 +18,13 @@ Example: # `--max-time` -Maximum time in seconds that you allow each transfer to take. This is useful -for preventing your batch jobs from hanging for hours due to slow networks or -links going down. This option accepts decimal values (added in 7.32.0). +Set maximum time in seconds that you allow each transfer to take. Prevents +your batch jobs from hanging for hours due to slow networks or links going +down. This option accepts decimal values (added in 7.32.0). If you enable retrying the transfer (--retry) then the maximum time counter is reset each time the transfer is retried. You can use --retry-max-time to limit the retry time. -The decimal value needs to provided using a dot (.) as decimal separator - not -the local version even if it might be using another separator. +The decimal value needs to be provided using a dot (.) as decimal separator - +not the local version even if it might be using another separator. diff --git a/deps/curl/docs/cmdline-opts/metalink.md b/deps/curl/docs/cmdline-opts/metalink.md index 0c39b46e..d3d3e257 100644 --- a/deps/curl/docs/cmdline-opts/metalink.md +++ b/deps/curl/docs/cmdline-opts/metalink.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: metalink Help: Process given URLs as metalink XML file Added: 7.27.0 -Category: misc +Category: deprecated Multi: single See-also: - parallel diff --git a/deps/curl/docs/cmdline-opts/mptcp.md b/deps/curl/docs/cmdline-opts/mptcp.md new file mode 100644 index 00000000..698b6937 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/mptcp.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Dorian Craps, +SPDX-License-Identifier: curl +Long: mptcp +Added: 8.9.0 +Help: Enable Multipath TCP +Category: connection +Multi: boolean +See-also: + - tcp-fastopen +Example: + - --mptcp $URL +--- + +# `--mptcp` + +Enables the use of Multipath TCP (MPTCP) for connections. MPTCP is an extension +to the standard TCP that allows multiple TCP streams over different network +paths between the same source and destination. This can enhance bandwidth and +improve reliability by using multiple paths simultaneously. + +MPTCP is beneficial in networks where multiple paths exist between clients and +servers, such as mobile networks where a device may switch between WiFi and +cellular data or in wired networks with multiple Internet Service Providers. + +This option is currently only supported on Linux starting from kernel 5.6. Only +TCP connections are modified, hence this option does not effect HTTP/3 (QUIC) +or UDP connections. + +The server curl connects to must also support MPTCP. If not, the connection +seamlessly falls back to TCP. diff --git a/deps/curl/docs/cmdline-opts/negotiate.md b/deps/curl/docs/cmdline-opts/negotiate.md index 8f30888a..bba3f6a0 100644 --- a/deps/curl/docs/cmdline-opts/negotiate.md +++ b/deps/curl/docs/cmdline-opts/negotiate.md @@ -18,7 +18,7 @@ Example: # `--negotiate` -Enables Negotiate (SPNEGO) authentication. +Enable Negotiate (SPNEGO) authentication. This option requires a library built with GSS-API or SSPI support. Use --version to see if your curl supports GSS-API/SSPI or SPNEGO. diff --git a/deps/curl/docs/cmdline-opts/netrc-file.md b/deps/curl/docs/cmdline-opts/netrc-file.md index e37020ea..3df72ce1 100644 --- a/deps/curl/docs/cmdline-opts/netrc-file.md +++ b/deps/curl/docs/cmdline-opts/netrc-file.md @@ -6,7 +6,7 @@ Help: Specify FILE for netrc Arg: Added: 7.21.5 Mutexed: netrc -Category: curl +Category: auth Multi: single See-also: - netrc @@ -18,8 +18,7 @@ Example: # `--netrc-file` -This option is similar to --netrc, except that you provide the path (absolute -or relative) to the netrc file that curl should use. You can only specify one -netrc file per invocation. +Set the netrc file to use. Similar to --netrc, except that you also provide +the path (absolute or relative). It abides by --netrc-optional if specified. diff --git a/deps/curl/docs/cmdline-opts/netrc-optional.md b/deps/curl/docs/cmdline-opts/netrc-optional.md index 6aa76954..9b9c068c 100644 --- a/deps/curl/docs/cmdline-opts/netrc-optional.md +++ b/deps/curl/docs/cmdline-opts/netrc-optional.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: netrc-optional Help: Use either .netrc or URL Mutexed: netrc -Category: curl +Category: auth Added: 7.9.8 Multi: boolean See-also: diff --git a/deps/curl/docs/cmdline-opts/netrc.md b/deps/curl/docs/cmdline-opts/netrc.md index b8b1b943..26e1ccd2 100644 --- a/deps/curl/docs/cmdline-opts/netrc.md +++ b/deps/curl/docs/cmdline-opts/netrc.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: netrc Short: n Help: Must read .netrc for username and password -Category: curl +Category: auth Added: 4.6 Mutexed: netrc-file netrc-optional Multi: boolean @@ -18,7 +18,7 @@ Example: # `--netrc` -Makes curl scan the *.netrc* file in the user's home directory for login name +Make curl scan the *.netrc* file in the user's home directory for login name and password. This is typically used for FTP on Unix. If used with HTTP, curl enables user authentication. See *netrc(5)* and *ftp(1)* for details on the file format. Curl does not complain if that file does not have the right diff --git a/deps/curl/docs/cmdline-opts/next.md b/deps/curl/docs/cmdline-opts/next.md index 2f484f4c..cb67e907 100644 --- a/deps/curl/docs/cmdline-opts/next.md +++ b/deps/curl/docs/cmdline-opts/next.md @@ -7,7 +7,7 @@ Tags: Protocols: Added: 7.36.0 Magic: divider -Help: Make next URL use its separate set of options +Help: Make next URL use separate options Category: curl Multi: append See-also: @@ -20,10 +20,9 @@ Example: # `--next` -Tells curl to use a separate operation for the following URL and associated -options. This allows you to send several URL requests, each with their own -specific options, for example, such as different usernames or custom requests -for each. +Use a separate operation for the following URL and associated options. This +allows you to send several URL requests, each with their own specific options, +for example, such as different usernames or custom requests for each. --next resets all local options and only global ones have their values survive over to the operation following the --next instruction. Global options include diff --git a/deps/curl/docs/cmdline-opts/no-buffer.md b/deps/curl/docs/cmdline-opts/no-buffer.md index 41328b16..e0860155 100644 --- a/deps/curl/docs/cmdline-opts/no-buffer.md +++ b/deps/curl/docs/cmdline-opts/no-buffer.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: no-buffer Short: N Help: Disable buffering of the output stream -Category: curl +Category: output Added: 6.5 Multi: boolean See-also: diff --git a/deps/curl/docs/cmdline-opts/no-clobber.md b/deps/curl/docs/cmdline-opts/no-clobber.md index 58646224..69090056 100644 --- a/deps/curl/docs/cmdline-opts/no-clobber.md +++ b/deps/curl/docs/cmdline-opts/no-clobber.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: no-clobber Help: Do not overwrite files that already exist -Category: curl output +Category: output Added: 7.83.0 Multi: boolean See-also: diff --git a/deps/curl/docs/cmdline-opts/no-keepalive.md b/deps/curl/docs/cmdline-opts/no-keepalive.md index 1829e8c4..2c2115fe 100644 --- a/deps/curl/docs/cmdline-opts/no-keepalive.md +++ b/deps/curl/docs/cmdline-opts/no-keepalive.md @@ -8,6 +8,7 @@ Added: 7.18.0 Multi: boolean See-also: - keepalive-time + - keepalive-cnt Example: - --no-keepalive $URL --- diff --git a/deps/curl/docs/cmdline-opts/no-npn.md b/deps/curl/docs/cmdline-opts/no-npn.md index d8ad6a25..dbb69e91 100644 --- a/deps/curl/docs/cmdline-opts/no-npn.md +++ b/deps/curl/docs/cmdline-opts/no-npn.md @@ -8,7 +8,7 @@ Added: 7.36.0 Mutexed: Requires: TLS Help: Disable the NPN TLS extension -Category: tls http +Category: deprecated Multi: boolean See-also: - no-alpn diff --git a/deps/curl/docs/cmdline-opts/ntlm-wb.md b/deps/curl/docs/cmdline-opts/ntlm-wb.md index bc75dda5..3a1d35cb 100644 --- a/deps/curl/docs/cmdline-opts/ntlm-wb.md +++ b/deps/curl/docs/cmdline-opts/ntlm-wb.md @@ -2,9 +2,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ntlm-wb -Help: Use HTTP NTLM authentication with winbind +Help: HTTP NTLM authentication with winbind Protocols: HTTP -Category: auth http +Category: deprecated Added: 7.22.0 Multi: mutex See-also: @@ -16,5 +16,7 @@ Example: # `--ntlm-wb` -Enables NTLM much in the style --ntlm does, but hand over the authentication -to the separate binary `ntlmauth` application that is executed when needed. +Deprecated option (added in 8.8.0). + +Enabled NTLM much in the style --ntlm does, but handed over the authentication +to a separate executable that was executed when needed. diff --git a/deps/curl/docs/cmdline-opts/ntlm.md b/deps/curl/docs/cmdline-opts/ntlm.md index c0a58a63..b37716bc 100644 --- a/deps/curl/docs/cmdline-opts/ntlm.md +++ b/deps/curl/docs/cmdline-opts/ntlm.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ntlm -Help: Use HTTP NTLM authentication +Help: HTTP NTLM authentication Mutexed: basic negotiate digest anyauth Protocols: HTTP Requires: TLS @@ -17,7 +17,7 @@ Example: # `--ntlm` -Enables NTLM authentication. The NTLM authentication method was designed by +Use NTLM authentication. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage diff --git a/deps/curl/docs/cmdline-opts/oauth2-bearer.md b/deps/curl/docs/cmdline-opts/oauth2-bearer.md index ee9ec5dc..b66477fc 100644 --- a/deps/curl/docs/cmdline-opts/oauth2-bearer.md +++ b/deps/curl/docs/cmdline-opts/oauth2-bearer.md @@ -5,7 +5,7 @@ Long: oauth2-bearer Help: OAuth 2 Bearer Token Arg: Protocols: IMAP LDAP POP3 SMTP HTTP -Category: auth +Category: auth imap pop3 smtp ldap Added: 7.33.0 Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/output-dir.md b/deps/curl/docs/cmdline-opts/output-dir.md index 9f494d87..468ecc8a 100644 --- a/deps/curl/docs/cmdline-opts/output-dir.md +++ b/deps/curl/docs/cmdline-opts/output-dir.md @@ -5,7 +5,7 @@ Long: output-dir Arg: Help: Directory to save files in Added: 7.73.0 -Category: curl +Category: output Multi: single See-also: - remote-name @@ -16,8 +16,8 @@ Example: # `--output-dir` -This option specifies the directory in which files should be stored, when ---remote-name or --output are used. +Specify the directory in which files should be stored, when --remote-name or +--output are used. The given output directory is used for all URLs and output options on the command line, up until the first --next. diff --git a/deps/curl/docs/cmdline-opts/output.md b/deps/curl/docs/cmdline-opts/output.md index f7beaba6..48360a49 100644 --- a/deps/curl/docs/cmdline-opts/output.md +++ b/deps/curl/docs/cmdline-opts/output.md @@ -5,9 +5,9 @@ Long: output Arg: Short: o Help: Write to file instead of stdout -Category: important curl +Category: important output Added: 4.0 -Multi: append +Multi: per-URL See-also: - remote-name - remote-name-all @@ -55,3 +55,8 @@ To suppress response bodies, you can redirect output to /dev/null: Or for Windows: curl example.com -o nul + +Specify the filename as single minus to force the output to stdout, to +override curl's internal binary output in terminal prevention: + + curl https://example.com/jpeg -o - diff --git a/deps/curl/docs/cmdline-opts/parallel-immediate.md b/deps/curl/docs/cmdline-opts/parallel-immediate.md index f93a355f..4d7a3ad5 100644 --- a/deps/curl/docs/cmdline-opts/parallel-immediate.md +++ b/deps/curl/docs/cmdline-opts/parallel-immediate.md @@ -2,9 +2,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: parallel-immediate -Help: Do not wait for multiplexing (with --parallel) +Help: Do not wait for multiplexing Added: 7.68.0 -Category: connection curl +Category: connection curl global Multi: boolean Scope: global See-also: @@ -16,7 +16,10 @@ Example: # `--parallel-immediate` -When doing parallel transfers, this option instructs curl that it should -rather prefer opening up more connections in parallel at once rather than -waiting to see if new transfers can be added as multiplexed streams on another -connection. +When doing parallel transfers, this option instructs curl to prefer opening up +more connections in parallel at once rather than waiting to see if new +transfers can be added as multiplexed streams on another connection. + +By default, without this option set, curl prefers to wait a little and +multiplex new transfers over existing connections. It keeps the number of +connections low at the expense of risking a slightly slower transfer startup. diff --git a/deps/curl/docs/cmdline-opts/parallel-max.md b/deps/curl/docs/cmdline-opts/parallel-max.md index f3d2ad19..6b3684b8 100644 --- a/deps/curl/docs/cmdline-opts/parallel-max.md +++ b/deps/curl/docs/cmdline-opts/parallel-max.md @@ -5,8 +5,9 @@ Long: parallel-max Arg: Help: Maximum concurrency for parallel transfers Added: 7.66.0 -Category: connection curl +Category: connection curl global Multi: single +Scope: global See-also: - parallel Example: @@ -18,7 +19,4 @@ Example: When asked to do parallel transfers, using --parallel, this option controls the maximum amount of transfers to do simultaneously. -This option is global and does not need to be specified for each use of ---next. - -The default is 50. +The default is 50. 300 is the largest supported value. diff --git a/deps/curl/docs/cmdline-opts/parallel.md b/deps/curl/docs/cmdline-opts/parallel.md index f67598a0..fb9221bc 100644 --- a/deps/curl/docs/cmdline-opts/parallel.md +++ b/deps/curl/docs/cmdline-opts/parallel.md @@ -5,17 +5,28 @@ Short: Z Long: parallel Help: Perform transfers in parallel Added: 7.66.0 -Category: connection curl +Category: connection curl global Multi: boolean Scope: global See-also: - next - verbose + - parallel-max + - parallel-immediate Example: - --parallel $URL -o file1 $URL -o file2 --- # `--parallel` -Makes curl perform its transfers in parallel as compared to the regular serial -manner. +Makes curl perform all transfers in parallel as compared to the regular serial +manner. Parallel transfer means that curl runs up to N concurrent transfers +simultaneously and if there are more than N transfers to handle, it starts new +ones when earlier transfers finish. + +With parallel transfers, the progress meter output is different than when +doing serial transfers, as it then displays the transfer status for multiple +transfers in a single line. + +The maximum amount of concurrent transfers is set with --parallel-max and it +defaults to 50. diff --git a/deps/curl/docs/cmdline-opts/pass.md b/deps/curl/docs/cmdline-opts/pass.md index a0d94563..98bc35b2 100644 --- a/deps/curl/docs/cmdline-opts/pass.md +++ b/deps/curl/docs/cmdline-opts/pass.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: pass Arg: -Help: Pass phrase for the private key +Help: Passphrase for the private key Protocols: SSH TLS Category: ssh tls auth Added: 7.9.3 diff --git a/deps/curl/docs/cmdline-opts/path-as-is.md b/deps/curl/docs/cmdline-opts/path-as-is.md index 768faa50..f3a60cff 100644 --- a/deps/curl/docs/cmdline-opts/path-as-is.md +++ b/deps/curl/docs/cmdline-opts/path-as-is.md @@ -14,6 +14,6 @@ Example: # `--path-as-is` -Tell curl to not handle sequences of /../ or /./ in the given URL -path. Normally curl squashes or merges them according to standards but with -this option set you tell it not to do that. +Do not handle sequences of /../ or /./ in the given URL path. Normally curl +squashes or merges them according to standards but with this option set you +tell it not to do that. diff --git a/deps/curl/docs/cmdline-opts/pinnedpubkey.md b/deps/curl/docs/cmdline-opts/pinnedpubkey.md index cdbd31dc..d21a18f6 100644 --- a/deps/curl/docs/cmdline-opts/pinnedpubkey.md +++ b/deps/curl/docs/cmdline-opts/pinnedpubkey.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: pinnedpubkey Arg: -Help: FILE/HASHES Public key to verify peer against +Help: Public key to verify peer against Protocols: TLS Category: tls Added: 7.39.0 @@ -17,10 +17,10 @@ Example: # `--pinnedpubkey` -Tells curl to use the specified public key file (or hashes) to verify the -peer. This can be a path to a file which contains a single public key in PEM -or DER format, or any number of base64 encoded sha256 hashes preceded by -'sha256//' and separated by ';'. +Use the specified public key file (or hashes) to verify the peer. This can be +a path to a file which contains a single public key in PEM or DER format, or +any number of base64 encoded sha256 hashes preceded by 'sha256//' and +separated by ';'. When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and @@ -33,12 +33,13 @@ together then the peer is still verified by public key. PEM/DER support: OpenSSL and GnuTLS (added in 7.39.0), wolfSSL (added in 7.43.0), mbedTLS -(added in 7.47.0), Secure Transport macOS 10.7+/iOS 10+ (7.54.1), Schannel -(7.58.1) +(added in 7.47.0), Secure Transport macOS 10.7+/iOS 10+ (added in 7.54.1), +Schannel (added in 7.58.1) sha256 support: OpenSSL, GnuTLS and wolfSSL (added in 7.44.0), mbedTLS (added in 7.47.0), -Secure Transport macOS 10.7+/iOS 10+ (7.54.1), Schannel (7.58.1) +Secure Transport macOS 10.7+/iOS 10+ (added in 7.54.1), Schannel +(added in 7.58.1) Other SSL backends not supported. diff --git a/deps/curl/docs/cmdline-opts/post301.md b/deps/curl/docs/cmdline-opts/post301.md index 5a7ce063..d9506f7d 100644 --- a/deps/curl/docs/cmdline-opts/post301.md +++ b/deps/curl/docs/cmdline-opts/post301.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: post301 -Help: Do not switch to GET after following a 301 +Help: Do not switch to GET after a 301 redirect Protocols: HTTP Added: 7.17.1 Category: http post @@ -17,8 +17,8 @@ Example: # `--post301` -Tells curl to respect RFC 7231/6.4.2 and not convert POST requests into GET -requests when following a 301 redirection. The non-RFC behavior is ubiquitous -in web browsers, so curl does the conversion by default to maintain -consistency. However, a server may require a POST to remain a POST after such -a redirection. This option is meaningful only when using --location. +Respect RFC 7231/6.4.2 and do not convert POST requests into GET requests when +following a 301 redirect. The non-RFC behavior is ubiquitous in web browsers, +so curl does the conversion by default to maintain consistency. However, a +server may require a POST to remain a POST after such a redirection. This +option is meaningful only when using --location. diff --git a/deps/curl/docs/cmdline-opts/post302.md b/deps/curl/docs/cmdline-opts/post302.md index 7eefc0cd..9b2c2f65 100644 --- a/deps/curl/docs/cmdline-opts/post302.md +++ b/deps/curl/docs/cmdline-opts/post302.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: post302 -Help: Do not switch to GET after following a 302 +Help: Do not switch to GET after a 302 redirect Protocols: HTTP Added: 7.19.1 Category: http post @@ -17,8 +17,8 @@ Example: # `--post302` -Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET -requests when following a 302 redirection. The non-RFC behavior is ubiquitous -in web browsers, so curl does the conversion by default to maintain -consistency. However, a server may require a POST to remain a POST after such -a redirection. This option is meaningful only when using --location. +Respect RFC 7231/6.4.3 and do not convert POST requests into GET requests when +following a 302 redirect. The non-RFC behavior is ubiquitous in web browsers, +so curl does the conversion by default to maintain consistency. However, a +server may require a POST to remain a POST after such a redirection. This +option is meaningful only when using --location. diff --git a/deps/curl/docs/cmdline-opts/post303.md b/deps/curl/docs/cmdline-opts/post303.md index 4ea749c2..63dc0d79 100644 --- a/deps/curl/docs/cmdline-opts/post303.md +++ b/deps/curl/docs/cmdline-opts/post303.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: post303 -Help: Do not switch to GET after following a 303 +Help: Do not switch to GET after a 303 redirect Protocols: HTTP Added: 7.26.0 Category: http post @@ -17,7 +17,6 @@ Example: # `--post303` -Tells curl to violate RFC 7231/6.4.4 and not convert POST requests into GET -requests when following 303 redirections. A server may require a POST to -remain a POST after a 303 redirection. This option is meaningful only when -using --location. +Violate RFC 7231/6.4.4 and do not convert POST requests into GET requests when +following 303 redirect. A server may require a POST to remain a POST after a +303 redirection. This option is meaningful only when using --location. diff --git a/deps/curl/docs/cmdline-opts/progress-bar.md b/deps/curl/docs/cmdline-opts/progress-bar.md index 7b9c599b..6f08d7f7 100644 --- a/deps/curl/docs/cmdline-opts/progress-bar.md +++ b/deps/curl/docs/cmdline-opts/progress-bar.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Short: # Long: progress-bar Help: Display transfer progress as a bar -Category: verbose +Category: verbose global Added: 5.10 Multi: boolean Scope: global diff --git a/deps/curl/docs/cmdline-opts/proto-default.md b/deps/curl/docs/cmdline-opts/proto-default.md index 38d9dffe..209e5cdc 100644 --- a/deps/curl/docs/cmdline-opts/proto-default.md +++ b/deps/curl/docs/cmdline-opts/proto-default.md @@ -16,10 +16,9 @@ Example: # `--proto-default` -Tells curl to use *protocol* for any URL missing a scheme name. +Use *protocol* for any provided URL missing a scheme. -An unknown or unsupported protocol causes error -*CURLE_UNSUPPORTED_PROTOCOL* (1). +An unknown or unsupported protocol causes error *CURLE_UNSUPPORTED_PROTOCOL*. This option does not change the default proxy protocol (http). diff --git a/deps/curl/docs/cmdline-opts/proto-redir.md b/deps/curl/docs/cmdline-opts/proto-redir.md index f0a307a1..9332f3f0 100644 --- a/deps/curl/docs/cmdline-opts/proto-redir.md +++ b/deps/curl/docs/cmdline-opts/proto-redir.md @@ -15,14 +15,13 @@ Example: # `--proto-redir` -Tells curl to limit what protocols it may use on redirect. Protocols denied by ---proto are not overridden by this option. See --proto for how protocols are -represented. +Limit what protocols to allow on redirects. Protocols denied by --proto are +not overridden by this option. See --proto for how protocols are represented. Example, allow only HTTP and HTTPS on redirect: curl --proto-redir -all,http,https http://example.com -By default curl only allows HTTP, HTTPS, FTP and FTPS on redirects (added in -7.65.2). Specifying *all* or *+all* enables all protocols on redirects, which -is not good for security. +By default curl only allows HTTP, HTTPS, FTP and FTPS on redirects +(added in 7.65.2). Specifying *all* or *+all* enables all protocols on +redirects, which is not good for security. diff --git a/deps/curl/docs/cmdline-opts/proto.md b/deps/curl/docs/cmdline-opts/proto.md index a7045544..704c6493 100644 --- a/deps/curl/docs/cmdline-opts/proto.md +++ b/deps/curl/docs/cmdline-opts/proto.md @@ -16,9 +16,9 @@ Example: # `--proto` -Tells curl to limit what protocols it may use 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: +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 diff --git a/deps/curl/docs/cmdline-opts/proxy-anyauth.md b/deps/curl/docs/cmdline-opts/proxy-anyauth.md index dcb3952e..78e67ee7 100644 --- a/deps/curl/docs/cmdline-opts/proxy-anyauth.md +++ b/deps/curl/docs/cmdline-opts/proxy-anyauth.md @@ -16,5 +16,5 @@ Example: # `--proxy-anyauth` -Tells curl to pick a suitable authentication method when communicating with +Automatically pick a suitable authentication method when communicating with the given HTTP proxy. This might cause an extra request/response round-trip. diff --git a/deps/curl/docs/cmdline-opts/proxy-basic.md b/deps/curl/docs/cmdline-opts/proxy-basic.md index 4262a74f..2fae3d5b 100644 --- a/deps/curl/docs/cmdline-opts/proxy-basic.md +++ b/deps/curl/docs/cmdline-opts/proxy-basic.md @@ -16,6 +16,6 @@ Example: # `--proxy-basic` -Tells curl to use HTTP Basic authentication when communicating with the given -proxy. Use --basic for enabling HTTP Basic with a remote host. Basic is the -default authentication method curl uses with proxies. +Use HTTP Basic authentication when communicating with the given proxy. Use +--basic for enabling HTTP Basic with a remote host. Basic is the default +authentication method curl uses with proxies. diff --git a/deps/curl/docs/cmdline-opts/proxy-ca-native.md b/deps/curl/docs/cmdline-opts/proxy-ca-native.md index 071d04f9..e84dbd96 100644 --- a/deps/curl/docs/cmdline-opts/proxy-ca-native.md +++ b/deps/curl/docs/cmdline-opts/proxy-ca-native.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-ca-native -Help: Use CA certificates from the native OS for proxy +Help: Load CA certs from the OS to verify proxy Protocols: TLS Category: tls Added: 8.2.0 @@ -10,17 +10,17 @@ Multi: boolean See-also: - cacert - capath + - dump-ca-embed - insecure Example: - - --ca-native $URL + - --proxy-ca-native $URL --- # `--proxy-ca-native` -Tells curl to use the CA store from the native operating system to verify the -HTTPS proxy. By default, curl uses a CA store provided in a single file or -directory, but when using this option it interfaces the operating system's own -vault. +Use the CA store from the native operating system to verify the HTTPS proxy. +By default, curl uses a CA store provided in a single file or directory, but +when using this option it interfaces the operating system's own vault. This option works for curl on Windows when built to use OpenSSL, wolfSSL (added in 8.3.0) or GnuTLS (added in 8.5.0). When curl on Windows is built to diff --git a/deps/curl/docs/cmdline-opts/proxy-cacert.md b/deps/curl/docs/cmdline-opts/proxy-cacert.md index b3a038a5..682349a7 100644 --- a/deps/curl/docs/cmdline-opts/proxy-cacert.md +++ b/deps/curl/docs/cmdline-opts/proxy-cacert.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-cacert -Help: CA certificate to verify peer against for proxy +Help: CA certificates to verify proxy against Arg: Added: 7.52.0 Category: proxy tls @@ -11,6 +11,7 @@ See-also: - proxy-capath - cacert - capath + - dump-ca-embed - proxy Example: - --proxy-cacert CA-file.txt -x https://proxy $URL @@ -18,4 +19,10 @@ Example: # `--proxy-cacert` -Same as --cacert but used in HTTPS proxy context. +Use the specified certificate file to verify the HTTPS proxy. The file may +contain multiple CA certificates. The certificate(s) must be in PEM format. + +This allows you to use a different trust for the proxy compared to the remote +server connected to via the proxy. + +Equivalent to --cacert but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-capath.md b/deps/curl/docs/cmdline-opts/proxy-capath.md index 62a25a0d..3a3aabf1 100644 --- a/deps/curl/docs/cmdline-opts/proxy-capath.md +++ b/deps/curl/docs/cmdline-opts/proxy-capath.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-capath -Help: CA directory to verify peer against for proxy +Help: CA directory to verify proxy against Arg: Added: 7.52.0 Category: proxy tls @@ -11,6 +11,7 @@ See-also: - proxy-cacert - proxy - capath + - dump-ca-embed Example: - --proxy-capath /local/directory -x https://proxy $URL --- @@ -18,3 +19,13 @@ Example: # `--proxy-capath` Same as --capath but used in HTTPS proxy context. + +Use the specified certificate directory to verify the proxy. Multiple paths +can be provided by separated with colon (`:`) (e.g. `path1:path2:path3`). The +certificates must be in PEM format, and if curl is built against OpenSSL, the +directory must have been processed using the c_rehash utility supplied with +OpenSSL. Using --proxy-capath can allow OpenSSL-powered curl to make +SSL-connections much more efficiently than using --proxy-cacert if the +--proxy-cacert file contains many CA certificates. + +If this option is set, the default capath value is ignored. diff --git a/deps/curl/docs/cmdline-opts/proxy-cert-type.md b/deps/curl/docs/cmdline-opts/proxy-cert-type.md index 3f46bb61..c2e8ed1e 100644 --- a/deps/curl/docs/cmdline-opts/proxy-cert-type.md +++ b/deps/curl/docs/cmdline-opts/proxy-cert-type.md @@ -9,10 +9,18 @@ Category: proxy tls Multi: single See-also: - proxy-cert + - proxy-key Example: - --proxy-cert-type PEM --proxy-cert file -x https://proxy $URL --- # `--proxy-cert-type` -Same as --cert-type but used in HTTPS proxy context. +Set type of the provided client certificate when using HTTPS proxy. PEM, DER, +ENG and P12 are recognized types. + +The default type depends on the TLS backend and is usually PEM, however for +Secure Transport and Schannel it is P12. If --proxy-cert is a pkcs11: URI then +ENG is the default type. + +Equivalent to --cert-type but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-cert.md b/deps/curl/docs/cmdline-opts/proxy-cert.md index 3068f3cd..a588329d 100644 --- a/deps/curl/docs/cmdline-opts/proxy-cert.md +++ b/deps/curl/docs/cmdline-opts/proxy-cert.md @@ -8,6 +8,8 @@ Added: 7.52.0 Category: proxy tls Multi: single See-also: + - proxy + - proxy-key - proxy-cert-type Example: - --proxy-cert file -x https://proxy $URL @@ -15,4 +17,10 @@ Example: # `--proxy-cert` -Same as --cert but used in HTTPS proxy context. +Use the specified client certificate file when communicating with an HTTPS +proxy. The certificate must be in PKCS#12 format if using Secure Transport, or +PEM format if using any other engine. If the optional password is not +specified, it is queried for on the terminal. Use --proxy-key to provide the +private key. + +This option is the equivalent to --cert but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-ciphers.md b/deps/curl/docs/cmdline-opts/proxy-ciphers.md index 065d4495..420e7563 100644 --- a/deps/curl/docs/cmdline-opts/proxy-ciphers.md +++ b/deps/curl/docs/cmdline-opts/proxy-ciphers.md @@ -3,24 +3,25 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-ciphers Arg: -Help: SSL ciphers to use for proxy +Help: TLS 1.2 (1.1, 1.0) ciphers to use for proxy +Protocols: TLS Added: 7.52.0 Category: proxy tls Multi: single See-also: + - proxy-tls13-ciphers - ciphers - - curves - proxy Example: - - --proxy-ciphers ECDHE-ECDSA-AES256-CCM8 -x https://proxy $URL + - --proxy-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 -x https://proxy $URL --- # `--proxy-ciphers` Same as --ciphers but used in HTTPS proxy context. -Specifies which ciphers to use in the connection to the HTTPS proxy. The list -of ciphers must specify valid ciphers. Read up on SSL cipher list details on -this URL: +Specify which cipher suites to use in the connection to your HTTPS proxy when +it negotiates TLS 1.2 (1.1, 1.0). The list of ciphers suites must specify +valid ciphers. Read up on cipher suite details on this URL: https://curl.se/docs/ssl-ciphers.html diff --git a/deps/curl/docs/cmdline-opts/proxy-crlfile.md b/deps/curl/docs/cmdline-opts/proxy-crlfile.md index ab47fb0a..726e4495 100644 --- a/deps/curl/docs/cmdline-opts/proxy-crlfile.md +++ b/deps/curl/docs/cmdline-opts/proxy-crlfile.md @@ -16,4 +16,8 @@ Example: # `--proxy-crlfile` -Same as --crlfile but used in HTTPS proxy context. +Provide filename for a PEM formatted file with a Certificate Revocation List +that specifies peer certificates that are considered revoked when +communicating with an HTTPS proxy. + +Equivalent to --crlfile but only used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-digest.md b/deps/curl/docs/cmdline-opts/proxy-digest.md index 052b67b7..77b88d7e 100644 --- a/deps/curl/docs/cmdline-opts/proxy-digest.md +++ b/deps/curl/docs/cmdline-opts/proxy-digest.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-digest -Help: Use Digest authentication on the proxy +Help: Digest auth with the proxy Category: proxy tls Added: 7.12.0 Multi: mutex @@ -16,5 +16,5 @@ Example: # `--proxy-digest` -Tells curl to use HTTP Digest authentication when communicating with the given -proxy. Use --digest for enabling HTTP Digest with a remote host. +Use HTTP Digest authentication when communicating with the given proxy. Use +--digest for enabling HTTP Digest with a remote host. diff --git a/deps/curl/docs/cmdline-opts/proxy-http2.md b/deps/curl/docs/cmdline-opts/proxy-http2.md index a5745f08..ca6a091f 100644 --- a/deps/curl/docs/cmdline-opts/proxy-http2.md +++ b/deps/curl/docs/cmdline-opts/proxy-http2.md @@ -18,7 +18,7 @@ Example: # `--proxy-http2` -Tells curl to try negotiate HTTP version 2 with an HTTPS proxy. The proxy might -still only offer HTTP/1 and then curl sticks to using that version. +Negotiate HTTP/2 with an HTTPS proxy. The proxy might still only offer HTTP/1 +and then curl sticks to using that version. This has no effect for any other kinds of proxies. diff --git a/deps/curl/docs/cmdline-opts/proxy-insecure.md b/deps/curl/docs/cmdline-opts/proxy-insecure.md index 3e174428..5796c362 100644 --- a/deps/curl/docs/cmdline-opts/proxy-insecure.md +++ b/deps/curl/docs/cmdline-opts/proxy-insecure.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-insecure -Help: Do HTTPS proxy connections without verifying the proxy +Help: Skip HTTPS proxy cert verification Added: 7.52.0 Category: proxy tls Multi: boolean @@ -16,3 +16,15 @@ Example: # `--proxy-insecure` Same as --insecure but used in HTTPS proxy context. + +Every secure connection curl makes is verified to be secure before the +transfer takes place. This option makes curl skip the verification step with a +proxy and proceed without checking. + +When this option is not used for a proxy using HTTPS, curl verifies the +proxy's TLS certificate before it continues: that the certificate contains the +right name which matches the hostname and that the certificate has been signed +by a CA certificate present in the cert store. See this online resource for +further details: **https://curl.se/docs/sslcerts.html** + +**WARNING**: using this option makes the transfer to the proxy insecure. diff --git a/deps/curl/docs/cmdline-opts/proxy-key-type.md b/deps/curl/docs/cmdline-opts/proxy-key-type.md index 8740935b..587c13c5 100644 --- a/deps/curl/docs/cmdline-opts/proxy-key-type.md +++ b/deps/curl/docs/cmdline-opts/proxy-key-type.md @@ -16,4 +16,7 @@ Example: # `--proxy-key-type` -Same as --key-type but used in HTTPS proxy context. +Specify the private key file type your --proxy-key provided private key uses. +DER, PEM, and ENG are supported. If not specified, PEM is assumed. + +Equivalent to --key-type but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-key.md b/deps/curl/docs/cmdline-opts/proxy-key.md index cfe50784..7caa636e 100644 --- a/deps/curl/docs/cmdline-opts/proxy-key.md +++ b/deps/curl/docs/cmdline-opts/proxy-key.md @@ -16,4 +16,6 @@ Example: # `--proxy-key` -Same as --key but used in HTTPS proxy context. +Specify the filename for your private key when using client certificates with +your HTTPS proxy. This option is the equivalent to --key but used in HTTPS +proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-negotiate.md b/deps/curl/docs/cmdline-opts/proxy-negotiate.md index 98e0bd37..0285155c 100644 --- a/deps/curl/docs/cmdline-opts/proxy-negotiate.md +++ b/deps/curl/docs/cmdline-opts/proxy-negotiate.md @@ -2,19 +2,20 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-negotiate -Help: Use HTTP Negotiate (SPNEGO) authentication on the proxy +Help: HTTP Negotiate (SPNEGO) auth with the proxy Added: 7.17.1 Category: proxy auth Multi: mutex See-also: - proxy-anyauth - proxy-basic + - proxy-service-name Example: - --proxy-negotiate --proxy-user user:passwd -x proxy $URL --- # `--proxy-negotiate` -Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating -with the given proxy. Use --negotiate for enabling HTTP Negotiate (SPNEGO) -with a remote host. +Use HTTP Negotiate (SPNEGO) authentication when communicating with the given +proxy. Use --negotiate for enabling HTTP Negotiate (SPNEGO) with a remote +host. diff --git a/deps/curl/docs/cmdline-opts/proxy-ntlm.md b/deps/curl/docs/cmdline-opts/proxy-ntlm.md index b3394f07..e403f98e 100644 --- a/deps/curl/docs/cmdline-opts/proxy-ntlm.md +++ b/deps/curl/docs/cmdline-opts/proxy-ntlm.md @@ -2,18 +2,19 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-ntlm -Help: Use NTLM authentication on the proxy +Help: NTLM authentication with the proxy Category: proxy auth Added: 7.10.7 Multi: mutex See-also: - proxy-negotiate - proxy-anyauth + - proxy-user Example: - --proxy-ntlm --proxy-user user:passwd -x http://proxy $URL --- # `--proxy-ntlm` -Tells curl to use HTTP NTLM authentication when communicating with the given -proxy. Use --ntlm for enabling NTLM with a remote host. +Use HTTP NTLM authentication when communicating with the given proxy. Use +--ntlm for enabling NTLM with a remote host. diff --git a/deps/curl/docs/cmdline-opts/proxy-pass.md b/deps/curl/docs/cmdline-opts/proxy-pass.md index feba6e08..88cefd54 100644 --- a/deps/curl/docs/cmdline-opts/proxy-pass.md +++ b/deps/curl/docs/cmdline-opts/proxy-pass.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-pass Arg: -Help: Pass phrase for the private key for HTTPS proxy +Help: Passphrase for private key for HTTPS proxy Added: 7.52.0 Category: proxy tls auth Multi: single @@ -16,4 +16,6 @@ Example: # `--proxy-pass` -Same as --pass but used in HTTPS proxy context. +Passphrase for the private key for HTTPS proxy client certificate. + +Equivalent to --pass but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-pinnedpubkey.md b/deps/curl/docs/cmdline-opts/proxy-pinnedpubkey.md index edf68cb0..df0b0bb9 100644 --- a/deps/curl/docs/cmdline-opts/proxy-pinnedpubkey.md +++ b/deps/curl/docs/cmdline-opts/proxy-pinnedpubkey.md @@ -18,12 +18,14 @@ Example: # `--proxy-pinnedpubkey` -Tells curl to use the specified public key file (or hashes) to verify the -proxy. This can be a path to a file which contains a single public key in PEM -or DER format, or any number of base64 encoded sha256 hashes preceded by -'sha256//' and separated by ';'. +Use the specified public key file (or hashes) to verify the proxy. This can be +a path to a file which contains a single public key in PEM or DER format, or +any number of base64 encoded sha256 hashes preceded by 'sha256//' and +separated by ';'. When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, curl aborts the connection before sending or receiving any data. + +Before curl 8.10.0 this option did not work due to a bug. diff --git a/deps/curl/docs/cmdline-opts/proxy-service-name.md b/deps/curl/docs/cmdline-opts/proxy-service-name.md index f1ee2649..b3d665d8 100644 --- a/deps/curl/docs/cmdline-opts/proxy-service-name.md +++ b/deps/curl/docs/cmdline-opts/proxy-service-name.md @@ -10,10 +10,11 @@ Multi: single See-also: - service-name - proxy + - proxy-negotiate Example: - --proxy-service-name "shrubbery" -x proxy $URL --- # `--proxy-service-name` -This option allows you to change the service name for proxy negotiation. +Set the service name for SPNEGO when doing proxy authentication. diff --git a/deps/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md b/deps/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md index f2deedbb..089038de 100644 --- a/deps/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md +++ b/deps/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-ssl-allow-beast -Help: Allow security flaw for interop for HTTPS proxy +Help: Allow this security flaw for HTTPS proxy Added: 7.52.0 Category: proxy tls Multi: boolean @@ -15,4 +15,15 @@ Example: # `--proxy-ssl-allow-beast` -Same as --ssl-allow-beast but used in HTTPS proxy context. +Do not work around a security flaw in the TLS1.0 protocol known as BEAST when +communicating to an HTTPS proxy. If this option is not used, the TLS layer may +use workarounds known to cause interoperability problems with some older +server implementations. + +This option only changes how curl does TLS 1.0 with an HTTPS proxy and has no +effect on later TLS versions. + +**WARNING**: this option loosens the TLS security, and by using this flag you +ask for exactly that. + +Equivalent to --ssl-allow-beast but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md b/deps/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md index f3e77158..578a7a64 100644 --- a/deps/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md +++ b/deps/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-ssl-auto-client-cert -Help: Use auto client certificate for proxy (Schannel) +Help: Auto client certificate for proxy Added: 7.77.0 Category: proxy tls Multi: boolean @@ -16,3 +16,5 @@ Example: # `--proxy-ssl-auto-client-cert` Same as --ssl-auto-client-cert but used in HTTPS proxy context. + +This is only supported by Schannel. diff --git a/deps/curl/docs/cmdline-opts/proxy-tls13-ciphers.md b/deps/curl/docs/cmdline-opts/proxy-tls13-ciphers.md index c9202ae1..72bae4e7 100644 --- a/deps/curl/docs/cmdline-opts/proxy-tls13-ciphers.md +++ b/deps/curl/docs/cmdline-opts/proxy-tls13-ciphers.md @@ -2,28 +2,32 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-tls13-ciphers -Arg: +Arg: help: TLS 1.3 proxy cipher suites Protocols: TLS Category: proxy tls Added: 7.61.0 Multi: single See-also: - - tls13-ciphers - - curves - proxy-ciphers + - tls13-ciphers + - proxy Example: - --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy $URL --- # `--proxy-tls13-ciphers` -Specifies which cipher suites to use in the connection to your HTTPS proxy -when it negotiates TLS 1.3. The list of ciphers suites must specify valid -ciphers. Read up on TLS 1.3 cipher suite details on this URL: +Same as --tls13-ciphers but used in HTTPS proxy context. + +Specify which cipher suites to use in the connection to your HTTPS proxy when +it negotiates TLS 1.3. The list of ciphers suites must specify valid ciphers. +Read up on TLS 1.3 cipher suite details on this URL: https://curl.se/docs/ssl-ciphers.html -This option is currently used only when curl is built to use OpenSSL 1.1.1 or -later. If you are using a different SSL backend you can try setting TLS 1.3 -cipher suites by using the --proxy-ciphers option. +This option is used when curl is built to use OpenSSL 1.1.1 or later, +Schannel, wolfSSL, or mbedTLS 3.6.0 or later. + +Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set +by using the --proxy-ciphers option. diff --git a/deps/curl/docs/cmdline-opts/proxy-tlsauthtype.md b/deps/curl/docs/cmdline-opts/proxy-tlsauthtype.md index 067e4c59..684a7d55 100644 --- a/deps/curl/docs/cmdline-opts/proxy-tlsauthtype.md +++ b/deps/curl/docs/cmdline-opts/proxy-tlsauthtype.md @@ -10,10 +10,15 @@ Multi: single See-also: - proxy - proxy-tlsuser + - proxy-tlspassword Example: - --proxy-tlsauthtype SRP -x https://proxy $URL --- # `--proxy-tlsauthtype` -Same as --tlsauthtype but used in HTTPS proxy context. +Set TLS authentication type with HTTPS proxy. The only supported option is +`SRP`, for TLS-SRP (RFC 5054). This option works only if the underlying +libcurl is built with TLS-SRP support. + +Equivalent to --tlsauthtype but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-tlspassword.md b/deps/curl/docs/cmdline-opts/proxy-tlspassword.md index 3c6d06c6..fe9ae7d2 100644 --- a/deps/curl/docs/cmdline-opts/proxy-tlspassword.md +++ b/deps/curl/docs/cmdline-opts/proxy-tlspassword.md @@ -16,4 +16,10 @@ Example: # `--proxy-tlspassword` -Same as --tlspassword but used in HTTPS proxy context. +Set password to use with the TLS authentication method specified with +--proxy-tlsauthtype when using HTTPS proxy. Requires that --proxy-tlsuser is +set. + +This option does not work with TLS 1.3. + +Equivalent to --tlspassword but used in HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy-tlsuser.md b/deps/curl/docs/cmdline-opts/proxy-tlsuser.md index 1c626ee7..35177011 100644 --- a/deps/curl/docs/cmdline-opts/proxy-tlsuser.md +++ b/deps/curl/docs/cmdline-opts/proxy-tlsuser.md @@ -16,4 +16,8 @@ Example: # `--proxy-tlsuser` -Same as --tlsuser but used in HTTPS proxy context. +Set username for use for HTTPS proxy with the TLS authentication method +specified with --proxy-tlsauthtype. Requires that --proxy-tlspassword also is +set. + +This option does not work with TLS 1.3. diff --git a/deps/curl/docs/cmdline-opts/proxy-tlsv1.md b/deps/curl/docs/cmdline-opts/proxy-tlsv1.md index b7b09ee4..7b322e3a 100644 --- a/deps/curl/docs/cmdline-opts/proxy-tlsv1.md +++ b/deps/curl/docs/cmdline-opts/proxy-tlsv1.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxy-tlsv1 -Help: Use TLSv1 for HTTPS proxy +Help: TLSv1 for HTTPS proxy Added: 7.52.0 Category: proxy tls auth Multi: mutex @@ -14,4 +14,7 @@ Example: # `--proxy-tlsv1` -Same as --tlsv1 but used in HTTPS proxy context. +Use at least TLS version 1.x when negotiating with an HTTPS proxy. That means +TLS version 1.0 or higher + +Equivalent to --tlsv1 but for an HTTPS proxy context. diff --git a/deps/curl/docs/cmdline-opts/proxy.md b/deps/curl/docs/cmdline-opts/proxy.md index 51f638c6..afaa2983 100644 --- a/deps/curl/docs/cmdline-opts/proxy.md +++ b/deps/curl/docs/cmdline-opts/proxy.md @@ -28,7 +28,7 @@ Unix domain sockets are supported for socks proxy. Set localhost for the host part. e.g. socks5h://localhost/path/to/socket.sock HTTPS proxy support works set with the https:// protocol prefix for OpenSSL -and GnuTLS (added in 7.52.0). It also works for BearSSL, mbedTLS, rustls, +and GnuTLS (added in 7.52.0). It also works for BearSSL, mbedTLS, Rustls, Schannel, Secure Transport and wolfSSL (added in 7.87.0). Unrecognized and unsupported proxy protocols cause an error (added in 7.52.0). @@ -56,3 +56,7 @@ password. When a proxy is used, the active FTP mode as set with --ftp-port, cannot be used. + +Doing FTP over an HTTP proxy without --proxytunnel makes curl do HTTP with an +FTP URL over the proxy. For such transfers, common FTP specific options do not +work, including --ftp-ssl-reqd and --ftp-ssl-control. diff --git a/deps/curl/docs/cmdline-opts/proxytunnel.md b/deps/curl/docs/cmdline-opts/proxytunnel.md index 74faa681..169d2ad8 100644 --- a/deps/curl/docs/cmdline-opts/proxytunnel.md +++ b/deps/curl/docs/cmdline-opts/proxytunnel.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: proxytunnel Short: p -Help: Operate through an HTTP proxy tunnel (using CONNECT) +Help: HTTP proxy tunnel (using CONNECT) Category: proxy Added: 7.3 Multi: boolean diff --git a/deps/curl/docs/cmdline-opts/pubkey.md b/deps/curl/docs/cmdline-opts/pubkey.md index 94e50e4e..373d113c 100644 --- a/deps/curl/docs/cmdline-opts/pubkey.md +++ b/deps/curl/docs/cmdline-opts/pubkey.md @@ -5,7 +5,7 @@ Long: pubkey Arg: Protocols: SFTP SCP Help: SSH Public key filename -Category: sftp scp auth +Category: sftp scp ssh auth Added: 7.16.2 Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/random-file.md b/deps/curl/docs/cmdline-opts/random-file.md index 0f564d9d..e2c8624a 100644 --- a/deps/curl/docs/cmdline-opts/random-file.md +++ b/deps/curl/docs/cmdline-opts/random-file.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: random-file Arg: Help: File for reading random data from -Category: misc +Category: deprecated Added: 7.7 Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/range.md b/deps/curl/docs/cmdline-opts/range.md index abfdf216..c2cee2e1 100644 --- a/deps/curl/docs/cmdline-opts/range.md +++ b/deps/curl/docs/cmdline-opts/range.md @@ -42,7 +42,7 @@ specifies two separate 100-byte ranges(*) (HTTP) ## (*) = NOTE that these make the server reply with a multipart response, which -is returned as-is by curl! Parsing or otherwise transforming this response is +is returned as-is by curl. Parsing or otherwise transforming this response is the responsibility of the caller. Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the diff --git a/deps/curl/docs/cmdline-opts/rate.md b/deps/curl/docs/cmdline-opts/rate.md index fb2901e7..6de65165 100644 --- a/deps/curl/docs/cmdline-opts/rate.md +++ b/deps/curl/docs/cmdline-opts/rate.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: rate Arg: Help: Request rate for serial transfers -Category: connection +Category: connection global Added: 7.84.0 Multi: single Scope: global @@ -40,3 +40,7 @@ more than 1000 per second, it instead runs unrestricted. When retrying transfers, enabled with --retry, the separate retry delay logic is used and not this setting. + +Starting in version 8.10.0, you can specify number of time units in the rate +expression. Make curl do no more than 5 transfers per 15 seconds with "5/15s" +or limit it to 3 transfers per 4 hours with "3/4h". No spaces allowed. diff --git a/deps/curl/docs/cmdline-opts/referer.md b/deps/curl/docs/cmdline-opts/referer.md index 40a8dc6d..1fec2485 100644 --- a/deps/curl/docs/cmdline-opts/referer.md +++ b/deps/curl/docs/cmdline-opts/referer.md @@ -20,7 +20,7 @@ Example: # `--referer` -Sends the referrer URL in the HTTP request. This can also be set with the +Set the referrer URL in the HTTP request. This can also be set with the --header flag of course. When used with --location you can append `;auto`" to the --referer URL to make curl automatically set the previous URL when it follows a Location: header. The `;auto` string can be used alone, even if you diff --git a/deps/curl/docs/cmdline-opts/remote-header-name.md b/deps/curl/docs/cmdline-opts/remote-header-name.md index 46b8ad28..88c2808a 100644 --- a/deps/curl/docs/cmdline-opts/remote-header-name.md +++ b/deps/curl/docs/cmdline-opts/remote-header-name.md @@ -16,10 +16,9 @@ Example: # `--remote-header-name` -This option tells the --remote-name option to use the server-specified -Content-Disposition filename instead of extracting a filename from the URL. If -the server-provided filename contains a path, that is stripped off before the -filename is used. +Tell the --remote-name option to use the server-specified Content-Disposition +filename instead of extracting a filename from the URL. If the server-provided +filename contains a path, that is stripped off before the filename is used. The file is saved in the current directory, or in the directory specified with --output-dir. diff --git a/deps/curl/docs/cmdline-opts/remote-name-all.md b/deps/curl/docs/cmdline-opts/remote-name-all.md index 19f7de76..92d348e2 100644 --- a/deps/curl/docs/cmdline-opts/remote-name-all.md +++ b/deps/curl/docs/cmdline-opts/remote-name-all.md @@ -14,7 +14,7 @@ Example: # `--remote-name-all` -This option changes the default action for all given URLs to be dealt with as -if --remote-name were used for each one. If you want to disable that for a +Change the default action for all given URLs to be dealt with as if +--remote-name were used for each one. If you want to disable that for a specific URL after --remote-name-all has been used, you must use "-o -" or --no-remote-name. diff --git a/deps/curl/docs/cmdline-opts/remote-name.md b/deps/curl/docs/cmdline-opts/remote-name.md index 487799fa..e39dd51a 100644 --- a/deps/curl/docs/cmdline-opts/remote-name.md +++ b/deps/curl/docs/cmdline-opts/remote-name.md @@ -3,16 +3,17 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: remote-name Short: O -Help: Write output to a file named as the remote file +Help: Write output to file named as remote file Category: important output Added: 4.0 -Multi: append +Multi: per-URL See-also: - remote-name-all - output-dir - remote-header-name Example: - -O https://example.com/filename + - -O https://example.com/filename -O https://example.com/file2 --- # `--remote-name` @@ -34,3 +35,8 @@ There is no URL decoding done on the filename. If it has %20 or other URL encoded parts of the name, they end up as-is as filename. You may use this option as many times as the number of URLs you have. + +Before curl 8.10.0, curl returned an error if the URL ended with a slash, +which means that there is no filename part in the URL. Starting in 8.10.0, +curl sets the filename to the last directory part of the URL or if that also +is missing to `curl_response` (without extension) for this situation. diff --git a/deps/curl/docs/cmdline-opts/remote-time.md b/deps/curl/docs/cmdline-opts/remote-time.md index b010bc13..7c5d21f0 100644 --- a/deps/curl/docs/cmdline-opts/remote-time.md +++ b/deps/curl/docs/cmdline-opts/remote-time.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: remote-time Short: R -Help: Set the remote file's time on the local output +Help: Set remote file's time on local output Category: output Added: 7.9 Multi: boolean diff --git a/deps/curl/docs/cmdline-opts/remove-on-error.md b/deps/curl/docs/cmdline-opts/remove-on-error.md index 02ce9923..4f9cf90d 100644 --- a/deps/curl/docs/cmdline-opts/remove-on-error.md +++ b/deps/curl/docs/cmdline-opts/remove-on-error.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: remove-on-error Help: Remove output file on errors -Category: curl +Category: output Added: 7.83.0 Multi: boolean See-also: @@ -14,8 +14,8 @@ Example: # `--remove-on-error` -When curl returns an error when told to save output in a local file, this -option removes that saved file before exiting. This prevents curl from -leaving a partial file in the case of an error during transfer. +Remove output file if an error occurs. If curl returns an error when told to +save output in a local file. This prevents curl from leaving a partial file in +the case of an error during transfer. If the output is not a regular file, this option has no effect. diff --git a/deps/curl/docs/cmdline-opts/request-target.md b/deps/curl/docs/cmdline-opts/request-target.md index cc379229..44285114 100644 --- a/deps/curl/docs/cmdline-opts/request-target.md +++ b/deps/curl/docs/cmdline-opts/request-target.md @@ -16,10 +16,10 @@ Example: # `--request-target` -Tells curl to use an alternative target (path) instead of using the path as -provided in the URL. Particularly useful when wanting to issue HTTP requests -without leading slash or other data that does not follow the regular URL -pattern, like "OPTIONS *". +Use an alternative target (path) instead of using the path as provided in the +URL. Particularly useful when wanting to issue HTTP requests without leading +slash or other data that does not follow the regular URL pattern, like +"OPTIONS *". curl passes on the verbatim string you give it its the request without any filter or other safe guards. That includes white space and control characters. diff --git a/deps/curl/docs/cmdline-opts/request.md b/deps/curl/docs/cmdline-opts/request.md index 4a6304c1..86cf10de 100644 --- a/deps/curl/docs/cmdline-opts/request.md +++ b/deps/curl/docs/cmdline-opts/request.md @@ -5,7 +5,7 @@ Long: request Short: X Arg: Help: Specify request method to use -Category: connection +Category: connection pop3 ftp imap smtp Added: 6.0 Multi: single See-also: @@ -19,7 +19,7 @@ Example: Change the method to use when starting the transfer. -curl passes on the verbatim string you give it its the request without any +curl passes on the verbatim string you give it in the request without any filter or other safe guards. That includes white space and control characters. ## HTTP diff --git a/deps/curl/docs/cmdline-opts/resolve.md b/deps/curl/docs/cmdline-opts/resolve.md index 70d039aa..2b71d9a5 100644 --- a/deps/curl/docs/cmdline-opts/resolve.md +++ b/deps/curl/docs/cmdline-opts/resolve.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: resolve Arg: <[+]host:port:addr[,addr]...> -Help: Resolve the host+port to this address +Help: Resolve host+port to address Added: 7.21.3 Category: connection dns Multi: append @@ -24,7 +24,7 @@ the number used for the specific protocol the host is used for. It means you need several entries if you want to provide address for the same host but different ports. -By specifying '*' as host you can tell curl to resolve any host and specific +By specifying `*` as host you can tell curl to resolve any host and specific port pair to the specified address. Wildcard is resolved last so any --resolve with a specific host and port is used first. @@ -37,9 +37,8 @@ parallel transfers with a lot of files. In such cases, if this option is used curl tries to resolve the host as it normally would once the timeout has expired. -Support for providing the IP address within [brackets] was added in 7.57.0. - -Support for providing multiple IP addresses per entry was added in 7.59.0. +To redirect connects from a specific hostname or any hostname, independently +of port number, consider the --connect-to option. Support for resolving with wildcard was added in 7.64.0. diff --git a/deps/curl/docs/cmdline-opts/retry-all-errors.md b/deps/curl/docs/cmdline-opts/retry-all-errors.md index 6d3deebc..230e7306 100644 --- a/deps/curl/docs/cmdline-opts/retry-all-errors.md +++ b/deps/curl/docs/cmdline-opts/retry-all-errors.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: retry-all-errors -Help: Retry all errors (use with --retry) +Help: Retry all errors (with --retry) Added: 7.71.0 Category: curl Multi: boolean diff --git a/deps/curl/docs/cmdline-opts/retry-connrefused.md b/deps/curl/docs/cmdline-opts/retry-connrefused.md index 975dc097..22345cd8 100644 --- a/deps/curl/docs/cmdline-opts/retry-connrefused.md +++ b/deps/curl/docs/cmdline-opts/retry-connrefused.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: retry-connrefused -Help: Retry on connection refused (use with --retry) +Help: Retry on connection refused (with --retry) Added: 7.52.0 Category: curl Multi: boolean diff --git a/deps/curl/docs/cmdline-opts/retry-delay.md b/deps/curl/docs/cmdline-opts/retry-delay.md index b2a405b6..fcee1767 100644 --- a/deps/curl/docs/cmdline-opts/retry-delay.md +++ b/deps/curl/docs/cmdline-opts/retry-delay.md @@ -5,7 +5,7 @@ Long: retry-delay Arg: Help: Wait time between retries Added: 7.12.3 -Category: curl +Category: curl timeout Multi: single See-also: - retry diff --git a/deps/curl/docs/cmdline-opts/retry-max-time.md b/deps/curl/docs/cmdline-opts/retry-max-time.md index f7346475..e95a381a 100644 --- a/deps/curl/docs/cmdline-opts/retry-max-time.md +++ b/deps/curl/docs/cmdline-opts/retry-max-time.md @@ -5,7 +5,7 @@ Long: retry-max-time Arg: Help: Retry only within this period Added: 7.12.3 -Category: curl +Category: curl timeout Multi: single See-also: - retry diff --git a/deps/curl/docs/cmdline-opts/sasl-ir.md b/deps/curl/docs/cmdline-opts/sasl-ir.md index 56732807..b11137df 100644 --- a/deps/curl/docs/cmdline-opts/sasl-ir.md +++ b/deps/curl/docs/cmdline-opts/sasl-ir.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: sasl-ir -Help: Enable initial response in SASL authentication +Help: Initial response in SASL authentication Added: 7.31.0 Category: auth Multi: boolean diff --git a/deps/curl/docs/cmdline-opts/service-name.md b/deps/curl/docs/cmdline-opts/service-name.md index 818dc4e7..f98409aa 100644 --- a/deps/curl/docs/cmdline-opts/service-name.md +++ b/deps/curl/docs/cmdline-opts/service-name.md @@ -5,7 +5,7 @@ Long: service-name Help: SPNEGO service name Arg: Added: 7.43.0 -Category: misc +Category: auth Multi: single See-also: - negotiate @@ -16,4 +16,4 @@ Example: # `--service-name` -This option allows you to change the service name for SPNEGO. +Set the service name for SPNEGO. diff --git a/deps/curl/docs/cmdline-opts/show-error.md b/deps/curl/docs/cmdline-opts/show-error.md index 0517c37b..aaf865bc 100644 --- a/deps/curl/docs/cmdline-opts/show-error.md +++ b/deps/curl/docs/cmdline-opts/show-error.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: show-error Short: S Help: Show error even when -s is used -Category: curl +Category: curl global Added: 5.9 Multi: boolean Scope: global diff --git a/deps/curl/docs/cmdline-opts/show-headers.md b/deps/curl/docs/cmdline-opts/show-headers.md new file mode 100644 index 00000000..126610f7 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/show-headers.md @@ -0,0 +1,29 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: show-headers +Short: i +Help: Show response headers in output +Protocols: HTTP FTP +Category: important verbose output +Added: 4.8 +Multi: boolean +See-also: + - verbose +Example: + - -i $URL +--- + +# `--show-headers` + +Show response headers in the output. HTTP response headers can include things +like server name, cookies, date of the document, HTTP version and more. With +non-HTTP protocols, the "headers" are other server communication. + +To view the request headers, consider the --verbose option. + +Prior to 7.75.0 curl did not print the headers if --fail was used in +combination with this option and there was error reported by server. + +This option was called --include before 8.10.0. The previous name remains +functional. diff --git a/deps/curl/docs/cmdline-opts/skip-existing.md b/deps/curl/docs/cmdline-opts/skip-existing.md new file mode 100644 index 00000000..cfb7c2f9 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/skip-existing.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: skip-existing +Help: Skip download if local file already exists +Category: curl output +Added: 8.10.0 +Multi: boolean +See-also: + - output + - remote-name + - no-clobber +Example: + - --skip-existing --output local/dir/file $URL +--- + +# `--skip-existing` + +If there is a local file present when a download is requested, the operation +is skipped. Note that curl cannot know if the local file was previously +downloaded fine, or if it is incomplete etc, it just knows if there is a +filename present in the file system or not and it skips the transfer if it is. diff --git a/deps/curl/docs/cmdline-opts/socks4.md b/deps/curl/docs/cmdline-opts/socks4.md index e74fa787..99a7fc92 100644 --- a/deps/curl/docs/cmdline-opts/socks4.md +++ b/deps/curl/docs/cmdline-opts/socks4.md @@ -21,7 +21,7 @@ Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. Using this socket type make curl resolve the hostname and passing the address on to the proxy. -To specify proxy on a unix domain socket, use localhost for host, e.g. +To specify proxy on a Unix domain socket, use localhost for host, e.g. `socks4://localhost/path/to/socket.sock` This option overrides any previous use of --proxy, as they are mutually diff --git a/deps/curl/docs/cmdline-opts/socks4a.md b/deps/curl/docs/cmdline-opts/socks4a.md index 49fb9a27..04d60b81 100644 --- a/deps/curl/docs/cmdline-opts/socks4a.md +++ b/deps/curl/docs/cmdline-opts/socks4a.md @@ -20,7 +20,7 @@ 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. +To specify proxy on a Unix domain socket, use localhost for host, e.g. `socks4a://localhost/path/to/socket.sock` This option overrides any previous use of --proxy, as they are mutually diff --git a/deps/curl/docs/cmdline-opts/socks5-basic.md b/deps/curl/docs/cmdline-opts/socks5-basic.md index bfadea6b..dc2a5532 100644 --- a/deps/curl/docs/cmdline-opts/socks5-basic.md +++ b/deps/curl/docs/cmdline-opts/socks5-basic.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: socks5-basic -Help: Enable username/password auth for SOCKS5 proxies +Help: Username/password auth for SOCKS5 proxies Added: 7.55.0 Category: proxy auth Multi: mutex @@ -14,6 +14,6 @@ Example: # `--socks5-basic` -Tells curl to use username/password authentication when connecting to a SOCKS5 -proxy. The username/password authentication is enabled by default. Use ---socks5-gssapi to force GSS-API authentication to SOCKS5 proxies. +Use username/password authentication when connecting to a SOCKS5 proxy. The +username/password authentication is enabled by default. Use --socks5-gssapi to +force GSS-API authentication to SOCKS5 proxies. diff --git a/deps/curl/docs/cmdline-opts/socks5-gssapi-service.md b/deps/curl/docs/cmdline-opts/socks5-gssapi-service.md index c2ab2d93..d847e65e 100644 --- a/deps/curl/docs/cmdline-opts/socks5-gssapi-service.md +++ b/deps/curl/docs/cmdline-opts/socks5-gssapi-service.md @@ -15,5 +15,4 @@ Example: # `--socks5-gssapi-service` -The default service name for a socks server is **rcmd/server-fqdn**. This option -allows you to change it. +Set the service name for a socks server. Default is **rcmd/server-fqdn**. diff --git a/deps/curl/docs/cmdline-opts/socks5-gssapi.md b/deps/curl/docs/cmdline-opts/socks5-gssapi.md index 43ec56aa..e1742543 100644 --- a/deps/curl/docs/cmdline-opts/socks5-gssapi.md +++ b/deps/curl/docs/cmdline-opts/socks5-gssapi.md @@ -14,7 +14,7 @@ Example: # `--socks5-gssapi` -Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy. -The GSS-API authentication is enabled by default (if curl is compiled with -GSS-API support). Use --socks5-basic to force username/password authentication -to SOCKS5 proxies. +Use GSS-API authentication when connecting to a SOCKS5 proxy. The GSS-API +authentication is enabled by default (if curl is compiled with GSS-API +support). Use --socks5-basic to force username/password authentication to +SOCKS5 proxies. diff --git a/deps/curl/docs/cmdline-opts/socks5-hostname.md b/deps/curl/docs/cmdline-opts/socks5-hostname.md index 1a5e4c1b..0ea2ed73 100644 --- a/deps/curl/docs/cmdline-opts/socks5-hostname.md +++ b/deps/curl/docs/cmdline-opts/socks5-hostname.md @@ -19,7 +19,7 @@ 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. +To specify proxy on a Unix domain socket, use localhost for host, e.g. `socks5h://localhost/path/to/socket.sock` This option overrides any previous use of --proxy, as they are mutually diff --git a/deps/curl/docs/cmdline-opts/socks5.md b/deps/curl/docs/cmdline-opts/socks5.md index f17dfeb7..4ea660d6 100644 --- a/deps/curl/docs/cmdline-opts/socks5.md +++ b/deps/curl/docs/cmdline-opts/socks5.md @@ -19,7 +19,7 @@ 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. +To specify proxy on a Unix domain socket, use localhost for host, e.g. `socks5://localhost/path/to/socket.sock` This option overrides any previous use of --proxy, as they are mutually @@ -33,4 +33,4 @@ used with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. -This option (as well as --socks4) does not work with IPV6, FTPS or LDAP. +This option does not work with FTPS or LDAP. diff --git a/deps/curl/docs/cmdline-opts/speed-time.md b/deps/curl/docs/cmdline-opts/speed-time.md index ef8759ee..f27702be 100644 --- a/deps/curl/docs/cmdline-opts/speed-time.md +++ b/deps/curl/docs/cmdline-opts/speed-time.md @@ -5,7 +5,7 @@ Long: speed-time Short: y Arg: Help: Trigger 'speed-limit' abort after this time -Category: connection +Category: connection timeout Added: 4.7 Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/ssl-allow-beast.md b/deps/curl/docs/cmdline-opts/ssl-allow-beast.md index 6c144e76..f9933b77 100644 --- a/deps/curl/docs/cmdline-opts/ssl-allow-beast.md +++ b/deps/curl/docs/cmdline-opts/ssl-allow-beast.md @@ -16,10 +16,12 @@ Example: # `--ssl-allow-beast` -This option tells curl to not work around a security flaw in the SSL3 and -TLS1.0 protocols known as BEAST. If this option is not used, the SSL layer may -use workarounds known to cause interoperability problems with some older SSL -implementations. +Do not work around a security flaw in the TLS1.0 protocol known as BEAST. If +this option is not used, the TLS layer may use workarounds known to cause +interoperability problems with some older server implementations. -**WARNING**: this option loosens the SSL security, and by using this flag you +This option only changes how curl does TLS 1.0 and has no effect on later TLS +versions. + +**WARNING**: this option loosens the TLS security, and by using this flag you ask for exactly that. diff --git a/deps/curl/docs/cmdline-opts/ssl-auto-client-cert.md b/deps/curl/docs/cmdline-opts/ssl-auto-client-cert.md index 8ed6fed2..4f0be5bd 100644 --- a/deps/curl/docs/cmdline-opts/ssl-auto-client-cert.md +++ b/deps/curl/docs/cmdline-opts/ssl-auto-client-cert.md @@ -15,7 +15,7 @@ Example: # `--ssl-auto-client-cert` -(Schannel) Tell libcurl to automatically locate and use a client certificate -for authentication, when requested by the server. Since the server can request -any certificate that supports client authentication in the OS certificate -store it could be a privacy violation and unexpected. +(Schannel) Automatically locate and use a client certificate for +authentication, when requested by the server. Since the server can request any +certificate that supports client authentication in the OS certificate store it +could be a privacy violation and unexpected. diff --git a/deps/curl/docs/cmdline-opts/ssl-no-revoke.md b/deps/curl/docs/cmdline-opts/ssl-no-revoke.md index 3f1400cd..16981f14 100644 --- a/deps/curl/docs/cmdline-opts/ssl-no-revoke.md +++ b/deps/curl/docs/cmdline-opts/ssl-no-revoke.md @@ -15,6 +15,5 @@ Example: # `--ssl-no-revoke` -(Schannel) This option tells curl to disable certificate revocation checks. -WARNING: this option loosens the SSL security, and by using this flag you ask -for exactly that. +(Schannel) Disable certificate revocation checks. WARNING: this option loosens +the SSL security, and by using this flag you ask for exactly that. diff --git a/deps/curl/docs/cmdline-opts/ssl-reqd.md b/deps/curl/docs/cmdline-opts/ssl-reqd.md index eeabc064..f21c145f 100644 --- a/deps/curl/docs/cmdline-opts/ssl-reqd.md +++ b/deps/curl/docs/cmdline-opts/ssl-reqd.md @@ -5,7 +5,7 @@ Long: ssl-reqd Help: Require SSL/TLS Protocols: FTP IMAP POP3 SMTP LDAP Added: 7.20.0 -Category: tls +Category: tls imap pop3 smtp ldap Multi: boolean See-also: - ssl @@ -16,7 +16,8 @@ Example: # `--ssl-reqd` -Require SSL/TLS for the connection. Terminates the connection if the transfer +Require SSL/TLS for the connection - often referred to as STARTTLS or STLS +because of the involved commands. Terminates the connection if the transfer cannot be upgraded to use SSL/TLS. This option is handled in LDAP (added in 7.81.0). It is fully supported by the diff --git a/deps/curl/docs/cmdline-opts/ssl-revoke-best-effort.md b/deps/curl/docs/cmdline-opts/ssl-revoke-best-effort.md index 77fb8767..0257e05f 100644 --- a/deps/curl/docs/cmdline-opts/ssl-revoke-best-effort.md +++ b/deps/curl/docs/cmdline-opts/ssl-revoke-best-effort.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ssl-revoke-best-effort -Help: Ignore missing/offline cert CRL dist points (Schannel) +Help: Ignore missing cert CRL dist points Added: 7.70.0 Protocols: TLS Category: tls @@ -16,6 +16,5 @@ Example: # `--ssl-revoke-best-effort` -(Schannel) This option tells curl to ignore certificate revocation checks when -they failed due to missing/offline distribution points for the revocation check -lists. +(Schannel) Ignore certificate revocation checks when they failed due to +missing/offline distribution points for the revocation check lists. diff --git a/deps/curl/docs/cmdline-opts/ssl.md b/deps/curl/docs/cmdline-opts/ssl.md index 9a78ae3a..0c0f2817 100644 --- a/deps/curl/docs/cmdline-opts/ssl.md +++ b/deps/curl/docs/cmdline-opts/ssl.md @@ -2,10 +2,10 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: ssl -Help: Try SSL/TLS +Help: Try enabling TLS Protocols: FTP IMAP POP3 SMTP LDAP Added: 7.20.0 -Category: tls +Category: tls imap pop3 smtp ldap Multi: boolean See-also: - ssl-reqd @@ -20,9 +20,10 @@ Example: Warning: this is considered an insecure option. Consider using --ssl-reqd instead to be sure curl upgrades to a secure connection. -Try to use SSL/TLS for the connection. Reverts to a non-secure connection if -the server does not support SSL/TLS. See also --ftp-ssl-control and --ssl-reqd -for different levels of encryption required. +Try to use SSL/TLS for the connection - often referred to as STARTTLS or STLS +because of the involved commands. Reverts to a non-secure connection if the +server does not support SSL/TLS. See also --ftp-ssl-control and --ssl-reqd for +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. diff --git a/deps/curl/docs/cmdline-opts/sslv2.md b/deps/curl/docs/cmdline-opts/sslv2.md index 05fe938b..ea92a2cb 100644 --- a/deps/curl/docs/cmdline-opts/sslv2.md +++ b/deps/curl/docs/cmdline-opts/sslv2.md @@ -8,8 +8,8 @@ Protocols: SSL Added: 5.9 Mutexed: sslv3 tlsv1 tlsv1.1 tlsv1.2 Requires: TLS -Help: Use SSLv2 -Category: tls +Help: SSLv2 +Category: deprecated Multi: mutex See-also: - http1.1 diff --git a/deps/curl/docs/cmdline-opts/sslv3.md b/deps/curl/docs/cmdline-opts/sslv3.md index 343f628a..f022124e 100644 --- a/deps/curl/docs/cmdline-opts/sslv3.md +++ b/deps/curl/docs/cmdline-opts/sslv3.md @@ -8,8 +8,8 @@ Protocols: SSL Added: 5.9 Mutexed: sslv2 tlsv1 tlsv1.1 tlsv1.2 Requires: TLS -Help: Use SSLv3 -Category: tls +Help: SSLv3 +Category: deprecated Multi: mutex See-also: - http1.1 diff --git a/deps/curl/docs/cmdline-opts/stderr.md b/deps/curl/docs/cmdline-opts/stderr.md index bb42497d..7030e557 100644 --- a/deps/curl/docs/cmdline-opts/stderr.md +++ b/deps/curl/docs/cmdline-opts/stderr.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: stderr Arg: Help: Where to redirect stderr -Category: verbose +Category: verbose global Added: 6.2 Multi: single Scope: global diff --git a/deps/curl/docs/cmdline-opts/styled-output.md b/deps/curl/docs/cmdline-opts/styled-output.md index 1df472ae..8193896c 100644 --- a/deps/curl/docs/cmdline-opts/styled-output.md +++ b/deps/curl/docs/cmdline-opts/styled-output.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: styled-output Help: Enable styled output for HTTP headers Added: 7.61.0 -Category: verbose +Category: verbose global Multi: boolean Scope: global See-also: @@ -16,7 +16,7 @@ Example: # `--styled-output` -Enables the automatic use of bold font styles when writing HTTP headers to the +Enable automatic use of bold font styles when writing HTTP headers to the terminal. Use --no-styled-output to switch them off. Styled output requires a terminal that supports bold fonts. This feature is diff --git a/deps/curl/docs/cmdline-opts/suppress-connect-headers.md b/deps/curl/docs/cmdline-opts/suppress-connect-headers.md index 9e2eefea..e9e32c0a 100644 --- a/deps/curl/docs/cmdline-opts/suppress-connect-headers.md +++ b/deps/curl/docs/cmdline-opts/suppress-connect-headers.md @@ -8,15 +8,16 @@ Added: 7.54.0 Multi: boolean See-also: - dump-header - - include + - show-headers - proxytunnel Example: - - --suppress-connect-headers --include -x proxy $URL + - --suppress-connect-headers --show-headers -x proxy $URL --- # `--suppress-connect-headers` When --proxytunnel is used and a CONNECT request is made do not output proxy -CONNECT response headers. This option is meant to be used with --dump-header or ---include which are used to show protocol headers in the output. It has no -effect on debug options such as --verbose or --trace, or any statistics. +CONNECT response headers. This option is meant to be used with --dump-header +or --show-headers which are used to show protocol headers in the output. It +has no effect on debug options such as --verbose or --trace, or any +statistics. diff --git a/deps/curl/docs/cmdline-opts/tcp-nodelay.md b/deps/curl/docs/cmdline-opts/tcp-nodelay.md index 9a6df8d6..6944d701 100644 --- a/deps/curl/docs/cmdline-opts/tcp-nodelay.md +++ b/deps/curl/docs/cmdline-opts/tcp-nodelay.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: tcp-nodelay -Help: Use the TCP_NODELAY option +Help: Set TCP_NODELAY Added: 7.11.2 Category: connection Multi: boolean diff --git a/deps/curl/docs/cmdline-opts/tftp-no-options.md b/deps/curl/docs/cmdline-opts/tftp-no-options.md index 518816c2..063da92e 100644 --- a/deps/curl/docs/cmdline-opts/tftp-no-options.md +++ b/deps/curl/docs/cmdline-opts/tftp-no-options.md @@ -15,8 +15,6 @@ Example: # `--tftp-no-options` -Tells curl not to send TFTP options requests. - -This option improves interop with some legacy servers that do not acknowledge -or properly implement TFTP options. When this option is used --tftp-blksize is -ignored. +Do not to send TFTP options requests. This improves interop with some legacy +servers that do not acknowledge or properly implement TFTP options. When this +option is used --tftp-blksize is ignored. diff --git a/deps/curl/docs/cmdline-opts/tls-earlydata.md b/deps/curl/docs/cmdline-opts/tls-earlydata.md new file mode 100644 index 00000000..8482f809 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/tls-earlydata.md @@ -0,0 +1,41 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: tls-earlydata +Help: Allow use of TLSv1.3 early data (0RTT) +Protocols: TLS +Added: 8.11.0 +Category: tls +Multi: boolean +See-also: + - tlsv1.3 + - tls-max +Example: + - --tls-earlydata $URL +--- + +# `--tls-earlydata` + +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 is used when curl is built to use GnuTLS. + +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 +a session in a previous request, early data cannot be used. + +When a new connection is initiated with a known TLSv1.3 session, and that +session announced early data support, the first request on this connection is +sent *before* the TLS handshake is complete. While the early data is also +encrypted, it is not protected against replays. An attacker can send +your early data to the server again and the server would accept it. + +If your request contacts a public server and only retrieves a file, there +may be no harm in that. If the first request orders a refrigerator +for you, it is probably not a good idea to use early data for it. curl +cannot deduce what the security implications of your requests actually +are and make this decision for you. + +**WARNING**: this option has security implications. See above for more +details. diff --git a/deps/curl/docs/cmdline-opts/tls-max.md b/deps/curl/docs/cmdline-opts/tls-max.md index a815d21d..87233c75 100644 --- a/deps/curl/docs/cmdline-opts/tls-max.md +++ b/deps/curl/docs/cmdline-opts/tls-max.md @@ -7,7 +7,7 @@ Tags: Versions Protocols: TLS Added: 7.54.0 Requires: TLS -Help: Set maximum allowed TLS version +Help: Maximum allowed TLS version Category: tls Multi: single See-also: diff --git a/deps/curl/docs/cmdline-opts/tls13-ciphers.md b/deps/curl/docs/cmdline-opts/tls13-ciphers.md index 2f68a619..43220af4 100644 --- a/deps/curl/docs/cmdline-opts/tls13-ciphers.md +++ b/deps/curl/docs/cmdline-opts/tls13-ciphers.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: tls13-ciphers -Arg: +Arg: help: TLS 1.3 cipher suites to use Protocols: TLS Category: tls @@ -10,8 +10,8 @@ Added: 7.61.0 Multi: single See-also: - ciphers - - curves - proxy-tls13-ciphers + - curves Example: - --tls13-ciphers TLS_AES_128_GCM_SHA256 $URL --- @@ -24,6 +24,8 @@ cipher suite details on this URL: https://curl.se/docs/ssl-ciphers.html -This option is currently used only when curl is built to use OpenSSL 1.1.1 or -later, or Schannel. If you are using a different SSL backend you can try -setting TLS 1.3 cipher suites by using the --ciphers option. +This option is used when curl is built to use OpenSSL 1.1.1 or later, +Schannel, wolfSSL, or mbedTLS 3.6.0 or later. + +Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set +by using the --ciphers option. diff --git a/deps/curl/docs/cmdline-opts/tlspassword.md b/deps/curl/docs/cmdline-opts/tlspassword.md index 4b181799..6a1bb23a 100644 --- a/deps/curl/docs/cmdline-opts/tlspassword.md +++ b/deps/curl/docs/cmdline-opts/tlspassword.md @@ -16,7 +16,7 @@ Example: # `--tlspassword` -Set password for use with the TLS authentication method specified with ---tlsauthtype. Requires that --tlsuser also be set. +Set password to use with the TLS authentication method specified with +--tlsauthtype. Requires that --tlsuser is set. This option does not work with TLS 1.3. diff --git a/deps/curl/docs/cmdline-opts/tlsv1.0.md b/deps/curl/docs/cmdline-opts/tlsv1.0.md index 01aa0aea..66ca3238 100644 --- a/deps/curl/docs/cmdline-opts/tlsv1.0.md +++ b/deps/curl/docs/cmdline-opts/tlsv1.0.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: tlsv1.0 -Help: Use TLSv1.0 or greater +Help: TLSv1.0 or greater Protocols: TLS Added: 7.34.0 Category: tls diff --git a/deps/curl/docs/cmdline-opts/tlsv1.1.md b/deps/curl/docs/cmdline-opts/tlsv1.1.md index b0d17838..577b7c7a 100644 --- a/deps/curl/docs/cmdline-opts/tlsv1.1.md +++ b/deps/curl/docs/cmdline-opts/tlsv1.1.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: tlsv1.1 -Help: Use TLSv1.1 or greater +Help: TLSv1.1 or greater Protocols: TLS Added: 7.34.0 Category: tls diff --git a/deps/curl/docs/cmdline-opts/tlsv1.2.md b/deps/curl/docs/cmdline-opts/tlsv1.2.md index b39c9abc..0132074e 100644 --- a/deps/curl/docs/cmdline-opts/tlsv1.2.md +++ b/deps/curl/docs/cmdline-opts/tlsv1.2.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: tlsv1.2 -Help: Use TLSv1.2 or greater +Help: TLSv1.2 or greater Protocols: TLS Added: 7.34.0 Category: tls diff --git a/deps/curl/docs/cmdline-opts/tlsv1.3.md b/deps/curl/docs/cmdline-opts/tlsv1.3.md index 537b372a..6c65f59d 100644 --- a/deps/curl/docs/cmdline-opts/tlsv1.3.md +++ b/deps/curl/docs/cmdline-opts/tlsv1.3.md @@ -2,7 +2,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: tlsv1.3 -Help: Use TLSv1.3 or greater +Help: TLSv1.3 or greater Protocols: TLS Added: 7.52.0 Category: tls diff --git a/deps/curl/docs/cmdline-opts/tlsv1.md b/deps/curl/docs/cmdline-opts/tlsv1.md index bed9db09..c6fc9e92 100644 --- a/deps/curl/docs/cmdline-opts/tlsv1.md +++ b/deps/curl/docs/cmdline-opts/tlsv1.md @@ -8,7 +8,7 @@ Protocols: TLS Added: 7.9.2 Mutexed: tlsv1.1 tlsv1.2 tlsv1.3 Requires: TLS -Help: Use TLSv1.0 or greater +Help: TLSv1.0 or greater Category: tls Multi: mutex See-also: @@ -20,5 +20,5 @@ Example: # `--tlsv1` -Tells curl to use at least TLS version 1.x when negotiating with a remote TLS -server. That means TLS version 1.0 or higher +Use at least TLS version 1.x when negotiating with a remote TLS server. That +means TLS version 1.0 or higher diff --git a/deps/curl/docs/cmdline-opts/trace-ascii.md b/deps/curl/docs/cmdline-opts/trace-ascii.md index 65154056..f46f0a6f 100644 --- a/deps/curl/docs/cmdline-opts/trace-ascii.md +++ b/deps/curl/docs/cmdline-opts/trace-ascii.md @@ -5,7 +5,7 @@ Long: trace-ascii Arg: Help: Like --trace, but without hex output Mutexed: trace verbose -Category: verbose +Category: verbose global Added: 7.9.7 Multi: single Scope: global @@ -18,9 +18,9 @@ Example: # `--trace-ascii` -Enables a full trace dump of all incoming and outgoing data, including -descriptive information, to the given output file. Use `-` as filename to have -the output sent to stdout. +Save a full trace dump of all incoming and outgoing data, including +descriptive information, in the given output file. Use `-` as filename to have +the output sent to stdout. Use `%` as filename to send the output to stderr. This is similar to --trace, but leaves out the hex part and only shows the ASCII part of the dump. It makes smaller output that might be easier to read diff --git a/deps/curl/docs/cmdline-opts/trace-config.md b/deps/curl/docs/cmdline-opts/trace-config.md index d7c7e0da..2f095401 100644 --- a/deps/curl/docs/cmdline-opts/trace-config.md +++ b/deps/curl/docs/cmdline-opts/trace-config.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: trace-config Arg: Help: Details to log in trace/verbose output -Category: verbose +Category: verbose global Added: 8.3.0 Multi: append Scope: global diff --git a/deps/curl/docs/cmdline-opts/trace-ids.md b/deps/curl/docs/cmdline-opts/trace-ids.md index 43774d37..dc7d61e7 100644 --- a/deps/curl/docs/cmdline-opts/trace-ids.md +++ b/deps/curl/docs/cmdline-opts/trace-ids.md @@ -2,9 +2,9 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: trace-ids -Help: Add transfer and connection identifiers to trace/verbose output +Help: Transfer + connection ids in verbose output Added: 8.2.0 -Category: verbose +Category: verbose global Multi: boolean Scope: global See-also: diff --git a/deps/curl/docs/cmdline-opts/trace-time.md b/deps/curl/docs/cmdline-opts/trace-time.md index 79206ba9..d3e0f47c 100644 --- a/deps/curl/docs/cmdline-opts/trace-time.md +++ b/deps/curl/docs/cmdline-opts/trace-time.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: trace-time Help: Add time stamps to trace/verbose output Added: 7.14.0 -Category: verbose +Category: verbose global Multi: boolean Scope: global See-also: diff --git a/deps/curl/docs/cmdline-opts/trace.md b/deps/curl/docs/cmdline-opts/trace.md index ed9e681f..875e756f 100644 --- a/deps/curl/docs/cmdline-opts/trace.md +++ b/deps/curl/docs/cmdline-opts/trace.md @@ -5,7 +5,7 @@ Long: trace Arg: Help: Write a debug trace to FILE Mutexed: verbose trace-ascii -Category: verbose +Category: verbose global Added: 7.9.7 Multi: single Scope: global @@ -20,9 +20,9 @@ Example: # `--trace` -Enables a full trace dump of all incoming and outgoing data, including -descriptive information, to the given output file. Use "-" as filename to have -the output sent to stdout. Use "%" as filename to have the output sent to +Save a full trace dump of all incoming and outgoing data, including +descriptive information, in the given output file. Use `-` as filename to have +the output sent to stdout. Use `%` as filename to have the output sent to stderr. Note that verbose output of curl activities and network traffic might contain diff --git a/deps/curl/docs/cmdline-opts/upload-file.md b/deps/curl/docs/cmdline-opts/upload-file.md index eb4b8b77..7e9ffbf1 100644 --- a/deps/curl/docs/cmdline-opts/upload-file.md +++ b/deps/curl/docs/cmdline-opts/upload-file.md @@ -7,7 +7,7 @@ Arg: Help: Transfer local FILE to destination Category: important upload Added: 4.0 -Multi: append +Multi: per-URL See-also: - get - head @@ -17,11 +17,12 @@ Example: - -T file $URL - -T "img[1-1000].png" ftp://ftp.example.com/ - --upload-file "{file1,file2}" $URL + - -T file -T file2 $URL $URL --- # `--upload-file` -This transfers the specified local file to the remote URL. +Upload the specified local file to the remote URL. If there is no file part in the specified URL, curl appends the local file name to the end of the URL before the operation starts. You must use a diff --git a/deps/curl/docs/cmdline-opts/url-query.md b/deps/curl/docs/cmdline-opts/url-query.md index 15e58577..43bf43d9 100644 --- a/deps/curl/docs/cmdline-opts/url-query.md +++ b/deps/curl/docs/cmdline-opts/url-query.md @@ -21,9 +21,9 @@ Example: # `--url-query` -This option adds a piece of data, usually a name + value pair, to the end of -the URL query part. The syntax is identical to that used for --data-urlencode -with one extension: +Add a piece of data, usually a name + value pair, to the end of the URL query +part. The syntax is identical to that used for --data-urlencode with one +extension: If the argument starts with a '+' (plus), the rest of the string is provided as-is unencoded. diff --git a/deps/curl/docs/cmdline-opts/url.md b/deps/curl/docs/cmdline-opts/url.md index 671c376e..d19c73ec 100644 --- a/deps/curl/docs/cmdline-opts/url.md +++ b/deps/curl/docs/cmdline-opts/url.md @@ -16,18 +16,19 @@ Example: # `--url` -Specify a URL to fetch. This option is mostly handy when you want to specify -URL(s) in a config file. +Specify a URL to fetch or send data to. -If the given URL is missing a scheme name (such as `http://` or `ftp://` etc) -then curl makes a guess based on the host. If the outermost subdomain name -matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol is used, -otherwise HTTP is used. Guessing can be avoided by providing a full URL -including the scheme, or disabled by setting a default protocol (added in -7.45.0), see --proto-default for details. +If the given URL is missing a scheme (such as `http://` or `ftp://` etc) curl +guesses which scheme to use based on the hostname. If the outermost subdomain +name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP case insensitively, then that +protocol is used, otherwise it assumes HTTP. Scheme guessing can be avoided by +providing a full URL including the scheme, or disabled by setting a default +protocol, see --proto-default for details. -To control where this URL is written, use the --output or the --remote-name -options. +To control where the contents of a retrieved URL is written instead of the +default stdout, use the --output or the --remote-name options. When retrieving +multiple URLs in a single invoke, each provided URL needs its own dedicated +destination option unless --remote-name-all is used. -**WARNING**: On Windows, particular `file://` accesses can be converted to -network accesses by the operating system. Beware! +On Windows, `file://` accesses can be converted to network accesses by the +operating system. diff --git a/deps/curl/docs/cmdline-opts/use-ascii.md b/deps/curl/docs/cmdline-opts/use-ascii.md index 96b19281..30cc860b 100644 --- a/deps/curl/docs/cmdline-opts/use-ascii.md +++ b/deps/curl/docs/cmdline-opts/use-ascii.md @@ -5,7 +5,7 @@ Short: B Long: use-ascii Help: Use ASCII/text transfer Protocols: FTP LDAP -Category: misc +Category: ftp output ldap Added: 5.0 Multi: boolean See-also: @@ -17,6 +17,6 @@ Example: # `--use-ascii` -Enable ASCII transfer. For FTP, this can also be enforced by using a URL that -ends with `;type=A`. This option causes data sent to stdout to be in text mode -for win32 systems. +Enable ASCII transfer mode. For FTP, this can also be enforced by using a URL +that ends with `;type=A`. This option causes data sent to stdout to be in text +mode for Win32 systems. diff --git a/deps/curl/docs/cmdline-opts/variable.md b/deps/curl/docs/cmdline-opts/variable.md index 9da1d3fe..9fe05723 100644 --- a/deps/curl/docs/cmdline-opts/variable.md +++ b/deps/curl/docs/cmdline-opts/variable.md @@ -10,7 +10,7 @@ Multi: append See-also: - config Example: - - --variable name=smith $URL + - --variable name=smith --expand-url "$URL/{{name}}" --- # `--variable` diff --git a/deps/curl/docs/cmdline-opts/verbose.md b/deps/curl/docs/cmdline-opts/verbose.md index 53096c54..d29e23a7 100644 --- a/deps/curl/docs/cmdline-opts/verbose.md +++ b/deps/curl/docs/cmdline-opts/verbose.md @@ -5,12 +5,12 @@ Short: v Long: verbose Mutexed: trace trace-ascii Help: Make the operation more talkative -Category: important verbose +Category: important verbose global Added: 4.0 Multi: boolean Scope: global See-also: - - include + - show-headers - silent - trace - trace-ascii @@ -25,11 +25,30 @@ 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 only want HTTP headers in the output, --show-headers 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. +Since curl 8.10, mentioning this option several times in the same argument +increases the level of the trace output. However, as before, a single +--verbose or --no-verbose reverts any additions by previous `-vv` again. This +means that `-vv -v` is equivalent to a single -v. This avoids unwanted +verbosity when the option is mentioned in the command line *and* curl config +files. + +Using it twice, e.g. `-vv`, outputs time (--trace-time) and transfer ids +(--trace-ids), as well as enable tracing for all protocols (--trace-config +protocol). + +Adding a third verbose outputs transfer content (--trace-ascii %) and enable +tracing of more components (--trace-config read,write,ssl). + +A forth time adds tracing of all network components. (--trace-config network). + +Any addition of the verbose option after that has no effect. + +If you think this option does not give you the right details, consider using +--trace or --trace-ascii instead. Or use it only once and use --trace-config +to trace the specific components you wish to see. Note that verbose output of curl activities and network traffic might contain sensitive data, including usernames, credentials or secret data content. Be diff --git a/deps/curl/docs/cmdline-opts/version.md b/deps/curl/docs/cmdline-opts/version.md index 0fe8d741..0597f84a 100644 --- a/deps/curl/docs/cmdline-opts/version.md +++ b/deps/curl/docs/cmdline-opts/version.md @@ -44,7 +44,10 @@ curl was built with support for character set conversions (like EBCDIC) ## `Debug` This curl uses a libcurl built with Debug. This enables more error-tracking -and memory debugging etc. For curl-developers only! +and memory debugging etc. For curl-developers only. + +## `ECH` +ECH support is present. ## `gsasl` The built-in SASL authentication includes extensions to support SCRAM because @@ -89,6 +92,7 @@ NTLM authentication is supported. ## `NTLM_WB` NTLM delegation to winbind helper is supported. +This feature was removed from curl in 8.8.0. ## `PSL` PSL is short for Public Suffix List and means that this curl has been built diff --git a/deps/curl/docs/cmdline-opts/vlan-priority.md b/deps/curl/docs/cmdline-opts/vlan-priority.md new file mode 100644 index 00000000..34dc8ce0 --- /dev/null +++ b/deps/curl/docs/cmdline-opts/vlan-priority.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: vlan-priority +Arg: +Help: Set VLAN priority +Added: 8.9.0 +Category: connection +Protocols: All +Multi: single +See-also: + - ip-tos +Example: + - --vlan-priority 4 $URL +--- + +# `--vlan-priority` + +Set VLAN priority as defined in IEEE 802.1Q. + +This field is set on Ethernet level, and only works within a local network. + +The valid range for \ is 0 to 7. diff --git a/deps/curl/docs/cmdline-opts/write-out.md b/deps/curl/docs/cmdline-opts/write-out.md index 6a75efea..3f8af2b5 100644 --- a/deps/curl/docs/cmdline-opts/write-out.md +++ b/deps/curl/docs/cmdline-opts/write-out.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: curl Long: write-out Short: w Arg: -Help: Use output FORMAT after completion +Help: Output FORMAT after completion Category: verbose Added: 6.5 Multi: single @@ -63,6 +63,11 @@ The variables available are: Output the certificate chain with details. Supported only by the OpenSSL, GnuTLS, Schannel and Secure Transport backends. (Added in 7.88.0) +## `conn_id` +The connection identifier last used by the transfer. The connection id is +unique number among all connections using the same connection cache. +(Added in 8.2.0) + ## `content_type` The Content-Type of the requested document, if there was any. @@ -75,8 +80,8 @@ The numerical exit code of the transfer. (Added in 7.75.0) ## `filename_effective` The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the --remote-name or --output option. It is -most useful in combination with the --remote-header-name option. (Added in -7.26.0) +most useful in combination with the --remote-header-name option. +(Added in 7.26.0) ## `ftp_entry_path` The initial path curl ended up in when logging on to the remote FTP @@ -130,6 +135,10 @@ redirect). Note that the status line IS NOT a header. (Added in 7.73.0) ## `num_redirects` Number of redirects that were followed in the request. (Added in 7.12.3) +## `num_retries` +Number of retries actually performed when `--retry` has been used. +(Added in 8.9.0) + ## `onerror` The rest of the output is only shown if the transfer returned a non-zero error. (Added in 7.75.0) @@ -212,6 +221,10 @@ remote host (or proxy) was completed. The time, in seconds, it took from the start until the name resolving was completed. +## `time_posttransfer` +The time it took from the start until the last byte is sent by libcurl. +In microseconds. (Added in 8.10.0) + ## `time_pretransfer` The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that @@ -305,3 +318,9 @@ same index number as the origin globbed URL. (Added in 7.75.0) ## `url_effective` The URL that was fetched last. This is most meaningful if you have told curl to follow location: headers. + +## `xfer_id` +The numerical identifier of the last transfer done. -1 if no transfer has been +started yet for the handle. The transfer id is unique among all transfers +performed using the same connection cache. +(Added in 8.2.0) diff --git a/deps/curl/docs/cmdline-opts/xattr.md b/deps/curl/docs/cmdline-opts/xattr.md index a09819ce..0c3bb753 100644 --- a/deps/curl/docs/cmdline-opts/xattr.md +++ b/deps/curl/docs/cmdline-opts/xattr.md @@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl Long: xattr Help: Store metadata in extended file attributes -Category: misc +Category: output Added: 7.21.3 Multi: boolean See-also: @@ -16,8 +16,8 @@ Example: # `--xattr` -When saving output to a file, this option tells curl to store certain file -metadata in extended file attributes. Currently, the URL is stored in the -`xdg.origin.url` attribute and, for HTTP, the content type is stored in the -`mime_type` attribute. If the file system does not support extended -attributes, a warning is issued. +When saving output to a file, tell curl to store file metadata in extended +file attributes. Currently, `curl` is stored in the `creator` attribute, +the URL is stored in the `xdg.origin.url` attribute and, for HTTP, the content +type is stored in the `mime_type` attribute. If the file system does not +support extended attributes, a warning is issued. diff --git a/deps/curl/docs/curl-config.md b/deps/curl/docs/curl-config.md index d8272508..4dfaab6a 100644 --- a/deps/curl/docs/curl-config.md +++ b/deps/curl/docs/curl-config.md @@ -6,6 +6,7 @@ Section: 1 Source: curl-config See-also: - curl (1) +Added-in: 7.7.2 --- # NAME diff --git a/deps/curl/docs/examples/.gitignore b/deps/curl/docs/examples/.gitignore index f9a2c779..68f96939 100644 --- a/deps/curl/docs/examples/.gitignore +++ b/deps/curl/docs/examples/.gitignore @@ -3,12 +3,15 @@ # SPDX-License-Identifier: curl 10-at-a-time +address-scope altsvc anyauthput certinfo chkspeed +connect-to cookie_interface debug +default-scheme externalsocket fileupload fopen @@ -20,10 +23,13 @@ ftpsget ftpupload ftpuploadfrommem ftpuploadresume -getreferrer getinfo getinmemory getredirect +getreferrer +headerapi +hsts-preload +http-options http-post http2-download http2-pushinmemory @@ -50,6 +56,11 @@ imap-search imap-ssl imap-store imap-tls +interface +ipv6 +keepalive +localport +maxconnects multi-app multi-debugcallback multi-double @@ -58,6 +69,8 @@ multi-legacy multi-poll multi-post multi-single +netrc +new-gitignore parseurl persistent pop3-authzid @@ -76,8 +89,11 @@ postinmemory postit2 postit2-formadd progressfunc +protofeats +range resolve rtsp +rtsp-options sendrecv sepheaders sftpget @@ -95,7 +111,10 @@ smtp-ssl smtp-tls smtp-vrfy sslbackend -urlapi +unixsocket url2file +urlapi usercertinmem +websocket +websocket-cb xmlstream diff --git a/deps/curl/docs/examples/10-at-a-time.c b/deps/curl/docs/examples/10-at-a-time.c index a622410f..38a0f24a 100644 --- a/deps/curl/docs/examples/10-at-a-time.c +++ b/deps/curl/docs/examples/10-at-a-time.c @@ -26,12 +26,8 @@ * */ -#include #include #include -#ifndef _WIN32 -# include -#endif #include static const char *urls[] = { @@ -127,7 +123,8 @@ int main(void) int still_alive = 1; curl_multi_perform(cm, &still_alive); - while((msg = curl_multi_info_read(cm, &msgs_left))) { + /* !checksrc! disable EQUALSNULL 1 */ + while((msg = curl_multi_info_read(cm, &msgs_left)) != NULL) { if(msg->msg == CURLMSG_DONE) { char *url; CURL *e = msg->easy_handle; diff --git a/deps/curl/CMake/FindLibSSH2.cmake b/deps/curl/docs/examples/CMakeLists.txt similarity index 54% rename from deps/curl/CMake/FindLibSSH2.cmake rename to deps/curl/docs/examples/CMakeLists.txt index a0c251ae..21c427d1 100644 --- a/deps/curl/CMake/FindLibSSH2.cmake +++ b/deps/curl/docs/examples/CMakeLists.txt @@ -21,25 +21,23 @@ # SPDX-License-Identifier: curl # ########################################################################### -# - Try to find the libssh2 library -# Once done this will define -# -# LIBSSH2_FOUND - system has the libssh2 library -# LIBSSH2_INCLUDE_DIR - the libssh2 include directory -# LIBSSH2_LIBRARY - the libssh2 library name -find_path(LIBSSH2_INCLUDE_DIR libssh2.h) +add_custom_target(curl-examples) -find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2) +# Get 'check_PROGRAMS' variable +transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -if(LIBSSH2_INCLUDE_DIR) - file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION[\t ]+\"(.*)\"") - string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBSSH2_VERSION "${libssh2_version_str}") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibSSH2 - REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR - VERSION_VAR LIBSSH2_VERSION) - -mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) +foreach(_target IN LISTS check_PROGRAMS) + set(_target_name "curl-example-${_target}") + add_executable(${_target_name} EXCLUDE_FROM_ALL "${_target}.c") + add_dependencies(curl-examples ${_target_name}) + target_link_libraries(${_target_name} ${LIB_SELECTED} ${CURL_LIBS}) + target_compile_definitions(${_target_name} PRIVATE "CURL_NO_OLDIES") + if(LIB_SELECTED STREQUAL LIB_STATIC AND WIN32) + set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() + set_target_properties(${_target_name} PROPERTIES + OUTPUT_NAME "${_target}" UNITY_BUILD OFF + PROJECT_LABEL "Example ${_target}") +endforeach() diff --git a/deps/curl/docs/examples/Makefile.am b/deps/curl/docs/examples/Makefile.am index 80ccc592..e5ff9ffd 100644 --- a/deps/curl/docs/examples/Makefile.am +++ b/deps/curl/docs/examples/Makefile.am @@ -24,7 +24,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc -EXTRA_DIST = README.md Makefile.example Makefile.inc Makefile.mk \ +EXTRA_DIST = README.md Makefile.example Makefile.mk CMakeLists.txt \ $(COMPLICATED_EXAMPLES) .checksrc # Specify our include paths here, and do it relative to $(top_srcdir) and @@ -34,8 +34,7 @@ EXTRA_DIST = README.md Makefile.example Makefile.inc Makefile.mk \ # # $(top_srcdir)/include is for libcurl's external include files -AM_CPPFLAGS = -I$(top_srcdir)/include \ - -DCURL_DISABLE_DEPRECATION +AM_CPPFLAGS = -I$(top_srcdir)/include LIBDIR = $(top_builddir)/lib @@ -50,11 +49,7 @@ endif LIBS = $(BLANK_AT_MAKETIME) # Dependencies -if USE_EXPLICIT_LIB_DEPS -LDADD = $(LIBDIR)/libcurl.la @LIBCURL_LIBS@ -else -LDADD = $(LIBDIR)/libcurl.la -endif +LDADD = $(LIBDIR)/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@ # This might hold -Werror CFLAGS += @CURL_CFLAG_EXTRAS@ diff --git a/deps/curl/docs/examples/Makefile.example b/deps/curl/docs/examples/Makefile.example index b10cdecf..cfb59c94 100644 --- a/deps/curl/docs/examples/Makefile.example +++ b/deps/curl/docs/examples/Makefile.example @@ -36,7 +36,7 @@ CFLAGS = -c -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 +# 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 diff --git a/deps/curl/docs/examples/README.md b/deps/curl/docs/examples/README.md index 3f95f03c..a6a31c93 100644 --- a/deps/curl/docs/examples/README.md +++ b/deps/curl/docs/examples/README.md @@ -21,12 +21,12 @@ first. Most examples should build fine using a command line like this: - `curl-config --cc --cflags --libs` -o example example.c + `curl-config --cc --cflags --libs` -o example-my example.c Some compilers do not like having the arguments in this order but instead want you do reorganize them like: - `curl-config --cc` -o example example.c `curl-config --cflags --libs` + `curl-config --cc` -o example-my example.c `curl-config --cflags --libs` **Please** do not use the `curl.se` site as a test target for your libcurl applications/experiments. Even if some of the examples use that site as a URL diff --git a/deps/curl/docs/examples/address-scope.c b/deps/curl/docs/examples/address-scope.c index 5650fdb2..a4ae2653 100644 --- a/deps/curl/docs/examples/address-scope.c +++ b/deps/curl/docs/examples/address-scope.c @@ -44,7 +44,7 @@ int main(void) long my_scope_id; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); - my_scope_id = if_nametoindex("eth0"); + my_scope_id = (long)if_nametoindex("eth0"); curl_easy_setopt(curl, CURLOPT_ADDRESS_SCOPE, my_scope_id); /* Perform the request, res gets the return code */ diff --git a/deps/curl/docs/examples/anyauthput.c b/deps/curl/docs/examples/anyauthput.c index 269e29cf..3bbc056c 100644 --- a/deps/curl/docs/examples/anyauthput.c +++ b/deps/curl/docs/examples/anyauthput.c @@ -100,7 +100,7 @@ int main(int argc, char **argv) fp = fopen(file, "rb"); fstat(FILENO(fp), &file_info); - /* In windows, this inits the winsock stuff */ + /* In Windows, this inits the Winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ diff --git a/deps/curl/docs/examples/chkspeed.c b/deps/curl/docs/examples/chkspeed.c index a8d95666..687b264b 100644 --- a/deps/curl/docs/examples/chkspeed.c +++ b/deps/curl/docs/examples/chkspeed.c @@ -180,31 +180,31 @@ 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)) + if((CURLE_OK == res) && (val > 0)) printf("Data downloaded: %lu bytes.\n", (unsigned long)val); /* check for total download time */ res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME_T, &val); - if((CURLE_OK == res) && (val>0)) + if((CURLE_OK == res) && (val > 0)) printf("Total download time: %lu.%06lu sec.\n", (unsigned long)(val / 1000000), (unsigned long)(val % 1000000)); /* check for average download speed */ res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD_T, &val); - if((CURLE_OK == res) && (val>0)) + if((CURLE_OK == res) && (val > 0)) printf("Average download speed: %lu kbyte/sec.\n", (unsigned long)(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)) + if((CURLE_OK == res) && (val > 0)) printf("Name lookup time: %lu.%06lu sec.\n", (unsigned long)(val / 1000000), (unsigned long)(val % 1000000)); /* check for connect time */ res = curl_easy_getinfo(curl_handle, CURLINFO_CONNECT_TIME_T, &val); - if((CURLE_OK == res) && (val>0)) + if((CURLE_OK == res) && (val > 0)) printf("Connect time: %lu.%06lu sec.\n", (unsigned long)(val / 1000000), (unsigned long)(val % 1000000)); } diff --git a/deps/curl/docs/examples/cookie_interface.c b/deps/curl/docs/examples/cookie_interface.c index 0cc47cff..396aeca9 100644 --- a/deps/curl/docs/examples/cookie_interface.c +++ b/deps/curl/docs/examples/cookie_interface.c @@ -29,10 +29,10 @@ #include #include #include -#include #include #include +#include static void print_cookies(CURL *curl) @@ -91,14 +91,11 @@ main(void) printf("-----------------------------------------------\n" "Setting a cookie \"PREF\" via cookie interface:\n"); -#ifdef _WIN32 -#define snprintf _snprintf -#endif /* Netscape format cookie */ - snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%.0f\t%s\t%s", - ".example.com", "TRUE", "/", "FALSE", - difftime(time(NULL) + 31337, (time_t)0), - "PREF", "hello example, i like you!"); + curl_msnprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%.0f\t%s\t%s", + ".example.com", "TRUE", "/", "FALSE", + difftime(time(NULL) + 31337, (time_t)0), + "PREF", "hello example, i like you!"); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); if(res != CURLE_OK) { fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", @@ -111,7 +108,7 @@ main(void) modified, likely not what you intended. For more information refer to the CURLOPT_COOKIELIST documentation. */ - snprintf(nline, sizeof(nline), + curl_msnprintf(nline, sizeof(nline), "Set-Cookie: OLD_PREF=3d141414bf4209321; " "expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.example.com"); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); diff --git a/deps/curl/docs/examples/debug.c b/deps/curl/docs/examples/debug.c index 68d93039..2bd8b971 100644 --- a/deps/curl/docs/examples/debug.c +++ b/deps/curl/docs/examples/debug.c @@ -49,7 +49,7 @@ void dump(const char *text, fprintf(stream, "%s, %10.10lu bytes (0x%8.8lx)\n", text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { @@ -128,7 +128,7 @@ int main(void) CURLcode res; struct data config; - config.trace_ascii = 1; /* enable ascii tracing */ + config.trace_ascii = 1; /* enable ASCII tracing */ curl = curl_easy_init(); if(curl) { diff --git a/deps/curl/docs/examples/ephiperfifo.c b/deps/curl/docs/examples/ephiperfifo.c index 0c8a2692..8edcd201 100644 --- a/deps/curl/docs/examples/ephiperfifo.c +++ b/deps/curl/docs/examples/ephiperfifo.c @@ -33,7 +33,7 @@ * * Written by Jeff Pohlmeyer, converted to use epoll by Josh Bialkowski -Requires a linux system with epoll +Requires a Linux system with epoll When running, the program creates the named pipe "hiper.fifo" diff --git a/deps/curl/docs/examples/externalsocket.c b/deps/curl/docs/examples/externalsocket.c index 21e9a9c4..01065429 100644 --- a/deps/curl/docs/examples/externalsocket.c +++ b/deps/curl/docs/examples/externalsocket.c @@ -25,19 +25,24 @@ * Pass in a custom socket for libcurl to use. * */ +#ifdef _WIN32 +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS /* for inet_addr() */ +#endif +#endif + #include #include #include #include #ifdef _WIN32 -#include #define close closesocket #else #include /* socket types */ #include /* socket definitions */ #include -#include /* inet (3) functions */ +#include /* inet (3) functions */ #include /* misc. Unix functions */ #endif diff --git a/deps/curl/docs/examples/ftp-wildcard.c b/deps/curl/docs/examples/ftp-wildcard.c index 8a1b3c88..53fb76e3 100644 --- a/deps/curl/docs/examples/ftp-wildcard.c +++ b/deps/curl/docs/examples/ftp-wildcard.c @@ -50,9 +50,9 @@ int main(int argc, char **argv) struct callback_data data = { 0 }; /* global initialization */ - int rc = curl_global_init(CURL_GLOBAL_ALL); + CURLcode rc = curl_global_init(CURL_GLOBAL_ALL); if(rc) - return rc; + return (int)rc; /* initialization of easy handle */ handle = curl_easy_init(); @@ -90,7 +90,7 @@ int main(int argc, char **argv) curl_easy_cleanup(handle); curl_global_cleanup(); - return rc; + return (int)rc; } static long file_is_coming(struct curl_fileinfo *finfo, diff --git a/deps/curl/docs/examples/ftpgetinfo.c b/deps/curl/docs/examples/ftpgetinfo.c index be24fa71..485b26bd 100644 --- a/deps/curl/docs/examples/ftpgetinfo.c +++ b/deps/curl/docs/examples/ftpgetinfo.c @@ -74,7 +74,7 @@ int main(void) } res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &filesize); - if((CURLE_OK == res) && (filesize>0)) + if((CURLE_OK == res) && (filesize > 0)) printf("filesize %s: %" CURL_FORMAT_CURL_OFF_T " bytes\n", filename, filesize); } diff --git a/deps/curl/docs/examples/ftpgetresp.c b/deps/curl/docs/examples/ftpgetresp.c index 33c26b38..256998d8 100644 --- a/deps/curl/docs/examples/ftpgetresp.c +++ b/deps/curl/docs/examples/ftpgetresp.c @@ -48,17 +48,17 @@ int main(void) FILE *respfile; /* local filename to store the file as */ - ftpfile = fopen(FTPBODY, "wb"); /* b is binary, needed on win32 */ + ftpfile = fopen(FTPBODY, "wb"); /* b is binary, needed on Windows */ /* local filename to store the FTP server's response lines in */ - respfile = fopen(FTPHEADERS, "wb"); /* b is binary, needed on win32 */ + respfile = fopen(FTPHEADERS, "wb"); /* b is binary, needed on Windows */ curl = curl_easy_init(); if(curl) { /* Get a file listing from sunet */ curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/"); curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile); - /* If you intend to use this on windows with a libcurl DLL, you must use + /* If you intend to use this on Windows with a libcurl DLL, you must use CURLOPT_WRITEFUNCTION as well */ curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response); curl_easy_setopt(curl, CURLOPT_HEADERDATA, respfile); diff --git a/deps/curl/docs/examples/ftpupload.c b/deps/curl/docs/examples/ftpupload.c index d43f0902..462202e6 100644 --- a/deps/curl/docs/examples/ftpupload.c +++ b/deps/curl/docs/examples/ftpupload.c @@ -90,7 +90,7 @@ int main(void) /* get a FILE * of the same file */ hd_src = fopen(LOCAL_FILE, "rb"); - /* In windows, this inits the winsock stuff */ + /* In Windows, this inits the Winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ diff --git a/deps/curl/docs/examples/ftpuploadfrommem.c b/deps/curl/docs/examples/ftpuploadfrommem.c index 699468d1..25374868 100644 --- a/deps/curl/docs/examples/ftpuploadfrommem.c +++ b/deps/curl/docs/examples/ftpuploadfrommem.c @@ -76,7 +76,7 @@ int main(void) upload.readptr = data; upload.sizeleft = strlen(data); - /* In windows, this inits the winsock stuff */ + /* In Windows, this inits the Winsock stuff */ res = curl_global_init(CURL_GLOBAL_DEFAULT); /* Check for errors */ if(res != CURLE_OK) { diff --git a/deps/curl/docs/examples/ghiper.c b/deps/curl/docs/examples/ghiper.c index ec7174ff..57047edd 100644 --- a/deps/curl/docs/examples/ghiper.c +++ b/deps/curl/docs/examples/ghiper.c @@ -311,7 +311,7 @@ static void new_conn(char *url, GlobalInfo *g) curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)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_NOPROGRESS, SHOW_PROGRESS ? 0L : 1L); 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); diff --git a/deps/curl/docs/examples/htmltidy.c b/deps/curl/docs/examples/htmltidy.c index cc6f63e1..498bb85b 100644 --- a/deps/curl/docs/examples/htmltidy.c +++ b/deps/curl/docs/examples/htmltidy.c @@ -56,8 +56,8 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent) /* walk the attribute list */ for(attr = tidyAttrFirst(child); attr; attr = tidyAttrNext(attr) ) { printf("%s", tidyAttrName(attr)); - tidyAttrValue(attr)?printf("=\"%s\" ", - tidyAttrValue(attr)):printf(" "); + tidyAttrValue(attr) ? printf("=\"%s\" ", + tidyAttrValue(attr)) : printf(" "); } printf(">\n"); } @@ -66,7 +66,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent) TidyBuffer buf; tidyBufInit(&buf); tidyNodeGetText(doc, child, &buf); - printf("%*.*s\n", indent, indent, buf.bp?(char *)buf.bp:""); + printf("%*.*s\n", indent, indent, buf.bp ? (char *)buf.bp : ""); tidyBufFree(&buf); } dumpNode(doc, child, indent + 4); /* recursive */ diff --git a/deps/curl/docs/examples/http-post.c b/deps/curl/docs/examples/http-post.c index 1ee9f69c..901ee1e3 100644 --- a/deps/curl/docs/examples/http-post.c +++ b/deps/curl/docs/examples/http-post.c @@ -33,7 +33,7 @@ int main(void) CURL *curl; CURLcode res; - /* In windows, this inits the winsock stuff */ + /* In Windows, this inits the Winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ diff --git a/deps/curl/docs/examples/http2-download.c b/deps/curl/docs/examples/http2-download.c index c45a1c2d..ff74efb8 100644 --- a/deps/curl/docs/examples/http2-download.c +++ b/deps/curl/docs/examples/http2-download.c @@ -30,10 +30,6 @@ #include #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include #include @@ -69,7 +65,7 @@ void dump(const char *text, unsigned int num, unsigned char *ptr, size_t size, fprintf(stderr, "%u %s, %lu bytes (0x%lx)\n", num, text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { diff --git a/deps/curl/docs/examples/http2-pushinmemory.c b/deps/curl/docs/examples/http2-pushinmemory.c index 74c64e0a..53c368e0 100644 --- a/deps/curl/docs/examples/http2-pushinmemory.c +++ b/deps/curl/docs/examples/http2-pushinmemory.c @@ -29,10 +29,6 @@ #include #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include diff --git a/deps/curl/docs/examples/http2-serverpush.c b/deps/curl/docs/examples/http2-serverpush.c index e830aa95..e259e149 100644 --- a/deps/curl/docs/examples/http2-serverpush.c +++ b/deps/curl/docs/examples/http2-serverpush.c @@ -29,12 +29,9 @@ #include #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include +#include #ifndef CURLPIPE_MULTIPLEX #error "too old libcurl, cannot do HTTP/2 server push!" @@ -56,7 +53,7 @@ void dump(const char *text, unsigned char *ptr, size_t size, fprintf(stderr, "%s, %lu bytes (0x%lx)\n", text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { @@ -176,7 +173,7 @@ static int server_push_callback(CURL *parent, (void)parent; /* we have no use for this */ - snprintf(filename, 128, "push%u", count++); + curl_msnprintf(filename, 128, "push%u", count++); /* here's a new stream, save it in a new file for each new push */ out = fopen(filename, "wb"); @@ -192,7 +189,7 @@ static int server_push_callback(CURL *parent, fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n", count, (unsigned long)num_headers); - for(i = 0; i #include -/* somewhat unix-specific */ +/* somewhat Unix-specific */ +#ifndef _MSC_VER #include #include +#endif /* curl stuff */ #include @@ -49,6 +51,27 @@ #define NUM_HANDLES 1000 +#ifdef _MSC_VER +#define gettimeofday(a, b) my_gettimeofday((a), (b)) +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) + union { + CURL_TYPEOF_CURL_OFF_T ns100; /* time since 1 Jan 1601 in 100ns units */ + FILETIME ft; + } _now; + GetSystemTimeAsFileTime(&_now.ft); + tp->tv_usec = (long)((_now.ns100 / 10) % 1000000); + tp->tv_sec = (long)((_now.ns100 - _WIN32_FT_OFFSET) / 10000000); + } + return 0; +} +#endif + struct input { FILE *in; size_t bytes_read; /* count up */ @@ -71,7 +94,7 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size, fprintf(stderr, "%d %s, %lu bytes (0x%lx)\n", num, text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { @@ -268,7 +291,7 @@ int main(int argc, char **argv) /* init a multi stack */ multi_handle = curl_multi_init(); - for(i = 0; i #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include @@ -57,7 +53,7 @@ int main(void) int msgs_left; /* how many messages are left */ /* Allocate one CURL handle per transfer */ - for(i = 0; imsg == CURLMSG_DONE) { int idx; /* Find out which handle this message is about */ - for(idx = 0; idxeasy_handle == handles[idx]); if(found) break; @@ -107,7 +104,7 @@ int main(void) } /* remove the transfers and cleanup the handles */ - for(i = 0; i #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include @@ -53,7 +49,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr, fprintf(stream, "%s, %10.10lu bytes (0x%8.8lx)\n", text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { diff --git a/deps/curl/docs/examples/multi-double.c b/deps/curl/docs/examples/multi-double.c index 62295a92..99bd736a 100644 --- a/deps/curl/docs/examples/multi-double.c +++ b/deps/curl/docs/examples/multi-double.c @@ -28,10 +28,6 @@ #include #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include diff --git a/deps/curl/docs/examples/multi-formadd.c b/deps/curl/docs/examples/multi-formadd.c index 801b61e6..58c7e641 100644 --- a/deps/curl/docs/examples/multi-formadd.c +++ b/deps/curl/docs/examples/multi-formadd.c @@ -33,7 +33,6 @@ #include #include -#include #include @@ -49,27 +48,29 @@ int main(void) struct curl_slist *headerlist = NULL; static const char buf[] = "Expect:"; - /* Fill in the file upload field. This makes libcurl load data from - the given file name when curl_easy_perform() is called. */ - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "sendfile", - CURLFORM_FILE, "multi-formadd.c", - CURLFORM_END); + 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. */ + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "sendfile", + CURLFORM_FILE, "multi-formadd.c", + CURLFORM_END); - /* Fill in the filename field */ - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "filename", - CURLFORM_COPYCONTENTS, "multi-formadd.c", - CURLFORM_END); + /* Fill in the filename field */ + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "filename", + CURLFORM_COPYCONTENTS, "multi-formadd.c", + CURLFORM_END); - /* Fill in the submit field too, even if this is rarely needed */ - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "submit", - CURLFORM_COPYCONTENTS, "send", - CURLFORM_END); + /* Fill in the submit field too, even if this is rarely needed */ + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "submit", + CURLFORM_COPYCONTENTS, "send", + CURLFORM_END); + ) curl = curl_easy_init(); multi_handle = curl_multi_init(); @@ -84,7 +85,9 @@ int main(void) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); - curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + CURL_IGNORE_DEPRECATION( + curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + ) curl_multi_add_handle(multi_handle, curl); @@ -105,8 +108,10 @@ int main(void) /* always cleanup */ curl_easy_cleanup(curl); - /* then cleanup the formpost chain */ - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + /* then cleanup the formpost chain */ + curl_formfree(formpost); + ) /* free slist */ curl_slist_free_all(headerlist); diff --git a/deps/curl/docs/examples/multi-legacy.c b/deps/curl/docs/examples/multi-legacy.c index 67575418..3e7714f4 100644 --- a/deps/curl/docs/examples/multi-legacy.c +++ b/deps/curl/docs/examples/multi-legacy.c @@ -30,9 +30,11 @@ #include #include -/* somewhat unix-specific */ +/* somewhat Unix-specific */ +#ifndef _WIN32 #include #include +#endif /* curl stuff */ #include @@ -57,7 +59,7 @@ int main(void) int msgs_left; /* how many messages are left */ /* Allocate one CURL handle per transfer */ - for(i = 0; imsg == CURLMSG_DONE) { int idx; /* Find out which handle this message is about */ - for(idx = 0; idxeasy_handle == handles[idx]); if(found) break; @@ -172,7 +175,7 @@ int main(void) curl_multi_cleanup(multi_handle); /* Free the CURL handles */ - for(i = 0; i #include -#include #include diff --git a/deps/curl/docs/examples/multi-single.c b/deps/curl/docs/examples/multi-single.c index f5077850..0ead96f4 100644 --- a/deps/curl/docs/examples/multi-single.c +++ b/deps/curl/docs/examples/multi-single.c @@ -29,10 +29,6 @@ #include #include -/* somewhat unix-specific */ -#include -#include - /* curl stuff */ #include diff --git a/deps/curl/docs/examples/multi-uv.c b/deps/curl/docs/examples/multi-uv.c index 3e967ccd..27a07319 100644 --- a/deps/curl/docs/examples/multi-uv.c +++ b/deps/curl/docs/examples/multi-uv.c @@ -26,12 +26,12 @@ * multi_socket API using libuv * */ -/* Example application using the multi socket interface to download multiple - files in parallel, powered by libuv. +/* Use the socket_action interface to download multiple files in parallel, + powered by libuv. Requires libuv and (of course) libcurl. - See https://nikhilm.github.io/uvbook/ for more information on libuv. + See https://docs.libuv.org/en/v1.x/index.html libuv API documentation */ #include @@ -39,24 +39,30 @@ #include #include -uv_loop_t *loop; -CURLM *curl_handle; -uv_timer_t timeout; +/* object to pass to the callbacks */ +struct datauv { + uv_timer_t timeout; + uv_loop_t *loop; + CURLM *multi; +}; typedef struct curl_context_s { uv_poll_t poll_handle; curl_socket_t sockfd; + struct datauv *uv; } curl_context_t; -static curl_context_t *create_curl_context(curl_socket_t sockfd) +static curl_context_t *create_curl_context(curl_socket_t sockfd, + struct datauv *uv) { curl_context_t *context; context = (curl_context_t *) malloc(sizeof(*context)); context->sockfd = sockfd; + context->uv = uv; - uv_poll_init_socket(loop, &context->poll_handle, sockfd); + uv_poll_init_socket(uv->loop, &context->poll_handle, sockfd); context->poll_handle.data = context; return context; @@ -73,7 +79,7 @@ static void destroy_curl_context(curl_context_t *context) uv_close((uv_handle_t *) &context->poll_handle, curl_close_cb); } -static void add_download(const char *url, int num) +static void add_download(const char *url, int num, CURLM *multi) { char filename[50]; FILE *file; @@ -91,11 +97,11 @@ static void add_download(const char *url, int num) 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_multi_add_handle(multi, handle); fprintf(stderr, "Added download %s -> %s\n", url, filename); } -static void check_multi_info(void) +static void check_multi_info(curl_context_t *context) { char *done_url; CURLMsg *message; @@ -103,7 +109,7 @@ static void check_multi_info(void) CURL *easy_handle; FILE *file; - while((message = curl_multi_info_read(curl_handle, &pending))) { + while((message = curl_multi_info_read(context->uv->multi, &pending))) { switch(message->msg) { case CURLMSG_DONE: /* Do not use message data after calling curl_multi_remove_handle() and @@ -117,7 +123,7 @@ static void check_multi_info(void) curl_easy_getinfo(easy_handle, CURLINFO_PRIVATE, &file); printf("%s DONE\n", done_url); - curl_multi_remove_handle(curl_handle, easy_handle); + curl_multi_remove_handle(context->uv->multi, easy_handle); curl_easy_cleanup(easy_handle); if(file) { fclose(file); @@ -131,73 +137,82 @@ static void check_multi_info(void) } } -static void curl_perform(uv_poll_t *req, int status, int events) +/* callback from libuv on socket activity */ +static void on_uv_socket(uv_poll_t *req, int status, int events) { int running_handles; int flags = 0; - curl_context_t *context; - + curl_context_t *context = (curl_context_t *) req->data; + (void)status; if(events & UV_READABLE) flags |= CURL_CSELECT_IN; if(events & UV_WRITABLE) flags |= CURL_CSELECT_OUT; - context = (curl_context_t *) req->data; - - curl_multi_socket_action(curl_handle, context->sockfd, flags, + curl_multi_socket_action(context->uv->multi, context->sockfd, flags, &running_handles); - - check_multi_info(); + check_multi_info(context); } -static void on_timeout(uv_timer_t *req) +/* callback from libuv when timeout expires */ +static void on_uv_timeout(uv_timer_t *req) { - int running_handles; - curl_multi_socket_action(curl_handle, CURL_SOCKET_TIMEOUT, 0, - &running_handles); - check_multi_info(); -} - -static int start_timeout(CURLM *multi, long timeout_ms, void *userp) -{ - if(timeout_ms < 0) { - uv_timer_stop(&timeout); + curl_context_t *context = (curl_context_t *) req->data; + if(context) { + int running_handles; + curl_multi_socket_action(context->uv->multi, CURL_SOCKET_TIMEOUT, 0, + &running_handles); + check_multi_info(context); } +} + +/* callback from libcurl to update the timeout expiry */ +static int cb_timeout(CURLM *multi, long timeout_ms, + struct datauv *uv) +{ + (void)multi; + if(timeout_ms < 0) + uv_timer_stop(&uv->timeout); else { if(timeout_ms == 0) - timeout_ms = 1; /* 0 means call socket_action asap */ - uv_timer_start(&timeout, on_timeout, timeout_ms, 0); + timeout_ms = 1; /* 0 means call curl_multi_socket_action asap but NOT + within the callback itself */ + uv_timer_start(&uv->timeout, on_uv_timeout, timeout_ms, + 0); /* do not repeat */ } return 0; } -static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, - void *socketp) +/* callback from libcurl to update socket activity to wait for */ +static int cb_socket(CURL *easy, curl_socket_t s, int action, + struct datauv *uv, + void *socketp) { curl_context_t *curl_context; int events = 0; + (void)easy; switch(action) { case CURL_POLL_IN: case CURL_POLL_OUT: case CURL_POLL_INOUT: curl_context = socketp ? - (curl_context_t *) socketp : create_curl_context(s); + (curl_context_t *) socketp : create_curl_context(s, uv); - curl_multi_assign(curl_handle, s, (void *) curl_context); + curl_multi_assign(uv->multi, s, (void *) curl_context); if(action != CURL_POLL_IN) events |= UV_WRITABLE; if(action != CURL_POLL_OUT) events |= UV_READABLE; - uv_poll_start(&curl_context->poll_handle, events, curl_perform); + uv_poll_start(&curl_context->poll_handle, events, on_uv_socket); break; case CURL_POLL_REMOVE: if(socketp) { uv_poll_stop(&((curl_context_t*)socketp)->poll_handle); destroy_curl_context((curl_context_t*) socketp); - curl_multi_assign(curl_handle, s, NULL); + curl_multi_assign(uv->multi, s, NULL); } break; default: @@ -209,28 +224,31 @@ static int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, int main(int argc, char **argv) { - loop = uv_default_loop(); + struct datauv uv = { 0 }; + int running_handles; if(argc <= 1) return 0; - if(curl_global_init(CURL_GLOBAL_ALL)) { - fprintf(stderr, "Could not init curl\n"); - return 1; - } + curl_global_init(CURL_GLOBAL_ALL); - uv_timer_init(loop, &timeout); + uv.loop = uv_default_loop(); + uv_timer_init(uv.loop, &uv.timeout); - curl_handle = curl_multi_init(); - curl_multi_setopt(curl_handle, CURLMOPT_SOCKETFUNCTION, handle_socket); - curl_multi_setopt(curl_handle, CURLMOPT_TIMERFUNCTION, start_timeout); + uv.multi = curl_multi_init(); + curl_multi_setopt(uv.multi, CURLMOPT_SOCKETFUNCTION, cb_socket); + curl_multi_setopt(uv.multi, CURLMOPT_SOCKETDATA, &uv); + curl_multi_setopt(uv.multi, CURLMOPT_TIMERFUNCTION, cb_timeout); + curl_multi_setopt(uv.multi, CURLMOPT_TIMERDATA, &uv); while(argc-- > 1) { - add_download(argv[argc], argc); + add_download(argv[argc], argc, uv.multi); } - uv_run(loop, UV_RUN_DEFAULT); - curl_multi_cleanup(curl_handle); + /* kickstart the thing */ + curl_multi_socket_action(uv.multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); + uv_run(uv.loop, UV_RUN_DEFAULT); + curl_multi_cleanup(uv.multi); return 0; } diff --git a/deps/curl/docs/examples/multithread.c b/deps/curl/docs/examples/multithread.c index cc4ce7c1..299edd57 100644 --- a/deps/curl/docs/examples/multithread.c +++ b/deps/curl/docs/examples/multithread.c @@ -75,7 +75,7 @@ int main(int argc, char **argv) /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); - for(i = 0; i< NUMT; i++) { + for(i = 0; i < NUMT; i++) { int error = pthread_create(&tid[i], NULL, /* default attributes please */ pull_one_url, @@ -87,7 +87,7 @@ int main(int argc, char **argv) } /* now wait for all threads to terminate */ - for(i = 0; i< NUMT; i++) { + for(i = 0; i < NUMT; i++) { pthread_join(tid[i], NULL); fprintf(stderr, "Thread %d terminated\n", i); } diff --git a/deps/curl/docs/examples/persistent.c b/deps/curl/docs/examples/persistent.c index 4be7d6f2..be5e8c33 100644 --- a/deps/curl/docs/examples/persistent.c +++ b/deps/curl/docs/examples/persistent.c @@ -26,7 +26,7 @@ * */ #include -#include + #include int main(void) diff --git a/deps/curl/docs/examples/post-callback.c b/deps/curl/docs/examples/post-callback.c index 311bc3ca..1a213cb2 100644 --- a/deps/curl/docs/examples/post-callback.c +++ b/deps/curl/docs/examples/post-callback.c @@ -73,7 +73,7 @@ int main(void) wt.readptr = data; wt.sizeleft = strlen(data); - /* In windows, this inits the winsock stuff */ + /* In Windows, this inits the Winsock stuff */ res = curl_global_init(CURL_GLOBAL_DEFAULT); /* Check for errors */ if(res != CURLE_OK) { diff --git a/deps/curl/docs/examples/postit2-formadd.c b/deps/curl/docs/examples/postit2-formadd.c index 02e50aa3..0d903461 100644 --- a/deps/curl/docs/examples/postit2-formadd.c +++ b/deps/curl/docs/examples/postit2-formadd.c @@ -59,27 +59,29 @@ int main(int argc, char *argv[]) curl_global_init(CURL_GLOBAL_ALL); - /* Fill in the file upload field */ - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "sendfile", - CURLFORM_FILE, "postit2-formadd.c", - CURLFORM_END); + CURL_IGNORE_DEPRECATION( + /* Fill in the file upload field */ + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "sendfile", + CURLFORM_FILE, "postit2-formadd.c", + CURLFORM_END); - /* Fill in the filename field */ - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "filename", - CURLFORM_COPYCONTENTS, "postit2-formadd.c", - CURLFORM_END); + /* Fill in the filename field */ + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "filename", + CURLFORM_COPYCONTENTS, "postit2-formadd.c", + CURLFORM_END); - /* Fill in the submit field too, even if this is rarely needed */ - curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "submit", - CURLFORM_COPYCONTENTS, "send", - CURLFORM_END); + /* Fill in the submit field too, even if this is rarely needed */ + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "submit", + CURLFORM_COPYCONTENTS, "send", + CURLFORM_END); + ) curl = curl_easy_init(); /* initialize custom header list (stating that Expect: 100-continue is not @@ -91,7 +93,9 @@ int main(int argc, char *argv[]) if((argc == 2) && (!strcmp(argv[1], "noexpectheader"))) /* only disable 100-continue header if explicitly requested */ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); - curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + CURL_IGNORE_DEPRECATION( + curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + ) /* Perform the request, res gets the return code */ res = curl_easy_perform(curl); @@ -103,8 +107,11 @@ int main(int argc, char *argv[]) /* always cleanup */ curl_easy_cleanup(curl); - /* then cleanup the formpost chain */ - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + /* then cleanup the formpost chain */ + curl_formfree(formpost); + ) + /* free slist */ curl_slist_free_all(headerlist); } diff --git a/deps/curl/docs/examples/sendrecv.c b/deps/curl/docs/examples/sendrecv.c index 0b7e86a3..93e06099 100644 --- a/deps/curl/docs/examples/sendrecv.c +++ b/deps/curl/docs/examples/sendrecv.c @@ -48,9 +48,12 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms) * warning: conversion to 'long unsigned int' from 'curl_socket_t' {aka 'int'} * may change the sign of the result [-Wsign-conversion] */ -#if defined(__GNUC__) && defined(__CYGWIN__) +#if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4127) /* conditional expression is constant */ #endif FD_SET(sockfd, &errfd); /* always check for error */ @@ -60,8 +63,10 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms) else { FD_SET(sockfd, &outfd); } -#if defined(__GNUC__) && defined(__CYGWIN__) +#if defined(__GNUC__) #pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) #endif /* select() returns the number of signalled sockets or -1 */ diff --git a/deps/curl/docs/examples/sepheaders.c b/deps/curl/docs/examples/sepheaders.c index 0d090ed8..31a32012 100644 --- a/deps/curl/docs/examples/sepheaders.c +++ b/deps/curl/docs/examples/sepheaders.c @@ -27,7 +27,6 @@ */ #include #include -#include #include diff --git a/deps/curl/docs/examples/simplessl.c b/deps/curl/docs/examples/simplessl.c index 7145493a..fcbb5a46 100644 --- a/deps/curl/docs/examples/simplessl.c +++ b/deps/curl/docs/examples/simplessl.c @@ -83,6 +83,10 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://your.favourite.ssl.site"); 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 */ @@ -94,7 +98,7 @@ int main(void) 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 - a engine in a curl object... */ + an engine in a curl object... */ fprintf(stderr, "cannot set crypto engine as default\n"); break; } @@ -133,6 +137,9 @@ int main(void) /* we are done... */ } while(0); +#ifdef _MSC_VER +#pragma warning(pop) +#endif /* always cleanup */ curl_easy_cleanup(curl); } diff --git a/deps/curl/docs/examples/synctime.c b/deps/curl/docs/examples/synctime.c index ab61b2fb..6c495f4a 100644 --- a/deps/curl/docs/examples/synctime.c +++ b/deps/curl/docs/examples/synctime.c @@ -165,7 +165,7 @@ 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 */ - for(i = 0; i<12; i++) { + for(i = 0; i < 12; i++) { if(strcmp(MthStr[i], TmpStr2) == 0) { SYSTime.wMonth = i + 1; break; @@ -250,7 +250,7 @@ int conf_init(conf_t *conf) int i; *conf->http_proxy = 0; - for(i = 0; iproxy_user[i] = 0; /* Clean up password from memory */ *conf->timeserver = 0; return 1; diff --git a/deps/curl/docs/examples/threaded-ssl.c b/deps/curl/docs/examples/threaded-ssl.c index f58e4474..c903fced 100644 --- a/deps/curl/docs/examples/threaded-ssl.c +++ b/deps/curl/docs/examples/threaded-ssl.c @@ -27,13 +27,13 @@ * */ /* A multi-threaded example that uses pthreads and fetches 4 remote files at - * once over HTTPS. The lock callbacks and stuff assume OpenSSL <1.1 or GnuTLS - * (libgcrypt) so far. + * once over HTTPS. * - * OpenSSL docs for this: - * https://www.openssl.org/docs/man1.0.2/man3/CRYPTO_num_locks.html - * gcrypt docs for this: - * https://gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html + * Recent versions of OpenSSL and GnuTLS are thread safe by design, assuming + * support for the underlying OS threading API is built-in. Older revisions + * of this example demonstrated locking callbacks for the SSL library, which + * are no longer necessary. An older revision with callbacks can be found at + * https://github.com/curl/curl/blob/curl-7_88_1/docs/examples/threaded-ssl.c */ #define USE_OPENSSL /* or USE_GNUTLS accordingly */ @@ -44,71 +44,6 @@ #define NUMT 4 -/* we have this global to let the callback get easy access to it */ -static pthread_mutex_t *lockarray; - -#ifdef USE_OPENSSL -#include -static void lock_callback(int mode, int type, char *file, int line) -{ - (void)file; - (void)line; - if(mode & CRYPTO_LOCK) { - pthread_mutex_lock(&(lockarray[type])); - } - else { - pthread_mutex_unlock(&(lockarray[type])); - } -} - -static unsigned long thread_id(void) -{ - unsigned long ret; - - ret = (unsigned long)pthread_self(); - return ret; -} - -static void init_locks(void) -{ - int i; - - lockarray = (pthread_mutex_t *)OPENSSL_malloc(CRYPTO_num_locks() * - sizeof(pthread_mutex_t)); - for(i = 0; i -#include - -GCRY_THREAD_OPTION_PTHREAD_IMPL; - -void init_locks(void) -{ - gcry_control(GCRYCTL_SET_THREAD_CBS); -} - -#define kill_locks() -#endif - /* List of URLs to fetch.*/ const char * const urls[]= { "https://www.example.com/", @@ -143,9 +78,7 @@ int main(int argc, char **argv) /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); - init_locks(); - - for(i = 0; i< NUMT; i++) { + for(i = 0; i < NUMT; i++) { int error = pthread_create(&tid[i], NULL, /* default attributes please */ pull_one_url, @@ -157,12 +90,10 @@ int main(int argc, char **argv) } /* now wait for all threads to terminate */ - for(i = 0; i< NUMT; i++) { + for(i = 0; i < NUMT; i++) { pthread_join(tid[i], NULL); fprintf(stderr, "Thread %d terminated\n", i); } - kill_locks(); - return 0; } diff --git a/deps/curl/docs/examples/unixsocket.c b/deps/curl/docs/examples/unixsocket.c index 90c65591..299a121d 100644 --- a/deps/curl/docs/examples/unixsocket.c +++ b/deps/curl/docs/examples/unixsocket.c @@ -22,7 +22,7 @@ * ***************************************************************************/ /* - * Access HTTP server over unix domain socket + * Access HTTP server over Unix domain socket * */ #include diff --git a/deps/curl/docs/examples/url2file.c b/deps/curl/docs/examples/url2file.c index f95d5746..9ed7da5a 100644 --- a/deps/curl/docs/examples/url2file.c +++ b/deps/curl/docs/examples/url2file.c @@ -27,7 +27,6 @@ */ #include #include -#include #include diff --git a/deps/curl/docs/examples/usercertinmem.c b/deps/curl/docs/examples/usercertinmem.c index b35d9820..7b338cd9 100644 --- a/deps/curl/docs/examples/usercertinmem.c +++ b/deps/curl/docs/examples/usercertinmem.c @@ -157,7 +157,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm) printf("Use Key failed\n"); } - /* free resources that have been allocated by openssl functions */ + /* free resources that have been allocated by OpenSSL functions */ if(bio) BIO_free(bio); diff --git a/deps/curl/docs/examples/websocket.c b/deps/curl/docs/examples/websocket.c index 039b4f8b..996f2a02 100644 --- a/deps/curl/docs/examples/websocket.c +++ b/deps/curl/docs/examples/websocket.c @@ -27,7 +27,13 @@ */ #include #include +#ifdef _WIN32 +#include +#define sleep(s) Sleep((DWORD)(s)) +#else #include +#endif + #include static int ping(CURL *curl, const char *send_payload) @@ -68,16 +74,13 @@ static int recv_pong(CURL *curl, const char *expected_payload) return (int)result; } -static int recv_any(CURL *curl) +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; - return 0; + return curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); } /* close the connection */ diff --git a/deps/curl/docs/examples/xmlstream.c b/deps/curl/docs/examples/xmlstream.c index 76a8e48c..d779e6e7 100644 --- a/deps/curl/docs/examples/xmlstream.c +++ b/deps/curl/docs/examples/xmlstream.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/deps/curl/docs/BUFQ.md b/deps/curl/docs/internals/BUFQ.md similarity index 94% rename from deps/curl/docs/BUFQ.md rename to deps/curl/docs/internals/BUFQ.md index 26cfccf4..bb577845 100644 --- a/deps/curl/docs/BUFQ.md +++ b/deps/curl/docs/internals/BUFQ.md @@ -1,3 +1,9 @@ + + # bufq This is an internal module for managing I/O buffers. A `bufq` can be written @@ -70,6 +76,17 @@ void Curl_bufq_skip(struct bufq *q, size_t amount); This removes `amount` number of bytes from the `bufq`. +## unwrite + +It is possible to undo writes by calling: + +``` +CURLcode Curl_bufq_unwrite(struct bufq *q, size_t len); +``` + +This will remove `len` bytes from the end of the bufq again. When removing +more bytes than are present, CURLE_AGAIN is returned and the bufq will be +empty. ## lifetime diff --git a/deps/curl/docs/BUFREF.md b/deps/curl/docs/internals/BUFREF.md similarity index 95% rename from deps/curl/docs/BUFREF.md rename to deps/curl/docs/internals/BUFREF.md index 9ee8fdbb..9a8b506b 100644 --- a/deps/curl/docs/BUFREF.md +++ b/deps/curl/docs/internals/BUFREF.md @@ -1,3 +1,9 @@ + + # bufref This is an internal module for handling buffer references. A referenced diff --git a/deps/curl/docs/CHECKSRC.md b/deps/curl/docs/internals/CHECKSRC.md similarity index 98% rename from deps/curl/docs/CHECKSRC.md rename to deps/curl/docs/internals/CHECKSRC.md index fc500453..16eb96c7 100644 --- a/deps/curl/docs/CHECKSRC.md +++ b/deps/curl/docs/internals/CHECKSRC.md @@ -1,3 +1,9 @@ + + # checksrc This is the tool we use within the curl project to scan C source code and diff --git a/deps/curl/docs/CLIENT-READERS.md b/deps/curl/docs/internals/CLIENT-READERS.md similarity index 98% rename from deps/curl/docs/CLIENT-READERS.md rename to deps/curl/docs/internals/CLIENT-READERS.md index dec35b32..07306384 100644 --- a/deps/curl/docs/CLIENT-READERS.md +++ b/deps/curl/docs/internals/CLIENT-READERS.md @@ -1,3 +1,9 @@ + + # curl client readers Client readers is a design in the internals of libcurl, not visible in its public API. They were started @@ -117,7 +123,7 @@ Readers operating on callbacks to the application need to "rewind" the underlyin ## 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. diff --git a/deps/curl/docs/CLIENT-WRITERS.md b/deps/curl/docs/internals/CLIENT-WRITERS.md similarity index 98% rename from deps/curl/docs/CLIENT-WRITERS.md rename to deps/curl/docs/internals/CLIENT-WRITERS.md index 227e11db..9f7197d2 100644 --- a/deps/curl/docs/CLIENT-WRITERS.md +++ b/deps/curl/docs/internals/CLIENT-WRITERS.md @@ -1,3 +1,9 @@ + + # curl client writers Client writers is a design in the internals of libcurl, not visible in its public API. They were started @@ -115,4 +121,3 @@ That is why transfer decoding writers are added for phase `CURL_CW_TRANSFER_DECO 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. - diff --git a/deps/curl/docs/CODE_STYLE.md b/deps/curl/docs/internals/CODE_STYLE.md similarity index 97% rename from deps/curl/docs/CODE_STYLE.md rename to deps/curl/docs/internals/CODE_STYLE.md index 970a3b0a..f64c5eb7 100644 --- a/deps/curl/docs/CODE_STYLE.md +++ b/deps/curl/docs/internals/CODE_STYLE.md @@ -1,3 +1,9 @@ + + # curl C code style Source code that has a common style is easier to read than code that uses @@ -265,7 +271,7 @@ DEBUGF(infof(data, "Curl_pp_readresp_ %d bytes of trailing " Use **#ifdef HAVE_FEATURE** to do conditional code. We avoid checking for particular operating systems or hardware in the #ifdef lines. The HAVE_FEATURE -shall be generated by the configure script for unix-like systems and they are +shall be generated by the configure script for Unix-like systems and they are hard-coded in the `config-[system].h` files for the others. We also encourage use of macros/functions that possibly are empty or defined diff --git a/deps/curl/docs/CONNECTION-FILTERS.md b/deps/curl/docs/internals/CONNECTION-FILTERS.md similarity index 99% rename from deps/curl/docs/CONNECTION-FILTERS.md rename to deps/curl/docs/internals/CONNECTION-FILTERS.md index 06ec0293..629e769b 100644 --- a/deps/curl/docs/CONNECTION-FILTERS.md +++ b/deps/curl/docs/internals/CONNECTION-FILTERS.md @@ -1,3 +1,9 @@ + + # curl connection filters Connection filters is a design in the internals of curl, not visible in its @@ -265,7 +271,7 @@ 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 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: @@ -300,4 +306,3 @@ conn[curl.se] --> HTTPS-CONNECT --> NULL conn[curl.se] --> HTTPS-CONNECT --> SETUP[QUIC] --> HAPPY-EYEBALLS --> HTTP/3[151.101.1.91]:443 * transfer ``` - diff --git a/deps/curl/docs/DYNBUF.md b/deps/curl/docs/internals/DYNBUF.md similarity index 97% rename from deps/curl/docs/DYNBUF.md rename to deps/curl/docs/internals/DYNBUF.md index 3f63ec7e..01fe332a 100644 --- a/deps/curl/docs/DYNBUF.md +++ b/deps/curl/docs/internals/DYNBUF.md @@ -1,3 +1,9 @@ + + # dynbuf This is the internal module for creating and handling "dynamic buffers". This diff --git a/deps/curl/docs/internals/HASH.md b/deps/curl/docs/internals/HASH.md new file mode 100644 index 00000000..5a5bdc98 --- /dev/null +++ b/deps/curl/docs/internals/HASH.md @@ -0,0 +1,188 @@ + + +# `hash` + + #include "hash.h" + +This is the internal module for doing hash tables. A hash table uses a hash +function to compute an index. On each index there is a separate linked list of +entries. + +Create a hash table. Add items. Retrieve items. Remove items. Destroy table. + +## `Curl_hash_init` + +~~~c +void Curl_hash_init(struct Curl_hash *h, + size_t slots, + hash_function hfunc, + comp_function comparator, + Curl_hash_dtor dtor); +~~~ + +The call initializes a `struct Curl_hash`. + +- `slots` is the number of entries to create in the hash table. Larger is + better (faster lookups) but also uses more memory. +- `hfunc` is a function pointer to a function that returns a `size_t` value as + a checksum for an entry in this hash table. Ideally, it returns a unique + value for every entry ever added to the hash table, but hash collisions are + handled. +- `comparator` is a function pointer to a function that compares two hash + table entries. It should return non-zero if the compared items are + identical. +- `dtor` is a function pointer to a destructor called when an entry is removed + from the table + +## `Curl_hash_add` + +~~~c +void * +Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) +~~~ + +This call adds an entry to the hash. `key` points to the hash key and +`key_len` is the length of the hash key. `p` is a custom pointer. + +If there already was a match in the hash, that data is replaced with this new +entry. + +This function also lazily allocates the table if needed, as it is not done in +the `Curl_hash_init` function. + +Returns NULL on error, otherwise it returns a pointer to `p`. + +## `Curl_hash_add2` + +~~~c +void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, + Curl_hash_elem_dtor dtor) +~~~ + +This works like `Curl_hash_add` but has an extra argument: `dtor`, which is a +destructor call for this specific entry. When this entry is removed, this +function is called instead of the function stored for the whole hash table. + +## `Curl_hash_delete` + +~~~c +int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len); +~~~ + +This function removes an entry from the hash table. If successful, it returns +zero. If the entry was not found, it returns 1. + +## `Curl_hash_pick` + +~~~c +void *Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len); +~~~ + +If there is an entry in the hash that matches the given `key` with size of +`key_len`, that its custom pointer is returned. The pointer that was called +`p` when the entry was added. + +It returns NULL if there is no matching entry in the hash. + +## `Curl_hash_destroy` + +~~~c +void Curl_hash_destroy(struct Curl_hash *h); +~~~ + +This function destroys a hash and cleanups up all its related data. Calling it +multiple times is fine. + +## `Curl_hash_clean` + +~~~c +void Curl_hash_clean(struct Curl_hash *h); +~~~ + +This function removes all the entries in the given hash. + +## `Curl_hash_clean_with_criterium` + +~~~c +void +Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, + int (*comp)(void *, void *)) +~~~ + +This function removes all the entries in the given hash that matches the +criterion. The provided `comp` function determines if the criteria is met by +returning non-zero. + +## `Curl_hash_count` + +~~~c +size_t Curl_hash_count(struct Curl_hash *h) +~~~ + +Returns the number of entries stored in the hash. + +## `Curl_hash_start_iterate` + +~~~c +void Curl_hash_start_iterate(struct Curl_hash *hash, + struct Curl_hash_iterator *iter): +~~~ + +This function initializes a `struct Curl_hash_iterator` that `iter` points to. +It can then be used to iterate over all the entries in the hash. + +## `Curl_hash_next_element` + +~~~c +struct Curl_hash_element * +Curl_hash_next_element(struct Curl_hash_iterator *iter); +~~~ + +Given the iterator `iter`, this function returns a pointer to the next hash +entry if there is one, or NULL if there is no more entries. + +Called repeatedly, it iterates over all the entries in the hash table. + +Note: it only guarantees functionality if the hash table remains untouched +during its iteration. + +# `curl_off_t` dedicated hash functions + +## `Curl_hash_offt_init` + +~~~c +void Curl_hash_offt_init(struct Curl_hash *h, + size_t slots, + Curl_hash_dtor dtor); +~~~ + +Initializes a hash table for `curl_off_t` values. Pass in desired number of +`slots` and `dtor` function. + +## `Curl_hash_offt_set` + +~~~c +void *Curl_hash_offt_set(struct Curl_hash *h, curl_off_t id, void *elem); +~~~ + +Associate a custom `elem` pointer with the given `id`. + +## `Curl_hash_offt_remove` + +~~~c +int Curl_hash_offt_remove(struct Curl_hash *h, curl_off_t id); +~~~ + +Remove the `id` from the hash. + +## `Curl_hash_offt_get` + +~~~c +void *Curl_hash_offt_get(struct Curl_hash *h, curl_off_t id); +~~~ + +Get the pointer associated with the specified `id`. diff --git a/deps/curl/docs/HYPER.md b/deps/curl/docs/internals/HYPER.md similarity index 93% rename from deps/curl/docs/HYPER.md rename to deps/curl/docs/internals/HYPER.md index 1e47c423..bbaa4e4d 100644 --- a/deps/curl/docs/HYPER.md +++ b/deps/curl/docs/internals/HYPER.md @@ -1,9 +1,15 @@ + + # Hyper Hyper is a separate HTTP library written in Rust. curl can be told to use this library as a backend to deal with HTTP. -## Experimental! +## EXPERIMENTAL Hyper support in curl is considered **EXPERIMENTAL** until further notice. It needs to be explicitly enabled at build-time. @@ -15,7 +21,7 @@ in the master branch using pull-requests, just like ordinary changes. The C API for Hyper is brand new and is still under development. -## build curl with hyper +## Build curl with hyper Using Rust 1.64.0 or later, build hyper and enable its C API like this: @@ -33,7 +39,7 @@ Build curl to use hyper's C API: % ./configure LDFLAGS="-Wl,-rpath,/target/debug -Wl,-rpath,/target/release" --with-openssl --with-hyper= % make -# using Hyper internally +# Using Hyper internally Hyper is a low level HTTP transport library. curl itself provides all HTTP headers and Hyper provides all received headers back to curl. diff --git a/deps/curl/docs/internals/LLIST.md b/deps/curl/docs/internals/LLIST.md new file mode 100644 index 00000000..ee9a89ba --- /dev/null +++ b/deps/curl/docs/internals/LLIST.md @@ -0,0 +1,190 @@ + + +# `llist` - linked lists + + #include "llist.h" + +This is the internal module for linked lists. The API is designed to be +flexible but also to avoid dynamic memory allocation. + +None of the involved structs should be accessed using struct fields (outside +of `llist.c`). Use the functions. + +## Setup and shutdown + +`struct Curl_llist` is the struct holding a single linked list. It needs to be +initialized with a call to `Curl_llist_init()` before it can be used + +To clean up a list, call `Curl_llist_destroy()`. Since the linked lists +themselves do not allocate memory, it can also be fine to just *not* clean up +the list. + +## Add a node + +There are two functions for adding a node to a linked list: + +1. Add it last in the list with `Curl_llist_append` +2. Add it after a specific existing node with `Curl_llist_insert_next` + +When a node is added to a list, it stores an associated custom pointer to +anything you like and you provide a pointer to a `struct Curl_llist_node` +struct in which it stores and updates pointers. If you intend to add the same +struct to multiple lists concurrently, you need to have one `struct +Curl_llist_node` for each list. + +Add a node to a list with `Curl_llist_append(list, elem, node)`. Where + +- `list`: points to a `struct Curl_llist` +- `elem`: points to what you want added to the list +- `node`: is a pointer to a `struct Curl_llist_node`. Data storage for this + node. + +Example: to add a `struct foobar` to a linked list. Add a node struct within +it: + + struct foobar { + char *random; + struct Curl_llist_node storage; /* can be anywhere in the struct */ + char *data; + }; + + struct Curl_llist barlist; /* the list for foobar entries */ + struct foobar entries[10]; + + Curl_llist_init(&barlist, NULL); + + /* add the first struct to the list */ + Curl_llist_append(&barlist, &entries[0], &entries[0].storage); + +See also `Curl_llist_insert_next`. + +## Remove a node + +Remove a node again from a list by calling `Curl_llist_remove()`. + +## Iterate + +To iterate over a list: first get the head entry and then iterate over the +nodes as long there is a next. Each node has an *element* associated with it, +the custom pointer you stored there. Usually a struct pointer or similar. + + struct Curl_llist_node *iter; + + /* get the first entry of the 'barlist' */ + iter = Curl_llist_head(&barlist); + + while(iter) { + /* extract the element pointer from the node */ + struct foobar *elem = Curl_node_elem(iter); + + /* advance to the next node in the list */ + iter = Curl_node_next(iter); + } + +# Function overview + +## `Curl_llist_init` + +~~~c +void Curl_llist_init(struct Curl_llist *list, Curl_llist_dtor dtor); +~~~ + +Initializes the `list`. The argument `dtor` is NULL or a function pointer that +gets called when list nodes are removed from this list. + +The function is infallible. + +~~~c +typedef void (*Curl_llist_dtor)(void *user, void *elem); +~~~ + +`dtor` is called with two arguments: `user` and `elem`. The first being the +`user` pointer passed in to `Curl_llist_remove()`or `Curl_llist_destroy()` and +the second is the `elem` pointer associated with removed node. The pointer +that `Curl_node_elem()` would have returned for that node. + +## `Curl_llist_destroy` + +~~~c +void Curl_llist_destroy(struct Curl_llist *list, void *user); +~~~ + +This removes all nodes from the `list`. This leaves the list in a cleared +state. + +The function is infallible. + +## `Curl_llist_append` + +~~~c +void Curl_llist_append(struct Curl_llist *list, + const void *elem, struct Curl_llist_node *node); +~~~ + +Adds `node` last in the `list` with a custom pointer to `elem`. + +The function is infallible. + +## `Curl_llist_insert_next` + +~~~c +void Curl_llist_insert_next(struct Curl_llist *list, + struct Curl_llist_node *node, + const void *elem, + struct Curl_llist_node *node); +~~~ + +Adds `node` to the `list` with a custom pointer to `elem` immediately after +the previous list `node`. + +The function is infallible. + +## `Curl_llist_head` + +~~~c +struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list); +~~~ + +Returns a pointer to the first node of the `list`, or a NULL if empty. + +## `Curl_node_uremove` + +~~~c +void Curl_node_uremove(struct Curl_llist_node *node, void *user); +~~~ + +Removes the `node` the list it was previously added to. Passes the `user` +pointer to the list's destructor function if one was setup. + +The function is infallible. + +## `Curl_node_remove` + +~~~c +void Curl_node_remove(struct Curl_llist_node *node); +~~~ + +Removes the `node` the list it was previously added to. Passes a NULL pointer +to the list's destructor function if one was setup. + +The function is infallible. + +## `Curl_node_elem` + +~~~c +void *Curl_node_elem(struct Curl_llist_node *node); +~~~ + +Given a list node, this function returns the associated element. + +## `Curl_node_next` + +~~~c +struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *node); +~~~ + +Given a list node, this function returns the next node in the list. diff --git a/deps/curl/docs/MQTT.md b/deps/curl/docs/internals/MQTT.md similarity index 50% rename from deps/curl/docs/MQTT.md rename to deps/curl/docs/internals/MQTT.md index 35c4e769..90d641b3 100644 --- a/deps/curl/docs/MQTT.md +++ b/deps/curl/docs/internals/MQTT.md @@ -1,21 +1,45 @@ + + # MQTT in curl ## Usage 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: + + curl mqtt://host/topic + Example subscribe: curl mqtt://host.home/bedroom/temp +This will send an MQTT SUBSCRIBE packet for the topic `bedroom/temp` and listen in for incoming PUBLISH packets. + +### Publishing + +Command usage: + + curl -d payload mqtt://host/topic + Example publish: curl -d 75 mqtt://host.home/bedroom/dimmer +This will send an MQTT PUBLISH packet to the topic `bedroom/dimmer` with the payload `75`. + ## What does curl deliver as a response to a subscribe -It outputs two bytes topic length (MSB | LSB), the topic followed by the +Whenever a PUBLISH packet is received, curl outputs two bytes topic length (MSB | LSB), the topic followed by the payload. ## Caveats diff --git a/deps/curl/docs/NEW-PROTOCOL.md b/deps/curl/docs/internals/NEW-PROTOCOL.md similarity index 97% rename from deps/curl/docs/NEW-PROTOCOL.md rename to deps/curl/docs/internals/NEW-PROTOCOL.md index b70caa94..35beba6e 100644 --- a/deps/curl/docs/NEW-PROTOCOL.md +++ b/deps/curl/docs/internals/NEW-PROTOCOL.md @@ -1,3 +1,9 @@ + + # Adding a new protocol? Every once in a while, someone comes up with the idea of adding support for yet @@ -95,7 +101,7 @@ peculiarities of the protocol. It needs documentation. Maybe it even needs some internal documentation so that the developers who try to debug something five years from now can figure out functionality a little -easier! +easier. The protocol specification itself should be freely available without requiring a non-disclosure agreement or similar. diff --git a/deps/curl/docs/internals/README.md b/deps/curl/docs/internals/README.md new file mode 100644 index 00000000..289b360a --- /dev/null +++ b/deps/curl/docs/internals/README.md @@ -0,0 +1,12 @@ + + +# Internals + +This directory contains documentation covering libcurl internals; APIs and +concepts that are useful for contributors and maintainers. + +Public APIs are documented in the public documentation, not here. diff --git a/deps/curl/docs/internals/SPLAY.md b/deps/curl/docs/internals/SPLAY.md new file mode 100644 index 00000000..29cf3858 --- /dev/null +++ b/deps/curl/docs/internals/SPLAY.md @@ -0,0 +1,111 @@ + + +# `splay` + + #include "splay.h" + +This is an internal module for splay tree management. A splay tree is a binary +search tree with the additional property that recently accessed elements are +quick to access again. A self-balancing tree. + +Nodes are added to the tree, they are accessed and removed from the tree and +it automatically rebalances itself in each operation. + +## libcurl use + +libcurl adds fixed timeout expiry timestamps to the splay tree, and is meant +to scale up to holding a huge amount of pending timeouts with decent +performance. + +The splay tree is used to: + +1. figure out the next timeout expiry value closest in time +2. iterate over timeouts that already have expired + +This splay tree rebalances itself based on the time value. + +Each node in the splay tree points to a `struct Curl_easy`. Each `Curl_easy` +struct is represented only once in the tree. To still allow each easy handle +to have a large number of timeouts per handle, each handle has a sorted linked +list of pending timeouts. Only the handle's timeout that is closest to expire +is the timestamp used for the splay tree node. + +When a specific easy handle's timeout expires, the node gets removed from the +splay tree and from the handle's linked list of timeouts. The next timeout for +that handle is then first in line and becomes the new timeout value as the +node is re-added to the splay. + +## `Curl_splay` + +~~~c +struct Curl_tree *Curl_splay(struct curltime i, struct Curl_tree *t); +~~~ + +Rearranges the tree `t` after the provide time `i`. + +## `Curl_splayinsert` + +~~~c +struct Curl_tree *Curl_splayinsert(struct curltime key, + struct Curl_tree *t, + struct Curl_tree *node); +~~~ + +This function inserts a new `node` in the tree, using the given `key` +timestamp. The `node` struct has a field called `->payload` that can be set to +point to anything. libcurl sets this to the `struct Curl_easy` handle that is +associated with the timeout value set in `key`. + +The splay insert function does not allocate any memory, it assumes the caller +has that arranged. + +It returns a pointer to the new tree root. + +## `Curl_splaygetbest` + +~~~c +struct Curl_tree *Curl_splaygetbest(struct curltime key, + struct Curl_tree *tree, + struct Curl_tree **removed); +~~~ + +If there is a node in the `tree` that has a time value that is less than the +provided `key`, this function removes that node from the tree and provides it +in the `*removed` pointer (or NULL if there was no match). + +It returns a pointer to the new tree root. + +## `Curl_splayremove` + +~~~c +int Curl_splayremove(struct Curl_tree *tree, + struct Curl_tree *node, + struct Curl_tree **newroot); +~~~ + +Removes a given `node` from a splay `tree`, and returns the `newroot` +identifying the new tree root. + +Note that a clean tree without any nodes present implies a NULL pointer. + +## `Curl_splayset` + +~~~c +void Curl_splayset(struct Curl_tree *node, void *payload); +~~~ + +Set a custom pointer to be stored in the splay node. This pointer is not used +by the splay code itself and can be retrieved again with `Curl_splayget`. + +## `Curl_splayget` + +~~~c +void *Curl_splayget(struct Curl_tree *node); +~~~ + +Get the custom pointer from the splay node that was previously set with +`Curl_splayset`. If no pointer was set before, it returns NULL. diff --git a/deps/curl/docs/WEBSOCKET.md b/deps/curl/docs/internals/WEBSOCKET.md similarity index 100% rename from deps/curl/docs/WEBSOCKET.md rename to deps/curl/docs/internals/WEBSOCKET.md diff --git a/deps/curl/docs/libcurl/CMakeLists.txt b/deps/curl/docs/libcurl/CMakeLists.txt index 2aa051ed..4af47af3 100644 --- a/deps/curl/docs/libcurl/CMakeLists.txt +++ b/deps/curl/docs/libcurl/CMakeLists.txt @@ -21,33 +21,51 @@ # SPDX-License-Identifier: curl # ########################################################################### -# Load man_MANS from shared file +# Get 'man_MANS' variable transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") function(add_manual_pages _listname) - foreach(_file IN LISTS ${_listname}) - set(_rofffile "${CMAKE_CURRENT_BINARY_DIR}/${_file}") + # Maximum number of files per command to stay within shell/OS limits + if(CMAKE_HOST_UNIX) + set(_files_per_batch 10000) + else() # e.g. Windows with cmd.exe and other obsolete/unidentified shells + set(_files_per_batch 200) + endif() + set(_file_count 0) + unset(_rofffiles) + unset(_mdfiles) + set(_eol "_EOL_") + foreach(_file IN LISTS ${_listname} _eol) + math(EXPR _file_count "${_file_count} + 1") + if(_file_count GREATER_EQUAL _files_per_batch OR _file STREQUAL "_EOL_") + add_custom_command(OUTPUT ${_rofffiles} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" -k -d "${CMAKE_CURRENT_BINARY_DIR}" ${_mdfiles} + DEPENDS ${_mdfiles} + VERBATIM + ) + set(_file_count 0) + unset(_rofffiles) + unset(_mdfiles) + endif() + + list(APPEND _rofffiles "${CMAKE_CURRENT_BINARY_DIR}/${_file}") if(_file STREQUAL "libcurl-symbols.3") # Special case, an auto-generated file. string(REPLACE ".3" ".md" _mdfile "${CMAKE_CURRENT_BINARY_DIR}/${_file}") else() - string(REPLACE ".3" ".md" _mdfile "${CMAKE_CURRENT_SOURCE_DIR}/${_file}") + string(REPLACE ".3" ".md" _mdfile "${_file}") endif() - add_custom_command(OUTPUT "${_rofffile}" - COMMAND "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/cd2nroff ${_mdfile} > ${_rofffile} - DEPENDS "${_mdfile}" - VERBATIM - ) + list(APPEND _mdfiles "${_mdfile}") endforeach() - endfunction() -add_custom_command(OUTPUT libcurl-symbols.md +add_custom_command(OUTPUT "libcurl-symbols.md" COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mksymbolsmanpage.pl" < - "${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions" > libcurl-symbols.md + "${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions" > "libcurl-symbols.md" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions" "${CMAKE_CURRENT_SOURCE_DIR}/mksymbolsmanpage.pl" @@ -55,13 +73,13 @@ add_custom_command(OUTPUT libcurl-symbols.md ) add_manual_pages(man_MANS) -add_custom_target(man ALL DEPENDS ${man_MANS}) +add_custom_target(curl-man ALL DEPENDS ${man_MANS}) if(NOT CURL_DISABLE_INSTALL) unset(_src) - foreach(_f ${man_MANS}) + foreach(_f IN LISTS man_MANS) list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_f}") endforeach() - install(FILES ${_src} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) + install(FILES ${_src} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") endif() add_subdirectory(opts) diff --git a/deps/curl/docs/libcurl/Makefile.inc b/deps/curl/docs/libcurl/Makefile.inc index 336b4192..fe990cc1 100644 --- a/deps/curl/docs/libcurl/Makefile.inc +++ b/deps/curl/docs/libcurl/Makefile.inc @@ -87,6 +87,7 @@ man_MANS = \ curl_multi_timeout.3 \ curl_multi_wakeup.3 \ curl_multi_wait.3 \ + curl_multi_waitfds.3 \ curl_pushheader_bynum.3 \ curl_pushheader_byname.3 \ curl_share_cleanup.3 \ diff --git a/deps/curl/docs/libcurl/curl_easy_cleanup.md b/deps/curl/docs/libcurl/curl_easy_cleanup.md index 3175d0b7..fc653e3a 100644 --- a/deps/curl/docs/libcurl/curl_easy_cleanup.md +++ b/deps/curl/docs/libcurl/curl_easy_cleanup.md @@ -10,11 +10,14 @@ See-also: - curl_easy_reset (3) - curl_multi_cleanup (3) - curl_multi_remove_handle (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_easy_cleanup - End a libcurl easy handle +curl_easy_cleanup - free an easy handle # SYNOPSIS @@ -50,6 +53,8 @@ before it is closed. Passing in a NULL pointer in *handle* makes this function return immediately with no action. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -67,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_duphandle.md b/deps/curl/docs/libcurl/curl_easy_duphandle.md index babc222e..45e738f3 100644 --- a/deps/curl/docs/libcurl/curl_easy_duphandle.md +++ b/deps/curl/docs/libcurl/curl_easy_duphandle.md @@ -9,11 +9,14 @@ See-also: - curl_easy_init (3) - curl_easy_reset (3) - curl_global_init (3) +Protocol: + - All +Added-in: 7.9 --- # NAME -curl_easy_duphandle - Clone a libcurl session handle +curl_easy_duphandle - clone an easy handle # SYNOPSIS @@ -44,6 +47,8 @@ data from the main filename to populate the cache. In multi-threaded programs, this function must be called in a synchronous way, the input handle may not be in use when cloned. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -62,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_escape.md b/deps/curl/docs/libcurl/curl_easy_escape.md index 9ab8f3a6..b10500ac 100644 --- a/deps/curl/docs/libcurl/curl_easy_escape.md +++ b/deps/curl/docs/libcurl/curl_easy_escape.md @@ -6,12 +6,16 @@ Section: 3 Source: libcurl See-also: - curl_easy_unescape (3) - - curl_free (3) + - curl_url_set (3) + - curl_url_get (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME -curl_easy_escape - URL encodes the given string +curl_easy_escape - URL encode a string # SYNOPSIS @@ -23,18 +27,14 @@ char *curl_easy_escape(CURL *curl, const char *string, int length); # DESCRIPTION -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). +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). -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 longer than **CURL_MAX_INPUT_LENGTH** (8 MB). - -Since 7.82.0, the **curl** parameter is ignored. Prior to that there was -per-handle character conversion support for some old operating systems such as -TPF, but it was otherwise ignored. +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 +longer than **CURL_MAX_INPUT_LENGTH** (8 MB). You must curl_free(3) the returned string when you are done with it. @@ -49,6 +49,19 @@ uses. The caller of curl_easy_escape(3) must make sure that the data passed in to the function is encoded correctly. +# URLs + +URLs are by definition *URL encoded*. To create a proper URL from a set of +components that may not be URL encoded already, you cannot just URL encode the +entire URL string with curl_easy_escape(3), because it then also converts +colons, slashes and other symbols that you probably want untouched. + +To create a proper URL from strings that are not already URL encoded, we +recommend using libcurl's URL API: set the pieces with curl_url_set(3) and get +the final correct URL with curl_url_get(3). + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -66,9 +79,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.15.4 and replaces the old curl_escape(3) function. +Since 7.82.0, the **curl** parameter is ignored. Prior to that there was +per-handle character conversion support for some old operating systems such as +TPF, but it was otherwise ignored. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_getinfo.md b/deps/curl/docs/libcurl/curl_easy_getinfo.md index 8076dc84..31efc316 100644 --- a/deps/curl/docs/libcurl/curl_easy_getinfo.md +++ b/deps/curl/docs/libcurl/curl_easy_getinfo.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -31,202 +34,60 @@ performed transfer if you want to get transfer related data. You should not free the memory returned by this function unless it is explicitly mentioned below. -# AVAILABLE INFORMATION +# OPTIONS The following information can be extracted: -## CURLINFO_EFFECTIVE_METHOD +## CURLINFO_ACTIVESOCKET -Last used HTTP method. See CURLINFO_EFFECTIVE_METHOD(3) - -## CURLINFO_EFFECTIVE_URL - -Last used URL. See CURLINFO_EFFECTIVE_URL(3) - -## CURLINFO_RESPONSE_CODE - -Last received response code. See CURLINFO_RESPONSE_CODE(3) - -## CURLINFO_REFERER - -Referrer header. See CURLINFO_REFERER(3) - -## CURLINFO_HTTP_CONNECTCODE - -Last proxy CONNECT response code. See CURLINFO_HTTP_CONNECTCODE(3) - -## CURLINFO_HTTP_VERSION - -The http version used in the connection. See CURLINFO_HTTP_VERSION(3) - -## CURLINFO_FILETIME - -Remote time of the retrieved document. See CURLINFO_FILETIME(3) - -## CURLINFO_FILETIME_T - -Remote time of the retrieved document. See CURLINFO_FILETIME_T(3) - -## CURLINFO_TOTAL_TIME - -Total time of previous transfer. See CURLINFO_TOTAL_TIME(3) - -## CURLINFO_TOTAL_TIME_T - -Total time of previous transfer. See CURLINFO_TOTAL_TIME_T(3) - -## CURLINFO_NAMELOOKUP_TIME - -Time from start until name resolving completed. See -CURLINFO_NAMELOOKUP_TIME(3) - -## CURLINFO_NAMELOOKUP_TIME_T - -Time from start until name resolving completed. See -CURLINFO_NAMELOOKUP_TIME_T(3) - -## CURLINFO_CONNECT_TIME - -Time from start until remote host or proxy completed. -See CURLINFO_CONNECT_TIME(3) - -## CURLINFO_CONNECT_TIME_T - -Time from start until remote host or proxy completed. -See CURLINFO_CONNECT_TIME_T(3) +The session's active socket. See CURLINFO_ACTIVESOCKET(3) ## CURLINFO_APPCONNECT_TIME -Time from start until SSL/SSH handshake completed. -See CURLINFO_APPCONNECT_TIME(3) +The time it took from the start until the SSL connect/handshake with the +remote host was completed as a double in number of seconds. (Added in 7.19.0) ## CURLINFO_APPCONNECT_TIME_T -Time from start until SSL/SSH handshake completed. -See CURLINFO_APPCONNECT_TIME_T(3) +The time it took from the start until the SSL connect/handshake with the +remote host was completed in number of microseconds. (Added in 7.60.0) See +CURLINFO_APPCONNECT_TIME_T(3) -## CURLINFO_PRETRANSFER_TIME +## CURLINFO_CAINFO -Time from start until just before the transfer begins. -See CURLINFO_PRETRANSFER_TIME(3) +Get the default value for CURLOPT_CAINFO(3). See CURLINFO_CAINFO(3) -## CURLINFO_PRETRANSFER_TIME_T +## CURLINFO_CAPATH -Time from start until just before the transfer begins. -See CURLINFO_PRETRANSFER_TIME_T(3) +Get the default value for CURLOPT_CAPATH(3). See CURLINFO_CAPATH(3) -## CURLINFO_QUEUE_TIME_T +## CURLINFO_CERTINFO -Time during which this transfer was held in a waiting queue. -See CURLINFO_QUEUE_TIME_T(3) +Certificate chain. See CURLINFO_CERTINFO(3) -## CURLINFO_USED_PROXY +## CURLINFO_CONDITION_UNMET -Whether the proxy was used (Added in 8.7.0). See CURLINFO_USED_PROXY(3) +Whether or not a time conditional was met or 304 HTTP response. +See CURLINFO_CONDITION_UNMET(3) -## CURLINFO_STARTTRANSFER_TIME +## CURLINFO_CONNECT_TIME -Time from start until just when the first byte is received. -See CURLINFO_STARTTRANSFER_TIME(3) +The time it took from the start until the connect to the remote host (or +proxy) was completed. As a double. See CURLINFO_CONNECT_TIME(3) -## CURLINFO_STARTTRANSFER_TIME_T +## CURLINFO_CONNECT_TIME_T -Time from start until just when the first byte is received. -See CURLINFO_STARTTRANSFER_TIME_T(3) +The time it took from the start until the connect to the remote host (or +proxy) was completed. In microseconds. See CURLINFO_CONNECT_TIME_T(3). -## CURLINFO_REDIRECT_TIME +## CURLINFO_CONN_ID -Time taken for all redirect steps before the final transfer. -See CURLINFO_REDIRECT_TIME(3) - -## CURLINFO_REDIRECT_TIME_T - -Time taken for all redirect steps before the final transfer. -See CURLINFO_REDIRECT_TIME_T(3) - -## CURLINFO_REDIRECT_COUNT - -Total number of redirects that were followed. -See CURLINFO_REDIRECT_COUNT(3) - -## CURLINFO_REDIRECT_URL - -URL a redirect would take you to, had you enabled redirects. -See CURLINFO_REDIRECT_URL(3) - -## CURLINFO_SIZE_UPLOAD - -(Deprecated) Number of bytes uploaded. -See CURLINFO_SIZE_UPLOAD(3) - -## CURLINFO_SIZE_UPLOAD_T - -Number of bytes uploaded. -See CURLINFO_SIZE_UPLOAD_T(3) - -## CURLINFO_SIZE_DOWNLOAD - -(Deprecated) Number of bytes downloaded. -See CURLINFO_SIZE_DOWNLOAD(3) - -## CURLINFO_SIZE_DOWNLOAD_T - -Number of bytes downloaded. -See CURLINFO_SIZE_DOWNLOAD_T(3) - -## CURLINFO_SPEED_DOWNLOAD - -(Deprecated) Average download speed. -See CURLINFO_SPEED_DOWNLOAD(3) - -## CURLINFO_SPEED_DOWNLOAD_T - -Average download speed. -See CURLINFO_SPEED_DOWNLOAD_T(3) - -## CURLINFO_SPEED_UPLOAD - -(Deprecated) Average upload speed. -See CURLINFO_SPEED_UPLOAD(3) - -## CURLINFO_SPEED_UPLOAD_T - -Average upload speed. -See CURLINFO_SPEED_UPLOAD_T(3) - -## CURLINFO_HEADER_SIZE - -Number of bytes of all headers received. -See CURLINFO_HEADER_SIZE(3) - -## CURLINFO_REQUEST_SIZE - -Number of bytes sent in the issued HTTP requests. -See CURLINFO_REQUEST_SIZE(3) - -## CURLINFO_SSL_VERIFYRESULT - -Certificate verification result. -See CURLINFO_SSL_VERIFYRESULT(3) - -## CURLINFO_PROXY_ERROR - -Detailed proxy error. -See CURLINFO_PROXY_ERROR(3) - -## CURLINFO_PROXY_SSL_VERIFYRESULT - -Proxy certificate verification result. -See CURLINFO_PROXY_SSL_VERIFYRESULT(3) - -## CURLINFO_SSL_ENGINES - -A list of OpenSSL crypto engines. -See CURLINFO_SSL_ENGINES(3) +The ID of the last connection used by the transfer. (Added in 8.2.0) +See CURLINFO_CONN_ID(3) ## CURLINFO_CONTENT_LENGTH_DOWNLOAD -(Deprecated) Content length from the Content-Length header. +(**Deprecated**) Content length from the Content-Length header. See CURLINFO_CONTENT_LENGTH_DOWNLOAD(3) ## CURLINFO_CONTENT_LENGTH_DOWNLOAD_T @@ -236,7 +97,7 @@ See CURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3) ## CURLINFO_CONTENT_LENGTH_UPLOAD -(Deprecated) Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD(3) +(**Deprecated**) Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD(3) ## CURLINFO_CONTENT_LENGTH_UPLOAD_T @@ -244,149 +105,274 @@ Upload size. See CURLINFO_CONTENT_LENGTH_UPLOAD_T(3) ## CURLINFO_CONTENT_TYPE -Content type from the Content-Type header. -See CURLINFO_CONTENT_TYPE(3) +Content type from the `Content-Type:` header. We recommend using +curl_easy_header(3) instead. See CURLINFO_CONTENT_TYPE(3) -## CURLINFO_RETRY_AFTER +## CURLINFO_COOKIELIST -The value from the Retry-After header. -See CURLINFO_RETRY_AFTER(3) +List of all known cookies. See CURLINFO_COOKIELIST(3) -## CURLINFO_PRIVATE +## CURLINFO_EARLYDATA_SENT_T -User's private data pointer. -See CURLINFO_PRIVATE(3) +Amount of TLS early data sent (in number of bytes) when +CURLSSLOPT_EARLYDATA is enabled. + +## CURLINFO_EFFECTIVE_METHOD + +Last used HTTP method. See CURLINFO_EFFECTIVE_METHOD(3) + +## CURLINFO_EFFECTIVE_URL + +Last used URL. See CURLINFO_EFFECTIVE_URL(3) + +## CURLINFO_FILETIME + +Remote time of the retrieved document. See CURLINFO_FILETIME(3) + +## CURLINFO_FILETIME_T + +Remote time of the retrieved document. See CURLINFO_FILETIME_T(3) + +## CURLINFO_FTP_ENTRY_PATH + +The entry path after logging in to an FTP server. See +CURLINFO_FTP_ENTRY_PATH(3) + +## CURLINFO_HEADER_SIZE + +Number of bytes of all headers received. See CURLINFO_HEADER_SIZE(3) ## CURLINFO_HTTPAUTH_AVAIL -Available HTTP authentication methods. -See CURLINFO_HTTPAUTH_AVAIL(3) +Available HTTP authentication methods. See CURLINFO_HTTPAUTH_AVAIL(3) -## CURLINFO_PROXYAUTH_AVAIL +## CURLINFO_HTTP_CONNECTCODE -Available HTTP proxy authentication methods. -See CURLINFO_PROXYAUTH_AVAIL(3) +Last proxy CONNECT response code. See CURLINFO_HTTP_CONNECTCODE(3) -## CURLINFO_OS_ERRNO +## CURLINFO_HTTP_VERSION -The errno from the last failure to connect. -See CURLINFO_OS_ERRNO(3) +The http version used in the connection. See CURLINFO_HTTP_VERSION(3) + +## CURLINFO_LASTSOCKET + +(**Deprecated**) Last socket used. See CURLINFO_LASTSOCKET(3) + +## CURLINFO_LOCAL_IP + +Source IP address of the last connection. See CURLINFO_LOCAL_IP(3) + +## CURLINFO_LOCAL_PORT + +Source port number of the last connection. See CURLINFO_LOCAL_PORT(3) + +## CURLINFO_NAMELOOKUP_TIME + +Time from start until name resolving completed as a double. See +CURLINFO_NAMELOOKUP_TIME(3) + +## CURLINFO_NAMELOOKUP_TIME_T + +Time from start until name resolving completed in number of microseconds. See +CURLINFO_NAMELOOKUP_TIME_T(3) ## CURLINFO_NUM_CONNECTS Number of new successful connections used for previous transfer. See CURLINFO_NUM_CONNECTS(3) +## CURLINFO_OS_ERRNO + +The errno from the last failure to connect. See CURLINFO_OS_ERRNO(3) + +## CURLINFO_POSTTRANSFER_TIME_T + +The time it took from the start until the last byte is sent by libcurl. +In microseconds. (Added in 8.10.0) See CURLINFO_POSTTRANSFER_TIME_T(3) + +## CURLINFO_PRETRANSFER_TIME + +The time it took from the start until the file transfer is just about to +begin. This includes all pre-transfer commands and negotiations that are +specific to the particular protocol(s) involved. See +CURLINFO_PRETRANSFER_TIME(3) + +## CURLINFO_PRETRANSFER_TIME_T + +The time it took from the start until the file transfer is just about to +begin. This includes all pre-transfer commands and negotiations that are +specific to the particular protocol(s) involved. In microseconds. See +CURLINFO_PRETRANSFER_TIME_T(3) + ## CURLINFO_PRIMARY_IP -Destination IP address of the last connection. -See CURLINFO_PRIMARY_IP(3) +Destination IP address of the last connection. See CURLINFO_PRIMARY_IP(3) ## CURLINFO_PRIMARY_PORT -Destination port of the last connection. -See CURLINFO_PRIMARY_PORT(3) +Destination port of the last connection. See CURLINFO_PRIMARY_PORT(3) -## CURLINFO_LOCAL_IP +## CURLINFO_PRIVATE -Source IP address of the last connection. -See CURLINFO_LOCAL_IP(3) - -## CURLINFO_LOCAL_PORT - -Source port number of the last connection. -See CURLINFO_LOCAL_PORT(3) - -## CURLINFO_COOKIELIST - -List of all known cookies. -See CURLINFO_COOKIELIST(3) - -## CURLINFO_LASTSOCKET - -(Deprecated) Last socket used. -See CURLINFO_LASTSOCKET(3) - -## CURLINFO_ACTIVESOCKET - -The session's active socket. -See CURLINFO_ACTIVESOCKET(3) - -## CURLINFO_FTP_ENTRY_PATH - -The entry path after logging in to an FTP server. -See CURLINFO_FTP_ENTRY_PATH(3) - -## CURLINFO_CAPATH - -Get the default value for CURLOPT_CAPATH(3). -See CURLINFO_CAPATH(3) - -## CURLINFO_CAINFO - -Get the default value for CURLOPT_CAINFO(3). -See CURLINFO_CAINFO(3) - -## CURLINFO_CERTINFO - -Certificate chain. -See CURLINFO_CERTINFO(3) - -## CURLINFO_TLS_SSL_PTR - -TLS session info that can be used for further processing. -See CURLINFO_TLS_SSL_PTR(3) - -## CURLINFO_TLS_SESSION - -TLS session info that can be used for further processing. See -CURLINFO_TLS_SESSION(3). Deprecated option, use -CURLINFO_TLS_SSL_PTR(3) instead! - -## CURLINFO_CONDITION_UNMET - -Whether or not a time conditional was met or 304 HTTP response. -See CURLINFO_CONDITION_UNMET(3) - -## CURLINFO_RTSP_SESSION_ID - -RTSP session ID. -See CURLINFO_RTSP_SESSION_ID(3) - -## CURLINFO_RTSP_CLIENT_CSEQ - -The RTSP client CSeq that is expected next. -See CURLINFO_RTSP_CLIENT_CSEQ(3) - -## CURLINFO_RTSP_SERVER_CSEQ - -The RTSP server CSeq that is expected next. -See CURLINFO_RTSP_SERVER_CSEQ(3) - -## CURLINFO_RTSP_CSEQ_RECV - -RTSP CSeq last received. -See CURLINFO_RTSP_CSEQ_RECV(3) +User's private data pointer. See CURLINFO_PRIVATE(3) ## CURLINFO_PROTOCOL -(Deprecated) The protocol used for the connection. (Added in 7.52.0) -See CURLINFO_PROTOCOL(3) +(**Deprecated**) The protocol used for the connection. (Added in 7.52.0) See +CURLINFO_PROTOCOL(3) + +## CURLINFO_PROXYAUTH_AVAIL + +Available HTTP proxy authentication methods. See CURLINFO_PROXYAUTH_AVAIL(3) + +## CURLINFO_PROXY_ERROR + +Detailed proxy error. See CURLINFO_PROXY_ERROR(3) + +## CURLINFO_PROXY_SSL_VERIFYRESULT + +Proxy certificate verification result. See CURLINFO_PROXY_SSL_VERIFYRESULT(3) + +## CURLINFO_QUEUE_TIME_T + +The time during which the transfer was held in a waiting queue before it could +start for real in number of microseconds. (Added in 8.6.0) See +CURLINFO_QUEUE_TIME_T(3) + +## CURLINFO_REDIRECT_COUNT + +Total number of redirects that were followed. See CURLINFO_REDIRECT_COUNT(3) + +## CURLINFO_REDIRECT_TIME + +The time it took for all redirection steps include name lookup, connect, +pretransfer and transfer before final transaction was started. So, this is +zero if no redirection took place. As a double. See CURLINFO_REDIRECT_TIME(3) + +## CURLINFO_REDIRECT_TIME_T + +The time it took for all redirection steps include name lookup, connect, +pretransfer and transfer before final transaction was started. So, this is +zero if no redirection took place. In number of microseconds. See +CURLINFO_REDIRECT_TIME_T(3) + +## CURLINFO_REDIRECT_URL + +URL a redirect would take you to, had you enabled redirects. See +CURLINFO_REDIRECT_URL(3) + +## CURLINFO_REFERER + +Referrer header. See CURLINFO_REFERER(3) + +## CURLINFO_REQUEST_SIZE + +Number of bytes sent in the issued HTTP requests. See CURLINFO_REQUEST_SIZE(3) + +## CURLINFO_RESPONSE_CODE + +Last received response code. See CURLINFO_RESPONSE_CODE(3) + +## CURLINFO_RETRY_AFTER + +The value from the Retry-After header. See CURLINFO_RETRY_AFTER(3) + +## CURLINFO_RTSP_CLIENT_CSEQ + +The RTSP client CSeq that is expected next. See CURLINFO_RTSP_CLIENT_CSEQ(3) + +## CURLINFO_RTSP_CSEQ_RECV + +RTSP CSeq last received. See CURLINFO_RTSP_CSEQ_RECV(3) + +## CURLINFO_RTSP_SERVER_CSEQ + +The RTSP server CSeq that is expected next. See CURLINFO_RTSP_SERVER_CSEQ(3) + +## CURLINFO_RTSP_SESSION_ID + +RTSP session ID. See CURLINFO_RTSP_SESSION_ID(3) ## CURLINFO_SCHEME -The scheme used for the connection. (Added in 7.52.0) -See CURLINFO_SCHEME(3) +The scheme used for the connection. (Added in 7.52.0) See CURLINFO_SCHEME(3) -## CURLINFO_CONN_ID +## CURLINFO_SIZE_DOWNLOAD -The ID of the last connection used by the transfer. (Added in 8.2.0) -See CURLINFO_CONN_ID(3) +(**Deprecated**) Number of bytes downloaded. See CURLINFO_SIZE_DOWNLOAD(3) + +## CURLINFO_SIZE_DOWNLOAD_T + +Number of bytes downloaded. See CURLINFO_SIZE_DOWNLOAD_T(3) + +## CURLINFO_SIZE_UPLOAD + +(**Deprecated**) Number of bytes uploaded. See CURLINFO_SIZE_UPLOAD(3) + +## CURLINFO_SIZE_UPLOAD_T + +Number of bytes uploaded. See CURLINFO_SIZE_UPLOAD_T(3) + +## CURLINFO_SPEED_DOWNLOAD + +(**Deprecated**) Average download speed. See CURLINFO_SPEED_DOWNLOAD(3) + +## CURLINFO_SPEED_DOWNLOAD_T + +Average download speed. See CURLINFO_SPEED_DOWNLOAD_T(3) + +## CURLINFO_SPEED_UPLOAD + +(**Deprecated**) Average upload speed. See CURLINFO_SPEED_UPLOAD(3) + +## CURLINFO_SPEED_UPLOAD_T + +Average upload speed in number of bytes per second. See +CURLINFO_SPEED_UPLOAD_T(3) + +## CURLINFO_SSL_ENGINES + +A list of OpenSSL crypto engines. See CURLINFO_SSL_ENGINES(3) + +## CURLINFO_SSL_VERIFYRESULT + +Certificate verification result. See CURLINFO_SSL_VERIFYRESULT(3) + +## CURLINFO_STARTTRANSFER_TIME + +The time it took from the start until the first byte is received by libcurl. +As a double. See CURLINFO_STARTTRANSFER_TIME(3) + +## CURLINFO_STARTTRANSFER_TIME_T + +The time it took from the start until the first byte is received by libcurl. +In microseconds. See CURLINFO_STARTTRANSFER_TIME_T(3) + +## CURLINFO_TLS_SESSION + +(**Deprecated**) TLS session info that can be used for further processing. See +CURLINFO_TLS_SESSION(3). Use CURLINFO_TLS_SSL_PTR(3) instead. + +## CURLINFO_TLS_SSL_PTR + +TLS session info that can be used for further processing. See +CURLINFO_TLS_SSL_PTR(3) + +## CURLINFO_TOTAL_TIME + +Total time of previous transfer. See CURLINFO_TOTAL_TIME(3) + +## CURLINFO_TOTAL_TIME_T + +Total time of previous transfer. See CURLINFO_TOTAL_TIME_T(3) + +## CURLINFO_USED_PROXY + +Whether the proxy was used (Added in 8.7.0). See CURLINFO_USED_PROXY(3) ## CURLINFO_XFER_ID -The ID of the transfer. (Added in 8.2.0) -See CURLINFO_XFER_ID(3) +The ID of the transfer. (Added in 8.2.0) See CURLINFO_XFER_ID(3) # TIMES @@ -399,55 +385,19 @@ An overview of the time values available from curl_easy_getinfo(3) |--|--|--CONNECT |--|--|--|--APPCONNECT |--|--|--|--|--PRETRANSFER - |--|--|--|--|--|--STARTTRANSFER - |--|--|--|--|--|--|--TOTAL - |--|--|--|--|--|--|--REDIRECT + |--|--|--|--|--|--POSTTRANSFER + |--|--|--|--|--|--|--STARTTRANSFER + |--|--|--|--|--|--|--|--TOTAL + |--|--|--|--|--|--|--|--REDIRECT -## CURLINFO_QUEUE_TIME -CURLINFO_QUEUE_TIME_T(3). The time during which the transfer was held in a -waiting queue before it could start for real. (Added in 8.6.0) + 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), + CURLINFO_STARTTRANSFER_TIME_T(3), CURLINFO_TOTAL_TIME_T(3), + CURLINFO_REDIRECT_TIME_T(3) -## CURLINFO_NAMELOOKUP_TIME - -CURLINFO_NAMELOOKUP_TIME(3) and CURLINFO_NAMELOOKUP_TIME_T(3). The time it -took from the start until the name resolving was completed. - -## CURLINFO_CONNECT_TIME - -CURLINFO_CONNECT_TIME(3) and CURLINFO_CONNECT_TIME_T(3). The time it took from -the start until the connect to the remote host (or proxy) was completed. - -## CURLINFO_APPCONNECT_TIME - -CURLINFO_APPCONNECT_TIME(3) and CURLINFO_APPCONNECT_TIME_T(3). The time it -took from the start until the SSL connect/handshake with the remote host was -completed. (Added in 7.19.0) The latter is the integer version (measuring -microseconds). (Added in 7.60.0) - -## CURLINFO_PRETRANSFER_TIME - -CURLINFO_PRETRANSFER_TIME(3) and CURLINFO_PRETRANSFER_TIME_T(3). The time it -took from the start until the file transfer is just about to begin. This -includes all pre-transfer commands and negotiations that are specific to the -particular protocol(s) involved. - -## CURLINFO_STARTTRANSFER_TIME - -CURLINFO_STARTTRANSFER_TIME(3) and CURLINFO_STARTTRANSFER_TIME_T(3). The time -it took from the start until the first byte is received by libcurl. - -## CURLINFO_TOTAL_TIME - -CURLINFO_TOTAL_TIME(3) and CURLINFO_TOTAL_TIME_T(3). Total time -of the previous request. - -## CURLINFO_REDIRECT_TIME - -CURLINFO_REDIRECT_TIME(3) and CURLINFO_REDIRECT_TIME_T(3). The time it took -for all redirection steps include name lookup, connect, pretransfer and -transfer before final transaction was started. So, this is zero if no -redirection took place. +# %PROTOCOLS% # EXAMPLE @@ -475,9 +425,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_header.md b/deps/curl/docs/libcurl/curl_easy_header.md index ff3699b9..0c712506 100644 --- a/deps/curl/docs/libcurl/curl_easy_header.md +++ b/deps/curl/docs/libcurl/curl_easy_header.md @@ -10,6 +10,9 @@ See-also: - curl_easy_nextheader (3) - curl_easy_perform (3) - libcurl-errors (3) +Protocol: + - HTTP +Added-in: 7.83.0 --- # NAME @@ -62,7 +65,7 @@ does not have to bother about multiple headers used wrongly. The memory for the returned struct is associated with the easy handle and subsequent calls to curl_easy_header(3) clobber the struct used in the -previous calls for the same easy handle. Applications need to copy the data if +previous calls for the same easy handle. The application needs to copy the data if it wants to keep it around. The memory used for the struct gets freed with calling curl_easy_cleanup(3) of the easy handle. @@ -134,6 +137,8 @@ response that might happen before the "real" response. The header is an HTTP/2 or HTTP/3 pseudo header +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -151,9 +156,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.83.0. Officially supported since 7.84.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_init.md b/deps/curl/docs/libcurl/curl_easy_init.md index c51e8c40..3a5d2be4 100644 --- a/deps/curl/docs/libcurl/curl_easy_init.md +++ b/deps/curl/docs/libcurl/curl_easy_init.md @@ -11,11 +11,14 @@ See-also: - curl_easy_reset (3) - curl_global_init (3) - curl_multi_init (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_easy_init - Start a libcurl easy session +curl_easy_init - create an easy handle # SYNOPSIS @@ -40,14 +43,16 @@ all the options that were set in the source handle set in the new copy as well. If you did not already call curl_global_init(3) before calling this function, -curl_easy_init(3) does it automatically. This may be lethal in multi-threaded -cases, if curl_global_init(3) is not thread-safe in your system, and it may +curl_easy_init(3) does it automatically. This can be lethal in multi-threaded +cases for platforms where curl_global_init(3) is not thread-safe, and it may then result in resource problems because there is no corresponding cleanup. You are strongly advised to not allow this automatic behavior, by calling curl_global_init(3) yourself properly. See the description in libcurl(3) of global environment requirements for details of how to use this function. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -63,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_nextheader.md b/deps/curl/docs/libcurl/curl_easy_nextheader.md index f7057af7..2dbdf61c 100644 --- a/deps/curl/docs/libcurl/curl_easy_nextheader.md +++ b/deps/curl/docs/libcurl/curl_easy_nextheader.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_easy_header (3) - curl_easy_perform (3) +Protocol: + - HTTP +Added-in: 7.83.0 --- # NAME @@ -58,6 +61,8 @@ The memory for the struct this points to, is owned and managed by libcurl and is associated with the easy handle. Applications must copy the data if they want it to survive subsequent API calls or the life-time of the easy handle. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -87,9 +92,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.83.0. Officially supported since 7.84.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_option_by_id.md b/deps/curl/docs/libcurl/curl_easy_option_by_id.md index 99ebb346..87cdeeb2 100644 --- a/deps/curl/docs/libcurl/curl_easy_option_by_id.md +++ b/deps/curl/docs/libcurl/curl_easy_option_by_id.md @@ -8,6 +8,9 @@ See-also: - curl_easy_option_by_name (3) - curl_easy_option_next (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.73.0 --- # NAME @@ -33,6 +36,8 @@ well. If libcurl has no option with the given id, this function returns NULL. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -45,9 +50,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.73.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_option_by_name.md b/deps/curl/docs/libcurl/curl_easy_option_by_name.md index 401fc02f..d237bd35 100644 --- a/deps/curl/docs/libcurl/curl_easy_option_by_name.md +++ b/deps/curl/docs/libcurl/curl_easy_option_by_name.md @@ -8,6 +8,9 @@ See-also: - curl_easy_option_by_id (3) - curl_easy_option_next (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.73.0 --- # NAME @@ -32,6 +35,8 @@ insensitive. If libcurl has no option with the given name, this function returns NULL. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -44,9 +49,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.73.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_option_next.md b/deps/curl/docs/libcurl/curl_easy_option_next.md index d231c806..836dee2d 100644 --- a/deps/curl/docs/libcurl/curl_easy_option_next.md +++ b/deps/curl/docs/libcurl/curl_easy_option_next.md @@ -8,6 +8,9 @@ See-also: - curl_easy_option_by_id (3) - curl_easy_option_by_name (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.73.0 --- # NAME @@ -64,6 +67,8 @@ struct curl_easyoption { }; ~~~ +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -79,9 +84,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.73.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_pause.md b/deps/curl/docs/libcurl/curl_easy_pause.md index ce3681a6..fa8159ac 100644 --- a/deps/curl/docs/libcurl/curl_easy_pause.md +++ b/deps/curl/docs/libcurl/curl_easy_pause.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_easy_cleanup (3) - curl_easy_reset (3) +Protocol: + - All +Added-in: 7.18.0 --- # NAME @@ -95,6 +98,8 @@ buffering 32 megabyte of data for a paused stream. When such a paused stream is unpaused again, any buffered data is delivered first. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -103,7 +108,7 @@ int main(void) CURL *curl = curl_easy_init(); if(curl) { /* pause a transfer in both directions */ - curl_easy_pause(curl, CURL_READFUNC_PAUSE | CURL_WRITEFUNC_PAUSE); + curl_easy_pause(curl, CURLPAUSE_RECV | CURLPAUSE_SEND); } } @@ -129,9 +134,7 @@ size worth of data that curl cannot stop but instead needs to cache while the transfer is paused. This means that if a window size of 64 MB is used, libcurl might end up having to cache 64 MB of data. -# AVAILABILITY - -Added in 7.18.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_perform.md b/deps/curl/docs/libcurl/curl_easy_perform.md index 23320201..4c4c5668 100644 --- a/deps/curl/docs/libcurl/curl_easy_perform.md +++ b/deps/curl/docs/libcurl/curl_easy_perform.md @@ -10,11 +10,14 @@ See-also: - curl_multi_add_handle (3) - curl_multi_perform (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_easy_perform - perform a blocking file transfer +curl_easy_perform - perform a blocking network transfer # SYNOPSIS @@ -56,6 +59,8 @@ CURLOPT_POSTFIELDS(3). While the **easy_handle** is added to a multi handle, it cannot be used by curl_easy_perform(3). +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -71,9 +76,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_recv.md b/deps/curl/docs/libcurl/curl_easy_recv.md index 249362c0..94491b63 100644 --- a/deps/curl/docs/libcurl/curl_easy_recv.md +++ b/deps/curl/docs/libcurl/curl_easy_recv.md @@ -9,6 +9,9 @@ See-also: - curl_easy_perform (3) - curl_easy_send (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.18.2 --- # NAME @@ -55,6 +58,8 @@ Furthermore if you wait on the socket and it tells you there is data to read, curl_easy_recv(3) may return **CURLE_AGAIN** if the only data that was read was for internal SSL processing, and no other data is available. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -83,9 +88,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.18.2. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_reset.md b/deps/curl/docs/libcurl/curl_easy_reset.md index a74eb7fe..3f4e7ae7 100644 --- a/deps/curl/docs/libcurl/curl_easy_reset.md +++ b/deps/curl/docs/libcurl/curl_easy_reset.md @@ -9,6 +9,9 @@ See-also: - curl_easy_duphandle (3) - curl_easy_init (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.12.1 --- # NAME @@ -33,6 +36,8 @@ It does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies, the shares or the alt-svc cache. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -47,9 +52,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.12.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_send.md b/deps/curl/docs/libcurl/curl_easy_send.md index edeb65c5..04d295a4 100644 --- a/deps/curl/docs/libcurl/curl_easy_send.md +++ b/deps/curl/docs/libcurl/curl_easy_send.md @@ -9,6 +9,9 @@ See-also: - curl_easy_perform (3) - curl_easy_recv (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.18.2 --- # NAME @@ -50,6 +53,8 @@ Furthermore if you wait on the socket and it tells you it is writable, curl_easy_send(3) may return **CURLE_AGAIN** if the only data that was sent was for internal SSL processing, and no other data could be sent. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -76,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.18.2. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_setopt.md b/deps/curl/docs/libcurl/curl_easy_setopt.md index 843673a6..e0fe95ca 100644 --- a/deps/curl/docs/libcurl/curl_easy_setopt.md +++ b/deps/curl/docs/libcurl/curl_easy_setopt.md @@ -13,6 +13,9 @@ See-also: - curl_easy_option_next (3) - curl_easy_reset (3) - curl_multi_setopt (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -34,7 +37,7 @@ appropriate options, the application can change libcurl's behavior. All options are set with an *option* followed by a *parameter*. That parameter can be a **long**, a **function pointer**, an **object pointer** or a **curl_off_t**, depending on what the specific option expects. Read this -manual carefully as bad input values may cause libcurl to behave badly! You +manual carefully as bad input values may cause libcurl to behave badly. You can only set one option in each function call. A typical application uses many curl_easy_setopt(3) calls in the setup phase. @@ -60,134 +63,107 @@ keep them available until libcurl no longer needed them. The *handle* is the return code from a curl_easy_init(3) or curl_easy_duphandle(3) call. -# BEHAVIOR OPTIONS +# OPTIONS -## CURLOPT_VERBOSE +## CURLOPT_ABSTRACT_UNIX_SOCKET -Display verbose information. See CURLOPT_VERBOSE(3) +Path to an abstract Unix domain socket. See CURLOPT_ABSTRACT_UNIX_SOCKET(3) -## CURLOPT_HEADER +## CURLOPT_ACCEPTTIMEOUT_MS -Include the header in the body output. See CURLOPT_HEADER(3) +Timeout for waiting for the server's connect back to be accepted. See +CURLOPT_ACCEPTTIMEOUT_MS(3) -## CURLOPT_NOPROGRESS +## CURLOPT_ACCEPT_ENCODING -Shut off the progress meter. See CURLOPT_NOPROGRESS(3) +Accept-Encoding and automatic decompressing data. See +CURLOPT_ACCEPT_ENCODING(3) -## CURLOPT_NOSIGNAL +## CURLOPT_ADDRESS_SCOPE -Do not install signal handlers. See CURLOPT_NOSIGNAL(3) +IPv6 scope for local addresses. See CURLOPT_ADDRESS_SCOPE(3) -## CURLOPT_WILDCARDMATCH +## CURLOPT_ALTSVC -Transfer multiple files according to a filename pattern. See -CURLOPT_WILDCARDMATCH(3) +Specify the Alt-Svc: cache filename. See CURLOPT_ALTSVC(3) -# CALLBACK OPTIONS +## CURLOPT_ALTSVC_CTRL -## CURLOPT_WRITEFUNCTION +Enable and configure Alt-Svc: treatment. See CURLOPT_ALTSVC_CTRL(3) -Callback for writing data. See CURLOPT_WRITEFUNCTION(3) +## CURLOPT_APPEND -## CURLOPT_WRITEDATA +Append to remote file. See CURLOPT_APPEND(3) -Data pointer to pass to the write callback. See CURLOPT_WRITEDATA(3) +## CURLOPT_AUTOREFERER -## CURLOPT_READFUNCTION +Automatically set Referer: header. See CURLOPT_AUTOREFERER(3) -Callback for reading data. See CURLOPT_READFUNCTION(3) +## CURLOPT_AWS_SIGV4 -## CURLOPT_READDATA +AWS HTTP V4 Signature. See CURLOPT_AWS_SIGV4(3) -Data pointer to pass to the read callback. See CURLOPT_READDATA(3) +## CURLOPT_BUFFERSIZE -## CURLOPT_IOCTLFUNCTION +Ask for alternate buffer size. See CURLOPT_BUFFERSIZE(3) -**Deprecated option** Callback for I/O operations. -See CURLOPT_IOCTLFUNCTION(3) +## CURLOPT_CAINFO -## CURLOPT_IOCTLDATA +CA cert bundle. See CURLOPT_CAINFO(3) -**Deprecated option** Data pointer to pass to the I/O callback. -See CURLOPT_IOCTLDATA(3) +## CURLOPT_CAINFO_BLOB -## CURLOPT_SEEKFUNCTION +CA cert bundle memory buffer. See CURLOPT_CAINFO_BLOB(3) -Callback for seek operations. See CURLOPT_SEEKFUNCTION(3) +## CURLOPT_CAPATH -## CURLOPT_SEEKDATA +Path to CA cert bundle. See CURLOPT_CAPATH(3) -Data pointer to pass to the seek callback. See CURLOPT_SEEKDATA(3) +## CURLOPT_CA_CACHE_TIMEOUT -## CURLOPT_SOCKOPTFUNCTION +Timeout for CA cache. See CURLOPT_CA_CACHE_TIMEOUT(3) -Callback for sockopt operations. See CURLOPT_SOCKOPTFUNCTION(3) +## CURLOPT_CERTINFO -## CURLOPT_SOCKOPTDATA +Extract certificate info. See CURLOPT_CERTINFO(3) -Data pointer to pass to the sockopt callback. See CURLOPT_SOCKOPTDATA(3) +## CURLOPT_CHUNK_BGN_FUNCTION -## CURLOPT_OPENSOCKETFUNCTION +Callback for wildcard download start of chunk. See +CURLOPT_CHUNK_BGN_FUNCTION(3) -Callback for socket creation. See CURLOPT_OPENSOCKETFUNCTION(3) +## CURLOPT_CHUNK_DATA -## CURLOPT_OPENSOCKETDATA +Data pointer to pass to the chunk callbacks. See CURLOPT_CHUNK_DATA(3) -Data pointer to pass to the open socket callback. See CURLOPT_OPENSOCKETDATA(3) +## CURLOPT_CHUNK_END_FUNCTION + +Callback for wildcard download end of chunk. See CURLOPT_CHUNK_END_FUNCTION(3) + +## CURLOPT_CLOSESOCKETDATA + +Data pointer to pass to the close socket callback. See +CURLOPT_CLOSESOCKETDATA(3) ## CURLOPT_CLOSESOCKETFUNCTION Callback for closing socket. See CURLOPT_CLOSESOCKETFUNCTION(3) -## CURLOPT_CLOSESOCKETDATA +## CURLOPT_CONNECTTIMEOUT -Data pointer to pass to the close socket callback. See CURLOPT_CLOSESOCKETDATA(3) +Timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT(3) -## CURLOPT_PROGRESSFUNCTION +## CURLOPT_CONNECTTIMEOUT_MS -**OBSOLETE** callback for progress meter. -See CURLOPT_PROGRESSFUNCTION(3) +Millisecond timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT_MS(3) -## CURLOPT_PROGRESSDATA +## CURLOPT_CONNECT_ONLY -Data pointer to pass to the progress meter callback. See CURLOPT_PROGRESSDATA(3) +Only connect, nothing else. See CURLOPT_CONNECT_ONLY(3) -## CURLOPT_XFERINFOFUNCTION +## CURLOPT_CONNECT_TO -Callback for progress meter. See CURLOPT_XFERINFOFUNCTION(3) - -## CURLOPT_XFERINFODATA - -Data pointer to pass to the progress meter callback. See CURLOPT_XFERINFODATA(3) - -## CURLOPT_HEADERFUNCTION - -Callback for writing received headers. See CURLOPT_HEADERFUNCTION(3) - -## CURLOPT_HEADERDATA - -Data pointer to pass to the header callback. See CURLOPT_HEADERDATA(3) - -## CURLOPT_DEBUGFUNCTION - -Callback for debug information. See CURLOPT_DEBUGFUNCTION(3) - -## CURLOPT_DEBUGDATA - -Data pointer to pass to the debug callback. See CURLOPT_DEBUGDATA(3) - -## CURLOPT_SSL_CTX_FUNCTION - -Callback for SSL context logic. See CURLOPT_SSL_CTX_FUNCTION(3) - -## CURLOPT_SSL_CTX_DATA - -Data pointer to pass to the SSL context callback. See CURLOPT_SSL_CTX_DATA(3) - -## CURLOPT_CONV_TO_NETWORK_FUNCTION - -**OBSOLETE** Callback for code base conversion. -See CURLOPT_CONV_TO_NETWORK_FUNCTION(3) +Connect to a specific host and port. See CURLOPT_CONNECT_TO(3) ## CURLOPT_CONV_FROM_NETWORK_FUNCTION @@ -199,398 +175,10 @@ See CURLOPT_CONV_FROM_NETWORK_FUNCTION(3) **OBSOLETE** Callback for code base conversion. See CURLOPT_CONV_FROM_UTF8_FUNCTION(3) -## CURLOPT_INTERLEAVEFUNCTION +## CURLOPT_CONV_TO_NETWORK_FUNCTION -Callback for RTSP interleaved data. See CURLOPT_INTERLEAVEFUNCTION(3) - -## CURLOPT_INTERLEAVEDATA - -Data pointer to pass to the RTSP interleave callback. See CURLOPT_INTERLEAVEDATA(3) - -## CURLOPT_CHUNK_BGN_FUNCTION - -Callback for wildcard download start of chunk. See CURLOPT_CHUNK_BGN_FUNCTION(3) - -## CURLOPT_CHUNK_END_FUNCTION - -Callback for wildcard download end of chunk. See CURLOPT_CHUNK_END_FUNCTION(3) - -## CURLOPT_CHUNK_DATA - -Data pointer to pass to the chunk callbacks. See CURLOPT_CHUNK_DATA(3) - -## CURLOPT_FNMATCH_FUNCTION - -Callback for wildcard matching. See CURLOPT_FNMATCH_FUNCTION(3) - -## CURLOPT_FNMATCH_DATA - -Data pointer to pass to the wildcard matching callback. See CURLOPT_FNMATCH_DATA(3) - -## CURLOPT_SUPPRESS_CONNECT_HEADERS - -Suppress proxy CONNECT response headers from user callbacks. See -CURLOPT_SUPPRESS_CONNECT_HEADERS(3) - -## CURLOPT_RESOLVER_START_FUNCTION - -Callback to be called before a new resolve request is started. See -CURLOPT_RESOLVER_START_FUNCTION(3) - -## CURLOPT_RESOLVER_START_DATA - -Data pointer to pass to resolver start callback. See CURLOPT_RESOLVER_START_DATA(3) - -## CURLOPT_PREREQFUNCTION - -Callback to be called after a connection is established but before a request -is made on that connection. See CURLOPT_PREREQFUNCTION(3) - -## CURLOPT_PREREQDATA - -Data pointer to pass to the CURLOPT_PREREQFUNCTION callback. See -CURLOPT_PREREQDATA(3) - -# ERROR OPTIONS - -## CURLOPT_ERRORBUFFER - -Error message buffer. See CURLOPT_ERRORBUFFER(3) - -## CURLOPT_STDERR - -stderr replacement stream. See CURLOPT_STDERR(3) - -## CURLOPT_FAILONERROR - -Fail on HTTP 4xx errors. CURLOPT_FAILONERROR(3) - -## CURLOPT_KEEP_SENDING_ON_ERROR - -Keep sending on HTTP \>= 300 errors. CURLOPT_KEEP_SENDING_ON_ERROR(3) - -# NETWORK OPTIONS - -## CURLOPT_URL - -URL to work on. See CURLOPT_URL(3) - -## CURLOPT_PATH_AS_IS - -Disable squashing /../ and /./ sequences in the path. See CURLOPT_PATH_AS_IS(3) - -## CURLOPT_PROTOCOLS - -**Deprecated option** Allowed protocols. See CURLOPT_PROTOCOLS(3) - -## CURLOPT_PROTOCOLS_STR - -Allowed protocols. See CURLOPT_PROTOCOLS_STR(3) - -## CURLOPT_REDIR_PROTOCOLS - -**Deprecated option** Protocols to allow redirects to. See -CURLOPT_REDIR_PROTOCOLS(3) - -## CURLOPT_REDIR_PROTOCOLS_STR - -Protocols to allow redirects to. See CURLOPT_REDIR_PROTOCOLS_STR(3) - -## CURLOPT_DEFAULT_PROTOCOL - -Default protocol. See CURLOPT_DEFAULT_PROTOCOL(3) - -## CURLOPT_PROXY - -Proxy to use. See CURLOPT_PROXY(3) - -## CURLOPT_PRE_PROXY - -Socks proxy to use. See CURLOPT_PRE_PROXY(3) - -## CURLOPT_PROXYPORT - -Proxy port to use. See CURLOPT_PROXYPORT(3) - -## CURLOPT_PROXYTYPE - -Proxy type. See CURLOPT_PROXYTYPE(3) - -## CURLOPT_NOPROXY - -Filter out hosts from proxy use. CURLOPT_NOPROXY(3) - -## CURLOPT_HTTPPROXYTUNNEL - -Tunnel through the HTTP proxy. CURLOPT_HTTPPROXYTUNNEL(3) - -## CURLOPT_CONNECT_TO - -Connect to a specific host and port. See CURLOPT_CONNECT_TO(3) - -## CURLOPT_SOCKS5_AUTH - -Socks5 authentication methods. See CURLOPT_SOCKS5_AUTH(3) - -## CURLOPT_SOCKS5_GSSAPI_SERVICE - -**Deprecated option** Socks5 GSSAPI service name. -See CURLOPT_SOCKS5_GSSAPI_SERVICE(3) - -## CURLOPT_SOCKS5_GSSAPI_NEC - -Socks5 GSSAPI NEC mode. See CURLOPT_SOCKS5_GSSAPI_NEC(3) - -## CURLOPT_PROXY_SERVICE_NAME - -Proxy authentication service name. CURLOPT_PROXY_SERVICE_NAME(3) - -## CURLOPT_HAPROXYPROTOCOL - -Send an HAProxy PROXY protocol v1 header. See CURLOPT_HAPROXYPROTOCOL(3) - -## CURLOPT_HAPROXY_CLIENT_IP - -Spoof the client IP in an HAProxy PROXY protocol v1 header. See -CURLOPT_HAPROXY_CLIENT_IP(3) - -## CURLOPT_SERVICE_NAME - -Authentication service name. CURLOPT_SERVICE_NAME(3) - -## CURLOPT_INTERFACE - -Bind connection locally to this. See CURLOPT_INTERFACE(3) - -## CURLOPT_LOCALPORT - -Bind connection locally to this port. See CURLOPT_LOCALPORT(3) - -## CURLOPT_LOCALPORTRANGE - -Bind connection locally to port range. See CURLOPT_LOCALPORTRANGE(3) - -## CURLOPT_DNS_CACHE_TIMEOUT - -Timeout for DNS cache. See CURLOPT_DNS_CACHE_TIMEOUT(3) - -## CURLOPT_DNS_USE_GLOBAL_CACHE - -**OBSOLETE** Enable global DNS cache. -See CURLOPT_DNS_USE_GLOBAL_CACHE(3) - -## CURLOPT_DOH_URL - -Use this DoH server for name resolves. See CURLOPT_DOH_URL(3) - -## CURLOPT_BUFFERSIZE - -Ask for alternate buffer size. See CURLOPT_BUFFERSIZE(3) - -## CURLOPT_PORT - -Port number to connect to. See CURLOPT_PORT(3) - -## CURLOPT_TCP_FASTOPEN - -Enable TCP Fast Open. See CURLOPT_TCP_FASTOPEN(3) - -## CURLOPT_TCP_NODELAY - -Disable the Nagle algorithm. See CURLOPT_TCP_NODELAY(3) - -## CURLOPT_ADDRESS_SCOPE - -IPv6 scope for local addresses. See CURLOPT_ADDRESS_SCOPE(3) - -## CURLOPT_TCP_KEEPALIVE - -Enable TCP keep-alive. See CURLOPT_TCP_KEEPALIVE(3) - -## CURLOPT_TCP_KEEPIDLE - -Idle time before sending keep-alive. See CURLOPT_TCP_KEEPIDLE(3) - -## CURLOPT_TCP_KEEPINTVL - -Interval between keep-alive probes. See CURLOPT_TCP_KEEPINTVL(3) - -## CURLOPT_UNIX_SOCKET_PATH - -Path to a Unix domain socket. See CURLOPT_UNIX_SOCKET_PATH(3) - -## CURLOPT_ABSTRACT_UNIX_SOCKET - -Path to an abstract Unix domain socket. See CURLOPT_ABSTRACT_UNIX_SOCKET(3) - -# NAMES and PASSWORDS OPTIONS (Authentication) - -## CURLOPT_NETRC - -Enable .netrc parsing. See CURLOPT_NETRC(3) - -## CURLOPT_NETRC_FILE - -.netrc filename. See CURLOPT_NETRC_FILE(3) - -## CURLOPT_USERPWD - -Username and password. See CURLOPT_USERPWD(3) - -## CURLOPT_PROXYUSERPWD - -Proxy username and password. See CURLOPT_PROXYUSERPWD(3) - -## CURLOPT_USERNAME - -Username. See CURLOPT_USERNAME(3) - -## CURLOPT_PASSWORD - -Password. See CURLOPT_PASSWORD(3) - -## CURLOPT_LOGIN_OPTIONS - -Login options. See CURLOPT_LOGIN_OPTIONS(3) - -## CURLOPT_PROXYUSERNAME - -Proxy username. See CURLOPT_PROXYUSERNAME(3) - -## CURLOPT_PROXYPASSWORD - -Proxy password. See CURLOPT_PROXYPASSWORD(3) - -## CURLOPT_HTTPAUTH - -HTTP server authentication methods. See CURLOPT_HTTPAUTH(3) - -## CURLOPT_TLSAUTH_USERNAME - -TLS authentication username. See CURLOPT_TLSAUTH_USERNAME(3) - -## CURLOPT_PROXY_TLSAUTH_USERNAME - -Proxy TLS authentication username. See CURLOPT_PROXY_TLSAUTH_USERNAME(3) - -## CURLOPT_TLSAUTH_PASSWORD - -TLS authentication password. See CURLOPT_TLSAUTH_PASSWORD(3) - -## CURLOPT_PROXY_TLSAUTH_PASSWORD - -Proxy TLS authentication password. See CURLOPT_PROXY_TLSAUTH_PASSWORD(3) - -## CURLOPT_TLSAUTH_TYPE - -TLS authentication methods. See CURLOPT_TLSAUTH_TYPE(3) - -## CURLOPT_PROXY_TLSAUTH_TYPE - -Proxy TLS authentication methods. See CURLOPT_PROXY_TLSAUTH_TYPE(3) - -## CURLOPT_PROXYAUTH - -HTTP proxy authentication methods. See CURLOPT_PROXYAUTH(3) - -## CURLOPT_SASL_AUTHZID - -SASL authorization identity (identity to act as). See CURLOPT_SASL_AUTHZID(3) - -## CURLOPT_SASL_IR - -Enable SASL initial response. See CURLOPT_SASL_IR(3) - -## CURLOPT_XOAUTH2_BEARER - -OAuth2 bearer token. See CURLOPT_XOAUTH2_BEARER(3) - -## CURLOPT_DISALLOW_USERNAME_IN_URL - -Do not allow username in URL. See CURLOPT_DISALLOW_USERNAME_IN_URL(3) - -# HTTP OPTIONS - -## CURLOPT_AUTOREFERER - -Automatically set Referer: header. See CURLOPT_AUTOREFERER(3) - -## CURLOPT_ACCEPT_ENCODING - -Accept-Encoding and automatic decompressing data. See CURLOPT_ACCEPT_ENCODING(3) - -## CURLOPT_TRANSFER_ENCODING - -Request Transfer-Encoding. See CURLOPT_TRANSFER_ENCODING(3) - -## CURLOPT_FOLLOWLOCATION - -Follow HTTP redirects. See CURLOPT_FOLLOWLOCATION(3) - -## CURLOPT_UNRESTRICTED_AUTH - -Do not restrict authentication to original host. CURLOPT_UNRESTRICTED_AUTH(3) - -## CURLOPT_MAXREDIRS - -Maximum number of redirects to follow. See CURLOPT_MAXREDIRS(3) - -## CURLOPT_POSTREDIR - -How to act on redirects after POST. See CURLOPT_POSTREDIR(3) - -## CURLOPT_PUT - -**Deprecated option** Issue an HTTP PUT request. See CURLOPT_PUT(3) - -## CURLOPT_POST - -Issue an HTTP POST request. See CURLOPT_POST(3) - -## CURLOPT_POSTFIELDS - -Send a POST with this data. See CURLOPT_POSTFIELDS(3) - -## CURLOPT_POSTFIELDSIZE - -The POST data is this big. See CURLOPT_POSTFIELDSIZE(3) - -## CURLOPT_POSTFIELDSIZE_LARGE - -The POST data is this big. See CURLOPT_POSTFIELDSIZE_LARGE(3) - -## CURLOPT_COPYPOSTFIELDS - -Send a POST with this data - and copy it. See CURLOPT_COPYPOSTFIELDS(3) - -## CURLOPT_HTTPPOST - -**Deprecated option** Multipart formpost HTTP POST. -See CURLOPT_HTTPPOST(3) - -## CURLOPT_REFERER - -Referer: header. See CURLOPT_REFERER(3) - -## CURLOPT_USERAGENT - -User-Agent: header. See CURLOPT_USERAGENT(3) - -## CURLOPT_HTTPHEADER - -Custom HTTP headers. See CURLOPT_HTTPHEADER(3) - -## CURLOPT_HEADEROPT - -Control custom headers. See CURLOPT_HEADEROPT(3) - -## CURLOPT_PROXYHEADER - -Custom HTTP headers sent to proxy. See CURLOPT_PROXYHEADER(3) - -## CURLOPT_HTTP200ALIASES - -Alternative versions of 200 OK. See CURLOPT_HTTP200ALIASES(3) +**OBSOLETE** Callback for code base conversion. +See CURLOPT_CONV_TO_NETWORK_FUNCTION(3) ## CURLOPT_COOKIE @@ -604,259 +192,25 @@ File to read cookies from. See CURLOPT_COOKIEFILE(3) File to write cookies to. See CURLOPT_COOKIEJAR(3) -## CURLOPT_COOKIESESSION - -Start a new cookie session. See CURLOPT_COOKIESESSION(3) - ## CURLOPT_COOKIELIST Add or control cookies. See CURLOPT_COOKIELIST(3) -## CURLOPT_ALTSVC +## CURLOPT_COOKIESESSION -Specify the Alt-Svc: cache filename. See CURLOPT_ALTSVC(3) +Start a new cookie session. See CURLOPT_COOKIESESSION(3) -## CURLOPT_ALTSVC_CTRL +## CURLOPT_COPYPOSTFIELDS -Enable and configure Alt-Svc: treatment. See CURLOPT_ALTSVC_CTRL(3) - -## CURLOPT_HSTS - -Set HSTS cache file. See CURLOPT_HSTS(3) - -## CURLOPT_HSTS_CTRL - -Enable HSTS. See CURLOPT_HSTS_CTRL(3) - -## CURLOPT_HSTSREADFUNCTION - -Set HSTS read callback. See CURLOPT_HSTSREADFUNCTION(3) - -## CURLOPT_HSTSREADDATA - -Pass pointer to the HSTS read callback. See CURLOPT_HSTSREADDATA(3) - -## CURLOPT_HSTSWRITEFUNCTION - -Set HSTS write callback. See CURLOPT_HSTSWRITEFUNCTION(3) - -## CURLOPT_HSTSWRITEDATA - -Pass pointer to the HSTS write callback. See CURLOPT_HSTSWRITEDATA(3) - -## CURLOPT_HTTPGET - -Do an HTTP GET request. See CURLOPT_HTTPGET(3) - -## CURLOPT_REQUEST_TARGET - -Set the request target. CURLOPT_REQUEST_TARGET(3) - -## CURLOPT_HTTP_VERSION - -HTTP version to use. CURLOPT_HTTP_VERSION(3) - -## CURLOPT_HTTP09_ALLOWED - -Allow HTTP/0.9 responses. CURLOPT_HTTP09_ALLOWED(3) - -## CURLOPT_IGNORE_CONTENT_LENGTH - -Ignore Content-Length. See CURLOPT_IGNORE_CONTENT_LENGTH(3) - -## CURLOPT_HTTP_CONTENT_DECODING - -Disable Content decoding. See CURLOPT_HTTP_CONTENT_DECODING(3) - -## CURLOPT_HTTP_TRANSFER_DECODING - -Disable Transfer decoding. See CURLOPT_HTTP_TRANSFER_DECODING(3) - -## CURLOPT_EXPECT_100_TIMEOUT_MS - -100-continue timeout. See CURLOPT_EXPECT_100_TIMEOUT_MS(3) - -## CURLOPT_TRAILERFUNCTION - -Set callback for sending trailing headers. See -CURLOPT_TRAILERFUNCTION(3) - -## CURLOPT_TRAILERDATA - -Custom pointer passed to the trailing headers callback. See -CURLOPT_TRAILERDATA(3) - -## CURLOPT_PIPEWAIT - -Wait on connection to pipeline on it. See CURLOPT_PIPEWAIT(3) - -## CURLOPT_STREAM_DEPENDS - -This HTTP/2 stream depends on another. See CURLOPT_STREAM_DEPENDS(3) - -## CURLOPT_STREAM_DEPENDS_E - -This HTTP/2 stream depends on another exclusively. See -CURLOPT_STREAM_DEPENDS_E(3) - -## CURLOPT_STREAM_WEIGHT - -Set this HTTP/2 stream's weight. See CURLOPT_STREAM_WEIGHT(3) - -# SMTP OPTIONS - -## CURLOPT_MAIL_FROM - -Address of the sender. See CURLOPT_MAIL_FROM(3) - -## CURLOPT_MAIL_RCPT - -Address of the recipients. See CURLOPT_MAIL_RCPT(3) - -## CURLOPT_MAIL_AUTH - -Authentication address. See CURLOPT_MAIL_AUTH(3) - -## CURLOPT_MAIL_RCPT_ALLOWFAILS - -Allow RCPT TO command to fail for some recipients. See -CURLOPT_MAIL_RCPT_ALLOWFAILS(3) - -# TFTP OPTIONS - -## CURLOPT_TFTP_BLKSIZE - -TFTP block size. See CURLOPT_TFTP_BLKSIZE(3) - -## CURLOPT_TFTP_NO_OPTIONS - -Do not send TFTP options requests. See CURLOPT_TFTP_NO_OPTIONS(3) - -# FTP OPTIONS - -## CURLOPT_FTPPORT - -Use active FTP. See CURLOPT_FTPPORT(3) - -## CURLOPT_QUOTE - -Commands to run before transfer. See CURLOPT_QUOTE(3) - -## CURLOPT_POSTQUOTE - -Commands to run after transfer. See CURLOPT_POSTQUOTE(3) - -## CURLOPT_PREQUOTE - -Commands to run just before transfer. See CURLOPT_PREQUOTE(3) - -## CURLOPT_APPEND - -Append to remote file. See CURLOPT_APPEND(3) - -## CURLOPT_FTP_USE_EPRT - -Use EPRT. See CURLOPT_FTP_USE_EPRT(3) - -## CURLOPT_FTP_USE_EPSV - -Use EPSV. See CURLOPT_FTP_USE_EPSV(3) - -## CURLOPT_FTP_USE_PRET - -Use PRET. See CURLOPT_FTP_USE_PRET(3) - -## CURLOPT_FTP_CREATE_MISSING_DIRS - -Create missing directories on the remote server. See CURLOPT_FTP_CREATE_MISSING_DIRS(3) - -## CURLOPT_SERVER_RESPONSE_TIMEOUT - -Timeout for server responses. See CURLOPT_SERVER_RESPONSE_TIMEOUT(3) - -## CURLOPT_SERVER_RESPONSE_TIMEOUT_MS - -Timeout for server responses. See CURLOPT_SERVER_RESPONSE_TIMEOUT_MS(3) - -## CURLOPT_FTP_ALTERNATIVE_TO_USER - -Alternative to USER. See CURLOPT_FTP_ALTERNATIVE_TO_USER(3) - -## CURLOPT_FTP_SKIP_PASV_IP - -Ignore the IP address in the PASV response. See CURLOPT_FTP_SKIP_PASV_IP(3) - -## CURLOPT_FTPSSLAUTH - -Control how to do TLS. See CURLOPT_FTPSSLAUTH(3) - -## CURLOPT_FTP_SSL_CCC - -Back to non-TLS again after authentication. See CURLOPT_FTP_SSL_CCC(3) - -## CURLOPT_FTP_ACCOUNT - -Send ACCT command. See CURLOPT_FTP_ACCOUNT(3) - -## CURLOPT_FTP_FILEMETHOD - -Specify how to reach files. See CURLOPT_FTP_FILEMETHOD(3) - -# RTSP OPTIONS - -## CURLOPT_RTSP_REQUEST - -RTSP request. See CURLOPT_RTSP_REQUEST(3) - -## CURLOPT_RTSP_SESSION_ID - -RTSP session-id. See CURLOPT_RTSP_SESSION_ID(3) - -## CURLOPT_RTSP_STREAM_URI - -RTSP stream URI. See CURLOPT_RTSP_STREAM_URI(3) - -## CURLOPT_RTSP_TRANSPORT - -RTSP Transport: header. See CURLOPT_RTSP_TRANSPORT(3) - -## CURLOPT_RTSP_CLIENT_CSEQ - -Client CSEQ number. See CURLOPT_RTSP_CLIENT_CSEQ(3) - -## CURLOPT_RTSP_SERVER_CSEQ - -CSEQ number for RTSP Server-\>Client request. See CURLOPT_RTSP_SERVER_CSEQ(3) - -## CURLOPT_AWS_SIGV4 - -AWS HTTP V4 Signature. See CURLOPT_AWS_SIGV4(3) - -# PROTOCOL OPTIONS - -## CURLOPT_TRANSFERTEXT - -Use text transfer. See CURLOPT_TRANSFERTEXT(3) - -## CURLOPT_PROXY_TRANSFER_MODE - -Add transfer mode to URL over proxy. See CURLOPT_PROXY_TRANSFER_MODE(3) +Send a POST with this data - and copy it. See CURLOPT_COPYPOSTFIELDS(3) ## CURLOPT_CRLF Convert newlines. See CURLOPT_CRLF(3) -## CURLOPT_RANGE +## CURLOPT_CRLFILE -Range requests. See CURLOPT_RANGE(3) - -## CURLOPT_RESUME_FROM - -Resume a transfer. See CURLOPT_RESUME_FROM(3) - -## CURLOPT_RESUME_FROM_LARGE - -Resume a transfer. See CURLOPT_RESUME_FROM_LARGE(3) +Certificate Revocation List. See CURLOPT_CRLFILE(3) ## CURLOPT_CURLU @@ -866,132 +220,29 @@ Set URL to work on with a URL handle. See CURLOPT_CURLU(3) Custom request/method. See CURLOPT_CUSTOMREQUEST(3) -## CURLOPT_FILETIME +## CURLOPT_DEBUGDATA -Request file modification date and time. See CURLOPT_FILETIME(3) +Data pointer to pass to the debug callback. See CURLOPT_DEBUGDATA(3) + +## CURLOPT_DEBUGFUNCTION + +Callback for debug information. See CURLOPT_DEBUGFUNCTION(3) + +## CURLOPT_DEFAULT_PROTOCOL + +Default protocol. See CURLOPT_DEFAULT_PROTOCOL(3) ## CURLOPT_DIRLISTONLY List only. See CURLOPT_DIRLISTONLY(3) -## CURLOPT_NOBODY +## CURLOPT_DISALLOW_USERNAME_IN_URL -Do not get the body contents. See CURLOPT_NOBODY(3) +Do not allow username in URL. See CURLOPT_DISALLOW_USERNAME_IN_URL(3) -## CURLOPT_INFILESIZE +## CURLOPT_DNS_CACHE_TIMEOUT -Size of file to send. CURLOPT_INFILESIZE(3) - -## CURLOPT_INFILESIZE_LARGE - -Size of file to send. CURLOPT_INFILESIZE_LARGE(3) - -## CURLOPT_UPLOAD - -Upload data. See CURLOPT_UPLOAD(3) - -## CURLOPT_UPLOAD_BUFFERSIZE - -Set upload buffer size. See CURLOPT_UPLOAD_BUFFERSIZE(3) - -## CURLOPT_MIMEPOST - -Post/send MIME data. See CURLOPT_MIMEPOST(3) - -## CURLOPT_MIME_OPTIONS - -Set MIME option flags. See CURLOPT_MIME_OPTIONS(3) - -## CURLOPT_MAXFILESIZE - -Maximum file size to get. See CURLOPT_MAXFILESIZE(3) - -## CURLOPT_MAXFILESIZE_LARGE - -Maximum file size to get. See CURLOPT_MAXFILESIZE_LARGE(3) - -## CURLOPT_TIMECONDITION - -Make a time conditional request. See CURLOPT_TIMECONDITION(3) - -## CURLOPT_TIMEVALUE - -Time value for the time conditional request. See CURLOPT_TIMEVALUE(3) - -## CURLOPT_TIMEVALUE_LARGE - -Time value for the time conditional request. See CURLOPT_TIMEVALUE_LARGE(3) - -# CONNECTION OPTIONS - -## CURLOPT_TIMEOUT - -Timeout for the entire request. See CURLOPT_TIMEOUT(3) - -## CURLOPT_TIMEOUT_MS - -Millisecond timeout for the entire request. See CURLOPT_TIMEOUT_MS(3) - -## CURLOPT_LOW_SPEED_LIMIT - -Low speed limit to abort transfer. See CURLOPT_LOW_SPEED_LIMIT(3) - -## CURLOPT_LOW_SPEED_TIME - -Time to be below the speed to trigger low speed abort. See CURLOPT_LOW_SPEED_TIME(3) - -## CURLOPT_MAX_SEND_SPEED_LARGE - -Cap the upload speed to this. See CURLOPT_MAX_SEND_SPEED_LARGE(3) - -## CURLOPT_MAX_RECV_SPEED_LARGE - -Cap the download speed to this. See CURLOPT_MAX_RECV_SPEED_LARGE(3) - -## CURLOPT_MAXCONNECTS - -Maximum number of connections in the connection pool. See CURLOPT_MAXCONNECTS(3) - -## CURLOPT_FRESH_CONNECT - -Use a new connection. CURLOPT_FRESH_CONNECT(3) - -## CURLOPT_FORBID_REUSE - -Prevent subsequent connections from reusing this. See CURLOPT_FORBID_REUSE(3) - -## CURLOPT_MAXAGE_CONN - -Limit the age (idle time) of connections for reuse. See CURLOPT_MAXAGE_CONN(3) - -## CURLOPT_MAXLIFETIME_CONN - -Limit the age (since creation) of connections for reuse. See -CURLOPT_MAXLIFETIME_CONN(3) - -## CURLOPT_CONNECTTIMEOUT - -Timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT(3) - -## CURLOPT_CONNECTTIMEOUT_MS - -Millisecond timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT_MS(3) - -## CURLOPT_IPRESOLVE - -IP version to use. See CURLOPT_IPRESOLVE(3) - -## CURLOPT_CONNECT_ONLY - -Only connect, nothing else. See CURLOPT_CONNECT_ONLY(3) - -## CURLOPT_USE_SSL - -Use TLS/SSL. See CURLOPT_USE_SSL(3) - -## CURLOPT_RESOLVE - -Provide fixed/fake name resolves. See CURLOPT_RESOLVE(3) +Timeout for DNS cache. See CURLOPT_DNS_CACHE_TIMEOUT(3) ## CURLOPT_DNS_INTERFACE @@ -1013,78 +264,846 @@ Preferred DNS servers. See CURLOPT_DNS_SERVERS(3) Shuffle addresses before use. See CURLOPT_DNS_SHUFFLE_ADDRESSES(3) -## CURLOPT_ACCEPTTIMEOUT_MS +## CURLOPT_DNS_USE_GLOBAL_CACHE -Timeout for waiting for the server's connect back to be accepted. See -CURLOPT_ACCEPTTIMEOUT_MS(3) +**OBSOLETE** Enable global DNS cache. See CURLOPT_DNS_USE_GLOBAL_CACHE(3) + +## CURLOPT_DOH_SSL_VERIFYHOST + +Verify the hostname in the DoH (DNS-over-HTTPS) SSL certificate. See +CURLOPT_DOH_SSL_VERIFYHOST(3) + +## CURLOPT_DOH_SSL_VERIFYPEER + +Verify the DoH (DNS-over-HTTPS) SSL certificate. See +CURLOPT_DOH_SSL_VERIFYPEER(3) + +## CURLOPT_DOH_SSL_VERIFYSTATUS + +Verify the DoH (DNS-over-HTTPS) SSL certificate's status. See +CURLOPT_DOH_SSL_VERIFYSTATUS(3) + +## CURLOPT_DOH_URL + +Use this DoH server for name resolves. See CURLOPT_DOH_URL(3) + +## CURLOPT_ECH + +Set the configuration for ECH. See CURLOPT_ECH(3) + +## CURLOPT_EGDSOCKET + +**OBSOLETE** Identify EGD socket for entropy. See CURLOPT_EGDSOCKET(3) + +## CURLOPT_ERRORBUFFER + +Error message buffer. See CURLOPT_ERRORBUFFER(3) + +## CURLOPT_EXPECT_100_TIMEOUT_MS + +100-continue timeout. See CURLOPT_EXPECT_100_TIMEOUT_MS(3) + +## CURLOPT_FAILONERROR + +Fail on HTTP 4xx errors. CURLOPT_FAILONERROR(3) + +## CURLOPT_FILETIME + +Request file modification date and time. See CURLOPT_FILETIME(3) + +## CURLOPT_FNMATCH_DATA + +Data pointer to pass to the wildcard matching callback. See +CURLOPT_FNMATCH_DATA(3) + +## CURLOPT_FNMATCH_FUNCTION + +Callback for wildcard matching. See CURLOPT_FNMATCH_FUNCTION(3) + +## CURLOPT_FOLLOWLOCATION + +Follow HTTP redirects. See CURLOPT_FOLLOWLOCATION(3) + +## CURLOPT_FORBID_REUSE + +Prevent subsequent connections from reusing this. See CURLOPT_FORBID_REUSE(3) + +## CURLOPT_FRESH_CONNECT + +Use a new connection. CURLOPT_FRESH_CONNECT(3) + +## CURLOPT_FTPPORT + +Use active FTP. See CURLOPT_FTPPORT(3) + +## CURLOPT_FTPSSLAUTH + +Control how to do TLS. See CURLOPT_FTPSSLAUTH(3) + +## CURLOPT_FTP_ACCOUNT + +Send ACCT command. See CURLOPT_FTP_ACCOUNT(3) + +## CURLOPT_FTP_ALTERNATIVE_TO_USER + +Alternative to USER. See CURLOPT_FTP_ALTERNATIVE_TO_USER(3) + +## CURLOPT_FTP_CREATE_MISSING_DIRS + +Create missing directories on the remote server. See +CURLOPT_FTP_CREATE_MISSING_DIRS(3) + +## CURLOPT_FTP_FILEMETHOD + +Specify how to reach files. See CURLOPT_FTP_FILEMETHOD(3) + +## CURLOPT_FTP_SKIP_PASV_IP + +Ignore the IP address in the PASV response. See CURLOPT_FTP_SKIP_PASV_IP(3) + +## CURLOPT_FTP_SSL_CCC + +Back to non-TLS again after authentication. See CURLOPT_FTP_SSL_CCC(3) + +## CURLOPT_FTP_USE_EPRT + +Use EPRT. See CURLOPT_FTP_USE_EPRT(3) + +## CURLOPT_FTP_USE_EPSV + +Use EPSV. See CURLOPT_FTP_USE_EPSV(3) + +## CURLOPT_FTP_USE_PRET + +Use PRET. See CURLOPT_FTP_USE_PRET(3) + +## CURLOPT_GSSAPI_DELEGATION + +Disable GSS-API delegation. See CURLOPT_GSSAPI_DELEGATION(3) ## CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS Timeout for happy eyeballs. See CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS(3) -## CURLOPT_UPKEEP_INTERVAL_MS +## CURLOPT_HAPROXYPROTOCOL -Sets the interval at which connection upkeep are performed. See -CURLOPT_UPKEEP_INTERVAL_MS(3) +Send an HAProxy PROXY protocol v1 header. See CURLOPT_HAPROXYPROTOCOL(3) -# SSL and SECURITY OPTIONS +## CURLOPT_HAPROXY_CLIENT_IP -## CURLOPT_SSLCERT +Spoof the client IP in an HAProxy PROXY protocol v1 header. See +CURLOPT_HAPROXY_CLIENT_IP(3) -Client cert. See CURLOPT_SSLCERT(3) +## CURLOPT_HEADER -## CURLOPT_SSLCERT_BLOB +Include the header in the body output. See CURLOPT_HEADER(3) -Client cert memory buffer. See CURLOPT_SSLCERT_BLOB(3) +## CURLOPT_HEADERDATA -## CURLOPT_PROXY_SSLCERT +Data pointer to pass to the header callback. See CURLOPT_HEADERDATA(3) -Proxy client cert. See CURLOPT_PROXY_SSLCERT(3) +## CURLOPT_HEADERFUNCTION -## CURLOPT_PROXY_SSLCERT_BLOB +Callback for writing received headers. See CURLOPT_HEADERFUNCTION(3) -Proxy client cert memory buffer. See CURLOPT_PROXY_SSLCERT_BLOB(3) +## CURLOPT_HEADEROPT -## CURLOPT_SSLCERTTYPE +Control custom headers. See CURLOPT_HEADEROPT(3) -Client cert type. See CURLOPT_SSLCERTTYPE(3) +## CURLOPT_HSTS -## CURLOPT_PROXY_SSLCERTTYPE +Set HSTS cache file. See CURLOPT_HSTS(3) -Proxy client cert type. See CURLOPT_PROXY_SSLCERTTYPE(3) +## CURLOPT_HSTSREADDATA -## CURLOPT_SSLKEY +Pass pointer to the HSTS read callback. See CURLOPT_HSTSREADDATA(3) -Client key. See CURLOPT_SSLKEY(3) +## CURLOPT_HSTSREADFUNCTION -## CURLOPT_SSLKEY_BLOB +Set HSTS read callback. See CURLOPT_HSTSREADFUNCTION(3) -Client key memory buffer. See CURLOPT_SSLKEY_BLOB(3) +## CURLOPT_HSTSWRITEDATA -## CURLOPT_PROXY_SSLKEY +Pass pointer to the HSTS write callback. See CURLOPT_HSTSWRITEDATA(3) -Proxy client key. See CURLOPT_PROXY_SSLKEY(3) +## CURLOPT_HSTSWRITEFUNCTION -## CURLOPT_PROXY_SSLKEY_BLOB +Set HSTS write callback. See CURLOPT_HSTSWRITEFUNCTION(3) -Proxy client key. See CURLOPT_PROXY_SSLKEY_BLOB(3) +## CURLOPT_HSTS_CTRL -## CURLOPT_SSLKEYTYPE +Enable HSTS. See CURLOPT_HSTS_CTRL(3) -Client key type. See CURLOPT_SSLKEYTYPE(3) +## CURLOPT_HTTP09_ALLOWED -## CURLOPT_PROXY_SSLKEYTYPE +Allow HTTP/0.9 responses. CURLOPT_HTTP09_ALLOWED(3) -Proxy client key type. See CURLOPT_PROXY_SSLKEYTYPE(3) +## CURLOPT_HTTP200ALIASES + +Alternative versions of 200 OK. See CURLOPT_HTTP200ALIASES(3) + +## CURLOPT_HTTPAUTH + +HTTP server authentication methods. See CURLOPT_HTTPAUTH(3) + +## CURLOPT_HTTPGET + +Do an HTTP GET request. See CURLOPT_HTTPGET(3) + +## CURLOPT_HTTPHEADER + +Custom HTTP headers. See CURLOPT_HTTPHEADER(3) + +## CURLOPT_HTTPPOST + +**Deprecated option** Multipart formpost HTTP POST. +See CURLOPT_HTTPPOST(3) + +## CURLOPT_HTTPPROXYTUNNEL + +Tunnel through the HTTP proxy. CURLOPT_HTTPPROXYTUNNEL(3) + +## CURLOPT_HTTP_CONTENT_DECODING + +Disable Content decoding. See CURLOPT_HTTP_CONTENT_DECODING(3) + +## CURLOPT_HTTP_TRANSFER_DECODING + +Disable Transfer decoding. See CURLOPT_HTTP_TRANSFER_DECODING(3) + +## CURLOPT_HTTP_VERSION + +HTTP version to use. CURLOPT_HTTP_VERSION(3) + +## CURLOPT_IGNORE_CONTENT_LENGTH + +Ignore Content-Length. See CURLOPT_IGNORE_CONTENT_LENGTH(3) + +## CURLOPT_INFILESIZE + +Size of file to send. CURLOPT_INFILESIZE(3) + +## CURLOPT_INFILESIZE_LARGE + +Size of file to send. CURLOPT_INFILESIZE_LARGE(3) + +## CURLOPT_INTERFACE + +Bind connection locally to this. See CURLOPT_INTERFACE(3) + +## CURLOPT_INTERLEAVEDATA + +Data pointer to pass to the RTSP interleave callback. See +CURLOPT_INTERLEAVEDATA(3) + +## CURLOPT_INTERLEAVEFUNCTION + +Callback for RTSP interleaved data. See CURLOPT_INTERLEAVEFUNCTION(3) + +## CURLOPT_IOCTLDATA + +**Deprecated option** Data pointer to pass to the I/O callback. +See CURLOPT_IOCTLDATA(3) + +## CURLOPT_IOCTLFUNCTION + +**Deprecated option** Callback for I/O operations. +See CURLOPT_IOCTLFUNCTION(3) + +## CURLOPT_IPRESOLVE + +IP version to use. See CURLOPT_IPRESOLVE(3) + +## CURLOPT_ISSUERCERT + +Issuer certificate. See CURLOPT_ISSUERCERT(3) + +## CURLOPT_ISSUERCERT_BLOB + +Issuer certificate memory buffer. See CURLOPT_ISSUERCERT_BLOB(3) + +## CURLOPT_KEEP_SENDING_ON_ERROR + +Keep sending on HTTP \>= 300 errors. CURLOPT_KEEP_SENDING_ON_ERROR(3) ## CURLOPT_KEYPASSWD Client key password. See CURLOPT_KEYPASSWD(3) +## CURLOPT_KRBLEVEL + +Kerberos security level. See CURLOPT_KRBLEVEL(3) + +## CURLOPT_LOCALPORT + +Bind connection locally to this port. See CURLOPT_LOCALPORT(3) + +## CURLOPT_LOCALPORTRANGE + +Bind connection locally to port range. See CURLOPT_LOCALPORTRANGE(3) + +## CURLOPT_LOGIN_OPTIONS + +Login options. See CURLOPT_LOGIN_OPTIONS(3) + +## CURLOPT_LOW_SPEED_LIMIT + +Low speed limit to abort transfer. See CURLOPT_LOW_SPEED_LIMIT(3) + +## CURLOPT_LOW_SPEED_TIME + +Time to be below the speed to trigger low speed abort. See +CURLOPT_LOW_SPEED_TIME(3) + +## CURLOPT_MAIL_AUTH + +Authentication address. See CURLOPT_MAIL_AUTH(3) + +## CURLOPT_MAIL_FROM + +Address of the sender. See CURLOPT_MAIL_FROM(3) + +## CURLOPT_MAIL_RCPT + +Address of the recipients. See CURLOPT_MAIL_RCPT(3) + +## CURLOPT_MAIL_RCPT_ALLOWFAILS + +Allow RCPT TO command to fail for some recipients. See +CURLOPT_MAIL_RCPT_ALLOWFAILS(3) + +## CURLOPT_MAXAGE_CONN + +Limit the age (idle time) of connections for reuse. See CURLOPT_MAXAGE_CONN(3) + +## CURLOPT_MAXCONNECTS + +Maximum number of connections in the connection pool. See +CURLOPT_MAXCONNECTS(3) + +## CURLOPT_MAXFILESIZE + +Maximum file size to get. See CURLOPT_MAXFILESIZE(3) + +## CURLOPT_MAXFILESIZE_LARGE + +Maximum file size to get. See CURLOPT_MAXFILESIZE_LARGE(3) + +## CURLOPT_MAXLIFETIME_CONN + +Limit the age (since creation) of connections for reuse. See +CURLOPT_MAXLIFETIME_CONN(3) + +## CURLOPT_MAXREDIRS + +Maximum number of redirects to follow. See CURLOPT_MAXREDIRS(3) + +## CURLOPT_MAX_RECV_SPEED_LARGE + +Cap the download speed to this. See CURLOPT_MAX_RECV_SPEED_LARGE(3) + +## CURLOPT_MAX_SEND_SPEED_LARGE + +Cap the upload speed to this. See CURLOPT_MAX_SEND_SPEED_LARGE(3) + +## CURLOPT_MIMEPOST + +Post/send MIME data. See CURLOPT_MIMEPOST(3) + +## CURLOPT_MIME_OPTIONS + +Set MIME option flags. See CURLOPT_MIME_OPTIONS(3) + +## CURLOPT_NETRC + +Enable .netrc parsing. See CURLOPT_NETRC(3) + +## CURLOPT_NETRC_FILE + +.netrc filename. See CURLOPT_NETRC_FILE(3) + +## CURLOPT_NEW_DIRECTORY_PERMS + +Mode for creating new remote directories. See CURLOPT_NEW_DIRECTORY_PERMS(3) + +## CURLOPT_NEW_FILE_PERMS + +Mode for creating new remote files. See CURLOPT_NEW_FILE_PERMS(3) + +## CURLOPT_NOBODY + +Do not get the body contents. See CURLOPT_NOBODY(3) + +## CURLOPT_NOPROGRESS + +Shut off the progress meter. See CURLOPT_NOPROGRESS(3) + +## CURLOPT_NOPROXY + +Filter out hosts from proxy use. CURLOPT_NOPROXY(3) + +## CURLOPT_NOSIGNAL + +Do not install signal handlers. See CURLOPT_NOSIGNAL(3) + +## CURLOPT_OPENSOCKETDATA + +Data pointer to pass to the open socket callback. See CURLOPT_OPENSOCKETDATA(3) + +## CURLOPT_OPENSOCKETFUNCTION + +Callback for socket creation. See CURLOPT_OPENSOCKETFUNCTION(3) + +## CURLOPT_PASSWORD + +Password. See CURLOPT_PASSWORD(3) + +## CURLOPT_PATH_AS_IS + +Disable squashing /../ and /./ sequences in the path. See CURLOPT_PATH_AS_IS(3) + +## CURLOPT_PINNEDPUBLICKEY + +Set pinned SSL public key . See CURLOPT_PINNEDPUBLICKEY(3) + +## CURLOPT_PIPEWAIT + +Wait on connection to pipeline on it. See CURLOPT_PIPEWAIT(3) + +## CURLOPT_PORT + +Port number to connect to. See CURLOPT_PORT(3) + +## CURLOPT_POST + +Make an HTTP POST. See CURLOPT_POST(3) + +## CURLOPT_POSTFIELDSIZE + +The POST data is this big. See CURLOPT_POSTFIELDSIZE(3) + +## CURLOPT_POSTFIELDSIZE_LARGE + +The POST data is this big. See CURLOPT_POSTFIELDSIZE_LARGE(3) + +## CURLOPT_POSTQUOTE + +Commands to run after transfer. See CURLOPT_POSTQUOTE(3) + +## CURLOPT_POSTREDIR + +How to act on redirects after POST. See CURLOPT_POSTREDIR(3) + +## CURLOPT_PREQUOTE + +Commands to run just before transfer. See CURLOPT_PREQUOTE(3) + +## CURLOPT_PREREQDATA + +Data pointer to pass to the CURLOPT_PREREQFUNCTION callback. See +CURLOPT_PREREQDATA(3) + +## CURLOPT_PREREQFUNCTION + +Callback to be called after a connection is established but before a request +is made on that connection. See CURLOPT_PREREQFUNCTION(3) + +## CURLOPT_PRE_PROXY + +Socks proxy to use. See CURLOPT_PRE_PROXY(3) + +## CURLOPT_PRIVATE + +Private pointer to store. See CURLOPT_PRIVATE(3) + +## CURLOPT_PROGRESSDATA + +Data pointer to pass to the progress meter callback. See +CURLOPT_PROGRESSDATA(3) + +## CURLOPT_PROGRESSFUNCTION + +**OBSOLETE** callback for progress meter. See CURLOPT_PROGRESSFUNCTION(3) + +## CURLOPT_PROTOCOLS + +**Deprecated option** Allowed protocols. See CURLOPT_PROTOCOLS(3) + +## CURLOPT_PROTOCOLS_STR + +Allowed protocols. See CURLOPT_PROTOCOLS_STR(3) + +## CURLOPT_PROXY + +Proxy to use. See CURLOPT_PROXY(3) + +## CURLOPT_PROXYAUTH + +HTTP proxy authentication methods. See CURLOPT_PROXYAUTH(3) + +## CURLOPT_PROXYHEADER + +Custom HTTP headers sent to proxy. See CURLOPT_PROXYHEADER(3) + +## CURLOPT_PROXYPASSWORD + +Proxy password. See CURLOPT_PROXYPASSWORD(3) + +## CURLOPT_PROXYPORT + +Proxy port to use. See CURLOPT_PROXYPORT(3) + +## CURLOPT_PROXYTYPE + +Proxy type. See CURLOPT_PROXYTYPE(3) + +## CURLOPT_PROXYUSERNAME +Proxy username. See CURLOPT_PROXYUSERNAME(3) + +## CURLOPT_PROXYUSERPWD + +Proxy username and password. See CURLOPT_PROXYUSERPWD(3) + +## CURLOPT_PROXY_CAINFO + +Proxy CA cert bundle. See CURLOPT_PROXY_CAINFO(3) + +## CURLOPT_PROXY_CAINFO_BLOB + +Proxy CA cert bundle memory buffer. See CURLOPT_PROXY_CAINFO_BLOB(3) + +## CURLOPT_PROXY_CAPATH + +Path to proxy CA cert bundle. See CURLOPT_PROXY_CAPATH(3) + +## CURLOPT_PROXY_CRLFILE + +Proxy Certificate Revocation List. See CURLOPT_PROXY_CRLFILE(3) + +## CURLOPT_PROXY_ISSUERCERT + +Proxy issuer certificate. See CURLOPT_PROXY_ISSUERCERT(3) + +## CURLOPT_PROXY_ISSUERCERT_BLOB + +Proxy issuer certificate memory buffer. See CURLOPT_PROXY_ISSUERCERT_BLOB(3) + ## CURLOPT_PROXY_KEYPASSWD Proxy client key password. See CURLOPT_PROXY_KEYPASSWD(3) +## CURLOPT_PROXY_PINNEDPUBLICKEY + +Set the proxy's pinned SSL public key. See +CURLOPT_PROXY_PINNEDPUBLICKEY(3) + +## CURLOPT_PROXY_SERVICE_NAME + +Proxy authentication service name. CURLOPT_PROXY_SERVICE_NAME(3) + +## CURLOPT_PROXY_SSLCERT + +Proxy client cert. See CURLOPT_PROXY_SSLCERT(3) + +## CURLOPT_PROXY_SSLCERTTYPE + +Proxy client cert type. See CURLOPT_PROXY_SSLCERTTYPE(3) + +## CURLOPT_PROXY_SSLCERT_BLOB + +Proxy client cert memory buffer. See CURLOPT_PROXY_SSLCERT_BLOB(3) + +## CURLOPT_PROXY_SSLKEY + +Proxy client key. See CURLOPT_PROXY_SSLKEY(3) + +## CURLOPT_PROXY_SSLKEYTYPE + +Proxy client key type. See CURLOPT_PROXY_SSLKEYTYPE(3) + +## CURLOPT_PROXY_SSLKEY_BLOB + +Proxy client key. See CURLOPT_PROXY_SSLKEY_BLOB(3) + +## CURLOPT_PROXY_SSLVERSION + +Proxy SSL version to use. See CURLOPT_PROXY_SSLVERSION(3) + +## CURLOPT_PROXY_SSL_CIPHER_LIST + +Proxy ciphers to use. See CURLOPT_PROXY_SSL_CIPHER_LIST(3) + +## CURLOPT_PROXY_SSL_OPTIONS + +Control proxy SSL behavior. See CURLOPT_PROXY_SSL_OPTIONS(3) + +## CURLOPT_PROXY_SSL_VERIFYHOST + +Verify the hostname in the proxy SSL certificate. See +CURLOPT_PROXY_SSL_VERIFYHOST(3) + +## CURLOPT_PROXY_SSL_VERIFYPEER + +Verify the proxy SSL certificate. See CURLOPT_PROXY_SSL_VERIFYPEER(3) + +## CURLOPT_PROXY_TLS13_CIPHERS + +Proxy TLS 1.3 cipher suites to use. See CURLOPT_PROXY_TLS13_CIPHERS(3) + +## CURLOPT_PROXY_TLSAUTH_PASSWORD + +Proxy TLS authentication password. See CURLOPT_PROXY_TLSAUTH_PASSWORD(3) + +## CURLOPT_PROXY_TLSAUTH_TYPE + +Proxy TLS authentication methods. See CURLOPT_PROXY_TLSAUTH_TYPE(3) + +## CURLOPT_PROXY_TLSAUTH_USERNAME + +Proxy TLS authentication username. See CURLOPT_PROXY_TLSAUTH_USERNAME(3) + +## CURLOPT_PROXY_TRANSFER_MODE + +Add transfer mode to URL over proxy. See CURLOPT_PROXY_TRANSFER_MODE(3) + +## CURLOPT_PUT + +**Deprecated option** Issue an HTTP PUT request. See CURLOPT_PUT(3) + +## CURLOPT_QUICK_EXIT + +To be set by toplevel tools like "curl" to skip lengthy cleanups when they are +about to call exit() anyway. See CURLOPT_QUICK_EXIT(3) + +## CURLOPT_QUOTE + +Commands to run before transfer. See CURLOPT_QUOTE(3) + +## CURLOPT_RANDOM_FILE + +**OBSOLETE** Provide source for entropy random data. +See CURLOPT_RANDOM_FILE(3) + +## CURLOPT_RANGE + +Range requests. See CURLOPT_RANGE(3) + +## CURLOPT_READDATA + +Data pointer to pass to the read callback. See CURLOPT_READDATA(3) + +## CURLOPT_READFUNCTION + +Callback for reading data. See CURLOPT_READFUNCTION(3) + +## CURLOPT_REDIR_PROTOCOLS + +**Deprecated option** Protocols to allow redirects to. See +CURLOPT_REDIR_PROTOCOLS(3) + +## CURLOPT_REDIR_PROTOCOLS_STR + +Protocols to allow redirects to. See CURLOPT_REDIR_PROTOCOLS_STR(3) + +## CURLOPT_REFERER + +Referer: header. See CURLOPT_REFERER(3) + +## CURLOPT_REQUEST_TARGET + +Set the request target. CURLOPT_REQUEST_TARGET(3) + +## CURLOPT_RESOLVE + +Provide fixed/fake name resolves. See CURLOPT_RESOLVE(3) + +## CURLOPT_RESOLVER_START_DATA + +Data pointer to pass to resolver start callback. See +CURLOPT_RESOLVER_START_DATA(3) + +## CURLOPT_RESOLVER_START_FUNCTION + +Callback to be called before a new resolve request is started. See +CURLOPT_RESOLVER_START_FUNCTION(3) + +## CURLOPT_RESUME_FROM + +Resume a transfer. See CURLOPT_RESUME_FROM(3) + +## CURLOPT_RESUME_FROM_LARGE + +Resume a transfer. See CURLOPT_RESUME_FROM_LARGE(3) + +## CURLOPT_RTSP_CLIENT_CSEQ + +Client CSEQ number. See CURLOPT_RTSP_CLIENT_CSEQ(3) + +## CURLOPT_RTSP_REQUEST + +RTSP request. See CURLOPT_RTSP_REQUEST(3) + +## CURLOPT_RTSP_SERVER_CSEQ + +CSEQ number for RTSP Server-\>Client request. See CURLOPT_RTSP_SERVER_CSEQ(3) + +## CURLOPT_RTSP_SESSION_ID + +RTSP session-id. See CURLOPT_RTSP_SESSION_ID(3) + +## CURLOPT_RTSP_STREAM_URI + +RTSP stream URI. See CURLOPT_RTSP_STREAM_URI(3) + +## CURLOPT_RTSP_TRANSPORT + +RTSP Transport: header. See CURLOPT_RTSP_TRANSPORT(3) + +## CURLOPT_SASL_AUTHZID + +SASL authorization identity (identity to act as). See CURLOPT_SASL_AUTHZID(3) + +## CURLOPT_SASL_IR + +Enable SASL initial response. See CURLOPT_SASL_IR(3) + +## CURLOPT_SEEKDATA + +Data pointer to pass to the seek callback. See CURLOPT_SEEKDATA(3) + +## CURLOPT_SEEKFUNCTION + +Callback for seek operations. See CURLOPT_SEEKFUNCTION(3) + +## CURLOPT_SERVER_RESPONSE_TIMEOUT + +Timeout for server responses. See CURLOPT_SERVER_RESPONSE_TIMEOUT(3) + +## CURLOPT_SERVER_RESPONSE_TIMEOUT_MS + +Timeout for server responses. See CURLOPT_SERVER_RESPONSE_TIMEOUT_MS(3) + +## CURLOPT_SERVICE_NAME + +Authentication service name. CURLOPT_SERVICE_NAME(3) + +## CURLOPT_SHARE + +Share object to use. See CURLOPT_SHARE(3) + +## CURLOPT_SOCKOPTDATA + +Data pointer to pass to the sockopt callback. See CURLOPT_SOCKOPTDATA(3) + +## CURLOPT_SOCKOPTFUNCTION + +Callback for sockopt operations. See CURLOPT_SOCKOPTFUNCTION(3) + +## CURLOPT_SOCKS5_AUTH + +Socks5 authentication methods. See CURLOPT_SOCKS5_AUTH(3) + +## CURLOPT_SOCKS5_GSSAPI_NEC + +Socks5 GSSAPI NEC mode. See CURLOPT_SOCKS5_GSSAPI_NEC(3) + +## CURLOPT_SOCKS5_GSSAPI_SERVICE + +**Deprecated option** Socks5 GSSAPI service name. +See CURLOPT_SOCKS5_GSSAPI_SERVICE(3) + +## CURLOPT_SSH_AUTH_TYPES + +SSH authentication types. See CURLOPT_SSH_AUTH_TYPES(3) + +## CURLOPT_SSH_COMPRESSION + +Enable SSH compression. See CURLOPT_SSH_COMPRESSION(3) + +## CURLOPT_SSH_HOSTKEYDATA + +Custom pointer to pass to ssh host key callback. See CURLOPT_SSH_HOSTKEYDATA(3) + +## CURLOPT_SSH_HOSTKEYFUNCTION + +Callback for checking host key handling. See CURLOPT_SSH_HOSTKEYFUNCTION(3) + +## CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 + +MD5 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_MD5(3) + +## CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 + +SHA256 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256(3) + +## CURLOPT_SSH_KEYDATA + +Custom pointer to pass to ssh key callback. See CURLOPT_SSH_KEYDATA(3) + +## CURLOPT_SSH_KEYFUNCTION + +Callback for known hosts handling. See CURLOPT_SSH_KEYFUNCTION(3) + +## CURLOPT_SSH_KNOWNHOSTS + +Filename with known hosts. See CURLOPT_SSH_KNOWNHOSTS(3) + +## CURLOPT_SSH_PRIVATE_KEYFILE + +Filename of the private key. See CURLOPT_SSH_PRIVATE_KEYFILE(3) + +## CURLOPT_SSH_PUBLIC_KEYFILE + +Filename of the public key. See CURLOPT_SSH_PUBLIC_KEYFILE(3) + +## CURLOPT_SSLCERT + +Client cert. See CURLOPT_SSLCERT(3) + +## CURLOPT_SSLCERTTYPE + +Client cert type. See CURLOPT_SSLCERTTYPE(3) + +## CURLOPT_SSLCERT_BLOB + +Client cert memory buffer. See CURLOPT_SSLCERT_BLOB(3) + +## CURLOPT_SSLENGINE + +Use identifier with SSL engine. See CURLOPT_SSLENGINE(3) + +## CURLOPT_SSLENGINE_DEFAULT + +Default SSL engine. See CURLOPT_SSLENGINE_DEFAULT(3) + +## CURLOPT_SSLKEY + +Client key. See CURLOPT_SSLKEY(3) + +## CURLOPT_SSLKEYTYPE + +Client key type. See CURLOPT_SSLKEYTYPE(3) + +## CURLOPT_SSLKEY_BLOB + +Client key memory buffer. See CURLOPT_SSLKEY_BLOB(3) + +## CURLOPT_SSLVERSION + +SSL version to use. See CURLOPT_SSLVERSION(3) + +## CURLOPT_SSL_CIPHER_LIST + +Ciphers to use. See CURLOPT_SSL_CIPHER_LIST(3) + +## CURLOPT_SSL_CTX_DATA + +Data pointer to pass to the SSL context callback. See CURLOPT_SSL_CTX_DATA(3) + +## CURLOPT_SSL_CTX_FUNCTION + +Callback for SSL context logic. See CURLOPT_SSL_CTX_FUNCTION(3) + ## CURLOPT_SSL_EC_CURVES Set key exchange curves. See CURLOPT_SSL_EC_CURVES(3) @@ -1097,252 +1116,218 @@ Enable use of ALPN. See CURLOPT_SSL_ENABLE_ALPN(3) **OBSOLETE** Enable use of NPN. See CURLOPT_SSL_ENABLE_NPN(3) -## CURLOPT_SSLENGINE - -Use identifier with SSL engine. See CURLOPT_SSLENGINE(3) - -## CURLOPT_SSLENGINE_DEFAULT - -Default SSL engine. See CURLOPT_SSLENGINE_DEFAULT(3) - ## CURLOPT_SSL_FALSESTART Enable TLS False Start. See CURLOPT_SSL_FALSESTART(3) -## CURLOPT_SSLVERSION - -SSL version to use. See CURLOPT_SSLVERSION(3) - -## CURLOPT_PROXY_SSLVERSION - -Proxy SSL version to use. See CURLOPT_PROXY_SSLVERSION(3) - -## CURLOPT_SSL_VERIFYHOST - -Verify the hostname in the SSL certificate. See CURLOPT_SSL_VERIFYHOST(3) - -## CURLOPT_DOH_SSL_VERIFYHOST - -Verify the hostname in the DoH (DNS-over-HTTPS) SSL certificate. See -CURLOPT_DOH_SSL_VERIFYHOST(3) - -## CURLOPT_PROXY_SSL_VERIFYHOST - -Verify the hostname in the proxy SSL certificate. See -CURLOPT_PROXY_SSL_VERIFYHOST(3) - -## CURLOPT_SSL_VERIFYPEER - -Verify the SSL certificate. See CURLOPT_SSL_VERIFYPEER(3) - -## CURLOPT_DOH_SSL_VERIFYPEER - -Verify the DoH (DNS-over-HTTPS) SSL certificate. See -CURLOPT_DOH_SSL_VERIFYPEER(3) - -## CURLOPT_PROXY_SSL_VERIFYPEER - -Verify the proxy SSL certificate. See CURLOPT_PROXY_SSL_VERIFYPEER(3) - -## CURLOPT_SSL_VERIFYSTATUS - -Verify the SSL certificate's status. See CURLOPT_SSL_VERIFYSTATUS(3) - -## CURLOPT_DOH_SSL_VERIFYSTATUS - -Verify the DoH (DNS-over-HTTPS) SSL certificate's status. See -CURLOPT_DOH_SSL_VERIFYSTATUS(3) - -## CURLOPT_CAINFO - -CA cert bundle. See CURLOPT_CAINFO(3) - -## CURLOPT_CAINFO_BLOB - -CA cert bundle memory buffer. See CURLOPT_CAINFO_BLOB(3) - -## CURLOPT_PROXY_CAINFO - -Proxy CA cert bundle. See CURLOPT_PROXY_CAINFO(3) - -## CURLOPT_PROXY_CAINFO_BLOB - -Proxy CA cert bundle memory buffer. See CURLOPT_PROXY_CAINFO_BLOB(3) - -## CURLOPT_ISSUERCERT - -Issuer certificate. See CURLOPT_ISSUERCERT(3) - -## CURLOPT_ISSUERCERT_BLOB - -Issuer certificate memory buffer. See CURLOPT_ISSUERCERT_BLOB(3) - -## CURLOPT_PROXY_ISSUERCERT - -Proxy issuer certificate. See CURLOPT_PROXY_ISSUERCERT(3) - -## CURLOPT_PROXY_ISSUERCERT_BLOB - -Proxy issuer certificate memory buffer. See CURLOPT_PROXY_ISSUERCERT_BLOB(3) - -## CURLOPT_CAPATH - -Path to CA cert bundle. See CURLOPT_CAPATH(3) - -## CURLOPT_PROXY_CAPATH - -Path to proxy CA cert bundle. See CURLOPT_PROXY_CAPATH(3) - -## CURLOPT_CRLFILE - -Certificate Revocation List. See CURLOPT_CRLFILE(3) - -## CURLOPT_PROXY_CRLFILE - -Proxy Certificate Revocation List. See CURLOPT_PROXY_CRLFILE(3) - -## CURLOPT_CA_CACHE_TIMEOUT - -Timeout for CA cache. See CURLOPT_CA_CACHE_TIMEOUT(3) - -## CURLOPT_CERTINFO - -Extract certificate info. See CURLOPT_CERTINFO(3) - -## CURLOPT_PINNEDPUBLICKEY - -Set pinned SSL public key . See CURLOPT_PINNEDPUBLICKEY(3) - -## CURLOPT_PROXY_PINNEDPUBLICKEY - -Set the proxy's pinned SSL public key. See -CURLOPT_PROXY_PINNEDPUBLICKEY(3) - -## CURLOPT_RANDOM_FILE - -**OBSOLETE** Provide source for entropy random data. -See CURLOPT_RANDOM_FILE(3) - -## CURLOPT_EGDSOCKET - -**OBSOLETE** Identify EGD socket for entropy. See CURLOPT_EGDSOCKET(3) - -## CURLOPT_SSL_CIPHER_LIST - -Ciphers to use. See CURLOPT_SSL_CIPHER_LIST(3) - -## CURLOPT_PROXY_SSL_CIPHER_LIST - -Proxy ciphers to use. See CURLOPT_PROXY_SSL_CIPHER_LIST(3) - -## CURLOPT_TLS13_CIPHERS - -TLS 1.3 cipher suites to use. See CURLOPT_TLS13_CIPHERS(3) - -## CURLOPT_PROXY_TLS13_CIPHERS - -Proxy TLS 1.3 cipher suites to use. See CURLOPT_PROXY_TLS13_CIPHERS(3) - -## CURLOPT_SSL_SESSIONID_CACHE - -Disable SSL session-id cache. See CURLOPT_SSL_SESSIONID_CACHE(3) - ## CURLOPT_SSL_OPTIONS Control SSL behavior. See CURLOPT_SSL_OPTIONS(3) -## CURLOPT_PROXY_SSL_OPTIONS +## CURLOPT_SSL_SESSIONID_CACHE -Control proxy SSL behavior. See CURLOPT_PROXY_SSL_OPTIONS(3) +Disable SSL session-id cache. See CURLOPT_SSL_SESSIONID_CACHE(3) -## CURLOPT_KRBLEVEL +## CURLOPT_SSL_VERIFYHOST -Kerberos security level. See CURLOPT_KRBLEVEL(3) +Verify the hostname in the SSL certificate. See CURLOPT_SSL_VERIFYHOST(3) -## CURLOPT_GSSAPI_DELEGATION +## CURLOPT_SSL_VERIFYPEER -Disable GSS-API delegation. See CURLOPT_GSSAPI_DELEGATION(3) +Verify the SSL certificate. See CURLOPT_SSL_VERIFYPEER(3) -# SSH OPTIONS +## CURLOPT_SSL_VERIFYSTATUS -## CURLOPT_SSH_AUTH_TYPES +Verify the SSL certificate's status. See CURLOPT_SSL_VERIFYSTATUS(3) -SSH authentication types. See CURLOPT_SSH_AUTH_TYPES(3) +## CURLOPT_STDERR -## CURLOPT_SSH_COMPRESSION +Redirect stderr to another stream. See CURLOPT_STDERR(3) -Enable SSH compression. See CURLOPT_SSH_COMPRESSION(3) +## CURLOPT_STREAM_DEPENDS -## CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 +This HTTP/2 stream depends on another. See CURLOPT_STREAM_DEPENDS(3) -MD5 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_MD5(3) +## CURLOPT_STREAM_DEPENDS_E -## CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 +This HTTP/2 stream depends on another exclusively. See +CURLOPT_STREAM_DEPENDS_E(3) -SHA256 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256(3) +## CURLOPT_STREAM_WEIGHT -## CURLOPT_SSH_PUBLIC_KEYFILE +Set this HTTP/2 stream's weight. See CURLOPT_STREAM_WEIGHT(3) -Filename of the public key. See CURLOPT_SSH_PUBLIC_KEYFILE(3) +## CURLOPT_SUPPRESS_CONNECT_HEADERS -## CURLOPT_SSH_PRIVATE_KEYFILE +Suppress proxy CONNECT response headers from user callbacks. See +CURLOPT_SUPPRESS_CONNECT_HEADERS(3) -Filename of the private key. See CURLOPT_SSH_PRIVATE_KEYFILE(3) +## CURLOPT_TCP_FASTOPEN -## CURLOPT_SSH_KNOWNHOSTS +Enable TCP Fast Open. See CURLOPT_TCP_FASTOPEN(3) -Filename with known hosts. See CURLOPT_SSH_KNOWNHOSTS(3) +## CURLOPT_TCP_KEEPALIVE -## CURLOPT_SSH_KEYFUNCTION +Enable TCP keep-alive. See CURLOPT_TCP_KEEPALIVE(3) -Callback for known hosts handling. See CURLOPT_SSH_KEYFUNCTION(3) +## CURLOPT_TCP_KEEPCNT -## CURLOPT_SSH_KEYDATA +Maximum number of keep-alive probes. See CURLOPT_TCP_KEEPCNT(3) -Custom pointer to pass to ssh key callback. See CURLOPT_SSH_KEYDATA(3) +## CURLOPT_TCP_KEEPIDLE -## CURLOPT_SSH_HOSTKEYFUNCTION +Idle time before sending keep-alive. See CURLOPT_TCP_KEEPIDLE(3) -Callback for checking host key handling. See CURLOPT_SSH_HOSTKEYFUNCTION(3) +## CURLOPT_TCP_KEEPINTVL -## CURLOPT_SSH_HOSTKEYDATA +Interval between keep-alive probes. See CURLOPT_TCP_KEEPINTVL(3) -Custom pointer to pass to ssh host key callback. See CURLOPT_SSH_HOSTKEYDATA(3) +## CURLOPT_TCP_NODELAY -# WEBSOCKET +Disable the Nagle algorithm. See CURLOPT_TCP_NODELAY(3) + +## CURLOPT_TELNETOPTIONS + +TELNET options. See CURLOPT_TELNETOPTIONS(3) + +## CURLOPT_TFTP_BLKSIZE + +TFTP block size. See CURLOPT_TFTP_BLKSIZE(3) + +## CURLOPT_TFTP_NO_OPTIONS + +Do not send TFTP options requests. See CURLOPT_TFTP_NO_OPTIONS(3) + +## CURLOPT_TIMECONDITION + +Make a time conditional request. See CURLOPT_TIMECONDITION(3) + +## CURLOPT_TIMEOUT + +Timeout for the entire request. See CURLOPT_TIMEOUT(3) + +## CURLOPT_TIMEOUT_MS + +Millisecond timeout for the entire request. See CURLOPT_TIMEOUT_MS(3) + +## CURLOPT_TIMEVALUE + +Time value for the time conditional request. See CURLOPT_TIMEVALUE(3) + +## CURLOPT_TIMEVALUE_LARGE + +Time value for the time conditional request. See CURLOPT_TIMEVALUE_LARGE(3) + +## CURLOPT_TLS13_CIPHERS + +TLS 1.3 cipher suites to use. See CURLOPT_TLS13_CIPHERS(3) + +## CURLOPT_TLSAUTH_PASSWORD + +TLS authentication password. See CURLOPT_TLSAUTH_PASSWORD(3) + +## CURLOPT_TLSAUTH_TYPE + +TLS authentication methods. See CURLOPT_TLSAUTH_TYPE(3) + +## CURLOPT_TLSAUTH_USERNAME + +TLS authentication username. See CURLOPT_TLSAUTH_USERNAME(3) + +## CURLOPT_TRAILERDATA + +Custom pointer passed to the trailing headers callback. See +CURLOPT_TRAILERDATA(3) + +## CURLOPT_TRAILERFUNCTION + +Set callback for sending trailing headers. See +CURLOPT_TRAILERFUNCTION(3) + +## CURLOPT_TRANSFERTEXT + +Use text transfer. See CURLOPT_TRANSFERTEXT(3) + +## CURLOPT_TRANSFER_ENCODING + +Request Transfer-Encoding. See CURLOPT_TRANSFER_ENCODING(3) + +## CURLOPT_UNIX_SOCKET_PATH + +Path to a Unix domain socket. See CURLOPT_UNIX_SOCKET_PATH(3) + +## CURLOPT_UNRESTRICTED_AUTH + +Do not restrict authentication to original host. CURLOPT_UNRESTRICTED_AUTH(3) + +## CURLOPT_UPKEEP_INTERVAL_MS + +Sets the interval at which connection upkeep are performed. See +CURLOPT_UPKEEP_INTERVAL_MS(3) + +## CURLOPT_UPLOAD + +Upload data. See CURLOPT_UPLOAD(3) + +## CURLOPT_UPLOAD_BUFFERSIZE + +Set upload buffer size. See CURLOPT_UPLOAD_BUFFERSIZE(3) + +## CURLOPT_URL + +URL to work on. See CURLOPT_URL(3) + +## CURLOPT_USERAGENT + +User-Agent: header. See CURLOPT_USERAGENT(3) + +## CURLOPT_USERNAME + +Username. See CURLOPT_USERNAME(3) + +## CURLOPT_USERPWD + +Username and password. See CURLOPT_USERPWD(3) + +## CURLOPT_USE_SSL + +Use TLS/SSL. See CURLOPT_USE_SSL(3) + +## CURLOPT_VERBOSE + +Display verbose information. See CURLOPT_VERBOSE(3) + +## CURLOPT_WILDCARDMATCH + +Transfer multiple files according to a filename pattern. See +CURLOPT_WILDCARDMATCH(3) + +## CURLOPT_WRITEDATA + +Data pointer to pass to the write callback. See CURLOPT_WRITEDATA(3) + +## CURLOPT_WRITEFUNCTION + +Callback for writing data. See CURLOPT_WRITEFUNCTION(3) ## CURLOPT_WS_OPTIONS Set WebSocket options. See CURLOPT_WS_OPTIONS(3) -# OTHER OPTIONS +## CURLOPT_XFERINFODATA -## CURLOPT_PRIVATE +Data pointer to pass to the progress meter callback. See +CURLOPT_XFERINFODATA(3) -Private pointer to store. See CURLOPT_PRIVATE(3) +## CURLOPT_XFERINFOFUNCTION -## CURLOPT_SHARE +Callback for progress meter. See CURLOPT_XFERINFOFUNCTION(3) -Share object to use. See CURLOPT_SHARE(3) +## CURLOPT_XOAUTH2_BEARER -## CURLOPT_NEW_FILE_PERMS +OAuth2 bearer token. See CURLOPT_XOAUTH2_BEARER(3) -Mode for creating new remote files. See CURLOPT_NEW_FILE_PERMS(3) - -## CURLOPT_NEW_DIRECTORY_PERMS - -Mode for creating new remote directories. See CURLOPT_NEW_DIRECTORY_PERMS(3) - -## CURLOPT_QUICK_EXIT - -To be set by toplevel tools like "curl" to skip lengthy cleanups when they are -about to call exit() anyway. See CURLOPT_QUICK_EXIT(3) - -# TELNET OPTIONS - -## CURLOPT_TELNETOPTIONS - -TELNET options. See CURLOPT_TELNETOPTIONS(3) +# %PROTOCOLS% # EXAMPLE @@ -1359,9 +1344,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_strerror.md b/deps/curl/docs/libcurl/curl_easy_strerror.md index 265efc05..37040a1c 100644 --- a/deps/curl/docs/libcurl/curl_easy_strerror.md +++ b/deps/curl/docs/libcurl/curl_easy_strerror.md @@ -9,6 +9,9 @@ See-also: - curl_share_strerror (3) - curl_url_strerror (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.12.0 --- # NAME @@ -31,6 +34,8 @@ CURLcode error code passed in the argument *errornum*. Typically applications also appreciate CURLOPT_ERRORBUFFER(3) for more specific error descriptions generated at runtime. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -50,9 +55,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.12.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_unescape.md b/deps/curl/docs/libcurl/curl_easy_unescape.md index e397a1af..2e78ad5d 100644 --- a/deps/curl/docs/libcurl/curl_easy_unescape.md +++ b/deps/curl/docs/libcurl/curl_easy_unescape.md @@ -6,12 +6,15 @@ Section: 3 Source: libcurl See-also: - curl_easy_escape (3) - - curl_free (3) + - curl_url_get (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME -curl_easy_unescape - URL decodes the given string +curl_easy_unescape - URL decode a string # SYNOPSIS @@ -44,6 +47,8 @@ TPF, but it was otherwise ignored. You must curl_free(3) the returned string when you are done with it. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -54,7 +59,7 @@ int main(void) int decodelen; char *decoded = curl_easy_unescape(curl, "%63%75%72%6c", 12, &decodelen); if(decoded) { - /* do not assume printf() works on the decoded data! */ + /* do not assume printf() works on the decoded data */ printf("Decoded: "); /* ... */ curl_free(decoded); @@ -64,9 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.4 and replaces the old curl_unescape(3) function. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_easy_upkeep.md b/deps/curl/docs/libcurl/curl_easy_upkeep.md index fd27f104..1b2fef01 100644 --- a/deps/curl/docs/libcurl/curl_easy_upkeep.md +++ b/deps/curl/docs/libcurl/curl_easy_upkeep.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - CURLOPT_TCP_KEEPALIVE (3) - CURLOPT_TCP_KEEPIDLE (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME -curl_easy_upkeep - Perform any connection upkeep checks. +curl_easy_upkeep - keep existing connections alive # SYNOPSIS @@ -36,6 +39,12 @@ This function must be explicitly called in order to perform the upkeep work. The connection upkeep interval is set with CURLOPT_UPKEEP_INTERVAL_MS(3). +If you call this function on an easy handle that uses a shared connection cache +then upkeep is performed on the connections in that cache, even if those +connections were never used by the easy handle. (Added in 8.10.0) + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -66,9 +75,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_escape.md b/deps/curl/docs/libcurl/curl_escape.md index 1c06ab9f..c24d1890 100644 --- a/deps/curl/docs/libcurl/curl_escape.md +++ b/deps/curl/docs/libcurl/curl_escape.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_free (3) - curl_unescape (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_escape - URL encodes the given string +curl_escape - URL encode a string # SYNOPSIS @@ -23,7 +26,7 @@ char *curl_escape(const char *string, int length); # DESCRIPTION -Obsolete function. Use curl_easy_escape(3) instead! +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 @@ -35,6 +38,8 @@ on **string** to find out the size. You must curl_free(3) the returned string when you are done with it. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -48,11 +53,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY Since 7.15.4, curl_easy_escape(3) should be used. This function might be removed in a future release. +# %AVAILABILITY% + # RETURN VALUE A pointer to a null-terminated string or NULL if it failed. diff --git a/deps/curl/docs/libcurl/curl_formadd.md b/deps/curl/docs/libcurl/curl_formadd.md index 7cd89165..b0f82f08 100644 --- a/deps/curl/docs/libcurl/curl_formadd.md +++ b/deps/curl/docs/libcurl/curl_formadd.md @@ -8,6 +8,9 @@ See-also: - curl_easy_setopt (3) - curl_formfree (3) - curl_mime_init (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -102,7 +105,7 @@ you must make sure strlen() on the data pointer returns zero. ## CURLFORM_CONTENTSLENGTH -(This option is deprecated. Use *CURLFORM_CONTENTLEN* instead!) +(This option is deprecated. Use *CURLFORM_CONTENTLEN* instead.) followed by a long giving the length of the contents. Note that for *CURLFORM_STREAM* contents, this option is mandatory. @@ -200,6 +203,8 @@ for the curl handle. See example below. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -297,7 +302,7 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Deprecated in 7.56.0. Before this release, field names were allowed to contain zero-valued bytes. The pseudo-filename "-" to read stdin is discouraged @@ -306,6 +311,8 @@ effective data size can then not be automatically determined, resulting in a chunked encoding transfer. Backslashes and double quotes in field and filenames are now escaped before transmission. +# %AVAILABILITY% + # RETURN VALUE 0 means everything was OK, non-zero means an error occurred corresponding to a diff --git a/deps/curl/docs/libcurl/curl_formfree.md b/deps/curl/docs/libcurl/curl_formfree.md index 65ff0e02..d7b4e303 100644 --- a/deps/curl/docs/libcurl/curl_formfree.md +++ b/deps/curl/docs/libcurl/curl_formfree.md @@ -8,6 +8,9 @@ See-also: - curl_formadd (3) - curl_mime_free (3) - curl_mime_init (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -24,7 +27,7 @@ void curl_formfree(struct curl_httppost *form); # DESCRIPTION -This function is deprecated. Do not use. See curl_mime_init(3) instead! +This function is deprecated. Do not use. See curl_mime_init(3) instead. curl_formfree() is used to clean up data previously built/appended with curl_formadd(3). This must be called when the data has been used, which @@ -40,6 +43,8 @@ curl_formadd(3) and may be NULL. Passing in a NULL pointer in *form* makes this function return immediately with no action. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -67,10 +72,12 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Deprecated in 7.56.0. +# %AVAILABILITY% + # RETURN VALUE None diff --git a/deps/curl/docs/libcurl/curl_formget.md b/deps/curl/docs/libcurl/curl_formget.md index 6da9b0d6..ad3efb9d 100644 --- a/deps/curl/docs/libcurl/curl_formget.md +++ b/deps/curl/docs/libcurl/curl_formget.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_formadd (3) - curl_mime_init (3) +Protocol: + - HTTP +Added-in: 7.15.5 --- # NAME -curl_formget - serialize a previously built multipart form POST chain +curl_formget - serialize a multipart form POST chain # SYNOPSIS @@ -24,9 +27,11 @@ int curl_formget(struct curl_httppost * form, void *userp, # DESCRIPTION +The form API (including this function) is deprecated since libcurl 7.56.0. + curl_formget() serializes data previously built with curl_formadd(3). It -accepts a void pointer as second argument named *userp* which is passed as -the first argument to the curl_formget_callback function. +accepts a void pointer as second argument named *userp* which is passed as the +first argument to the curl_formget_callback function. ~~~c typedef size_t (*curl_formget_callback)(void *userp, const char *buf, @@ -38,9 +43,10 @@ character buffer passed to the callback must not be freed. The callback should return the buffer length passed to it on success. If the **CURLFORM_STREAM** option is used in the formpost, it prevents -curl_formget(3) from working until you have performed the actual HTTP -request. This, because first then does libcurl known which actual read -callback to use! +curl_formget(3) from working until you have performed the actual HTTP request. +This, because first then does libcurl known which actual read callback to use. + +# %PROTOCOLS% # EXAMPLE @@ -62,10 +68,7 @@ size_t print_httppost(struct curl_httppost *post) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.15.5. The form API is deprecated in -libcurl 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_free.md b/deps/curl/docs/libcurl/curl_free.md index d1a26b79..c10ca280 100644 --- a/deps/curl/docs/libcurl/curl_free.md +++ b/deps/curl/docs/libcurl/curl_free.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_easy_escape (3) - curl_easy_unescape (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -30,6 +33,8 @@ differences in memory management between your application and libcurl. Passing in a NULL pointer in *ptr* makes this function return immediately with no action. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -37,15 +42,13 @@ int main(void) { char *width = curl_getenv("COLUMNS"); if(width) { - /* it was set! */ + /* it was set */ curl_free(width); } } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_getdate.md b/deps/curl/docs/libcurl/curl_getdate.md index 0a5ba446..00b4f9b7 100644 --- a/deps/curl/docs/libcurl/curl_getdate.md +++ b/deps/curl/docs/libcurl/curl_getdate.md @@ -9,11 +9,14 @@ See-also: - CURLOPT_TIMEVALUE (3) - curl_easy_escape (3) - curl_easy_unescape (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_getdate - Convert a date string to number of seconds +curl_getdate - convert date string to number of seconds # SYNOPSIS @@ -45,6 +48,9 @@ Can be specified several ways. Month names can only be three-letter English abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits. Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6. +If the year appears to be below 100 (two-digit), any year after 70 is assumed +to be 1900 + the given year. All others are 2000 + the given year. + ## time of the day items This string specifies the time on a given day. You must specify it with 6 @@ -60,7 +66,7 @@ UTC. Supported formats include: -1200, MST, +0100. ## day of the week items Specifies a day of the week. Days of the week may be spelled out in full -(using English): `Sunday', `Monday', etc or they may be abbreviated to their +(using English): 'Sunday', 'Monday', etc or they may be abbreviated to their first three letters. This is usually not info that adds anything. ## pure numbers @@ -69,6 +75,8 @@ If a decimal number of the form YYYYMMDD appears, then YYYY is read as the year, MM as the month number and DD as the day of the month, for the specified calendar date. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -108,21 +116,19 @@ RFC 1036) and ANSI C's *asctime()* format. These formats are the only ones RFC 7231 says HTTP applications may use. -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE This function returns -1 when it fails to parse the date string. Otherwise it returns the number of seconds as described. -On systems with a signed 32 bit time_t: if the year is larger than 2037 or +On systems with a signed 32-bit time_t: if the year is larger than 2037 or less than 1903, this function returns -1. -On systems with an unsigned 32 bit time_t: if the year is larger than 2106 or +On systems with an unsigned 32-bit time_t: if the year is larger than 2106 or less than 1970, this function returns -1. -On systems with 64 bit time_t: if the year is less than 1583, this function +On systems with 64-bit time_t: if the year is less than 1583, this function returns -1. (The Gregorian calendar was first introduced 1582 so no "real" dates in this way of doing dates existed before then.) diff --git a/deps/curl/docs/libcurl/curl_getenv.md b/deps/curl/docs/libcurl/curl_getenv.md index f4c72156..2cfb5814 100644 --- a/deps/curl/docs/libcurl/curl_getenv.md +++ b/deps/curl/docs/libcurl/curl_getenv.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - getenv (3C) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -24,10 +27,12 @@ char *curl_getenv(const char *name); 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 win32). +systems libcurl builds on (including Windows). You must curl_free(3) the returned string when you are done with it. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -35,15 +40,13 @@ int main(void) { char *width = curl_getenv("COLUMNS"); if(width) { - /* it was set! */ + /* it was set */ curl_free(width); } } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE @@ -52,6 +55,6 @@ specified name. # NOTE -Under unix operating systems, there is no point in returning an allocated +Under Unix operating systems, there is no point in returning an allocated memory, although other systems does not work properly if this is not done. The -unix implementation thus suffers slightly from the drawbacks of other systems. +Unix implementation thus suffers slightly from the drawbacks of other systems. diff --git a/deps/curl/docs/libcurl/curl_global_cleanup.md b/deps/curl/docs/libcurl/curl_global_cleanup.md index ae2380aa..60a761ed 100644 --- a/deps/curl/docs/libcurl/curl_global_cleanup.md +++ b/deps/curl/docs/libcurl/curl_global_cleanup.md @@ -8,6 +8,9 @@ See-also: - curl_global_init (3) - libcurl (3) - libcurl-thread (3) +Protocol: + - All +Added-in: 7.8 --- # NAME @@ -52,6 +55,13 @@ still running then your program may crash or other corruption may occur. We recommend you do not run libcurl from any module that may be unloaded dynamically. This behavior may be addressed in the future. +libcurl may not be able to fully clean up after multi-threaded OpenSSL +depending on how OpenSSL was built and loaded as a library. It is possible in +some rare circumstances a memory leak could occur unless you implement your own +OpenSSL thread cleanup. Refer to libcurl-thread(3). + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -65,9 +75,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.8 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_global_init.md b/deps/curl/docs/libcurl/curl_global_init.md index 7382369f..198b6e9f 100644 --- a/deps/curl/docs/libcurl/curl_global_init.md +++ b/deps/curl/docs/libcurl/curl_global_init.md @@ -11,11 +11,14 @@ See-also: - curl_global_sslset (3) - curl_global_trace (3) - libcurl (3) +Protocol: + - All +Added-in: 7.8 --- # NAME -curl_global_init - Global libcurl initialization +curl_global_init - global libcurl initialization # SYNOPSIS @@ -42,16 +45,15 @@ In normal operation, you must specify CURL_GLOBAL_ALL. Do not use any other value unless you are familiar with it and mean to control internal operations of libcurl. -This function is thread-safe since libcurl 7.84.0 if -curl_version_info(3) has the CURL_VERSION_THREADSAFE feature bit set -(most platforms). +This function is thread-safe on most platforms. Then curl_version_info(3) has +the `threadsafe` feature set (added in 7.84.0). -If this is not thread-safe, you must not call this function when any other -thread in the program (i.e. a thread sharing the same memory) is running. -This does not just mean no other thread that is using libcurl. Because -curl_global_init(3) calls functions of other libraries that are -similarly thread unsafe, it could conflict with any other thread that uses -these other libraries. +If this is not thread-safe (the bit mentioned above is not set), you must not +call this function when any other thread in the program (i.e. a thread sharing +the same memory) is running. This does not just mean no other thread that is +using libcurl. Because curl_global_init(3) calls functions of other libraries +that are similarly thread unsafe, it could conflict with any other thread that +uses these other libraries. If you are initializing libcurl from a Windows DLL you should not initialize it from *DllMain* or a static initializer because Windows holds the loader @@ -87,7 +89,7 @@ unexpected behaviors. Initialize the Win32 socket libraries. The implication here is that if this bit is not set, the initialization of -winsock has to be done by the application or you risk getting undefined +Winsock has to be done by the application or you risk getting undefined behaviors. This option exists for when the initialization is handled outside of libcurl so there is no need for libcurl to do it again. @@ -108,6 +110,8 @@ Before 7.69.0: when this flag is set, curl acknowledges EINTR condition when connecting or when waiting for data. Otherwise, curl waits until full timeout elapses. (Added in 7.30.0) +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -121,9 +125,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.8 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_global_init_mem.md b/deps/curl/docs/libcurl/curl_global_init_mem.md index edc75635..4ac22fbe 100644 --- a/deps/curl/docs/libcurl/curl_global_init_mem.md +++ b/deps/curl/docs/libcurl/curl_global_init_mem.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_global_cleanup (3) - curl_global_init (3) +Protocol: + - All +Added-in: 7.12.0 --- # NAME -curl_global_init_mem - Global libcurl initialization with memory callbacks +curl_global_init_mem - global libcurl initialization with memory callbacks # SYNOPSIS @@ -66,7 +69,9 @@ to that man page for documentation. # CAUTION Manipulating these gives considerable powers to the application to severely -screw things up for libcurl. Take care! +screw things up for libcurl. Take care. + +# %PROTOCOLS% # EXAMPLE @@ -85,9 +90,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.12.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_global_sslset.md b/deps/curl/docs/libcurl/curl_global_sslset.md index 25dde166..42123d71 100644 --- a/deps/curl/docs/libcurl/curl_global_sslset.md +++ b/deps/curl/docs/libcurl/curl_global_sslset.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_global_init (3) - libcurl (3) +Protocol: + - All +Added-in: 7.56.0 --- # NAME -curl_global_sslset - Select SSL backend to use with libcurl +curl_global_sslset - select SSL backend to use # SYNOPSIS @@ -64,7 +67,7 @@ This does not just mean no other thread that is using libcurl. # OpenSSL The name "OpenSSL" is used for all versions of OpenSSL and its associated -forks/flavors in this function. OpenSSL, BoringSSL, libressl, quictls and +forks/flavors in this function. OpenSSL, BoringSSL, LibreSSL, quictls and AmiSSL are all supported by libcurl, but in the eyes of curl_global_sslset(3) they are all just "OpenSSL". They all mostly provide the same API. @@ -98,6 +101,8 @@ typedef enum { } curl_sslbackend; ~~~ +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -117,10 +122,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.56.0. Before this version, there was no -support for choosing SSL backends at runtime. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_global_trace.md b/deps/curl/docs/libcurl/curl_global_trace.md index 2b27401b..bf722ae6 100644 --- a/deps/curl/docs/libcurl/curl_global_trace.md +++ b/deps/curl/docs/libcurl/curl_global_trace.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_global_init (3) - libcurl (3) +Protocol: + - All +Added-in: 8.3 --- # NAME -curl_global_trace - Global libcurl logging configuration +curl_global_trace - log configuration # SYNOPSIS @@ -23,35 +26,34 @@ CURLcode curl_global_trace(const char *config); # DESCRIPTION -This function configures the logging behavior, allowing to make some -parts of curl more verbose or silent than others. +This function configures the logging behavior to make some parts of curl more +verbose or silent than others. This function may be called during the initialization phase of a program. It does not have to be. It can be called several times even, possibly overwriting settings of previous calls. -Calling this function after transfers have been started is undefined. On -some platforms/architectures it might take effect, on others not. +Calling this function after transfers have been started is undefined. On some +platforms/architectures it might take effect, on others not. -This function is thread-safe since libcurl 8.3.0 if -curl_version_info(3) has the CURL_VERSION_THREADSAFE feature bit set -(most platforms). +This function is thread-safe since libcurl 8.3.0 if curl_version_info(3) has +the CURL_VERSION_THREADSAFE feature bit set (most platforms). If this is not thread-safe, you must not call this function when any other -thread in the program (i.e. a thread sharing the same memory) is running. -This does not just mean no other thread that is using libcurl. Because -curl_global_init(3) may call functions of other libraries that are -similarly thread unsafe, it could conflict with any other thread that uses -these other libraries. +thread in the program (i.e. a thread sharing the same memory) is running. This +does not just mean no other thread that is using libcurl. Because +curl_global_init(3) may call functions of other libraries that are similarly +thread unsafe, it could conflict with any other thread that uses these other +libraries. If you are initializing libcurl from a Windows DLL you should not initialize it from *DllMain* or a static initializer because Windows holds the loader lock during that time and it could cause a deadlock. -The *config* string is a list of comma-separated component names. Names -are case-insensitive and unknown names are ignored. The special name "all" -applies to all components. Names may be prefixed with '+' or '-' to enable -or disable detailed logging for a component. +The *config* string is a list of comma-separated component names. Names are +case-insensitive and unknown names are ignored. The special name "all" applies +to all components. Names may be prefixed with '+' or '-' to enable or disable +detailed logging for a component. The list of component names is not part of curl's public API. Names may be added or disappear in future versions of libcurl. Since unknown names are @@ -59,20 +61,24 @@ silently ignored, outdated log configurations does not cause errors when upgrading libcurl. Given that, some names can be expected to be fairly stable and are listed below for easy reference. -Note that log configuration applies only to transfers where debug logging -is enabled. See CURLOPT_VERBOSE(3) or CURLOPT_DEBUGFUNCTION(3) -on how to control that. +Note that log configuration applies only to transfers where debug logging is +enabled. See CURLOPT_VERBOSE(3) or CURLOPT_DEBUGFUNCTION(3) on how to control +that. # TRACE COMPONENTS ## `tcp` -Tracing of TCP socket handling: connect, reads, writes. +Tracing of TCP socket handling: connect, sends, receives. ## `ssl` Tracing of SSL/TLS operations, whichever SSL backend is used in your build. +## `ftp` + +Tracing of FTP operations when this protocol is enabled in your build. + ## `http/2` Details about HTTP/2 handling: frames, events, I/O, etc. @@ -95,6 +101,45 @@ trace. Tracing of DNS-over-HTTP operations to resolve hostnames. +## `read` + +Traces reading of upload data from the application in order to send it to the server. + +## `smtp` + +Tracing of SMTP operations when this protocol is enabled in your build. + +## `write` + +Traces writing of download data, received from the server, to the application. + +## `ws` + +Tracing of WebSocket operations when this protocol is enabled in your build. + +# TRACE GROUPS + +Besides the specific component names there are the following group names +defined: + +## `all` + +## `network` + +All components involved in bare network I/O, including the SSL layer. + +All components that your libcurl is built with. + +## `protocol` + +All components involved in transfer protocols, such as 'ftp' and 'http/2'. + +## `proxy` + +All components involved in use of proxies. + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -118,9 +163,7 @@ of an enabled component appears at the beginning in brackets. ... ~~~ -# AVAILABILITY - -Added in 8.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_addpart.md b/deps/curl/docs/libcurl/curl_mime_addpart.md index dc11f10c..9a21295d 100644 --- a/deps/curl/docs/libcurl/curl_mime_addpart.md +++ b/deps/curl/docs/libcurl/curl_mime_addpart.md @@ -15,6 +15,11 @@ See-also: - curl_mime_name (3) - curl_mime_subparts (3) - curl_mime_type (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -38,6 +43,8 @@ subsequently be populated using functions from the mime API. *mime* is the handle of the mime structure in which the new part must be appended. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -61,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_data.md b/deps/curl/docs/libcurl/curl_mime_data.md index 0733d014..5db64a95 100644 --- a/deps/curl/docs/libcurl/curl_mime_data.md +++ b/deps/curl/docs/libcurl/curl_mime_data.md @@ -9,6 +9,11 @@ See-also: - curl_mime_data_cb (3) - curl_mime_name (3) - curl_mime_type (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -45,6 +50,8 @@ last call is retained. It is possible to unassign part's contents by setting Setting large data is memory consuming: one might consider using curl_mime_data_cb(3) in such a case. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -67,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_data_cb.md b/deps/curl/docs/libcurl/curl_mime_data_cb.md index e17866b9..f85e23e9 100644 --- a/deps/curl/docs/libcurl/curl_mime_data_cb.md +++ b/deps/curl/docs/libcurl/curl_mime_data_cb.md @@ -9,6 +9,11 @@ See-also: - curl_mime_addpart (3) - curl_mime_data (3) - curl_mime_name (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -93,6 +98,8 @@ the pointed item to be shared between the original and the copied handle. In particular, special attention should be given to the *freefunc* procedure code since it then gets called twice with the same argument. +# %PROTOCOLS% + # EXAMPLE Sending a huge data string causes the same amount of memory to be allocated: @@ -159,9 +166,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_encoder.md b/deps/curl/docs/libcurl/curl_mime_encoder.md index 54850654..1479bd7f 100644 --- a/deps/curl/docs/libcurl/curl_mime_encoder.md +++ b/deps/curl/docs/libcurl/curl_mime_encoder.md @@ -8,6 +8,11 @@ See-also: - curl_mime_addpart (3) - curl_mime_headers (3) - curl_mime_subparts (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -66,6 +71,8 @@ Encoding should not be applied to multiparts, thus the use of this function on a part with content set with curl_mime_subparts(3) is strongly discouraged. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -91,9 +98,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_filedata.md b/deps/curl/docs/libcurl/curl_mime_filedata.md index 81441e39..079330ed 100644 --- a/deps/curl/docs/libcurl/curl_mime_filedata.md +++ b/deps/curl/docs/libcurl/curl_mime_filedata.md @@ -9,6 +9,11 @@ See-also: - curl_mime_data (3) - curl_mime_filename (3) - curl_mime_name (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -51,6 +56,8 @@ part is transferred using chunks by HTTP but is rejected by IMAP. Setting a part's contents multiple times is valid: only the value set by the last call is retained. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -76,9 +83,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_filename.md b/deps/curl/docs/libcurl/curl_mime_filename.md index 234fd2c6..cfaeada8 100644 --- a/deps/curl/docs/libcurl/curl_mime_filename.md +++ b/deps/curl/docs/libcurl/curl_mime_filename.md @@ -8,6 +8,11 @@ See-also: - curl_mime_addpart (3) - curl_mime_data (3) - curl_mime_filedata (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -39,6 +44,8 @@ The remote filename string is copied into the part, thus the associated storage may safely be released or reused after call. Setting a part's file name multiple times is valid: only the value set by the last call is retained. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -70,9 +77,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_free.md b/deps/curl/docs/libcurl/curl_mime_free.md index 5b352dfb..851b1c52 100644 --- a/deps/curl/docs/libcurl/curl_mime_free.md +++ b/deps/curl/docs/libcurl/curl_mime_free.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - curl_free (3) - curl_mime_init (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -38,6 +43,8 @@ curl_mime_init(3) and may be NULL. Passing in a NULL pointer in *mime* makes this function return immediately with no action. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -56,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_headers.md b/deps/curl/docs/libcurl/curl_mime_headers.md index 21d08986..99626611 100644 --- a/deps/curl/docs/libcurl/curl_mime_headers.md +++ b/deps/curl/docs/libcurl/curl_mime_headers.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - curl_mime_addpart (3) - curl_mime_name (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -38,6 +43,8 @@ freed explicitly. Setting a part's custom headers list multiple times is valid: only the value set by the last call is retained. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -69,9 +76,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_init.md b/deps/curl/docs/libcurl/curl_mime_init.md index db905c70..7d1513df 100644 --- a/deps/curl/docs/libcurl/curl_mime_init.md +++ b/deps/curl/docs/libcurl/curl_mime_init.md @@ -9,6 +9,11 @@ See-also: - curl_mime_addpart (3) - curl_mime_free (3) - curl_mime_subparts (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -37,6 +42,8 @@ reporting. Since 7.87.0, it does not need to be the final target handle. Using a mime handle is the recommended way to post an HTTP form, format and send a multi-part email with SMTP or upload such an email to an IMAP server. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -63,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_name.md b/deps/curl/docs/libcurl/curl_mime_name.md index 3482a655..86278443 100644 --- a/deps/curl/docs/libcurl/curl_mime_name.md +++ b/deps/curl/docs/libcurl/curl_mime_name.md @@ -8,6 +8,11 @@ See-also: - curl_mime_addpart (3) - curl_mime_data (3) - curl_mime_type (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -36,6 +41,8 @@ safely be released or reused after call. Setting a part's name multiple times is valid: only the value set by the last call is retained. It is possible to reset the name of a part by setting *name* to NULL. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -58,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_subparts.md b/deps/curl/docs/libcurl/curl_mime_subparts.md index 8fb3f3ec..8056a335 100644 --- a/deps/curl/docs/libcurl/curl_mime_subparts.md +++ b/deps/curl/docs/libcurl/curl_mime_subparts.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - curl_mime_addpart (3) - curl_mime_init (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -37,6 +42,8 @@ Setting a part's contents multiple times is valid: only the value set by the last call is retained. It is possible to unassign previous part's contents by setting *subparts* to NULL. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -74,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mime_type.md b/deps/curl/docs/libcurl/curl_mime_type.md index 14cf4ca1..76f3d710 100644 --- a/deps/curl/docs/libcurl/curl_mime_type.md +++ b/deps/curl/docs/libcurl/curl_mime_type.md @@ -8,6 +8,11 @@ See-also: - curl_mime_addpart (3) - curl_mime_data (3) - curl_mime_name (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.56.0 --- # NAME @@ -49,6 +54,8 @@ extension, or application/octet-stream by default. - text/plain in other cases. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -77,9 +84,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_mprintf.md b/deps/curl/docs/libcurl/curl_mprintf.md index 658a2def..8f1daa8c 100644 --- a/deps/curl/docs/libcurl/curl_mprintf.md +++ b/deps/curl/docs/libcurl/curl_mprintf.md @@ -9,11 +9,14 @@ See-also: - printf (3) - sprintf (3) - vprintf (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf +curl_maprintf, curl_mfprintf, curl_mprintf, curl_msnprintf, curl_msprintf, curl_mvaprintf, curl_mvfprintf, curl_mvprintf, curl_mvsnprintf, curl_mvsprintf - formatted output conversion @@ -182,7 +185,7 @@ pointer to a long argument (ell-ell). A following integer conversion corresponds to a *long long* or *unsigned long long* argument, or a following n conversion corresponds to -a pointer to a long long argument. +a pointer to a *long long* argument. ## q @@ -261,6 +264,8 @@ by the corresponding argument. A '%' symbol is written. No argument is converted. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -273,10 +278,7 @@ int main(void) } ~~~ -# AVAILABILITY - -These functions might be removed from the public libcurl API in the future. Do -not use them in new programs or projects. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_add_handle.md b/deps/curl/docs/libcurl/curl_multi_add_handle.md index ab03bdd4..9082e9c4 100644 --- a/deps/curl/docs/libcurl/curl_multi_add_handle.md +++ b/deps/curl/docs/libcurl/curl_multi_add_handle.md @@ -10,6 +10,9 @@ See-also: - curl_multi_init (3) - curl_multi_setopt (3) - curl_multi_socket_action (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -61,6 +64,8 @@ first the easy handle and then the multi handle: 3 - curl_multi_cleanup(3) +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -79,9 +84,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_assign.md b/deps/curl/docs/libcurl/curl_multi_assign.md index aa8d1bf5..50729100 100644 --- a/deps/curl/docs/libcurl/curl_multi_assign.md +++ b/deps/curl/docs/libcurl/curl_multi_assign.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_multi_setopt (3) - curl_multi_socket_action (3) +Protocol: + - All +Added-in: 7.15.5 --- # NAME @@ -45,6 +48,8 @@ functionality. It is acceptable to call this function from your multi callback functions. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -61,14 +66,6 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.5 - -# RETURN VALUE - -The standard CURLMcode for multi interface error codes. - # TYPICAL USAGE In a typical application you allocate a struct or at least use some kind of @@ -76,6 +73,12 @@ semi-dynamic data for each socket that we must wait for action on when using the curl_multi_socket_action(3) approach. When our socket-callback gets called by libcurl and we get to know about yet -another socket to wait for, we can use curl_multi_assign(3) to point out -the particular data so that when we get updates about this same socket again, -we do not have to find the struct associated with this socket by ourselves. +another socket to wait for, we can use curl_multi_assign(3) to point out the +particular data so that when we get updates about this same socket again, we +do not have to find the struct associated with this socket by ourselves. + +# %AVAILABILITY% + +# RETURN VALUE + +The standard CURLMcode for multi interface error codes. diff --git a/deps/curl/docs/libcurl/curl_multi_cleanup.md b/deps/curl/docs/libcurl/curl_multi_cleanup.md index ed2b29a7..21661ea8 100644 --- a/deps/curl/docs/libcurl/curl_multi_cleanup.md +++ b/deps/curl/docs/libcurl/curl_multi_cleanup.md @@ -9,6 +9,9 @@ See-also: - curl_easy_init (3) - curl_multi_get_handles (3) - curl_multi_init (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -25,10 +28,10 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle); # DESCRIPTION -Cleans up and removes a whole multi stack. It does not free or touch any -individual easy handles in any way - they still need to be closed -individually, using the usual curl_easy_cleanup(3) way. The order of -cleaning up should be: +This function is the opposite of curl_multi_init(3). Cleans up and removes a +whole multi stack. It does not free or touch any individual easy handles in +any way - they still need to be closed individually, using the usual +curl_easy_cleanup(3) way. The order of cleaning up should be: 1 - curl_multi_remove_handle(3) before any easy handles are cleaned up @@ -38,9 +41,17 @@ handle is no longer connected to the multi handle 3 - curl_multi_cleanup(3) should be called when all easy handles are removed +When this function is called, remaining entries in the connection pool held by +the multi handle are shut down, which might trigger calls to the +CURLMOPT_SOCKETFUNCTION(3) callback. + Passing in a NULL pointer in *multi_handle* makes this function return CURLM_BAD_HANDLE immediately with no other action. +Any use of the **multi_handle** after this function has been called and have +returned, is illegal. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -55,9 +66,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_fdset.md b/deps/curl/docs/libcurl/curl_multi_fdset.md index bcdf15a8..e1b86941 100644 --- a/deps/curl/docs/libcurl/curl_multi_fdset.md +++ b/deps/curl/docs/libcurl/curl_multi_fdset.md @@ -10,12 +10,16 @@ See-also: - curl_multi_perform (3) - curl_multi_timeout (3) - curl_multi_wait (3) + - curl_multi_waitfds (3) - select (2) +Protocol: + - All +Added-in: 7.9.6 --- # NAME -curl_multi_fdset - extracts file descriptor information from a multi handle +curl_multi_fdset - extract file descriptor information from a multi handle # SYNOPSIS @@ -75,6 +79,8 @@ which can cause crashes, or worse. The effect of NOT storing it might possibly save you from the crash, but makes your program NOT wait for sockets it should wait for... +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -109,9 +115,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_get_handles.md b/deps/curl/docs/libcurl/curl_multi_get_handles.md index de127bcc..f94436a8 100644 --- a/deps/curl/docs/libcurl/curl_multi_get_handles.md +++ b/deps/curl/docs/libcurl/curl_multi_get_handles.md @@ -9,11 +9,14 @@ See-also: - curl_multi_cleanup (3) - curl_multi_init (3) - curl_multi_remove_handle (3) +Protocol: + - All +Added-in: 8.4.0 --- # NAME -curl_multi_get_handles - returns all added easy handles +curl_multi_get_handles - return all added easy handles # SYNOPSIS @@ -40,6 +43,8 @@ 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. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -68,9 +73,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 8.4.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_info_read.md b/deps/curl/docs/libcurl/curl_multi_info_read.md index f4b05bb7..3a8af88d 100644 --- a/deps/curl/docs/libcurl/curl_multi_info_read.md +++ b/deps/curl/docs/libcurl/curl_multi_info_read.md @@ -8,6 +8,9 @@ See-also: - curl_multi_cleanup (3) - curl_multi_init (3) - curl_multi_perform (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -64,6 +67,8 @@ that just completed. At this point, there are no other **msg** types defined. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -91,9 +96,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_init.md b/deps/curl/docs/libcurl/curl_multi_init.md index c022c441..28c3d69c 100644 --- a/deps/curl/docs/libcurl/curl_multi_init.md +++ b/deps/curl/docs/libcurl/curl_multi_init.md @@ -10,6 +10,9 @@ See-also: - curl_multi_add_handle (3) - curl_multi_cleanup (3) - curl_multi_get_handles (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -31,6 +34,12 @@ all the other multi-functions, sometimes referred to as a multi handle in some places in the documentation. This init call MUST have a corresponding call to curl_multi_cleanup(3) when the operation is complete. +By default, several caches are stored in and held by the multi handle: DNS +cache, connection pool, TLS session ID cache and the TLS CA cert cache. All +transfers using the same multi handle share these caches. + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -47,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_perform.md b/deps/curl/docs/libcurl/curl_multi_perform.md index 6c27eaf9..c30ad211 100644 --- a/deps/curl/docs/libcurl/curl_multi_perform.md +++ b/deps/curl/docs/libcurl/curl_multi_perform.md @@ -12,11 +12,14 @@ See-also: - curl_multi_init (3) - curl_multi_wait (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME -curl_multi_perform - reads/writes available data from easy handles +curl_multi_perform - run all transfers until it would block # SYNOPSIS @@ -58,13 +61,15 @@ they cannot be continued. curl_multi_perform(3) should not be called again on the same multi handle after an error has been returned, unless first removing all the handles and adding new ones. +# %PROTOCOLS% + # EXAMPLE ~~~c int main(void) { int still_running; - CURL *multi = curl_multi_init(); + CURLM *multi = curl_multi_init(); CURL *curl = curl_easy_init(); if(curl) { curl_multi_add_handle(multi, curl); @@ -80,15 +85,13 @@ int main(void) break; } - /* if there are still transfers, loop! */ + /* if there are still transfers, loop */ } while(still_running); } } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_poll.md b/deps/curl/docs/libcurl/curl_multi_poll.md index 7eadebc0..c19661d0 100644 --- a/deps/curl/docs/libcurl/curl_multi_poll.md +++ b/deps/curl/docs/libcurl/curl_multi_poll.md @@ -9,11 +9,14 @@ See-also: - curl_multi_perform (3) - curl_multi_wait (3) - curl_multi_wakeup (3) +Protocol: + - All +Added-in: 7.66.0 --- # NAME -curl_multi_poll - polls on all easy handles in a multi handle +curl_multi_poll - poll on all easy handles in a multi handle # SYNOPSIS @@ -84,14 +87,19 @@ priority read events such as out of band data. Bit flag to curl_waitfd.events indicating the socket should poll on write events such as the socket being clear to write without blocking. +# %PROTOCOLS% + # EXAMPLE ~~~c +extern void handle_fd(int); + int main(void) { CURL *easy_handle; CURLM *multi_handle; int still_running = 0; + int myfd; /* this is our own file descriptor */ /* add the individual easy handle */ curl_multi_add_handle(multi_handle, easy_handle); @@ -103,8 +111,19 @@ int main(void) mc = curl_multi_perform(multi_handle, &still_running); if(mc == CURLM_OK) { - /* wait for activity or timeout */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, &numfds); + struct curl_waitfd myown; + myown.fd = myfd; + myown.events = CURL_WAIT_POLLIN; /* wait for input */ + myown.revents = 0; /* clear it */ + + /* wait for activity on curl's descriptors or on our own, + or timeout */ + mc = curl_multi_poll(multi_handle, &myown, 1, 1000, &numfds); + + if(myown.revents) { + /* did our descriptor receive an event? */ + handle_fd(myfd); + } } if(mc != CURLM_OK) { @@ -118,9 +137,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.66.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_remove_handle.md b/deps/curl/docs/libcurl/curl_multi_remove_handle.md index da817cad..ac43a592 100644 --- a/deps/curl/docs/libcurl/curl_multi_remove_handle.md +++ b/deps/curl/docs/libcurl/curl_multi_remove_handle.md @@ -8,6 +8,9 @@ See-also: - curl_multi_add_handle (3) - curl_multi_cleanup (3) - curl_multi_init (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -44,6 +47,8 @@ libcurl keeps the connection alive in the connection pool associated with the multi handle, ready to get reused for a future transfer using this multi handle. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -64,9 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_setopt.md b/deps/curl/docs/libcurl/curl_multi_setopt.md index 27f6dd4b..3f326be7 100644 --- a/deps/curl/docs/libcurl/curl_multi_setopt.md +++ b/deps/curl/docs/libcurl/curl_multi_setopt.md @@ -9,6 +9,9 @@ See-also: - curl_multi_info_read (3) - curl_multi_init (3) - curl_multi_socket (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME @@ -20,85 +23,88 @@ curl_multi_setopt - set options for a curl multi handle ~~~c #include -CURLMcode curl_multi_setopt(CURLM *multi_handle, CURLMoption option, parameter); +CURLMcode curl_multi_setopt(CURLM *multi, CURLMoption option, parameter); ~~~ # DESCRIPTION -curl_multi_setopt(3) is used to tell a libcurl multi handle how to -behave. By using the appropriate options to curl_multi_setopt(3), you -can change libcurl's behavior when using that multi handle. All options are -set with the *option* followed by the *parameter*. That parameter can -be a **long**, a **function pointer**, an **object pointer** or a -**curl_off_t** type, depending on what the specific option expects. Read -this manual carefully as bad input values may cause libcurl to behave -badly. You can only set one option in each function call. +curl_multi_setopt(3) is used to tell a libcurl multi handle how to behave. By +using the appropriate options to curl_multi_setopt(3), you can change +libcurl's behavior when using that multi handle. All options are set with the +*option* followed by the *parameter*. That parameter can be a **long**, a +**function pointer**, an **object pointer** or a **curl_off_t** type, +depending on what the specific option expects. Read this manual carefully as +bad input values may cause libcurl to behave badly. You can only set one +option in each function call. # OPTIONS ## CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE -See CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3) +**deprecated** See CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE(3) ## CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE -See CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE(3) - -## CURLMOPT_MAX_HOST_CONNECTIONS - -See CURLMOPT_MAX_HOST_CONNECTIONS(3) - -## CURLMOPT_MAX_PIPELINE_LENGTH - -See CURLMOPT_MAX_PIPELINE_LENGTH(3) - -## CURLMOPT_MAX_TOTAL_CONNECTIONS - -See CURLMOPT_MAX_TOTAL_CONNECTIONS(3) +**deprecated** See CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE(3) ## CURLMOPT_MAXCONNECTS -See CURLMOPT_MAXCONNECTS(3) - -## CURLMOPT_PIPELINING - -See CURLMOPT_PIPELINING(3) - -## CURLMOPT_PIPELINING_SITE_BL - -See CURLMOPT_PIPELINING_SITE_BL(3) - -## CURLMOPT_PIPELINING_SERVER_BL - -See CURLMOPT_PIPELINING_SERVER_BL(3) - -## CURLMOPT_PUSHFUNCTION - -See CURLMOPT_PUSHFUNCTION(3) - -## CURLMOPT_PUSHDATA - -See CURLMOPT_PUSHDATA(3) - -## CURLMOPT_SOCKETFUNCTION - -See CURLMOPT_SOCKETFUNCTION(3) - -## CURLMOPT_SOCKETDATA - -See CURLMOPT_SOCKETDATA(3) - -## CURLMOPT_TIMERFUNCTION - -See CURLMOPT_TIMERFUNCTION(3) - -## CURLMOPT_TIMERDATA - -See CURLMOPT_TIMERDATA(3) +Size of connection cache. See CURLMOPT_MAXCONNECTS(3) ## CURLMOPT_MAX_CONCURRENT_STREAMS -See CURLMOPT_MAX_CONCURRENT_STREAMS(3) +Max concurrent streams for http2. See CURLMOPT_MAX_CONCURRENT_STREAMS(3) + +## CURLMOPT_MAX_HOST_CONNECTIONS + +Max number of connections to a single host. See +CURLMOPT_MAX_HOST_CONNECTIONS(3) + +## CURLMOPT_MAX_PIPELINE_LENGTH + +**deprecated**. See CURLMOPT_MAX_PIPELINE_LENGTH(3) + +## CURLMOPT_MAX_TOTAL_CONNECTIONS + +Max simultaneously open connections. See CURLMOPT_MAX_TOTAL_CONNECTIONS(3) + +## CURLMOPT_PIPELINING + +Enable HTTP multiplexing. See CURLMOPT_PIPELINING(3) + +## CURLMOPT_PIPELINING_SERVER_BL + +**deprecated**. See CURLMOPT_PIPELINING_SERVER_BL(3) + +## CURLMOPT_PIPELINING_SITE_BL + +**deprecated**. See CURLMOPT_PIPELINING_SITE_BL(3) + +## CURLMOPT_PUSHDATA + +Pointer to pass to push callback. See CURLMOPT_PUSHDATA(3) + +## CURLMOPT_PUSHFUNCTION + +Callback that approves or denies server pushes. See CURLMOPT_PUSHFUNCTION(3) + +## CURLMOPT_SOCKETDATA + +Custom pointer passed to the socket callback. See CURLMOPT_SOCKETDATA(3) + +## CURLMOPT_SOCKETFUNCTION + +Callback informed about what to wait for. See CURLMOPT_SOCKETFUNCTION(3) + +## CURLMOPT_TIMERDATA + +Custom pointer to pass to timer callback. See CURLMOPT_TIMERDATA(3) + +## CURLMOPT_TIMERFUNCTION + +Callback to receive timeout values. See CURLMOPT_TIMERFUNCTION(3) + +# %PROTOCOLS% # EXAMPLE @@ -114,9 +120,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_socket.md b/deps/curl/docs/libcurl/curl_multi_socket.md index fe376834..5903a1e1 100644 --- a/deps/curl/docs/libcurl/curl_multi_socket.md +++ b/deps/curl/docs/libcurl/curl_multi_socket.md @@ -10,11 +10,14 @@ See-also: - curl_multi_info_read (3) - curl_multi_init (3) - the hiperfifo.c example +Protocol: + - All +Added-in: 7.15.4 --- # NAME -curl_multi_socket - reads/writes available data +curl_multi_socket - read/write available data # SYNOPSIS @@ -22,47 +25,39 @@ curl_multi_socket - reads/writes available data #include CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t sockfd, int *running_handles); - -CURLMcode curl_multi_socket_all(CURLM *multi_handle, - int *running_handles); ~~~ # DESCRIPTION -These functions are deprecated. Do not use. See -curl_multi_socket_action(3) instead. +This function is deprecated. Do not use. See curl_multi_socket_action(3) +instead. At return, the integer **running_handles** points to contains the number of still running easy handles within the multi handle. When this number reaches zero, all transfers are complete/done. Note that when you call -curl_multi_socket_action(3) on a specific socket and the counter -decreases by one, it DOES NOT necessarily mean that this exact socket/transfer -is the one that completed. Use curl_multi_info_read(3) to figure out -which easy handle that completed. +curl_multi_socket(3) on a specific socket and the counter decreases by one, it +DOES NOT necessarily mean that this exact socket/transfer is the one that +completed. Use curl_multi_info_read(3) to figure out which easy handle that +completed. -The curl_multi_socket_action(3) functions inform the application about -updates in the socket (file descriptor) status by doing none, one, or multiple -calls to the socket callback function set with the -CURLMOPT_SOCKETFUNCTION(3) option to curl_multi_setopt(3). They -update the status with changes since the previous time the callback was -called. +The curl_multi_socket(3) functions inform the application about updates in the +socket (file descriptor) status by doing none, one, or multiple calls to the +socket callback function set with the CURLMOPT_SOCKETFUNCTION(3) option to +curl_multi_setopt(3). They update the status with changes since the previous +time the callback was called. -Get the timeout time by setting the CURLMOPT_TIMERFUNCTION(3) option -with curl_multi_setopt(3). Your application then gets called with -information on how long to wait for socket actions at most before doing the -timeout action: call the curl_multi_socket_action(3) function with the -**sockfd** argument set to CURL_SOCKET_TIMEOUT. You can also use the -curl_multi_timeout(3) function to poll the value at any given time, but -for an event-based system using the callback is far better than relying on -polling the timeout value. +Get the timeout time by setting the CURLMOPT_TIMERFUNCTION(3) option with +curl_multi_setopt(3). Your application then gets called with information on +how long to wait for socket actions at most before doing the timeout action: +call the curl_multi_socket_action(3) function with the **sockfd** argument set +to CURL_SOCKET_TIMEOUT. You can also use the curl_multi_timeout(3) function to +poll the value at any given time, but for an event-based system using the +callback is far better than relying on polling the timeout value. Usage of curl_multi_socket(3) is deprecated, whereas the function is -equivalent to curl_multi_socket_action(3) with **ev_bitmask** set to -0. +equivalent to curl_multi_socket_action(3) with **ev_bitmask** set to 0. -Force libcurl to (re-)check all its internal sockets and transfers instead of -just a single one by calling curl_multi_socket_all(3). Note that there -should not be any reason to use this function. +# %PROTOCOLS% # EXAMPLE @@ -79,13 +74,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -This function was added in libcurl 7.15.4, and is deemed stable since -7.16.0. +curl_multi_socket(3) is deprecated, use curl_multi_socket_action(3) instead. -curl_multi_socket(3) is deprecated, use -curl_multi_socket_action(3) instead! +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_socket_action.md b/deps/curl/docs/libcurl/curl_multi_socket_action.md index 21880650..536bf3cb 100644 --- a/deps/curl/docs/libcurl/curl_multi_socket_action.md +++ b/deps/curl/docs/libcurl/curl_multi_socket_action.md @@ -10,11 +10,14 @@ See-also: - curl_multi_info_read (3) - curl_multi_init (3) - the hiperfifo.c example +Protocol: + - All +Added-in: 7.15.4 --- # NAME -curl_multi_socket_action - reads/writes available data given an action +curl_multi_socket_action - read/write available data given an action # SYNOPSIS @@ -93,6 +96,8 @@ callback has been told. socket(s) that got action. If no activity is detected and the timeout expires, call curl_multi_socket_action(3) with *CURL_SOCKET_TIMEOUT*. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -110,9 +115,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_socket_all.md b/deps/curl/docs/libcurl/curl_multi_socket_all.md index fe376834..37a605bd 100644 --- a/deps/curl/docs/libcurl/curl_multi_socket_all.md +++ b/deps/curl/docs/libcurl/curl_multi_socket_all.md @@ -1,7 +1,7 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: curl_multi_socket +Title: curl_multi_socket_all Section: 3 Source: libcurl See-also: @@ -10,18 +10,19 @@ See-also: - curl_multi_info_read (3) - curl_multi_init (3) - the hiperfifo.c example +Protocol: + - All +Added-in: 7.15.4 --- # NAME -curl_multi_socket - reads/writes available data +curl_multi_socket_all - reads/writes available data for all easy handles # SYNOPSIS ~~~c #include -CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t sockfd, - int *running_handles); CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles); @@ -29,63 +30,32 @@ CURLMcode curl_multi_socket_all(CURLM *multi_handle, # DESCRIPTION -These functions are deprecated. Do not use. See -curl_multi_socket_action(3) instead. +This function is deprecated. Do not use. See curl_multi_socket_action(3) +instead. At return, the integer **running_handles** points to contains the number of still running easy handles within the multi handle. When this number reaches -zero, all transfers are complete/done. Note that when you call -curl_multi_socket_action(3) on a specific socket and the counter -decreases by one, it DOES NOT necessarily mean that this exact socket/transfer -is the one that completed. Use curl_multi_info_read(3) to figure out -which easy handle that completed. - -The curl_multi_socket_action(3) functions inform the application about -updates in the socket (file descriptor) status by doing none, one, or multiple -calls to the socket callback function set with the -CURLMOPT_SOCKETFUNCTION(3) option to curl_multi_setopt(3). They -update the status with changes since the previous time the callback was -called. - -Get the timeout time by setting the CURLMOPT_TIMERFUNCTION(3) option -with curl_multi_setopt(3). Your application then gets called with -information on how long to wait for socket actions at most before doing the -timeout action: call the curl_multi_socket_action(3) function with the -**sockfd** argument set to CURL_SOCKET_TIMEOUT. You can also use the -curl_multi_timeout(3) function to poll the value at any given time, but -for an event-based system using the callback is far better than relying on -polling the timeout value. - -Usage of curl_multi_socket(3) is deprecated, whereas the function is -equivalent to curl_multi_socket_action(3) with **ev_bitmask** set to -0. +zero, all transfers are complete/done. Force libcurl to (re-)check all its internal sockets and transfers instead of -just a single one by calling curl_multi_socket_all(3). Note that there -should not be any reason to use this function. +just a single one by calling curl_multi_socket_all(3). Note that there should +not be any reason to use this function. + +# %PROTOCOLS% # EXAMPLE ~~~c int main(void) { - /* the event-library gets told when there activity on the socket 'fd', - which we translate to a call to curl_multi_socket_action() */ int running; int rc; - int fd; CURLM *multi; - rc = curl_multi_socket(multi, fd, &running); + rc = curl_multi_socket_all(multi, &running); } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.15.4, and is deemed stable since -7.16.0. - -curl_multi_socket(3) is deprecated, use -curl_multi_socket_action(3) instead! +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_strerror.md b/deps/curl/docs/libcurl/curl_multi_strerror.md index 590af13a..d419ab2e 100644 --- a/deps/curl/docs/libcurl/curl_multi_strerror.md +++ b/deps/curl/docs/libcurl/curl_multi_strerror.md @@ -9,6 +9,9 @@ See-also: - curl_share_strerror (3) - curl_url_strerror (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.12.0 --- # NAME @@ -28,6 +31,8 @@ const char *curl_multi_strerror(CURLMcode errornum); This function returns a string describing the *CURLMcode* error code passed in the argument *errornum*. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -42,9 +47,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.12.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_timeout.md b/deps/curl/docs/libcurl/curl_multi_timeout.md index a8693d1c..de59c392 100644 --- a/deps/curl/docs/libcurl/curl_multi_timeout.md +++ b/deps/curl/docs/libcurl/curl_multi_timeout.md @@ -9,6 +9,9 @@ See-also: - curl_multi_info_read (3) - curl_multi_setopt (3) - curl_multi_socket (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME @@ -46,6 +49,8 @@ Note: if libcurl returns a -1 timeout here, it just means that libcurl currently has no stored timeout value. You must not wait too long (more than a few seconds perhaps) before you call curl_multi_perform(3) again. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -80,9 +85,7 @@ out which sockets to wait for by calling curl_multi_fdset(3). When there is activity or timeout, call curl_multi_perform(3) and then loop - until all transfers are complete. -# AVAILABILITY - -This function was added in libcurl 7.15.4. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_wait.md b/deps/curl/docs/libcurl/curl_multi_wait.md index 526cef6b..7e9553d7 100644 --- a/deps/curl/docs/libcurl/curl_multi_wait.md +++ b/deps/curl/docs/libcurl/curl_multi_wait.md @@ -8,11 +8,14 @@ See-also: - curl_multi_fdset (3) - curl_multi_perform (3) - curl_multi_poll (3) +Protocol: + - All +Added-in: 7.28.0 --- # NAME -curl_multi_wait - polls on all easy handles in a multi handle +curl_multi_wait - poll on all easy handles in a multi handle # SYNOPSIS @@ -32,7 +35,7 @@ curl_multi_wait(3) polls all file descriptors used by the curl easy handles contained in the given multi handle set. It blocks until activity is detected on at least one of the handles or *timeout_ms* has passed. Alternatively, if the multi handle has a pending internal timeout that has a -shorter expiry time than *timeout_ms*, that shorter time is be used +shorter expiry time than *timeout_ms*, that shorter time is being used instead to make sure timeout accuracy is reasonably kept. The calling application may pass additional *curl_waitfd* structures which @@ -77,6 +80,8 @@ priority read events such as out of band data. Bit flag to *curl_waitfd.events* indicating the socket should poll on write events such as the socket being clear to write without blocking. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -111,9 +116,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.28.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_multi_waitfds.md b/deps/curl/docs/libcurl/curl_multi_waitfds.md new file mode 100644 index 00000000..0a8440eb --- /dev/null +++ b/deps/curl/docs/libcurl/curl_multi_waitfds.md @@ -0,0 +1,112 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Title: curl_multi_waitfds +Section: 3 +Source: libcurl +See-also: + - curl_multi_perform (3) + - curl_multi_poll (3) + - curl_multi_wait (3) + - curl_multi_fdset (3) +Protocol: + - All +Added-in: 8.8.0 +--- + +# NAME + +curl_multi_waitfds - extract file descriptor information from a multi handle + +# SYNOPSIS + +~~~c +#include +#include + +CURLMcode curl_multi_waitfds(CURLM *multi, + struct curl_waitfd *ufds, + unsigned int size, + unsigned int *fd_count); +~~~ + +# DESCRIPTION + +This function extracts *curl_waitfd* structures which are similar to +*poll(2)*'s *pollfd* structure from a given multi_handle. + +These structures can be used for polling on multi_handle file descriptors in a +fashion similar to curl_multi_poll(3). The curl_multi_perform(3) +function should be called as soon as one of them is ready to be read from or +written to. + +libcurl fills provided *ufds* array up to the *size*. +If a number of descriptors used by the multi_handle is greater than the +*size* parameter then libcurl returns CURLM_OUT_OF_MEMORY error. + +If the *fd_count* argument is not a null pointer, it points to a variable +that on returns specifies the number of descriptors used by the multi_handle to +be checked for being ready to read or write. + +The client code can pass *size* equal to zero just to get the number of the +descriptors and allocate appropriate storage for them to be used in a +subsequent function call. + +# %PROTOCOLS% + +# EXAMPLE + +~~~c +#include + +int main(void) +{ + CURLMcode mc; + struct curl_waitfd *ufds; + + CURLM *multi = curl_multi_init(); + + do { + /* call curl_multi_perform() */ + + /* get the count of file descriptors from the transfers */ + unsigned int fd_count = 0; + + mc = curl_multi_waitfds(multi, NULL, 0, &fd_count); + + if(mc != CURLM_OK) { + fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); + break; + } + + if(!fd_count) + continue; /* no descriptors yet */ + + /* Allocate storage for our descriptors. + * Note that a better approach can be used to minimize allocations and + * deallocations, if needed, like pre-allocated or grow-only array. + */ + ufds = (struct curl_waitfd*)malloc(fd_count * sizeof(struct curl_waitfd)); + + /* get wait descriptors from the transfers and put them into array. */ + mc = curl_multi_waitfds(multi, ufds, fd_count, NULL); + + if(mc != CURLM_OK) { + fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); + free(ufds); + break; + } + + /* Do polling on descriptors in ufds */ + + free(ufds); + } while(!mc); +} +~~~ + +# %AVAILABILITY% + +# RETURN VALUE + +**CURLMcode** type, general libcurl multi interface error code. See +libcurl-errors(3) diff --git a/deps/curl/docs/libcurl/curl_multi_wakeup.md b/deps/curl/docs/libcurl/curl_multi_wakeup.md index fd9fa056..a920847a 100644 --- a/deps/curl/docs/libcurl/curl_multi_wakeup.md +++ b/deps/curl/docs/libcurl/curl_multi_wakeup.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_multi_poll (3) - curl_multi_wait (3) +Protocol: + - All +Added-in: 7.68.0 --- # NAME -curl_multi_wakeup - wakes up a sleeping curl_multi_poll call +curl_multi_wakeup - wake up a sleeping curl_multi_poll call # SYNOPSIS @@ -36,6 +39,8 @@ that multiple calls to this function wake up the same waiting operation. This function has no effect on curl_multi_wait(3) calls. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -82,9 +87,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.68.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_pushheader_byname.md b/deps/curl/docs/libcurl/curl_pushheader_byname.md index b83ba559..d066ea7b 100644 --- a/deps/curl/docs/libcurl/curl_pushheader_byname.md +++ b/deps/curl/docs/libcurl/curl_pushheader_byname.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_PUSHFUNCTION (3) - curl_pushheader_bynum (3) +Protocol: + - HTTP +Added-in: 7.44.0 --- # NAME @@ -33,6 +36,8 @@ 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 one header field use the same name, this returns only the first one. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -73,9 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.44.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_pushheader_bynum.md b/deps/curl/docs/libcurl/curl_pushheader_bynum.md index 4ba20b67..12555c57 100644 --- a/deps/curl/docs/libcurl/curl_pushheader_bynum.md +++ b/deps/curl/docs/libcurl/curl_pushheader_bynum.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_PUSHFUNCTION (3) - curl_pushheader_byname (3) +Protocol: + - HTTP +Added-in: 7.44.0 --- # NAME @@ -32,6 +35,8 @@ 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. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -60,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.44.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_share_cleanup.md b/deps/curl/docs/libcurl/curl_share_cleanup.md index 2f161149..afb06d00 100644 --- a/deps/curl/docs/libcurl/curl_share_cleanup.md +++ b/deps/curl/docs/libcurl/curl_share_cleanup.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_share_init (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10 --- # NAME -curl_share_cleanup - Clean up a shared object +curl_share_cleanup - close a shared object # SYNOPSIS @@ -29,6 +32,11 @@ when this function has been called. Passing in a NULL pointer in *share_handle* makes this function return immediately with no action. +Any use of the **share_handle** after this function has been called and have +returned, is illegal. + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -42,9 +50,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_share_init.md b/deps/curl/docs/libcurl/curl_share_init.md index 6654f3c9..deb61733 100644 --- a/deps/curl/docs/libcurl/curl_share_init.md +++ b/deps/curl/docs/libcurl/curl_share_init.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_share_cleanup (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10 --- # NAME -curl_share_init - Create a shared object +curl_share_init - create a share object # SYNOPSIS @@ -33,6 +36,8 @@ This *share handle* is what you pass to curl using the CURLOPT_SHARE(3) option with curl_easy_setopt(3), to make that specific curl handle use the data in this share. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -46,9 +51,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_share_setopt.md b/deps/curl/docs/libcurl/curl_share_setopt.md index d21c1595..a15955e4 100644 --- a/deps/curl/docs/libcurl/curl_share_setopt.md +++ b/deps/curl/docs/libcurl/curl_share_setopt.md @@ -7,11 +7,14 @@ Source: libcurl See-also: - curl_share_cleanup (3) - curl_share_init (3) +Protocol: + - All +Added-in: 7.10 --- # NAME -curl_share_setopt - Set options for a shared object +curl_share_setopt - set options for a shared object # SYNOPSIS @@ -47,6 +50,8 @@ See CURLSHOPT_UNSHARE(3). See CURLSHOPT_USERDATA(3). +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -60,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_share_strerror.md b/deps/curl/docs/libcurl/curl_share_strerror.md index 9e8ebe72..9c45278f 100644 --- a/deps/curl/docs/libcurl/curl_share_strerror.md +++ b/deps/curl/docs/libcurl/curl_share_strerror.md @@ -9,6 +9,9 @@ See-also: - curl_multi_strerror (3) - curl_url_strerror (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.12.0 --- # NAME @@ -28,6 +31,8 @@ const char *curl_share_strerror(CURLSHcode errornum); The curl_share_strerror(3) function returns a string describing the *CURLSHcode* error code passed in the argument *errornum*. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -41,9 +46,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This function was added in libcurl 7.12.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_slist_append.md b/deps/curl/docs/libcurl/curl_slist_append.md index 2e8a5401..27ec45da 100644 --- a/deps/curl/docs/libcurl/curl_slist_append.md +++ b/deps/curl/docs/libcurl/curl_slist_append.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - curl_slist_free_all (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -32,6 +35,8 @@ returns. curl_slist_append(3) copies the string. The list should be freed again (after usage) with curl_slist_free_all(3). +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -63,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_slist_free_all.md b/deps/curl/docs/libcurl/curl_slist_free_all.md index 1d73d7d7..91491aa6 100644 --- a/deps/curl/docs/libcurl/curl_slist_free_all.md +++ b/deps/curl/docs/libcurl/curl_slist_free_all.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - curl_slist_append (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -28,6 +31,11 @@ linked list. Passing in a NULL pointer in *list* makes this function return immediately with no action. +Any use of the **list** after this function has been called and have returned, +is illegal. + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -49,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_strequal.md b/deps/curl/docs/libcurl/curl_strequal.md index 76b08a97..e7270d87 100644 --- a/deps/curl/docs/libcurl/curl_strequal.md +++ b/deps/curl/docs/libcurl/curl_strequal.md @@ -5,13 +5,17 @@ Title: curl_strequal Section: 3 Source: libcurl See-also: + - curl_strnequal (3) - strcasecmp (3) - strcmp (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_strequal, curl_strnequal - case insensitive string comparisons +curl_strequal - compare two strings ignoring case # SYNOPSIS @@ -19,21 +23,23 @@ curl_strequal, curl_strnequal - case insensitive string comparisons #include int curl_strequal(const char *str1, const char *str2); -int curl_strnequal(const char *str1, const char *str2, size_t length); ~~~ # DESCRIPTION -The curl_strequal(3) function compares the two strings *str1* and -*str2*, ignoring the case of the characters. It returns a non-zero (TRUE) -integer if the strings are identical. +The curl_strequal(3) function compares the two strings *str1* and *str2*, +ignoring the case of the characters. It returns a non-zero (TRUE) integer if +the strings are identical. -The **curl_strnequal()** function is similar, except it only compares the -first *length* characters of *str1*. +This function uses plain ASCII based comparisons completely disregarding the +locale - contrary to how **strcasecmp** and other system case insensitive +string comparisons usually work. -These functions are provided by libcurl to enable applications to compare -strings in a truly portable manner. There are no standard portable case -insensitive string comparison functions. These two work on all platforms. +This function is provided by libcurl to enable applications to compare strings +in a truly portable manner. There are no standard portable case insensitive +string comparison functions. This function works on all platforms. + +# %PROTOCOLS% # EXAMPLE @@ -43,14 +49,10 @@ int main(int argc, char **argv) const char *name = "compare"; if(curl_strequal(name, argv[1])) printf("Name and input matches\n"); - if(curl_strnequal(name, argv[1], 5)) - printf("Name and input matches in the 5 first bytes\n"); } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_strnequal.md b/deps/curl/docs/libcurl/curl_strnequal.md index 76b08a97..db42bcdf 100644 --- a/deps/curl/docs/libcurl/curl_strnequal.md +++ b/deps/curl/docs/libcurl/curl_strnequal.md @@ -1,39 +1,48 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: curl_strequal +Title: curl_strnequal Section: 3 Source: libcurl See-also: + - curl_strequal (3) - strcasecmp (3) - strcmp (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_strequal, curl_strnequal - case insensitive string comparisons +curl_strnequal - compare two strings ignoring case # SYNOPSIS ~~~c #include -int curl_strequal(const char *str1, const char *str2); int curl_strnequal(const char *str1, const char *str2, size_t length); ~~~ # DESCRIPTION -The curl_strequal(3) function compares the two strings *str1* and -*str2*, ignoring the case of the characters. It returns a non-zero (TRUE) -integer if the strings are identical. +The curl_strnequal(3) function compares the two strings *str1* and *str2*, +ignoring the case of the characters. It returns a non-zero (TRUE) integer if +the strings are identical. -The **curl_strnequal()** function is similar, except it only compares the -first *length* characters of *str1*. +This function compares no more than the first *length* bytes of *str1* and +*str2*. -These functions are provided by libcurl to enable applications to compare -strings in a truly portable manner. There are no standard portable case -insensitive string comparison functions. These two work on all platforms. +This function uses plain ASCII based comparisons completely disregarding the +locale - contrary to how **strcasecmp** and other system case insensitive +string comparisons usually work. + +This function is provided by libcurl to enable applications to compare strings +in a truly portable manner. There are no standard portable case insensitive +string comparison functions. This function works on all platforms. + +# %PROTOCOLS% # EXAMPLE @@ -41,16 +50,12 @@ insensitive string comparison functions. These two work on all platforms. int main(int argc, char **argv) { const char *name = "compare"; - if(curl_strequal(name, argv[1])) - printf("Name and input matches\n"); if(curl_strnequal(name, argv[1], 5)) printf("Name and input matches in the 5 first bytes\n"); } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_unescape.md b/deps/curl/docs/libcurl/curl_unescape.md index ad60150a..2600f143 100644 --- a/deps/curl/docs/libcurl/curl_unescape.md +++ b/deps/curl/docs/libcurl/curl_unescape.md @@ -9,11 +9,14 @@ See-also: - curl_easy_escape (3) - curl_easy_unescape (3) - curl_free (3) +Protocol: + - All +Added-in: 7.1 --- # NAME -curl_unescape - URL decodes the given string +curl_unescape - URL decode a string # SYNOPSIS @@ -25,7 +28,7 @@ char *curl_unescape(const char *input, int length); # DESCRIPTION -Obsolete function. Use curl_easy_unescape(3) instead. +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 @@ -37,6 +40,8 @@ strlen() on **input** to find out the size. You must curl_free(3) the returned string when you are done with it. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -55,11 +60,13 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Since 7.15.4, curl_easy_unescape(3) should be used. This function might be removed in a future release. +# %AVAILABILITY% + # RETURN VALUE A pointer to a null-terminated string or NULL if it failed. diff --git a/deps/curl/docs/libcurl/curl_url.md b/deps/curl/docs/libcurl/curl_url.md index 3870073d..5872134e 100644 --- a/deps/curl/docs/libcurl/curl_url.md +++ b/deps/curl/docs/libcurl/curl_url.md @@ -11,11 +11,14 @@ See-also: - curl_url_get (3) - curl_url_set (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME -curl_url - returns a new URL handle +curl_url - create a URL handle # SYNOPSIS @@ -35,6 +38,8 @@ 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. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -55,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_url_cleanup.md b/deps/curl/docs/libcurl/curl_url_cleanup.md index b64fc79e..36455fc0 100644 --- a/deps/curl/docs/libcurl/curl_url_cleanup.md +++ b/deps/curl/docs/libcurl/curl_url_cleanup.md @@ -10,6 +10,9 @@ See-also: - curl_url_dup (3) - curl_url_get (3) - curl_url_set (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -26,11 +29,16 @@ void curl_url_cleanup(CURLU *handle); # DESCRIPTION -Frees all the resources associated with the given *CURLU* handle! +Frees all the resources associated with the given *CURLU* handle. Passing in a NULL pointer in *handle* makes this function return immediately with no action. +Any use of the **handle** after this function has been called and have +returned, is illegal. + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -42,9 +50,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_url_dup.md b/deps/curl/docs/libcurl/curl_url_dup.md index 769a1c72..28a661a4 100644 --- a/deps/curl/docs/libcurl/curl_url_dup.md +++ b/deps/curl/docs/libcurl/curl_url_dup.md @@ -10,6 +10,9 @@ See-also: - curl_url_cleanup (3) - curl_url_get (3) - curl_url_set (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -30,6 +33,8 @@ Duplicates the URL object the input *CURLU* *inhandle* identifies and returns a pointer to the copy as a new *CURLU* handle. The new handle also needs to be freed with curl_url_cleanup(3). +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -40,16 +45,14 @@ int main(void) CURLU *url2; rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0); if(!rc) { - url2 = curl_url_dup(url); /* clone it! */ + url2 = curl_url_dup(url); /* clone it */ curl_url_cleanup(url2); } curl_url_cleanup(url); } ~~~ -# AVAILABILITY - -Added in 7.62.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_url_get.md b/deps/curl/docs/libcurl/curl_url_get.md index 8722286f..e7aa6baa 100644 --- a/deps/curl/docs/libcurl/curl_url_get.md +++ b/deps/curl/docs/libcurl/curl_url_get.md @@ -11,6 +11,9 @@ See-also: - curl_url_dup (3) - curl_url_set (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -111,16 +114,47 @@ punycode. (Added in curl 8.3.0) +## CURLU_GET_EMPTY + +When this flag is used in curl_url_get(), it makes the function return empty +query and fragments parts or when used in the full URL. By default, libcurl +otherwise considers empty parts non-existing. + +An empty query part is one where this is nothing following the question mark +(before the possible fragment). An empty fragments part is one where there is +nothing following the hash sign. + +(Added in curl 8.8.0) + +## CURLU_NO_GUESS_SCHEME + +When this flag is used in curl_url_get(), it treats the scheme as non-existing +if it was set as a result of a previous guess; when CURLU_GUESS_SCHEME was +used parsing a URL. + +Using this flag when getting CURLUPART_SCHEME if the scheme was set as the +result of a guess makes curl_url_get() return CURLUE_NO_SCHEME. + +Using this flag when getting CURLUPART_URL if the scheme was set as the result +of a guess makes curl_url_get() return the full URL without the scheme +component. Such a URL can then only be parsed with curl_url_set() if +CURLU_GUESS_SCHEME is used. + +(Added in curl 8.9.0) + # PARTS ## CURLUPART_URL -When asked to return the full URL, curl_url_get(3) returns a normalized -and possibly cleaned up version using all available URL parts. +When asked to return the full URL, curl_url_get(3) returns a normalized and +possibly cleaned up version using all available URL parts. -We advise using the *CURLU_PUNYCODE* option to get the URL as "normalized" -as possible since IDN allows hostnames to be written in many different ways -that still end up the same punycode version. +We advise using the *CURLU_PUNYCODE* option to get the URL as "normalized" as +possible since IDN allows hostnames to be written in many different ways that +still end up the same punycode version. + +Zero-length queries and fragments are excluded from the URL unless +CURLU_GET_EMPTY is set. ## CURLUPART_SCHEME @@ -167,7 +201,8 @@ The initial question mark that denotes the beginning of the query part is a delimiter only. It is not part of the query contents. A not-present query returns *part* set to NULL. -A zero-length query returns *part* as a zero-length string. + +A zero-length query returns *part* as NULL unless CURLU_GET_EMPTY is set. The query part gets pluses converted to space when asked to URL decode on get with the CURLU_URLDECODE bit. @@ -177,6 +212,12 @@ with the CURLU_URLDECODE bit. The initial hash sign that denotes the beginning of the fragment is a delimiter only. It is not part of the fragment contents. +A not-present fragment returns *part* set to NULL. + +A zero-length fragment returns *part* as NULL unless CURLU_GET_EMPTY is set. + +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -197,9 +238,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0. CURLUPART_ZONEID was added in 7.65.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_url_set.md b/deps/curl/docs/libcurl/curl_url_set.md index d02ec001..b041d756 100644 --- a/deps/curl/docs/libcurl/curl_url_set.md +++ b/deps/curl/docs/libcurl/curl_url_set.md @@ -11,6 +11,9 @@ See-also: - curl_url_dup (3) - curl_url_get (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: 7.78.0 --- # NAME @@ -36,35 +39,30 @@ handle previously created by curl_url(3) or curl_url_dup(3). This function sets or updates individual URL components, or parts, held by the URL object the handle identifies. -The *part* argument should identify the particular URL part (see list -below) to set or change, with *content* pointing to a null-terminated -string with the new contents for that URL part. The contents should be in the -form and encoding they would use in a URL: URL encoded. +The *part* argument should identify the particular URL part (see list below) +to set or change, with *content* pointing to a null-terminated string with the +new contents for that URL part. The contents should be in the form and +encoding they would use in a URL: URL encoded. -When setting part in the URL object that was previously already set, it +When setting a part in the URL object that was previously already set, it replaces the data that was previously stored for that part with the new *content*. The caller does not have to keep *content* around after a successful call as this function copies the content. -Setting a part to a NULL pointer removes that part's contents from the -*CURLU* handle. - -By default, this API only accepts URLs using schemes for protocols that are -supported built-in. To make libcurl parse URLs generically even for schemes it -does not know about, the **CURLU_NON_SUPPORT_SCHEME** flags bit must be -set. Otherwise, this function returns *CURLUE_UNSUPPORTED_SCHEME* for URL -schemes it does not recognize. +Setting a part to a NULL pointer removes that part's contents from the *CURLU* +handle. This function has an 8 MB maximum length limit for all provided input strings. In the real world, excessively long fields in URLs cause problems even if this -API accepts them. +function accepts them. -When setting or updating contents of individual URL parts, this API might -accept data that would not be otherwise possible to set in the string when it -gets populated as a result of a full URL parse. Beware. If done so, extracting -a full URL later on from such components might render an invalid URL. +When setting or updating contents of individual URL parts, curl_url_set(3) +might accept data that would not be otherwise possible to set in the string +when it gets populated as a result of a full URL parse. Beware. If done so, +extracting a full URL later on from such components might render an invalid +URL. The *flags* argument is a bitmask with independent features. @@ -78,13 +76,23 @@ populated with a URL, the new URL can be relative to the previous. When successfully setting a new URL, relative or absolute, the handle contents is replaced with the components of the newly set URL. -Pass a pointer to a null-terminated string to the *url* parameter. The -string must point to a correctly formatted "RFC 3986+" URL or be a NULL -pointer. +Pass a pointer to a null-terminated string to the *url* parameter. The string +must point to a correctly formatted "RFC 3986+" URL or be a NULL pointer. The +URL parser only understands and parses the subset of URLS that are +"hierarchical" and therefore contain a :// separator - not the ones that are +normally specified with only a colon separator. + +By default this API only parses URLs using schemes for protocols that are +supported built-in. To make libcurl parse URLs generically even for schemes it +does not know about, the **CURLU_NON_SUPPORT_SCHEME** flags bit must be set. +Otherwise, this function returns *CURLUE_UNSUPPORTED_SCHEME* for URL schemes +it does not recognize. Unless *CURLU_NO_AUTHORITY* is set, a blank hostname is not allowed in the URL. +When a full URL is set (parsed), the hostname component is stored URL decoded. + ## CURLUPART_SCHEME Scheme cannot be URL decoded on set. libcurl only accepts setting schemes up @@ -92,8 +100,14 @@ to 40 bytes long. ## CURLUPART_USER +If only the user part is set and not the password, the URL is represented with +a blank password. + ## CURLUPART_PASSWORD +If only the password part is set and not the user, the URL is represented with +a blank user. + ## CURLUPART_OPTIONS The options field is an optional field that might follow the password in the @@ -108,6 +122,9 @@ encoded as your locale says or UTF-8 (when WinIDN is used). If it is a bracketed IPv6 numeric address it may contain a zone id (or you can use *CURLUPART_ZONEID*). +Note that if you set an IPv6 address, it gets ruined and causes an error if +you also set the CURLU_URLENCODE flag. + Unless *CURLU_NO_AUTHORITY* is set, a blank hostname is not allowed to set. ## CURLUPART_ZONEID @@ -155,17 +172,19 @@ first '=' symbol is not URL encoded. ## CURLU_NON_SUPPORT_SCHEME -If set, allows curl_url_set(3) to set a non-supported scheme. +If set, allows curl_url_set(3) to set a non-supported scheme. It then of +course cannot know if the provided scheme is a valid one or not. ## CURLU_URLENCODE When set, curl_url_set(3) URL encodes the part on entry, except for -scheme, port and URL. +**scheme**, **port** and **URL**. When setting the path component with URL encoding enabled, the slash character -is be skipped. +is skipped. -The query part gets space-to-plus conversion before the URL conversion. +The query part gets space-to-plus converted before the URL conversion is +applied. This URL encoding is charset unaware and converts the input in a byte-by-byte manner. @@ -173,8 +192,8 @@ manner. ## CURLU_DEFAULT_SCHEME If set, allows the URL to be set without a scheme and then sets that to the -default scheme: HTTPS. Overrides the *CURLU_GUESS_SCHEME* option if both -are set. +default scheme: HTTPS. Overrides the *CURLU_GUESS_SCHEME* option if both are +set. ## CURLU_GUESS_SCHEME @@ -184,6 +203,14 @@ subdomain name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that scheme is used, otherwise it picks HTTP. Conflicts with the *CURLU_DEFAULT_SCHEME* option which takes precedence if both are set. +If guessing is not allowed and there is no default scheme set, trying to parse +a URL without a scheme returns error. + +If the scheme ends up set as a result of guessing, i.e. it is not actually +present in the parsed URL, it can later be figured out by using the +**CURLU_NO_GUESS_SCHEME** flag when subsequently getting the URL or the scheme +with curl_url_get(3). + ## CURLU_NO_AUTHORITY If set, skips authority checks. The RFC allows individual schemes to omit the @@ -215,6 +242,8 @@ If set, the URL parser does not accept embedded credentials for the **CURLUPART_URL**, and instead returns **CURLUE_USER_NOT_ALLOWED** for such URLs. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -231,9 +260,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0. CURLUPART_ZONEID was added in 7.65.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_url_strerror.md b/deps/curl/docs/libcurl/curl_url_strerror.md index 46971c65..33cdb148 100644 --- a/deps/curl/docs/libcurl/curl_url_strerror.md +++ b/deps/curl/docs/libcurl/curl_url_strerror.md @@ -11,6 +11,9 @@ See-also: - curl_url_get (3) - curl_url_set (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.80.0 --- # NAME @@ -30,6 +33,8 @@ const char *curl_url_strerror(CURLUcode errornum); This function returns a string describing the CURLUcode error code passed in the argument *errornum*. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -44,9 +49,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.80.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_version.md b/deps/curl/docs/libcurl/curl_version.md index 953252c2..25c5eb98 100644 --- a/deps/curl/docs/libcurl/curl_version.md +++ b/deps/curl/docs/libcurl/curl_version.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - curl_version_info (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -25,7 +28,9 @@ char *curl_version(); Returns a human readable string with the version number of libcurl and some of its important components (like OpenSSL version). -We recommend using curl_version_info(3) instead! +We recommend using curl_version_info(3) instead. + +# %PROTOCOLS% # EXAMPLE @@ -36,9 +41,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_version_info.md b/deps/curl/docs/libcurl/curl_version_info.md index ded83910..271e935c 100644 --- a/deps/curl/docs/libcurl/curl_version_info.md +++ b/deps/curl/docs/libcurl/curl_version_info.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - curl_version (3) +Protocol: + - All +Added-in: 7.10.0 --- # NAME @@ -102,6 +105,9 @@ typedef struct { /* when 'age' is CURLVERSION_ELEVENTH or higher (>= 7.87.0), the members below exist */ const char *const *feature_names; /* Feature names. */ + /* when 'age' is CURLVERSION_TWELFTH or higher (>= 8.8.0), the members + below exist */ + const char *const *rtmp_version; /* human readable string */ } curl_version_info_data; ~~~ @@ -110,13 +116,13 @@ new the libcurl you are using is. You are however guaranteed to get a struct that you have a matching struct for in the header, as you tell libcurl your "age" with the input argument. -*version* is just an ascii string for the libcurl version. +*version* is just an ASCII string for the libcurl version. *version_num* is a 24 bit number created like this: \<8 bits major number\> | \<8 bits minor number\> | \<8 bits patch number\>. Version 7.9.8 is therefore returned as 0x070908. -*host* is an ascii string showing what host information that this libcurl +*host* is an ASCII string showing what host information that this libcurl was built for. As discovered by a configure script or set by the build environment. @@ -171,6 +177,12 @@ supports HTTP Brotli content encoding using libbrotlidec (Added in 7.57.0) libcurl was built with debug capabilities (added in 7.10.6) +## ECH + +*features* mask bit: non-existent + +libcurl was built with ECH support (experimental, added in 8.8.0) + ## gsasl *features* mask bit: CURL_VERSION_GSASL @@ -265,7 +277,7 @@ supports HTTP NTLM (added in 7.10.6) *features* mask bit: CURL_VERSION_NTLM_WB libcurl was built with support for NTLM delegation to a winbind helper. -(Added in 7.22.0) +(Added in 7.22.0) This feature was removed from curl in 8.8.0. ## PSL @@ -358,6 +370,8 @@ supports HTTP GSS-Negotiate (added in 7.10.6, deprecated in 7.38.0) supports Kerberos V4 (when using FTP). Legacy bit. Deprecated since 7.33.0. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -371,11 +385,8 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE A pointer to a curl_version_info_data struct. -curl_version(3) diff --git a/deps/curl/docs/libcurl/curl_ws_meta.md b/deps/curl/docs/libcurl/curl_ws_meta.md index 49d987da..f95f25e8 100644 --- a/deps/curl/docs/libcurl/curl_ws_meta.md +++ b/deps/curl/docs/libcurl/curl_ws_meta.md @@ -10,6 +10,9 @@ See-also: - curl_ws_recv (3) - curl_ws_send (3) - libcurl-ws (3) +Protocol: + - WS +Added-in: 7.86.0 --- # NAME @@ -95,6 +98,8 @@ This transfer is now closed. This as an incoming ping message, that expects a pong response. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -130,9 +135,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.86.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_ws_recv.md b/deps/curl/docs/libcurl/curl_ws_recv.md index e2b1b74f..c13d74a5 100644 --- a/deps/curl/docs/libcurl/curl_ws_recv.md +++ b/deps/curl/docs/libcurl/curl_ws_recv.md @@ -10,6 +10,9 @@ See-also: - curl_easy_setopt (3) - curl_ws_send (3) - libcurl-ws (3) +Protocol: + - WS +Added-in: 7.86.0 --- # NAME @@ -34,12 +37,16 @@ Retrieves as much as possible of a received WebSocket data fragment into the number of bytes actually stored. If there is more fragment data to deliver than what fits in the provided -*buffer*, libcurl returns a full buffer and the application needs to call -this function again to continue draining the buffer. +*buffer*, libcurl returns a full buffer and the application needs to call this +function again to continue draining the buffer. -The *meta* pointer gets set to point to a *const struct curl_ws_frame* -that contains information about the received data. See the -curl_ws_meta(3) for details on that struct. +If the function call is successful, the *meta* pointer gets set to point to a +*const struct curl_ws_frame* that contains information about the received +data. That struct must not be freed and its contents must not be relied upon +anymore once another WebSocket function is called. See the curl_ws_meta(3) for +details on that struct.a + +# %PROTOCOLS% # EXAMPLE @@ -58,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.86.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/curl_ws_send.md b/deps/curl/docs/libcurl/curl_ws_send.md index f07a3ecc..262250b5 100644 --- a/deps/curl/docs/libcurl/curl_ws_send.md +++ b/deps/curl/docs/libcurl/curl_ws_send.md @@ -10,6 +10,9 @@ See-also: - curl_easy_setopt (3) - curl_ws_recv (3) - libcurl-ws (3) +Protocol: + - WS +Added-in: 7.86.0 --- # NAME @@ -50,6 +53,10 @@ If **CURLWS_RAW_MODE** is enabled in CURLOPT_WS_OPTIONS(3), the To send a message consisting of multiple frames, set the *CURLWS_CONT* bit in all frames except the final one. +Warning: while it is possible to invoke this function from a callback, +such a call is blocking in this situation, e.g. only returns after all data +has been sent or an error is encountered. + # FLAGS ## CURLWS_TEXT @@ -87,6 +94,8 @@ fragment like this, the *fragsize* must be provided with the total expected fragment size in the first call and it needs to be zero in subsequent calls. +# %PROTOCOLS% + # EXAMPLE ~~~c @@ -109,9 +118,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.86.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/libcurl-easy.md b/deps/curl/docs/libcurl/libcurl-easy.md index 7dbc475e..78210883 100644 --- a/deps/curl/docs/libcurl/libcurl-easy.md +++ b/deps/curl/docs/libcurl/libcurl-easy.md @@ -1,7 +1,7 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: libcurl +Title: libcurl-easy Section: 3 Source: libcurl See-also: @@ -11,6 +11,9 @@ See-also: - libcurl (3) - libcurl-errors (3) - libcurl-multi (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -25,28 +28,27 @@ interface functions you use. Use curl_easy_init(3) to get the handle. You continue by setting all the options you want in the upcoming transfer, the most important among them is the URL itself (you cannot transfer anything -without a specified URL as you may have figured out yourself). You might want -to set some callbacks as well that are called from the library when data is -available etc. curl_easy_setopt(3) is used for all this. +without a specified URL). You might want to set some callbacks as well that +are called from the library when data is available etc. For example +CURLOPT_WRITEFUNCTION(3). curl_easy_setopt(3) is used for all this. -CURLOPT_URL(3) is the only option you really must set, as otherwise -there can be no transfer. Another commonly used option is -CURLOPT_VERBOSE(3) that helps you see what libcurl is doing under the -hood, which is useful when debugging for example. The -curl_easy_setopt(3) man page has a full index of the almost 300 +CURLOPT_URL(3) is the only option you really must set, as otherwise there can +be no transfer. Another commonly used option is CURLOPT_VERBOSE(3) that helps +you see what libcurl is doing under the hood, which is useful when debugging +for example. The curl_easy_setopt(3) man page has a full index of the over 300 available options. If you at any point would like to blank all previously set options for a -single easy handle, you can call curl_easy_reset(3) and you can also -make a clone of an easy handle (with all its set options) using +single easy handle, you can call curl_easy_reset(3) and you can also make a +clone of an easy handle (with all its set options) using curl_easy_duphandle(3). When all is setup, you tell libcurl to perform the transfer using -curl_easy_perform(3). It performs the entire transfer operation and does -not return until it is done (successfully or not). +curl_easy_perform(3). It performs the entire transfer operation and does not +return until it is done (successfully or not). After the transfer has been made, you can set new options and make another transfer, or if you are done, cleanup the session by calling -curl_easy_cleanup(3). If you want persistent connections, you do not -cleanup immediately, but instead run ahead and perform other transfers using -the same easy handle. +curl_easy_cleanup(3). If you want persistent connections, you do not cleanup +immediately, but instead run ahead and perform other transfers using the same +easy handle. diff --git a/deps/curl/docs/libcurl/libcurl-env-dbg.md b/deps/curl/docs/libcurl/libcurl-env-dbg.md index 6a22a885..73217ca2 100644 --- a/deps/curl/docs/libcurl/libcurl-env-dbg.md +++ b/deps/curl/docs/libcurl/libcurl-env-dbg.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - libcurl-env (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -61,6 +64,15 @@ Trace logging behavior as an alternative to calling curl_global_trace(3). Example: **CURL_DEBUG=http/2** means trace details about HTTP/2 handling. +In the curl command line tool, built with `--enable-debug`, this environment +variable adds to arguments like `--verbose`, `-vvv`. At least a single `-v` +is needed to make the run emit trace output, but when it does, the contents +of `CURL_DEBUG` are added and can override existing options. + +Example: **CURL_DEBUG=tcp,-http/2 curl -vv url** means trace protocol details, +triggered by `-vv`, add tracing of TCP in addition and remove tracing of +HTTP/2. + ## CURL_DEBUG_SIZE Fake the size returned by CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE. @@ -95,7 +107,7 @@ the current. ## CURL_TIME -Fake unix timestamp to use for AltSvc, HSTS and CURLINFO variables that are +Fake Unix timestamp to use for AltSvc, HSTS and CURLINFO variables that are time related. This variable can also be used to fake the data returned by some CURLINFO @@ -108,10 +120,6 @@ LDAP tracing is enabled if this variable exists and its value is 1 or greater. OpenLDAP tracing is separate. Refer to CURL_OPENLDAP_TRACE. -## CURL_NTLM_WB_FILE - -Debug-version of the *ntlm-wb* executable. - ## CURL_OPENLDAP_TRACE OpenLDAP tracing is enabled if this variable exists and its value is 1 or @@ -121,3 +129,16 @@ greater. There is a number of debug levels, refer to *openldap.c* comments. Used to influence the buffer chunk size used for WebSocket encoding and decoding. + +## CURL_FORBID_REUSE + +Used to set the CURLOPT_FORBID_REUSE flag on each transfer initiated +by the curl command line tool. The value of the environment variable +does not matter. + +## CURL_GRACEFUL_SHUTDOWN + +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. diff --git a/deps/curl/docs/libcurl/libcurl-env.md b/deps/curl/docs/libcurl/libcurl-env.md index 4df328ec..70b41d12 100644 --- a/deps/curl/docs/libcurl/libcurl-env.md +++ b/deps/curl/docs/libcurl/libcurl-env.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - libcurl-env-dbg (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -49,7 +52,7 @@ this variable's selection is used. Setting a name that is not a built-in alternative makes libcurl stay with the default. SSL backend names (case-insensitive): BearSSL, GnuTLS, mbedTLS, -nss, OpenSSL, rustls, Schannel, Secure-Transport, wolfSSL +nss, OpenSSL, Rustls, Schannel, Secure-Transport, wolfSSL ## `HOME` diff --git a/deps/curl/docs/libcurl/libcurl-errors.md b/deps/curl/docs/libcurl/libcurl-errors.md index 0d4ce511..1b5e4111 100644 --- a/deps/curl/docs/libcurl/libcurl-errors.md +++ b/deps/curl/docs/libcurl/libcurl-errors.md @@ -12,6 +12,9 @@ See-also: - curl_multi_strerror (3) - curl_share_strerror (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -57,7 +60,7 @@ The URL was not properly formatted. ## CURLE_NOT_BUILT_IN (4) -A requested feature, protocol or option was not found built-in in this libcurl +A requested feature, protocol or option was not found built into this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl. @@ -485,6 +488,10 @@ An internal call to poll() or select() returned error that is not recoverable. A value or data field grew larger than allowed. +## CURLE_ECH_REQUIRED (101)" + +ECH was attempted but failed. + # CURLMcode This is the generic return code used by functions in the libcurl multi @@ -518,7 +525,7 @@ You are doomed. ## CURLM_INTERNAL_ERROR (4) -This can only be returned if libcurl bugs. Please report it to us! +This can only be returned if libcurl bugs. Please report it to us. ## CURLM_BAD_SOCKET (5) diff --git a/deps/curl/docs/libcurl/libcurl-multi.md b/deps/curl/docs/libcurl/libcurl-multi.md index e037394d..3becb648 100644 --- a/deps/curl/docs/libcurl/libcurl-multi.md +++ b/deps/curl/docs/libcurl/libcurl-multi.md @@ -8,6 +8,9 @@ See-also: - libcurl (3) - libcurl-easy (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME diff --git a/deps/curl/docs/libcurl/libcurl-security.md b/deps/curl/docs/libcurl/libcurl-security.md index 0d71ca7b..e1301698 100644 --- a/deps/curl/docs/libcurl/libcurl-security.md +++ b/deps/curl/docs/libcurl/libcurl-security.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - libcurl-thread (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -119,7 +122,7 @@ user running the libcurl application, SCP: or SFTP: URLs could access password or private-key protected resources, e.g. **sftp://user@some-internal-server/etc/passwd** -The CURLOPT_REDIR_PROTOCOLS(3) and CURLOPT_NETRC(3) options can be +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 @@ -130,7 +133,7 @@ E.g. **http://127.0.0.1/** or **http://intranet/delete-stuff.cgi?delete=all** or Applications can mitigate against this by disabling CURLOPT_FOLLOWLOCATION(3) and handling redirects itself, sanitizing URLs as necessary. Alternately, an app could leave CURLOPT_FOLLOWLOCATION(3) -enabled but set CURLOPT_REDIR_PROTOCOLS(3) and install a +enabled but set CURLOPT_REDIR_PROTOCOLS_STR(3) and install a CURLOPT_OPENSOCKETFUNCTION(3) or CURLOPT_PREREQFUNCTION(3) callback function in which addresses are sanitized before use. @@ -162,7 +165,7 @@ non-redirected URLs, if the user is allowed to specify an arbitrary URL that could point to a private resource. For example, a web app providing a translation service might happily translate **file://localhost/etc/passwd** and display the result. Applications can mitigate against this with the -CURLOPT_PROTOCOLS(3) option as well as by similar mitigation techniques +CURLOPT_PROTOCOLS_STR(3) option as well as by similar mitigation techniques for redirections. A malicious FTP server could in response to the PASV command return an IP @@ -306,9 +309,9 @@ Remedies: curl command lines can use *--proto* to limit what URL schemes it accepts -## Use CURLOPT_PROTOCOLS +## Use CURLOPT_PROTOCOLS_STR -libcurl programs can use CURLOPT_PROTOCOLS(3) to limit what URL schemes it accepts +libcurl programs can use CURLOPT_PROTOCOLS_STR(3) to limit what URL schemes it accepts ## consider not allowing the user to set the full URL @@ -378,10 +381,11 @@ CURLOPT_TIMEOUT(3) and/or CURLOPT_LOW_SPEED_LIMIT(3) options can be used to mitigate against this. A malicious server could cause libcurl to download an infinite amount of data, -potentially causing all of memory or disk to be filled. Setting the -CURLOPT_MAXFILESIZE_LARGE(3) option is not sufficient to guard against -this. Instead, applications should monitor the amount of data received within -the write or progress callback and abort once the limit is reached. +potentially causing system resources to be exhausted resulting in a system or +application crash. Setting the CURLOPT_MAXFILESIZE_LARGE(3) option is not +sufficient to guard against this. Instead, applications should monitor the +amount of data received within the write or progress callback and abort once +the limit is reached. A malicious HTTP server could cause an infinite redirection loop, causing a denial-of-service. This can be mitigated by using the @@ -456,7 +460,9 @@ created. libcurl itself uses *fork()* and *execl()* if told to use the **CURLAUTH_NTLM_WB** authentication method which then invokes the helper command in a child process with file descriptors duplicated. Make sure that -only the trusted and reliable helper program is invoked! +only the trusted and reliable helper program is invoked. + +This feature was removed from curl in 8.8.0. # Secrets in memory diff --git a/deps/curl/docs/libcurl/libcurl-share.md b/deps/curl/docs/libcurl/libcurl-share.md index 2d33f71e..04005931 100644 --- a/deps/curl/docs/libcurl/libcurl-share.md +++ b/deps/curl/docs/libcurl/libcurl-share.md @@ -11,6 +11,9 @@ See-also: - libcurl-easy (3) - libcurl-errors (3) - libcurl-multi (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -33,7 +36,7 @@ The share interface was added to enable sharing of data between curl handles. You can have multiple easy handles share data between them. Have them update and use the **same** cookie database, DNS cache, TLS session cache and/or -connection cache! This way, each single transfer takes advantage from data +connection cache. This way, each single transfer takes advantage from data updates made by the other transfer(s). # SHARE OBJECT diff --git a/deps/curl/docs/libcurl/libcurl-thread.md b/deps/curl/docs/libcurl/libcurl-thread.md index 6924eb35..ef7ae9b7 100644 --- a/deps/curl/docs/libcurl/libcurl-thread.md +++ b/deps/curl/docs/libcurl/libcurl-thread.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - libcurl-security (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -35,10 +38,28 @@ share API (the connection pool and HSTS cache for example). # TLS -All current TLS libraries libcurl supports are thread-safe. OpenSSL 1.1.0+ can -be safely used in multi-threaded applications provided that support for the -underlying OS threading API is built-in. For older versions of OpenSSL, the -user must set mutex callbacks. +All current TLS libraries libcurl supports are thread-safe. + +## OpenSSL + +OpenSSL 1.1.0+ can be safely used in multi-threaded applications provided that +support for the underlying OS threading API is built-in. For older versions of +OpenSSL, the user must set mutex callbacks. + +libcurl may not be able to fully clean up after multi-threaded OpenSSL +depending on how OpenSSL was built and loaded as a library. It is possible in +some rare circumstances a memory leak could occur unless you implement your own +OpenSSL thread cleanup. + +For example, on Windows if both libcurl and OpenSSL are linked statically to a +DLL or application then OpenSSL may leak memory unless the DLL or application +calls OPENSSL_thread_stop() before each thread terminates. If OpenSSL is built +as a DLL then it does this cleanup automatically and there is no leak. If +libcurl is built as a DLL and OpenSSL is linked statically to it then libcurl +does this cleanup automatically and there is no leak (added in libcurl 8.8.0). + +Please review the OpenSSL documentation for a full list of circumstances: +https://docs.openssl.org/3.0/man3/OPENSSL_init_crypto/#notes # Signals diff --git a/deps/curl/docs/libcurl/libcurl-tutorial.md b/deps/curl/docs/libcurl/libcurl-tutorial.md index 54607af7..7c59e2f8 100644 --- a/deps/curl/docs/libcurl/libcurl-tutorial.md +++ b/deps/curl/docs/libcurl/libcurl-tutorial.md @@ -9,6 +9,9 @@ See-also: - libcurl-errors (3) - libcurl-multi (3) - libcurl-url (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -109,7 +112,7 @@ specified are: ## CURL_GLOBAL_WIN32 which only does anything on Windows machines. When used on a Windows machine, -it makes libcurl initialize the win32 socket stuff. Without having that +it makes libcurl initialize the Win32 socket stuff. Without having that initialized properly, your program cannot use sockets properly. You should only do this once for each application, so if your program already does this or of another library in use does it, you should not tell libcurl to do this @@ -232,7 +235,7 @@ to make your program run fine virtually everywhere. (CURLOPT_WRITEDATA(3) was formerly known as *CURLOPT_FILE*. Both names still work and do the same thing). -If you are using libcurl as a win32 DLL, you MUST use the +If you are using libcurl as a Windows DLL, you MUST use the CURLOPT_WRITEFUNCTION(3) if you set CURLOPT_WRITEDATA(3) - or experience crashes. @@ -1252,7 +1255,7 @@ curl_mime_subparts(3). Once it has been bound to its parent multi-part, a nth-level multi-part belongs to it and should not be freed explicitly. -Email messages data is not supposed to be non-ascii and line length is +Email messages data is not supposed to be non-ASCII and line length is limited: fortunately, some transfer encodings are defined by the standards to support the transmission of such incompatible data. Function curl_mime_encoder(3) tells a part that its source data must be encoded diff --git a/deps/curl/docs/libcurl/libcurl-url.md b/deps/curl/docs/libcurl/libcurl-url.md index c8d3f0b3..82de7e78 100644 --- a/deps/curl/docs/libcurl/libcurl-url.md +++ b/deps/curl/docs/libcurl/libcurl-url.md @@ -1,7 +1,7 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: libcurl +Title: libcurl-url Section: 3 Source: libcurl See-also: @@ -12,6 +12,9 @@ See-also: - curl_url_get (3) - curl_url_set (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -101,7 +104,7 @@ Extracted parts are not URL decoded unless the user also asks for it with the *CURLU_URLDECODE* flag set in the fourth bitmask argument. Remember to free the returned string with curl_free(3) when you are done -with it! +with it. # SET PARTS @@ -154,9 +157,7 @@ Now the URL looks like https://example.com/?shoes=2&hat=1&candy=N%26N ~~~ -# AVAILABILITY - -The URL API was introduced in libcurl 7.62.0. +# NOTES A URL with a literal IPv6 address can be parsed even when IPv6 support is not enabled. diff --git a/deps/curl/docs/libcurl/libcurl-ws.md b/deps/curl/docs/libcurl/libcurl-ws.md index 1668af44..60c9fa59 100644 --- a/deps/curl/docs/libcurl/libcurl-ws.md +++ b/deps/curl/docs/libcurl/libcurl-ws.md @@ -1,7 +1,7 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: libcurl +Title: libcurl-ws Section: 3 Source: libcurl See-also: @@ -12,6 +12,9 @@ See-also: - curl_ws_meta (3) - curl_ws_recv (3) - curl_ws_send (3) +Protocol: + - All +Added-in: 7.86.0 --- # NAME @@ -113,7 +116,7 @@ Once such a setup has been successfully performed, the application can proceed and use curl_ws_recv(3) and curl_ws_send(3) freely to exchange WebSocket messages with the server. -# AVAILABILITY +# EXPERIMENTAL The WebSocket API was introduced as experimental in 7.86.0 and is still experimental today. diff --git a/deps/curl/docs/libcurl/libcurl.md b/deps/curl/docs/libcurl/libcurl.md index f8ff15eb..b6d4af36 100644 --- a/deps/curl/docs/libcurl/libcurl.md +++ b/deps/curl/docs/libcurl/libcurl.md @@ -9,6 +9,9 @@ See-also: - libcurl-multi (3) - libcurl-security (3) - libcurl-thread (3) +Protocol: + - All +Added-in: n/a --- # NAME @@ -92,7 +95,7 @@ See libcurl-ws(3) # LINKING WITH LIBCURL -On unix-like machines, there is a tool named curl-config that gets installed +On Unix-like machines, there is a tool named curl-config that gets installed with the rest of the curl stuff when 'make install' is performed. curl-config is added to make it easier for applications to link with libcurl @@ -116,7 +119,7 @@ a lowercase c). You can find other functions in the library source code, but other prefixes indicate that the functions are private and may change without further notice in the next release. -Only use documented functions and functionality! +Only use documented functions and functionality. # PORTABILITY diff --git a/deps/curl/docs/libcurl/mksymbolsmanpage.pl b/deps/curl/docs/libcurl/mksymbolsmanpage.pl index d7b9a77e..c1a6b9d6 100644 --- a/deps/curl/docs/libcurl/mksymbolsmanpage.pl +++ b/deps/curl/docs/libcurl/mksymbolsmanpage.pl @@ -40,12 +40,15 @@ SPDX-License-Identifier: curl Title: libcurl-symbols Section: 3 Source: libcurl +Protocol: + - All See-also: - libcurl (3) - libcurl-easy (3) - libcurl-multi (3) - libcurl-security (3) - libcurl-thread (3) +Added-in: n/a --- # libcurl symbols @@ -58,7 +61,7 @@ since that version no new code should be written to use the symbol as it is marked for getting removed in a future. The last version that featured the specific symbol. Using the symbol in source -code will make it no longer compile error-free after that specified version. +code makes it no longer compile error-free after that specified version. This man page is automatically generated from the symbols-in-versions file. HEADER diff --git a/deps/curl/docs/libcurl/opts/CMakeLists.txt b/deps/curl/docs/libcurl/opts/CMakeLists.txt index a20d0b9b..99683c40 100644 --- a/deps/curl/docs/libcurl/opts/CMakeLists.txt +++ b/deps/curl/docs/libcurl/opts/CMakeLists.txt @@ -21,17 +21,17 @@ # SPDX-License-Identifier: curl # ########################################################################### -# Load man_MANS from shared file +# Get 'man_MANS' variable transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") add_manual_pages(man_MANS) -add_custom_target(opts-man DEPENDS ${man_MANS}) -add_dependencies(man opts-man) +add_custom_target(curl-opts-man DEPENDS ${man_MANS}) +add_dependencies(curl-man curl-opts-man) if(NOT CURL_DISABLE_INSTALL) unset(_src) - foreach(_f ${man_MANS}) + foreach(_f IN LISTS man_MANS) list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_f}") endforeach() - install(FILES ${_src} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) + install(FILES ${_src} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") endif() diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md b/deps/curl/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md index e041ff80..2b849afc 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_ACTIVESOCKET.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_CONNECT_ONLY (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.45.0 --- # NAME @@ -38,9 +41,7 @@ CURLOPT_CONNECT_ONLY(3), which skips the transfer phase. CURLINFO_ACTIVESOCKET(3) was added as a replacement for CURLINFO_LASTSOCKET(3) since that one is not working on all platforms. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,21 +57,24 @@ int main(void) /* Do not do the transfer - only connect to host */ curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L); res = curl_easy_perform(curl); + if(res != CURLE_OK) { + printf("Error: %s\n", curl_easy_strerror(res)); + curl_easy_cleanup(curl); + return 1; + } /* Extract the socket from the curl handle */ res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd); - - if(res != CURLE_OK) { - printf("Error: %s\n", curl_easy_strerror(res)); - return 1; + if(!res && sockfd != CURL_SOCKET_BAD) { + /* operate on sockfd */ } + + curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY - -Added in 7.45.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md index 474c033c..61ea7ba8 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_APPCONNECT_TIME_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.19.0 --- # NAME @@ -27,17 +30,15 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME, Pass a pointer to a double to receive the time, in seconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed. -This time is most often close to the CURLINFO_PRETRANSFER_TIME(3) time, -except for cases such as HTTP pipelining where the pretransfer time can be -delayed due to waits in line for the pipeline and more. +This time is most often close to the CURLINFO_PRETRANSFER_TIME(3) time, except +for cases such as HTTP multiplexing where the pretransfer time can be delayed +due to waits in line for the stream and more. When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME_T.md index c2f9825b..4490fd03 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_APPCONNECT_TIME_T.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_APPCONNECT_TIME (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.61.0 --- # NAME @@ -27,18 +30,15 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME_T, Pass a pointer to a curl_off_t to receive the time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was -completed. This time is most often close to the -CURLINFO_PRETRANSFER_TIME_T(3) time, except for cases such as HTTP -pipelining where the pretransfer time can be delayed due to waits in line for -the pipeline and more. +completed. This time is most often close to the CURLINFO_PRETRANSFER_TIME_T(3) +time, except for cases such as HTTP multiplexing where the pretransfer time +can be delayed due to waits in line for the stream and more. When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CAINFO.md b/deps/curl/docs/libcurl/opts/CURLINFO_CAINFO.md index 0cc3c0cd..60c131d9 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CAINFO.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CAINFO.md @@ -8,6 +8,11 @@ See-also: - CURLINFO_CAPATH (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.84.0 --- # NAME @@ -36,9 +41,7 @@ This is a path identifying a single file containing CA certificates. The **path** pointer is set to NULL if there is no default path. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -57,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.84.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CAPATH.md b/deps/curl/docs/libcurl/opts/CURLINFO_CAPATH.md index c1f31578..6211859a 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CAPATH.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CAPATH.md @@ -8,6 +8,14 @@ See-also: - CURLINFO_CAINFO (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - wolfSSL +Added-in: 7.84.0 --- # NAME @@ -36,9 +44,7 @@ This is a path identifying a directory. The **path** pointer is set to NULL if there is no default path. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -57,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.84.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CERTINFO.md b/deps/curl/docs/libcurl/opts/CURLINFO_CERTINFO.md index a4125632..e73b2aee 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CERTINFO.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CERTINFO.md @@ -8,6 +8,14 @@ See-also: - CURLINFO_CAPATH (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - Schannel + - Secure Transport +Added-in: 7.19.1 --- # NAME @@ -43,9 +51,7 @@ items with textual information in the format "name:content" such as "Subject:Foo", "Issuer:Bar", etc. The items in each list varies depending on the SSL backend and the certificate. -# PROTOCOLS - -All TLS-based +# %PROTOCOLS% # EXAMPLE @@ -88,13 +94,12 @@ int main(void) See also the *certinfo.c* example. -# AVAILABILITY +# HISTORY -This option is only working in libcurl built with OpenSSL, GnuTLS, Schannel or -Secure Transport. GnuTLS support added in 7.42.0. Schannel support added in -7.50.0. Secure Transport support added in 7.79.0. +GnuTLS support added in 7.42.0. Schannel support added in 7.50.0. Secure +Transport support added in 7.79.0. mbedTLS support added in 8.9.0. -Added in 7.19.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md index 38cd1ce2..6befaf8a 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_TIMEVALUE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.19.4 --- # NAME @@ -34,9 +37,7 @@ gets a zero stored if the condition instead was met. This can also return 1 if the server responded with a 304 HTTP status code, for example after sending a custom "If-Match-*" header. -# PROTOCOLS - -HTTP and some +# %PROTOCOLS% # EXAMPLE @@ -71,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md index b1c58ad9..dbf1a56f 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONNECT_TIME_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -31,9 +34,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md index 158b58d9..073a93b9 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONNECT_TIME_T.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_CONNECTTIMEOUT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.61.0 --- # NAME @@ -33,9 +36,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONN_ID.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONN_ID.md index 8b6c21bc..41a3b16f 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONN_ID.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONN_ID.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_XFER_ID (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 8.2.0 --- # NAME @@ -32,9 +35,7 @@ The connection id is unique among all connections using the same connection cache. This is implicitly the case for all connections in the same multi handle. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 8.2.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md index 155759b2..77b7be40 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONTENT_LENGTH_UPLOAD (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.6.1 --- # NAME @@ -32,9 +35,7 @@ is the value read from the Content-Length: field. Since 7.19.4, this returns CURLINFO_CONTENT_LENGTH_DOWNLOAD_T(3) is a newer replacement that returns a more sensible variable type. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.6.1. Deprecated since 7.55.0. +Deprecated since 7.55.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md index fa4acf81..ea08eb93 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONTENT_LENGTH_UPLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.55.0 --- # NAME @@ -29,9 +32,7 @@ Pass a pointer to a *curl_off_t* to receive the content-length of the download. This is the value read from the Content-Length: field. Stores -1 if the size is not known. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md index 24c26dbf..322a84a5 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONTENT_LENGTH_DOWNLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.6.1 --- # NAME @@ -31,9 +34,7 @@ Pass a pointer to a double to receive the specified size of the upload. Since CURLINFO_CONTENT_LENGTH_UPLOAD_T(3) is a newer replacement that returns a more sensible variable type. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.6.1. Deprecated since 7.55.0. +Deprecated since 7.55.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md index 4fe942c2..4f018711 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_LENGTH_UPLOAD_T.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONTENT_LENGTH_DOWNLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.55.0 --- # NAME @@ -28,9 +31,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_LENGTH_UPLOAD_T, Pass a pointer to a *curl_off_t* to receive the specified size of the upload. Stores -1 if the size is not known. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -57,9 +58,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md index b9bc4107..9e1800f8 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_CONTENT_TYPE.md @@ -9,6 +9,9 @@ See-also: - curl_easy_getinfo (3) - curl_easy_header (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.9.4 --- # NAME @@ -37,9 +40,7 @@ corresponding CURL handle. The modern way to get this header from a response is to instead use the curl_easy_header(3) function. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_COOKIELIST.md b/deps/curl/docs/libcurl/opts/CURLINFO_COOKIELIST.md index bc01bbfe..0481c127 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_COOKIELIST.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_COOKIELIST.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_COOKIELIST (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.14.1 --- # NAME @@ -34,9 +37,7 @@ received) the 'struct curl_slist *' is made a NULL pointer. Since 7.43.0 cookies that were imported in the Set-Cookie format without a domain name are not exported by this option. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -73,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.14.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md new file mode 100644 index 00000000..42774607 --- /dev/null +++ b/deps/curl/docs/libcurl/opts/CURLINFO_EARLYDATA_SENT_T.md @@ -0,0 +1,75 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Title: CURLINFO_EARLYDATA_SENT_T +Section: 3 +Source: libcurl +See-also: + - curl_easy_getinfo (3) + - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - GnuTLS +Added-in: 8.11.0 +--- + +# NAME + +CURLINFO_EARLYDATA_SENT_T - get the number of bytes sent as TLS early data + +# SYNOPSIS + +~~~c +#include + +CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_EARLYDATA_SENT_T, + curl_off_t *amount); +~~~ + +# DESCRIPTION + +Pass a pointer to an *curl_off_t* to receive the total amount of bytes that +were sent to the server as TLSv1.3 early data. When no TLS early +data is used, this reports 0. + +TLS early data is only attempted when CURLSSLOPT_EARLYDATA is set for the +transfer. In addition, it is only used by libcurl when a TLS session exists +that announces support. + +The amount is **negative** when the sent data was rejected +by the server. TLS allows a server that announces support for early data to +reject any attempt to use it at its own discretion. When for example 127 +bytes had been sent, but were rejected, it reports -127 as the amount "sent". + +# %PROTOCOLS% + +# EXAMPLE + +~~~c +int main(void) +{ + CURL *curl = curl_easy_init(); + if(curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); + + /* Perform the request */ + res = curl_easy_perform(curl); + + if(!res) { + curl_off_t amount; + res = curl_easy_getinfo(curl, CURLINFO_EARLYDATA_SENT_T, &amount); + if(!res) { + printf("TLS earlydata: %" CURL_FORMAT_CURL_OFF_T " bytes\n", amount); + } + } + } +} +~~~ + +# %AVAILABILITY% + +# RETURN VALUE + +Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md b/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md index 98ebde70..86080c57 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_METHOD.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_FOLLOWLOCATION (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.72.0 --- # NAME @@ -36,9 +39,7 @@ The **methodp** pointer is NULL or points to private memory. You MUST NOT free - it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.72.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md b/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md index 8671535e..c1f39522 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_EFFECTIVE_URL.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_FOLLOWLOCATION (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.4 --- # NAME @@ -33,9 +36,7 @@ The **urlp** pointer is NULL or points to private memory. You MUST NOT free - it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME.md index 59a61840..40482e36 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_FILETIME (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP + - FTP + - SFTP +Added-in: 7.5 --- # NAME @@ -30,16 +35,13 @@ in number of seconds since January 1 1970 in the GMT/UTC time zone. If you get hide it or the server does not support the command that tells document time etc) and the time of the document is unknown. -You must tell libcurl to collect this information before the transfer is made, -by using the CURLOPT_FILETIME(3) option to curl_easy_setopt(3) or -you this unconditionally gets a -1 back. +You must ask libcurl to collect this information before the transfer is made, +by using the CURLOPT_FILETIME(3) option or you unconditionally get a -1 back. -Consider using CURLINFO_FILETIME_T(3) to be able to extract dates beyond -the year 2038 on systems using 32 bit longs (Windows). +Consider CURLINFO_FILETIME_T(3) instead to be able to extract dates beyond the +year 2038 on systems using 32-bit longs (Windows). -# PROTOCOLS - -HTTP(S), FTP(S), SFTP +# %PROTOCOLS% # EXAMPLE @@ -67,9 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.5 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME_T.md index 2f48b12e..7cdec9b4 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_FILETIME_T.md @@ -1,13 +1,18 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: CURLINFO_FILETIME +Title: CURLINFO_FILETIME_T Section: 3 Source: libcurl See-also: - CURLOPT_FILETIME (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP + - FTP + - SFTP +Added-in: 7.59.0 --- # NAME @@ -26,22 +31,18 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FILETIME_T, # DESCRIPTION Pass a pointer to a curl_off_t to receive the remote time of the retrieved -document in number of seconds since January 1 1970 in the GMT/UTC time -zone. If you get -1, it can be because of many reasons (it might be unknown, -the server might hide it or the server does not support the command that tells +document in number of seconds since January 1 1970 in the GMT/UTC time zone. +If you get -1, it can be because of many reasons (it might be unknown, the +server might hide it or the server does not support the command that tells document time etc) and the time of the document is unknown. You must ask libcurl to collect this information before the transfer is made, -by using the CURLOPT_FILETIME(3) option to curl_easy_setopt(3) or -you unconditionally get a -1 back. +by using the CURLOPT_FILETIME(3) option or you unconditionally get a -1 back. -This option is an alternative to CURLINFO_FILETIME(3) to allow systems -with 32 bit long variables to extract dates outside of the 32bit timestamp -range. +This option is an alternative to CURLINFO_FILETIME(3) to allow systems with 32 +bit long variables to extract dates outside of the 32-bit timestamp range. -# PROTOCOLS - -HTTP(S), FTP(S), SFTP +# %PROTOCOLS% # EXAMPLE @@ -69,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.59.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md b/deps/curl/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md index 6cbd3c98..245a8493 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_FTP_ENTRY_PATH.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - FTP +Added-in: 7.15.4 --- # NAME @@ -32,9 +35,7 @@ The **path** pointer is NULL or points to private memory. You MUST NOT free - it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. -# PROTOCOLS - -FTP(S) and SFTP +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,11 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.15.4. Works for SFTP since 7.21.4 +Works for SFTP since 7.21.4 + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md b/deps/curl/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md index 81ac85d6..ce8764c9 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_HEADER_SIZE.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_SIZE_DOWNLOAD (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -31,9 +34,7 @@ received. Measured in number of bytes. The total includes the size of any received headers suppressed by CURLOPT_SUPPRESS_CONNECT_HEADERS(3). -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md b/deps/curl/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md index 6eed5bfe..b0b229eb 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_HTTPAUTH_AVAIL.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTPAUTH (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.10.8 --- # NAME @@ -27,12 +30,9 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTPAUTH_AVAIL, long *authp); Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available according to the previous response. The meaning of the -bits is explained in the CURLOPT_HTTPAUTH(3) option for -curl_easy_setopt(3). +bits is explained in the CURLOPT_HTTPAUTH(3) option for curl_easy_setopt(3). -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -67,10 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added RFC 2617 in 7.10.8 -Added RFC 7616 in 7.57.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md b/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md index 94cd4491..b93f9d6f 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_CONNECTCODE.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RESPONSE_CODE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.10.7 --- # NAME @@ -28,9 +31,7 @@ Pass a pointer to a long to receive the last received HTTP proxy response code to a CONNECT request. The returned value is zero if no such response code was available. -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.7 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md b/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md index 71c31819..2721eb3f 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_HTTP_VERSION.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RESPONSE_CODE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.50.0 --- # NAME @@ -29,9 +32,7 @@ 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. -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -52,9 +53,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.50.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_LASTSOCKET.md b/deps/curl/docs/libcurl/opts/CURLINFO_LASTSOCKET.md index da698172..957f21f4 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_LASTSOCKET.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_LASTSOCKET.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_CONNECT_ONLY (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.15.2 --- # NAME @@ -38,9 +41,7 @@ NOTE: this API is deprecated since it is not working on win64 where the SOCKET type is 64 bits large while its 'long' is 32 bits. Use the CURLINFO_ACTIVESOCKET(3) instead, if possible. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -50,27 +51,30 @@ int main(void) CURL *curl = curl_easy_init(); if(curl) { CURLcode res; - long sockfd; /* does not work on win64! */ + long sockfd; /* does not work on win64 */ curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); /* Do not do the transfer - only connect to host */ curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L); res = curl_easy_perform(curl); + if(res != CURLE_OK) { + printf("Error: %s\n", curl_easy_strerror(res)); + curl_easy_cleanup(curl); + return 1; + } /* Extract the socket from the curl handle */ res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd); - - if(res != CURLE_OK) { - printf("Error: %s\n", curl_easy_strerror(res)); - return 1; + if(!res && sockfd != -1) { + /* operate on sockfd */ } + + curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY - -Added in 7.15.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_IP.md b/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_IP.md index 9584243e..f8470b04 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_IP.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_IP.md @@ -9,6 +9,10 @@ See-also: - CURLINFO_PRIMARY_IP (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TCP + - QUIC +Added-in: 7.21.0 --- # NAME @@ -27,17 +31,15 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_LOCAL_IP, char **ip); Pass a pointer to a char pointer to receive the pointer to a null-terminated string holding the IP address of the local end of most recent connection done -with this **curl** handle. This string may be IPv6 when that is -enabled. Note that you get a pointer to a memory area that is reused at next -request so you need to copy the string if you want to keep the information. +with this **curl** handle. This string may be IPv6 when that is enabled. Note +that you get a pointer to a memory area that is reused at next request so you +need to copy the string if you want to keep the information. -The **ip** pointer is NULL or points to private memory. You MUST NOT free - -it gets freed when you call curl_easy_cleanup(3) on the corresponding -CURL handle. +The **ip** pointer is NULL or points to private memory. You MUST NOT free - it +gets freed when you call curl_easy_cleanup(3) on the corresponding CURL +handle. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -63,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md b/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md index d7ae9a9a..a73496be 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_LOCAL_PORT.md @@ -4,11 +4,15 @@ SPDX-License-Identifier: curl Title: CURLINFO_LOCAL_PORT Section: 3 Source: libcurl +Protocol: + - TCP + - QUIC See-also: - CURLINFO_LOCAL_IP (3) - CURLINFO_PRIMARY_PORT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Added-in: 7.21.0 --- # NAME @@ -28,9 +32,10 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_LOCAL_PORT, long *portp); Pass a pointer to a long to receive the local port number of the most recent connection done with this **curl** handle. -# PROTOCOLS +If the connection was done using QUIC, the port number is a UDP port number, +otherwise it is a TCP port number. -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md index 68e1aa9b..349e300e 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_NAMELOOKUP_TIME_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -32,9 +35,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md index b97b584d..d263eb61 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME_T.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_NAMELOOKUP_TIME (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.61.0 --- # NAME @@ -32,9 +35,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md b/deps/curl/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md index 053ab6ff..1a0a83f8 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_NUM_CONNECTS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.12.3 --- # NAME @@ -30,9 +33,7 @@ many times libcurl successfully reused existing connection(s) or not. See the connection options of curl_easy_setopt(3) to see how libcurl tries to make persistent connections to save time. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -48,7 +49,7 @@ int main(void) if(res == CURLE_OK) { long connects; res = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connects); - if(res) + if(!res) printf("It needed %ld connects\n", connects); } curl_easy_cleanup(curl); @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.12.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_OS_ERRNO.md b/deps/curl/docs/libcurl/opts/CURLINFO_OS_ERRNO.md index 61c3348a..969f1a36 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_OS_ERRNO.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_OS_ERRNO.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.12.2 --- # NAME @@ -27,9 +30,15 @@ Pass a pointer to a long to receive the errno variable from a connect failure. Note that the value is only set on failure, it is not reset upon a successful operation. The number is OS and system specific. -# PROTOCOLS +libcurl network-related errors that may have a saved errno are: +CURLE_COULDNT_CONNECT, CURLE_FAILED_INIT, CURLE_INTERFACE_FAILED, +CURLE_OPERATION_TIMEDOUT, CURLE_RECV_ERROR, CURLE_SEND_ERROR. -All +Since 8.8.0 libcurl clears the easy handle's saved errno before performing the +transfer. Prior versions did not clear the saved errno, which means if a saved +errno is retrieved it could be from a previous transfer on the same handle. + +# %PROTOCOLS% # EXAMPLE @@ -44,7 +53,7 @@ int main(void) if(res != CURLE_OK) { long error; res = curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &error); - if(res && error) { + if(!res && error) { printf("Errno: %ld\n", error); } } @@ -53,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.12.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md new file mode 100644 index 00000000..9acdbd7f --- /dev/null +++ b/deps/curl/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md @@ -0,0 +1,70 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Title: CURLINFO_POSTTRANSFER_TIME_T +Section: 3 +Source: libcurl +See-also: + - CURLINFO_PRETRANSFER_TIME_T (3) + - CURLOPT_TIMEOUT (3) + - curl_easy_getinfo (3) + - curl_easy_setopt (3) +Protocol: + - All +Added-in: 8.10.0 +--- + +# NAME + +CURLINFO_POSTTRANSFER_TIME_T - get the time until the last byte is sent + +# SYNOPSIS + +~~~c +#include + +CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_POSTTRANSFER_TIME_T, + curl_off_t *timep); +~~~ + +# DESCRIPTION + +Pass a pointer to a curl_off_t to receive the time, in microseconds, +it took from the start until the last byte is sent by libcurl. + +When a redirect is followed, the time from each request is added together. + +See also the TIMES overview in the curl_easy_getinfo(3) man page. + +# %PROTOCOLS% + +# EXAMPLE + +~~~c +int main(void) +{ + CURL *curl = curl_easy_init(); + if(curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); + res = curl_easy_perform(curl); + if(CURLE_OK == res) { + curl_off_t posttransfer; + res = curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T, + &posttransfer); + if(CURLE_OK == res) { + printf("Request sent after: %" CURL_FORMAT_CURL_OFF_T ".%06ld us", + posttransfer / 1000000, (long)(posttransfer % 1000000)); + } + } + /* always cleanup */ + curl_easy_cleanup(curl); + } +} +~~~ + +# %AVAILABILITY% + +# RETURN VALUE + +Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md index 5dfd6c3f..0d3e3304 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_PRETRANSFER_TIME_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -37,9 +40,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md index fb9be877..0300312d 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PRETRANSFER_TIME_T.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_PRETRANSFER_TIME_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.61.0 --- # NAME @@ -37,9 +40,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md b/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md index c5692f12..83f431fd 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_IP.md @@ -10,6 +10,9 @@ See-also: - CURLINFO_PRIMARY_PORT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.19.0 --- # NAME @@ -36,9 +39,7 @@ The **ip** pointer is NULL or points to private memory. You MUST NOT free - it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. -# PROTOCOLS - -All network based ones +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md b/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md index 43ef2676..d44594e3 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PRIMARY_PORT.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_PRIMARY_IP (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.21.0 --- # NAME @@ -33,9 +36,7 @@ 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. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PRIVATE.md b/deps/curl/docs/libcurl/opts/CURLINFO_PRIVATE.md index 42c96f0e..0ce64992 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PRIVATE.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PRIVATE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_PRIVATE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -29,9 +32,7 @@ associated with the curl handle (set with the CURLOPT_PRIVATE(3)). Please note that for internal reasons, the value is returned as a char pointer, although effectively being a 'void *'. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PROTOCOL.md b/deps/curl/docs/libcurl/opts/CURLINFO_PROTOCOL.md index d15457b9..6e466f77 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PROTOCOL.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PROTOCOL.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RESPONSE_CODE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.52.0 --- # NAME @@ -26,7 +29,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROTOCOL, long *p); This option is deprecated. We strongly recommend using CURLINFO_SCHEME(3) instead, because this option cannot return all -possible protocols! +possible protocols. Pass a pointer to a long to receive the version used in the last http connection. The returned value is set to one of the CURLPROTO_* values: @@ -41,9 +44,7 @@ CURLPROTO_SCP, CURLPROTO_SFTP, CURLPROTO_SMB, CURLPROTO_SMBS, CURLPROTO_SMTP, CURLPROTO_SMTPS, CURLPROTO_TELNET, CURLPROTO_TFTP, CURLPROTO_MQTT ~~~ -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.52.0. Deprecated since 7.85.0. +Deprecated since 7.85.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md b/deps/curl/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md index f29f9245..201c0d99 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PROXYAUTH_AVAIL.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_HTTPAUTH_AVAIL (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.10.8 --- # NAME @@ -27,12 +30,9 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXYAUTH_AVAIL, Pass a pointer to a long to receive a bitmask indicating the authentication method(s) available according to the previous response. The meaning of the -bits is explained in the CURLOPT_PROXYAUTH(3) option for -curl_easy_setopt(3). +bits is explained in the CURLOPT_PROXYAUTH(3) option for curl_easy_setopt(3). -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -68,10 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added RFC 2617 in 7.10.8 -Added RFC 7616 in 7.57.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md b/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md index d16668d8..52572b99 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_ERROR.md @@ -9,6 +9,9 @@ See-also: - curl_easy_getinfo (3) - curl_easy_setopt (3) - libcurl-errors (3) +Protocol: + - All +Added-in: 7.73.0 --- # NAME @@ -69,9 +72,7 @@ transfer returned a **CURLE_PROXY** error. That error code matches the The error code is zero (**CURLPX_OK**) if no response code was available. -# PROTOCOLS - -All that can be done over SOCKS +# %PROTOCOLS% # EXAMPLE @@ -96,9 +97,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.73.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md b/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md index f559badf..f1aeb052 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_PROXY_SSL_VERIFYRESULT.md @@ -8,6 +8,12 @@ See-also: - CURLINFO_SSL_VERIFYRESULT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.52.0 --- # NAME @@ -29,9 +35,9 @@ Pass a pointer to a long to receive the result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER(3) option. This is only used for HTTPS proxies. -# PROTOCOLS +0 is a positive result. Non-zero is an error. -All +# %PROTOCOLS% # EXAMPLE @@ -42,22 +48,29 @@ int main(void) if(curl) { CURLcode res; long verifyresult; + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443"); + res = curl_easy_perform(curl); - if(res) + if(res) { printf("error: %s\n", curl_easy_strerror(res)); - curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT, &verifyresult); - printf("The peer verification said %s\n", verifyresult? - "fine" : "bad"); + curl_easy_cleanup(curl); + return 1; + } + + res = curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT, + &verifyresult); + if(!res) { + printf("The peer verification said %s\n", + (verifyresult ? "bad" : "fine")); + } curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_QUEUE_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_QUEUE_TIME_T.md index 0fffb728..c066e4ca 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_QUEUE_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_QUEUE_TIME_T.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_TIMEOUT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 8.6.0 --- # NAME @@ -33,9 +36,7 @@ connection etc due to set conditions and limits imposed by the application. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 8.6.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md index e0749029..c5999247 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_COUNT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_FOLLOWLOCATION (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.9.7 --- # NAME @@ -29,9 +32,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_COUNT, Pass a pointer to a long to receive the total number of redirections that were actually followed. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -53,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.7 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md index 6f742aba..f60b5e54 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME.md @@ -10,6 +10,9 @@ See-also: - CURLINFO_REDIRECT_URL (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.9.7 --- # NAME @@ -34,9 +37,7 @@ the complete execution time for multiple redirections. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.7 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md index 4b48a4f4..1c69bfcf 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_TIME_T.md @@ -10,6 +10,9 @@ See-also: - CURLINFO_REDIRECT_URL (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.61.0 --- # NAME @@ -35,9 +38,7 @@ multiple redirections. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md index 1954351d..9926a5ed 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_REDIRECT_URL.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_FOLLOWLOCATION (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.18.2 --- # NAME @@ -26,18 +29,16 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_URL, char **urlp); # DESCRIPTION -Pass a pointer to a char pointer to receive the URL a redirect *would* -take you to if you would enable CURLOPT_FOLLOWLOCATION(3). This can come -handy if you think using the built-in libcurl redirect logic is not good enough -for you but you would still prefer to avoid implementing all the magic of -figuring out the new URL. +Pass a pointer to a char pointer to receive the URL a redirect *would* take +you to if you would enable CURLOPT_FOLLOWLOCATION(3). This can come handy if +you think using the built-in libcurl redirect logic is not good enough for you +but you would still prefer to avoid implementing all the magic of figuring out +the new URL. -This URL is also set if the CURLOPT_MAXREDIRS(3) limit prevented a -redirect to happen (since 7.54.1). +This URL is also set if the CURLOPT_MAXREDIRS(3) limit prevented a redirect to +happen (since 7.54.1). -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.18.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_REFERER.md b/deps/curl/docs/libcurl/opts/CURLINFO_REFERER.md index fcb719e9..b74a7016 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_REFERER.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_REFERER.md @@ -9,6 +9,9 @@ See-also: - curl_easy_getinfo (3) - curl_easy_header (3) - curl_easy_setopt (3) +Protocol: + - HTTP +Added-in: 7.76.0 --- # NAME @@ -32,9 +35,7 @@ The **hdrp** pointer is NULL or points to private memory you MUST NOT free - it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.76.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md b/deps/curl/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md index dd1f6011..3b0c66dc 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_REQUEST_SIZE.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_SIZE_DOWNLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -29,9 +32,7 @@ Pass a pointer to a long to receive the total size of the issued requests. This is so far only for HTTP requests. Note that this may be more than one request if CURLOPT_FOLLOWLOCATION(3) is enabled. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -54,9 +55,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md b/deps/curl/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md index 72cc1449..05e88387 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_RESPONSE_CODE.md @@ -8,6 +8,12 @@ See-also: - CURLINFO_HTTP_CONNECTCODE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - HTTP + - FTP + - SMTP + - LDAP +Added-in: 7.10.8 --- # NAME @@ -32,9 +38,7 @@ no server response code has been received. Note that a proxy's CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE(3) and not this. -# PROTOCOLS - -HTTP, FTP, SMTP and LDAP +# %PROTOCOLS% # EXAMPLE @@ -55,10 +59,12 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES -Added in 7.10.8. CURLINFO_HTTP_CODE was added in 7.4.1. -Support for SMTP responses added in 7.25.0, for OpenLDAP in 7.81.0. +The former name, CURLINFO_HTTP_CODE, was added in 7.4.1. Support for SMTP +responses added in 7.25.0, for OpenLDAP in 7.81.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_RETRY_AFTER.md b/deps/curl/docs/libcurl/opts/CURLINFO_RETRY_AFTER.md index 12e30375..0dca2e50 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_RETRY_AFTER.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_RETRY_AFTER.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HEADERFUNCTION (3) - CURLOPT_STDERR (3) - curl_easy_header (3) +Protocol: + - All +Added-in: 7.66.0 --- # NAME @@ -35,11 +38,9 @@ or zero if there was no header or the header could not be parsed. # DEFAULT -Returns zero delay if there was no header. +Zero if there was no header. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.66.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md index 68796760..52640e99 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CLIENT_CSEQ.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_RTSP_SERVER_CSEQ (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -29,9 +32,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_CLIENT_CSEQ, Pass a pointer to a long to receive the next CSeq that is expected to be used by the application. -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -52,9 +53,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md index c316f37c..4eb11b41 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_CSEQ_RECV.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RTSP_SERVER_CSEQ (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -29,9 +32,7 @@ server. If your application encounters a *CURLE_RTSP_CSEQ_ERROR* then you may wish to troubleshoot and/or fix the CSeq mismatch by peeking at this value. -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -52,9 +53,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md index 28bf6cd2..ee306e8e 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SERVER_CSEQ.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RTSP_CSEQ_RECV (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -28,14 +31,12 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_SERVER_CSEQ, Pass a pointer to a long to receive the next CSeq that is expected to be used by the application. -Listening for server initiated requests is not implemented! +Listening for server initiated requests is not implemented. Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection. -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md index 48ebe207..04feb1b6 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_RTSP_SESSION_ID.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RTSP_CSEQ_RECV (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -34,9 +37,7 @@ The **id** pointer is NULL or points to private memory. You MUST NOT free - it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -57,9 +58,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SCHEME.md b/deps/curl/docs/libcurl/opts/CURLINFO_SCHEME.md index c3f59a14..8c109839 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SCHEME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SCHEME.md @@ -10,6 +10,9 @@ See-also: - CURLINFO_RESPONSE_CODE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.52.0 --- # NAME @@ -31,12 +34,13 @@ string holding the URL scheme used for the most recent connection done with this CURL **handle**. The **scheme** pointer is NULL or points to private memory. You MUST NOT -free - it gets freed when you call curl_easy_cleanup(3) on the -corresponding CURL handle. +free - it gets freed when you call curl_easy_cleanup(3) on the corresponding +CURL handle. -# PROTOCOLS +The returned scheme might be upper or lowercase. Do comparisons case +insensitively. -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md index e62f971a..9c986649 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_MAXFILESIZE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -35,9 +38,7 @@ number. CURLINFO_SIZE_DOWNLOAD_T(3) is a newer replacement that returns a more sensible variable type. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.4.1. Deprecated since 7.55.0. +Deprecated since 7.55.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md index 5603f5a8..e886f2c1 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_DOWNLOAD_T.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_MAXFILESIZE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.55.0 --- # NAME @@ -32,9 +35,7 @@ were downloaded. The amount is only for the latest transfer and gets reset again for each new transfer. This counts actual payload data, what's also commonly called body. All meta and header data is excluded from this amount. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md index 19c594d3..1ecbddbe 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_SIZE_UPLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -32,9 +35,7 @@ uploaded. CURLINFO_SIZE_UPLOAD_T(3) is a newer replacement that returns a more sensible variable type. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.4.1. Deprecated since 7.55.0. +Deprecated since 7.55.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md index 66954a2d..06ee47da 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SIZE_UPLOAD_T.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_SIZE_UPLOAD (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.55.0 --- # NAME @@ -29,9 +32,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_UPLOAD_T, Pass a pointer to a *curl_off_t* to receive the total amount of bytes that were uploaded. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -57,9 +58,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md index 6ffef34c..52e7cd0c 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_SPEED_UPLOAD (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -32,7 +35,7 @@ measured for the complete download. Measured in bytes/second. CURLINFO_SPEED_DOWNLOAD_T(3) is a newer replacement that returns a more sensible variable type. -# PROTOCOLS +# %PROTOCOLS% # EXAMPLE @@ -58,9 +61,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.4.1. Deprecated since 7.55.0. +Deprecated since 7.55.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md index b8016254..a42356b3 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_DOWNLOAD_T.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_SPEED_UPLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.55.0 --- # NAME @@ -29,7 +32,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_DOWNLOAD_T, Pass a pointer to a *curl_off_t* to receive the average download speed that curl measured for the complete download. Measured in bytes/second. -# PROTOCOLS +# %PROTOCOLS% # EXAMPLE @@ -56,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md index ef9105ba..15d8cf23 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_SPEED_DOWNLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -30,7 +33,7 @@ measured for the complete upload. Measured in bytes/second. CURLINFO_SPEED_UPLOAD_T(3) is a newer replacement that returns a more sensible variable type. -# PROTOCOLS +# %PROTOCOLS% # EXAMPLE @@ -56,9 +59,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.4.1. Deprecated since 7.55.0. +Deprecated since 7.55.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md index 4398fc2e..44694343 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SPEED_UPLOAD_T.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_SPEED_DOWNLOAD_T (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.55.0 --- # NAME @@ -28,7 +31,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD_T, Pass a pointer to a *curl_off_t* to receive the average upload speed that curl measured for the complete upload. Measured in bytes/second. -# PROTOCOLS +# %PROTOCOLS% # EXAMPLE @@ -54,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md b/deps/curl/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md index 7f612795..553bd039 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SSL_ENGINES.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_SSLENGINE (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.12.3 --- # NAME @@ -32,9 +37,7 @@ available at runtime. **NOTE:** you must call curl_slist_free_all(3) on the list pointer once you are done with it, as libcurl does not free this data for you. -# PROTOCOLS - -All TLS based ones. +# %PROTOCOLS% # EXAMPLE @@ -56,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.12.3. Available in OpenSSL builds with "engine" support. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md b/deps/curl/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md index 270dacba..69726b35 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_SSL_VERIFYRESULT.md @@ -8,6 +8,12 @@ See-also: - CURLINFO_PROXY_SSL_VERIFYRESULT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.5 --- # NAME @@ -31,9 +37,7 @@ option). 0 is a positive result. Non-zero is an error. -# PROTOCOLS - -All using TLS +# %PROTOCOLS% # EXAMPLE @@ -44,21 +48,28 @@ int main(void) if(curl) { CURLcode res; long verifyresult; + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); + res = curl_easy_perform(curl); - if(res) + if(res) { printf("error: %s\n", curl_easy_strerror(res)); - curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &verifyresult); - printf("The peer verification said %s\n", verifyresult? - "BAAAD":"fine"); + curl_easy_cleanup(curl); + return 1; + } + + res = curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, + &verifyresult); + if(!res) { + printf("The peer verification said %s\n", + (verifyresult ? "bad" : "fine")); + } curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY - -Added in 7.5. Only set by the OpenSSL/libressl/boringssl and GnuTLS backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md index 5fc6fac8..0e64ba8b 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_TIMEOUT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.9.2 --- # NAME @@ -35,9 +38,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.9.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md index 814658c9..39894d6f 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_STARTTRANSFER_TIME_T.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_TIMEOUT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.61.0 --- # NAME @@ -36,9 +39,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SESSION.md b/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SESSION.md index 490e0bc2..e990ec6e 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SESSION.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SESSION.md @@ -8,6 +8,12 @@ See-also: - CURLINFO_TLS_SSL_PTR (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.34.0 --- # NAME @@ -42,9 +48,7 @@ function *SSL_get_SSL_CTX(3)*. Therefore unless you need compatibility with older versions of libcurl use CURLINFO_TLS_SSL_PTR(3). Refer to that document for more information. -# PROTOCOLS - -All TLS-based +# %PROTOCOLS% # EXAMPLE @@ -65,10 +69,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.34.0. Deprecated since 7.48.0 and supported OpenSSL, GnuTLS, and -NSS only up until this version was released. +Deprecated since 7.48.0 + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md b/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md index 6a54f01f..de8965a1 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md @@ -8,6 +8,17 @@ See-also: - CURLINFO_TLS_SESSION (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - TLS +TLS-backend: + - BearSSL + - GnuTLS + - mbedTLS + - OpenSSL + - Schannel + - Secure Transport + - wolfSSL +Added-in: 7.48.0 --- # NAME @@ -50,8 +61,8 @@ struct curl_tlssessioninfo { The *backend* struct member is one of the defines in the CURLSSLBACKEND_* series: CURLSSLBACKEND_NONE (when built without TLS support), CURLSSLBACKEND_WOLFSSL, CURLSSLBACKEND_SECURETRANSPORT, CURLSSLBACKEND_GNUTLS, -CURLSSLBACKEND_MBEDTLS, CURLSSLBACKEND_NSS, CURLSSLBACKEND_OPENSSL, -CURLSSLBACKEND_SCHANNEL or CURLSSLBACKEND_MESALINK. (Note that the OpenSSL +CURLSSLBACKEND_MBEDTLS, CURLSSLBACKEND_NSS, CURLSSLBACKEND_OPENSSL or +CURLSSLBACKEND_SCHANNEL. (Note that the OpenSSL forks are all reported as just OpenSSL here.) The *internals* struct member points to a TLS library specific pointer for @@ -61,10 +72,6 @@ the active ("in use") SSL connection, with the following underlying types: **gnutls_session_t** -## NSS - -**PRFileDesc *** - ## OpenSSL CURLINFO_TLS_SESSION(3): **SSL_CTX *** @@ -89,6 +96,8 @@ as well: **SSL *** +## + If the *internals* pointer is NULL then either the SSL backend is not supported, an SSL session has not yet been established or the connection is no longer associated with the easy handle (e.g. curl_easy_perform(3) has @@ -125,9 +134,7 @@ How are you using this option? Are you affected by any of these limitations? Please let us know by making a comment at https://github.com/curl/curl/issues/685 -# PROTOCOLS - -All TLS-based +# %PROTOCOLS% # EXAMPLE @@ -162,13 +169,13 @@ int main(int argc, char **argv) } ~~~ -# AVAILABILITY - -Added in 7.48.0. +# HISTORY This option supersedes CURLINFO_TLS_SESSION(3) which was added in 7.34.0. This option is exactly the same as that option except in the case of OpenSSL. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md b/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md index 8859f57f..f752a23d 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_TIMEOUT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.4.1 --- # NAME @@ -33,9 +36,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.4.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md b/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md index cbd8ddda..0b0d16ab 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_TOTAL_TIME_T.md @@ -9,8 +9,10 @@ See-also: - CURLOPT_TIMEOUT (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 7.61.0 --- - # NAME CURLINFO_TOTAL_TIME_T - get total time of previous transfer in microseconds @@ -34,9 +36,7 @@ When a redirect is followed, the time from each request is added together. See also the TIMES overview in the curl_easy_getinfo(3) man page. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_USED_PROXY.md b/deps/curl/docs/libcurl/opts/CURLINFO_USED_PROXY.md index 9fc6836a..aeabb97a 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_USED_PROXY.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_USED_PROXY.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PROXY (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 8.7.0 --- # NAME @@ -29,9 +32,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_USED_PROXY, Pass a pointer to a long. It gets set to zero set if no proxy was used in the previous transfer or a non-zero value if a proxy was used. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(int argc, char *argv[]) } ~~~ -# AVAILABILITY - -Added in 8.7.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLINFO_XFER_ID.md b/deps/curl/docs/libcurl/opts/CURLINFO_XFER_ID.md index 68ec3e8e..f8755932 100644 --- a/deps/curl/docs/libcurl/opts/CURLINFO_XFER_ID.md +++ b/deps/curl/docs/libcurl/opts/CURLINFO_XFER_ID.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONN_ID (3) - curl_easy_getinfo (3) - curl_easy_setopt (3) +Protocol: + - All +Added-in: 8.2.0 --- # NAME @@ -33,9 +36,7 @@ The transfer id is unique among all transfers performed using the same connection cache. This is implicitly the case for all transfers in the same multi handle. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 8.2.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE.md b/deps/curl/docs/libcurl/opts/CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE.md index 5b8c6062..ff232ed6 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE.md @@ -8,6 +8,9 @@ See-also: - CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE (3) - CURLMOPT_MAX_PIPELINE_LENGTH (3) - CURLMOPT_PIPELINING (3) +Protocol: + - HTTP +Added-in: 7.30.0 --- # NAME @@ -35,11 +38,9 @@ than CURLMOPT_MAX_PIPELINE_LENGTH(3). # DEFAULT -The default value is 0, which means that the penalization is inactive. +0, which means that penalization is inactive. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -52,9 +53,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE.md b/deps/curl/docs/libcurl/opts/CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE.md index b5507969..bbd90553 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE (3) - CURLMOPT_PIPELINING (3) +Protocol: + - HTTP +Added-in: 7.30.0 --- # NAME @@ -34,11 +37,9 @@ CURLMOPT_MAX_PIPELINE_LENGTH(3). # DEFAULT -The default value is 0, which means that the size penalization is inactive. +0, which means that the size penalization is inactive. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -51,9 +52,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md b/deps/curl/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md index fbfa0c8b..9e9a55ff 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_MAXCONNECTS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_MAX_HOST_CONNECTIONS (3) - CURLOPT_MAXCONNECTS (3) +Protocol: + - All +Added-in: 7.16.3 --- # NAME @@ -23,17 +26,16 @@ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAXCONNECTS, long max); # DESCRIPTION -Pass a long indicating the **max**. The set number is used as the maximum -amount of simultaneously open connections that libcurl may keep in its -connection cache after completed use. By default libcurl enlarges the size for -each added easy handle to make it fit 4 times the number of added easy -handles. +Pass a long indicating the **max**, the maximum amount of connections that +libcurl may keep alive in its connection cache after use. By default libcurl +enlarges the size for each added easy handle to make it fit 4 times the number +of added easy handles. -By setting this option, you can prevent the cache size from growing beyond the +By setting this option, you prevent the cache size from growing beyond the limit set by you. -When the cache is full, curl closes the oldest one in the cache to prevent the -number of open connections from increasing. +When the cache is full, curl closes the oldest connection present in the cache +to prevent the number of connections from increasing. This option is for the multi handle's use only, when using the easy interface you should instead use the CURLOPT_MAXCONNECTS(3) option. @@ -41,13 +43,16 @@ you should instead use the CURLOPT_MAXCONNECTS(3) option. See CURLMOPT_MAX_TOTAL_CONNECTIONS(3) for limiting the number of active connections. +Changing this value when there are transfers in progress is possible, and the +new value is then used the next time checks are performed. Lowering the value +does not close down any active transfers, it simply does not allow new ones to +get made. + # DEFAULT See DESCRIPTION -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -60,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_CONCURRENT_STREAMS.md b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_CONCURRENT_STREAMS.md index a8e23f8c..c628ca2b 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_CONCURRENT_STREAMS.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_CONCURRENT_STREAMS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_MAXCONNECTS (3) - CURLOPT_MAXCONNECTS (3) +Protocol: + - HTTP +Added-in: 7.67.0 --- # NAME @@ -35,9 +38,7 @@ value passed here would be honored based on other system resources properties. 100 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -50,9 +51,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.67.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_HOST_CONNECTIONS.md b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_HOST_CONNECTIONS.md index 3ccfe87f..07fa6bf6 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_HOST_CONNECTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_HOST_CONNECTIONS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_MAXCONNECTS (3) - CURLMOPT_MAX_TOTAL_CONNECTIONS (3) +Protocol: + - All +Added-in: 7.30.0 --- # NAME @@ -24,10 +27,10 @@ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAX_HOST_CONNECTIONS, # DESCRIPTION -Pass a long to indicate **max**. The set number is used as the maximum amount -of simultaneously open connections to a single host (a host being the same as -a hostname + port number pair). For each new session to a host, libcurl might -open a new connection up to the limit set by +Pass a long to indicate **max**, the maximum amount of simultaneously open +connections libcurl may hold a single host (a host being the same as a +hostname + port number pair). For each new transfer to the same host, libcurl +might open a new connection up to the limit set by CURLMOPT_MAX_HOST_CONNECTIONS(3). When the limit is reached, new sessions are kept pending until a connection becomes available. @@ -36,21 +39,25 @@ proxy connections, and then the proxy is considered to be the host for which this limit counts. When more transfers are added to the multi handle than what can be performed -due to the set limit, they are queued up waiting for their chance. When that -happens, the CURLOPT_TIMEOUT_MS(3) timeout is inclusive of the waiting -time, meaning that if you set a too narrow timeout in such a case the transfer -might never even start before it times out. +due to the set limit, they are queued up waiting for their chance. -Even in the queued up situation, the CURLOPT_CONNECTTIMEOUT_MS(3) -timeout is however treated as a per-connect timeout. +While a transfer is queued up internally waiting for a connection, the +CURLOPT_TIMEOUT_MS(3) timeout is counted inclusive of the waiting time, +meaning that if you set a too narrow timeout the transfer might never even +start before it times out. The CURLOPT_CONNECTTIMEOUT_MS(3) time is also +similarly still treated as a per-connect timeout and might expire even before +making a new connection is permitted. + +Changing this value while there are transfers in progress is possible. The new +value is then used the next time checks are performed. Lowering the value does +not close down any active transfers, it simply does not allow new ones to get +made. # DEFAULT 0 -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -63,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_PIPELINE_LENGTH.md b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_PIPELINE_LENGTH.md index fea5d513..9da9994a 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_PIPELINE_LENGTH.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_PIPELINE_LENGTH.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_MAX_HOST_CONNECTIONS (3) - CURLMOPT_PIPELINING (3) +Protocol: + - All +Added-in: 7.30.0 --- # NAME @@ -40,9 +43,7 @@ CURLMOPT_MAX_PIPELINE_LENGTH(3). 5 -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -55,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_TOTAL_CONNECTIONS.md b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_TOTAL_CONNECTIONS.md index 8cac3702..b014453a 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_TOTAL_CONNECTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_MAX_TOTAL_CONNECTIONS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_MAXCONNECTS (3) - CURLMOPT_MAX_HOST_CONNECTIONS (3) +Protocol: + - All +Added-in: 7.30.0 --- # NAME @@ -27,28 +30,31 @@ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, Pass a long for the **amount**. The set number is used as the maximum number of simultaneously open connections in total using this multi handle. For each new session, libcurl might open a new connection up to the limit set by -CURLMOPT_MAX_TOTAL_CONNECTIONS(3). When the limit is reached, new -sessions are held pending until there are available connections. If -CURLMOPT_PIPELINING(3) is enabled, libcurl can try multiplexing if the -host is capable of it. +CURLMOPT_MAX_TOTAL_CONNECTIONS(3). If CURLMOPT_PIPELINING(3) is enabled, +libcurl can try multiplexing if the host is capable of it. When more transfers are added to the multi handle than what can be performed -due to the set limit, they get queued up waiting for their chance. When that -happens, the CURLOPT_TIMEOUT_MS(3) timeout is counted inclusive of the -waiting time, meaning that if you set a too narrow timeout in such a case the -transfer might never even start before it times out. +due to the set limit, they get queued up waiting for their chance. -Even in the queued up situation, the CURLOPT_CONNECTTIMEOUT_MS(3) -timeout is however treated as a per-connect timeout. +While a transfer is queued up internally waiting for a connection, the +CURLOPT_TIMEOUT_MS(3) timeout is counted inclusive of the waiting time, +meaning that if you set a too narrow timeout the transfer might never even +start before it times out. The CURLOPT_CONNECTTIMEOUT_MS(3) time is also +similarly still treated as a per-connect timeout and might expire even before +making a new connection is permitted. + +Changing this value while there are transfers in progress is possible. The new +value is then used the next time checks are performed. Lowering the value does +not close down any active transfers, it simply does not allow new ones to get +made. # DEFAULT -The default value is 0, which means that there is no limit. It is then simply -controlled by the number of easy handles added. +0, which means that there is no limit. It is then simply controlled by the +number of easy handles added concurrently and how much multiplexing is being +done. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING.md b/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING.md index 2d171df3..5fba662a 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING.md @@ -11,11 +11,14 @@ See-also: - CURLMOPT_MAX_HOST_CONNECTIONS (3) - CURLMOPT_MAX_PIPELINE_LENGTH (3) - CURLMOPT_PIPELINING_SITE_BL (3) +Protocol: + - HTTP +Added-in: 7.16.0 --- # NAME -CURLMOPT_PIPELINING - enable HTTP pipelining and multiplexing +CURLMOPT_PIPELINING - enable HTTP multiplexing # SYNOPSIS @@ -27,15 +30,15 @@ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_PIPELINING, long bitmask); # DESCRIPTION -Pass in the correct value in the **bitmask** parameter to instruct libcurl -to enable multiplexing for this multi handle. +Pass in the correct value in the **bitmask** parameter to instruct libcurl to +enable multiplexing for this multi handle. With multiplexing enabled, libcurl attempts to do multiple transfers over the same connection when doing parallel transfers to the same hosts. ## CURLPIPE_NOTHING (0) -Default, which means doing no attempts at multiplexing. +Make no attempts at multiplexing. ## CURLPIPE_HTTP1 (1) @@ -48,13 +51,9 @@ existing connection if possible. This requires HTTP/2 or HTTP/3. # DEFAULT -Since 7.62.0, **CURLPIPE_MULTIPLEX** is enabled by default. +**CURLPIPE_MULTIPLEX** -Before that, default was **CURLPIPE_NOTHING**. - -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -67,10 +66,16 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.16.0. Multiplex support bit added in 7.43.0. HTTP/1 Pipelining -support was disabled in 7.62.0. +The multiplex support bit was added in 7.43.0. HTTP/1 Pipelining support was +disabled in 7.62.0. + +Since 7.62.0, **CURLPIPE_MULTIPLEX** is enabled by default. + +Before that, default was **CURLPIPE_NOTHING**. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SERVER_BL.md b/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SERVER_BL.md index 87eb2c45..b009de81 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SERVER_BL.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SERVER_BL.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_PIPELINING (3) - CURLMOPT_PIPELINING_SITE_BL (3) +Protocol: + - HTTP +Added-in: 7.30.0 --- # NAME @@ -39,9 +42,9 @@ Pass a NULL pointer to clear the block list. # DEFAULT -The default value is NULL, which means that there is no block list. +NULL, which means that there is no block list. -# PROTOCOLS +# %PROTOCOLS% # EXAMPLE @@ -59,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SITE_BL.md b/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SITE_BL.md index 00491ed8..9e9e20ac 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SITE_BL.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_PIPELINING_SITE_BL.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_PIPELINING (3) - CURLMOPT_PIPELINING_SERVER_BL (3) +Protocol: + - HTTP +Added-in: 7.30.0 --- # NAME @@ -34,11 +37,9 @@ Pass a NULL pointer to clear the block list. # DEFAULT -The default value is NULL, which means that there is no block list. +NULL, which means that there is no block list. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -57,9 +58,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.30.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHDATA.md b/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHDATA.md index f634d355..5499225d 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHDATA.md @@ -9,6 +9,9 @@ See-also: - CURLMOPT_PUSHFUNCTION (3) - CURLOPT_PIPEWAIT (3) - RFC 7540 +Protocol: + - HTTP +Added-in: 7.44.0 --- # NAME @@ -33,9 +36,7 @@ libcurl itself, only passed on to the callback function. NULL -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -78,9 +79,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.44.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHFUNCTION.md index 9ef51d50..d8f80038 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_PUSHFUNCTION.md @@ -9,6 +9,9 @@ See-also: - CURLMOPT_PUSHDATA (3) - CURLOPT_PIPEWAIT (3) - RFC 7540 +Protocol: + - HTTP +Added-in: 7.44.0 --- # NAME @@ -94,9 +97,7 @@ All other return codes are reserved for future use. NULL, no callback -# PROTOCOLS - -HTTP(S) (HTTP/2 only) +# %PROTOCOLS% # EXAMPLE @@ -139,9 +140,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.44.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETDATA.md b/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETDATA.md index 1b4814c4..aade927a 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETDATA.md @@ -8,6 +8,9 @@ See-also: - CURLMOPT_SOCKETFUNCTION (3) - CURLMOPT_TIMERFUNCTION (3) - curl_multi_socket_action (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME @@ -34,9 +37,7 @@ callback's **clientp** argument. NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -73,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md index 207819f9..60c1185e 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLMOPT_SOCKETDATA (3) - CURLMOPT_TIMERFUNCTION (3) - curl_multi_socket_action (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME @@ -47,6 +50,9 @@ libcurl by calling curl_multi_socket_action(3). # CALLBACK ARGUMENTS *easy* identifies the specific transfer for which this update is related. +Since this callback manages a whole multi handle, an application should not +make assumptions about which particular handle that is passed here. It might +even be an internal easy handle that the application did not add itself. *s* is the specific socket this function invocation concerns. If the **what** argument is not CURL_POLL_REMOVE then it holds information about @@ -87,9 +93,7 @@ active transfer. It might soon be added again. NULL (no callback) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -126,9 +130,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERDATA.md b/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERDATA.md index 1632c720..4f0ce4e7 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_SOCKETFUNCTION (3) - CURLMOPT_TIMERFUNCTION (3) +Protocol: + - All +Added-in: 7.16.0 --- # NAME @@ -33,9 +36,7 @@ callback's **clientp** argument. NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.md index fa73266c..35fabdc7 100644 --- a/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLMOPT_SOCKETFUNCTION (3) - CURLMOPT_TIMERDATA (3) +Protocol: + - All +Added-in: 7.16.0 --- # NAME @@ -20,7 +23,7 @@ CURLMOPT_TIMERFUNCTION - callback to receive timeout values int timer_callback(CURLM *multi, /* multi handle */ long timeout_ms, /* timeout in number of ms */ - void *clientp); /* private callback pointer */ + void *clientp); /* private callback pointer */ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_TIMERFUNCTION, timer_callback); ~~~ @@ -33,11 +36,15 @@ shown above. Certain features, such as timeouts and retries, require you to call libcurl even when there is no activity on the file descriptors. -Your callback function **timer_callback** should install a non-repeating -timer with an expire time of **timeout_ms** milliseconds. When that timer -fires, call either curl_multi_socket_action(3) or +Your callback function **timer_callback** should install a single +non-repeating timer with an expire time of **timeout_ms** milliseconds. When +that timer fires, call either curl_multi_socket_action(3) or curl_multi_perform(3), depending on which interface you use. +If this callback is called when a timer is already running, this new expire +time *replaces* the former timeout. The application should then effectively +cancel the old timeout and set a new timeout using this new expire time. + A **timeout_ms** value of -1 passed to this callback means you should delete the timer. All other values are valid expire times in number of milliseconds. @@ -46,24 +53,22 @@ The **timer_callback** is called when the timeout expire time is changed. The **clientp** pointer is set with CURLMOPT_TIMERDATA(3). The timer callback should return 0 on success, and -1 on error. If this -callback returns error, **all** transfers currently in progress in this -multi handle are aborted and made to fail. +callback returns error, **all** transfers currently in progress in this multi +handle are aborted and made to fail. This callback can be used instead of, or in addition to, curl_multi_timeout(3). -**WARNING:** do not call libcurl directly from within the callback itself -when the **timeout_ms** value is zero, since it risks triggering an -unpleasant recursive behavior that immediately calls another call to the -callback with a zero timeout... +**WARNING:** do not call libcurl directly from within the callback itself when +the **timeout_ms** value is zero, since it risks triggering an unpleasant +recursive behavior that immediately calls another call to the callback with a +zero timeout... # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -74,15 +79,15 @@ struct priv { static int timerfunc(CURLM *multi, long timeout_ms, void *clientp) { - struct priv *mydata = clientp; - printf("our ptr: %p\n", mydata->custom); + struct priv *mydata = clientp; + printf("our ptr: %p\n", mydata->custom); - if(timeout_ms) { - /* this is the new single timeout to wait for */ - } - else { - /* delete the timeout, nothing to wait for now */ - } + if(timeout_ms) { + /* this is the new single timeout to wait for */ + } + else { + /* delete the timeout, nothing to wait for now */ + } } int main(void) @@ -94,9 +99,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ABSTRACT_UNIX_SOCKET.md b/deps/curl/docs/libcurl/opts/CURLOPT_ABSTRACT_UNIX_SOCKET.md index cd71bb19..c2b3a3ca 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ABSTRACT_UNIX_SOCKET.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ABSTRACT_UNIX_SOCKET.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_UNIX_SOCKET_PATH (3) - unix (7) +Protocol: + - All +Added-in: 7.53.0 --- # NAME @@ -40,11 +43,9 @@ share the same storage and therefore only one of them can be set per handle. # DEFAULT -Default is NULL. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.53.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPTTIMEOUT_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPTTIMEOUT_MS.md index b51f4516..90c1060e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPTTIMEOUT_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPTTIMEOUT_MS.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_CONNECTTIMEOUT_MS (3) - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_STDERR (3) +Protocol: + - FTP +Added-in: 7.24.0 --- # NAME @@ -31,9 +34,7 @@ server to connect back to libcurl when an active FTP connection is used. 60000 milliseconds -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -52,9 +53,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.24.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPT_ENCODING.md b/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPT_ENCODING.md index 50e7eba9..d0ef75f7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPT_ENCODING.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ACCEPT_ENCODING.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HTTPHEADER (3) - CURLOPT_HTTP_CONTENT_DECODING (3) - CURLOPT_TRANSFER_ENCODING (3) +Protocol: + - HTTP +Added-in: 7.21.6 --- # NAME @@ -39,19 +42,19 @@ built-in supported encodings. Alternatively, you can specify exactly the encoding or list of encodings you want in the response. The following encodings are supported: *identity*, -meaning non-compressed, *deflate* which requests the server to compress -its response using the zlib algorithm, *gzip* which requests the gzip -algorithm, (since curl 7.57.0) *br* which is brotli and (since curl -7.72.0) *zstd* which is zstd. Provide them in the string as a -comma-separated list of accepted encodings, like: **"br, gzip, deflate"**. +meaning non-compressed, *deflate* which requests the server to compress its +response using the zlib algorithm, *gzip* which requests the gzip algorithm, +(since curl 7.57.0) *br* which is brotli and (since curl 7.72.0) *zstd* which +is zstd. Provide them in the string as a comma-separated list of accepted +encodings, like: **"br, gzip, deflate"**. -Set CURLOPT_ACCEPT_ENCODING(3) to NULL to explicitly disable it, which -makes libcurl not send an Accept-Encoding: header and not decompress received +Set CURLOPT_ACCEPT_ENCODING(3) to NULL to explicitly disable it, which makes +libcurl not send an Accept-Encoding: header and not decompress received contents automatically. You can also opt to just include the Accept-Encoding: header in your request -with CURLOPT_HTTPHEADER(3) but then there is no automatic decompressing -when receiving data. +with CURLOPT_HTTPHEADER(3) but then there is no automatic decompressing when +receiving data. This is a request, not an order; the server may or may not do it. This option must be set (to any non-NULL value) or else any unsolicited encoding done by @@ -69,13 +72,25 @@ sending the length of the non-compressed content is a common server mistake). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. + +# HISTORY + +This option was called CURLOPT_ENCODING before 7.21.6 + +# NOTES + +The specific libcurl you are using must have been built with zlib to be able to +decompress gzip and deflate responses, with the brotli library to +decompress brotli responses and with the zstd library to decompress zstd +responses. + # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -95,14 +110,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This option was called CURLOPT_ENCODING before 7.21.6 - -The specific libcurl you are using must have been built with zlib to be able to -decompress gzip and deflate responses, with the brotli library to -decompress brotli responses and with the zstd library to decompress zstd -responses. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ADDRESS_SCOPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_ADDRESS_SCOPE.md index dc9f08a8..e8ac90c0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ADDRESS_SCOPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ADDRESS_SCOPE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_STDERR (3) +Protocol: + - All +Added-in: 7.19.0 --- # NAME @@ -29,9 +32,7 @@ Pass a long specifying the scope id value to use when connecting to IPv6 address 0 -# PROTOCOLS - -All, when using IPv6 +# %PROTOCOLS% # EXAMPLE @@ -53,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC.md b/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC.md index 09f89a32..ef5e8345 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_CONNECT_TO (3) - CURLOPT_COOKIEFILE (3) - CURLOPT_RESOLVE (3) +Protocol: + - HTTP +Added-in: 7.64.1 --- # NAME @@ -32,13 +35,17 @@ CURLOPT_ALTSVC_CTRL(3). Specify a blank filename ("") to make libcurl not load from a file at all. +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL. The alt-svc cache is not read nor written to file. -# PROTOCOLS - -HTTPS +# %PROTOCOLS% # EXAMPLE @@ -102,9 +109,7 @@ Boolean (1 or 0) if "persist" was set for this entry Integer priority value (not currently used) -# AVAILABILITY - -Added in 7.64.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md b/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md index b17e0c46..190d28f9 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_ALTSVC (3) - CURLOPT_CONNECT_TO (3) - CURLOPT_RESOLVE (3) +Protocol: + - HTTP +Added-in: 7.64.1 --- # NAME @@ -32,7 +35,7 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask); Populate the long *bitmask* with the correct set of features to instruct libcurl how to handle Alt-Svc for the transfers using this handle. -libcurl only accepts Alt-Svc headers over a secure transport, meaning +libcurl only accepts Alt-Svc headers over a Secure Transport, meaning HTTPS. It also only completes a request to an alternative origin if that origin is properly hosted over HTTPS. These requirements are there to make sure both the source and the destination are legitimate. @@ -41,6 +44,11 @@ Alternative services are only used when setting up new connections. If there exists an existing connection to the host in the connection pool, then that is preferred. +If CURLOPT_ALTSVC(3) is set, CURLOPT_ALTSVC_CTRL(3) gets a default value +corresponding to CURLALTSVC_H1 | CURLALTSVC_H2 | CURLALTSVC_H3 - the HTTP/2 +and HTTP/3 bits are only set if libcurl was built with support for those +versions. + Setting any bit enables the alt-svc engine. ## CURLALTSVC_READONLYFILE @@ -65,14 +73,9 @@ was also built to actually support HTTP/3, otherwise this bit is ignored. # DEFAULT -Alt-Svc handling is disabled by default. If CURLOPT_ALTSVC(3) is set, -CURLOPT_ALTSVC_CTRL(3) has a default value corresponding to -CURLALTSVC_H1 | CURLALTSVC_H2 | CURLALTSVC_H3 - the HTTP/2 and HTTP/3 bits are -only set if libcurl was built with support for those versions. +0 - Alt-Svc handling is disabled -# PROTOCOLS - -HTTPS +# %PROTOCOLS% # EXAMPLE @@ -88,9 +91,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.64.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_APPEND.md b/deps/curl/docs/libcurl/opts/CURLOPT_APPEND.md index a1d5176c..867cace7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_APPEND.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_APPEND.md @@ -8,6 +8,10 @@ See-also: - CURLOPT_DIRLISTONLY (3) - CURLOPT_RESUME_FROM (3) - CURLOPT_UPLOAD (3) +Protocol: + - FTP + - SFTP +Added-in: 7.17.0 --- # NAME @@ -31,9 +35,7 @@ instead of overwrite it. This is only useful when uploading to an FTP site. 0 (disabled) -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -52,10 +54,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY This option was known as CURLOPT_FTPAPPEND up to 7.16.4 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_AUTOREFERER.md b/deps/curl/docs/libcurl/opts/CURLOPT_AUTOREFERER.md index c9a4ce1f..5106d84c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_AUTOREFERER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_AUTOREFERER.md @@ -10,6 +10,9 @@ See-also: - CURLINFO_REFERER (3) - CURLOPT_FOLLOWLOCATION (3) - CURLOPT_REFERER (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -41,9 +44,7 @@ referer header after the transfer. 0, disabled -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -68,9 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_AWS_SIGV4.md b/deps/curl/docs/libcurl/opts/CURLOPT_AWS_SIGV4.md index a9e1acd2..0b17b1ed 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_AWS_SIGV4.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_AWS_SIGV4.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTPAUTH (3) - CURLOPT_HTTPHEADER (3) - CURLOPT_PROXYAUTH (3) +Protocol: + - HTTP +Added-in: 7.75.0 --- # NAME @@ -48,27 +51,34 @@ It is extracted from the hostname specified in the URL if omitted. The argument is a function provided by a cloud. It is extracted from the hostname specified in the URL if omitted. -NOTE: This call set CURLOPT_HTTPAUTH(3) to CURLAUTH_AWS_SIGV4. -Calling CURLOPT_HTTPAUTH(3) with CURLAUTH_AWS_SIGV4 is the same -as calling this with **"aws:amz"** in parameter. +## + +NOTE: This call set CURLOPT_HTTPAUTH(3) to CURLAUTH_AWS_SIGV4. Calling +CURLOPT_HTTPAUTH(3) with CURLAUTH_AWS_SIGV4 is the same as calling this with +**"aws:amz"** in parameter. Example with "Test:Try", when curl uses the algorithm, it generates -**"TEST-HMAC-SHA256"** for "Algorithm", **"x-try-date"** and -**"X-Try-Date"** for "date", **"test4_request"** for "request type", +**"TEST-HMAC-SHA256"** for "Algorithm", **"x-try-date"** and **"X-Try-Date"** +for "date", **"test4_request"** for "request type", **"SignedHeaders=content-type;host;x-try-date"** for "signed headers" If you use just "test", instead of "test:try", test is used for every generated string. +Setting CURLOPT_HTTPAUTH(3) with the CURLAUTH_AWS_SIGV4 bit set is the same as +setting this option with a **"aws:amz"** parameter. + +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -By default, the value of this parameter is NULL. -Calling CURLOPT_HTTPAUTH(3) with CURLAUTH_AWS_SIGV4 is the same -as calling this with **"aws:amz"** in parameter. +NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -93,19 +103,11 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.75.0 - -# RETURN VALUE - -Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. - # NOTES This option overrides the other auth types you might have set in -CURLOPT_HTTPAUTH(3) which should be highlighted as this makes this auth -method special. This method cannot be combined with other auth types. +CURLOPT_HTTPAUTH(3) which should be highlighted as this makes this auth method +special. This method cannot be combined with other auth types. A sha256 checksum of the request payload is used as input to the signature calculation. For POST requests, this is a checksum of the provided @@ -113,6 +115,12 @@ CURLOPT_POSTFIELDS(3). Otherwise, it is the checksum of an empty buffer. For requests like PUT, you can provide your own checksum in an HTTP header named **x-provider2-content-sha256**. -For **aws:s3**, a **x-amz-content-sha256** header is added to every request -if not already present. For s3 requests with unknown payload, this header takes +For **aws:s3**, a **x-amz-content-sha256** header is added to every request if +not already present. For s3 requests with unknown payload, this header takes the special value "UNSIGNED-PAYLOAD". + +# %AVAILABILITY% + +# RETURN VALUE + +Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_BUFFERSIZE.md b/deps/curl/docs/libcurl/opts/CURLOPT_BUFFERSIZE.md index 3a2ddd8e..5225dedf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_BUFFERSIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_BUFFERSIZE.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_MAX_RECV_SPEED_LARGE (3) - CURLOPT_UPLOAD_BUFFERSIZE (3) - CURLOPT_WRITEFUNCTION (3) +Protocol: + - All +Added-in: 7.10 --- # NAME @@ -51,9 +54,7 @@ allocated as long as there are active transfers. CURL_MAX_WRITE_SIZE (16kB) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -75,9 +76,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10. Growing the buffer was added in 7.53.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO.md b/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO.md index 6955aaa6..686d17e0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO.md @@ -11,6 +11,11 @@ See-also: - CURLOPT_CA_CACHE_TIMEOUT (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.4.2 --- # NAME @@ -49,6 +54,9 @@ store of root certificates (the default for Schannel). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + The default value for this can be figured out with CURLINFO_CAINFO(3). # DEFAULT @@ -56,9 +64,7 @@ The default value for this can be figured out with CURLINFO_CAINFO(3). Built-in system specific. When curl is built with Secure Transport or Schannel, this option is not set by default. -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -75,11 +81,11 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -For the SSL engines that do not support certificate files the -CURLOPT_CAINFO(3) option is ignored. Schannel support added in libcurl -7.60. +Schannel support added in libcurl 7.60. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md index 4566eabc..39b1f987 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CAINFO_BLOB.md @@ -4,11 +4,22 @@ SPDX-License-Identifier: curl Title: CURLOPT_CAINFO_BLOB Section: 3 Source: libcurl +Protocol: + - TLS See-also: - CURLOPT_CAINFO (3) - CURLOPT_CAPATH (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +TLS-backend: + - BearSSL + - OpenSSL + - mbedTLS + - rustls + - wolfSSL + - Secure Transport + - Schannel +Added-in: 7.77.0 --- # NAME @@ -43,9 +54,7 @@ This option overrides CURLOPT_CAINFO(3). NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -70,14 +79,14 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.77.0. +# HISTORY This option is supported by the BearSSL (since 7.79.0), mbedTLS (since -7.81.0), rustls (since 7.82.0), wolfSSL (since 8.2.0), OpenSSL, Secure +7.81.0), Rustls (since 7.82.0), wolfSSL (since 8.2.0), OpenSSL, Secure Transport and Schannel backends. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CAPATH.md b/deps/curl/docs/libcurl/opts/CURLOPT_CAPATH.md index 3d6c3af6..3dcba2d0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CAPATH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CAPATH.md @@ -9,6 +9,14 @@ See-also: - CURLOPT_CAINFO (3) - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_STDERR (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - wolfSSL +Added-in: 7.9.8 --- # NAME @@ -37,15 +45,16 @@ to some limitation in OpenSSL. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + The default value for this can be figured out with CURLINFO_CAPATH(3). # DEFAULT -A default path detected at build time. +A path detected at build time. -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -63,10 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This option is supported by the OpenSSL, GnuTLS and mbedTLS (since 7.56.0) -backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CA_CACHE_TIMEOUT.md b/deps/curl/docs/libcurl/opts/CURLOPT_CA_CACHE_TIMEOUT.md index 79133e81..725efc36 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CA_CACHE_TIMEOUT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CA_CACHE_TIMEOUT.md @@ -10,6 +10,14 @@ See-also: - CURLOPT_CAPATH (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - GnuTLS + - OpenSSL + - Schannel + - wolfSSL +Added-in: 7.87.0 --- # NAME @@ -27,24 +35,23 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CA_CACHE_TIMEOUT, long age); # DESCRIPTION Pass a long, this sets the timeout in seconds. This tells libcurl the maximum -time any cached certificate store it has in memory may be kept and reused for -new connections. Once the timeout has expired, a subsequent fetch requiring a -certificate has to reload it. +time any cached CA certificate store it has in memory may be kept and reused +for new connections. Once the timeout has expired, a subsequent fetch +requiring a CA certificate has to reload it. -Building a certificate store from a CURLOPT_CAINFO(3) file is a slow -operation so curl may cache the generated certificate store internally to speed -up future connections. +Building a CA certificate store from a CURLOPT_CAINFO(3) file is a slow +operation so curl may cache the generated certificate store internally to +speed up future connections. -Set to zero to completely disable caching, or set to -1 to retain the cached -store remain forever. By default, libcurl caches this info for 24 hours. +Set the timeout to zero to completely disable caching, or set to -1 to retain +the cached store remain forever. By default, libcurl caches this info for 24 +hours. # DEFAULT 86400 (24 hours) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -70,12 +77,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -This option was added in curl 7.87.0. +This option is supported by OpenSSL and its forks (since 7.87.0), Schannel +(since 8.5.0), wolfSSL (since 8.9.0) and GnuTLS (since 8.9.0). -This option is supported by OpenSSL and its forks (since 7.87.0) and Schannel -(since 8.5.0). +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CERTINFO.md b/deps/curl/docs/libcurl/opts/CURLOPT_CERTINFO.md index caaa9ea1..abceeb46 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CERTINFO.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CERTINFO.md @@ -10,6 +10,14 @@ See-also: - CURLINFO_CERTINFO (3) - CURLOPT_CAINFO (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - Schannel + - Secure Transport +Added-in: 7.19.1 --- # NAME @@ -36,9 +44,7 @@ its option CURLINFO_CERTINFO(3). 0 -# PROTOCOLS - -All TLS-based +# %PROTOCOLS% # EXAMPLE @@ -79,11 +85,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -This option is supported by the OpenSSL, GnuTLS, Schannel and Secure -Transport backends. Schannel support added in 7.50.0. Secure Transport support -added in 7.79.0. +Schannel support added in 7.50.0. Secure Transport support added in 7.79.0. +mbedTLS support added in 8.9.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_BGN_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_BGN_FUNCTION.md index d349f2db..7d9af2ea 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_BGN_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_BGN_FUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CHUNK_END_FUNCTION (3) - CURLOPT_WILDCARDMATCH (3) +Protocol: + - FTP +Added-in: 7.21.0 --- # NAME @@ -21,7 +24,7 @@ CURLOPT_CHUNK_BGN_FUNCTION - callback before a transfer with FTP wildcard match struct curl_fileinfo { char *filename; curlfiletype filetype; - time_t time; /* always zero! */ + time_t time; /* always zero */ unsigned int perm; int uid; int gid; @@ -81,9 +84,7 @@ Return *CURL_CHUNK_BGN_FUNC_OK* if everything is fine, NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -143,9 +144,7 @@ int main() } ~~~ -# AVAILABILITY - -This was added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_DATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_DATA.md index eca85c87..5a7ebd6a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_DATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_DATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CHUNK_BGN_FUNCTION (3) - CURLOPT_WILDCARDMATCH (3) +Protocol: + - FTP +Added-in: 7.21.0 --- # NAME @@ -31,9 +34,7 @@ CURLOPT_CHUNK_END_FUNCTION(3). NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -93,9 +94,7 @@ int main() } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_END_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_END_FUNCTION.md index 0b228a73..30a2efb1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_END_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CHUNK_END_FUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CHUNK_BGN_FUNCTION (3) - CURLOPT_WILDCARDMATCH (3) +Protocol: + - FTP +Added-in: 7.21.0 --- # NAME @@ -39,9 +42,7 @@ Return *CURL_CHUNK_END_FUNC_OK* if everything is fine or NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -73,9 +74,7 @@ int main() } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETDATA.md index c15c5181..deea601c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CLOSESOCKETFUNCTION (3) - CURLOPT_OPENSOCKETFUNCTION (3) +Protocol: + - All +Added-in: 7.21.7 --- # NAME @@ -30,11 +33,9 @@ CURLOPT_CLOSESOCKETFUNCTION(3). # DEFAULT -The default value of this parameter is NULL. +NULL -# PROTOCOLS - -All except file: +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.7 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETFUNCTION.md index 4e9f2557..060df3a0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CLOSESOCKETFUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CLOSESOCKETDATA (3) - CURLOPT_OPENSOCKETFUNCTION (3) +Protocol: + - All +Added-in: 7.21.7 --- # NAME @@ -41,11 +44,9 @@ closed. # DEFAULT -By default libcurl uses the standard socket close function. +Use the standard socket close function. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -77,9 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.7 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT.md index 798c290b..83ccfcd2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT.md @@ -5,10 +5,12 @@ Title: CURLOPT_CONNECTTIMEOUT Section: 3 Source: libcurl See-also: - - CURLOPT_CONNECTTIMEOUT_MS (3) - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_MAX_RECV_SPEED_LARGE (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.7 --- # NAME @@ -25,22 +27,22 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CONNECTTIMEOUT, long timeout); # DESCRIPTION -Pass a long. It should contain the maximum time in seconds that you allow the -connection phase to the server to take. This timeout only limits the -connection phase, it has no impact once it has connected. Set to zero to -switch to the default built-in connection timeout - 300 seconds. See also the -CURLOPT_TIMEOUT(3) option. +Pass a long. It sets the maximum time in seconds that you allow the connection +phase to take. This timeout only limits the connection phase, it has no impact +once libcurl has connected. The connection phase includes the name resolve +(DNS) and all protocol handshakes and negotiations until there is an +established connection with the remote side. + +Set this option to zero to switch to the default built-in connection timeout - +300 seconds. See also the CURLOPT_TIMEOUT(3) option. CURLOPT_CONNECTTIMEOUT_MS(3) is the same function but set in milliseconds. If both CURLOPT_CONNECTTIMEOUT(3) and CURLOPT_CONNECTTIMEOUT_MS(3) are set, the value set last is used. -The "connection phase" is considered complete when the requested TCP, TLS or -QUIC handshakes are done. - -The connection timeout set with CURLOPT_CONNECTTIMEOUT(3) is included in -the general all-covering CURLOPT_TIMEOUT(3). +The connection timeout is included in the general all-covering +CURLOPT_TIMEOUT(3): With CURLOPT_CONNECTTIMEOUT(3) set to 3 and CURLOPT_TIMEOUT(3) set to 5, the operation can never last longer than 5 seconds, and the connection @@ -51,16 +53,14 @@ to 2, the operation can never last longer than 2 seconds. Including the connection phase. This option may cause libcurl to use the SIGALRM signal to timeout system -calls on builds not using asynch DNS. In unix-like systems, this might cause +calls on builds not using asynch DNS. In Unix-like systems, this might cause signals to be used unless CURLOPT_NOSIGNAL(3) is set. # DEFAULT 300 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -79,9 +79,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT_MS.md index 793b3701..cbfc6d3a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT_MS.md @@ -5,9 +5,12 @@ Title: CURLOPT_CONNECTTIMEOUT_MS Section: 3 Source: libcurl See-also: - - CURLOPT_CONNECTTIMEOUT (3) - CURLOPT_LOW_SPEED_LIMIT (3) - - CURLOPT_TIMEOUT (3) + - CURLOPT_MAX_RECV_SPEED_LARGE (3) + - CURLOPT_TIMEOUT_MS (3) +Protocol: + - All +Added-in: 7.16.2 --- # NAME @@ -25,18 +28,40 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CONNECTTIMEOUT_MS, # DESCRIPTION -Pass a long. It should contain the maximum time in milliseconds that you allow -the connection phase to the server to take. +Pass a long. It sets the maximum time in milliseconds that you allow the +connection phase to take. This timeout only limits the connection phase, it +has no impact once libcurl has connected. The connection phase includes the +name resolve (DNS) and all protocol handshakes and negotiations until there is +an established connection with the remote side. -See CURLOPT_CONNECTTIMEOUT(3) for details. +Set this option to zero to switch to the default built-in connection timeout - +300 seconds. See also the CURLOPT_TIMEOUT_MS(3) option. + +CURLOPT_CONNECTTIMEOUT(3) is the same function but set in seconds. + +If both CURLOPT_CONNECTTIMEOUT(3) and CURLOPT_CONNECTTIMEOUT_MS(3) are set, +the value set last is used. + +The connection timeout is included in the general all-covering +CURLOPT_TIMEOUT_MS(3): + +With CURLOPT_CONNECTTIMEOUT_MS(3) set to 3000 and CURLOPT_TIMEOUT_MS(3) set to +5000, the operation can never last longer than 5000 milliseconds, and the +connection phase cannot last longer than 3000 milliseconds. + +With CURLOPT_CONNECTTIMEOUT_MS(3) set to 4000 and CURLOPT_TIMEOUT_MS(3) set to +2000, the operation can never last longer than 2000 milliseconds. Including +the connection phase. + +This option may cause libcurl to use the SIGALRM signal to timeout system +calls on builds not using asynch DNS. In Unix-like systems, this might cause +signals to be used unless CURLOPT_NOSIGNAL(3) is set. # DEFAULT 300000 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -55,9 +80,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_ONLY.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_ONLY.md index ccb00fd2..7b2e713a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_ONLY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_ONLY.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_VERBOSE (3) - curl_easy_recv (3) - curl_easy_send (3) +Protocol: + - All +Added-in: 7.15.2 --- # NAME @@ -52,9 +55,7 @@ curl_easy_recv(3) do not function. 0 -# PROTOCOLS - -HTTP, SMTP, POP3 and IMAP. For WS and WSS starting in 7.86.0. +# %PROTOCOLS% # EXAMPLE @@ -68,15 +69,17 @@ int main(void) curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L); ret = curl_easy_perform(curl); if(ret == CURLE_OK) { - /* only connected! */ + /* only connected */ } } } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.15.2 +WS and WSS support added in 7.86.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_TO.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_TO.md index ed0db591..b4cc638a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_TO.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONNECT_TO.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTPPROXYTUNNEL (3) - CURLOPT_RESOLVE (3) - CURLOPT_URL (3) +Protocol: + - All +Added-in: 7.49.0 --- # NAME @@ -73,13 +76,14 @@ When this option is passed to curl_easy_setopt(3), libcurl does not copy the list so you **must** keep it around until you no longer use this *handle* for a transfer before you call curl_slist_free_all(3) on the list. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -105,9 +109,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.49.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.md index 46b935dd..6d233ef3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CONV_FROM_UTF8_FUNCTION (3) - CURLOPT_CONV_TO_NETWORK_FUNCTION (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME @@ -70,9 +73,7 @@ You need to override these definitions if they are different on your system. NULL -# PROTOCOLS - -FTP, SMTP, IMAP, POP3 +# %PROTOCOLS% # EXAMPLE @@ -102,13 +103,15 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Not available and deprecated since 7.82.0. Available only if **CURL_DOES_CONVERSIONS** was defined when libcurl was built. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md index 37abfc5b..9ea257f2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_CONV_FROM_UTF8_FUNCTION Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_CONV_FROM_NETWORK_FUNCTION (3) - CURLOPT_CONV_TO_NETWORK_FUNCTION (3) +Added-in: 7.15.4 --- # NAME @@ -67,9 +70,7 @@ You need to override these definitions if they are different on your system. NULL -# PROTOCOLS - -TLS-based protocols. +# %PROTOCOLS% # EXAMPLE @@ -95,13 +96,15 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Not available and deprecated since 7.82.0. Available only if **CURL_DOES_CONVERSIONS** was defined when libcurl was built. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.md index 97a8a6c1..8644885c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CONV_FROM_NETWORK_FUNCTION (3) - CURLOPT_CONV_FROM_UTF8_FUNCTION (3) +Protocol: + - All +Added-in: 7.15.4 --- # NAME @@ -69,9 +72,7 @@ You need to override these definitions if they are different on your system. NULL -# PROTOCOLS - -FTP, SMTP, IMAP, POP3 +# %PROTOCOLS% # EXAMPLE @@ -98,13 +99,15 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Not available and deprecated since 7.82.0. Available only if **CURL_DOES_CONVERSIONS** was defined when libcurl was built. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIE.md b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIE.md index 5d34072a..c16a5937 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIE.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_COOKIEJAR (3) - CURLOPT_COOKIELIST (3) - CURLOPT_HTTPHEADER (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -32,7 +35,8 @@ NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain. To set multiple cookies, set them all using a single option concatenated like -this: "name1=content1; name2=content2;" etc. +this: "name1=content1; name2=content2;" etc. libcurl does not syntax check the +data but assumes the application gives it what it needs to send. This option sets the cookie header explicitly in the outgoing request(s). If multiple requests are done due to authentication, followed redirections or @@ -40,36 +44,30 @@ similar, they all get this cookie passed on. The cookies set by this option are separate from the internal cookie storage held by the cookie engine and they are not be modified by it. If you enable -the cookie engine and either you have imported a cookie of the same name -(e.g. 'foo') or the server has set one, it has no effect on the cookies you -set here. A request to the server sends both the 'foo' held by the cookie -engine and the 'foo' held by this option. To set a cookie that is instead held -by the cookie engine and can be modified by the server use -CURLOPT_COOKIELIST(3). +the cookie engine and either you have imported a cookie of the same name (e.g. +'foo') or the server has set one, it has no effect on the cookies you set +here. A request to the server sends both the 'foo' held by the cookie engine +and the 'foo' held by this option. To set a cookie that is instead held by the +cookie engine and can be modified by the server use CURLOPT_COOKIELIST(3). -Using this option multiple times makes the last set string override the -previous ones. - -This option does not enable the cookie engine. Use CURLOPT_COOKIEFILE(3) -or CURLOPT_COOKIEJAR(3) to enable parsing and sending cookies -automatically. +Since this custom cookie is appended to the Cookie: header in addition to any +cookies set by the cookie engine, there is a risk that the header ends up too +long and thereby getting the entire request rejected by the server. The application does not have to keep the string around after setting this option. -If libcurl is built with PSL (*Public Suffix List*) support, it detects and -discards cookies that are specified for such suffix domains that should not be -allowed to have cookies. If libcurl is *not* built with PSL support, it has no -ability to stop super cookies. PSL support is identified by the -**CURL_VERSION_PSL** feature bit returned by curl_version_info(3). +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +This option does not enable the cookie engine. Use CURLOPT_COOKIEFILE(3) or +CURLOPT_COOKIEJAR(3) to enable parsing and sending cookies automatically. # DEFAULT NULL, no cookies -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -87,9 +85,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If HTTP is enabled +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEFILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEFILE.md index fa88c14d..7f607c73 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEFILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEFILE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_COOKIE (3) - CURLOPT_COOKIEJAR (3) - CURLOPT_COOKIESESSION (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -45,14 +48,12 @@ domain cannot match the target URL's. To address this, set a domain in Set-Cookie line (doing that includes subdomains) or preferably: use the Netscape format. -If you use this option multiple times, you add more files to read cookies -from. - The application does not have to keep the string around after setting this option. -Setting this option to NULL (since 7.77.0) explicitly disables the cookie -engine and clears the list of files to read cookies from. +If you use this option multiple times, you add more files to read cookies +from. Setting this option to NULL disables the cookie engine and clears the +list of files to read cookies from. # SECURITY @@ -65,9 +66,7 @@ run. NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -94,9 +93,7 @@ int main(void) The cookie file format and general cookie concepts in curl are described online here: https://curl.se/docs/http-cookies.html -# AVAILABILITY - -As long as HTTP is supported +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEJAR.md b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEJAR.md index 05196abc..f9c17e85 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEJAR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIEJAR.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_COOKIE (3) - CURLOPT_COOKIEFILE (3) - CURLOPT_COOKIELIST (3) +Protocol: + - HTTP +Added-in: 7.9 --- # NAME @@ -24,22 +27,21 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_COOKIEJAR, char *filename); # DESCRIPTION -Pass a *filename* as a char *, null-terminated. This makes libcurl write -all internally known cookies to the specified file when -curl_easy_cleanup(3) is called. If no cookies are kept in memory at that -time, no file is created. Specify "-" as filename to instead have the cookies -written to stdout. Using this option also enables cookies for this session, so -if you for example follow a redirect it makes matching cookies get sent -accordingly. +Pass a *filename* as a char *, null-terminated. This makes libcurl write all +internally known cookies to the specified file when curl_easy_cleanup(3) is +called. If no cookies are kept in memory at that time, no file is created. +Specify "-" as filename to instead have the cookies written to stdout. Using +this option also enables cookies for this session, so if you for example +follow a redirect it makes matching cookies get sent accordingly. Note that libcurl does not read any cookies from the cookie jar specified with this option. To read cookies from a file, use CURLOPT_COOKIEFILE(3). If the cookie jar file cannot be created or written to (when the -curl_easy_cleanup(3) is called), libcurl does not and cannot report an -error for this. Using CURLOPT_VERBOSE(3) or -CURLOPT_DEBUGFUNCTION(3) displays a warning, but that is the only -visible feedback you get about this possibly lethal situation. +curl_easy_cleanup(3) is called), libcurl does not and cannot report an error +for this. Using CURLOPT_VERBOSE(3) or CURLOPT_DEBUGFUNCTION(3) displays a +warning, but that is the only visible feedback you get about this possibly +lethal situation. Cookies are imported in the Set-Cookie format without a domain name are not exported by this option. @@ -47,13 +49,14 @@ exported by this option. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -70,15 +73,13 @@ int main(void) res = curl_easy_perform(curl); - /* close the handle, write the cookies! */ + /* close the handle, write the cookies */ curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIELIST.md b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIELIST.md index 31fb8d24..d7a6c0b1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIELIST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIELIST.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_COOKIE (3) - CURLOPT_COOKIEFILE (3) - CURLOPT_COOKIEJAR (3) +Protocol: + - HTTP +Added-in: 7.14.1 --- # NAME @@ -67,9 +70,7 @@ loads all cookies from the files specified by CURLOPT_COOKIEFILE(3) NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -120,7 +121,7 @@ int main(void) The cookie file format and general cookie concepts in curl are described online here: https://curl.se/docs/http-cookies.html -# AVAILABILITY +# HISTORY **ALL** was added in 7.14.1 @@ -130,6 +131,8 @@ online here: https://curl.se/docs/http-cookies.html **RELOAD** was added in 7.39.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIESESSION.md b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIESESSION.md index 33c8a2f5..19b9a301 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_COOKIESESSION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_COOKIESESSION.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_COOKIE (3) - CURLOPT_COOKIEFILE (3) - CURLOPT_COOKIEJAR (3) +Protocol: + - HTTP +Added-in: 7.9.7 --- # NAME @@ -39,9 +42,7 @@ the same session. 0 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md b/deps/curl/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md index 430c5354..a014458c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_POSTFIELDS (3) - CURLOPT_POSTFIELDSIZE (3) - CURLOPT_UPLOAD (3) +Protocol: + - HTTP +Added-in: 7.17.1 --- # NAME @@ -30,22 +33,25 @@ HTTP POST operation. It behaves as the CURLOPT_POSTFIELDS(3) option, but the original data is instead copied by the library, allowing the application to overwrite the original data after setting this option. -Because data are copied, care must be taken when using this option in -conjunction with CURLOPT_POSTFIELDSIZE(3) or -CURLOPT_POSTFIELDSIZE_LARGE(3): If the size has not been set prior to -CURLOPT_COPYPOSTFIELDS(3), the data is assumed to be a null-terminated -string; else the stored size informs the library about the byte count to -copy. In any case, the size must not be changed after -CURLOPT_COPYPOSTFIELDS(3), unless another CURLOPT_POSTFIELDS(3) or -CURLOPT_COPYPOSTFIELDS(3) option is issued. +Because data is copied, care must be taken when using this option in +conjunction with CURLOPT_POSTFIELDSIZE(3) or CURLOPT_POSTFIELDSIZE_LARGE(3). +If the size has not been set prior to CURLOPT_COPYPOSTFIELDS(3), the data is +assumed to be a null-terminated string; else the stored size informs the +library about the byte count to copy. In any case, the size must not be +changed after CURLOPT_COPYPOSTFIELDS(3), unless another CURLOPT_POSTFIELDS(3) +or CURLOPT_COPYPOSTFIELDS(3) option is set. + +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. # DEFAULT NULL -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -68,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.17.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CRLF.md b/deps/curl/docs/libcurl/opts/CURLOPT_CRLF.md index b712902c..8c0c9a59 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CRLF.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CRLF.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_CONV_FROM_NETWORK_FUNCTION (3) - CURLOPT_CONV_TO_NETWORK_FUNCTION (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -33,9 +36,7 @@ This is a legacy option of questionable use. 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -53,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -SMTP since 7.40.0, other protocols since they were introduced +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CRLFILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_CRLFILE.md index 486383bf..f0bea282 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CRLFILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CRLFILE.md @@ -8,6 +8,14 @@ See-also: - CURLOPT_PROXY_CRLFILE (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - GnuTLS + - mbedTLS + - OpenSSL + - rustls +Added-in: 7.19.0 --- # NAME @@ -41,20 +49,21 @@ This option makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER(3) option. A specific error code (*CURLE_SSL_CRL_BADFILE*) is defined with the option. It -is returned when the SSL exchange fails because the CRL file cannot be -loaded. A failure in certificate verification due to a revocation information -found in the CRL does not trigger this specific error. +is returned when the SSL exchange fails because the CRL file cannot be loaded. +A failure in certificate verification due to a revocation information found in +the CRL does not trigger this specific error. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -72,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CURLU.md b/deps/curl/docs/libcurl/opts/CURLOPT_CURLU.md index 53146baf..f9a3020b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CURLU.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CURLU.md @@ -12,6 +12,9 @@ See-also: - curl_url_get (3) - curl_url_set (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: 7.63.0 --- # NAME @@ -42,11 +45,9 @@ updated contents is used. # DEFAULT -The default value of this parameter is NULL. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -70,9 +71,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.63.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_CUSTOMREQUEST.md b/deps/curl/docs/libcurl/opts/CURLOPT_CUSTOMREQUEST.md index eda31d1e..886f27ce 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_CUSTOMREQUEST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_CUSTOMREQUEST.md @@ -9,6 +9,13 @@ See-also: - CURLOPT_HTTPHEADER (3) - CURLOPT_NOBODY (3) - CURLOPT_REQUEST_TARGET (3) +Protocol: + - HTTP + - FTP + - IMAP + - POP3 + - SMTP +Added-in: 7.1 --- # NAME @@ -27,14 +34,18 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CUSTOMREQUEST, char *method); Pass a pointer to a null-terminated string as parameter. -When changing the request *method* by setting CURLOPT_CUSTOMREQUEST(3), you -do not actually change how libcurl behaves or acts: you only change the actual +When changing the request *method* by setting CURLOPT_CUSTOMREQUEST(3), you do +not actually change how libcurl behaves or acts: you only change the actual string sent in the request. libcurl passes on the verbatim string in its request without any filter or other safe guards. That includes white space and control characters. -Restore to the internal default by setting this to NULL. +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Restore to the internal default by setting this to NULL. This option can be used to specify the request: @@ -89,16 +100,11 @@ with CURLOPT_MAIL_RCPT(3), to specify an EXPN request. If the CURLOPT_NOBODY(3) option is specified then the request can be used to issue **NOOP** and **RSET** commands. -The application does not have to keep the string around after setting this -option. - # DEFAULT NULL -# PROTOCOLS - -HTTP, FTP, IMAP, POP3 and SMTP +# %PROTOCOLS% # EXAMPLE @@ -120,9 +126,7 @@ int main(void) } ~~~ -# AVAILABILITY - -IMAP is supported since 7.30.0, POP3 since 7.26.0 and SMTP since 7.34.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGDATA.md index ac924f79..3df122d6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_STDERR (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -31,9 +34,7 @@ not used by libcurl, it is only passed to the callback. NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -77,9 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md index 58eba18d..4887f627 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_DEBUGDATA (3) - CURLOPT_VERBOSE (3) - curl_global_trace (3) +Protocol: + - All +Added-in: 7.9.6 --- # NAME @@ -89,19 +92,19 @@ The data is SSL/TLS (binary) data sent to the peer. The data is SSL/TLS (binary) data received from the peer. -WARNING: This callback may be called with the curl *handle* set to an -internal handle. (Added in 8.4.0) +## -If you need to distinguish your curl *handle* from internal handles then -set CURLOPT_PRIVATE(3) on your handle. +WARNING: This callback may be called with the curl *handle* set to an internal +handle. (Added in 8.4.0) + +If you need to distinguish your curl *handle* from internal handles then set +CURLOPT_PRIVATE(3) on your handle. # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -207,9 +210,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DEFAULT_PROTOCOL.md b/deps/curl/docs/libcurl/opts/CURLOPT_DEFAULT_PROTOCOL.md index 1ef732b6..9f85c6af 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DEFAULT_PROTOCOL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DEFAULT_PROTOCOL.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_PROTOCOL (3) - CURLINFO_SCHEME (3) - CURLOPT_URL (3) +Protocol: + - All +Added-in: 7.45.0 --- # NAME @@ -34,12 +37,12 @@ Use one of these protocol (scheme) names: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp -An unknown or unsupported protocol causes error -*CURLE_UNSUPPORTED_PROTOCOL* when libcurl parses a URL without a -scheme. Parsing happens when curl_easy_perform(3) or -curl_multi_perform(3) is called. The protocol set supported by libcurl -vary depending on how it was built. Use curl_version_info(3) if you need -a list of protocol names supported by the build of libcurl that you are using. +An unknown or unsupported protocol causes error *CURLE_UNSUPPORTED_PROTOCOL* +when libcurl parses a URL without a scheme. Parsing happens when +curl_easy_perform(3) or curl_multi_perform(3) is called. The protocol set +supported by libcurl vary depending on how it was built. Use +curl_version_info(3) if you need a list of protocol names supported by the +build of libcurl that you are using. This option does not change the default proxy protocol (http). @@ -49,13 +52,14 @@ CURLOPT_URL(3) for details. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL (make a guess based on the host) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -76,9 +80,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.45.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DIRLISTONLY.md b/deps/curl/docs/libcurl/opts/CURLOPT_DIRLISTONLY.md index abeb6473..1c5ee14c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DIRLISTONLY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DIRLISTONLY.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_CUSTOMREQUEST (3) - CURLOPT_WILDCARDMATCH (3) +Protocol: + - FTP + - SFTP + - POP3 +Added-in: 7.17.0 --- # NAME @@ -32,6 +37,9 @@ messages on the POP3 server. This can be used to change the default behavior of libcurl, when combined with a URL that contains a message ID, to perform a "scan listing" which can then be used to determine the size of an email. +For FILE, this option has no effect yet as directories are always listed in +this mode. + Note: For FTP this causes a NLST command to be sent to the FTP server. Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links. @@ -46,9 +54,7 @@ effectively breaks that feature. 0, disabled -# PROTOCOLS - -FTP, SFTP and POP3 +# %PROTOCOLS% # EXAMPLE @@ -70,11 +76,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY This option was known as CURLOPT_FTPLISTONLY up to 7.16.4. POP3 is supported since 7.21.5. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DISALLOW_USERNAME_IN_URL.md b/deps/curl/docs/libcurl/opts/CURLOPT_DISALLOW_USERNAME_IN_URL.md index ee06610e..66a5948b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DISALLOW_USERNAME_IN_URL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DISALLOW_USERNAME_IN_URL.md @@ -5,10 +5,13 @@ Title: CURLOPT_DISALLOW_USERNAME_IN_URL Section: 3 Source: libcurl See-also: - - CURLOPT_PROTOCOLS (3) + - CURLOPT_PROTOCOLS_STR (3) - CURLOPT_URL (3) - curl_url_set (3) - libcurl-security (3) +Protocol: + - All +Added-in: 7.61.0 --- # NAME @@ -34,11 +37,9 @@ curl_url_set(3) function. # DEFAULT -0 (disabled) - usernames are allowed by default. +0 (disabled) -# PROTOCOLS - -Several +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.61.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.md index 274dae6b..6ae904d6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_DNS_USE_GLOBAL_CACHE (3) - CURLOPT_MAXAGE_CONN (3) - CURLOPT_RESOLVE (3) +Protocol: + - All +Added-in: 7.9.3 --- # NAME @@ -52,9 +55,7 @@ Since version 8.1.0, libcurl prunes entries from the DNS cache if it exceeds 60 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -80,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_INTERFACE.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_INTERFACE.md index f985adcc..5e58e0fd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_INTERFACE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_INTERFACE.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_DNS_LOCAL_IP6 (3) - CURLOPT_DNS_SERVERS (3) - CURLOPT_INTERFACE (3) +Protocol: + - All +Added-in: 7.33.0 --- # NAME @@ -33,13 +36,14 @@ specific interface). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All protocols except file:// - protocols that resolve hostnames. +# %PROTOCOLS% # EXAMPLE @@ -57,11 +61,12 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES -Added in 7.33.0. This option also requires that libcurl was built with a -resolver backend that supports this operation. The c-ares backend is the only -such one. +This option requires that libcurl was built with a resolver backend that +supports this operation. The c-ares backend is the only such one. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP4.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP4.md index 2e6bf632..046ddbcd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP4.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP4.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DNS_INTERFACE (3) - CURLOPT_DNS_LOCAL_IP6 (3) - CURLOPT_DNS_SERVERS (3) +Protocol: + - All +Added-in: 7.33.0 --- # NAME @@ -32,13 +35,14 @@ specific IP address). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,12 +60,12 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. -Added in 7.33.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP6.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP6.md index babaf254..e820ab11 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP6.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_LOCAL_IP6.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DNS_INTERFACE (3) - CURLOPT_DNS_LOCAL_IP4 (3) - CURLOPT_DNS_SERVERS (3) +Protocol: + - All +Added-in: 7.33.0 --- # NAME @@ -32,13 +35,14 @@ address). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,12 +60,12 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. -Added in 7.33.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SERVERS.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SERVERS.md index 89281730..48a33523 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SERVERS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SERVERS.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DNS_CACHE_TIMEOUT (3) - CURLOPT_DNS_LOCAL_IP4 (3) - CURLOPT_DNS_LOCAL_IP6 (3) +Protocol: + - All +Added-in: 7.24.0 --- # NAME @@ -27,22 +30,23 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_SERVERS, char *servers); Pass a char pointer that is the list of DNS servers to be used instead of the system default. The format of the dns servers option is: -host[:port][,host[:port]]... + host[:port][,host[:port]]... For example: -192.168.1.100,192.168.1.101,3.4.5.6 + 192.168.1.100,192.168.1.101,3.4.5.6 The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -NULL - use system default +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,12 +65,12 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES This option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. -Added in 7.24.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SHUFFLE_ADDRESSES.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SHUFFLE_ADDRESSES.md index 4224a592..2074fff8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SHUFFLE_ADDRESSES.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_SHUFFLE_ADDRESSES.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_DNS_CACHE_TIMEOUT (3) - CURLOPT_IPRESOLVE (3) +Protocol: + - All +Added-in: 7.60.0 --- # NAME @@ -44,9 +47,7 @@ performance impacts and may cause IPv4 to be used before IPv6 or vice versa. 0 (disabled) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.60.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_USE_GLOBAL_CACHE.md b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_USE_GLOBAL_CACHE.md index 7b319378..20670db0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DNS_USE_GLOBAL_CACHE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DNS_USE_GLOBAL_CACHE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_DNS_CACHE_TIMEOUT (3) - CURLOPT_SHARE (3) +Protocol: + - All +Added-in: 7.9.3 --- # NAME @@ -24,22 +27,20 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_USE_GLOBAL_CACHE, # DESCRIPTION -Has no function since 7.62.0. Do not use! +Has no function since 7.62.0. Do not use. Pass a long. If the *enable* value is 1, it tells curl to use a global DNS cache that survives between easy handle creations and deletions. This is not thread-safe and this uses a global variable. -See CURLOPT_SHARE(3) and curl_share_init(3) for the correct way to -share DNS cache between transfers. +See CURLOPT_SHARE(3) and curl_share_init(3) for the correct way to share DNS +cache between transfers. # DEFAULT 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,11 @@ int main(void) ~~~ -# AVAILABILITY +# DEPRECATED -Deprecated since 7.11.1. Function removed in 7.62.0. +Deprecated since 7.11.1. Functionality removed in 7.62.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYHOST.md b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYHOST.md index ed003772..95227616 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYHOST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYHOST.md @@ -10,6 +10,11 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.76.0 --- # NAME @@ -46,7 +51,7 @@ for consistency with the other *VERIFYHOST* options we suggest use 2 and not 1. When the *verify* value is set to 0L, the connection succeeds regardless of -the names used in the certificate. Use that ability with caution! +the names used in the certificate. Use that ability with caution. See also CURLOPT_DOH_SSL_VERIFYPEER(3) to verify the digital signature of the DoH server certificate. @@ -55,9 +60,7 @@ of the DoH server certificate. 2 -# PROTOCOLS - -DoH +# %PROTOCOLS% # EXAMPLE @@ -79,11 +82,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.76.0 - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYPEER.md b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYPEER.md index 39caf195..e8674e06 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYPEER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYPEER.md @@ -12,6 +12,11 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.76.0 --- # NAME @@ -67,9 +72,7 @@ the correct end-point. 1 -# PROTOCOLS - -DoH +# %PROTOCOLS% # EXAMPLE @@ -91,11 +94,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.76.0 - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYSTATUS.md b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYSTATUS.md index ccc7b5d3..fb861ae7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYSTATUS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_SSL_VERIFYSTATUS.md @@ -8,6 +8,12 @@ See-also: - CURLOPT_DOH_SSL_VERIFYHOST (3) - CURLOPT_DOH_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYSTATUS (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.76.0 --- # NAME @@ -41,9 +47,7 @@ the verification fails. 0 -# PROTOCOLS - -DoH +# %PROTOCOLS% # EXAMPLE @@ -65,10 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.76.0. This option is currently only supported by the OpenSSL, and -GnuTLS TLS backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_URL.md b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_URL.md index 22a6c7af..cf7a04e1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_DOH_URL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_DOH_URL.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DNS_CACHE_TIMEOUT (3) - CURLOPT_RESOLVE (3) - CURLOPT_VERBOSE (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -38,7 +41,11 @@ To find the DoH server itself, which might be specified using a name, libcurl uses the default name lookup function. You can bootstrap that by providing the address for the DoH server with CURLOPT_RESOLVE(3). -Disable DoH use again by setting this option to NULL. +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. # INHERIT OPTIONS @@ -61,12 +68,9 @@ CURLOPT_FTPPORT(3), a proxy type set to **CURLPROXY_SOCKS4** or # DEFAULT -NULL - there is no default DoH URL. If this option is not set, libcurl uses -the default name resolver. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -82,9 +86,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ECH.md b/deps/curl/docs/libcurl/opts/CURLOPT_ECH.md new file mode 100644 index 00000000..b8251fe1 --- /dev/null +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ECH.md @@ -0,0 +1,108 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Title: CURLOPT_ECH +Section: 3 +Source: libcurl +See-also: + - CURLOPT_DOH_URL (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - wolfSSL +Added-in: 8.8.0 +--- + +# NAME + +CURLOPT_ECH - configuration for Encrypted Client Hello + +# SYNOPSIS + +~~~c +#include + +CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ECH, char *config); +~~~ + +# DESCRIPTION + +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 and wolfSSL releases. + +There is also a known issue with using wolfSSL which does not support ECH when +the HelloRetryRequest mechanism is used. + +Pass a string that specifies configuration details for ECH. In all cases, if +ECH is attempted, it may fail for various reasons. The keywords supported are: + +## false + +Turns off ECH. + +## grease + +Instructs client to emit a GREASE ECH extension. (The connection fails if ECH +is attempted but fails.) + +## true + +Instructs client to attempt ECH, if possible, but to not fail if attempting +ECH is not possible. + +## hard + +Instructs client to attempt ECH and fail if attempting ECH is not possible. + +## ecl:\ + +If the string starts with `ecl:` then the remainder of the string should be a +base64-encoded ECHConfigList that is used for ECH rather than attempting to +download such a value from the DNS. + +## pn:\ + +If the string starts with `pn:` then the remainder of the string should be a +DNS/hostname that is used to over-ride the public_name field of the +ECHConfigList that is used for ECH. + +## + +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL or "false" to disable its use again. + +# DEFAULT + +NULL, meaning ECH is disabled. + +# %PROTOCOLS% + +# EXAMPLE + +~~~c +int main(void) +{ + CURL *curl = curl_easy_init(); + + const char *config = \ + "ecl:AED+DQA87wAgACB/RuzUCsW3uBbSFI7mzD63TUXpI8sGDTnFTbFCDpa+" \ + "CAAEAAEAAQANY292ZXIuZGVmby5pZQAA"; + if(curl) { + curl_easy_setopt(curl, CURLOPT_ECH, config); + curl_easy_perform(curl); + } +} +~~~ +# %AVAILABILITY% + +# RETURN VALUE + +Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient +heap space. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_EGDSOCKET.md b/deps/curl/docs/libcurl/opts/CURLOPT_EGDSOCKET.md index d4ab6c61..05fb76ed 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_EGDSOCKET.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_EGDSOCKET.md @@ -6,6 +6,11 @@ Section: 3 Source: libcurl See-also: - CURLOPT_RANDOM_FILE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.7 --- # NAME @@ -24,44 +29,16 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_EGDSOCKET, char *path); Deprecated option. It serves no purpose anymore. -Pass a char pointer to the null-terminated path name to the Entropy Gathering -Daemon socket. It is used to seed the random engine for TLS. - -The application does not have to keep the string around after setting this -option. - # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. - -# EXAMPLE - -~~~c -int main(void) -{ - CURL *curl = curl_easy_init(); - if(curl) { - CURLcode res; - curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_EGDSOCKET, "/var/egd.socket"); - res = curl_easy_perform(curl); - curl_easy_cleanup(curl); - } -} -~~~ - -# AVAILABILITY - -If built with TLS enabled. Only the OpenSSL backend uses this, and only with -OpenSSL versions before 1.1.0. +# DEPRECATED This option was deprecated in 7.84.0. +# %AVAILABILITY% + # RETURN VALUE -Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or -CURLE_OUT_OF_MEMORY if there was insufficient heap space. +Returns CURLE_OK. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ERRORBUFFER.md b/deps/curl/docs/libcurl/opts/CURLOPT_ERRORBUFFER.md index 8caeec8b..edac39b9 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ERRORBUFFER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ERRORBUFFER.md @@ -11,6 +11,9 @@ See-also: - curl_multi_strerror (3) - curl_share_strerror (3) - curl_url_strerror (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -34,24 +37,25 @@ be at least **CURL_ERROR_SIZE** bytes big. You must keep the associated buffer available until libcurl no longer needs it. Failing to do so might cause odd behavior or even crashes. libcurl might -need it until you call curl_easy_cleanup(3) or you set the same option -again to use a different pointer. +need it until you call curl_easy_cleanup(3) or you set the same option again +to use a different pointer. Do not rely on the contents of the buffer unless an error code was returned. Since 7.60.0 libcurl initializes the contents of the error buffer to an empty string before performing the transfer. For earlier versions if an error code was returned but there was no error detail then the buffer was untouched. -Consider CURLOPT_VERBOSE(3) and CURLOPT_DEBUGFUNCTION(3) to better -debug and trace why errors happen. +Consider CURLOPT_VERBOSE(3) and CURLOPT_DEBUGFUNCTION(3) to better debug and +trace why errors happen. + +Using this option multiple times makes the last set pointer override the +previous ones. Set it to NULL to disable its use again. # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -92,9 +96,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_EXPECT_100_TIMEOUT_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_EXPECT_100_TIMEOUT_MS.md index 41cc59a8..45997dcc 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_EXPECT_100_TIMEOUT_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_EXPECT_100_TIMEOUT_MS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_HTTPPOST (3) - CURLOPT_POST (3) +Protocol: + - HTTP +Added-in: 7.36.0 --- # NAME @@ -34,9 +37,7 @@ sent anyway. 1000 milliseconds -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -55,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.36.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FAILONERROR.md b/deps/curl/docs/libcurl/opts/CURLOPT_FAILONERROR.md index 894a5b46..d865b637 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FAILONERROR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FAILONERROR.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RESPONSE_CODE (3) - CURLOPT_HTTP200ALIASES (3) - CURLOPT_KEEP_SENDING_ON_ERROR (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -43,9 +46,7 @@ get closed and *CURLE_HTTP_RETURNED_ERROR* is returned. 0, do not fail on error -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -65,9 +66,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FILETIME.md b/deps/curl/docs/libcurl/opts/CURLOPT_FILETIME.md index 340f584d..bca79ab9 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FILETIME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FILETIME.md @@ -7,6 +7,13 @@ Source: libcurl See-also: - CURLINFO_FILETIME (3) - curl_easy_getinfo (3) +Protocol: + - HTTP + - FTP + - SFTP + - FILE + - SMB +Added-in: 7.5 --- # NAME @@ -33,9 +40,7 @@ transfer to extract the received time (if any). 0 -# PROTOCOLS - -HTTP(S), FTP(S), SFTP, FILE, SMB(S) +# %PROTOCOLS% # EXAMPLE @@ -63,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always, for SFTP since 7.49.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_DATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_DATA.md index d56b9922..866333f1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_DATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_DATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_FNMATCH_FUNCTION (3) - CURLOPT_WILDCARDMATCH (3) +Protocol: + - FTP +Added-in: 7.21.0 --- # NAME @@ -31,9 +34,7 @@ the CURLOPT_FNMATCH_FUNCTION(3). NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -71,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_FUNCTION.md index 5f087d7c..f9ff1d3b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FNMATCH_FUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_FNMATCH_DATA (3) - CURLOPT_WILDCARDMATCH (3) +Protocol: + - FTP +Added-in: 7.21.0 --- # NAME @@ -42,9 +45,7 @@ error occurred. NULL == an internal function for wildcard matching. -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -79,9 +80,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md b/deps/curl/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md index af3ddbec..4bd02eea 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FOLLOWLOCATION.md @@ -8,8 +8,12 @@ See-also: - CURLINFO_REDIRECT_COUNT (3) - CURLINFO_REDIRECT_URL (3) - CURLOPT_POSTREDIR (3) - - CURLOPT_PROTOCOLS (3) - - CURLOPT_REDIR_PROTOCOLS (3) + - CURLOPT_PROTOCOLS_STR (3) + - CURLOPT_REDIR_PROTOCOLS_STR (3) + - CURLOPT_UNRESTRICTED_AUTH (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -31,41 +35,48 @@ redirects that an HTTP server sends in a 30x response. The Location: header can specify a relative or an absolute URL to follow. libcurl issues another request for the new URL and follows subsequent new -Location: redirects all the way until no more such headers are returned or the -maximum limit is reached. CURLOPT_MAXREDIRS(3) is used to limit the -number of redirects libcurl follows. +`Location:` redirects all the way until no more such headers are returned or +the maximum limit is reached. CURLOPT_MAXREDIRS(3) is used to limit the number +of redirects libcurl follows. libcurl restricts what protocols it automatically follow redirects to. The -accepted target protocols are set with CURLOPT_REDIR_PROTOCOLS(3). By +accepted target protocols are set with CURLOPT_REDIR_PROTOCOLS_STR(3). By default libcurl allows HTTP, HTTPS, FTP and FTPS on redirects. When following a redirect, the specific 30x response code also dictates which request method libcurl uses in the subsequent request: For 301, 302 and 303 -responses libcurl switches method from POST to GET unless -CURLOPT_POSTREDIR(3) instructs libcurl otherwise. All other redirect -response codes make libcurl use the same method again. +responses libcurl switches method from POST to GET unless CURLOPT_POSTREDIR(3) +instructs libcurl otherwise. All other redirect response codes make libcurl +use the same method again. For users who think the existing location following is too naive, too simple 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). +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:` +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. + +Due to the way HTTP works, almost any header can be made to contain data a +client may not want to pass on to other servers than the initially intended +host and for all other headers than the two mentioned above, there is no +protection from this happening when libcurl is told to follow redirects. # NOTE Since libcurl changes method or not based on the specific HTTP response code, -setting CURLOPT_CUSTOMREQUEST(3) while following redirects may change -what libcurl would otherwise do and if not that carefully may even make it -misbehave since CURLOPT_CUSTOMREQUEST(3) overrides the method libcurl -would otherwise select internally. +setting CURLOPT_CUSTOMREQUEST(3) while following redirects may change what +libcurl would otherwise do and if not that carefully may even make it +misbehave since CURLOPT_CUSTOMREQUEST(3) overrides the method libcurl would +otherwise select internally. # DEFAULT 0, disabled -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -84,9 +95,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FORBID_REUSE.md b/deps/curl/docs/libcurl/opts/CURLOPT_FORBID_REUSE.md index a266863e..2f452ff5 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FORBID_REUSE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FORBID_REUSE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_FRESH_CONNECT (3) - CURLOPT_MAXCONNECTS (3) - CURLOPT_MAXLIFETIME_CONN (3) +Protocol: + - All +Added-in: 7.7 --- # NAME @@ -37,9 +40,7 @@ Set to 0 to have libcurl keep the connection open for possible later reuse 0 -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FRESH_CONNECT.md b/deps/curl/docs/libcurl/opts/CURLOPT_FRESH_CONNECT.md index aaadf345..f64c6adc 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FRESH_CONNECT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FRESH_CONNECT.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_FRESH_CONNECT Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_FORBID_REUSE (3) - CURLOPT_MAXAGE_CONN (3) - CURLOPT_MAXLIFETIME_CONN (3) +Added-in: 7.7 --- # NAME @@ -39,9 +42,7 @@ Set *fresh* to 0 to have libcurl attempt reusing an existing connection 0 -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTPPORT.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTPPORT.md index fac0ebd1..7f82b179 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTPPORT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTPPORT.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTPPORT Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTP_USE_EPRT (3) - CURLOPT_FTP_USE_EPSV (3) +Added-in: 7.1 --- # NAME @@ -43,12 +46,10 @@ specifier can be in brackets. Examples with specified ports: -~~~c - eth0:0 - 192.168.1.2:32000-33000 - curl.se:32123 - [::1]:1234-4567 -~~~ + eth0:0 + 192.168.1.2:32000-33000 + curl.se:32123 + [::1]:1234-4567 We strongly advise against specifying the address with a name, as it causes libcurl to do a blocking name resolve call to retrieve the IP address. That @@ -58,19 +59,18 @@ CURLOPT_DOH_URL(3) is set. Using anything else than "-" for this option should typically only be done if you have special knowledge and confirmation that it works. -You disable PORT again and go back to using the passive version by setting -this option to NULL. - The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. You disable PORT again and go back to using the passive version +by setting this option to NULL. + # DEFAULT NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -89,9 +89,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Port range support was added in 7.19.5 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md index 6097d43d..5e1300dd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTPSSLAUTH Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTP_SSL_CCC (3) - CURLOPT_USE_SSL (3) +Added-in: 7.12.2 --- # NAME @@ -45,9 +48,7 @@ Try "AUTH TLS" first, and only if that fails try "AUTH SSL". CURLFTPAUTH_DEFAULT -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -67,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.12.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ACCOUNT.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ACCOUNT.md index 70061f0d..aae893d3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ACCOUNT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ACCOUNT.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_ACCOUNT Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_PASSWORD (3) - CURLOPT_USERNAME (3) +Added-in: 7.13.0 --- # NAME @@ -30,13 +33,14 @@ this data is sent off using the ACCT command. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -57,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.13.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ALTERNATIVE_TO_USER.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ALTERNATIVE_TO_USER.md index a24b5326..54fd80b6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ALTERNATIVE_TO_USER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_ALTERNATIVE_TO_USER.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_ALTERNATIVE_TO_USER Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTP_ACCOUNT (3) - CURLOPT_FTP_SKIP_PASV_IP (3) - CURLOPT_SERVER_RESPONSE_TIMEOUT (3) - CURLOPT_USERNAME (3) +Added-in: 7.15.5 --- # NAME @@ -39,9 +42,7 @@ option. NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.5 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md index 891feb18..f428243c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_CREATE_MISSING_DIRS Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTP_FILEMETHOD (3) - CURLOPT_FTP_USE_EPSV (3) +Added-in: 7.10.7 --- # NAME @@ -47,15 +50,13 @@ retry the CWD command again if the subsequent **MKD** command fails. This is especially useful if you are doing many simultaneous connections against the same server and they all have this option enabled, as then CWD may first fail but then another connection does **MKD** before this connection and thus -**MKD** fails but trying CWD works! +**MKD** fails but trying CWD works. # DEFAULT CURLFTP_CREATE_DIR_NONE (0) -# PROTOCOLS - -FTP and SFTP +# %PROTOCOLS% # EXAMPLE @@ -77,10 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.7. SFTP support added in 7.16.3. The retry option was added in -7.19.4. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md index 31c4cfb1..342f72f7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_FILEMETHOD Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_DIRLISTONLY (3) - CURLOPT_FTP_SKIP_PASV_IP (3) +Added-in: 7.15.1 --- # NAME @@ -54,9 +57,7 @@ compliant than 'nocwd' but without the full penalty of 'multicwd'. CURLFTPMETHOD_MULTICWD -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -77,9 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SKIP_PASV_IP.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SKIP_PASV_IP.md index 5d8e8cec..65f88192 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SKIP_PASV_IP.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SKIP_PASV_IP.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_SKIP_PASV_IP Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTPPORT (3) - CURLOPT_FTP_USE_EPRT (3) +Added-in: 7.15.0 --- # NAME @@ -40,9 +43,7 @@ This option has no effect if PORT, EPRT or EPSV is used instead of PASV. 1 since 7.74.0, was 0 before then. -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.14.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md index ea23e596..ccccc8c2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_SSL_CCC Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTPSSLAUTH (3) - CURLOPT_PROTOCOLS_STR (3) - CURLOPT_USE_SSL (3) +Added-in: 7.16.1 --- # NAME @@ -47,9 +50,7 @@ Initiate the shutdown and wait for a reply. CURLFTPSSL_CCC_NONE -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -69,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPRT.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPRT.md index a823e4d8..c651fe94 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPRT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPRT.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_USE_EPRT Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTPPORT (3) - CURLOPT_FTP_USE_EPSV (3) +Added-in: 7.10.5 --- # NAME @@ -39,7 +42,7 @@ then. # DEFAULT -# PROTOCOLS +# %PROTOCOLS% # EXAMPLE @@ -64,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.5 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPSV.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPSV.md index 9ac30fe7..8b8051fd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPSV.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_EPSV.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_FTP_USE_EPSV Section: 3 Source: libcurl +Protocol: + - FTP See-also: - CURLOPT_FTPPORT (3) - CURLOPT_FTP_USE_EPRT (3) +Added-in: 7.9.2 --- # NAME @@ -39,9 +42,7 @@ If the server is an IPv6 host, this option has no effect. 1 -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with FTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_PRET.md b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_PRET.md index a43cf10a..d50be758 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_PRET.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_FTP_USE_PRET.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_FTP_USE_EPRT (3) - CURLOPT_FTP_USE_EPSV (3) +Protocol: + - FTP +Added-in: 7.20.0 --- # NAME @@ -32,9 +35,7 @@ no effect when using the active FTP transfers mode. 0 -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -47,7 +48,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt"); - /* a drftpd server, do it! */ + /* a drftpd server, do it */ curl_easy_setopt(curl, CURLOPT_FTP_USE_PRET, 1L); res = curl_easy_perform(curl); @@ -57,9 +58,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md b/deps/curl/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md index 29245bd7..e60b503b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_GSSAPI_DELEGATION Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HTTPAUTH (3) - CURLOPT_PROXYAUTH (3) +Added-in: 7.22.0 --- # NAME @@ -35,9 +38,7 @@ available at compile-time. CURLGSSAPI_DELEGATION_NONE -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.22.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.md index 87b1dee8..f13abddb 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_CONNECTTIMEOUT_MS (3) - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TIMEOUT (3) +Added-in: 7.59.0 --- # NAME @@ -40,9 +43,7 @@ currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms. CURL_HET_DEFAULT (currently defined as 200L) -# PROTOCOLS - -All except FILE +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.59.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXYPROTOCOL.md b/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXYPROTOCOL.md index 7fe1647c..99e7fce5 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXYPROTOCOL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXYPROTOCOL.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_PROXY (3) +Protocol: + - All +Added-in: 7.60.0 --- # NAME @@ -36,9 +39,7 @@ Most applications do not need this option. 0, do not send any HAProxy PROXY protocol header -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -55,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP. Added in 7.60.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXY_CLIENT_IP.md b/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXY_CLIENT_IP.md index 19f3cca2..fb0f0ec5 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXY_CLIENT_IP.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HAPROXY_CLIENT_IP.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_HAPROXY_CLIENT_IP Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_HAPROXYPROTOCOL (3) - CURLOPT_PROXY (3) +Added-in: 8.2.0 --- # NAME @@ -28,16 +31,20 @@ When this parameter is set to a valid IPv4 or IPv6 numerical address, the library sends this address as client address in the HAProxy PROXY protocol v1 header at beginning of the connection. -This option is an alternative to CURLOPT_HAPROXYPROTOCOL(3) as that one -cannot use a specified address. +This option is an alternative to CURLOPT_HAPROXYPROTOCOL(3) as that one cannot +use a specified address. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +The application does not have to keep the string around after setting this +option. # DEFAULT NULL, no HAProxy header is sent -# PROTOCOLS - -HTTP, HAProxy PROTOCOL +# %PROTOCOLS% # EXAMPLE @@ -54,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP. Added in 8.2.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HEADER.md b/deps/curl/docs/libcurl/opts/CURLOPT_HEADER.md index ed3d8879..fd81b37c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HEADER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HEADER.md @@ -4,9 +4,16 @@ SPDX-License-Identifier: curl Title: CURLOPT_HEADER Section: 3 Source: libcurl +Protocol: + - HTTP + - FTP + - IMAP + - POP3 + - SMTP See-also: - CURLOPT_HEADERFUNCTION (3) - CURLOPT_HTTPHEADER (3) +Added-in: 7.1 --- # NAME @@ -41,15 +48,13 @@ It is often better to use CURLOPT_HEADERFUNCTION(3) to get the header data separately. While named confusingly similar, CURLOPT_HTTPHEADER(3) is used to set -custom HTTP headers! +custom HTTP headers. # DEFAULT 0 -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -67,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Provided in all libcurl versions. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HEADERDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_HEADERDATA.md index 83109af8..0542e158 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HEADERDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HEADERDATA.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HEADERFUNCTION (3) - CURLOPT_WRITEFUNCTION (3) - curl_easy_header (3) +Protocol: + - All +Added-in: 7.10 --- # NAME @@ -33,7 +36,7 @@ If CURLOPT_WRITEFUNCTION(3) or CURLOPT_HEADERFUNCTION(3) is used, If neither of those options are set, *pointer* must be a valid FILE * and it is used by a plain fwrite() to write headers to. -If you are using libcurl as a win32 DLL, you **MUST** use a +If you are using libcurl as a Windows DLL, you **MUST** use a CURLOPT_WRITEFUNCTION(3) or CURLOPT_HEADERFUNCTION(3) if you set this option or you might experience crashes. @@ -41,9 +44,7 @@ this option or you might experience crashes. NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -80,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md index 41d02c3a..3c7e0a9e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HEADERFUNCTION.md @@ -8,6 +8,13 @@ See-also: - CURLOPT_HEADERDATA (3) - CURLOPT_WRITEFUNCTION (3) - curl_easy_header (3) +Protocol: + - HTTP + - FTP + - POP3 + - IMAP + - SMTP +Added-in: 7.7.2 --- # NAME @@ -36,12 +43,12 @@ shown above. This callback function gets invoked by libcurl as soon as it has received header data. The header callback is called once for each header and only complete header lines are passed on to the callback. Parsing headers is easy -to do using this callback. *buffer* points to the delivered data, and the -size of that data is *nitems*; *size* is always 1. The provide header -line is not null-terminated! +to do using this callback. *buffer* points to the delivered data, and the size +of that data is *nitems*; *size* is always 1. The provided header line is not +null-terminated. Do not modify the passed in buffer. -The pointer named *userdata* is the one you set with the -CURLOPT_HEADERDATA(3) option. +The pointer named *userdata* is the one you set with the CURLOPT_HEADERDATA(3) +option. Your callback should return the number of bytes actually taken care of. If that amount differs from the amount passed to your callback function, it @@ -94,10 +101,7 @@ although strictly they are just continuations of the previous lines. Nothing. -# PROTOCOLS - -Used for all protocols with headers or meta-data concept: HTTP, FTP, POP3, -IMAP, SMTP and more. +# %PROTOCOLS% # EXAMPLE @@ -123,9 +127,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HEADEROPT.md b/deps/curl/docs/libcurl/opts/CURLOPT_HEADEROPT.md index 0b1d8b66..9c74c6fa 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HEADEROPT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HEADEROPT.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_HEADEROPT Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HTTPHEADER (3) - CURLOPT_PROXYHEADER (3) +Added-in: 7.37.0 --- # NAME @@ -42,9 +45,7 @@ proxy and then CURLOPT_HTTPHEADER(3) headers only to the server. CURLHEADER_SEPARATE (changed in 7.42.1, used CURLHEADER_UNIFIED before then) -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -63,7 +64,7 @@ int main(void) /* HTTPS over a proxy makes a separate CONNECT to the proxy, so tell libcurl to not send the custom headers to the proxy. Keep them - separate! */ + separate. */ curl_easy_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE); ret = curl_easy_perform(curl); curl_slist_free_all(list); @@ -72,9 +73,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.37.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HSTS.md b/deps/curl/docs/libcurl/opts/CURLOPT_HSTS.md index fe7106ca..3d5f957a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HSTS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HSTS.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_HSTS Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_ALTSVC (3) - CURLOPT_HSTS_CTRL (3) - CURLOPT_RESOLVE (3) +Added-in: 7.74.0 --- # NAME @@ -30,8 +33,9 @@ name with this option also enables HSTS for this handle (the equivalent of setting *CURLHSTS_ENABLE* with CURLOPT_HSTS_CTRL(3)). If the given file does not exist or contains no HSTS entries at startup, the -HSTS cache simply starts empty. Setting the filename to NULL or "" only -enables HSTS without reading from or writing to any file. +HSTS cache simply starts empty. Setting the filename to NULL allows HSTS +without reading from or writing to any file. NULL also makes libcurl clear the +list of files to read HSTS data from, if any such were previously set. If this option is set multiple times, libcurl loads cache entries from each given file but only stores the last used name for later writing. @@ -41,7 +45,7 @@ given file but only stores the last used name for later writing. The HSTS cache is saved to and loaded from a text file with one entry per physical line. Each line in the file has the following format: -[host] [stamp] + [host] [stamp] [host] is the domain name for the entry and the name is dot-prefixed if it is an entry valid for all subdomains to the name as well or only for the exact @@ -57,9 +61,7 @@ currently no length or size limit. NULL, no filename -# PROTOCOLS - -HTTPS and HTTP +# %PROTOCOLS% # EXAMPLE @@ -74,9 +76,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.74.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADDATA.md index 0d391318..eda180e3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADDATA.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HSTSREADDATA Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HSTS (3) - CURLOPT_HSTSREADFUNCTION (3) - CURLOPT_HSTSWRITEDATA (3) - CURLOPT_HSTSWRITEFUNCTION (3) +Added-in: 7.74.0 --- # NAME @@ -36,9 +39,7 @@ do that. NULL -# PROTOCOLS - -This feature is only used for HTTP(S) transfer. +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.74.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADFUNCTION.md index 763b81dc..5d03607f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSREADFUNCTION.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HSTSREADFUNCTION Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HSTS (3) - CURLOPT_HSTSREADDATA (3) - CURLOPT_HSTSWRITEFUNCTION (3) - CURLOPT_HSTS_CTRL (3) +Added-in: 7.74.0 --- # NAME @@ -61,9 +64,7 @@ do that. NULL - no callback. -# PROTOCOLS - -This feature is only used for HTTP(S) transfer. +# %PROTOCOLS% # EXAMPLE @@ -97,9 +98,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.74.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEDATA.md index f871f1c4..6be5582d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEDATA.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HSTSWRITEDATA Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HSTS (3) - CURLOPT_HSTSREADDATA (3) - CURLOPT_HSTSREADFUNCTION (3) - CURLOPT_HSTSWRITEFUNCTION (3) +Added-in: 7.74.0 --- # NAME @@ -36,9 +39,7 @@ do that. NULL -# PROTOCOLS - -This feature is only used for HTTP(S) transfer. +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.74.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEFUNCTION.md index 9d0dd301..621268ea 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HSTSWRITEFUNCTION.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HSTSWRITEFUNCTION Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HSTS (3) - CURLOPT_HSTSWRITEDATA (3) - CURLOPT_HSTSWRITEFUNCTION (3) - CURLOPT_HSTS_CTRL (3) +Added-in: 7.74.0 --- # NAME @@ -65,9 +68,7 @@ do that. NULL - no callback. -# PROTOCOLS - -This feature is only used for HTTP(S) transfer. +# %PROTOCOLS% # EXAMPLE @@ -101,9 +102,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.74.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md b/deps/curl/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md index 4a87adc5..8dee6086 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HSTS_CTRL Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_ALTSVC (3) - CURLOPT_CONNECT_TO (3) - CURLOPT_HSTS (3) - CURLOPT_RESOLVE (3) +Added-in: 7.74.0 --- # NAME @@ -50,11 +53,9 @@ to the file when closing the handle. # DEFAULT -0. HSTS is disabled by default. +0 -# PROTOCOLS - -HTTPS and HTTP +# %PROTOCOLS% # EXAMPLE @@ -69,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.74.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.md index 447fb6fc..56c177cf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP09_ALLOWED.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTP09_ALLOWED Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HTTP_VERSION (3) - CURLOPT_SSLVERSION (3) +Added-in: 7.64.0 --- # NAME @@ -27,18 +30,13 @@ Pass the long argument *allowed* set to 1L to allow HTTP/0.9 responses. An HTTP/0.9 response is a server response entirely without headers and only a body. You can connect to lots of random TCP services and still get a response -that curl might consider to be HTTP/0.9! +that curl might consider to be HTTP/0.9. # DEFAULT -curl allowed HTTP/0.9 responses by default before 7.66.0 +0 -Since 7.66.0, libcurl requires this option set to 1L to allow HTTP/0.9 -responses. - -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -55,9 +53,14 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Option added in 7.64.0, present along with HTTP. +curl allowed HTTP/0.9 responses by default before 7.66.0 + +Since 7.66.0, libcurl requires this option set to 1L to allow HTTP/0.9 +responses. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP200ALIASES.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP200ALIASES.md index 167c26b2..933ed135 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP200ALIASES.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP200ALIASES.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTP200ALIASES Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HTTP09_ALLOWED (3) - CURLOPT_HTTP_VERSION (3) +Added-in: 7.10.3 --- # NAME @@ -38,13 +41,17 @@ curl_slist_free_all(3) to clean up an entire list. The alias itself is not parsed for any version strings. The protocol is assumed to match HTTP 1.0 when an alias match. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. + # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -66,9 +73,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPAUTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPAUTH.md index cafa39cc..e436e078 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPAUTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPAUTH.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTPAUTH Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_PASSWORD (3) - CURLOPT_PROXYAUTH (3) - CURLOPT_USERNAME (3) +Added-in: 7.10.6 --- # NAME @@ -82,6 +85,8 @@ option to work, or build libcurl on Windows with SSPI support. ## CURLAUTH_NTLM_WB +Support for this is removed since libcurl 8.8.0. + NTLM delegating to winbind helper. Authentication is performed by a separate binary application that is executed when needed. The name of the application is specified at compile time but is typically **/usr/bin/ntlm_auth**. @@ -121,9 +126,7 @@ see CURLOPT_AWS_SIGV4(3). CURLAUTH_BASIC -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -142,9 +145,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Option Added in 7.10.6. +# HISTORY CURLAUTH_DIGEST_IE was added in 7.19.3 @@ -156,6 +157,8 @@ CURLAUTH_BEARER was added in 7.61.0 CURLAUTH_AWS_SIGV4 was added in 7.74.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPGET.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPGET.md index 9be93217..109fe9ce 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPGET.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPGET.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTPGET Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_NOBODY (3) - CURLOPT_POST (3) - CURLOPT_UPLOAD (3) - curl_easy_reset (3) +Added-in: 7.8.1 --- # NAME @@ -40,9 +43,7 @@ reset a handle to default method, consider curl_easy_reset(3). 0 -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPHEADER.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPHEADER.md index 25895f23..cd49b1b8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPHEADER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPHEADER.md @@ -4,6 +4,10 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTPHEADER Section: 3 Source: libcurl +Protocol: + - HTTP + - SMTP + - IMAP See-also: - CURLOPT_CUSTOMREQUEST (3) - CURLOPT_HEADER (3) @@ -11,6 +15,7 @@ See-also: - CURLOPT_MIMEPOST (3) - CURLOPT_PROXYHEADER (3) - curl_mime_init (3) +Added-in: 7.1 --- # NAME @@ -30,23 +35,22 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPHEADER, Pass a pointer to a linked list of HTTP headers to pass to the server and/or proxy in your HTTP request. The same list can be used for both host and proxy -requests! +requests. When used within an IMAP or SMTP request to upload a MIME mail, the given header list establishes the document-level MIME headers to prepend to the -uploaded document described by CURLOPT_MIMEPOST(3). This does not affect -raw mail uploads. +uploaded document described by CURLOPT_MIMEPOST(3). This does not affect raw +mail uploads. -The linked list should be a fully valid list of **struct curl_slist** -structs properly filled in. Use curl_slist_append(3) to create the list -and curl_slist_free_all(3) to clean up an entire list. If you add a -header that is otherwise generated and used by libcurl internally, your added -header is used instead. If you add a header with no content as in 'Accept:' -(no data on the right side of the colon), the internally used header is -disabled/removed. With this option you can add new headers, replace internal -headers and remove internal headers. To add a header with no content (nothing -to the right side of the colon), use the form 'name;' (note the ending -semicolon). +The linked list should be a fully valid list of **struct curl_slist** structs +properly filled in. Use curl_slist_append(3) to create the list and +curl_slist_free_all(3) to clean up an entire list. If you add a header that is +otherwise generated and used by libcurl internally, your added header is used +instead. If you add a header with no content as in 'Accept:' (no data on the +right side of the colon), the internally used header is disabled/removed. With +this option you can add new headers, replace internal headers and remove +internal headers. To add a header with no content (nothing to the right side +of the colon), use the form 'name;' (note the ending semicolon). The headers included in the linked list **must not** be CRLF-terminated, because libcurl adds CRLF after each header item itself. Failure to comply @@ -60,16 +64,16 @@ following the request-line are headers. Adding this method line in this list of headers only causes your request to send an invalid header. Use CURLOPT_CUSTOMREQUEST(3) to change the method. -When this option is passed to curl_easy_setopt(3), libcurl does not copy -the entire list so you **must** keep it around until you no longer use this -*handle* for a transfer before you call curl_slist_free_all(3) on -the list. +When this option is passed to curl_easy_setopt(3), libcurl does not copy the +entire list so you **must** keep it around until you no longer use this +*handle* for a transfer before you call curl_slist_free_all(3) on the list. -Pass a NULL to this option to reset back to no custom headers. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. The most commonly replaced HTTP headers have "shortcuts" in the options -CURLOPT_COOKIE(3), CURLOPT_USERAGENT(3) and -CURLOPT_REFERER(3). We recommend using those. +CURLOPT_COOKIE(3), CURLOPT_USERAGENT(3) and CURLOPT_REFERER(3). We recommend +using those. There is an alternative option that sets or replaces headers only for requests that are sent with CONNECT to a proxy: CURLOPT_PROXYHEADER(3). Use @@ -110,9 +114,11 @@ MIME mail is only composed of alternative representations of the same data In all cases the value must be of the form "multipart/*" to respect the document structure and may not include the "boundary=" parameter. +## + Other specific headers that do not have a libcurl default value but are strongly desired by mail delivery and user agents should also be included. -These are "From:", "To:", "Date:" and "Subject:" among others and their +These are `From:`, `To:`, `Date:` and `Subject:` among others and their presence and value is generally checked by anti-spam utilities. # SECURITY CONCERNS @@ -144,9 +150,7 @@ with the CURLOPT_UNRESTRICTED_AUTH(3) option. NULL -# PROTOCOLS - -HTTP, IMAP and SMTP +# %PROTOCOLS% # EXAMPLE @@ -172,9 +176,11 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -As long as HTTP is enabled. Use in MIME mail added in 7.56.0. +Use for MIME mail added in 7.56.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPOST.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPOST.md index 890bd8f6..e9381c37 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPOST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPOST.md @@ -4,6 +4,8 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTPPOST Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_MIMEPOST (3) - CURLOPT_POST (3) @@ -11,6 +13,7 @@ See-also: - curl_formadd (3) - curl_formfree (3) - curl_mime_init (3) +Added-in: 7.1 --- # NAME @@ -47,9 +50,7 @@ CURLOPT_NOBODY(3) to 0. NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -91,9 +92,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -As long as HTTP is enabled. Deprecated in 7.56.0. +Deprecated in 7.56.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPROXYTUNNEL.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPROXYTUNNEL.md index 4f12811a..60b4e6a8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPROXYTUNNEL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTPPROXYTUNNEL.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTPPROXYTUNNEL Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYPORT (3) - CURLOPT_PROXYTYPE (3) +Added-in: 7.3 --- # NAME @@ -47,9 +50,7 @@ rarely works through the proxy anyway). 0 -# PROTOCOLS - -All network protocols +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_CONTENT_DECODING.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_CONTENT_DECODING.md index e0f010d6..3c3e381a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_CONTENT_DECODING.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_CONTENT_DECODING.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTP_CONTENT_DECODING Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_ACCEPT_ENCODING (3) - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_STDERR (3) +Added-in: 7.16.2 --- # NAME @@ -34,9 +37,7 @@ CURLOPT_ACCEPT_ENCODING(3) for that. 1 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -53,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_TRANSFER_DECODING.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_TRANSFER_DECODING.md index 3c4e06be..52cee575 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_TRANSFER_DECODING.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_TRANSFER_DECODING.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTP_TRANSFER_DECODING Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_ACCEPT_ENCODING (3) - CURLOPT_HTTP_CONTENT_DECODING (3) +Added-in: 7.16.2 --- # NAME @@ -28,13 +31,16 @@ Pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding is disabled, if set to 1 it is enabled (default). libcurl does chunked transfer decoding by default unless this option is set to zero. +# NOTES + +This option does not work with the hyper backend as that always has transfer +decoding enabled. + # DEFAULT 1 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -51,10 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.2 Does not work with the hyper backend (it always has transfer -decoding enabled). +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md index cab71fd6..32c2c2ce 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md @@ -4,11 +4,14 @@ SPDX-License-Identifier: curl Title: CURLOPT_HTTP_VERSION Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_ALTSVC (3) - CURLOPT_HTTP09_ALLOWED (3) - CURLOPT_HTTP200ALIASES (3) - CURLOPT_SSLVERSION (3) +Added-in: 7.9.1 --- # NAME @@ -70,6 +73,10 @@ prior knowledge that the server supports HTTP/2 straight away. HTTPS requests still do HTTP/2 the standard way with negotiated protocol version in the TLS handshake. (Added in 7.49.0) +Since 8.10.0 if this option is set for an HTTPS request then the application +layer protocol version (ALPN) offered to the server is only HTTP/2. Prior to +that both HTTP/1.1 and HTTP/2 were offered. + ## CURL_HTTP_VERSION_3 (Added in 7.66.0) This option makes libcurl attempt to use HTTP/3 to the host @@ -87,9 +94,7 @@ Since curl 7.62.0: CURL_HTTP_VERSION_2TLS Before that: CURL_HTTP_VERSION_1_1 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -110,9 +115,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_IGNORE_CONTENT_LENGTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_IGNORE_CONTENT_LENGTH.md index 93ea4b6d..4b8228b4 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_IGNORE_CONTENT_LENGTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_IGNORE_CONTENT_LENGTH.md @@ -4,9 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_IGNORE_CONTENT_LENGTH Section: 3 Source: libcurl +Protocol: + - HTTP + - FTP See-also: - CURLOPT_HTTP_VERSION (3) - CURLOPT_MAXFILESIZE_LARGE (3) +Added-in: 7.14.1 --- # NAME @@ -42,9 +46,7 @@ Only use this option if strictly necessary. 0 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -63,10 +65,16 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.14.1. Support for FTP added in 7.46.0. This option is not working -for HTTP when libcurl is built to use the hyper backend. +Support for FTP added in 7.46.0. + +# NOTES + +This option is not working for HTTP when libcurl is built to use the hyper +backend. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE.md b/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE.md index 0d7924ea..8c9ab624 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONTENT_LENGTH_UPLOAD_T (3) - CURLOPT_INFILESIZE_LARGE (3) - CURLOPT_UPLOAD (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -48,9 +51,7 @@ and sending a different amount may lead to errors. Unset -# PROTOCOLS - -Many +# %PROTOCOLS% # EXAMPLE @@ -76,10 +77,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY SMTP support added in 7.23.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE_LARGE.md index 119d2322..2fb73648 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_INFILESIZE_LARGE.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_CONTENT_LENGTH_UPLOAD_T (3) - CURLOPT_INFILESIZE (3) - CURLOPT_UPLOAD (3) +Protocol: + - All +Added-in: 7.11.0 --- # NAME @@ -45,9 +48,7 @@ and sending a different amount may lead to errors. Unset -# PROTOCOLS - -Many +# %PROTOCOLS% # EXAMPLE @@ -72,10 +73,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY SMTP support added in 7.23.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_INTERFACE.md b/deps/curl/docs/libcurl/opts/CURLOPT_INTERFACE.md index 0cd3d44c..ce5636ab 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_INTERFACE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_INTERFACE.md @@ -4,9 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_INTERFACE Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_SOCKOPTFUNCTION (3) - CURLOPT_TCP_NODELAY (3) + - CURLOPT_LOCALPORT (3) +Added-in: 7.3 --- # NAME @@ -25,34 +29,36 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INTERFACE, char *interface); Pass a char pointer as parameter. This sets the *interface* name to use as outgoing network interface. The name can be an interface name, an IP address, -or a hostname. +or a hostname. If you prefer one of these, you can use the following special +prefixes: -If the parameter starts with "if!" then it is treated only as an interface -name. If the parameter starts with &"host!" it is treated as either an IP -address or a hostname. +* `if!\` - Interface name +* `host!\` - IP address or hostname +* `ifhost!\!\` - Interface name and IP address or hostname -If "if!" is specified but the parameter does not match an existing interface, -*CURLE_INTERFACE_FAILED* is returned from the libcurl function used to -perform the transfer. +If `if!` or `ifhost!` is specified but the parameter does not match an existing +interface, *CURLE_INTERFACE_FAILED* is returned from the libcurl function used +to perform the transfer. libcurl does not support using network interface names for this option on Windows. We strongly advise against specifying the interface with a hostname, as it -causes libcurl to do a blocking name resolve call to retrieve the IP -address. That name resolve operation does **not** use DNS-over-HTTPS even if +causes libcurl to do a blocking name resolve call to retrieve the IP address. +That name resolve operation does **not** use DNS-over-HTTPS even if CURLOPT_DOH_URL(3) is set. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL, use whatever the TCP stack finds suitable -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -73,9 +79,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -The "if!" and "host!" syntax was added in 7.24.0. +The `if!` and `host!` syntax was added in 7.24.0. + +The `ifhost!` syntax was added in 8.9.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md index 7bb6059a..15f1c833 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_INTERLEAVEDATA Section: 3 Source: libcurl +Protocol: + - RTSP See-also: - CURLOPT_INTERLEAVEFUNCTION (3) - CURLOPT_RTSP_REQUEST (3) +Added-in: 7.20.0 --- # NAME @@ -32,9 +35,7 @@ anywhere. NULL -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEFUNCTION.md index 758192f1..6f975422 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_INTERLEAVEFUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_INTERLEAVEDATA (3) - CURLOPT_RTSP_REQUEST (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -63,9 +66,7 @@ You can also abort the transfer by returning CURL_WRITEFUNC_ERROR. (7.87.0) NULL, the interleave data is then passed to the regular write function: CURLOPT_WRITEFUNCTION(3). -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -93,9 +94,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLDATA.md index f34a3533..b9cd9a50 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_IOCTLFUNCTION (3) - CURLOPT_SEEKFUNCTION (3) +Protocol: + - All +Added-in: 7.12.3 --- # NAME @@ -28,11 +31,9 @@ argument in the ioctl callback set with CURLOPT_IOCTLFUNCTION(3). # DEFAULT -By default, the value of this parameter is NULL. +NULL -# PROTOCOLS - -Used with HTTP +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.12.3. Deprecated since 7.18.0. +Deprecated since 7.18.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLFUNCTION.md index a3e120f3..8aa01a9e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_IOCTLFUNCTION.md @@ -4,9 +4,12 @@ SPDX-License-Identifier: curl Title: CURLOPT_IOCTLFUNCTION Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_IOCTLDATA (3) - CURLOPT_SEEKFUNCTION (3) +Added-in: 7.12.3 --- # NAME @@ -54,16 +57,14 @@ The *clientp* argument to the callback is set with the CURLOPT_IOCTLDATA(3) option. **This option is deprecated**. Do not use it. Use CURLOPT_SEEKFUNCTION(3) -instead to provide seeking! If CURLOPT_SEEKFUNCTION(3) is set, this +instead to provide seeking. If CURLOPT_SEEKFUNCTION(3) is set, this parameter is ignored when seeking. # DEFAULT -By default, this parameter is set to NULL. Not used. +NULL -# PROTOCOLS - -Used with HTTP +# %PROTOCOLS% # EXAMPLE @@ -94,9 +95,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.12.3. Deprecated since 7.18.0. +Deprecated since 7.18.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_IPRESOLVE.md b/deps/curl/docs/libcurl/opts/CURLOPT_IPRESOLVE.md index a1262961..1b4369d2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_IPRESOLVE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_IPRESOLVE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HTTP_VERSION (3) - CURLOPT_RESOLVE (3) - CURLOPT_SSLVERSION (3) +Protocol: + - All +Added-in: 7.10.8 --- # NAME @@ -50,9 +53,7 @@ Uses only IPv6 addresses. CURL_IPRESOLVE_WHATEVER -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -74,9 +75,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT.md b/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT.md index 5b227a9d..e11f41a8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT.md @@ -8,6 +8,12 @@ See-also: - CURLOPT_CRLFILE (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.19.0 --- # NAME @@ -40,6 +46,9 @@ which is returned if the setup of the SSL/TLS session has failed due to a mismatch with the issuer of peer certificate (CURLOPT_SSL_VERIFYPEER(3) has to be set too for the check to fail). (Added in 7.19.0) +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + The application does not have to keep the string around after setting this option. @@ -47,9 +56,7 @@ option. NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -67,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built TLS enabled +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT_BLOB.md index 26641312..77f0d87b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_ISSUERCERT_BLOB.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_ISSUERCERT (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.71.0 --- # NAME @@ -54,9 +59,7 @@ expects a filename as input. NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -82,9 +85,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_KEEP_SENDING_ON_ERROR.md b/deps/curl/docs/libcurl/opts/CURLOPT_KEEP_SENDING_ON_ERROR.md index 0c8b8a8c..fb52799f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_KEEP_SENDING_ON_ERROR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_KEEP_SENDING_ON_ERROR.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RESPONSE_CODE (3) - CURLOPT_FAILONERROR (3) - CURLOPT_HTTPHEADER (3) +Protocol: + - HTTP +Added-in: 7.51.0 --- # NAME @@ -39,9 +42,7 @@ Most applications do not need this option. 0, stop sending on error -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP. Added in 7.51.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_KEYPASSWD.md b/deps/curl/docs/libcurl/opts/CURLOPT_KEYPASSWD.md index ddc8546f..08a08f7a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_KEYPASSWD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_KEYPASSWD.md @@ -7,6 +7,14 @@ Source: libcurl See-also: - CURLOPT_SSH_PRIVATE_KEYFILE (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - mbedTLS + - Schannel + - wolfSSL +Added-in: 7.17.0 --- # NAME @@ -25,19 +33,20 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_KEYPASSWD, char *pwd); Pass a pointer to a null-terminated string as parameter. It is used as the password required to use the CURLOPT_SSLKEY(3) or -CURLOPT_SSH_PRIVATE_KEYFILE(3) private key. You never need a pass phrase to +CURLOPT_SSH_PRIVATE_KEYFILE(3) private key. You never need a passphrase to load a certificate but you need one to load your private key. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -57,11 +66,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and CURLOPT_SSLCERTPASSWD up to 7.9.2. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_KRBLEVEL.md b/deps/curl/docs/libcurl/opts/CURLOPT_KRBLEVEL.md index a91f67e1..5a674d3c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_KRBLEVEL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_KRBLEVEL.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_KRBLEVEL (3) - CURLOPT_USE_SSL (3) +Protocol: + - FTP +Added-in: 7.16.4 --- # NAME @@ -32,13 +35,14 @@ string to NULL to disable kerberos support for FTP. The application does not have to keep the string around after setting this option. +The application does not have to keep the string around after setting this +option. + # DEFAULT NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -56,10 +60,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY This option was known as CURLOPT_KRB4LEVEL up to 7.16.3 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORT.md b/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORT.md index 0113e43c..a7cc9fdc 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORT.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_LOCAL_PORT (3) - CURLOPT_INTERFACE (3) - CURLOPT_LOCALPORTRANGE (3) +Protocol: + - All +Added-in: 7.15.2 --- # NAME @@ -33,9 +36,7 @@ this option is set. Valid port numbers are 1 - 65535. 0, disabled - use whatever the system thinks is fine -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -55,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORTRANGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORTRANGE.md index cd84649b..5d8c8a26 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORTRANGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_LOCALPORTRANGE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_INTERFACE (3) - CURLOPT_LOCALPORT (3) +Protocol: + - All +Added-in: 7.15.2 --- # NAME @@ -36,9 +39,7 @@ setup failures. 1 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.2 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_LOGIN_OPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_LOGIN_OPTIONS.md index 8a4e7eba..969a2c41 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_LOGIN_OPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_LOGIN_OPTIONS.md @@ -7,6 +7,12 @@ Source: libcurl See-also: - CURLOPT_PASSWORD (3) - CURLOPT_USERNAME (3) +Protocol: + - IMAP + - LDAP + - POP3 + - SMTP +Added-in: 7.34.0 --- # NAME @@ -42,13 +48,14 @@ disables the plain LOGIN (e.g. to prevent password snooping). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -Only IMAP, LDAP, POP3 and SMTP support login options. +# %PROTOCOLS% # EXAMPLE @@ -66,9 +73,11 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.34.0. Support for OpenLDAP added in 7.82.0. +Support for OpenLDAP added in 7.82.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_LIMIT.md b/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_LIMIT.md index 64fa45ed..068c6572 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_LIMIT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_LIMIT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_MAX_RECV_SPEED_LARGE (3) - CURLOPT_MAX_SEND_SPEED_LARGE (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -35,9 +38,7 @@ slow and abort. 0, disabled -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -53,7 +54,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L); res = curl_easy_perform(curl); if(CURLE_OPERATION_TIMEDOUT == res) { - printf("Timeout!\n"); + printf("Timeout.\n"); } /* always cleanup */ curl_easy_cleanup(curl); @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.md b/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.md index e7aa94ce..819e7c1c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -32,9 +35,7 @@ library to consider it too slow and abort. 0, disabled -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -50,7 +51,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L); res = curl_easy_perform(curl); if(CURLE_OPERATION_TIMEDOUT == res) { - printf("Timeout!\n"); + printf("Timeout.\n"); } /* always cleanup */ curl_easy_cleanup(curl); @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_AUTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_AUTH.md index a3ef13b5..fd5c5f40 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_AUTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_AUTH.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_MAIL_FROM (3) - CURLOPT_MAIL_RCPT (3) +Protocol: + - SMTP +Added-in: 7.25.0 --- # NAME @@ -42,13 +45,14 @@ string is used then a pair of brackets are sent by libcurl as required by RFC The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -SMTP +# %PROTOCOLS% # EXAMPLE @@ -66,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.25.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_FROM.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_FROM.md index 431d1b52..16d045be 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_FROM.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_FROM.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_MAIL_AUTH (3) - CURLOPT_MAIL_RCPT (3) +Protocol: + - SMTP +Added-in: 7.20.0 --- # NAME @@ -35,13 +38,14 @@ server which might cause the email to be rejected. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT blank -# PROTOCOLS - -SMTP +# %PROTOCOLS% # EXAMPLE @@ -59,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT.md index 40f42cc3..3a6d17d0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_MAIL_AUTH (3) - CURLOPT_MAIL_FROM (3) +Protocol: + - SMTP +Added-in: 7.20.0 --- # NAME @@ -29,6 +32,9 @@ SMTP mail request. The linked list should be a fully valid list of **struct curl_slist** structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list. +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. + When performing a mail transfer, each recipient should be specified within a pair of angled brackets (\<\>), however, should you not use an angled bracket as the first character libcurl assumes you provided a single email address and @@ -42,13 +48,14 @@ When performing a mailing list expand (**EXPN** command), each recipient should be specified using the mailing list name, such as `Friends` or `London-Office`. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -SMTP +# %PROTOCOLS% # EXAMPLE @@ -70,9 +77,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0. The **VRFY** and **EXPN** logic was added in 7.34.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT_ALLOWFAILS.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT_ALLOWFAILS.md index 83183ee1..f17d5615 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT_ALLOWFAILS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAIL_RCPT_ALLOWFAILS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_MAIL_FROM (3) - CURLOPT_MAIL_RCPT (3) +Protocol: + - SMTP +Added-in: 8.2.0 --- # NAME @@ -42,9 +45,7 @@ RCPT TO command. 0 -# PROTOCOLS - -SMTP +# %PROTOCOLS% # EXAMPLE @@ -70,11 +71,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -This option was called CURLOPT_MAIL_RCPT_ALLLOWFAILS before 8.2.0 +This option was called CURLOPT_MAIL_RCPT_ALLLOWFAILS (with three instead of +two letter L) before 8.2.0 -Added in 7.69.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAXAGE_CONN.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAXAGE_CONN.md index 3b84dfdc..c834d88c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAXAGE_CONN.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAXAGE_CONN.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_FRESH_CONNECT (3) - CURLOPT_MAXLIFETIME_CONN (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.65.0 --- # NAME @@ -39,11 +42,9 @@ cache that is older than this set *age*, it is closed instead. # DEFAULT -Default maximum age is set to 118 seconds. +118 seconds -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.65.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAXCONNECTS.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAXCONNECTS.md index 729fa2ba..3a368c82 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAXCONNECTS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAXCONNECTS.md @@ -9,6 +9,9 @@ See-also: - CURLMOPT_MAX_HOST_CONNECTIONS (3) - CURLMOPT_MAX_TOTAL_CONNECTIONS (3) - CURLOPT_MAXREDIRS (3) +Protocol: + - All +Added-in: 7.7 --- # NAME @@ -25,18 +28,18 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAXCONNECTS, long amount); # DESCRIPTION -Pass a long. The set *amount* is the maximum number of simultaneously open -persistent connections that libcurl may cache in the pool associated with this -handle. The default is 5, and there is not much point in changing this value -unless you are perfectly aware of how this works. This concerns connections -using any of the protocols that support persistent connections. +Pass a long. The set *amount* is the maximum number of connections that +libcurl may keep alive in its connection cache after use. The default is 5, +and there is not much point in changing this value unless you are perfectly +aware of how this works. This concerns connections using any of the protocols +that support persistent connections. -When reaching the maximum limit, curl closes the oldest one in the cache to -prevent increasing the number of open connections. +When reaching the maximum limit, curl closes the oldest connection present in +the cache to prevent the number of connections from increasing. If you already have performed transfers with this curl handle, setting a -smaller CURLOPT_MAXCONNECTS(3) than before may cause open connections to -get closed unnecessarily. +smaller CURLOPT_MAXCONNECTS(3) than before may cause open connections to get +closed unnecessarily. If you add this easy handle to a multi handle, this setting is not acknowledged, and you must instead use curl_multi_setopt(3) and the @@ -46,9 +49,7 @@ CURLMOPT_MAXCONNECTS(3) option. 5 -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE.md index 6203bd05..d28f3dc0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_MAXFILESIZE_LARGE (3) - CURLOPT_MAX_RECV_SPEED_LARGE (3) +Protocol: + - All +Added-in: 7.10.8 --- # NAME @@ -26,6 +29,8 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAXFILESIZE, long size); Pass a long as parameter. This specifies the maximum accepted *size* (in bytes) of a file to download. If the file requested is found larger than this value, the transfer is aborted and *CURLE_FILESIZE_EXCEEDED* is returned. +Passing a zero *size* disables this, and passing a negative *size* yields a +*CURLE_BAD_FUNCTION_ARGUMENT*. The file size is not always known prior to the download start, and for such transfers this option has no effect - even if the file transfer eventually @@ -38,11 +43,9 @@ threshold. # DEFAULT -None +0, meaning disabled. -# PROTOCOLS - -FTP, HTTP and MQTT +# %PROTOCOLS% # EXAMPLE @@ -53,17 +56,16 @@ int main(void) if(curl) { CURLcode ret; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - /* refuse to download if larger than 1000 bytes! */ + /* refuse to download if larger than 1000 bytes */ curl_easy_setopt(curl, CURLOPT_MAXFILESIZE, 1000L); ret = curl_easy_perform(curl); } } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE -Returns CURLE_OK +Returns CURLE_OK if the size passed is valid or CURLE_BAD_FUNCTION_ARGUMENT if +not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE_LARGE.md index f750c433..ad6b1075 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAXFILESIZE_LARGE.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_MAXFILESIZE (3) - CURLOPT_MAX_RECV_SPEED_LARGE (3) +Protocol: + - FTP + - HTTP + - MQTT +Added-in: 7.11.0 --- # NAME @@ -27,7 +32,8 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAXFILESIZE_LARGE, Pass a curl_off_t as parameter. This specifies the maximum accepted *size* (in bytes) of a file to download. If the file requested is found larger than this value, the transfer is aborted and *CURLE_FILESIZE_EXCEEDED* is -returned. +returned. Passing a zero *size* disables this, and passing a negative *size* +yields a *CURLE_BAD_FUNCTION_ARGUMENT*. The file size is not always known prior to the download start, and for such transfers this option has no effect - even if the file transfer eventually @@ -38,11 +44,9 @@ threshold. # DEFAULT -None +0, meaning disabled. -# PROTOCOLS - -FTP, HTTP and MQTT +# %PROTOCOLS% # EXAMPLE @@ -61,10 +65,9 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.11.0 +# %AVAILABILITY% # RETURN VALUE -Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. +Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or +CURLE_BAD_FUNCTION_ARGUMENT if the size passed is invalid. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAXLIFETIME_CONN.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAXLIFETIME_CONN.md index 429cf394..5615f1fd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAXLIFETIME_CONN.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAXLIFETIME_CONN.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_FRESH_CONNECT (3) - CURLOPT_MAXAGE_CONN (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.80.0 --- # NAME @@ -41,11 +44,9 @@ If set to 0, this behavior is disabled: all connections are eligible for reuse. # DEFAULT -Default *maxlifetime* is 0 seconds (i.e., disabled). +0 seconds (i.e., disabled) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.80.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAXREDIRS.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAXREDIRS.md index 136f9a6d..4f94f8d3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAXREDIRS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAXREDIRS.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_REDIRECT_COUNT (3) - CURLINFO_REDIRECT_URL (3) - CURLOPT_FOLLOWLOCATION (3) +Protocol: + - HTTP +Added-in: 7.5 --- # NAME @@ -38,9 +41,7 @@ to get stuck in never-ending redirect loops. 30 (since 8.3.0), it was previously unlimited. -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.md index 26080877..987693e8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_MAX_SEND_SPEED_LARGE (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.15.5 --- # NAME @@ -41,9 +44,7 @@ This option does not affect transfer speeds done with FILE:// URLs. 0, disabled -# PROTOCOLS - -All but file:// +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.15.5 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.md index e8cf5081..4619f272 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_MAX_RECV_SPEED_LARGE (3) +Protocol: + - All +Added-in: 7.15.5 --- # NAME @@ -42,9 +45,7 @@ This option does not affect transfer speeds done with FILE:// URLs. 0, disabled -# PROTOCOLS - -All except file:// +# %PROTOCOLS% # EXAMPLE @@ -57,15 +58,13 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* cap the upload speed to 1000 bytes/sec */ curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)1000); - /* (set some upload options as well!) */ + /* (set some upload options as well) */ ret = curl_easy_perform(curl); } } ~~~ -# AVAILABILITY - -Added in 7.15.5 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MIMEPOST.md b/deps/curl/docs/libcurl/opts/CURLOPT_MIMEPOST.md index f681c2a9..4cd3238b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MIMEPOST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MIMEPOST.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_POSTFIELDS (3) - CURLOPT_PUT (3) - curl_mime_init (3) +Protocol: + - HTTP + - SMTP + - IMAP +Added-in: 7.56.0 --- # NAME @@ -39,9 +44,7 @@ When setting CURLOPT_MIMEPOST(3) to NULL, libcurl resets the request type for HTTP to the default to disable the POST. Typically that would mean it is reset to GET. Instead you should set a desired request method explicitly. -# PROTOCOLS - -HTTP, SMTP, IMAP. +# %PROTOCOLS% # EXAMPLE @@ -65,16 +68,14 @@ int main(void) /* Set the form info */ curl_easy_setopt(curl, CURLOPT_MIMEPOST, multipart); - curl_easy_perform(curl); /* post away! */ + curl_easy_perform(curl); /* post away */ curl_mime_free(multipart); /* free the post data */ } } } ~~~ -# AVAILABILITY - -Added in 7.56.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md index 7f97d78d..5175570e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_HTTPPOST (3) - CURLOPT_MIMEPOST (3) +Protocol: + - HTTP + - IMAP + - SMTP +Added-in: 7.81.0 --- # NAME @@ -52,9 +57,7 @@ containing multipart form is sent, this is normally transmitted as 0, meaning disabled. -# PROTOCOLS - -HTTP, IMAP, SMTP +# %PROTOCOLS% # EXAMPLE @@ -88,9 +91,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Option added in 7.81.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NETRC.md b/deps/curl/docs/libcurl/opts/CURLOPT_NETRC.md index 023676d0..98568cc9 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NETRC.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NETRC.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_NETRC_FILE (3) - CURLOPT_USERNAME (3) - CURLOPT_USERPWD (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -28,8 +31,10 @@ This parameter controls the preference *level* of libcurl between using usernames and passwords from your *~/.netrc* file, relative to usernames and passwords in the URL supplied with CURLOPT_URL(3). -On Windows, libcurl uses the file as *%HOME%/_netrc*. If *%HOME%* is -not set on Windows, libcurl falls back to *%USERPROFILE%*. +On Windows, libcurl primarily checks for *.netrc* in *%HOME%*. If *%HOME%* is +not set on Windows, libcurl falls back to *%USERPROFILE%*. If the file does +not exist, it falls back to check if there is instead a file named *_netrc* - +using an underscore instead of period. You can also tell libcurl a different filename to use with CURLOPT_NETRC_FILE(3). @@ -113,9 +118,7 @@ done with "macdef" that it finds. CURL_NETRC_IGNORED -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -132,9 +135,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NETRC_FILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_NETRC_FILE.md index cf27945e..4486b9c2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NETRC_FILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NETRC_FILE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_NETRC (3) - CURLOPT_PASSWORD (3) - CURLOPT_USERNAME (3) +Protocol: + - All +Added-in: 7.11.0 --- # NAME @@ -32,13 +35,14 @@ for a .netrc file in the current user's home directory. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.9 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NEW_DIRECTORY_PERMS.md b/deps/curl/docs/libcurl/opts/CURLOPT_NEW_DIRECTORY_PERMS.md index 733a042f..94c778c7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NEW_DIRECTORY_PERMS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NEW_DIRECTORY_PERMS.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_FTP_CREATE_MISSING_DIRS (3) - CURLOPT_NEW_FILE_PERMS (3) - CURLOPT_UPLOAD (3) +Protocol: + - SFTP + - SCP + - FILE +Added-in: 7.16.4 --- # NAME @@ -34,9 +39,7 @@ this are *sftp://*, *scp://*, and *file://*. 0755 -# PROTOCOLS - -SFTP, SCP and FILE +# %PROTOCOLS% # EXAMPLE @@ -55,9 +58,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NEW_FILE_PERMS.md b/deps/curl/docs/libcurl/opts/CURLOPT_NEW_FILE_PERMS.md index f79a1937..f3fba558 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NEW_FILE_PERMS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NEW_FILE_PERMS.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_NEW_DIRECTORY_PERMS (3) - CURLOPT_UPLOAD (3) +Protocol: + - SFTP + - SCP + - FILE +Added-in: 7.16.4 --- # NAME @@ -32,9 +37,7 @@ The only protocols that can use this are *sftp://*, *scp://*, and *file://*. 0644 -# PROTOCOLS - -SFTP, SCP and FILE +# %PROTOCOLS% # EXAMPLE @@ -51,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NOBODY.md b/deps/curl/docs/libcurl/opts/CURLOPT_NOBODY.md index 2b7f8967..e1643fb1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NOBODY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NOBODY.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_POSTFIELDS (3) - CURLOPT_REQUEST_TARGET (3) - CURLOPT_UPLOAD (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -47,9 +50,7 @@ URL you request). 0, the body is transferred -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -60,7 +61,7 @@ int main(void) if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); - /* get us the resource without a body - use HEAD! */ + /* get us the resource without a body - use HEAD */ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); /* Perform the request */ @@ -69,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NOPROGRESS.md b/deps/curl/docs/libcurl/opts/CURLOPT_NOPROGRESS.md index 14478cf5..5f3d7322 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NOPROGRESS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NOPROGRESS.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PROGRESSFUNCTION (3) - CURLOPT_VERBOSE (3) - CURLOPT_XFERINFOFUNCTION (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -34,9 +37,7 @@ getting called. 1, meaning it normally runs without a progress meter. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NOPROXY.md b/deps/curl/docs/libcurl/opts/CURLOPT_NOPROXY.md index f5416174..b2728873 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NOPROXY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NOPROXY.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_NOPROXY Section: 3 Source: libcurl +Protocol: + - All See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYAUTH (3) - CURLOPT_PROXYTYPE (3) +Added-in: 7.19.4 --- # NAME @@ -38,7 +41,7 @@ proxy for all hostnames, even if there is an environment variable set for it. Enter IPv6 numerical addresses in the list of hostnames without enclosing brackets: - "example.com,::1,localhost" + "example.com,::1,localhost" Since 7.86.0, IP addresses specified to this option can be provided using CIDR notation: an appended slash and number specifies the number of "network bits" @@ -48,6 +51,9 @@ would match all addresses starting with "192.168". The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # Environment variables If there is an environment variable called **no_proxy** (or **NO_PROXY**), @@ -58,9 +64,7 @@ the same way. NULL -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -80,9 +84,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_NOSIGNAL.md b/deps/curl/docs/libcurl/opts/CURLOPT_NOSIGNAL.md index 6ed291db..4c9c5774 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_NOSIGNAL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_NOSIGNAL.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.10 --- # NAME @@ -24,7 +27,7 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOSIGNAL, long onoff); If *onoff* is 1, libcurl uses no functions that install signal handlers or any functions that cause signals to be sent to the process. This option is -here to allow multi-threaded unix applications to still set/use all timeout +here to allow multi-threaded Unix applications to still set/use all timeout options etc, without risking getting signals. If this option is set and libcurl has been built with the standard name @@ -38,17 +41,13 @@ ignore SIGPIPE signals, which otherwise are sent by the system when trying to send data to a socket which is closed in the other end. libcurl makes an effort to never cause such SIGPIPE signals to trigger, but some operating systems have no way to avoid them and even on those that have there are some -corner cases when they may still happen, contrary to our desire. In addition, -using *CURLAUTH_NTLM_WB* authentication could cause a SIGCHLD signal to be -raised. +corner cases when they may still happen, contrary to our desire. # DEFAULT 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -69,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETDATA.md index 20446500..1a73f2f1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETDATA.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_CLOSESOCKETFUNCTION (3) - CURLOPT_OPENSOCKETFUNCTION (3) - CURLOPT_SOCKOPTFUNCTION (3) +Protocol: + - All +Added-in: 7.17.1 --- # NAME @@ -30,11 +33,9 @@ CURLOPT_OPENSOCKETFUNCTION(3). # DEFAULT -The default value of this parameter is NULL. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -83,9 +84,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.17.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETFUNCTION.md index a5a101aa..47bb7e13 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_OPENSOCKETFUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_CLOSESOCKETFUNCTION (3) - CURLOPT_OPENSOCKETFUNCTION (3) - CURLOPT_SOCKOPTFUNCTION (3) +Protocol: + - All +Added-in: 7.17.1 --- # NAME @@ -68,14 +71,12 @@ CURLOPT_SOCKOPTFUNCTION(3) to signal that it already is connected. # DEFAULT -The default behavior is the equivalent of this: +The equivalent of this: ~~~c return socket(addr->family, addr->socktype, addr->protocol); ~~~ -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -123,9 +124,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.17.1. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PASSWORD.md b/deps/curl/docs/libcurl/opts/CURLOPT_PASSWORD.md index 2551c46a..68297111 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PASSWORD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PASSWORD.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PROXYAUTH (3) - CURLOPT_USERNAME (3) - CURLOPT_USERPWD (3) +Protocol: + - All +Added-in: 7.19.1 --- # NAME @@ -34,13 +37,14 @@ CURLOPT_USERNAME(3) option. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT blank -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -61,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PATH_AS_IS.md b/deps/curl/docs/libcurl/opts/CURLOPT_PATH_AS_IS.md index 7f013f0b..ef780043 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PATH_AS_IS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PATH_AS_IS.md @@ -9,11 +9,14 @@ See-also: - CURLOPT_STDERR (3) - CURLOPT_URL (3) - curl_url_set (3) +Protocol: + - All +Added-in: 7.42.0 --- # NAME -CURLOPT_PATH_AS_IS - do not handle dot dot sequences +CURLOPT_PATH_AS_IS - do not handle dot-dot sequences # SYNOPSIS @@ -32,7 +35,7 @@ This instructs libcurl to NOT squash sequences of "/../" or "/./" that may exist in the URL's path part and that is supposed to be removed according to RFC 3986 section 5.2.4. -Some server implementations are known to (erroneously) require the dot dot +Some server implementations are known to (erroneously) require the dot-dot sequences to remain in the path and some clients want to pass these on in order to try out server implementations. @@ -45,9 +48,7 @@ The corresponding flag for the curl_url_set(3) function is called 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.42.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY.md b/deps/curl/docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY.md index 9d563195..10c7100c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY.md @@ -9,6 +9,16 @@ See-also: - CURLOPT_CAPATH (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - wolfSSL + - mbedTLS + - Secure Transport + - Schannel +Added-in: 7.39.0 --- # NAME @@ -48,9 +58,7 @@ option. NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -111,7 +119,7 @@ footer: -----END PUBLIC KEY----- ~~~ -# AVAILABILITY +# HISTORY ## PEM/DER support @@ -137,6 +145,8 @@ footer: Other SSL backends not supported. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PIPEWAIT.md b/deps/curl/docs/libcurl/opts/CURLOPT_PIPEWAIT.md index 0d7defa8..8226791d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PIPEWAIT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PIPEWAIT.md @@ -9,6 +9,9 @@ See-also: - CURLMOPT_PIPELINING (3) - CURLOPT_FORBID_REUSE (3) - CURLOPT_FRESH_CONNECT (3) +Protocol: + - HTTP +Added-in: 7.43.0 --- # NAME @@ -50,9 +53,7 @@ and support level. 0 (off) -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -69,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.43.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PORT.md b/deps/curl/docs/libcurl/opts/CURLOPT_PORT.md index 1cd40655..812311bf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PORT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PORT.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_PRIMARY_PORT (3) - CURLOPT_STDERR (3) - CURLOPT_URL (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -40,12 +43,10 @@ and therefore using a port number lower than zero or over 65535 causes a # DEFAULT -By default this is 0 which makes it not used. This also makes port number zero -impossible to set with this API. +0 which makes it not used. This also makes port number zero impossible to set +with this API. -# PROTOCOLS - -Used for all protocols that speak to a port number. +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_POST.md b/deps/curl/docs/libcurl/opts/CURLOPT_POST.md index 1e605eae..fe4656f1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_POST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_POST.md @@ -4,10 +4,13 @@ SPDX-License-Identifier: curl Title: CURLOPT_POST Section: 3 Source: libcurl +Protocol: + - HTTP See-also: - CURLOPT_HTTPPOST (3) - CURLOPT_POSTFIELDS (3) - - CURLOPT_PUT (3) + - CURLOPT_UPLOAD (3) +Added-in: 7.1 --- # NAME @@ -69,9 +72,7 @@ you should set a new request type explicitly as described above. 0, disabled -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -93,9 +94,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.md b/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.md index da71ecc5..8f6738f7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.md @@ -10,6 +10,10 @@ See-also: - CURLOPT_POSTFIELDSIZE (3) - CURLOPT_READFUNCTION (3) - CURLOPT_UPLOAD (3) +Protocol: + - HTTP + - MQTT +Added-in: 7.1 --- # NAME @@ -27,19 +31,19 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTFIELDS, char *postdata); # DESCRIPTION Pass a char pointer as parameter, pointing to the data buffer to use in an -HTTP POST operation. The data must be formatted and encoded the way you want -the server to receive it. libcurl does not convert or encode it in any -way. For example, the web server may assume that this data is URL encoded. +HTTP POST operation or an MQTT subscribe. The data must be formatted and +encoded the way you want the server to receive it. libcurl does not convert or +encode it in any way. For example, a web server may assume that this data is +URL encoded. The data pointed to is NOT copied by the library: as a consequence, it must be preserved by the calling application until the associated transfer finishes. This behavior can be changed (so libcurl does copy the data) by instead using the CURLOPT_COPYPOSTFIELDS(3) option. -This POST is a normal **application/x-www-form-urlencoded** kind (and -libcurl sets that Content-Type by default when this option is used), which is -commonly used by HTML forms. Change Content-Type with -CURLOPT_HTTPHEADER(3). +This POST is a normal **application/x-www-form-urlencoded** kind (and libcurl +sets that Content-Type by default when this option is used), which is commonly +used by HTML forms. Change Content-Type with CURLOPT_HTTPHEADER(3). You can use curl_easy_escape(3) to URL encode your data, if necessary. It returns a pointer to an encoded string that can be passed as @@ -47,15 +51,15 @@ necessary. It returns a pointer to an encoded string that can be passed as Using CURLOPT_POSTFIELDS(3) implies setting CURLOPT_POST(3) to 1. -If CURLOPT_POSTFIELDS(3) is explicitly set to NULL then libcurl gets the -POST data from the read callback. If you want to send a zero-byte POST set -CURLOPT_POSTFIELDS(3) to an empty string, or set CURLOPT_POST(3) -to 1 and CURLOPT_POSTFIELDSIZE(3) to 0. +If CURLOPT_POSTFIELDS(3) is explicitly set to NULL then libcurl gets the POST +data from the read callback. To send a zero-length (empty) POST, set +CURLOPT_POSTFIELDS(3) to an empty string, or set CURLOPT_POST(3) to 1 and +CURLOPT_POSTFIELDSIZE(3) to 0. libcurl assumes this option points to a null-terminated string unless you also -set CURLOPT_POSTFIELDSIZE(3) to specify the length of the provided data, -which then is strictly required if you want to send off null bytes included in -the data. +set CURLOPT_POSTFIELDSIZE(3) to specify the length of the provided data, which +then is strictly required if you want to send off null bytes included in the +data. Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header, and libcurl adds that header automatically if the POST is either known to be @@ -65,13 +69,14 @@ header with CURLOPT_HTTPHEADER(3) as usual. To make **multipart/formdata** posts, check out the CURLOPT_MIMEPOST(3) option combined with curl_mime_init(3). +Using this option multiple times makes the last set pointer override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -115,9 +120,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md b/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md index 41648706..b23a486a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_POSTFIELDS (3) - CURLOPT_POSTFIELDSIZE_LARGE (3) +Protocol: + - HTTP +Added-in: 7.2 --- # NAME @@ -35,9 +38,7 @@ If you post more than 2GB, use CURLOPT_POSTFIELDSIZE_LARGE(3). -1 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md index 4f2c5ea3..d06bf1a7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE_LARGE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_COPYPOSTFIELDS (3) - CURLOPT_POSTFIELDS (3) - CURLOPT_POSTFIELDSIZE (3) +Protocol: + - HTTP +Added-in: 7.11.1 --- # NAME @@ -35,9 +38,7 @@ CURLOPT_READFUNCTION(3) (if used) to signal the end of data. -1 -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_POSTQUOTE.md b/deps/curl/docs/libcurl/opts/CURLOPT_POSTQUOTE.md index b8c41a83..7efca604 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_POSTQUOTE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_POSTQUOTE.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_PREQUOTE (3) - CURLOPT_QUOTE (3) +Protocol: + - FTP + - SFTP +Added-in: 7.1 --- # NAME @@ -29,15 +33,17 @@ after your FTP transfer request. The commands are only issued if no error occur. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for CURLOPT_QUOTE(3). -Disable this operation again by setting a NULL to this option. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. # DEFAULT NULL -# PROTOCOLS - -SFTP and FTP +# %PROTOCOLS% # EXAMPLE @@ -60,12 +66,11 @@ int main(void) curl_easy_cleanup(curl); } + curl_slist_free_all(cmdlist); } ~~~ -# AVAILABILITY - -If support for the protocols are built-in. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_POSTREDIR.md b/deps/curl/docs/libcurl/opts/CURLOPT_POSTREDIR.md index b25e3357..c56ba990 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_POSTREDIR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_POSTREDIR.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_FOLLOWLOCATION (3) - CURLOPT_MAXREDIRS (3) - CURLOPT_POSTFIELDS (3) +Protocol: + - HTTP +Added-in: 7.19.1 --- # NAME @@ -46,9 +49,7 @@ when setting CURLOPT_FOLLOWLOCATION(3). 0 -# PROTOCOLS - -HTTP(S) +# %PROTOCOLS% # EXAMPLE @@ -71,10 +72,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.17.1. This option was known as CURLOPT_POST301 up to 7.19.0 as it -only supported the 301 then. CURL_REDIR_POST_303 was added in 7.26.0. +This option was known as CURLOPT_POST301 up to 7.19.0 as it only supported the +301 then. CURL_REDIR_POST_303 was added in 7.26.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PREQUOTE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PREQUOTE.md index 129cd6c8..12383ec4 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PREQUOTE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PREQUOTE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_POSTQUOTE (3) - CURLOPT_QUOTE (3) +Protocol: + - FTP +Added-in: 7.9.5 --- # NAME @@ -27,8 +30,13 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PREQUOTE, Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for -CURLOPT_QUOTE(3). Disable this operation again by setting a NULL to this -option. +CURLOPT_QUOTE(3). + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. These commands are not performed when a directory listing is performed, only for file transfers. @@ -40,9 +48,7 @@ this option does not. NULL -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -64,12 +70,11 @@ int main(void) curl_easy_cleanup(curl); } + curl_slist_free_all(cmdlist); } ~~~ -# AVAILABILITY - -Along with the protocol support +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PREREQDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_PREREQDATA.md index c3b351d0..f94ecc6f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PREREQDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PREREQDATA.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_PRIMARY_IP (3) - CURLINFO_PRIMARY_PORT (3) - CURLOPT_PREREQFUNCTION (3) +Protocol: + - All +Added-in: 7.80.0 --- # NAME @@ -31,9 +34,7 @@ argument in the pre-request callback set with CURLOPT_PREREQFUNCTION(3). NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -64,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.80.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md index 4df94ccc..8024a9a8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_PRIMARY_IP (3) - CURLINFO_PRIMARY_PORT (3) - CURLOPT_PREREQDATA (3) +Protocol: + - All +Added-in: 7.80.0 --- # NAME @@ -81,11 +84,9 @@ The pointer you set with CURLOPT_PREREQDATA(3). # DEFAULT -By default, this is NULL and unused. +NULL -# PROTOCOLS - -ALL +# %PROTOCOLS% # EXAMPLE @@ -116,9 +117,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.80.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PRE_PROXY.md b/deps/curl/docs/libcurl/opts/CURLOPT_PRE_PROXY.md index 252abfbc..666f90cd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PRE_PROXY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PRE_PROXY.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_HTTPPROXYTUNNEL (3) - CURLOPT_PROXY (3) +Protocol: + - All +Added-in: 7.52.0 --- # NAME @@ -45,19 +48,20 @@ be used. Otherwise SOCKS4 is used as default. Setting the pre proxy string to "" (an empty string) explicitly disables the use of a pre proxy. +When you set a hostname to use, do not assume that there is any particular +single port number used widely for proxies. Specify it. + The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -Default is NULL, meaning no pre proxy is used. +NULL -When you set a hostname to use, do not assume that there is any particular -single port number used widely for proxies. Specify it! - -# PROTOCOLS - -All except file://. Note that some protocols do not work well over proxy. +# %PROTOCOLS% # EXAMPLE @@ -74,9 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PRIVATE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PRIVATE.md index 969f8584..580ba243 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PRIVATE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PRIVATE.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_PRIVATE (3) - CURLOPT_STDERR (3) - CURLOPT_VERBOSE (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -33,9 +36,7 @@ never does anything with this data. NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md index 01e006d4..6f501f2e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_PROGRESSFUNCTION (3) - CURLOPT_XFERINFOFUNCTION (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -28,11 +31,9 @@ argument in the progress callback set with CURLOPT_PROGRESSFUNCTION(3). # DEFAULT -The default value of this parameter is NULL. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -71,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md index 88e5b189..eb0981e0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_NOPROGRESS (3) - CURLOPT_VERBOSE (3) - CURLOPT_XFERINFOFUNCTION (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -57,11 +60,13 @@ if you only download data, the upload size remains 0). Many times the callback is called one or more times first, before it knows the data sizes so a program must be made to handle that. +Return zero from the callback if everything is fine. + If your callback function returns CURL_PROGRESSFUNC_CONTINUE it causes libcurl to continue executing the default progress function. -Returning any other non-zero value from this callback makes libcurl abort the -transfer and return *CURLE_ABORTED_BY_CALLBACK*. +Return 1 from this callback to make libcurl abort the transfer and return +*CURLE_ABORTED_BY_CALLBACK*. If you transfer data with the multi interface, this function is not called during periods of idleness unless you call the appropriate libcurl function @@ -72,12 +77,9 @@ get called. # DEFAULT -By default, libcurl has an internal progress meter. That is rarely wanted by -users. +NULL. libcurl has an internal progress meter. That is rarely wanted by users. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -116,10 +118,12 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED Deprecated since 7.32.0. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS.md index b9258892..346d9f58 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DEFAULT_PROTOCOL (3) - CURLOPT_REDIR_PROTOCOLS (3) - CURLOPT_URL (3) +Protocol: + - All +Added-in: 7.19.4 --- # NAME @@ -26,7 +29,7 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROTOCOLS, long bitmask); This option is deprecated. We strongly recommend using CURLOPT_PROTOCOLS_STR(3) instead because this option cannot control all -available protocols! +available protocols. Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in the transfer. This allows you to have @@ -71,9 +74,7 @@ CURLPROTO_TFTP All protocols built-in. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -95,9 +96,11 @@ int main(int argc, char **argv) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.19.4. Deprecated since 7.85.0. +Deprecated since 7.85.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md index cc13c529..85452085 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROTOCOLS_STR.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_REDIR_PROTOCOLS_STR (3) - CURLOPT_URL (3) - curl_version_info (3) +Protocol: + - All +Added-in: 7.85.0 --- # NAME @@ -46,17 +49,18 @@ You can set "ALL" as a short-cut to enable all protocols. Note that by setting all, you may enable protocols that were not supported the day you write this but are introduced in a future libcurl version. -curl_version_info(3) can be used to get a list of all supported -protocols in the current libcurl. CURLINFO_SCHEME(3) is the recommended -way to figure out the protocol used in a previous transfer. +curl_version_info(3) can be used to get a list of all supported protocols in +the current libcurl. CURLINFO_SCHEME(3) is the recommended way to figure out +the protocol used in a previous transfer. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore to the internal default. # DEFAULT All protocols built-in -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -77,9 +81,7 @@ int main(int argc, char **argv) } ~~~ -# AVAILABILITY - -Added in 7.85.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY.md index fdc98780..7c845560 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PRE_PROXY (3) - CURLOPT_PROXYPORT (3) - CURLOPT_PROXYTYPE (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -38,6 +41,12 @@ defaults to using port 1080 for proxies. The proxy string may be prefixed with [scheme]:// to specify which kind of proxy is used. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +The application does not have to keep the string around after setting this +option. + ## http:// HTTP Proxy. Default when no scheme or proxy type is specified. @@ -45,7 +54,7 @@ HTTP Proxy. Default when no scheme or proxy type is specified. ## https:// HTTPS Proxy. (Added in 7.52.0 for OpenSSL and GnuTLS Since 7.87.0, it -also works for BearSSL, mbedTLS, rustls, Schannel, Secure Transport and +also works for BearSSL, mbedTLS, Rustls, Schannel, Secure Transport and wolfSSL.) This uses HTTP/1 by default. Setting CURLOPT_PROXYTYPE(3) to @@ -67,15 +76,16 @@ SOCKS5 Proxy. SOCKS5 Proxy. Proxy resolves URL hostname. -Without a scheme prefix, CURLOPT_PROXYTYPE(3) can be used to specify -which kind of proxy the string identifies. +## + +Without a scheme prefix, CURLOPT_PROXYTYPE(3) can be used to specify which +kind of proxy the string identifies. When you tell the library to use an HTTP proxy, libcurl transparently converts operations to HTTP even if you specify an FTP URL etc. This may have an impact -on what other features of the library you can use, such as -CURLOPT_QUOTE(3) and similar FTP specifics that do not work unless you -tunnel through the HTTP proxy. Such tunneling is activated with -CURLOPT_HTTPPROXYTUNNEL(3). +on what other features of the library you can use, such as CURLOPT_QUOTE(3) +and similar FTP specifics that do not work unless you tunnel through the HTTP +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. @@ -86,12 +96,16 @@ user + password. 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 -The application does not have to keep the string around after setting this -option. +When you set a hostname to use, do not assume that there is any particular +single port number used widely for proxies. Specify it. When a proxy is used, the active FTP mode as set with *CUROPT_FTPPORT(3)*, cannot be used. +Doing FTP over an HTTP proxy without CURLOPT_HTTPPROXYTUNNEL(3) set makes +libcurl do HTTP with an FTP URL over the proxy. For such transfers, common FTP +specific options do not work, for example CURLOPT_USE_SSL(3). + # Environment variables libcurl respects the proxy environment variables named **http_proxy**, @@ -107,14 +121,9 @@ variables. # DEFAULT -Default is NULL, meaning no proxy is used. +NULL -When you set a hostname to use, do not assume that there is any particular -single port number used widely for proxies. Specify it! - -# PROTOCOLS - -All except file://. Note that some protocols do not work well over proxy. +# %PROTOCOLS% # EXAMPLE @@ -130,7 +139,7 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY Since 7.14.1 the proxy environment variable names can include the protocol scheme. @@ -140,6 +149,8 @@ Since 7.21.7 the proxy string supports the socks protocols as "schemes". Since 7.50.2, unsupported schemes in proxy strings cause libcurl to return error. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYAUTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYAUTH.md index b5234625..1609cbaf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYAUTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYAUTH.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_PROXYPORT (3) - CURLOPT_PROXYTYPE (3) - CURLOPT_PROXYUSERPWD (3) +Protocol: + - All +Added-in: 7.10.7 --- # NAME @@ -41,9 +44,7 @@ CURLOPT_HTTPAUTH(3) man page. CURLAUTH_BASIC -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.7 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYHEADER.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYHEADER.md index 21494e15..e74210ab 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYHEADER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYHEADER.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_HEADEROPT (3) - CURLOPT_HTTPHEADER (3) +Protocol: + - All +Added-in: 7.37.0 --- # NAME @@ -36,15 +39,17 @@ NOT a header and cannot be replaced using this option. Only the lines following the request-line are headers. Adding this method line in this list of headers causes your request to send an invalid header. -Pass a NULL to this to reset back to no custom headers. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -71,9 +76,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.37.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPASSWORD.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPASSWORD.md index bc931666..5086a4b3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPASSWORD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPASSWORD.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PASSWORD (3) - CURLOPT_PROXYAUTH (3) - CURLOPT_PROXYUSERNAME (3) +Protocol: + - All +Added-in: 7.19.1 --- # NAME @@ -25,22 +28,23 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPASSWORD, char *pwd); # DESCRIPTION -Pass a char pointer as parameter, which should be pointing to the null-terminated -password to use for authentication with the proxy. +Pass a char pointer as parameter, which should be pointing to the +null-terminated password to use for authentication with the proxy. -The CURLOPT_PROXYPASSWORD(3) option should be used in conjunction with -the CURLOPT_PROXYUSERNAME(3) option. +The CURLOPT_PROXYPASSWORD(3) option should be used in conjunction with the +CURLOPT_PROXYUSERNAME(3) option. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT blank -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -60,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPORT.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPORT.md index d2193ff0..b0113ac0 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPORT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYPORT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PORT (3) - CURLOPT_PROXY (3) - CURLOPT_PROXYTYPE (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -28,19 +31,21 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPORT, long port); We discourage use of this option. Pass a long with this option to set the proxy port to connect to unless it is -specified in the proxy string CURLOPT_PROXY(3) or uses 443 for https -proxies and 1080 for all others as default. +specified in the proxy string CURLOPT_PROXY(3) or uses 443 for https proxies +and 1080 for all others as default. + +Disabling this option, setting it to zero, makes it not specified which makes +libcurl use the default proxy port number or the port number specified in the +proxy URL string. While this accepts a 'long', the port number is 16 bit so it cannot be larger than 65535. # DEFAULT -0, not specified which makes it use the default port +0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYTYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYTYPE.md index 96d9269b..15aa2f84 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYTYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYTYPE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYPORT (3) +Protocol: + - All +Added-in: 7.10 --- # NAME @@ -32,7 +35,7 @@ HTTP Proxy. Default. ## CURLPROXY_HTTPS HTTPS Proxy using HTTP/1. (Added in 7.52.0 for OpenSSL and GnuTLS. Since -7.87.0, it also works for BearSSL, mbedTLS, rustls, Schannel, Secure Transport +7.87.0, it also works for BearSSL, mbedTLS, Rustls, Schannel, Secure Transport and wolfSSL.) ## CURLPROXY_HTTPS2 @@ -61,6 +64,8 @@ SOCKS5 Proxy. SOCKS5 Proxy. Proxy resolves URL hostname. +## + Often it is more convenient to specify the proxy type with the scheme part of the CURLOPT_PROXY(3) string. @@ -68,9 +73,7 @@ the CURLOPT_PROXY(3) string. CURLPROXY_HTTP -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -90,9 +93,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERNAME.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERNAME.md index 330a762d..7e0b0cab 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERNAME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERNAME.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PROXYAUTH (3) - CURLOPT_PROXYPASSWORD (3) - CURLOPT_USERNAME (3) +Protocol: + - All +Added-in: 7.19.1 --- # NAME @@ -41,9 +44,7 @@ option. blank -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERPWD.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERPWD.md index 7a49119c..acfd86f7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERPWD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXYUSERPWD.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PROXYPASSWORD (3) - CURLOPT_PROXYTYPE (3) - CURLOPT_PROXYUSERNAME (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -36,13 +39,14 @@ Use CURLOPT_PROXYAUTH(3) to specify the authentication method. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -This is NULL by default. +NULL -# PROTOCOLS - -Used with all protocols that can use a proxy +# %PROTOCOLS% # EXAMPLE @@ -61,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md index dac73f38..6365d5f2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO.md @@ -14,6 +14,11 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.52.0 --- # NAME @@ -51,15 +56,17 @@ method of verifying the peer's certificate chain. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again and switches back to +internal default. + The default value for this can be figured out with CURLINFO_CAINFO(3). # DEFAULT Built-in system specific -# PROTOCOLS - -Used with HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -79,14 +86,14 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# NOTES For TLS backends that do not support certificate files, the CURLOPT_PROXY_CAINFO(3) option is ignored. Refer to https://curl.se/docs/ssl-compared.html +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md index 2706dec1..91ef9a7c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.md @@ -14,6 +14,14 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - rustls + - Secure Transport + - Schannel +Added-in: 7.77.0 --- # NAME @@ -50,9 +58,7 @@ This option overrides CURLOPT_PROXY_CAINFO(3). NULL -# PROTOCOLS - -Used with HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -79,12 +85,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.77.0. - -This option is supported by the rustls (since 7.82.0), OpenSSL, Secure -Transport and Schannel backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md index 6d649045..d0fce53c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CAPATH.md @@ -10,6 +10,13 @@ See-also: - CURLOPT_PROXY_CAINFO (3) - CURLOPT_PROXY_SSL_VERIFYHOST (3) - CURLOPT_STDERR (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS +Added-in: 7.52.0 --- # NAME @@ -35,15 +42,17 @@ CURLOPT_PROXY_SSL_VERIFYPEER(3) is enabled (which it is by default). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again and switch back to +internal default. + The default value for this can be figured out with CURLINFO_CAPATH(3). # DEFAULT NULL -# PROTOCOLS - -Everything used over an HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -63,12 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 - -This option is supported by the OpenSSL, GnuTLS, and mbedTLS (since 7.56.0) -backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CRLFILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CRLFILE.md index 51d1728e..9dfeeefe 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CRLFILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_CRLFILE.md @@ -9,6 +9,13 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - GnuTLS + - mbedTLS + - OpenSSL +Added-in: 7.52.0 --- # NAME @@ -48,13 +55,14 @@ the CRL does not trigger this specific error. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -Used with HTTPS proxy. +# %PROTOCOLS% # EXAMPLE @@ -73,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md index 093dadfd..0b7e45de 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT.md @@ -10,6 +10,12 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.71.0 --- # NAME @@ -34,25 +40,25 @@ additional check is useful in multi-level PKI where one needs to enforce that the peer certificate is from a specific branch of the tree. This option makes sense only when used in combination with the -CURLOPT_PROXY_SSL_VERIFYPEER(3) option. Otherwise, the result of the -check is not considered as failure. +CURLOPT_PROXY_SSL_VERIFYPEER(3) option. Otherwise, the result of the check is +not considered as failure. A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option, which is returned if the setup of the SSL/TLS session has failed due to a -mismatch with the issuer of peer certificate -(CURLOPT_PROXY_SSL_VERIFYPEER(3) has to be set too for the check to -fail). +mismatch with the issuer of peer certificate (CURLOPT_PROXY_SSL_VERIFYPEER(3) +has to be set too for the check to fail). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -72,9 +78,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md index 4f4e153d..002704fc 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_ISSUERCERT_BLOB.md @@ -10,6 +10,11 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.71.0 --- # NAME @@ -55,9 +60,7 @@ instead expects a filename as input. NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -85,9 +88,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md index 7750dd24..6b417cb4 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_KEYPASSWD.md @@ -9,6 +9,14 @@ See-also: - CURLOPT_PROXY_SSLKEY (3) - CURLOPT_SSH_PRIVATE_KEYFILE (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - mbedTLS + - Schannel + - wolfSSL +Added-in: 7.52.0 --- # NAME @@ -28,20 +36,21 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_KEYPASSWD, char *pwd); This option is for connecting to an HTTPS proxy, not an HTTPS server. Pass a pointer to a null-terminated string as parameter. It is used as the -password required to use the CURLOPT_PROXY_SSLKEY(3) private key. You -never need a pass phrase to load a certificate but you need one to load your -private key. +password required to use the CURLOPT_PROXY_SSLKEY(3) private key. You never +need a passphrase to load a certificate but you need one to load your private +key. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -Used with HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -60,9 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md index 6d97bf48..6bb75fc6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_PINNEDPUBLICKEY.md @@ -10,6 +10,14 @@ See-also: - CURLOPT_PROXY_CAPATH (3) - CURLOPT_PROXY_SSL_VERIFYHOST (3) - CURLOPT_PROXY_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - wolfSSL +Added-in: 7.52.0 --- # NAME @@ -42,13 +50,14 @@ On mismatch, *CURLE_SSL_PINNEDPUBKEYNOTMATCH* is returned. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -106,7 +115,7 @@ footer: -----END PUBLIC KEY----- ~~~ -# AVAILABILITY +# HISTORY PEM/DER support: @@ -118,6 +127,8 @@ sha256 support: Other SSL backends not supported. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SERVICE_NAME.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SERVICE_NAME.md index 57a8161e..7083e252 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SERVICE_NAME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SERVICE_NAME.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYTYPE (3) - CURLOPT_SERVICE_NAME (3) +Protocol: + - All +Added-in: 7.43.0 --- # NAME @@ -32,13 +35,14 @@ service. The default service name is **"HTTP"** for HTTP based proxies and The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT See above -# PROTOCOLS - -All network protocols +# %PROTOCOLS% # EXAMPLE @@ -55,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.43.0 for HTTP proxies, 7.49.0 for SOCKS5 proxies. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md index 343d1363..c26f00ca 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT.md @@ -8,6 +8,16 @@ See-also: - CURLOPT_PROXY_SSLCERTTYPE (3) - CURLOPT_PROXY_SSLKEY (3) - CURLOPT_SSLCERT (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - Schannel + - Secure Transport + - wolfSSL +Added-in: 7.52.0 --- # NAME @@ -42,13 +52,14 @@ private key with CURLOPT_PROXY_SSLKEY(3). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -Used with HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -69,9 +80,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md index f019d7c3..fad7a6d7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERTTYPE.md @@ -8,6 +8,16 @@ See-also: - CURLOPT_PROXY_SSLCERT (3) - CURLOPT_PROXY_SSLKEY (3) - CURLOPT_SSLCERTTYPE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - Schannel + - Secure Transport + - wolfSSL +Added-in: 7.52.0 --- # NAME @@ -29,19 +39,20 @@ the format of your client certificate used when connecting to an HTTPS proxy. Supported formats are "PEM" and "DER", except with Secure Transport or Schannel. OpenSSL (versions 0.9.3 and later), Secure Transport (on iOS 5 or -later, or OS X 10.7 or later) and Schannel support "P12" for PKCS#12-encoded +later, or macOS 10.7 or later) and Schannel support "P12" for PKCS#12-encoded files. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT "PEM" -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -63,11 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md index 7d6bc6fc..2abbbb4d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLCERT_BLOB.md @@ -9,6 +9,13 @@ See-also: - CURLOPT_PROXY_SSLCERTTYPE (3) - CURLOPT_PROXY_SSLKEY (3) - CURLOPT_SSLCERT_BLOB (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - Schannel + - Secure Transport +Added-in: 7.71.0 --- # NAME @@ -43,9 +50,7 @@ expects a filename as input. NULL -# PROTOCOLS - -Used with HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -74,10 +79,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL, Secure Transport and -Schannel backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md index 0ef09a4d..6352d0e8 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY.md @@ -10,6 +10,14 @@ See-also: - CURLOPT_SSLCERT (3) - CURLOPT_SSLKEY (3) - CURLOPT_SSLKEYTYPE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - mbedTLS + - Schannel + - wolfSSL +Added-in: 7.52.0 --- # NAME @@ -31,20 +39,21 @@ the filename of your private key used for connecting to the HTTPS proxy. The default format is "PEM" and can be changed with CURLOPT_PROXY_SSLKEYTYPE(3). -(Windows, iOS and Mac OS X) This option is ignored by Secure Transport and +(Windows, iOS and macOS) This option is ignored by Secure Transport and Schannel SSL backends because they expect the private key to be already present in the key chain or PKCS#12 file containing the certificate. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -65,11 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md index 03264dbf..672318d2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEYTYPE.md @@ -8,6 +8,13 @@ See-also: - CURLOPT_PROXY_SSLCERT (3) - CURLOPT_PROXY_SSLKEY (3) - CURLOPT_SSLKEYTYPE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - BearSSL + - wolfSSL +Added-in: 7.52.0 --- # NAME @@ -32,9 +39,10 @@ the format of your private key. Supported formats are "PEM", "DER" and "ENG". The application does not have to keep the string around after setting this option. -# PROTOCOLS +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. -Used with HTTPS proxy +# %PROTOCOLS% # EXAMPLE @@ -56,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md index 67716532..06ccac49 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLKEY_BLOB.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_SSLKEY (3) - CURLOPT_SSLKEYTYPE (3) - CURLOPT_SSLKEY_BLOB (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.71.0 --- # NAME @@ -38,9 +43,7 @@ setting this. NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -76,9 +79,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md index f59240ba..1b179521 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_IPRESOLVE (3) - CURLOPT_SSLVERSION (3) - CURLOPT_USE_SSL (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.52.0 --- # NAME @@ -55,10 +60,13 @@ TLSv1.2 ## CURL_SSLVERSION_TLSv1_3 TLSv1.3 -The maximum TLS version can be set by using *one* of the -CURL_SSLVERSION_MAX_ macros below. It is also possible to OR *one* of the -CURL_SSLVERSION_ macros with *one* of the CURL_SSLVERSION_MAX_ macros. -The MAX macros are not supported for WolfSSL. + +## + +The maximum TLS version can be set by using *one* of the CURL_SSLVERSION_MAX_ +macros below. It is also possible to OR *one* of the CURL_SSLVERSION_ macros +with *one* of the CURL_SSLVERSION_MAX_ macros. The MAX macros are not +supported for wolfSSL. ## CURL_SSLVERSION_MAX_DEFAULT @@ -86,6 +94,8 @@ The flag defines maximum supported TLS version as TLSv1.2. The flag defines maximum supported TLS version as TLSv1.3. (Added in 7.54.0) +## + In versions of curl prior to 7.54 the CURL_SSLVERSION_TLS options were documented to allow *only* the specified TLS version, but behavior was inconsistent depending on the TLS library. @@ -94,9 +104,7 @@ inconsistent depending on the TLS library. CURL_SSLVERSION_DEFAULT -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -116,9 +124,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md index 11bce717..60776047 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_CIPHER_LIST.md @@ -10,6 +10,17 @@ See-also: - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_CIPHER_LIST (3) - CURLOPT_TLS13_CIPHERS (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - BearSSL + - Schannel + - Secure Transport + - wolfSSL + - mbedTLS + - rustls +Added-in: 7.52.0 --- # NAME @@ -28,24 +39,20 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_CIPHER_LIST, # DESCRIPTION Pass a char pointer, pointing to a null-terminated string holding the list of -ciphers to use for the connection to the HTTPS proxy. The list must be -syntactically correct, it consists of one or more cipher strings separated by -colons. Commas or spaces are also acceptable separators but colons are -normally used, &!, &- and &+ can be used as operators. +cipher suites to use for the TLS 1.2 (1.1, 1.0) connection to the HTTPS proxy. +The list must be syntactically correct, it consists of one or more cipher suite +strings separated by colons. -For OpenSSL and GnuTLS valid examples of cipher lists include **RC4-SHA**, -**SHA1+DES**, **TLSv1** and **DEFAULT**. The default list is normally -set when you compile OpenSSL. +For setting TLS 1.3 ciphers see CURLOPT_PROXY_TLS13_CIPHERS(3). -For WolfSSL, valid examples of cipher lists include **ECDHE-RSA-RC4-SHA**, -**AES256-SHA:AES256-SHA256**, etc. +A valid example of a cipher list is: +~~~ +"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:" +"ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305" +~~~ -For BearSSL, valid examples of cipher lists include -**ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256**, or when using IANA names -**TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256**, -etc. -With BearSSL you do not add/remove ciphers. If one uses this option then all -known ciphers are disabled and only those passed in are enabled. +For Schannel, you can use this option to set algorithms but not specific +cipher suites. Refer to the ciphers lists document for algorithms. Find more details about cipher lists on this URL: @@ -54,13 +61,14 @@ Find more details about cipher lists on this URL: The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -NULL, use internal default +NULL, use internal built-in list. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -72,20 +80,26 @@ int main(void) CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost"); - curl_easy_setopt(curl, CURLOPT_PROXY_SSL_CIPHER_LIST, "TLSv1"); + curl_easy_setopt(curl, CURLOPT_PROXY_SSL_CIPHER_LIST, + "ECDHE-ECDSA-CHACHA20-POLY1305:" + "ECDHE-RSA-CHACHA20-POLY1305"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.52.0, in 7.83.0 for BearSSL +OpenSSL support added in 7.52.0. +wolfSSL, Schannel, Secure Transport, and BearSSL support added in 7.87.0 +mbedTLS support added in 8.8.0. +Rustls support added in 8.10.0. -If built TLS enabled. +Since curl 8.10.0 returns CURLE_NOT_BUILT_IN when not supported. + +# %AVAILABILITY% # RETURN VALUE -Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or -CURLE_OUT_OF_MEMORY if there was insufficient heap space. +Returns CURLE_OK if supported, CURLE_NOT_BUILT_IN otherwise. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md index a2aa05a4..02bc267c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_PROXY_SSL_CIPHER_LIST (3) - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_CIPHER_LIST (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.52.0 --- # NAME @@ -87,9 +92,7 @@ could be a privacy violation and unexpected. 0 -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -110,9 +113,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYHOST.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYHOST.md index 40c588b7..0d195daf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYHOST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYHOST.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_PROXY_CAINFO (3) - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.52.0 --- # NAME @@ -51,7 +56,7 @@ an error and leaving the flag untouched. From 7.66.0: treats 1 and 2 the same. When the *verify* value is 0L, the connection succeeds regardless of the -names used in the certificate. Use that ability with caution! +names used in the certificate. Use that ability with caution. See also CURLOPT_PROXY_SSL_VERIFYPEER(3) to verify the digital signature of the proxy certificate. @@ -60,9 +65,7 @@ of the proxy certificate. 2 -# PROTOCOLS - -All protocols when used over an HTTPS proxy. +# %PROTOCOLS% # EXAMPLE @@ -81,11 +84,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0. - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYPEER.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYPEER.md index 916ae90d..b29a4235 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYPEER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_SSL_VERIFYPEER.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.52.0 --- # NAME @@ -62,9 +67,7 @@ the correct end-point. 1 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -83,11 +86,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md index 605379a0..ba5d97ed 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLS13_CIPHERS.md @@ -10,6 +10,15 @@ See-also: - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_CIPHER_LIST (3) - CURLOPT_TLS13_CIPHERS (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - Schannel + - wolfSSL + - mbedTLS + - rustls +Added-in: 7.61.0 --- # NAME @@ -32,24 +41,28 @@ cipher suites to use for the TLS 1.3 connection to a proxy. The list must be syntactically correct, it consists of one or more cipher suite strings separated by colons. +For setting TLS 1.2 (1.1, 1.0) ciphers see CURLOPT_PROXY_SSL_CIPHER_LIST(3). + +A valid example of a cipher list is: +~~~ +"TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256" +~~~ + Find more details about cipher lists on this URL: https://curl.se/docs/ssl-ciphers.html -This option is currently used only when curl is built to use OpenSSL 1.1.1 or -later. If you are using a different SSL backend you can try setting TLS 1.3 -cipher suites by using the CURLOPT_PROXY_SSL_CIPHER_LIST(3) option. - The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -NULL, use internal default +NULL, use internal built-in list -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -68,10 +81,19 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.61.0. -Available when built with OpenSSL \>= 1.1.1. +OpenSSL support added in 7.61.0, available when built with OpenSSL \>= 1.1.1. +Schannel support added in 7.87.0. +LibreSSL support added in 8.3.0, available when built with LibreSSL \>= 3.4.1. +wolfSSL support added in 8.10.0. +mbedTLS support added in 8.10.0, available when built with mbedTLS \>= 3.6.0. +Rustls support added in 8.10.0. + +Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set +by using the CURLOPT_PROXY_SSL_CIPHER_LIST(3) option. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md index e7885905..b92b2e27 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_PASSWORD.md @@ -9,6 +9,12 @@ See-also: - CURLOPT_PROXY_TLSAUTH_USERNAME (3) - CURLOPT_TLSAUTH_TYPE (3) - CURLOPT_TLSAUTH_USERNAME (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.52.0 --- # NAME @@ -34,13 +40,14 @@ CURLOPT_PROXY_TLSAUTH_USERNAME(3) option also be set. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0, with the OpenSSL and GnuTLS backends only +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md index 85ee86d7..436a5709 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_TYPE.md @@ -9,6 +9,12 @@ See-also: - CURLOPT_PROXY_TLSAUTH_USERNAME (3) - CURLOPT_TLSAUTH_PASSWORD (3) - CURLOPT_TLSAUTH_USERNAME (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.52.0 --- # NAME @@ -30,24 +36,25 @@ Pass a pointer to a null-terminated string as parameter. The string should be the method of the TLS authentication used for the HTTPS connection. Supported method is "SRP". +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore to internal default. + +The application does not have to keep the string around after setting this +option. + ## SRP TLS-SRP authentication. Secure Remote Password authentication for TLS is defined in RFC 5054 and provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set the -CURLOPT_PROXY_TLSAUTH_USERNAME(3) and -CURLOPT_PROXY_TLSAUTH_PASSWORD(3) options. - -The application does not have to keep the string around after setting this -option. +CURLOPT_PROXY_TLSAUTH_USERNAME(3) and CURLOPT_PROXY_TLSAUTH_PASSWORD(3) +options. # DEFAULT blank -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -68,12 +75,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0 - -You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this -to work. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md index a50c1d54..6a25f74d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TLSAUTH_USERNAME.md @@ -9,6 +9,12 @@ See-also: - CURLOPT_PROXY_TLSAUTH_TYPE (3) - CURLOPT_TLSAUTH_PASSWORD (3) - CURLOPT_TLSAUTH_TYPE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.52.0 --- # NAME @@ -34,13 +40,14 @@ CURLOPT_PROXY_TLSAUTH_PASSWORD(3) option also be set. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.52.0, with the OpenSSL and GnuTLS backends only. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TRANSFER_MODE.md b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TRANSFER_MODE.md index 233cad72..a0ac9491 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TRANSFER_MODE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PROXY_TRANSFER_MODE.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTPPROXYTUNNEL (3) - CURLOPT_PROXY (3) - CURLOPT_TRANSFERTEXT (3) +Protocol: + - All +Added-in: 7.18.0 --- # NAME @@ -36,9 +39,7 @@ doing FTP via a proxy. Beware that not all proxies support this feature. 0, disabled -# PROTOCOLS - -FTP over proxy +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.18.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_PUT.md b/deps/curl/docs/libcurl/opts/CURLOPT_PUT.md index 7ba4fc60..43bf645d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_PUT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_PUT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_MIMEPOST (3) - CURLOPT_POSTFIELDS (3) - CURLOPT_UPLOAD (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -35,9 +38,7 @@ This option is **deprecated** since version 7.12.1. Use CURLOPT_UPLOAD(3). 0, disabled -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -80,9 +81,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Deprecated since 7.12.1. Do not use. +Deprecated since 7.12.1. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_QUICK_EXIT.md b/deps/curl/docs/libcurl/opts/CURLOPT_QUICK_EXIT.md index b3fd1056..e13b43ca 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_QUICK_EXIT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_QUICK_EXIT.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_FAILONERROR (3) - CURLOPT_RESOLVE (3) +Protocol: + - All +Added-in: 7.87.0 --- # NAME @@ -35,9 +38,7 @@ possible (though short-lived) leak of associated resources. 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -53,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.87.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_QUOTE.md b/deps/curl/docs/libcurl/opts/CURLOPT_QUOTE.md index 7efe0d8e..41034714 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_QUOTE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_QUOTE.md @@ -9,6 +9,10 @@ See-also: - CURLOPT_DIRLISTONLY (3) - CURLOPT_POSTQUOTE (3) - CURLOPT_PREQUOTE (3) +Protocol: + - FTP + - SFTP +Added-in: 7.1 --- # NAME @@ -33,7 +37,9 @@ of 'struct curl_slist' structs properly filled in with text strings. Use curl_slist_append(3) to append strings (commands) to the list, and clear the entire list afterwards with curl_slist_free_all(3). -Disable this operation again by setting a NULL to this option. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. libcurl does not copy the list, +it needs to be kept around until after the transfer has completed. When speaking to an FTP server, prefix the command with an asterisk (*) to make libcurl continue even if the command fails as by default libcurl stops at @@ -124,9 +130,7 @@ See ln. NULL -# PROTOCOLS - -SFTP and FTP +# %PROTOCOLS% # EXAMPLE @@ -149,13 +153,17 @@ int main(void) curl_easy_cleanup(curl); } + + curl_slist_free_all(cmdlist); } ~~~ -# AVAILABILITY +# HISTORY SFTP support added in 7.16.3. *-prefix for SFTP added in 7.24.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RANDOM_FILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_RANDOM_FILE.md index 0f05337f..41cc75f2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RANDOM_FILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RANDOM_FILE.md @@ -6,6 +6,11 @@ Section: 3 Source: libcurl See-also: - CURLOPT_EGDSOCKET (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.7 --- # NAME @@ -24,44 +29,16 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RANDOM_FILE, char *path); Deprecated option. It serves no purpose anymore. -Pass a char pointer to a null-terminated filename. The file might be used to -read from to seed the random engine for SSL and more. - -The application does not have to keep the string around after setting this -option. - # DEFAULT NULL, not used -# PROTOCOLS +# DEPRECATED -All +Deprecated since 7.84.0. -# EXAMPLE - -~~~c -int main(void) -{ - CURL *curl = curl_easy_init(); - if(curl) { - CURLcode res; - curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_RANDOM_FILE, "junk.txt"); - res = curl_easy_perform(curl); - curl_easy_cleanup(curl); - } -} -~~~ - -# AVAILABILITY - -If built with TLS enabled. Only the OpenSSL backend uses this, and only with -OpenSSL versions before 1.1.0. - -This option was deprecated in 7.84.0. +# %AVAILABILITY% # RETURN VALUE -Returns CURLE_OK on success or -CURLE_OUT_OF_MEMORY if there was insufficient heap space. +Returns CURLE_OK. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RANGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_RANGE.md index a770c244..6d728b16 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RANGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RANGE.md @@ -9,6 +9,13 @@ See-also: - CURLOPT_MAXFILESIZE_LARGE (3) - CURLOPT_MAX_RECV_SPEED_LARGE (3) - CURLOPT_RESUME_FROM (3) +Protocol: + - HTTP + - FTP + - FILE + - RTSP + - SFTP +Added-in: 7.1 --- # NAME @@ -43,7 +50,8 @@ RTSP, byte ranges are **not** permitted. Instead, ranges should be given in For HTTP PUT uploads this option should not be used, since it may conflict with other options. -Pass a NULL to this option to disable the use of ranges. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. The application does not have to keep the string around after setting this option. @@ -52,9 +60,7 @@ option. NULL -# PROTOCOLS - -HTTP, FTP, FILE, RTSP and SFTP. +# %PROTOCOLS% # EXAMPLE @@ -74,10 +80,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY FILE since 7.18.0, RTSP since 7.20.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK on success or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_READDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_READDATA.md index 94086647..ae3ac3c4 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_READDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_READDATA.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_READFUNCTION (3) - CURLOPT_WRITEDATA (3) - CURLOPT_WRITEFUNCTION (3) +Protocol: + - All +Added-in: 7.9.7 --- # NAME @@ -38,11 +41,9 @@ might experience crashes. # DEFAULT -By default, this is a FILE * to stdin. +stdin -# PROTOCOLS - -This is used for all protocols when sending data. +# %PROTOCOLS% # EXAMPLE @@ -67,11 +68,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY This option was once known by the older name CURLOPT_INFILE, the name CURLOPT_READDATA(3) was introduced in 7.9.7. +# %AVAILABILITY% + # RETURN VALUE This returns CURLE_OK. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_READFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_READFUNCTION.md index b7eddbc4..9e3c3d1f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_READFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_READFUNCTION.md @@ -11,6 +11,9 @@ See-also: - CURLOPT_UPLOAD (3) - CURLOPT_UPLOAD_BUFFERSIZE (3) - CURLOPT_WRITEFUNCTION (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -70,11 +73,9 @@ and it allows for better error checking. # DEFAULT -The default internal read callback is fread(). +fread(3) -# PROTOCOLS - -This is used for all protocols when doing uploads. +# %PROTOCOLS% # EXAMPLE @@ -85,7 +86,7 @@ size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userdata) curl_off_t nread; /* copy as much data as possible into the 'ptr' buffer, but no more than - 'size' * 'nmemb' bytes! */ + 'size' * 'nmemb' bytes. */ size_t retcode = fread(ptr, size, nmemb, readhere); nread = (curl_off_t)retcode; @@ -113,11 +114,13 @@ int main(int argc, char **argv) } ~~~ -# AVAILABILITY +# HISTORY CURL_READFUNC_PAUSE return code was added in 7.18.0 and CURL_READFUNC_ABORT was added in 7.12.1. +# %AVAILABILITY% + # RETURN VALUE This returns CURLE_OK. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md b/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md index 5c03460c..28fd76b1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_DEFAULT_PROTOCOL (3) - CURLOPT_PROTOCOLS (3) - CURLOPT_REDIR_PROTOCOLS_STR (3) +Protocol: + - HTTP +Added-in: 7.19.4 --- # NAME @@ -27,7 +30,7 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REDIR_PROTOCOLS, long bitmask); This option is deprecated. We strongly recommend using CURLOPT_REDIR_PROTOCOLS_STR(3) instead because this option cannot -control all available protocols! +control all available protocols. Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a @@ -81,9 +84,7 @@ HTTP, HTTPS, FTP and FTPS (Added in 7.65.2). Older versions defaulted to all protocols except FILE, SCP and since 7.40.0 SMB and SMBS. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -105,10 +106,11 @@ int main(int argc, char **argv) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.19.4, before then it would follow all protocols. Deprecated -since 7.85.0. +Deprecated since 7.85.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md b/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md index 10a0f015..2f14b04d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS_STR.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_PROTOCOLS (3) - CURLOPT_PROTOCOLS_STR (3) - CURLOPT_REDIR_PROTOCOLS (3) +Protocol: + - HTTP +Added-in: 7.85.0 --- # NAME @@ -30,8 +33,8 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REDIR_PROTOCOLS_STR, Pass a pointer to a string that holds a comma-separated list of case insensitive protocol names (URL schemes). That list limits what protocols libcurl may use in a transfer that it follows to in a redirect when -CURLOPT_FOLLOWLOCATION(3) is enabled. This option allows applications to -limit specific transfers to only be allowed to use a subset of protocols in +CURLOPT_FOLLOWLOCATION(3) is enabled. This option allows applications to limit +specific transfers to only be allowed to use a subset of protocols in redirections. Protocols denied by CURLOPT_PROTOCOLS_STR(3) are not overridden by this @@ -53,6 +56,12 @@ but are introduced in a future libcurl version. If trying to set a non-existing protocol or if no matching protocol at all is set, it returns error. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore to internal default. + +The application does not have to keep the string around after setting this +option. + # DEFAULT HTTP, HTTPS, FTP and FTPS (Added in 7.65.2). @@ -60,9 +69,7 @@ HTTP, HTTPS, FTP and FTPS (Added in 7.65.2). Older versions defaulted to all protocols except FILE, SCP and since 7.40.0 SMB and SMBS. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -83,9 +90,7 @@ int main(int argc, char **argv) } ~~~ -# AVAILABILITY - -Added in 7.85.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_REFERER.md b/deps/curl/docs/libcurl/opts/CURLOPT_REFERER.md index fdf33903..e666411c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_REFERER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_REFERER.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_REFERER (3) - CURLOPT_HTTPHEADER (3) - CURLOPT_USERAGENT (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -32,13 +35,14 @@ set any custom header with CURLOPT_HTTPHEADER(3). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -57,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built with HTTP support +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_REQUEST_TARGET.md b/deps/curl/docs/libcurl/opts/CURLOPT_REQUEST_TARGET.md index 0d72e146..fa4ff1d1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_REQUEST_TARGET.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_REQUEST_TARGET.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTPGET (3) - CURLOPT_PATH_AS_IS (3) - CURLOPT_URL (3) +Protocol: + - HTTP +Added-in: 7.55.0 --- # NAME @@ -31,13 +34,17 @@ instead of the path as extracted from the URL. libcurl passes on the verbatim string in its request without any filter or other safe guards. That includes white space and control characters. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +The application does not have to keep the string around after setting this +option. + # DEFAULT NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -58,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVE.md b/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVE.md index 39250f55..a6db5b42 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_CONNECT_TO (3) - CURLOPT_DNS_CACHE_TIMEOUT (3) - CURLOPT_IPRESOLVE (3) +Protocol: + - All +Added-in: 7.21.3 --- # NAME @@ -31,11 +34,12 @@ list of **struct curl_slist** structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list. +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. + Each resolve rule to add should be written using the format -~~~c - [+]HOST:PORT:ADDRESS[,ADDRESS] -~~~ + [+]HOST:PORT:ADDRESS[,ADDRESS] HOST is the name libcurl wants to resolve, PORT is the port number of the service where libcurl wants to connect to the HOST and ADDRESS is one or more @@ -43,13 +47,17 @@ numerical IP addresses. If you specify multiple IP addresses they need to be separated by comma. If libcurl is built to support IPv6, each of the ADDRESS entries can of course be either IPv4 or IPv6 style addressing. +Specify the host as a single ampersand (`*`) to match all names. This wildcard +is resolved last so any resolve with a specific host and port number is given +priority. + This option effectively populates the DNS cache with entries for the host+port pair so redirects and everything that operations against the HOST+PORT instead use your provided ADDRESS. -The optional leading "+" specifies that the new entry should time-out. Entries -added without the leading plus character never times out whereas entries added -with "+HOST:..." times out just like ordinary DNS cache entries. +The optional leading plus (`+`) specifies that the new entry should timeout. +Entries added without the leading plus character never times out whereas +entries added with `+HOST:...` times out just like ordinary DNS cache entries. If the DNS cache already has an entry for the given host+port pair, the new entry overrides the former one. @@ -60,20 +68,19 @@ setting of CURLOPT_IPRESOLVE(3) to a different IP version. To remove names from the DNS cache again, to stop providing these fake resolves, include a string in the linked list that uses the format -~~~c - -HOST:PORT -~~~ + -HOST:PORT The entry to remove must be prefixed with a dash, and the hostname and port number must exactly match what was added previously. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -99,7 +106,7 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY Added in 7.21.3. Removal support added in 7.42.0. @@ -110,6 +117,8 @@ Support for providing multiple IP addresses per entry was added in 7.59.0. Support for adding non-permanent entries by using the "+" prefix was added in 7.75.0. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_DATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_DATA.md index 219d0bd1..e6ec836a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_DATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_DATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_PREREQFUNCTION (3) - CURLOPT_RESOLVER_START_FUNCTION (3) +Protocol: + - All +Added-in: 7.59.0 --- # NAME @@ -32,9 +35,7 @@ CURLOPT_RESOLVER_START_FUNCTION(3). NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.59.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_FUNCTION.md index e4d0a0b8..2be7bcde 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RESOLVER_START_FUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_PREREQFUNCTION (3) - CURLOPT_RESOLVER_START_DATA (3) +Protocol: + - All +Added-in: 7.59.0 --- # NAME @@ -50,9 +53,7 @@ resolve to fail. NULL (No callback) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -79,9 +80,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.59.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM.md b/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM.md index fd3bee4d..681c1ace 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_INFILESIZE (3) - CURLOPT_RANGE (3) - CURLOPT_RESUME_FROM_LARGE (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -41,9 +44,7 @@ CURLOPT_RESUME_FROM_LARGE(3) instead. 0, not used -# PROTOCOLS - -HTTP, FTP, SFTP, FILE +# %PROTOCOLS% # EXAMPLE @@ -71,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM_LARGE.md index e7e8d5df..061890dd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RESUME_FROM_LARGE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_INFILESIZE_LARGE (3) - CURLOPT_RANGE (3) - CURLOPT_RESUME_FROM (3) +Protocol: + - All +Added-in: 7.11.0 --- # NAME @@ -39,9 +42,7 @@ file to the remote target file. 0, not used -# PROTOCOLS - -HTTP, FTP, SFTP, FILE +# %PROTOCOLS% # EXAMPLE @@ -70,9 +71,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.11.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_CLIENT_CSEQ.md b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_CLIENT_CSEQ.md index d1ef05ea..7b00069e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_CLIENT_CSEQ.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_CLIENT_CSEQ.md @@ -9,6 +9,9 @@ See-also: - CURLINFO_RTSP_SERVER_CSEQ (3) - CURLOPT_RTSP_REQUEST (3) - CURLOPT_RTSP_SERVER_CSEQ (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -33,9 +36,7 @@ increments from this new number henceforth. 0 -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -53,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md index a9ff2160..4173ce62 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_RTSP_SESSION_ID (3) - CURLOPT_RTSP_STREAM_URI (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -109,9 +112,7 @@ application a chance to run. # DEFAULT -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -122,7 +123,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/"); - /* ask for options! */ + /* ask for options */ curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS); res = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -130,9 +131,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SERVER_CSEQ.md b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SERVER_CSEQ.md index 62b14220..01ea910a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SERVER_CSEQ.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SERVER_CSEQ.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_RTSP_SERVER_CSEQ (3) - CURLOPT_RTSP_CLIENT_CSEQ (3) - CURLOPT_RTSP_STREAM_URI (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -32,9 +35,7 @@ unimplemented. 0 -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -52,9 +53,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SESSION_ID.md b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SESSION_ID.md index 1373c382..36dc1eac 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SESSION_ID.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_SESSION_ID.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_RTSP_REQUEST (3) - CURLOPT_RTSP_STREAM_URI (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -33,13 +36,14 @@ server sets it in a response. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -58,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_STREAM_URI.md b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_STREAM_URI.md index 8a28d727..074b3948 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_STREAM_URI.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_STREAM_URI.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_RTSP_REQUEST (3) - CURLOPT_RTSP_TRANSPORT (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -37,13 +40,14 @@ to. (e.g. the CURLOPT_URL(3) for the above examples might be set to The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT "*" -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -62,9 +66,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md index d33ddea8..6e28650c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_RTSP_REQUEST (3) - CURLOPT_RTSP_SESSION_ID (3) +Protocol: + - RTSP +Added-in: 7.20.0 --- # NAME @@ -36,9 +39,7 @@ option. NULL -# PROTOCOLS - -RTSP +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.20.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SASL_AUTHZID.md b/deps/curl/docs/libcurl/opts/CURLOPT_SASL_AUTHZID.md index b32732f2..f4058fc3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SASL_AUTHZID.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SASL_AUTHZID.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_PASSWORD (3) - CURLOPT_USERNAME (3) - CURLOPT_USERPWD (3) +Protocol: + - IMAP +Added-in: 7.66.0 --- # NAME @@ -28,22 +31,26 @@ Pass a char pointer as parameter, which should be pointing to the null-terminated authorization identity (*authzid*) for the transfer. Only applicable to the PLAIN SASL authentication mechanism where it is optional. -When not specified only the authentication identity (*authcid*) as -specified by the username is sent to the server, along with the password. The -server derives a *authzid* from the *authcid* when not provided, which -it then uses internally. +When not specified only the authentication identity (*authcid*) as specified +by the username is sent to the server, along with the password. The server +derives a *authzid* from the *authcid* when not provided, which it then uses +internally. -When the *authzid* is specified, the use of which is server dependent, it -can be used to access another user's inbox, that the user has been granted -access to, or a shared mailbox for example. +When the *authzid* is specified, the use of which is server dependent, it can +be used to access another user's inbox, that the user has been granted access +to, or a shared mailbox for example. + +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. # DEFAULT blank -# PROTOCOLS - -IMAP, LDAP, POP3 and SMTP +# %PROTOCOLS% # EXAMPLE @@ -63,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.66.0. Support for OpenLDAP added in 7.82.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SASL_IR.md b/deps/curl/docs/libcurl/opts/CURLOPT_SASL_IR.md index 2e421da9..25d84950 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SASL_IR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SASL_IR.md @@ -8,6 +8,10 @@ See-also: - CURLOPT_MAIL_AUTH (3) - CURLOPT_MAIL_FROM (3) - CURLOPT_SASL_AUTHZID (3) +Protocol: + - SMTP + - IMAP +Added-in: 7.31.0 --- # NAME @@ -43,9 +47,7 @@ SASL-IR CAPABILITY. 0 -# PROTOCOLS - -IMAP, POP3 and SMTP +# %PROTOCOLS% # EXAMPLE @@ -63,9 +65,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.31.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SEEKDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_SEEKDATA.md index 84ea49f4..fd93aacd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SEEKDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SEEKDATA.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_IOCTLFUNCTION (3) - CURLOPT_SEEKFUNCTION (3) - CURLOPT_STDERR (3) +Protocol: + - All +Added-in: 7.18.0 --- # NAME @@ -32,9 +35,7 @@ CURLOPT_SEEKFUNCTION(3) option, this is the pointer you get as input. If you do not set this, NULL is passed to the callback. -# PROTOCOLS - -HTTP, FTP, SFTP +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,6 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.18.0 +# %AVAILABILITY% # RETURN VALUE - diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SEEKFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SEEKFUNCTION.md index 2744df85..ea8ff5e3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SEEKFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SEEKFUNCTION.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_IOCTLFUNCTION (3) - CURLOPT_SEEKDATA (3) - CURLOPT_STDERR (3) +Protocol: + - All +Added-in: 7.18.0 --- # NAME @@ -57,15 +60,13 @@ done by instead reading from the input or similar. If you forward the input arguments directly to fseek(3) or lseek(3), note that the data type for *offset* is not the same as defined for curl_off_t on -many systems! +many systems. # DEFAULT -By default, this is NULL and unused. +NULL -# PROTOCOLS - -HTTP, FTP, SFTP +# %PROTOCOLS% # EXAMPLE @@ -93,9 +94,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.18.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md b/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md index e96dd473..03f8eddf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT.md @@ -8,6 +8,14 @@ See-also: - CURLOPT_CONNECTTIMEOUT (3) - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TIMEOUT (3) +Protocol: + - FTP + - IMAP + - POP3 + - SMTP + - SFTP + - SCP +Added-in: 7.20.0 --- # NAME @@ -39,9 +47,7 @@ This option was formerly known as CURLOPT_FTP_RESPONSE_TIMEOUT. None -# PROTOCOLS - -FTP, IMAP, POP3, SMTP, and SSH +# %PROTOCOLS% # EXAMPLE @@ -61,12 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10.8. Used under this name since 7.20.0 - -Support for SSH is predicated on a new enough (1.11.0) version of libssh2 -being available when compiling libcurl. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md index 6cd4514a..57071d6d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md @@ -8,6 +8,14 @@ See-also: - CURLOPT_CONNECTTIMEOUT (3) - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TIMEOUT (3) +Protocol: + - FTP + - IMAP + - POP3 + - SMTP + - SFTP + - SCP +Added-in: 8.6.0 --- # NAME @@ -41,9 +49,7 @@ This is the millisecond version of CURLOPT_SERVER_RESPONSE_TIMEOUT(3). None -# PROTOCOLS - -FTP, IMAP, POP3, SMTP, and SSH +# %PROTOCOLS% # EXAMPLE @@ -63,9 +69,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 8.6.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SERVICE_NAME.md b/deps/curl/docs/libcurl/opts/CURLOPT_SERVICE_NAME.md index 9c772e98..b928c910 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SERVICE_NAME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SERVICE_NAME.md @@ -8,6 +8,14 @@ See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYTYPE (3) - CURLOPT_PROXY_SERVICE_NAME (3) +Protocol: + - HTTP + - FTP + - IMAP + - POP3 + - SMTP + - LDAP +Added-in: 7.43.0 --- # NAME @@ -32,13 +40,14 @@ allows you to change them. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT See above -# PROTOCOLS - -HTTP, FTP, IMAP, LDAP, POP3 and SMTP +# %PROTOCOLS% # EXAMPLE @@ -55,10 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.43.0 for HTTP, 7.49.0 for FTP, IMAP, POP3 and SMTP, -7.82.0 for OpenLDAP. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SHARE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SHARE.md index 38d87932..4e64cc74 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SHARE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SHARE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_COOKIE (3) - CURLSHOPT_SHARE (3) +Protocol: + - All +Added-in: 7.10 --- # NAME @@ -45,9 +48,7 @@ Set this option to NULL again to stop using that share object. NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -79,9 +80,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTDATA.md index bde40109..dbf75da3 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_OPENSOCKETFUNCTION (3) - CURLOPT_SOCKOPTFUNCTION (3) +Protocol: + - All +Added-in: 7.16.0 --- # NAME @@ -28,11 +31,9 @@ argument in the sockopt callback set with CURLOPT_SOCKOPTFUNCTION(3). # DEFAULT -The default value of this parameter is NULL. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTFUNCTION.md index 5538033b..fbc3d880 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKOPTFUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_OPENSOCKETFUNCTION (3) - CURLOPT_SEEKFUNCTION (3) - CURLOPT_SOCKOPTDATA (3) +Protocol: + - All +Added-in: 7.16.0 --- # NAME @@ -70,11 +73,9 @@ not attempt to connect (again). # DEFAULT -By default, this callback is NULL and unused. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -122,10 +123,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.0. The *CURL_SOCKOPT_ALREADY_CONNECTED* return code was -added in 7.21.5. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md index 374d566f..9a965933 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYTYPE (3) +Protocol: + - All +Added-in: 7.55.0 --- # NAME @@ -34,9 +37,7 @@ password with the CURLOPT_PROXYUSERPWD(3) option. CURLAUTH_BASIC|CURLAUTH_GSSAPI -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.55.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_NEC.md b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_NEC.md index 8c3891df..5bb2e42e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_NEC.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_NEC.md @@ -6,7 +6,10 @@ Section: 3 Source: libcurl See-also: - CURLOPT_PROXY (3) - - CURLOPT_SOCKS5_GSSAPI_SERVICE (3) + - CURLOPT_PROXY_SERVICE_NAME (3) +Protocol: + - All +Added-in: 7.19.4 --- # NAME @@ -33,9 +36,7 @@ negotiation. ? -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -54,9 +55,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_SERVICE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_SERVICE.md index 28062fc0..fe0c22df 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_SERVICE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SOCKS5_GSSAPI_SERVICE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_PROXY (3) - CURLOPT_PROXYTYPE (3) +Protocol: + - All +Added-in: 7.19.4 --- # NAME @@ -37,9 +40,7 @@ option. See above -# PROTOCOLS - -All network protocols +# %PROTOCOLS% # EXAMPLE @@ -58,9 +59,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.19.4, deprecated in 7.49.0 +Deprecated since 7.49.0 + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md index fb07fa43..f111efe6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md @@ -8,6 +8,10 @@ See-also: - CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 (3) - CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 (3) - CURLOPT_SSH_PUBLIC_KEYFILE (3) +Protocol: + - SFTP + - SCP +Added-in: 7.16.1 --- # NAME @@ -37,9 +41,7 @@ authentication. CURLSSH_AUTH_ANY (all available) -# PROTOCOLS - -SFTP and SCP +# %PROTOCOLS% # EXAMPLE @@ -58,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -CURLSSH_AUTH_HOST was added in 7.16.1, CURLSSH_AUTH_AGENT was added in 7.28.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_COMPRESSION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_COMPRESSION.md index d784e3dc..749dedf2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_COMPRESSION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_COMPRESSION.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_ACCEPT_ENCODING (3) - CURLOPT_TRANSFER_ENCODING (3) +Protocol: + - SFTP + - SCP +Added-in: 7.56.0 --- # NAME @@ -32,9 +36,7 @@ may or may not do it. 0, disabled -# PROTOCOLS - -All SSH based protocols: SCP, SFTP +# %PROTOCOLS% # EXAMPLE @@ -54,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.56.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYDATA.md index 7c22ff5d..4629bb63 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYDATA.md @@ -1,11 +1,15 @@ --- c: Copyright (C) Daniel Stenberg, , et al. SPDX-License-Identifier: curl -Title: CURLOPT_SSH_KEYDATA +Title: CURLOPT_SSH_HOSTKEYDATA Section: 3 Source: libcurl See-also: - CURLOPT_SSH_HOSTKEYFUNCTION (3) +Protocol: + - SFTP + - SCP +Added-in: 7.84.0 --- # NAME @@ -29,9 +33,7 @@ the callback set with CURLOPT_SSH_HOSTKEYFUNCTION(3). NULL -# PROTOCOLS - -SCP and SFTP +# %PROTOCOLS% # EXAMPLE @@ -64,9 +66,11 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES -Added in 7.84.0, works only with libssh2 backend. +Works only with the libssh2 backend. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYFUNCTION.md index 40d720ed..ecaa078a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOSTKEYFUNCTION.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_SSH_HOSTKEYDATA (3) - CURLOPT_SSH_KNOWNHOSTS (3) +Protocol: + - SFTP + - SCP +Added-in: 7.84.0 --- # NAME @@ -55,9 +59,7 @@ the host key is rejected, the connection is canceled. NULL -# PROTOCOLS - -SCP and SFTP +# %PROTOCOLS% # EXAMPLE @@ -89,9 +91,11 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES -Added in 7.84.0 , work only with libssh2 backend. +Work only with the libssh2 backend. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_MD5.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_MD5.md index 6f439522..3ad3a63f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_MD5.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_MD5.md @@ -9,6 +9,10 @@ See-also: - CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 (3) - CURLOPT_SSH_KNOWNHOSTS (3) - CURLOPT_SSH_PUBLIC_KEYFILE (3) +Protocol: + - SFTP + - SCP +Added-in: 7.17.1 --- # NAME @@ -36,13 +40,14 @@ CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256(3) instead. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -SCP and SFTP +# %PROTOCOLS% # EXAMPLE @@ -61,9 +66,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.17.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256.md index a4463e8e..cd8d6ecd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256.md @@ -8,6 +8,10 @@ See-also: - CURLOPT_SSH_AUTH_TYPES (3) - CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 (3) - CURLOPT_SSH_PUBLIC_KEYFILE (3) +Protocol: + - SFTP + - SCP +Added-in: 7.80.0 --- # NAME @@ -29,13 +33,17 @@ Pass a char pointer pointing to a string containing a Base64-encoded SHA256 hash of the remote host's public key. The transfer fails if the given hash does not match the hash the remote host provides. +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -SCP and SFTP +# %PROTOCOLS% # EXAMPLE @@ -54,11 +62,12 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES -Added in 7.80.0 Requires the libssh2 backend. +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYDATA.md index 24249aa0..64d98c41 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYDATA.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_SSH_KEYDATA (3) - CURLOPT_SSH_KNOWNHOSTS (3) +Protocol: + - SFTP + - SCP +Added-in: 7.19.6 --- # NAME @@ -30,9 +34,7 @@ callback set with CURLOPT_SSH_KEYFUNCTION(3). NULL -# PROTOCOLS - -SFTP and SCP +# %PROTOCOLS% # EXAMPLE @@ -66,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md index 90cd8bfb..3d815abd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KEYFUNCTION.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_SSH_KEYDATA (3) - CURLOPT_SSH_KNOWNHOSTS (3) +Protocol: + - SFTP + - SCP +Added-in: 7.19.6 --- # NAME @@ -30,7 +34,7 @@ enum curl_khstat { enum curl_khmatch { CURLKHMATCH_OK, /* match */ - CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ + CURLKHMATCH_MISMATCH, /* host found, key mismatch */ CURLKHMATCH_MISSING, /* no matching host/key found */ }; @@ -106,9 +110,7 @@ up from scratch again. NULL -# PROTOCOLS - -SFTP and SCP +# %PROTOCOLS% # EXAMPLE @@ -143,9 +145,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KNOWNHOSTS.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KNOWNHOSTS.md index 1f1f2bc8..8b7705b4 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KNOWNHOSTS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_KNOWNHOSTS.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_SSH_AUTH_TYPES (3) - CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 (3) +Protocol: + - SFTP + - SCP +Added-in: 7.19.6 --- # NAME @@ -33,13 +37,14 @@ behavior on host and key matches and mismatches. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -SFTP and SCP +# %PROTOCOLS% # EXAMPLE @@ -58,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PRIVATE_KEYFILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PRIVATE_KEYFILE.md index 11dda139..fe7e5207 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PRIVATE_KEYFILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PRIVATE_KEYFILE.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_SSH_AUTH_TYPES (3) - CURLOPT_SSH_PUBLIC_KEYFILE (3) +Protocol: + - SFTP + - SCP +Added-in: 7.16.1 --- # NAME @@ -44,9 +48,7 @@ option. As explained above -# PROTOCOLS - -SFTP and SCP +# %PROTOCOLS% # EXAMPLE @@ -66,9 +68,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PUBLIC_KEYFILE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PUBLIC_KEYFILE.md index 9f110c7d..f6d2fb3c 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PUBLIC_KEYFILE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSH_PUBLIC_KEYFILE.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_SSH_AUTH_TYPES (3) - CURLOPT_SSH_PRIVATE_KEYFILE (3) +Protocol: + - SFTP + - SCP +Added-in: 7.16.1 --- # NAME @@ -40,9 +44,7 @@ option. NULL -# PROTOCOLS - -SFTP and SCP +# %PROTOCOLS% # EXAMPLE @@ -61,10 +63,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY The "" trick was added in 7.26.0 +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT.md index dda3b940..8669e950 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT.md @@ -8,6 +8,16 @@ See-also: - CURLOPT_KEYPASSWD (3) - CURLOPT_SSLCERTTYPE (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - Schannel + - Secure Transport + - wolfSSL +Added-in: 7.1 --- # NAME @@ -38,13 +48,12 @@ in order to avoid confusion with a nickname. certificate store. (You can import *PFX* to a store first). You can use "\\\\\\\" to refer to a certificate in the system certificates store, for example, -**"CurrentUser\\MY\\934a7ac6f8a5d579285a74fa"**. The thumbprint is usually a -SHA-1 hex string which you can see in certificate details. Following store -locations are supported: **CurrentUser**, **LocalMachine**, -**CurrentService**, **Services**, **CurrentUserGroupPolicy**, -**LocalMachineGroupPolicy**, **LocalMachineEnterprise**. Schannel also support -P12 certificate file, with the string `P12` specified with -CURLOPT_SSLCERTTYPE(3). +**"CurrentUser\\MY\\934a7ac6f8a5d5"**. The thumbprint is usually a SHA-1 hex +string which you can see in certificate details. Following store locations are +supported: **CurrentUser**, **LocalMachine**, **CurrentService**, +**Services**, **CurrentUserGroupPolicy**, **LocalMachineGroupPolicy**, +**LocalMachineEnterprise**. Schannel also support P12 certificate file, with +the string `P12` specified with CURLOPT_SSLCERTTYPE(3). When using a client certificate, you most likely also need to provide a private key with CURLOPT_SSLKEY(3). @@ -52,13 +61,14 @@ private key with CURLOPT_SSLKEY(3). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -78,9 +88,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERTTYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERTTYPE.md index 948365b7..696344a9 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERTTYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERTTYPE.md @@ -7,6 +7,16 @@ Source: libcurl See-also: - CURLOPT_SSLCERT (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS + - mbedTLS + - Schannel + - Secure Transport + - wolfSSL +Added-in: 7.9.3 --- # NAME @@ -28,19 +38,20 @@ the format of your certificate. Supported formats are "PEM" and "DER", except with Secure Transport or Schannel. OpenSSL (versions 0.9.3 and later), Secure Transport (on iOS 5 or -later, or OS X 10.7 or later) and Schannel support "P12" for PKCS#12-encoded -files. +later, or macOS 10.7 or later) and Schannel support "P12" for PKCS#12-encoded +files. GnuTLS supports P12 starting with curl 8.11.0. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL restores back to internal default. + # DEFAULT "PEM" -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -61,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built TLS enabled. Added in 7.9.3 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT_BLOB.md index db54c40b..fb1cc62f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLCERT_BLOB.md @@ -8,6 +8,15 @@ See-also: - CURLOPT_KEYPASSWD (3) - CURLOPT_SSLCERTTYPE (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - Secure Transport + - Schannel + - mbedTLS + - wolfSSL +Added-in: 7.71.0 --- # NAME @@ -42,9 +51,7 @@ expects a filename as input. NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -72,10 +79,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL, Secure Transport, -Schannel and mbedTLS (since 7.78.0) backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE.md index f8b2a623..9bddf39f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE.md @@ -8,6 +8,11 @@ See-also: - CURLINFO_SSL_ENGINES (3) - CURLOPT_SSLENGINE_DEFAULT (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.9.3 --- # NAME @@ -30,13 +35,14 @@ identifier for the crypto engine you want to use for your private key. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -54,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Only if the SSL backend is OpenSSL built with engine support. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE_DEFAULT.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE_DEFAULT.md index 2d795852..72e908b7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE_DEFAULT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLENGINE_DEFAULT.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_SSLCERT (3) - CURLOPT_SSLENGINE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL +Added-in: 7.9.3 --- # NAME @@ -32,9 +37,7 @@ This option has no effect unless set after CURLOPT_SSLENGINE(3). None -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -53,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Only if the SSL backend is OpenSSL built with engine support. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY.md index b130eb84..13363ce2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY.md @@ -8,6 +8,14 @@ See-also: - CURLOPT_SSLCERT (3) - CURLOPT_SSLKEYTYPE (3) - CURLOPT_SSLKEY_BLOB (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - mbedTLS + - Schannel + - wolfSSL +Added-in: 7.9.3 --- # NAME @@ -28,20 +36,21 @@ Pass a pointer to a null-terminated string as parameter. The string should be the filename of your private key. The default format is "PEM" and can be changed with CURLOPT_SSLKEYTYPE(3). -(Windows, iOS and Mac OS X) This option is ignored by Secure Transport and +(Windows, iOS and macOS) This option is ignored by Secure Transport and Schannel SSL backends because they expect the private key to be already present in the key-chain or PKCS#12 file containing the certificate. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -61,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEYTYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEYTYPE.md index a13865a9..0f0106dc 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEYTYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEYTYPE.md @@ -8,6 +8,13 @@ See-also: - CURLOPT_PROXY_SSLKEYTYPE (3) - CURLOPT_SSLCERT (3) - CURLOPT_SSLKEY (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - BearSSL + - wolfSSL +Added-in: 7.9.3 --- # NAME @@ -35,13 +42,14 @@ currently does not work because of a bug in OpenSSL. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore to internal default. + # DEFAULT "PEM" -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -62,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY_BLOB.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY_BLOB.md index 35107700..bedf2d33 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY_BLOB.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLKEY_BLOB.md @@ -7,6 +7,12 @@ Source: libcurl See-also: - CURLOPT_SSLKEY (3) - CURLOPT_SSLKEYTYPE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - wolfSSL +Added-in: 7.71.0 --- # NAME @@ -39,9 +45,7 @@ filename as input. NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -77,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.71.0. This option is supported by the OpenSSL backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSLVERSION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSLVERSION.md index 08eee343..fd05eb41 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSLVERSION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSLVERSION.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_IPRESOLVE (3) - CURLOPT_PROXY_SSLVERSION (3) - CURLOPT_USE_SSL (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.1 --- # NAME @@ -67,10 +72,11 @@ TLS v1.2 or later (Added in 7.34.0) TLS v1.3 or later (Added in 7.52.0) +## + The maximum TLS version can be set by using *one* of the CURL_SSLVERSION_MAX_ macros below. It is also possible to OR *one* of the CURL_SSLVERSION_ macros with *one* of the CURL_SSLVERSION_MAX_ macros. -The MAX macros are not supported for WolfSSL. ## CURL_SSLVERSION_MAX_DEFAULT @@ -99,6 +105,8 @@ The flag defines maximum supported TLS version as TLS v1.2. The flag defines maximum supported TLS version as TLS v1.3. (Added in 7.54.0) +## + In versions of curl prior to 7.54 the CURL_SSLVERSION_TLS options were documented to allow *only* the specified TLS version, but behavior was inconsistent depending on the TLS library. @@ -107,9 +115,7 @@ inconsistent depending on the TLS library. CURL_SSLVERSION_DEFAULT -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -129,15 +135,23 @@ int main(void) } ~~~ -# AVAILABILITY - -SSLv2 and SSLv3 are refused completely since curl 7.77.0 +# HISTORY SSLv2 is disabled by default since 7.18.1. Other SSL versions availability may vary depending on which backend libcurl has been built to use. SSLv3 is disabled by default since 7.39.0. +SSLv2 and SSLv3 are refused completely since curl 7.77.0 + +Since 8.10.0 wolfSSL is fully supported. Before 8.10.0 the MAX macros were not +supported with wolfSSL and the other macros did not set a minimum, but +restricted the TLS version to only the specified one. + +Rustls support added in 8.10.0. + +# %AVAILABILITY% + # RETURN VALUE Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md index c07e7203..df57c837 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CIPHER_LIST.md @@ -10,6 +10,17 @@ See-also: - CURLOPT_SSLVERSION (3) - CURLOPT_TLS13_CIPHERS (3) - CURLOPT_USE_SSL (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - BearSSL + - Schannel + - Secure Transport + - wolfSSL + - mbedTLS + - rustls +Added-in: 7.9 --- # NAME @@ -27,24 +38,17 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_CIPHER_LIST, char *list); # DESCRIPTION Pass a char pointer, pointing to a null-terminated string holding the list of -ciphers to use for the SSL connection. The list must be syntactically correct, -it consists of one or more cipher strings separated by colons. Commas or -spaces are also acceptable separators but colons are normally used, !, - and -+ can be used as operators. +cipher suites to use for the TLS 1.2 (1.1, 1.0) connection. The list must +be syntactically correct, it consists of one or more cipher suite strings +separated by colons. -For OpenSSL and GnuTLS valid examples of cipher lists include **RC4-SHA**, -**SHA1+DES**, **TLSv1** and **DEFAULT**. The default list is normally set when -you compile OpenSSL. +For setting TLS 1.3 ciphers see CURLOPT_TLS13_CIPHERS(3). -For WolfSSL, valid examples of cipher lists include **ECDHE-RSA-RC4-SHA**, -**AES256-SHA:AES256-SHA256**, etc. - -For BearSSL, valid examples of cipher lists include -**ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256**, or when using -IANA names -**TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256**, -etc. With BearSSL you do not add/remove ciphers. If one uses this option then -all known ciphers are disabled and only those passed in are enabled. +A valid example of a cipher list is: +~~~ +"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:" +"ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305" +~~~ For Schannel, you can use this option to set algorithms but not specific cipher suites. Refer to the ciphers lists document for algorithms. @@ -56,13 +60,14 @@ Find more details about cipher lists on this URL: The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -NULL, use internal default +NULL, use built-in list -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -73,20 +78,29 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, "TLSv1"); + curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, + "ECDHE-ECDSA-CHACHA20-POLY1305:" + "ECDHE-RSA-CHACHA20-POLY1305"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.9, in 7.83.0 for BearSSL +OpenSSL support added in 7.9. +wolfSSL support added in 7.53.0. +Schannel support added in 7.61.0. +Secure Transport support added in 7.77.0. +BearSSL support added in 7.83.0. +mbedTLS support added in 8.8.0. +Rustls support added in 8.10.0. -If built TLS enabled. +Since curl 8.10.0 returns CURLE_NOT_BUILT_IN when not supported. + +# %AVAILABILITY% # RETURN VALUE -Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or -CURLE_OUT_OF_MEMORY if there was insufficient heap space. +Returns CURLE_OK if supported, CURLE_NOT_BUILT_IN otherwise. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md index b7d13258..2dcdd57e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_DATA.md @@ -7,6 +7,14 @@ Source: libcurl See-also: - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_CTX_FUNCTION (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - wolfSSL + - mbedTLS + - BearSSL +Added-in: 7.10.6 --- # NAME @@ -31,9 +39,7 @@ parameter. NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -110,10 +116,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY Added in 7.11.0 for OpenSSL, in 7.42.0 for wolfSSL, in 7.54.0 for mbedTLS, -in 7.83.0 in BearSSL. Other SSL backends are not supported. +in 7.83.0 in BearSSL. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md index d2eb2b1b..f461209b 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_CTX_FUNCTION.md @@ -5,9 +5,20 @@ Title: CURLOPT_SSL_CTX_FUNCTION Section: 3 Source: libcurl See-also: - - CURLOPT_SSL_CTX_DATA (3) - - CURLOPT_SSL_VERIFYPEER (3) + - CURLOPT_CA_CACHE_TIMEOUT (3) - CURLOPT_CAINFO (3) + - CURLOPT_CAINFO_BLOB (3) + - CURLOPT_SSL_CTX_DATA (3) + - CURLOPT_SSL_VERIFYHOST (3) + - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - wolfSSL + - mbedTLS + - BearSSL +Added-in: 7.10.6 --- # NAME @@ -71,13 +82,15 @@ callback function has returned. Your application must not assume that it can keep using the SSL context or data derived from it once this function is completed. +For libcurl builds using TLS backends that support CA caching and +CURLOPT_CA_CACHE_TIMEOUT(3) is not set to zero, multiple calls to this +callback may be done with the same CA store in memory. + # DEFAULT NULL -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -154,12 +167,7 @@ int main(void) } ~~~ -# AVAILABILITY - -libcurl built with OpenSSL (added in 7.11.0), wolfSSL (added in 7.42.0), mbedTLS -(added in 7.54.0) or BearSSL (added in 7.83.0) - -No other SSL backend is supported. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_EC_CURVES.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_EC_CURVES.md index 49d216be..6256e25f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_EC_CURVES.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_EC_CURVES.md @@ -8,6 +8,12 @@ See-also: - CURLOPT_SSL_CIPHER_LIST (3) - CURLOPT_SSL_OPTIONS (3) - CURLOPT_TLS13_CIPHERS (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - wolfSSL +Added-in: 7.73.0 --- # NAME @@ -19,22 +25,26 @@ CURLOPT_SSL_EC_CURVES - key exchange curves ~~~c #include -CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_EC_CURVES, char *alg_list); +CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_EC_CURVES, char *list); ~~~ # DESCRIPTION -Pass a string as parameter with a colon delimited list of (EC) algorithms. This -option defines the client's key exchange algorithms in the SSL handshake (if -the SSL backend libcurl is built to use supports it). +Pass a string as parameter with a colon delimited list of Elliptic curve (EC) +algorithms. This option defines the client's key exchange algorithms in the +SSL handshake (if the SSL backend libcurl is built to use supports it). + +The application does not have to keep the string around after setting this +option. + +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore back to internal default. # DEFAULT "", embedded in SSL backend -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -52,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.73.0. Supported by the OpenSSL backend. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_ALPN.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_ALPN.md index 1638942e..e521c543 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_ALPN.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_ALPN.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_SSL_ENABLE_NPN (3) - CURLOPT_SSL_OPTIONS (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.36.0 --- # NAME @@ -31,9 +36,7 @@ is built to use supports it), which can be used to negotiate http2. 1, enabled -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -51,9 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.36.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_NPN.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_NPN.md index 4e34e076..65ade8bd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_NPN.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_ENABLE_NPN.md @@ -7,6 +7,11 @@ Source: libcurl See-also: - CURLOPT_SSL_ENABLE_ALPN (3) - CURLOPT_SSL_OPTIONS (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.36.0 --- # NAME @@ -23,7 +28,7 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long npn); # DESCRIPTION -Deprecated in 7.86.0. Setting this option has no function. +Deprecated since 7.86.0. Setting this option has no function. Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for disable. This option enables/disables NPN in the SSL handshake (if the SSL backend libcurl @@ -33,9 +38,7 @@ is built to use supports it), which can be used to negotiate http2. 1, enabled -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -53,9 +56,11 @@ int main(void) } ~~~ -# AVAILABILITY +# DEPRECATED -Added in 7.36.0. Deprecated in 7.86.0. +Deprecated since 7.86.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_FALSESTART.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_FALSESTART.md index 1a1110ac..83b6b69d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_FALSESTART.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_FALSESTART.md @@ -6,6 +6,11 @@ Section: 3 Source: libcurl See-also: - CURLOPT_TCP_FASTOPEN (3) +Protocol: + - TLS +TLS-backend: + - Secure Transport +Added-in: 7.42.0 --- # NAME @@ -33,9 +38,7 @@ when performing a full handshake. 0 -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -51,10 +54,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.42.0. This option is currently only supported by the Secure -Transport (on iOS 7.0 or later, or OS X 10.9 or later) TLS backend. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md index 94732a96..f789a8b5 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_PROXY_SSL_OPTIONS (3) - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_CIPHER_LIST (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.25.0 --- # NAME @@ -81,13 +86,20 @@ certificate that supports client authentication in the OS certificate store it could be a privacy violation and unexpected. (Added in 7.77.0) +## CURLSSLOPT_EARLYDATA + +Tell libcurl to try sending application data as TLS1.3 early data. This option +is only supported for GnuTLS. This option works on a best effort basis, +in cases when it wasn't 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) + # DEFAULT 0 -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -107,9 +119,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.25.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_SESSIONID_CACHE.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_SESSIONID_CACHE.md index 0de33f1a..36907026 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_SESSIONID_CACHE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_SESSIONID_CACHE.md @@ -9,6 +9,11 @@ See-also: - CURLOPT_MAXAGE_CONN (3) - CURLOPT_MAXLIFETIME_CONN (3) - CURLOPT_SSLVERSION (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.16.0 --- # NAME @@ -36,9 +41,7 @@ wild that may require you to disable this in order for you to succeed. 1 -# PROTOCOLS - -All TLS-based +# %PROTOCOLS% # EXAMPLE @@ -49,7 +52,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - /* switch off session-id use! */ + /* switch off session-id use */ curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L); res = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -57,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.16.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYHOST.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYHOST.md index 110cbd10..30b1525f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYHOST.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYHOST.md @@ -8,6 +8,11 @@ See-also: - CURLOPT_CAINFO (3) - CURLOPT_PINNEDPUBLICKEY (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.8.1 --- # NAME @@ -24,40 +29,27 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_VERIFYHOST, long verify); # DESCRIPTION -Pass a long as parameter specifying what to *verify*. +Pass a long set to 2L to make libcurl verify the host in the server's TLS +certificate. -This option determines whether libcurl verifies that the server cert is for -the server it is known as. +When negotiating a TLS connection, the server sends a certificate indicating +its identity. -When negotiating TLS and SSL connections, the server sends a certificate -indicating its identity. +When CURLOPT_SSL_VERIFYHOST(3) is set to 1 or 2, the server certificate must +indicate that it was made for the hostname or address curl connects to, or the +connection fails. Simply put, it means it has to have the same name in the +certificate as is used in the URL you operate against. -When CURLOPT_SSL_VERIFYHOST(3) is 2, that certificate must indicate that -the server is the server to which you meant to connect, or the connection -fails. Simply put, it means it has to have the same name in the certificate as -is in the URL you operate against. - -Curl considers the server the intended one when the Common Name field or a +curl considers the server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the hostname in the -URL to which you told Curl to connect. +URL to which you told curl to connect. -If *verify* value is set to 1: +When the *verify* value is 0, the connection succeeds regardless of the names +in the certificate. Use that ability with caution, -In 7.28.0 and earlier: treated as a debug option of some sorts, not supported -anymore due to frequently leading to programmer mistakes. - -From 7.28.1 to 7.65.3: setting it to 1 made curl_easy_setopt(3) return -an error and leaving the flag untouched. - -From 7.66.0: treats 1 and 2 the same. - -When the *verify* value is 0, the connection succeeds regardless of the -names in the certificate. Use that ability with caution! - -The default value for this option is 2. - -This option controls checking the server's certificate's claimed identity. -The server could be lying. To control lying, see CURLOPT_SSL_VERIFYPEER(3). +This option controls checking the server's certificate's claimed identity. The +separate CURLOPT_SSL_VERIFYPEER(3) options enables/disables verification that +the certificate is signed by a trusted Certificate Authority. WARNING: disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it. Disabling @@ -70,21 +62,30 @@ HSTS and Alt-Svc information to be stored and used subsequently. Disabling certificate verification can make libcurl trust and use such information from malicious servers. +# MATCHING + +A certificate can have the name as a wildcard. The only asterisk (`*`) must +then be the left-most character and it must be followed by a period. The +wildcard must further contain more than one period as it cannot be set for a +top-level domain. + +A certificate can be set for a numerical IP address (IPv4 or IPv6), but then +it should be a Subject Alternate Name kind and its type should correctly +identify the field as an IP address. + # LIMITATIONS -Secure Transport: If *verify* value is 0, then SNI is also disabled. SNI is -a TLS extension that sends the hostname to the server. The server may use that +Secure Transport: If *verify* value is 0, then SNI is also disabled. SNI is a +TLS extension that sends the hostname to the server. The server may use that information to do such things as sending back a specific certificate for the -hostname, or forwarding the request to a specific origin server. Some hostnames -may be inaccessible if SNI is not sent. +hostname, or forwarding the request to a specific origin server. Some +hostnames may be inaccessible if SNI is not sent. # DEFAULT 2 -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -103,12 +104,18 @@ int main(void) } ~~~ -# AVAILABILITY +# %AVAILABILITY% -If built TLS enabled. +# HISTORY + +In 7.28.0 and earlier: the value 1 was treated as a debug option of some +sorts, not supported anymore due to frequently leading to programmer mistakes. + +From 7.28.1 to 7.65.3: setting it to 1 made curl_easy_setopt(3) return +an error and leaving the flag untouched. + +From 7.66.0: libcurl treats 1 and 2 to this option the same. # RETURN VALUE Returns CURLE_OK if TLS is supported, and CURLE_UNKNOWN_OPTION if not. - -If 1 is set as argument, *CURLE_BAD_FUNCTION_ARGUMENT* is returned. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYPEER.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYPEER.md index 5f083273..4d4bf7c6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYPEER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYPEER.md @@ -11,6 +11,11 @@ See-also: - CURLOPT_PROXY_SSL_VERIFYHOST (3) - CURLOPT_PROXY_SSL_VERIFYPEER (3) - CURLOPT_SSL_VERIFYHOST (3) +Protocol: + - TLS +TLS-backend: + - All +Added-in: 7.4.2 --- # NAME @@ -68,9 +73,7 @@ malicious servers. 1 - enabled -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -89,9 +92,7 @@ int main(void) } ~~~ -# AVAILABILITY - -If built TLS enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYSTATUS.md b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYSTATUS.md index 3bc2c793..aa8653d1 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYSTATUS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SSL_VERIFYSTATUS.md @@ -8,6 +8,12 @@ See-also: - CURLOPT_CAINFO (3) - CURLOPT_SSL_VERIFYHOST (3) - CURLOPT_SSL_VERIFYPEER (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.41.0 --- # NAME @@ -36,9 +42,7 @@ extension, the verification fails. 0 -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -49,7 +53,7 @@ int main(void) if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - /* ask for OCSP stapling! */ + /* ask for OCSP stapling */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L); res = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -57,10 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.41.0. This option is currently only supported by the OpenSSL and -GnuTLS TLS backends. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_STDERR.md b/deps/curl/docs/libcurl/opts/CURLOPT_STDERR.md index d90df253..36894433 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_STDERR.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_STDERR.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_DEBUGFUNCTION (3) - CURLOPT_NOPROGRESS (3) - CURLOPT_VERBOSE (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -36,9 +39,7 @@ application. A work-around is to instead use CURLOPT_DEBUGFUNCTION(3). stderr -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS.md b/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS.md index b0f4c9f0..1429de1f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTP_VERSION (3) - CURLOPT_STREAM_DEPENDS_E (3) - CURLOPT_STREAM_WEIGHT (3) +Protocol: + - HTTP +Added-in: 7.46.0 --- # NAME @@ -45,9 +48,7 @@ option to have an actual effect. NULL -# PROTOCOLS - -HTTP/2 +# %PROTOCOLS% # EXAMPLE @@ -63,14 +64,12 @@ int main(void) curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two"); curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS, curl); - /* then add both to a multi handle and transfer them! */ + /* then add both to a multi handle and transfer them */ } } ~~~ -# AVAILABILITY - -Added in 7.46.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS_E.md b/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS_E.md index da83e93d..bddfead6 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS_E.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_DEPENDS_E.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTP_VERSION (3) - CURLOPT_STREAM_DEPENDS (3) - CURLOPT_STREAM_WEIGHT (3) +Protocol: + - HTTP +Added-in: 7.46.0 --- # NAME @@ -48,9 +51,7 @@ option to have an actual effect. NULL -# PROTOCOLS - -HTTP/2 +# %PROTOCOLS% # EXAMPLE @@ -66,14 +67,12 @@ int main(void) curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two"); curl_easy_setopt(curl2, CURLOPT_STREAM_DEPENDS_E, curl); - /* then add both to a multi handle and transfer them! */ + /* then add both to a multi handle and transfer them */ } } ~~~ -# AVAILABILITY - -Added in 7.46.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_WEIGHT.md b/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_WEIGHT.md index af2ecff7..57088a79 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_WEIGHT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_STREAM_WEIGHT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PIPEWAIT (3) - CURLOPT_STREAM_DEPENDS (3) - CURLOPT_STREAM_DEPENDS_E (3) +Protocol: + - HTTP +Added-in: 7.46.0 --- # NAME @@ -45,12 +48,9 @@ streams). # DEFAULT -If nothing is set, the HTTP/2 protocol itself uses its own default which is -16. +16 -# PROTOCOLS - -HTTP/2 +# %PROTOCOLS% # EXAMPLE @@ -67,14 +67,12 @@ int main(void) curl_easy_setopt(curl2, CURLOPT_URL, "https://example.com/two"); curl_easy_setopt(curl2, CURLOPT_STREAM_WEIGHT, 20L); - /* then add both to a multi handle and transfer them! */ + /* then add both to a multi handle and transfer them */ } } ~~~ -# AVAILABILITY - -Added in 7.46.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md b/deps/curl/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md index e1dd7e56..b0582463 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_SUPPRESS_CONNECT_HEADERS.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HEADER (3) - CURLOPT_HTTPPROXYTUNNEL (3) - CURLOPT_PROXY (3) +Protocol: + - All +Added-in: 7.54.0 --- # NAME @@ -68,9 +71,7 @@ Content-Type: application/json 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -94,9 +95,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.54.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_FASTOPEN.md b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_FASTOPEN.md index c93d41f8..1f8f5d4a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_FASTOPEN.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_FASTOPEN.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_SSL_FALSESTART (3) +Protocol: + - TCP +Added-in: 7.49.0 --- # NAME @@ -35,9 +38,7 @@ Fast Open is also known to be problematic on or across certain networks. 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -53,10 +54,11 @@ int main(void) } ~~~ -# AVAILABILITY +# NOTES -Added in 7.49.0. This option is currently only supported on Linux and macOS -10.11 or later. +This option is only supported on Linux and macOS 10.11 or later. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPALIVE.md b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPALIVE.md index 17809794..3d9da660 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPALIVE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPALIVE.md @@ -9,6 +9,10 @@ See-also: - CURLOPT_MAX_RECV_SPEED_LARGE (3) - CURLOPT_TCP_KEEPIDLE (3) - CURLOPT_TCP_KEEPINTVL (3) + - CURLOPT_TCP_KEEPCNT (3) +Protocol: + - TCP +Added-in: 7.25.0 --- # NAME @@ -27,17 +31,15 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_KEEPALIVE, long probe); Pass a long. If set to 1, TCP keepalive probes are used. The delay and frequency of these probes can be controlled by the -CURLOPT_TCP_KEEPIDLE(3) and CURLOPT_TCP_KEEPINTVL(3) options, -provided the operating system supports them. Set to 0 (default behavior) to -disable keepalive probes +CURLOPT_TCP_KEEPIDLE(3), CURLOPT_TCP_KEEPINTVL(3), and CURLOPT_TCP_KEEPCNT(3) +options, provided the operating system supports them. Set to 0 (default behavior) +to disable keepalive probes. # DEFAULT 0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -57,14 +59,15 @@ int main(void) /* interval time between keep-alive probes: 60 seconds */ curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L); + /* maximum number of keep-alive probes: 3 */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 3L); + curl_easy_perform(curl); } } ~~~ -# AVAILABILITY - -Added in 7.25.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPCNT.md b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPCNT.md new file mode 100644 index 00000000..5a03f3cf --- /dev/null +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPCNT.md @@ -0,0 +1,74 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Title: CURLOPT_TCP_KEEPCNT +Section: 3 +Source: libcurl +See-also: + - CURLOPT_TCP_KEEPALIVE (3) + - CURLOPT_TCP_KEEPIDLE (3) + - CURLOPT_TCP_KEEPINTVL (3) +Protocol: + - TCP +Added-in: 8.9.0 +--- + +# NAME + +CURLOPT_TCP_KEEPCNT - Maximum number of TCP keep-alive probes + +# SYNOPSIS + +~~~c +#include + +CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_KEEPCNT, long cnt); +~~~ + +# DESCRIPTION + +Pass a long. Sets the number of probes to send before dropping +the connection. Not all operating systems support this option. +(Added in 8.9.0) + +The maximum value this option accepts is INT_MAX or whatever your +system allows. +Any larger value is capped to this amount. + +# DEFAULT + +9 + +# %PROTOCOLS% + +# EXAMPLE + +~~~c +int main(void) +{ + CURL *curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); + + /* enable TCP keep-alive for this transfer */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); + + /* set keep-alive idle time to 120 seconds */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L); + + /* interval time between keep-alive probes: 60 seconds */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L); + + /* maximum number of keep-alive probes: 3 */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 3L); + + curl_easy_perform(curl); + } +} +~~~ + +# %AVAILABILITY% + +# RETURN VALUE + +Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPIDLE.md b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPIDLE.md index 3e0db307..370ace4a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPIDLE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPIDLE.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_TCP_KEEPALIVE (3) - CURLOPT_TCP_KEEPINTVL (3) + - CURLOPT_TCP_KEEPCNT (3) +Protocol: + - TCP +Added-in: 7.25.0 --- # NAME @@ -34,9 +38,7 @@ this amount. 60 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -56,14 +58,15 @@ int main(void) /* interval time between keep-alive probes: 60 seconds */ curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L); + /* maximum number of keep-alive probes: 3 */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 3L); + curl_easy_perform(curl); } } ~~~ -# AVAILABILITY - -Added in 7.25.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPINTVL.md b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPINTVL.md index f3a2b4df..9d0ebc7a 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPINTVL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_KEEPINTVL.md @@ -7,6 +7,10 @@ Source: libcurl See-also: - CURLOPT_TCP_KEEPALIVE (3) - CURLOPT_TCP_KEEPIDLE (3) + - CURLOPT_TCP_KEEPCNT (3) +Protocol: + - TCP +Added-in: 7.25.0 --- # NAME @@ -33,9 +37,7 @@ this amount. 60 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -55,14 +57,15 @@ int main(void) /* interval time between keep-alive probes: 60 seconds */ curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L); + /* maximum number of keep-alive probes: 3 */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 3L); + curl_easy_perform(curl); } } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_NODELAY.md b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_NODELAY.md index a5640194..6b30b546 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TCP_NODELAY.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TCP_NODELAY.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_BUFFERSIZE (3) - CURLOPT_SOCKOPTFUNCTION (3) - CURLOPT_TCP_KEEPALIVE (3) +Protocol: + - TCP +Added-in: 7.11.2 --- # NAME @@ -43,9 +46,7 @@ overdone. 1 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,11 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Always. The default was changed to 1 from 0 in 7.50.2. +The default was changed to 1 from 0 in 7.50.2. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TELNETOPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_TELNETOPTIONS.md index 281ad831..85a92f8d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TELNETOPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TELNETOPTIONS.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_HTTPHEADER (3) - CURLOPT_QUOTE (3) +Protocol: + - TELNET +Added-in: 7.7 --- # NAME @@ -29,13 +32,17 @@ negotiations. The variables should be in the format \. libcurl supports the options **TTYPE**, **XDISPLOC** and **NEW_ENV**. See the TELNET standard for details. +Using this option multiple times makes the last set list override the previous +ones. Set it to NULL to disable its use again. + +libcurl does not copy the list, it needs to be kept around until after the +transfer has completed. + # DEFAULT NULL -# PROTOCOLS - -TELNET +# %PROTOCOLS% # EXAMPLE @@ -57,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with TELNET +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_BLKSIZE.md b/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_BLKSIZE.md index 8772c519..ab85fe45 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_BLKSIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_BLKSIZE.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_MAXFILESIZE (3) +Protocol: + - TFTP +Added-in: 7.19.4 --- # NAME @@ -33,9 +36,7 @@ is used. 512 -# PROTOCOLS - -TFTP +# %PROTOCOLS% # EXAMPLE @@ -54,9 +55,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_NO_OPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_NO_OPTIONS.md index 9571ebd6..098ee394 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_NO_OPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TFTP_NO_OPTIONS.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_TFTP_BLKSIZE (3) +Protocol: + - TFTP +Added-in: 7.48.0 --- # NAME @@ -33,9 +36,7 @@ CURLOPT_TFTP_BLKSIZE(3) is ignored. 0 -# PROTOCOLS - -TFTP +# %PROTOCOLS% # EXAMPLE @@ -69,9 +70,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.48.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TIMECONDITION.md b/deps/curl/docs/libcurl/opts/CURLOPT_TIMECONDITION.md index 8b42fc8b..43c679bd 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TIMECONDITION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TIMECONDITION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLINFO_FILETIME (3) - CURLOPT_TIMEVALUE (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -37,9 +40,7 @@ option can be used after a transfer to learn if a zero-byte successful CURL_TIMECOND_NONE (0) -# PROTOCOLS - -HTTP, FTP, RTSP, and FILE +# %PROTOCOLS% # EXAMPLE @@ -63,9 +64,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT.md b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT.md index 960b7692..d5b396ce 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TCP_KEEPALIVE (3) - CURLOPT_TIMEOUT_MS (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -52,16 +55,14 @@ With CURLOPT_CONNECTTIMEOUT(3) set to 4 and CURLOPT_TIMEOUT(3) set to 2, the operation can never last longer than 2 seconds. This option may cause libcurl to use the SIGALRM signal to timeout system -calls on builds not using asynch DNS. In unix-like systems, this might cause +calls on builds not using asynch DNS. In Unix-like systems, this might cause signals to be used unless CURLOPT_NOSIGNAL(3) is set. # DEFAULT -Default timeout is 0 (zero) which means it never times out during transfer. +0 (zero) which means it never times out during transfer. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -80,9 +81,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT_MS.md index dbc6ccf7..e02261d5 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEOUT_MS.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_LOW_SPEED_LIMIT (3) - CURLOPT_TCP_KEEPALIVE (3) - CURLOPT_TIMEOUT (3) +Protocol: + - All +Added-in: 7.16.2 --- # NAME @@ -32,11 +35,9 @@ See CURLOPT_TIMEOUT(3) for details. # DEFAULT -Default timeout is 0 (zero) which means it never times out during transfer. +0 (zero) which means it never times out during transfer. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -55,9 +56,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE.md b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE.md index bdd51900..ef9b9dab 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_TIMECONDITION (3) - CURLOPT_TIMEVALUE_LARGE (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -27,7 +30,7 @@ Pass a long *val* as parameter. This should be the time counted as seconds since 1 Jan 1970, and the time is used in a condition as specified with CURLOPT_TIMECONDITION(3). -On systems with 32 bit 'long' variables (such as Windows), this option cannot +On systems with 32-bit 'long' variables (such as Windows), this option cannot set dates beyond the year 2038. Consider CURLOPT_TIMEVALUE_LARGE(3) instead. @@ -35,9 +38,7 @@ instead. 0 -# PROTOCOLS - -HTTP, FTP, RTSP, and FILE +# %PROTOCOLS% # EXAMPLE @@ -60,9 +61,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md index 1b01a6b2..9ae16e4e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md @@ -8,6 +8,9 @@ See-also: - CURLINFO_FILETIME (3) - CURLOPT_TIMECONDITION (3) - CURLOPT_TIMEVALUE (3) +Protocol: + - HTTP +Added-in: 7.59.0 --- # NAME @@ -29,17 +32,15 @@ Pass a curl_off_t *val* as parameter. This should be the time counted as seconds since 1 Jan 1970, and the time is used in a condition as specified with CURLOPT_TIMECONDITION(3). -The difference between this option and CURLOPT_TIMEVALUE(3) is the type -of the argument. On systems where 'long' is only 32 bit wide, this option has -to be used to set dates beyond the year 2038. +The difference between this option and CURLOPT_TIMEVALUE(3) is the type of the +argument. On systems where 'long' is only 32 bits wide, this option has to be +used to set dates beyond the year 2038. # DEFAULT 0 -# PROTOCOLS - -HTTP, FTP, RTSP, and FILE +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.59.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md b/deps/curl/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md index 39dabc44..d2c6226d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TLS13_CIPHERS.md @@ -11,6 +11,15 @@ See-also: - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_CIPHER_LIST (3) - CURLOPT_USE_SSL (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - Schannel + - wolfSSL + - mbedTLS + - rustls +Added-in: 7.61.0 --- # NAME @@ -32,25 +41,28 @@ cipher suites to use for the TLS 1.3 connection. The list must be syntactically correct, it consists of one or more cipher suite strings separated by colons. +For setting TLS 1.2 (1.1, 1.0) ciphers see CURLOPT_SSL_CIPHER_LIST(3). + +A valid example of a cipher list is: +~~~c +"TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256" +~~~ + Find more details about cipher lists on this URL: https://curl.se/docs/ssl-ciphers.html -This option is currently used only when curl is built to use OpenSSL 1.1.1 or -later, or Schannel. If you are using a different SSL backend you can try -setting TLS 1.3 cipher suites by using the CURLOPT_SSL_CIPHER_LIST(3) -option. - The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore to internal default. + # DEFAULT -NULL, use internal default +NULL, use internal built-in -# PROTOCOLS - -All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. +# %PROTOCOLS% # EXAMPLE @@ -69,11 +81,19 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.61.0 for OpenSSL. Available when built with OpenSSL \>= 1.1.1. +OpenSSL support added in 7.61.0, available when built with OpenSSL \>= 1.1.1. +Schannel support added in 7.85.0. +LibreSSL support added in 8.3.0, available when built with LibreSSL \>= 3.4.1. +wolfSSL support added in 8.10.0. +mbedTLS support added in 8.10.0, available when built with mbedTLS \>= 3.6.0. +Rustls support added in 8.10.0. -Added in 7.85.0 for Schannel. +Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set +by using the CURLOPT_SSL_CIPHER_LIST(3) option. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md b/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md index 8f5c89d5..2548aa73 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md @@ -8,6 +8,12 @@ See-also: - CURLOPT_PROXY_TLSAUTH_PASSWORD (3) - CURLOPT_TLSAUTH_TYPE (3) - CURLOPT_TLSAUTH_USERNAME (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.21.4 --- # NAME @@ -26,21 +32,22 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_PASSWORD, char *pwd); Pass a char pointer as parameter, which should point to the null-terminated password to use for the TLS authentication method specified with the -CURLOPT_TLSAUTH_TYPE(3) option. Requires that the -CURLOPT_TLSAUTH_USERNAME(3) option also be set. +CURLOPT_TLSAUTH_TYPE(3) option. Requires that the CURLOPT_TLSAUTH_USERNAME(3) +option also be set. The application does not have to keep the string around after setting this option. -This feature relies in TLS SRP which does not work with TLS 1.3. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +This feature relies on TLS SRP which does not work with TLS 1.3. # DEFAULT NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -60,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.4, with the OpenSSL and GnuTLS backends only +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md b/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md index 066fc039..719095cf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md @@ -7,6 +7,12 @@ Source: libcurl See-also: - CURLOPT_TLSAUTH_PASSWORD (3) - CURLOPT_TLSAUTH_USERNAME (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.21.4 --- # NAME @@ -26,16 +32,18 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_TYPE, char *type); Pass a pointer to a null-terminated string as parameter. The string should be the method of the TLS authentication. Supported method is "SRP". +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to restore to internal default. + +The application does not have to keep the string around after setting this +option. + ## SRP TLS-SRP authentication. Secure Remote Password authentication for TLS is defined in RFC 5054 and provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set the -CURLOPT_TLSAUTH_USERNAME(3) and CURLOPT_TLSAUTH_PASSWORD(3) -options. - -The application does not have to keep the string around after setting this -option. +CURLOPT_TLSAUTH_USERNAME(3) and CURLOPT_TLSAUTH_PASSWORD(3) options. TLS SRP does not work with TLS 1.3. @@ -43,9 +51,7 @@ TLS SRP does not work with TLS 1.3. blank -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -65,10 +71,7 @@ int main(void) } ~~~ -# AVAILABILITY - -You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this -to work. Added in 7.21.4 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md b/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md index 9075163d..9af68650 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md @@ -7,6 +7,12 @@ Source: libcurl See-also: - CURLOPT_TLSAUTH_PASSWORD (3) - CURLOPT_TLSAUTH_TYPE (3) +Protocol: + - TLS +TLS-backend: + - OpenSSL + - GnuTLS +Added-in: 7.21.4 --- # NAME @@ -25,21 +31,22 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_USERNAME, char *user); Pass a char pointer as parameter, which should point to the null-terminated username to use for the TLS authentication method specified with the -CURLOPT_TLSAUTH_TYPE(3) option. Requires that the -CURLOPT_TLSAUTH_PASSWORD(3) option also be set. +CURLOPT_TLSAUTH_TYPE(3) option. Requires that the CURLOPT_TLSAUTH_PASSWORD(3) +option also be set. The application does not have to keep the string around after setting this option. -This feature relies in TLS SRP which does not work with TLS 1.3. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + +This feature relies on TLS SRP which does not work with TLS 1.3. # DEFAULT NULL -# PROTOCOLS - -All TLS-based protocols +# %PROTOCOLS% # EXAMPLE @@ -59,9 +66,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.4, with the OpenSSL and GnuTLS backends only +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERDATA.md index 28546ca7..bcc67530 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERDATA.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_TRAILERFUNCTION (3) - CURLOPT_WRITEFUNCTION (3) +Protocol: + - HTTP +Added-in: 7.64.0 --- # NAME @@ -29,9 +32,7 @@ Data pointer to be passed to the HTTP trailer callback function. NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -50,9 +51,7 @@ int main(void) } ~~~ -# AVAILABILITY - -This option was added in curl 7.64.0 and is present if HTTP support is enabled +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.md index 4eaee1f7..9c06a598 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_TRAILERDATA (3) - CURLOPT_WRITEFUNCTION (3) +Protocol: + - HTTP +Added-in: 7.64.0 --- # NAME @@ -57,9 +60,7 @@ without any interruptions. NULL -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE ~~~c @@ -79,7 +80,7 @@ int main(void) /* Set the URL of the request */ curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); /* Now set it as a put */ - curl_easy_setopt(curl, CURLOPT_PUT, 1L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* Assuming we have a function that returns the data to be pushed Let that function be read_cb */ @@ -101,9 +102,8 @@ int main(void) } } ~~~ -# AVAILABILITY -This option was added in curl 7.64.0 and is present if HTTP support is enabled. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFERTEXT.md b/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFERTEXT.md index 7f4798e9..d77274f7 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFERTEXT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFERTEXT.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_CRLF (3) +Protocol: + - All +Added-in: 7.1.1 --- # NAME @@ -23,7 +26,7 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRANSFERTEXT, long text); # DESCRIPTION A parameter set to 1 tells the library to use ASCII mode for FTP transfers, -instead of the default binary transfer. For win32 systems it does not set the +instead of the default binary transfer. For Win32 systems it does not set the stdout to binary mode. This option can be usable when transferring text data between systems with different views on certain characters, such as newlines or similar. @@ -36,9 +39,7 @@ simply sets the mode to ASCII and performs a standard transfer. 0, disabled -# PROTOCOLS - -FTP +# %PROTOCOLS% # EXAMPLE @@ -56,9 +57,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with FTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING.md b/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING.md index 52e37d61..a6678456 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_ACCEPT_ENCODING (3) - CURLOPT_HTTP_TRANSFER_DECODING (3) +Protocol: + - HTTP +Added-in: 7.21.6 --- # NAME @@ -41,9 +44,7 @@ by both HTTP clients and HTTP servers. 0 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -59,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.6 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.md b/deps/curl/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.md index 0783422b..7b369f19 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_ABSTRACT_UNIX_SOCKET (3) - CURLOPT_OPENSOCKETFUNCTION (3) - unix (7) +Protocol: + - All +Added-in: 7.40.0 --- # NAME @@ -35,22 +38,22 @@ does not resolve the DNS hostname in the URL. The maximum path length on Cygwin, Linux and Solaris is 107. On other platforms it might be even less. -Proxy and TCP options such as CURLOPT_TCP_NODELAY(3) are not -supported. Proxy options such as CURLOPT_PROXY(3) have no effect either -as these are TCP-oriented, and asking a proxy server to connect to a certain -Unix domain socket is not possible. +Proxy and TCP options such as CURLOPT_TCP_NODELAY(3) are not supported. Proxy +options such as CURLOPT_PROXY(3) have no effect either as these are +TCP-oriented, and asking a proxy server to connect to a certain Unix domain +socket is not possible. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -Default is NULL, meaning that no Unix domain sockets are used. +NULL - no Unix domain sockets are used. -# PROTOCOLS - -All protocols except for FILE and FTP are supported in theory. HTTP, IMAP, -POP3 and SMTP should in particular work (including their SSL/TLS variants). +# %PROTOCOLS% # EXAMPLE @@ -78,9 +81,7 @@ you can use the proc filesystem to bypass the limitation: /* Be sure to keep dirfd valid until you discard the handle */ ~~~ -# AVAILABILITY - -Added in 7.40.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_UNRESTRICTED_AUTH.md b/deps/curl/docs/libcurl/opts/CURLOPT_UNRESTRICTED_AUTH.md index 0ce080ae..a80c4f6f 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_UNRESTRICTED_AUTH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_UNRESTRICTED_AUTH.md @@ -10,6 +10,9 @@ See-also: - CURLOPT_MAXREDIRS (3) - CURLOPT_REDIR_PROTOCOLS_STR (3) - CURLOPT_USERPWD (3) +Protocol: + - HTTP +Added-in: 7.10.4 --- # NAME @@ -28,17 +31,19 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UNRESTRICTED_AUTH, # DESCRIPTION Set the long *gohead* parameter to 1L to make libcurl continue to send -authentication (user+password) credentials when following locations, even when -hostname changed. This option is meaningful only when setting -CURLOPT_FOLLOWLOCATION(3). +authentication (user+password) credentials or explicitly set cookie headers +when following locations, even when the host changes. This option is +meaningful only when setting CURLOPT_FOLLOWLOCATION(3). -Further, when this option is not used or set to **0L**, libcurl does not -send custom nor internally generated Authentication: headers on requests done -to other hosts than the one used for the initial URL. +Further, when this option is not used or set to **0L**, libcurl does not send +custom nor internally generated `Authentication:` or `Cookie:` headers on +requests done to other hosts than the one used for the initial URL. Another +host means that one or more of hostname, protocol scheme or port number +changed. -By default, libcurl only sends credentials and Authentication headers to the -initial hostname as given in the original URL, to avoid leaking username + -password to other sites. +By default, libcurl only sends `Authentication:` or explicitly set `Cookie:` +headers to the initial host as given in the original URL, to avoid leaking +username + password to other sites. This option should be used with caution: when curl follows redirects it blindly fetches the next URL as instructed by the server. Setting @@ -46,13 +51,16 @@ CURLOPT_UNRESTRICTED_AUTH(3) to 1L makes curl trust the server and sends possibly sensitive credentials to any host the server points to, possibly again and again as the following hosts can keep redirecting to new hosts. +Due to the way HTTP works, almost any header can be made to contain data a +client may not want to pass on to other servers than the initially intended +host and for all other headers than the two mentioned above, there is no +protection from this happening when libcurl is told to follow redirects. + # DEFAULT 0 -# PROTOCOLS - -HTTP +# %PROTOCOLS% # EXAMPLE @@ -69,9 +77,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Along with HTTP +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_UPKEEP_INTERVAL_MS.md b/deps/curl/docs/libcurl/opts/CURLOPT_UPKEEP_INTERVAL_MS.md index 11833c29..d8cdb90e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_UPKEEP_INTERVAL_MS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_UPKEEP_INTERVAL_MS.md @@ -6,6 +6,9 @@ Section: 3 Source: libcurl See-also: - CURLOPT_TCP_KEEPALIVE (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -39,9 +42,7 @@ is called, an HTTP/2 PING frame is sent on the connection. CURL_UPKEEP_INTERVAL_DEFAULT (currently defined as 60000L, which is 60 seconds) -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -73,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD.md b/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD.md index 0d4d8aad..eec09066 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_INFILESIZE_LARGE (3) - CURLOPT_PUT (3) - CURLOPT_READFUNCTION (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -25,27 +28,25 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UPLOAD, long upload); # DESCRIPTION The long parameter *upload* set to 1 tells the library to prepare for and -perform an upload. The CURLOPT_READDATA(3) and -CURLOPT_INFILESIZE(3) or CURLOPT_INFILESIZE_LARGE(3) options are -also interesting for uploads. If the protocol is HTTP, uploading means using -the PUT request unless you tell libcurl otherwise. +perform an upload. The CURLOPT_READDATA(3) and CURLOPT_INFILESIZE(3) or +CURLOPT_INFILESIZE_LARGE(3) options are also interesting for uploads. If the +protocol is HTTP, uploading means using the PUT request unless you tell +libcurl otherwise. Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER(3) as usual. If you use PUT to an HTTP 1.1 server, you can upload data without knowing the size before starting the transfer. The library enables this by adding a header -"Transfer-Encoding: chunked". With HTTP 1.0 or if you prefer not to use chunked -transfer, you must specify the size of the data with +"Transfer-Encoding: chunked". With HTTP 1.0 or if you prefer not to use +chunked transfer, you must specify the size of the data with CURLOPT_INFILESIZE(3) or CURLOPT_INFILESIZE_LARGE(3). # DEFAULT -0, default is download +0 -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -82,15 +83,13 @@ int main(void) /* Set the size of the file to upload */ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize); - /* Now run off and do what you have been told! */ + /* Now run off and do what you have been told */ curl_easy_perform(curl); } } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD_BUFFERSIZE.md b/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD_BUFFERSIZE.md index 0291fcf0..72a4b64d 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD_BUFFERSIZE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_UPLOAD_BUFFERSIZE.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_BUFFERSIZE (3) - CURLOPT_READFUNCTION (3) - CURLOPT_TCP_NODELAY (3) +Protocol: + - All +Added-in: 7.62.0 --- # NAME @@ -47,9 +50,7 @@ transfer as that may lead to unintended consequences. 65536 bytes -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -71,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.62.0. +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_URL.md b/deps/curl/docs/libcurl/opts/CURLOPT_URL.md index f0650a9e..93dacdf2 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_URL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_URL.md @@ -10,10 +10,13 @@ See-also: - CURLOPT_FORBID_REUSE (3) - CURLOPT_FRESH_CONNECT (3) - CURLOPT_PATH_AS_IS (3) - - CURLOPT_PROTOCOLS (3) + - CURLOPT_PROTOCOLS_STR (3) - curl_easy_perform (3) - curl_url_get (3) - curl_url_set (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -68,6 +71,10 @@ transfer is started. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. Note however that +libcurl needs a URL set to be able to performed a transfer. + The parser used for handling the URL set with CURLOPT_URL(3) is the same that curl_url_set(3) uses. @@ -78,15 +85,14 @@ expected to be a sequence of characters using an ASCII compatible encoding. If libcurl is built with IDN support, the server name part of the URL can use an "international name" by using the current encoding (according to locale) or -UTF-8 (when winidn is used; or a Windows Unicode build using libidn2). +UTF-8 (when WinIDN is used; or a Windows Unicode build using libidn2). If libcurl is built without IDN support, the server name is used exactly as specified when passed to the name resolver functions. # DEFAULT -There is no default URL. If this option is not set, no transfer can be -performed. +NULL. If this option is not set, no transfer can be performed. # SECURITY CONCERNS @@ -107,15 +113,13 @@ custom port number can allow external users to play tricks with your local services. Accepting external URLs may also use other protocols than http:// or other -common ones. Restrict what accept with CURLOPT_PROTOCOLS(3). +common ones. Restrict what accept with CURLOPT_PROTOCOLS_STR(3). User provided URLs can also be made to point to sites that redirect further on (possibly to other protocols too). Consider your -CURLOPT_FOLLOWLOCATION(3) and CURLOPT_REDIR_PROTOCOLS(3) settings. +CURLOPT_FOLLOWLOCATION(3) and CURLOPT_REDIR_PROTOCOLS_STR(3) settings. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -131,9 +135,7 @@ int main(void) } ~~~ -# AVAILABILITY - -POP3 and SMTP were added in 7.31.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_USERAGENT.md b/deps/curl/docs/libcurl/opts/CURLOPT_USERAGENT.md index 4547da53..e10ff0cf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_USERAGENT.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_USERAGENT.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_HTTPHEADER (3) - CURLOPT_REFERER (3) - CURLOPT_REQUEST_TARGET (3) +Protocol: + - HTTP +Added-in: 7.1 --- # NAME @@ -32,13 +35,14 @@ can also set any custom header with CURLOPT_HTTPHEADER(3). The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT -NULL, no User-Agent: header is used by default. +NULL, no User-Agent: header is used. -# PROTOCOLS - -HTTP, HTTPS +# %PROTOCOLS% # EXAMPLE @@ -56,9 +60,7 @@ int main(void) } ~~~ -# AVAILABILITY - -As long as HTTP is supported +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_USERNAME.md b/deps/curl/docs/libcurl/opts/CURLOPT_USERNAME.md index 7c53fdf3..72742194 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_USERNAME.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_USERNAME.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_PASSWORD (3) - CURLOPT_PROXYAUTH (3) - CURLOPT_USERPWD (3) +Protocol: + - All +Added-in: 7.19.1 --- # NAME @@ -58,9 +61,7 @@ option. blank -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -81,9 +82,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.19.1 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_USERPWD.md b/deps/curl/docs/libcurl/opts/CURLOPT_USERPWD.md index 366593fb..b9db9faf 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_USERPWD.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_USERPWD.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_PASSWORD (3) - CURLOPT_PROXYUSERPWD (3) - CURLOPT_USERNAME (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -60,13 +63,14 @@ for that, or include it in the URL. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -Most +# %PROTOCOLS% # EXAMPLE @@ -87,9 +91,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_USE_SSL.md b/deps/curl/docs/libcurl/opts/CURLOPT_USE_SSL.md index 9cb5eb7f..c74be586 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_USE_SSL.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_USE_SSL.md @@ -8,6 +8,12 @@ See-also: - CURLOPT_PROXY_SSLVERSION (3) - CURLOPT_SSLVERSION (3) - CURLOPT_SSL_OPTIONS (3) +Protocol: + - FTP + - SMTP + - POP3 + - IMAP +Added-in: 7.17.0 --- # NAME @@ -53,9 +59,7 @@ Require SSL for all communication or fail with *CURLE_USE_SSL_FAILED*. CURLUSESSL_NONE -# PROTOCOLS - -FTP, SMTP, POP3, IMAP, LDAP +# %PROTOCOLS% # EXAMPLE @@ -75,11 +79,13 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.11.0. This option was known as CURLOPT_FTP_SSL up to 7.16.4, and -the constants were known as CURLFTPSSL_* -Handled by LDAP since 7.81.0. Fully supported by the OpenLDAP backend only. +This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants were +known as CURLFTPSSL_* Handled by LDAP since 7.81.0. Fully supported by the +OpenLDAP backend only. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_VERBOSE.md b/deps/curl/docs/libcurl/opts/CURLOPT_VERBOSE.md index 83855be3..b242fcbc 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_VERBOSE.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_VERBOSE.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_ERRORBUFFER (3) - CURLOPT_STDERR (3) - curl_global_trace (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -40,9 +43,7 @@ CURLOPT_DEBUGFUNCTION(3). 0, meaning disabled. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -62,9 +63,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Always +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_WILDCARDMATCH.md b/deps/curl/docs/libcurl/opts/CURLOPT_WILDCARDMATCH.md index b0130dbe..e6ca3d65 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_WILDCARDMATCH.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_WILDCARDMATCH.md @@ -9,6 +9,9 @@ See-also: - CURLOPT_CHUNK_END_FUNCTION (3) - CURLOPT_FNMATCH_FUNCTION (3) - CURLOPT_URL (3) +Protocol: + - FTP +Added-in: 7.21.0 --- # NAME @@ -74,9 +77,7 @@ Using the rules above, a filename pattern can be constructed: ftp://example.com/some/path/[a-z[:upper:]\\].jpg -# PROTOCOLS - -This feature is only supported for FTP download. +# %PROTOCOLS% # EXAMPLE @@ -102,9 +103,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.21.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_WRITEDATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_WRITEDATA.md index a4a4a238..c042a19e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_WRITEDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_WRITEDATA.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HEADERDATA (3) - CURLOPT_READDATA (3) - CURLOPT_WRITEFUNCTION (3) +Protocol: + - All +Added-in: 7.9.7 --- # NAME @@ -39,24 +42,24 @@ crashes. # DEFAULT -By default, this is a FILE * to stdout. +stdout -# PROTOCOLS - -Used for all protocols. +# %PROTOCOLS% # EXAMPLE A common technique is to use the write callback to store the incoming data into a dynamically growing allocated buffer, and then this -CURLOPT_WRITEDATA(3) is used to point to a struct or the buffer to store -data in. Like in the getinmemory example: +CURLOPT_WRITEDATA(3) is used to point to a struct or the buffer to store data +in. Like in the getinmemory example: https://curl.se/libcurl/c/getinmemory.html -# AVAILABILITY +# HISTORY -Available in all libcurl versions. This option was formerly known as -CURLOPT_FILE, the name CURLOPT_WRITEDATA(3) was added in 7.9.7. +This option was formerly known as CURLOPT_FILE, the name CURLOPT_WRITEDATA(3) +was added in 7.9.7. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md index 6a7e023b..3ee11d8e 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_HEADERFUNCTION (3) - CURLOPT_READFUNCTION (3) - CURLOPT_WRITEDATA (3) +Protocol: + - All +Added-in: 7.1 --- # NAME @@ -70,11 +73,9 @@ do that. # DEFAULT -libcurl uses 'fwrite' as a callback by default. +fwrite(3) -# PROTOCOLS - -For all protocols +# %PROTOCOLS% # EXAMPLE @@ -87,14 +88,14 @@ struct memory { size_t size; }; -static size_t cb(void *data, size_t size, size_t nmemb, void *clientp) +static size_t cb(char *data, size_t size, size_t nmemb, void *clientp) { size_t realsize = size * nmemb; struct memory *mem = (struct memory *)clientp; char *ptr = realloc(mem->response, mem->size + realsize + 1); if(!ptr) - return 0; /* out of memory! */ + return 0; /* out of memory */ mem->response = ptr; memcpy(&(mem->response[mem->size]), data, realsize); @@ -127,10 +128,12 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY Support for the CURL_WRITEFUNC_PAUSE return code was added in version 7.18.0. +# %AVAILABILITY% + # RETURN VALUE This returns CURLE_OK. diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md b/deps/curl/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md index c1157e04..3eba3705 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_CONNECT_ONLY (3) - curl_ws_recv (3) - curl_ws_send (3) +Protocol: + - WS +Added-in: 7.86.0 --- # NAME @@ -45,9 +48,7 @@ application. 0 -# PROTOCOLS - -WebSocket +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.86.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFODATA.md b/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFODATA.md index 78616676..4ed174ef 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFODATA.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFODATA.md @@ -8,6 +8,9 @@ See-also: - CURLOPT_NOPROGRESS (3) - CURLOPT_VERBOSE (3) - CURLOPT_XFERINFOFUNCTION (3) +Protocol: + - All +Added-in: 7.32.0 --- # NAME @@ -31,11 +34,9 @@ This is an alias for CURLOPT_PROGRESSDATA(3). # DEFAULT -The default value of this parameter is NULL. +NULL -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -71,9 +72,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.32.0 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md b/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md index 41bd89a2..e2f95371 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md @@ -7,6 +7,9 @@ Source: libcurl See-also: - CURLOPT_NOPROGRESS (3) - CURLOPT_XFERINFODATA (3) +Protocol: + - All +Added-in: 7.32.0 --- # NAME @@ -53,12 +56,14 @@ you only download data, the upload size remains 0). Many times the callback is called one or more times first, before it knows the data sizes so a program must be made to handle that. +Return zero from the callback if everything is fine. + +Return 1 from this callback to make libcurl abort the transfer and return +*CURLE_ABORTED_BY_CALLBACK*. + If your callback function returns CURL_PROGRESSFUNC_CONTINUE it makes libcurl to continue executing the default progress function. -Returning any other non-zero value from this callback makes libcurl abort the -transfer and return *CURLE_ABORTED_BY_CALLBACK*. - If you transfer data with the multi interface, this function is not called during periods of idleness unless you call the appropriate libcurl function that performs transfers. @@ -68,12 +73,9 @@ get called. # DEFAULT -By default, libcurl has an internal progress meter. That is rarely wanted by -users. +NULL - use the internal progress meter. That is rarely wanted by users. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -106,14 +108,15 @@ int main(void) /* pass struct to callback */ curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data); + /* enable progress callback getting called */ + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); } } ~~~ -# AVAILABILITY - -Added in 7.32.0. This callback replaces CURLOPT_PROGRESSFUNCTION(3) +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLOPT_XOAUTH2_BEARER.md b/deps/curl/docs/libcurl/opts/CURLOPT_XOAUTH2_BEARER.md index 7f036d98..74289658 100644 --- a/deps/curl/docs/libcurl/opts/CURLOPT_XOAUTH2_BEARER.md +++ b/deps/curl/docs/libcurl/opts/CURLOPT_XOAUTH2_BEARER.md @@ -7,6 +7,13 @@ Source: libcurl See-also: - CURLOPT_MAIL_AUTH (3) - CURLOPT_USERNAME (3) +Protocol: + - HTTP + - IMAP + - LDAP + - POP3 + - SMTP +Added-in: 7.33.0 --- # NAME @@ -33,13 +40,14 @@ Token should be supplied via the CURLOPT_USERNAME(3) option. The application does not have to keep the string around after setting this option. +Using this option multiple times makes the last set string override the +previous ones. Set it to NULL to disable its use again. + # DEFAULT NULL -# PROTOCOLS - -HTTP, IMAP, LDAP, POP3 and SMTP +# %PROTOCOLS% # EXAMPLE @@ -57,9 +65,11 @@ int main(void) } ~~~ -# AVAILABILITY +# HISTORY -Added in 7.33.0. Support for OpenLDAP added in 7.82.0. +Support for OpenLDAP added in 7.82.0. + +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLSHOPT_LOCKFUNC.md b/deps/curl/docs/libcurl/opts/CURLSHOPT_LOCKFUNC.md index 47fbae96..208dfdd6 100644 --- a/deps/curl/docs/libcurl/opts/CURLSHOPT_LOCKFUNC.md +++ b/deps/curl/docs/libcurl/opts/CURLSHOPT_LOCKFUNC.md @@ -9,6 +9,9 @@ See-also: - curl_share_cleanup (3) - curl_share_init (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -46,9 +49,7 @@ sure that the callback uses a different lock for each kind of data. *clientp* is the private pointer you set with CURLSHOPT_USERDATA(3). This pointer is not used by libcurl itself. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -66,9 +67,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLSHOPT_SHARE.md b/deps/curl/docs/libcurl/opts/CURLSHOPT_SHARE.md index 7866640c..fa6838cb 100644 --- a/deps/curl/docs/libcurl/opts/CURLSHOPT_SHARE.md +++ b/deps/curl/docs/libcurl/opts/CURLSHOPT_SHARE.md @@ -9,6 +9,9 @@ See-also: - curl_share_cleanup (3) - curl_share_init (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -38,6 +41,8 @@ Cookie data is shared across the easy handles using this shared object. Note that this does not activate an easy handle's cookie handling. You can do that separately by using CURLOPT_COOKIEFILE(3) for example. +It is not supported to share cookies between multiple concurrent threads. + ## CURL_LOCK_DATA_DNS Cached DNS hosts are shared across the easy handles using this shared @@ -52,6 +57,8 @@ the same server. Note SSL session IDs are reused within the same easy handle by default. Note this symbol was added in 7.10.3 but was not implemented until 7.23.0. +It is not supported to share SSL sessions between multiple concurrent threads. + ## CURL_LOCK_DATA_CONNECT Put the connection cache in the share object and make all easy handles using @@ -59,9 +66,9 @@ this share object share the connection cache. It is not supported to share connections between multiple concurrent threads. -Connections that are used for HTTP/1.1 Pipelining or HTTP/2 multiplexing only -get additional transfers added to them if the existing connection is held by -the same multi or easy handle. libcurl does not support doing HTTP/2 streams +Connections that are used for HTTP/2 or HTTP/3 multiplexing only get +additional transfers added to them if the existing connection is held by the +same multi or easy handle. libcurl does not support doing multiplexed streams in different threads using a shared connection. Support for **CURL_LOCK_DATA_CONNECT** was added in 7.57.0, but the symbol @@ -89,9 +96,7 @@ It is not supported to share the HSTS between multiple concurrent threads. Added in 7.88.0 -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -106,9 +111,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLSHOPT_UNLOCKFUNC.md b/deps/curl/docs/libcurl/opts/CURLSHOPT_UNLOCKFUNC.md index 10db90eb..50391823 100644 --- a/deps/curl/docs/libcurl/opts/CURLSHOPT_UNLOCKFUNC.md +++ b/deps/curl/docs/libcurl/opts/CURLSHOPT_UNLOCKFUNC.md @@ -9,6 +9,9 @@ See-also: - curl_share_cleanup (3) - curl_share_init (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -42,9 +45,7 @@ sure that the callback uses a different lock for each kind of data. *clientp* is the private pointer you set with CURLSHOPT_USERDATA(3). This pointer is not used by libcurl itself. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -61,9 +62,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLSHOPT_UNSHARE.md b/deps/curl/docs/libcurl/opts/CURLSHOPT_UNSHARE.md index e6c23401..43edb4d2 100644 --- a/deps/curl/docs/libcurl/opts/CURLSHOPT_UNSHARE.md +++ b/deps/curl/docs/libcurl/opts/CURLSHOPT_UNSHARE.md @@ -9,6 +9,9 @@ See-also: - curl_share_cleanup (3) - curl_share_init (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -56,9 +59,7 @@ The connection cache is no longer shared. The Public Suffix List is no longer shared. -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -73,9 +74,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/CURLSHOPT_USERDATA.md b/deps/curl/docs/libcurl/opts/CURLSHOPT_USERDATA.md index 9349cebb..5796ce21 100644 --- a/deps/curl/docs/libcurl/opts/CURLSHOPT_USERDATA.md +++ b/deps/curl/docs/libcurl/opts/CURLSHOPT_USERDATA.md @@ -9,6 +9,9 @@ See-also: - curl_share_cleanup (3) - curl_share_init (3) - curl_share_setopt (3) +Protocol: + - All +Added-in: 7.10.3 --- # NAME @@ -29,9 +32,7 @@ The *clientp* parameter is held verbatim by libcurl and is passed on as the *clientp* argument to the callbacks set with CURLSHOPT_LOCKFUNC(3) and CURLSHOPT_UNLOCKFUNC(3). -# PROTOCOLS - -All +# %PROTOCOLS% # EXAMPLE @@ -51,9 +52,7 @@ int main(void) } ~~~ -# AVAILABILITY - -Added in 7.10 +# %AVAILABILITY% # RETURN VALUE diff --git a/deps/curl/docs/libcurl/opts/Makefile.inc b/deps/curl/docs/libcurl/opts/Makefile.inc index 7a292b81..8591f47b 100644 --- a/deps/curl/docs/libcurl/opts/Makefile.inc +++ b/deps/curl/docs/libcurl/opts/Makefile.inc @@ -32,14 +32,15 @@ man_MANS = \ CURLINFO_CERTINFO.3 \ CURLINFO_CONDITION_UNMET.3 \ CURLINFO_CONNECT_TIME.3 \ - CURLINFO_CONNECT_TIME_T.3 \ CURLINFO_CONN_ID.3 \ + CURLINFO_CONNECT_TIME_T.3 \ CURLINFO_CONTENT_LENGTH_DOWNLOAD.3 \ CURLINFO_CONTENT_LENGTH_DOWNLOAD_T.3 \ CURLINFO_CONTENT_LENGTH_UPLOAD.3 \ CURLINFO_CONTENT_LENGTH_UPLOAD_T.3 \ CURLINFO_CONTENT_TYPE.3 \ CURLINFO_COOKIELIST.3 \ + CURLINFO_EARLYDATA_SENT_T.3 \ CURLINFO_EFFECTIVE_METHOD.3 \ CURLINFO_EFFECTIVE_URL.3 \ CURLINFO_FILETIME.3 \ @@ -58,6 +59,7 @@ man_MANS = \ CURLINFO_OS_ERRNO.3 \ CURLINFO_PRETRANSFER_TIME.3 \ CURLINFO_PRETRANSFER_TIME_T.3 \ + CURLINFO_POSTTRANSFER_TIME_T.3 \ CURLINFO_PRIMARY_IP.3 \ CURLINFO_PRIMARY_PORT.3 \ CURLINFO_PRIVATE.3 \ @@ -166,6 +168,7 @@ man_MANS = \ CURLOPT_DOH_SSL_VERIFYPEER.3 \ CURLOPT_DOH_SSL_VERIFYSTATUS.3 \ CURLOPT_DOH_URL.3 \ + CURLOPT_ECH.3 \ CURLOPT_EGDSOCKET.3 \ CURLOPT_ERRORBUFFER.3 \ CURLOPT_EXPECT_100_TIMEOUT_MS.3 \ @@ -383,6 +386,7 @@ man_MANS = \ CURLOPT_TCP_KEEPALIVE.3 \ CURLOPT_TCP_KEEPIDLE.3 \ CURLOPT_TCP_KEEPINTVL.3 \ + CURLOPT_TCP_KEEPCNT.3 \ CURLOPT_TCP_NODELAY.3 \ CURLOPT_TELNETOPTIONS.3 \ CURLOPT_TFTP_BLKSIZE.3 \ diff --git a/deps/curl/docs/libcurl/symbols-in-versions b/deps/curl/docs/libcurl/symbols-in-versions index a627dd68..ddda26d8 100644 --- a/deps/curl/docs/libcurl/symbols-in-versions +++ b/deps/curl/docs/libcurl/symbols-in-versions @@ -177,7 +177,7 @@ CURL_VERSION_LARGEFILE 7.11.1 CURL_VERSION_LIBZ 7.10 CURL_VERSION_MULTI_SSL 7.56.0 CURL_VERSION_NTLM 7.10.6 -CURL_VERSION_NTLM_WB 7.22.0 +CURL_VERSION_NTLM_WB 7.22.0 8.8.0 CURL_VERSION_PSL 7.47.0 CURL_VERSION_SPNEGO 7.10.8 CURL_VERSION_SSL 7.10 @@ -210,7 +210,7 @@ CURLAUTH_GSSNEGOTIATE 7.10.6 7.38.0 CURLAUTH_NEGOTIATE 7.38.0 CURLAUTH_NONE 7.10.6 CURLAUTH_NTLM 7.10.6 -CURLAUTH_NTLM_WB 7.22.0 +CURLAUTH_NTLM_WB 7.22.0 8.8.0 CURLAUTH_ONLY 7.21.3 CURLCLOSEPOLICY_CALLBACK 7.7 7.16.1 CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 7.16.1 @@ -340,6 +340,7 @@ CURLE_URL_MALFORMAT_USER 7.1 7.17.0 CURLE_USE_SSL_FAILED 7.17.0 CURLE_WEIRD_SERVER_REPLY 7.51.0 CURLE_WRITE_ERROR 7.1 +CURLE_ECH_REQUIRED 8.8.0 CURLFILETYPE_DEVICE_BLOCK 7.21.0 CURLFILETYPE_DEVICE_CHAR 7.21.0 CURLFILETYPE_DIRECTORY 7.21.0 @@ -434,6 +435,7 @@ CURLINFO_COOKIELIST 7.14.1 CURLINFO_DATA_IN 7.9.6 CURLINFO_DATA_OUT 7.9.6 CURLINFO_DOUBLE 7.4.1 +CURLINFO_EARLYDATA_SENT_T 8.11.0 CURLINFO_EFFECTIVE_METHOD 7.72.0 CURLINFO_EFFECTIVE_URL 7.4 CURLINFO_END 7.9.6 @@ -461,6 +463,7 @@ CURLINFO_OFF_T 7.55.0 CURLINFO_OS_ERRNO 7.12.2 CURLINFO_PRETRANSFER_TIME 7.4.1 CURLINFO_PRETRANSFER_TIME_T 7.61.0 +CURLINFO_POSTTRANSFER_TIME_T 8.10.0 CURLINFO_PRIMARY_IP 7.19.0 CURLINFO_PRIMARY_PORT 7.21.0 CURLINFO_PRIVATE 7.10.3 @@ -617,6 +620,7 @@ CURLOPT_DOH_SSL_VERIFYHOST 7.76.0 CURLOPT_DOH_SSL_VERIFYPEER 7.76.0 CURLOPT_DOH_SSL_VERIFYSTATUS 7.76.0 CURLOPT_DOH_URL 7.62.0 +CURLOPT_ECH 8.8.0 CURLOPT_EGDSOCKET 7.7 7.84.0 CURLOPT_ENCODING 7.10 7.21.6 CURLOPT_ERRORBUFFER 7.1 @@ -862,6 +866,7 @@ CURLOPT_TCP_FASTOPEN 7.49.0 CURLOPT_TCP_KEEPALIVE 7.25.0 CURLOPT_TCP_KEEPIDLE 7.25.0 CURLOPT_TCP_KEEPINTVL 7.25.0 +CURLOPT_TCP_KEEPCNT 8.9.0 CURLOPT_TCP_NODELAY 7.11.2 CURLOPT_TELNETOPTIONS 7.7 CURLOPT_TFTP_BLKSIZE 7.19.4 @@ -1050,6 +1055,7 @@ CURLSSLOPT_NATIVE_CA 7.71.0 CURLSSLOPT_NO_PARTIALCHAIN 7.68.0 CURLSSLOPT_NO_REVOKE 7.44.0 CURLSSLOPT_REVOKE_BEST_EFFORT 7.70.0 +CURLSSLOPT_EARLYDATA 8.11.0 CURLSSLSET_NO_BACKENDS 7.56.0 CURLSSLSET_OK 7.56.0 CURLSSLSET_TOO_LATE 7.56.0 @@ -1062,9 +1068,11 @@ CURLU_APPENDQUERY 7.62.0 CURLU_DEFAULT_PORT 7.62.0 CURLU_DEFAULT_SCHEME 7.62.0 CURLU_DISALLOW_USER 7.62.0 +CURLU_GET_EMPTY 8.8.0 CURLU_GUESS_SCHEME 7.62.0 CURLU_NO_AUTHORITY 7.67.0 CURLU_NO_DEFAULT_PORT 7.62.0 +CURLU_NO_GUESS_SCHEME 8.9.0 CURLU_NON_SUPPORT_SCHEME 7.62.0 CURLU_PATH_AS_IS 7.62.0 CURLU_PUNY2IDN 8.3.0 @@ -1130,6 +1138,7 @@ CURLVERSION_SEVENTH 7.70.0 CURLVERSION_SIXTH 7.66.0 CURLVERSION_TENTH 7.77.0 CURLVERSION_THIRD 7.12.0 +CURLVERSION_TWELFTH 8.8.0 CURLWARNING 7.66.0 CURLWS_BINARY 7.86.0 CURLWS_CLOSE 7.86.0 diff --git a/deps/curl/docs/mk-ca-bundle.md b/deps/curl/docs/mk-ca-bundle.md index 8a813099..fe686352 100644 --- a/deps/curl/docs/mk-ca-bundle.md +++ b/deps/curl/docs/mk-ca-bundle.md @@ -6,6 +6,7 @@ Section: 1 Source: mk-ca-bundle See-also: - curl (1) +Added-in: n/a --- # NAME diff --git a/deps/curl/docs/options-in-versions b/deps/curl/docs/options-in-versions index 09058094..a7a11630 100644 --- a/deps/curl/docs/options-in-versions +++ b/deps/curl/docs/options-in-versions @@ -54,7 +54,9 @@ --doh-cert-status 7.76.0 --doh-insecure 7.76.0 --doh-url 7.62.0 +--dump-ca-embed 8.10.0 --dump-header (-D) 5.7 +--ech 8.8.0 --egd-file 7.7 --engine 7.9.3 --etag-compare 7.68.0 @@ -97,14 +99,15 @@ --http3 7.66.0 --http3-only 7.88.0 --ignore-content-length 7.14.1 +--ip-tos 8.9.0 --ipfs-gateway 8.4.0 ---include (-i) 4.8 --insecure (-k) 7.10 --interface 7.3 --ipv4 (-4) 7.10.8 --ipv6 (-6) 7.10.8 --json 7.82.0 --junk-session-cookies (-j) 7.9.7 +--keepalive-cnt 8.9.0 --keepalive-time 7.18.0 --key 7.9.3 --key-type 7.9.3 @@ -125,6 +128,7 @@ --max-redirs 7.5 --max-time (-m) 4.0 --metalink 7.27.0 +--mptcp 8.9.0 --negotiate 7.10.6 --netrc (-n) 4.6 --netrc-file 7.21.5 @@ -212,7 +216,9 @@ --sasl-ir 7.31.0 --service-name 7.43.0 --show-error (-S) 5.9 +--show-headers (-i) 4.8 --silent (-s) 4.0 +--skip-existing 8.10.0 --socks4 7.15.2 --socks4a 7.18.0 --socks5 7.18.0 @@ -240,6 +246,7 @@ --tftp-blksize 7.20.0 --tftp-no-options 7.48.0 --time-cond (-z) 5.8 +--tls-earlydata 8.11.0 --tls-max 7.54.0 --tls13-ciphers 7.61.0 --tlsauthtype 7.21.4 @@ -266,5 +273,6 @@ --variable 8.3.0 --verbose (-v) 4.0 --version (-V) 4.0 +--vlan-priority 8.9.0 --write-out (-w) 6.5 --xattr 7.21.3 diff --git a/deps/curl/include/README.md b/deps/curl/include/README.md index c9659326..b155d8c1 100644 --- a/deps/curl/include/README.md +++ b/deps/curl/include/README.md @@ -8,7 +8,7 @@ SPDX-License-Identifier: curl Public include files for libcurl, external users. -They're all placed in the curl subdirectory here for better fit in any kind of +They are all placed in the curl subdirectory here for better fit in any kind of environment. You must include files from here using... #include diff --git a/deps/curl/include/curl/Makefile.am b/deps/curl/include/curl/Makefile.am index a655aff1..8864d60e 100644 --- a/deps/curl/include/curl/Makefile.am +++ b/deps/curl/include/curl/Makefile.am @@ -35,7 +35,7 @@ CS_ = $(CS_0) checksrc: $(CHECKSRC)@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) -if CURLDEBUG +if DEBUGBUILD # for debug builds, we scan the sources on all regular make invokes all-local: checksrc endif diff --git a/deps/curl/include/curl/curl.h b/deps/curl/include/curl/curl.h index b2377b78..21a552bc 100644 --- a/deps/curl/include/curl/curl.h +++ b/deps/curl/include/curl/curl.h @@ -30,28 +30,37 @@ */ #ifdef CURL_NO_OLDIES -#define CURL_STRICTER +#define CURL_STRICTER /* not used since 8.11.0 */ #endif /* Compile-time deprecation macros. */ -#if defined(__GNUC__) && \ - ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) && \ - !defined(__INTEL_COMPILER) && \ +#if (defined(__GNUC__) && \ + ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1))) || \ + (defined(__clang__) && __clang_major__ >= 3) || \ + defined(__IAR_SYSTEMS_ICC__)) && \ + !defined(__INTEL_COMPILER) && \ !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL) #define CURL_DEPRECATED(version, message) \ __attribute__((deprecated("since " # version ". " message))) +#if defined(__IAR_SYSTEMS_ICC__) +#define CURL_IGNORE_DEPRECATION(statements) \ + _Pragma("diag_suppress=Pe1444") \ + statements \ + _Pragma("diag_default=Pe1444") +#else #define CURL_IGNORE_DEPRECATION(statements) \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ statements \ _Pragma("GCC diagnostic pop") +#endif #else #define CURL_DEPRECATED(version, message) #define CURL_IGNORE_DEPRECATION(statements) statements #endif #include "curlver.h" /* libcurl version defines */ -#include "system.h" /* determine things run-time */ +#include "system.h" /* determine things runtime */ #include #include @@ -68,8 +77,8 @@ #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \ defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ +/* The check above prevents the winsock2.h inclusion if winsock.h already was + included, since they cannot co-exist without problems */ #include #include #endif @@ -105,13 +114,8 @@ extern "C" { #endif -#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) -typedef struct Curl_easy CURL; -typedef struct Curl_share CURLSH; -#else typedef void CURL; typedef void CURLSH; -#endif /* * libcurl external API function linkage decorations. @@ -189,9 +193,9 @@ struct curl_httppost { files */ long flags; /* as defined below */ -/* specified content is a file name */ +/* specified content is a filename */ #define CURL_HTTPPOST_FILENAME (1<<0) -/* specified content is a file name */ +/* specified content is a filename */ #define CURL_HTTPPOST_READFILE (1<<1) /* name is only stored pointer do not free in formfree */ #define CURL_HTTPPOST_PTRNAME (1<<2) @@ -207,8 +211,8 @@ struct curl_httppost { /* use size in 'contentlen', added in 7.46.0 */ #define CURL_HTTPPOST_LARGE (1<<7) - char *showfilename; /* The file name to show. If not set, the - actual file name will be used (if this + char *showfilename; /* The filename to show. If not set, the + actual filename will be used (if this is a file part) */ void *userp; /* custom pointer used for HTTPPOST_CALLBACK posts */ @@ -245,12 +249,12 @@ typedef int (*curl_xferinfo_callback)(void *clientp, #endif #ifndef CURL_MAX_WRITE_SIZE - /* Tests have proven that 20K is a very bad buffer size for uploads on - Windows, while 16K for some odd reason performed a lot better. - We do the ifndef check to allow this value to easier be changed at build - time for those who feel adventurous. The practical minimum is about - 400 bytes since libcurl uses a buffer of this size as a scratch area - (unrelated to network send operations). */ + /* Tests have proven that 20K is a bad buffer size for uploads on Windows, + while 16K for some odd reason performed a lot better. We do the ifndef + check to allow this value to easier be changed at build time for those + who feel adventurous. The practical minimum is about 400 bytes since + libcurl uses a buffer of this size as a scratch area (unrelated to + network send operations). */ #define CURL_MAX_WRITE_SIZE 16384 #endif @@ -350,13 +354,13 @@ typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, download of an individual chunk finished. Note! After this callback was set then it have to be called FOR ALL chunks. Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. - This is the reason why we don't need "transfer_info" parameter in this + This is the reason why we do not need "transfer_info" parameter in this callback and we are not interested in "remains" parameter too. */ typedef long (*curl_chunk_end_callback)(void *ptr); /* return codes for FNMATCHFUNCTION */ #define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ -#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ +#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern does not match the string */ #define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ /* callback type for wildcard downloading pattern matching. If the @@ -368,7 +372,7 @@ typedef int (*curl_fnmatch_callback)(void *ptr, /* These are the return codes for the seek callbacks */ #define CURL_SEEKFUNC_OK 0 #define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ -#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so +#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so libcurl might try other means instead */ typedef int (*curl_seek_callback)(void *instream, curl_off_t offset, @@ -451,7 +455,7 @@ typedef curlioerr (*curl_ioctl_callback)(CURL *handle, #ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS /* * The following typedef's are signatures of malloc, free, realloc, strdup and - * calloc respectively. Function pointers of these types can be passed to the + * calloc respectively. Function pointers of these types can be passed to the * curl_global_init_mem() function to set user defined memory management * callback routines. */ @@ -539,17 +543,17 @@ typedef enum { CURLE_WRITE_ERROR, /* 23 */ CURLE_OBSOLETE24, /* 24 - NOT USED */ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ - CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ + CURLE_READ_ERROR, /* 26 - could not open/read from file */ CURLE_OUT_OF_MEMORY, /* 27 */ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ CURLE_OBSOLETE29, /* 29 - NOT USED */ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ CURLE_OBSOLETE32, /* 32 - NOT USED */ - CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ + CURLE_RANGE_ERROR, /* 33 - RANGE "command" did not work */ CURLE_HTTP_POST_ERROR, /* 34 */ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ - CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ + CURLE_BAD_DOWNLOAD_RESUME, /* 36 - could not resume download */ CURLE_FILE_COULDNT_READ_FILE, /* 37 */ CURLE_LDAP_CANNOT_BIND, /* 38 */ CURLE_LDAP_SEARCH_FAILED, /* 39 */ @@ -573,9 +577,9 @@ typedef enum { CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ CURLE_OBSOLETE57, /* 57 - NOT IN USE */ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ - CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ + CURLE_SSL_CIPHER, /* 59 - could not use specified cipher */ CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint - wasn't verified fine */ + was not verified fine */ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ @@ -604,7 +608,7 @@ typedef enum { CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL connection */ CURLE_AGAIN, /* 81 - socket is not ready for send/recv, - wait till it's ready and try again (Added + wait till it is ready and try again (Added in 7.18.2) */ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or wrong format (Added in 7.19.0) */ @@ -632,6 +636,7 @@ typedef enum { CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */ CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */ CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */ + CURLE_ECH_REQUIRED, /* 101 - ECH tried but failed */ CURL_LAST /* never use! */ } CURLcode; @@ -712,6 +717,8 @@ typedef enum { with them. */ #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40 #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72 +#define CURLOPT_OBSOLETE72 9999 +#define CURLOPT_OBSOLETE40 9999 #endif /* !CURL_NO_OLDIES */ @@ -762,7 +769,7 @@ typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ void *ssl_ctx, /* actually an OpenSSL - or WolfSSL SSL_CTX, + or wolfSSL SSL_CTX, or an mbedTLS mbedtls_ssl_config */ void *userptr); @@ -779,7 +786,7 @@ typedef enum { CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the - host name rather than the IP address. added + hostname rather than the IP address. added in 7.18.0 */ } curl_proxytype; /* this enum was added in 7.10 */ @@ -811,7 +818,10 @@ typedef enum { #define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE #define CURLAUTH_NTLM (((unsigned long)1)<<3) #define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) +#ifndef CURL_NO_OLDIES + /* functionality removed since 8.8.0 */ #define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) +#endif #define CURLAUTH_BEARER (((unsigned long)1)<<6) #define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7) #define CURLAUTH_ONLY (((unsigned long)1)<<31) @@ -856,7 +866,7 @@ enum curl_khstat { CURLKHSTAT_FINE_ADD_TO_FILE, CURLKHSTAT_FINE, CURLKHSTAT_REJECT, /* reject the connection, return an error */ - CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now. + CURLKHSTAT_DEFER, /* do not accept it, but we cannot answer right now. Causes a CURLE_PEER_FAILED_VERIFICATION error but the connection will be left intact etc */ CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */ @@ -928,6 +938,9 @@ typedef enum { a client certificate for authentication. (Schannel) */ #define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5) +/* If possible, send data using TLS 1.3 early data */ +#define CURLSSLOPT_EARLYDATA (1<<6) + /* The default connection attempt delay in milliseconds for happy eyeballs. CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document this value, keep them in sync. */ @@ -1076,7 +1089,7 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy, #define CURLOPT(na,t,nu) na = t + nu #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu -/* CURLOPT aliases that make no run-time difference */ +/* CURLOPT aliases that make no runtime difference */ /* 'char *' argument to a string with a trailing zero */ #define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT @@ -1143,7 +1156,7 @@ typedef enum { * * For large file support, there is also a _LARGE version of the key * which takes an off_t type, allowing platforms with larger off_t - * sizes to handle larger files. See below for INFILESIZE_LARGE. + * sizes to handle larger files. See below for INFILESIZE_LARGE. */ CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14), @@ -1176,7 +1189,7 @@ typedef enum { * * Note there is also a _LARGE version of this key which uses * off_t types, allowing for large file offsets on platforms which - * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. + * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. */ CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21), @@ -1238,8 +1251,7 @@ typedef enum { /* send linked-list of post-transfer QUOTE commands */ CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39), - /* OBSOLETE, do not use! */ - CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40), + /* 40 is not used */ /* talk a lot */ CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41), @@ -1312,9 +1324,9 @@ typedef enum { /* Set the interface string to use as outgoing network interface */ CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62), - /* Set the krb4/5 security level, this also enables krb4/5 awareness. This - * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string - * is set but doesn't match one of these, 'private' will be used. */ + /* Set the krb4/5 security level, this also enables krb4/5 awareness. This + * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string + * is set but does not match one of these, 'private' will be used. */ CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63), /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ @@ -1340,22 +1352,20 @@ typedef enum { /* Max amount of cached alive connections */ CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71), - /* OBSOLETE, do not use! */ - CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72), - + /* 72 = OBSOLETE */ /* 73 = OBSOLETE */ /* Set to explicitly use a new connection for the upcoming transfer. - Do not use this unless you're absolutely sure of this, as it makes the + Do not use this unless you are absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74), /* Set to explicitly forbid the upcoming transfer's connection to be reused - when done. Do not use this unless you're absolutely sure of this, as it + when done. Do not use this unless you are absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75), - /* Set to a file name that contains random data for libcurl to use to + /* Set to a filename that contains random data for libcurl to use to seed the random engine when doing SSL connects. */ CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76, 7.84.0, "Serves no purpose anymore"), @@ -1382,11 +1392,11 @@ typedef enum { * provided hostname. */ CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81), - /* Specify which file name to write all known cookies in after completed - operation. Set file name to "-" (dash) to make it go to stdout. */ + /* Specify which filename to write all known cookies in after completed + operation. Set filename to "-" (dash) to make it go to stdout. */ CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82), - /* Specify which SSL ciphers to use */ + /* Specify which TLS 1.2 (1.1, 1.0) ciphers to use */ CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83), /* Specify which HTTP version to use! This must be set to one of the @@ -1482,7 +1492,7 @@ typedef enum { CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107), /* Set the ssl context callback function, currently only for OpenSSL or - WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument. + wolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument. The function must match the curl_ssl_ctx_callback prototype. */ CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108), @@ -1502,7 +1512,7 @@ typedef enum { CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111), /* Option that changes the timeout, in seconds, associated with getting a - response. This is different from transfer timeout time and essentially + response. This is different from transfer timeout time and essentially places a demand on the server to acknowledge commands in a timely manner. For FTP, SMTP, IMAP and POP3. */ CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112), @@ -1516,7 +1526,7 @@ typedef enum { an HTTP or FTP server. Note there is also _LARGE version which adds large file support for - platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ + platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114), /* See the comment for INFILESIZE above, but in short, specifies @@ -1524,17 +1534,17 @@ typedef enum { */ CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115), - /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version + /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version * of this; look above for RESUME_FROM. */ CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116), /* Sets the maximum size of data that will be downloaded from - * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. + * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. */ CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117), - /* Set this option to the file name of your .netrc file you want libcurl + /* Set this option to the filename of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there. */ @@ -1681,7 +1691,7 @@ typedef enum { /* Callback function for opening socket (instead of socket(2)). Optionally, callback is able change the address or refuse to connect returning - CURL_SOCKET_BAD. The callback should have type + CURL_SOCKET_BAD. The callback should have type curl_opensocket_callback */ CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163), CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164), @@ -1751,7 +1761,7 @@ typedef enum { CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182, 7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"), - /* set the SSH knownhost file name to use */ + /* set the SSH knownhost filename to use */ CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183), /* set the SSH host key callback, must point to a curl_sshkeycallback @@ -1832,7 +1842,7 @@ typedef enum { future libcurl release. libcurl will ask for the compressed methods it knows of, and if that - isn't any, it will not ask for transfer-encoding at all even if this + is not any, it will not ask for transfer-encoding at all even if this option is set to 1. */ @@ -1934,7 +1944,7 @@ typedef enum { /* Service Name */ CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236), - /* Wait/don't wait for pipe/mutex to clarify */ + /* Wait/do not wait for pipe/mutex to clarify */ CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237), /* Set the protocol used when curl is given a URL without a protocol */ @@ -2010,7 +2020,7 @@ typedef enum { /* password for the SSL private key for proxy */ CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258), - /* Specify which SSL ciphers to use for proxy */ + /* Specify which TLS 1.2 (1.1, 1.0) ciphers to use for proxy */ CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259), /* CRL file for proxy */ @@ -2095,7 +2105,7 @@ typedef enum { /* alt-svc control bitmask */ CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286), - /* alt-svc cache file name to possibly read from/write to */ + /* alt-svc cache filename to possibly read from/write to */ CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287), /* maximum age (idle time) of a connection to consider it for reuse @@ -2121,13 +2131,13 @@ typedef enum { /* the EC curves requested by the TLS client (RFC 8422, 5.1); * OpenSSL support via 'set_groups'/'set_curves': - * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html + * https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/ */ CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298), /* HSTS bitmask */ CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299), - /* HSTS file name */ + /* HSTS filename */ CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300), /* HSTS read callback */ @@ -2191,7 +2201,7 @@ typedef enum { /* specify which protocols that libcurl is allowed to follow directs to */ CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319), - /* websockets options */ + /* WebSockets options */ CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320), /* CA cache timeout */ @@ -2206,6 +2216,12 @@ typedef enum { /* millisecond version */ CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324), + /* set ECH configuration */ + CURLOPT(CURLOPT_ECH, CURLOPTTYPE_STRINGPOINT, 325), + + /* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */ + CURLOPT(CURLOPT_TCP_KEEPCNT, CURLOPTTYPE_LONG, 326), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; @@ -2256,9 +2272,9 @@ typedef enum { /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ enum { - CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd - like the library to choose the best possible - for us! */ + CURL_HTTP_VERSION_NONE, /* setting this means we do not care, and that we + would like the library to choose the best + possible for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */ @@ -2311,30 +2327,26 @@ enum CURL_NETRC_OPTION { CURL_NETRC_LAST }; -enum { - CURL_SSLVERSION_DEFAULT, - CURL_SSLVERSION_TLSv1, /* TLS 1.x */ - CURL_SSLVERSION_SSLv2, - CURL_SSLVERSION_SSLv3, - CURL_SSLVERSION_TLSv1_0, - CURL_SSLVERSION_TLSv1_1, - CURL_SSLVERSION_TLSv1_2, - CURL_SSLVERSION_TLSv1_3, +#define CURL_SSLVERSION_DEFAULT 0 +#define CURL_SSLVERSION_TLSv1 1 /* TLS 1.x */ +#define CURL_SSLVERSION_SSLv2 2 +#define CURL_SSLVERSION_SSLv3 3 +#define CURL_SSLVERSION_TLSv1_0 4 +#define CURL_SSLVERSION_TLSv1_1 5 +#define CURL_SSLVERSION_TLSv1_2 6 +#define CURL_SSLVERSION_TLSv1_3 7 - CURL_SSLVERSION_LAST /* never use, keep last */ -}; +#define CURL_SSLVERSION_LAST 8 /* never use, keep last */ -enum { - CURL_SSLVERSION_MAX_NONE = 0, - CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16), - CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16), - CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16), - CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16), - CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16), +#define CURL_SSLVERSION_MAX_NONE 0 +#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1 << 16) +#define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16) +#define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16) +#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 */ - CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16) -}; +#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16) enum CURL_TLSAUTH { CURL_TLSAUTH_NONE, @@ -2422,7 +2434,7 @@ CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name); * * DESCRIPTION * - * Set mime part remote file name. + * Set mime part remote filename. */ CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part, const char *filename); @@ -2631,7 +2643,7 @@ CURL_EXTERN char *curl_getenv(const char *variable); * * DESCRIPTION * - * Returns a static ascii string of the libcurl version. + * Returns a static ASCII string of the libcurl version. */ CURL_EXTERN char *curl_version(void); @@ -2703,10 +2715,10 @@ CURL_EXTERN CURLcode curl_global_init(long flags); * DESCRIPTION * * curl_global_init() or curl_global_init_mem() should be invoked exactly once - * for each application that uses libcurl. This function can be used to + * for each application that uses libcurl. This function can be used to * initialize libcurl and set user defined memory management callback - * functions. Users can implement memory management routines to check for - * memory leaks, check for mis-use of the curl library etc. User registered + * functions. Users can implement memory management routines to check for + * memory leaks, check for mis-use of the curl library etc. User registered * callback routines will be invoked by this library instead of the system * memory management routines like malloc, free etc. */ @@ -2824,7 +2836,7 @@ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ struct curl_certinfo { int num_of_certs; /* number of certificates with information */ - struct curl_slist **certinfo; /* for each index in this array, there's a + struct curl_slist **certinfo; /* for each index in this array, there is a linked list with textual information for a certificate in the format "name:content". eg "Subject:foo", "Issuer:bar", etc. */ @@ -2939,7 +2951,9 @@ typedef enum { CURLINFO_CONN_ID = CURLINFO_OFF_T + 64, CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65, CURLINFO_USED_PROXY = CURLINFO_LONG + 66, - CURLINFO_LASTONE = 66 + CURLINFO_POSTTRANSFER_TIME_T = CURLINFO_OFF_T + 67, + CURLINFO_EARLYDATA_SENT_T = CURLINFO_OFF_T + 68, + CURLINFO_LASTONE = 68 } CURLINFO; /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as @@ -3015,7 +3029,7 @@ typedef enum { } CURLSHcode; typedef enum { - CURLSHOPT_NONE, /* don't use */ + CURLSHOPT_NONE, /* do not use */ CURLSHOPT_SHARE, /* specify a data type to share */ CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ @@ -3035,17 +3049,18 @@ CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share); */ typedef enum { - CURLVERSION_FIRST, - CURLVERSION_SECOND, - CURLVERSION_THIRD, - CURLVERSION_FOURTH, - CURLVERSION_FIFTH, - CURLVERSION_SIXTH, - CURLVERSION_SEVENTH, - CURLVERSION_EIGHTH, - CURLVERSION_NINTH, - CURLVERSION_TENTH, - CURLVERSION_ELEVENTH, + CURLVERSION_FIRST, /* 7.10 */ + CURLVERSION_SECOND, /* 7.11.1 */ + CURLVERSION_THIRD, /* 7.12.0 */ + CURLVERSION_FOURTH, /* 7.16.1 */ + CURLVERSION_FIFTH, /* 7.57.0 */ + CURLVERSION_SIXTH, /* 7.66.0 */ + CURLVERSION_SEVENTH, /* 7.70.0 */ + CURLVERSION_EIGHTH, /* 7.72.0 */ + CURLVERSION_NINTH, /* 7.75.0 */ + CURLVERSION_TENTH, /* 7.77.0 */ + CURLVERSION_ELEVENTH, /* 7.87.0 */ + CURLVERSION_TWELFTH, /* 8.8.0 */ CURLVERSION_LAST /* never actually use this */ } CURLversion; @@ -3054,7 +3069,7 @@ typedef enum { meant to be a built-in version number for what kind of struct the caller expects. If the struct ever changes, we redefine the NOW to another enum from above. */ -#define CURLVERSION_NOW CURLVERSION_ELEVENTH +#define CURLVERSION_NOW CURLVERSION_TWELFTH struct curl_version_info_data { CURLversion age; /* age of the returned struct */ @@ -3114,6 +3129,9 @@ struct curl_version_info_data { /* These fields were added in CURLVERSION_ELEVENTH */ /* feature_names is terminated by an entry with a NULL feature name */ const char * const *feature_names; + + /* These fields were added in CURLVERSION_TWELFTH */ + const char *rtmp_version; /* human readable string. */ }; typedef struct curl_version_info_data curl_version_info_data; @@ -3154,7 +3172,7 @@ typedef struct curl_version_info_data curl_version_info_data; #define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */ #define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */ - /* +/* * NAME curl_version_info() * * DESCRIPTION @@ -3170,7 +3188,7 @@ CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); * DESCRIPTION * * The curl_easy_strerror function may be used to turn a CURLcode value - * into the equivalent human readable error string. This is useful + * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ CURL_EXTERN const char *curl_easy_strerror(CURLcode); @@ -3181,7 +3199,7 @@ CURL_EXTERN const char *curl_easy_strerror(CURLcode); * DESCRIPTION * * The curl_share_strerror function may be used to turn a CURLSHcode value - * into the equivalent human readable error string. This is useful + * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ CURL_EXTERN const char *curl_share_strerror(CURLSHcode); @@ -3218,9 +3236,11 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); #include "options.h" #include "header.h" #include "websockets.h" +#ifndef CURL_SKIP_INCLUDE_MPRINTF #include "mprintf.h" +#endif -/* the typechecker doesn't work in C++ (yet) */ +/* the typechecker does not work in C++ (yet) */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) diff --git a/deps/curl/include/curl/curlver.h b/deps/curl/include/curl/curlver.h index 52009e54..e863815d 100644 --- a/deps/curl/include/curl/curlver.h +++ b/deps/curl/include/curl/curlver.h @@ -32,12 +32,12 @@ /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "8.7.0-DEV" +#define LIBCURL_VERSION "8.11.0-DEV" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 8 -#define LIBCURL_VERSION_MINOR 7 +#define LIBCURL_VERSION_MINOR 11 #define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier @@ -48,7 +48,7 @@ Where XX, YY and ZZ are the main version, release and patch numbers in hexadecimal (using 8 bits each). All three numbers are always represented - using two digits. 1.2 would appear as "0x010200" while version 9.11.7 + using two digits. 1.2 would appear as "0x010200" while version 9.11.7 appears as "0x090b07". This 6-digit (24 bits) hexadecimal number does not show pre-release number, @@ -59,7 +59,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 0x080700 +#define LIBCURL_VERSION_NUM 0x080b00 /* * This is the date and time when the full source package was created. The diff --git a/deps/curl/include/curl/easy.h b/deps/curl/include/curl/easy.h index 1285101c..71b8dd46 100644 --- a/deps/curl/include/curl/easy.h +++ b/deps/curl/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 man page of the option. The data pointed to + * which is documented in each manpage 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/deps/curl/include/curl/mprintf.h b/deps/curl/include/curl/mprintf.h index 4f704548..88059c85 100644 --- a/deps/curl/include/curl/mprintf.h +++ b/deps/curl/include/curl/mprintf.h @@ -32,12 +32,18 @@ extern "C" { #endif -#if (defined(__GNUC__) || defined(__clang__)) && \ +#ifndef CURL_TEMP_PRINTF +#if (defined(__GNUC__) || defined(__clang__) || \ + defined(__IAR_SYSTEMS_ICC__)) && \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ !defined(CURL_NO_FMT_CHECKS) #if defined(__MINGW32__) && !defined(__clang__) +#if defined(__MINGW_PRINTF_FORMAT) /* mingw-w64 3.0.0+. Needs stdio.h. */ #define CURL_TEMP_PRINTF(fmt, arg) \ - __attribute__((format(gnu_printf, fmt, arg))) + __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, arg))) +#else +#define CURL_TEMP_PRINTF(fmt, arg) +#endif #else #define CURL_TEMP_PRINTF(fmt, arg) \ __attribute__((format(printf, fmt, arg))) @@ -45,6 +51,7 @@ extern "C" { #else #define CURL_TEMP_PRINTF(fmt, arg) #endif +#endif CURL_EXTERN int curl_mprintf(const char *format, ...) CURL_TEMP_PRINTF(1, 2); diff --git a/deps/curl/include/curl/multi.h b/deps/curl/include/curl/multi.h index e79b48ff..42469bb5 100644 --- a/deps/curl/include/curl/multi.h +++ b/deps/curl/include/curl/multi.h @@ -24,7 +24,7 @@ * ***************************************************************************/ /* - This is an "external" header file. Don't give away any internals here! + This is an "external" header file. Do not give away any internals here! GOALS @@ -54,11 +54,7 @@ extern "C" { #endif -#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) -typedef struct Curl_multi CURLM; -#else typedef void CURLM; -#endif typedef enum { CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or @@ -66,7 +62,7 @@ typedef enum { CURLM_OK, CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ - CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ + CURLM_OUT_OF_MEMORY, /* if you ever get this, you are in deep sh*t */ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ @@ -109,7 +105,7 @@ struct CURLMsg { typedef struct CURLMsg CURLMsg; /* Based on poll(2) structure and values. - * We don't use pollfd and POLL* constants explicitly + * We do not use pollfd and POLL* constants explicitly * to cover platforms without poll(). */ #define CURL_WAIT_POLLIN 0x0001 #define CURL_WAIT_POLLPRI 0x0002 @@ -205,7 +201,7 @@ CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle); /* * Name: curl_multi_perform() * - * Desc: When the app thinks there's data available for curl it calls this + * 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 @@ -236,7 +232,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); /* * Name: curl_multi_info_read() * - * Desc: Ask the multi handle if there's any messages/informationals from + * Desc: Ask the multi handle if there is any messages/informationals from * the individual transfers. Messages include informationals such as * error code from the transfer or just the fact that a transfer is * completed. More details on these should be written down as well. @@ -248,13 +244,13 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); * The data the returned pointer points to will not survive calling * curl_multi_cleanup(). * - * The 'CURLMsg' struct is meant to be very simple and only contain - * very basic information. If more involved information is wanted, - * we will provide the particular "transfer handle" in that struct - * and that should/could/would be used in subsequent - * curl_easy_getinfo() calls (or similar). The point being that we - * must never expose complex structs to applications, as then we'll - * undoubtably get backwards compatibility problems in the future. + * The 'CURLMsg' struct is meant to be simple and only contain basic + * information. If more involved information is wanted, we will + * provide the particular "transfer handle" in that struct and that + * should/could/would be used in subsequent curl_easy_getinfo() calls + * (or similar). The point being that we must never expose complex + * structs to applications, as then we will undoubtably get backwards + * compatibility problems in the future. * * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out * of structs. It also writes the number of messages left in the @@ -268,7 +264,7 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, * Name: curl_multi_strerror() * * Desc: The curl_multi_strerror function may be used to turn a CURLMcode - * value into the equivalent human readable error string. This is + * value into the equivalent human readable error string. This is * useful for printing meaningful error messages. * * Returns: A pointer to a null-terminated error message. @@ -282,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 man page for details. + * See manpage for details. */ #define CURL_POLL_NONE 0 #define CURL_POLL_IN 1 @@ -464,6 +460,20 @@ typedef int (*curl_push_callback)(CURL *parent, struct curl_pushheaders *headers, void *userp); +/* + * Name: curl_multi_waitfds() + * + * Desc: Ask curl for fds for polling. The app can use these to poll on. + * We want curl_multi_perform() called as soon as one of them are + * ready. Passing zero size allows to get just a number of fds. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_waitfds(CURLM *multi, + struct curl_waitfd *ufds, + unsigned int size, + unsigned int *fd_count); + #ifdef __cplusplus } /* end of extern "C" */ #endif diff --git a/deps/curl/include/curl/system.h b/deps/curl/include/curl/system.h index 81a1b817..e5be2568 100644 --- a/deps/curl/include/curl/system.h +++ b/deps/curl/include/curl/system.h @@ -31,7 +31,7 @@ * changed. * * In order to differentiate between platforms/compilers/architectures use - * only compiler built in predefined preprocessor symbols. + * only compiler built-in predefined preprocessor symbols. * * curl_off_t * ---------- @@ -46,7 +46,7 @@ * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall * only be violated if off_t is the only 64-bit data type available and the * size of off_t is independent of large file support settings. Keep your - * build on the safe side avoiding an off_t gating. If you have a 64-bit + * build on the safe side avoiding an off_t gating. If you have a 64-bit * off_t then take for sure that another 64-bit data type exists, dig deeper * and you will find it. * @@ -402,7 +402,7 @@ # define CURL_PULL_SYS_SOCKET_H 1 #else -/* generic "safe guess" on old 32 bit style */ +/* generic "safe guess" on old 32-bit style */ # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" diff --git a/deps/curl/include/curl/typecheck-gcc.h b/deps/curl/include/curl/typecheck-gcc.h index b880f3dc..e532e699 100644 --- a/deps/curl/include/curl/typecheck-gcc.h +++ b/deps/curl/include/curl/typecheck-gcc.h @@ -34,11 +34,11 @@ * _curl_easy_setopt_err_sometype below * * NOTE: We use two nested 'if' statements here instead of the && operator, in - * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x + * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x * when compiling with -Wlogical-op. * - * To add an option that uses the same type as an existing option, you'll just - * need to extend the appropriate _curl_*_option macro + * To add an option that uses the same type as an existing option, you will + * just need to extend the appropriate _curl_*_option macro */ #define curl_easy_setopt(handle, option, value) \ __extension__({ \ @@ -245,7 +245,7 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t, /* To add a new option to one of the groups, just add * (option) == CURLOPT_SOMETHING - * to the or-expression. If the option takes a long or curl_off_t, you don't + * to the or-expression. If the option takes a long or curl_off_t, you do not * have to do anything */ @@ -275,6 +275,7 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t, (option) == CURLOPT_DNS_LOCAL_IP6 || \ (option) == CURLOPT_DNS_SERVERS || \ (option) == CURLOPT_DOH_URL || \ + (option) == CURLOPT_ECH || \ (option) == CURLOPT_EGDSOCKET || \ (option) == CURLOPT_FTP_ACCOUNT || \ (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ @@ -677,7 +678,7 @@ typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); #ifdef HEADER_SSL_H /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX - * this will of course break if we're included before OpenSSL headers... + * this will of course break if we are included before OpenSSL headers... */ typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *); typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *); diff --git a/deps/curl/include/curl/urlapi.h b/deps/curl/include/curl/urlapi.h index 91f8c454..b4a6e5d5 100644 --- a/deps/curl/include/curl/urlapi.h +++ b/deps/curl/include/curl/urlapi.h @@ -97,8 +97,12 @@ typedef enum { #define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the scheme is unknown. */ #define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */ -#define CURLU_PUNYCODE (1<<12) /* get the host name in punycode */ +#define CURLU_PUNYCODE (1<<12) /* get the hostname in punycode */ #define CURLU_PUNY2IDN (1<<13) /* punycode => IDN conversion */ +#define CURLU_GET_EMPTY (1<<14) /* allow empty queries and fragments + when extracting the URL or the + components */ +#define CURLU_NO_GUESS_SCHEME (1<<15) /* for get, do not accept a guess */ typedef struct Curl_URL CURLU; @@ -139,7 +143,7 @@ CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what, /* * curl_url_strerror() turns a CURLUcode value into the equivalent human - * readable error string. This is useful for printing meaningful error + * readable error string. This is useful for printing meaningful error * messages. */ CURL_EXTERN const char *curl_url_strerror(CURLUcode); diff --git a/deps/curl/lib/.checksrc b/deps/curl/lib/.checksrc index 16133a44..9066946c 100644 --- a/deps/curl/lib/.checksrc +++ b/deps/curl/lib/.checksrc @@ -1 +1,2 @@ enable STRERROR +enable STRNCPY diff --git a/deps/curl/lib/.gitignore b/deps/curl/lib/.gitignore index 7528196e..813b9941 100644 --- a/deps/curl/lib/.gitignore +++ b/deps/curl/lib/.gitignore @@ -11,7 +11,5 @@ TAGS curl_config.h curl_config.h.in -libcurl.plist.dist -libcurl.plist libcurl.vers stamp-h1 diff --git a/deps/curl/lib/CMakeLists.txt b/deps/curl/lib/CMakeLists.txt index 51d52578..895bc916 100644 --- a/deps/curl/lib/CMakeLists.txt +++ b/deps/curl/lib/CMakeLists.txt @@ -21,73 +21,46 @@ # SPDX-License-Identifier: curl # ########################################################################### -set(LIB_NAME libcurl) -set(LIBCURL_OUTPUT_NAME libcurl CACHE STRING "Basename of the curl library") -add_definitions(-DBUILDING_LIBCURL) +set(LIB_NAME "libcurl") +set(LIBCURL_OUTPUT_NAME "libcurl" CACHE STRING "Basename of the curl library") +add_definitions("-DBUILDING_LIBCURL") -configure_file(curl_config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/curl_config.h) +configure_file("curl_config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/curl_config.h") +# Get 'CSOURCES', 'HHEADERS' variables transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) +include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -list(APPEND HHEADERS - ${CMAKE_CURRENT_BINARY_DIR}/curl_config.h - ) +# DllMain is added later for DLL builds only. +list(REMOVE_ITEM CSOURCES "dllmain.c") + +list(APPEND HHEADERS "${CMAKE_CURRENT_BINARY_DIR}/curl_config.h") # The rest of the build -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +include_directories( + "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" + "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" +) if(USE_ARES) - include_directories(${CARES_INCLUDE_DIR}) + include_directories(SYSTEM ${CARES_INCLUDE_DIRS}) endif() -if(BUILD_TESTING) +if(CURL_BUILD_TESTING) add_library( - curlu # special libcurlu library just for unittests + curlu # special libcurlu library just for unittests STATIC EXCLUDE_FROM_ALL ${HHEADERS} ${CSOURCES} ) - target_compile_definitions(curlu PUBLIC UNITTESTS CURL_STATICLIB) + target_compile_definitions(curlu PUBLIC "UNITTESTS" "CURL_STATICLIB") + target_link_libraries(curlu PRIVATE ${CURL_LIBS}) endif() if(ENABLE_CURLDEBUG) # We must compile these sources separately to avoid memdebug.h redefinitions # applying to them. - set_source_files_properties(memdebug.c curl_multibyte.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) -endif() - -if(BUILD_TESTING) - target_link_libraries(curlu PRIVATE ${CURL_LIBS}) -endif() - -transform_makefile_inc("Makefile.soname" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake") -include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake) - -if(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR - CMAKE_SYSTEM_NAME STREQUAL "Linux" OR - CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR - CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR - CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR - - # FreeBSD comes with the a.out and elf flavours - # but a.out was supported up to version 3.x and - # elf from 3.x. I cannot imagine someone running - # CMake on those ancient systems - CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR - - CMAKE_SYSTEM_NAME STREQUAL "Haiku") - - math(EXPR CMAKESONAME "${VERSIONCHANGE} - ${VERSIONDEL}") - set(CMAKEVERSION "${CMAKESONAME}.${VERSIONDEL}.${VERSIONADD}") -else() - unset(CMAKESONAME) + set_source_files_properties("memdebug.c" "curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) endif() ## Library definition @@ -114,21 +87,20 @@ if(NOT DEFINED SHARE_LIB_OBJECT) endif() endif() -if(WIN32) - # Define CURL_STATICLIB always, to disable __declspec(dllexport) for exported - # libcurl symbols. We handle exports via libcurl.def instead. Except with - # symbol hiding disabled or debug mode enabled, when we export _all_ symbols - # from libcurl DLL, without using libcurl.def. - add_definitions("-DCURL_STATICLIB") -endif() - if(SHARE_LIB_OBJECT) set(LIB_OBJECT "libcurl_object") add_library(${LIB_OBJECT} OBJECT ${HHEADERS} ${CSOURCES}) + if(WIN32) + # Define CURL_STATICLIB always, to disable __declspec(dllexport) for + # exported libcurl symbols. We handle exports via libcurl.def instead. + # Except with symbol hiding disabled or debug mode enabled, when we export + # _all_ symbols from libcurl DLL, without using libcurl.def. + set_property(TARGET ${LIB_OBJECT} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() target_link_libraries(${LIB_OBJECT} PRIVATE ${CURL_LIBS}) set_target_properties(${LIB_OBJECT} PROPERTIES POSITION_INDEPENDENT_CODE ON) - if(HIDES_CURL_PRIVATE_SYMBOLS) + if(CURL_HIDES_PRIVATE_SYMBOLS) set_property(TARGET ${LIB_OBJECT} APPEND PROPERTY COMPILE_FLAGS "${CURL_CFLAG_SYMBOLS_HIDE}") set_property(TARGET ${LIB_OBJECT} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS") endif() @@ -139,26 +111,29 @@ if(SHARE_LIB_OBJECT) endif() target_include_directories(${LIB_OBJECT} INTERFACE - $ - $) + "$" + "$") set(LIB_SOURCE $) else() set(LIB_SOURCE ${HHEADERS} ${CSOURCES}) endif() -# we want it to be called libcurl on all platforms +# We want it to be called libcurl on all platforms if(BUILD_STATIC_LIBS) list(APPEND libcurl_export ${LIB_STATIC}) add_library(${LIB_STATIC} STATIC ${LIB_SOURCE}) add_library(${PROJECT_NAME}::${LIB_STATIC} ALIAS ${LIB_STATIC}) + if(WIN32) + set_property(TARGET ${LIB_OBJECT} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() target_link_libraries(${LIB_STATIC} PRIVATE ${CURL_LIBS}) # Remove the "lib" prefix since the library is already named "libcurl". 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") - if(HIDES_CURL_PRIVATE_SYMBOLS) + if(CURL_HIDES_PRIVATE_SYMBOLS) set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_FLAGS "${CURL_CFLAG_SYMBOLS_HIDE}") set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS") endif() @@ -167,24 +142,28 @@ if(BUILD_STATIC_LIBS) INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) endif() - if(CMAKEVERSION AND CMAKESONAME) - set_target_properties(${LIB_STATIC} PROPERTIES - VERSION ${CMAKEVERSION} SOVERSION ${CMAKESONAME}) - endif() target_include_directories(${LIB_STATIC} INTERFACE - $ - $) + "$" + "$") endif() if(BUILD_SHARED_LIBS) list(APPEND libcurl_export ${LIB_SHARED}) add_library(${LIB_SHARED} SHARED ${LIB_SOURCE}) add_library(${PROJECT_NAME}::${LIB_SHARED} ALIAS ${LIB_SHARED}) + if(WIN32 OR CYGWIN) + if(CYGWIN) + # For Cygwin always compile dllmain.c as a separate unit since it + # includes windows.h, which should not be included in other units. + set_source_files_properties("dllmain.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + endif() + set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "dllmain.c") + endif() if(WIN32) - set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES libcurl.rc) - if(HIDES_CURL_PRIVATE_SYMBOLS) - set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "${CURL_SOURCE_DIR}/libcurl.def") + set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "libcurl.rc") + if(CURL_HIDES_PRIVATE_SYMBOLS) + set_property(TARGET ${LIB_SHARED} APPEND PROPERTY SOURCES "${PROJECT_SOURCE_DIR}/lib/libcurl.def") endif() endif() target_link_libraries(${LIB_SHARED} PRIVATE ${CURL_LIBS}) @@ -193,7 +172,7 @@ if(BUILD_SHARED_LIBS) PREFIX "" OUTPUT_NAME "${LIBCURL_OUTPUT_NAME}" IMPORT_PREFIX "" IMPORT_SUFFIX "${IMPORT_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX}" POSITION_INDEPENDENT_CODE ON) - if(HIDES_CURL_PRIVATE_SYMBOLS) + if(CURL_HIDES_PRIVATE_SYMBOLS) set_property(TARGET ${LIB_SHARED} APPEND PROPERTY COMPILE_FLAGS "${CURL_CFLAG_SYMBOLS_HIDE}") set_property(TARGET ${LIB_SHARED} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS") endif() @@ -202,14 +181,87 @@ if(BUILD_SHARED_LIBS) INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) endif() - if(CMAKEVERSION AND CMAKESONAME) - set_target_properties(${LIB_SHARED} PROPERTIES - VERSION ${CMAKEVERSION} SOVERSION ${CMAKESONAME}) - endif() target_include_directories(${LIB_SHARED} INTERFACE - $ - $) + "$" + "$") + + if(CMAKE_DLL_NAME_WITH_SOVERSION OR + CYGWIN OR + APPLE OR + CMAKE_SYSTEM_NAME STREQUAL "AIX" OR + CMAKE_SYSTEM_NAME STREQUAL "Linux" OR + CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR + CMAKE_SYSTEM_NAME STREQUAL "Haiku" OR + CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR + # FreeBSD comes with the a.out and ELF flavours but a.out was supported + # up to v3.x and ELF from v3.x. I cannot imagine someone running CMake + # on those ancient systems. + CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(_soversion_default TRUE) + else() + set(_soversion_default FALSE) + endif() + + option(CURL_LIBCURL_SOVERSION "Enable libcurl SOVERSION" ${_soversion_default}) + option(CURL_LIBCURL_VERSIONED_SYMBOLS "Enable libcurl versioned symbols" OFF) + + if(CURL_LIBCURL_SOVERSION OR CURL_LIBCURL_VERSIONED_SYMBOLS) + # Get 'VERSIONCHANGE', 'VERSIONADD', 'VERSIONDEL', 'VERSIONINFO' variables + transform_makefile_inc("Makefile.soname" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake") + include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake") + + math(EXPR _cmakesoname "${VERSIONCHANGE} - ${VERSIONDEL}") + set(_cmakeversion "${_cmakesoname}.${VERSIONDEL}.${VERSIONADD}") + endif() + + if(CURL_LIBCURL_SOVERSION) + set_target_properties(${LIB_SHARED} PROPERTIES + VERSION "${_cmakeversion}" SOVERSION "${_cmakesoname}") + endif() + + ## Versioned symbols + + if(CURL_LIBCURL_VERSIONED_SYMBOLS) + if(NOT DEFINED CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX) + # Default to prefixes used by autotools + if(CURL_WITH_MULTI_SSL) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "MULTISSL_") + elseif(CURL_USE_OPENSSL) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "OPENSSL_") + elseif(CURL_USE_MBEDTLS) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "MBEDTLS_") + elseif(CURL_USE_BEARSSL) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "BEARSSL_") + elseif(CURL_USE_WOLFSSL) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "WOLFSSL_") + elseif(CURL_USE_GNUTLS) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "GNUTLS_") + elseif(CURL_USE_RUSTLS) + set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "RUSTLS_") + endif() + endif() + # Generate version script for the linker, for versioned symbols. + # Consumed variables: + # CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX + # CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME + set(CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME ${_cmakesoname}) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/libcurl.vers.in" + "${CMAKE_CURRENT_BINARY_DIR}/libcurl.vers" @ONLY) + include(CMakePushCheckState) + include(CheckCSourceCompiles) + cmake_push_check_state() + set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/libcurl.vers") + check_c_source_compiles("int main(void) { return 0; }" HAVE_VERSIONED_SYMBOLS) + if(HAVE_VERSIONED_SYMBOLS) + # Superseded by LINK_OPTIONS in CMake 3.13 and later. + set_target_properties(${LIB_SHARED} PROPERTIES LINK_FLAGS "${CMAKE_REQUIRED_LINK_OPTIONS}") + else() + message(WARNING "Versioned symbols requested, but not supported by the toolchain.") + endif() + cmake_pop_check_state() + endif() endif() add_library(${LIB_NAME} ALIAS ${LIB_SELECTED}) @@ -234,7 +286,7 @@ if(CURL_ENABLE_EXPORT_TARGET) endif() export(TARGETS ${libcurl_export} - FILE ${PROJECT_BINARY_DIR}/libcurl-target.cmake - NAMESPACE ${PROJECT_NAME}:: + FILE "${PROJECT_BINARY_DIR}/libcurl-target.cmake" + NAMESPACE ${PROJECT_NAME}:: ) endif() diff --git a/deps/curl/lib/Makefile.am b/deps/curl/lib/Makefile.am index 1237c8e9..3a40280b 100644 --- a/deps/curl/lib/Makefile.am +++ b/deps/curl/lib/Makefile.am @@ -25,11 +25,14 @@ AUTOMAKE_OPTIONS = foreign nostdinc CMAKE_DIST = CMakeLists.txt curl_config.h.cmake -EXTRA_DIST = Makefile.mk config-win32.h config-win32ce.h config-plan9.h \ - config-riscos.h config-mac.h curl_config.h.in config-dos.h \ - libcurl.plist libcurl.rc config-amigaos.h config-win32ce.h \ - config-os400.h setup-os400.h $(CMAKE_DIST) setup-win32.h .checksrc \ - Makefile.soname +CHECKSRC_DIST = .checksrc vauth/.checksrc vquic/.checksrc vssh/.checksrc \ + vtls/.checksrc + +EXTRA_DIST = Makefile.mk config-win32.h config-win32ce.h config-plan9.h \ + config-riscos.h config-mac.h curl_config.h.in config-dos.h libcurl.rc \ + config-amigaos.h config-win32ce.h config-os400.h setup-os400.h \ + $(CMAKE_DIST) setup-win32.h Makefile.soname optiontable.pl libcurl.def \ + $(CHECKSRC_DIST) lib_LTLIBRARIES = libcurl.la @@ -67,8 +70,27 @@ AM_CFLAGS = # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc +if USE_UNITY +# Keep these separate to avoid duplicate definitions when linking libtests +# in static mode. +curl_EXCLUDE = curl_threads.c timediff.c warnless.c +if DEBUGBUILD +# We must compile these sources separately to avoid memdebug.h redefinitions +# applying to them. +curl_EXCLUDE += memdebug.c curl_multibyte.c +endif +libcurl_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CSOURCES) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CSOURCES) --exclude $(curl_EXCLUDE) > libcurl_unity.c + +nodist_libcurl_la_SOURCES = libcurl_unity.c +libcurl_la_SOURCES = $(curl_EXCLUDE) +nodist_libcurlu_la_SOURCES = libcurl_unity.c +libcurlu_la_SOURCES = $(curl_EXCLUDE) +CLEANFILES = libcurl_unity.c +else libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) +endif libcurl_la_CPPFLAGS_EXTRA = libcurl_la_LDFLAGS_EXTRA = @@ -110,11 +132,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_LIBS) +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) libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS -libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) +libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_PC_LIBS_PRIVATE) libcurlu_la_CFLAGS = $(AM_CFLAGS) CHECKSRC = $(CS_$(V)) @@ -127,7 +149,7 @@ checksrc: -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \ $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch]) -if CURLDEBUG +if DEBUGBUILD # for debug builds, we scan the sources on all regular make invokes all-local: checksrc endif diff --git a/deps/curl/lib/Makefile.inc b/deps/curl/lib/Makefile.inc index 400e2b1a..1d3f69a2 100644 --- a/deps/curl/lib/Makefile.inc +++ b/deps/curl/lib/Makefile.inc @@ -44,6 +44,7 @@ LIB_VAUTH_HFILES = \ LIB_VTLS_CFILES = \ vtls/bearssl.c \ + vtls/cipher_suite.c \ vtls/gtls.c \ vtls/hostcheck.c \ vtls/keylog.c \ @@ -60,6 +61,7 @@ LIB_VTLS_CFILES = \ LIB_VTLS_HFILES = \ vtls/bearssl.h \ + vtls/cipher_suite.h \ vtls/gtls.h \ vtls/hostcheck.h \ vtls/keylog.h \ @@ -95,9 +97,11 @@ LIB_VQUIC_HFILES = \ LIB_VSSH_CFILES = \ vssh/libssh.c \ vssh/libssh2.c \ + vssh/curl_path.c \ vssh/wolfssh.c -LIB_VSSH_HFILES = \ +LIB_VSSH_HFILES = \ + vssh/curl_path.h \ vssh/ssh.h LIB_CFILES = \ @@ -129,8 +133,6 @@ LIB_CFILES = \ curl_memrchr.c \ curl_multibyte.c \ curl_ntlm_core.c \ - curl_ntlm_wb.c \ - curl_path.c \ curl_range.c \ curl_rtmp.c \ curl_sasl.c \ @@ -140,6 +142,7 @@ LIB_CFILES = \ curl_trc.c \ cw-out.c \ dict.c \ + dllmain.c \ doh.c \ dynbuf.c \ dynhds.c \ @@ -271,8 +274,6 @@ LIB_HFILES = \ curl_memrchr.h \ curl_multibyte.h \ curl_ntlm_core.h \ - curl_ntlm_wb.h \ - curl_path.h \ curl_printf.h \ curl_range.h \ curl_rtmp.h \ diff --git a/deps/curl/lib/Makefile.mk b/deps/curl/lib/Makefile.mk index 95f281b7..e130b758 100644 --- a/deps/curl/lib/Makefile.mk +++ b/deps/curl/lib/Makefile.mk @@ -27,7 +27,7 @@ # Usage: make -f Makefile.mk CFG=-feat1[-feat2][-feat3][...] # Example: make -f Makefile.mk CFG=-zlib-ssl-libssh2-ipv6 # -# Look for ' ?=' to find all accepted customization variables. +# Look for ' ?=' to find accepted customization variables. # This script is reused by 'src' and 'docs/examples' Makefile.mk scripts. @@ -96,7 +96,7 @@ ifneq ($(findstring -sync,$(CFG)),) else ifneq ($(findstring -ares,$(CFG)),) LIBCARES_PATH ?= $(PROOT)/../c-ares CPPFLAGS += -DUSE_ARES - CPPFLAGS += -I"$(LIBCARES_PATH)/include" + CPPFLAGS += -isystem "$(LIBCARES_PATH)/include" LDFLAGS += -L"$(LIBCARES_PATH)/lib" LIBS += -lcares endif @@ -104,7 +104,7 @@ endif ifneq ($(findstring -rtmp,$(CFG)),) LIBRTMP_PATH ?= $(PROOT)/../librtmp CPPFLAGS += -DUSE_LIBRTMP - CPPFLAGS += -I"$(LIBRTMP_PATH)" + CPPFLAGS += -isystem "$(LIBRTMP_PATH)" LDFLAGS += -L"$(LIBRTMP_PATH)/librtmp" LIBS += -lrtmp ZLIB := 1 @@ -113,19 +113,19 @@ endif ifneq ($(findstring -ssh2,$(CFG)),) LIBSSH2_PATH ?= $(PROOT)/../libssh2 CPPFLAGS += -DUSE_LIBSSH2 - CPPFLAGS += -I"$(LIBSSH2_PATH)/include" + CPPFLAGS += -isystem "$(LIBSSH2_PATH)/include" LDFLAGS += -L"$(LIBSSH2_PATH)/lib" LIBS += -lssh2 else ifneq ($(findstring -libssh,$(CFG)),) LIBSSH_PATH ?= $(PROOT)/../libssh CPPFLAGS += -DUSE_LIBSSH - CPPFLAGS += -I"$(LIBSSH_PATH)/include" + CPPFLAGS += -isystem "$(LIBSSH_PATH)/include" LDFLAGS += -L"$(LIBSSH_PATH)/lib" LIBS += -lssh else ifneq ($(findstring -wolfssh,$(CFG)),) WOLFSSH_PATH ?= $(PROOT)/../wolfssh CPPFLAGS += -DUSE_WOLFSSH - CPPFLAGS += -I"$(WOLFSSH_PATH)/include" + CPPFLAGS += -isystem "$(WOLFSSH_PATH)/include" LDFLAGS += -L"$(WOLFSSH_PATH)/lib" LIBS += -lwolfssh endif @@ -136,7 +136,7 @@ ifneq ($(findstring -ssl,$(CFG)),) CPPFLAGS += -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG OPENSSL_INCLUDE ?= $(OPENSSL_PATH)/include OPENSSL_LIBPATH ?= $(OPENSSL_PATH)/lib - CPPFLAGS += -I"$(OPENSSL_INCLUDE)" + CPPFLAGS += -isystem "$(OPENSSL_INCLUDE)" LDFLAGS += -L"$(OPENSSL_LIBPATH)" OPENSSL_LIBS ?= -lssl -lcrypto LIBS += $(OPENSSL_LIBS) @@ -153,7 +153,7 @@ ifneq ($(findstring -wolfssl,$(CFG)),) WOLFSSL_PATH ?= $(PROOT)/../wolfssl CPPFLAGS += -DUSE_WOLFSSL CPPFLAGS += -DSIZEOF_LONG_LONG=8 - CPPFLAGS += -I"$(WOLFSSL_PATH)/include" + CPPFLAGS += -isystem "$(WOLFSSL_PATH)/include" LDFLAGS += -L"$(WOLFSSL_PATH)/lib" LIBS += -lwolfssl SSLLIBS += 1 @@ -161,16 +161,24 @@ endif ifneq ($(findstring -mbedtls,$(CFG)),) MBEDTLS_PATH ?= $(PROOT)/../mbedtls CPPFLAGS += -DUSE_MBEDTLS - CPPFLAGS += -I"$(MBEDTLS_PATH)/include" + CPPFLAGS += -isystem "$(MBEDTLS_PATH)/include" LDFLAGS += -L"$(MBEDTLS_PATH)/lib" LIBS += -lmbedtls -lmbedx509 -lmbedcrypto SSLLIBS += 1 endif +ifneq ($(findstring -bearssl,$(CFG)),) + BEARSSL_PATH ?= $(PROOT)/../bearssl + CPPFLAGS += -DUSE_BEARSSL + CPPFLAGS += -isystem "$(BEARSSL_PATH)/inc" + LDFLAGS += -L"$(BEARSSL_PATH)/build" + LIBS += -lbearssl + SSLLIBS += 1 +endif ifneq ($(findstring -nghttp2,$(CFG)),) NGHTTP2_PATH ?= $(PROOT)/../nghttp2 CPPFLAGS += -DUSE_NGHTTP2 - CPPFLAGS += -I"$(NGHTTP2_PATH)/include" + CPPFLAGS += -isystem "$(NGHTTP2_PATH)/include" LDFLAGS += -L"$(NGHTTP2_PATH)/lib" LIBS += -lnghttp2 endif @@ -178,13 +186,13 @@ endif ifeq ($(findstring -nghttp3,$(CFG))$(findstring -ngtcp2,$(CFG)),-nghttp3-ngtcp2) NGHTTP3_PATH ?= $(PROOT)/../nghttp3 CPPFLAGS += -DUSE_NGHTTP3 - CPPFLAGS += -I"$(NGHTTP3_PATH)/include" + CPPFLAGS += -isystem "$(NGHTTP3_PATH)/include" LDFLAGS += -L"$(NGHTTP3_PATH)/lib" LIBS += -lnghttp3 NGTCP2_PATH ?= $(PROOT)/../ngtcp2 CPPFLAGS += -DUSE_NGTCP2 - CPPFLAGS += -I"$(NGTCP2_PATH)/include" + CPPFLAGS += -isystem "$(NGTCP2_PATH)/include" LDFLAGS += -L"$(NGTCP2_PATH)/lib" NGTCP2_LIBS ?= @@ -207,7 +215,7 @@ ifneq ($(findstring -zlib,$(CFG))$(ZLIB),) ZLIB_PATH ?= $(PROOT)/../zlib # These CPPFLAGS are also required when compiling the curl tool via 'src'. CPPFLAGS += -DHAVE_LIBZ - CPPFLAGS += -I"$(ZLIB_PATH)/include" + CPPFLAGS += -isystem "$(ZLIB_PATH)/include" LDFLAGS += -L"$(ZLIB_PATH)/lib" ZLIB_LIBS ?= -lz LIBS += $(ZLIB_LIBS) @@ -216,7 +224,7 @@ endif ifneq ($(findstring -zstd,$(CFG)),) ZSTD_PATH ?= $(PROOT)/../zstd CPPFLAGS += -DHAVE_ZSTD - CPPFLAGS += -I"$(ZSTD_PATH)/include" + CPPFLAGS += -isystem "$(ZSTD_PATH)/include" LDFLAGS += -L"$(ZSTD_PATH)/lib" ZSTD_LIBS ?= -lzstd LIBS += $(ZSTD_LIBS) @@ -224,7 +232,7 @@ endif ifneq ($(findstring -brotli,$(CFG)),) BROTLI_PATH ?= $(PROOT)/../brotli CPPFLAGS += -DHAVE_BROTLI - CPPFLAGS += -I"$(BROTLI_PATH)/include" + CPPFLAGS += -isystem "$(BROTLI_PATH)/include" LDFLAGS += -L"$(BROTLI_PATH)/lib" BROTLI_LIBS ?= -lbrotlidec -lbrotlicommon LIBS += $(BROTLI_LIBS) @@ -232,34 +240,34 @@ endif ifneq ($(findstring -gsasl,$(CFG)),) LIBGSASL_PATH ?= $(PROOT)/../gsasl CPPFLAGS += -DUSE_GSASL - CPPFLAGS += -I"$(LIBGSASL_PATH)/include" + CPPFLAGS += -isystem "$(LIBGSASL_PATH)/include" LDFLAGS += -L"$(LIBGSASL_PATH)/lib" LIBS += -lgsasl endif ifneq ($(findstring -idn2,$(CFG)),) LIBIDN2_PATH ?= $(PROOT)/../libidn2 - CPPFLAGS += -DUSE_LIBIDN2 - CPPFLAGS += -I"$(LIBIDN2_PATH)/include" + CPPFLAGS += -DHAVE_LIBIDN2 -DHAVE_IDN2_H + CPPFLAGS += -isystem "$(LIBIDN2_PATH)/include" LDFLAGS += -L"$(LIBIDN2_PATH)/lib" LIBS += -lidn2 ifneq ($(findstring -psl,$(CFG)),) LIBPSL_PATH ?= $(PROOT)/../libpsl CPPFLAGS += -DUSE_LIBPSL - CPPFLAGS += -I"$(LIBPSL_PATH)/include" + CPPFLAGS += -isystem "$(LIBPSL_PATH)/include" LDFLAGS += -L"$(LIBPSL_PATH)/lib" LIBS += -lpsl endif endif ifneq ($(findstring -ipv6,$(CFG)),) - CPPFLAGS += -DENABLE_IPV6 + CPPFLAGS += -DUSE_IPV6 endif ifneq ($(findstring -watt,$(CFG))$(MSDOS),) WATT_PATH ?= $(PROOT)/../watt - CPPFLAGS += -I"$(WATT_PATH)/inc" + CPPFLAGS += -isystem "$(WATT_PATH)/inc" LDFLAGS += -L"$(WATT_PATH)/lib" LIBS += -lwatt endif @@ -277,13 +285,11 @@ DEL = rm -f $1 COPY = -cp -afv $1 $2 MKDIR = mkdir -p $1 RMDIR = rm -fr $1 -WHICH = $(SHELL) -c "command -v $1" else DEL = -del 2>NUL /q /f $(subst /,\,$1) COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2) MKDIR = -md 2>NUL $(subst /,\,$1) RMDIR = -rd 2>NUL /q /s $(subst /,\,$1) -WHICH = where $1 endif all: $(TARGETS) diff --git a/deps/curl/lib/Makefile.soname b/deps/curl/lib/Makefile.soname index 02e003a8..eee661b7 100644 --- a/deps/curl/lib/Makefile.soname +++ b/deps/curl/lib/Makefile.soname @@ -22,6 +22,7 @@ # ########################################################################### +# Keep in sync with CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME in configure.ac VERSIONCHANGE=12 VERSIONADD=0 VERSIONDEL=8 diff --git a/deps/curl/lib/altsvc.c b/deps/curl/lib/altsvc.c index c12d7bda..ea37b0af 100644 --- a/deps/curl/lib/altsvc.c +++ b/deps/curl/lib/altsvc.c @@ -64,6 +64,8 @@ static enum alpnid alpn2alpnid(char *name) return ALPN_h2; if(strcasecompare(name, H3VERSION)) return ALPN_h3; + if(strcasecompare(name, "http/1.1")) + return ALPN_h1; return ALPN_none; /* unknown, probably rubbish input */ } @@ -92,6 +94,7 @@ static void altsvc_free(struct altsvc *as) static struct altsvc *altsvc_createid(const char *srchost, const char *dsthost, + size_t dlen, /* dsthost length */ enum alpnid srcalpnid, enum alpnid dstalpnid, unsigned int srcport, @@ -99,11 +102,9 @@ static struct altsvc *altsvc_createid(const char *srchost, { struct altsvc *as = calloc(1, sizeof(struct altsvc)); size_t hlen; - size_t dlen; if(!as) return NULL; hlen = strlen(srchost); - dlen = strlen(dsthost); DEBUGASSERT(hlen); DEBUGASSERT(dlen); if(!hlen || !dlen) { @@ -155,7 +156,8 @@ static struct altsvc *altsvc_create(char *srchost, enum alpnid srcalpnid = alpn2alpnid(srcalpn); if(!srcalpnid || !dstalpnid) return NULL; - return altsvc_createid(srchost, dsthost, srcalpnid, dstalpnid, + return altsvc_createid(srchost, dsthost, strlen(dsthost), + srcalpnid, dstalpnid, srcport, dstport); } @@ -191,7 +193,7 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, char *line) as->expires = expires; as->prio = prio; as->persist = persist ? 1 : 0; - Curl_llist_insert_next(&asi->list, asi->list.tail, as, &as->node); + Curl_llist_append(&asi->list, as, &as->node); } } @@ -211,7 +213,7 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file) CURLcode result = CURLE_OK; FILE *fp; - /* we need a private copy of the file name so that the altsvc cache 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); @@ -252,7 +254,7 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp) CURLcode result = Curl_gmtime(as->expires, &stamp); if(result) return result; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else { char ipv6_unused[16]; if(1 == Curl_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) { @@ -270,7 +272,7 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp) "%s %s%s%s %u " "\"%d%02d%02d " "%02d:%02d:%02d\" " - "%u %d\n", + "%u %u\n", Curl_alpnid2str(as->src.alpnid), src6_pre, as->src.host, src6_post, as->src.port, @@ -303,7 +305,7 @@ struct altsvcinfo *Curl_altsvc_init(void) #ifdef USE_HTTP2 | CURLALTSVC_H2 #endif -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 | CURLALTSVC_H3 #endif ; @@ -315,10 +317,8 @@ struct altsvcinfo *Curl_altsvc_init(void) */ CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file) { - CURLcode result; DEBUGASSERT(asi); - result = altsvc_load(asi, file); - return result; + return altsvc_load(asi, file); } /* @@ -337,13 +337,13 @@ CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl) */ void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) { - struct Curl_llist_element *e; - struct Curl_llist_element *n; if(*altsvcp) { + struct Curl_llist_node *e; + struct Curl_llist_node *n; struct altsvcinfo *altsvc = *altsvcp; - for(e = altsvc->list.head; e; e = n) { - struct altsvc *as = e->ptr; - n = e->next; + for(e = Curl_llist_head(&altsvc->list); e; e = n) { + struct altsvc *as = Curl_node_elem(e); + n = Curl_node_next(e); altsvc_free(as); } free(altsvc->filename); @@ -358,8 +358,6 @@ void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) CURLcode Curl_altsvc_save(struct Curl_easy *data, struct altsvcinfo *altsvc, const char *file) { - struct Curl_llist_element *e; - struct Curl_llist_element *n; CURLcode result = CURLE_OK; FILE *out; char *tempstore = NULL; @@ -373,17 +371,19 @@ CURLcode Curl_altsvc_save(struct Curl_easy *data, file = altsvc->filename; if((altsvc->flags & CURLALTSVC_READONLYFILE) || !file || !file[0]) - /* marked as read-only, no file or zero length file name */ + /* marked as read-only, no file or zero length filename */ return CURLE_OK; result = Curl_fopen(data, file, &out, &tempstore); if(!result) { + struct Curl_llist_node *e; + struct Curl_llist_node *n; fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n" "# This file was generated by libcurl! Edit at your own risk.\n", out); - for(e = altsvc->list.head; e; e = n) { - struct altsvc *as = e->ptr; - n = e->next; + for(e = Curl_llist_head(&altsvc->list); e; e = n) { + struct altsvc *as = Curl_node_elem(e); + n = Curl_node_next(e); result = altsvc_out(as, out); if(result) break; @@ -430,7 +430,7 @@ static bool hostcompare(const char *host, const char *check) if(hlen && (host[hlen - 1] == '.')) hlen--; if(hlen != clen) - /* they can't match if they have different lengths */ + /* they cannot match if they have different lengths */ return FALSE; return strncasecompare(host, check, hlen); } @@ -440,15 +440,15 @@ static bool hostcompare(const char *host, const char *check) static void altsvc_flush(struct altsvcinfo *asi, enum alpnid srcalpnid, const char *srchost, unsigned short srcport) { - struct Curl_llist_element *e; - struct Curl_llist_element *n; - for(e = asi->list.head; e; e = n) { - struct altsvc *as = e->ptr; - n = e->next; + struct Curl_llist_node *e; + struct Curl_llist_node *n; + for(e = Curl_llist_head(&asi->list); e; e = n) { + struct altsvc *as = Curl_node_elem(e); + n = Curl_node_next(e); if((srcalpnid == as->src.alpnid) && (srcport == as->src.port) && hostcompare(srchost, as->src.host)) { - Curl_llist_remove(&asi->list, e, NULL); + Curl_node_remove(e); altsvc_free(as); } } @@ -462,7 +462,7 @@ static time_t altsvc_debugtime(void *unused) char *timestr = getenv("CURL_TIME"); (void)unused; if(timestr) { - unsigned long val = strtol(timestr, NULL, 10); + long val = strtol(timestr, NULL, 10); return (time_t)val; } return time(NULL); @@ -477,11 +477,11 @@ static time_t altsvc_debugtime(void *unused) * Curl_altsvc_parse() takes an incoming alt-svc response header and stores * the data correctly in the cache. * - * 'value' points to the header *value*. That's contents to the right of the + * 'value' points to the header *value*. That is contents to the right of the * header name. * * Currently this function rejects invalid data without returning an error. - * Invalid host name, port number will result in the specific alternative + * Invalid hostname, port number will result in the specific alternative * being rejected. Unknown protocols are skipped. */ CURLcode Curl_altsvc_parse(struct Curl_easy *data, @@ -490,8 +490,6 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, unsigned short srcport) { const char *p = value; - size_t len; - char namebuf[MAX_ALTSVC_HOSTLEN] = ""; char alpnbuf[MAX_ALTSVC_ALPNLEN] = ""; struct altsvc *as; unsigned short dstport = srcport; /* the same by default */ @@ -521,6 +519,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, p++; if(*p == '\"') { const char *dsthost = ""; + size_t dstlen = 0; /* destination hostname length */ const char *value_ptr; char option[32]; unsigned long num; @@ -531,36 +530,35 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, bool valid = TRUE; p++; if(*p != ':') { - /* host name starts here */ + /* hostname starts here */ const char *hostp = p; if(*p == '[') { /* pass all valid IPv6 letters - does not handle zone id */ - len = strspn(++p, "0123456789abcdefABCDEF:."); - if(p[len] != ']') + dstlen = strspn(++p, "0123456789abcdefABCDEF:."); + if(p[dstlen] != ']') /* invalid host syntax, bail out */ break; /* we store the IPv6 numerical address *with* brackets */ - len += 2; - p = &p[len-1]; + dstlen += 2; + p = &p[dstlen-1]; } else { while(*p && (ISALNUM(*p) || (*p == '.') || (*p == '-'))) p++; - len = p - hostp; + dstlen = p - hostp; } - if(!len || (len >= MAX_ALTSVC_HOSTLEN)) { - infof(data, "Excessive alt-svc host name, ignoring."); + if(!dstlen || (dstlen >= MAX_ALTSVC_HOSTLEN)) { + infof(data, "Excessive alt-svc hostname, ignoring."); valid = FALSE; } else { - memcpy(namebuf, hostp, len); - namebuf[len] = 0; - dsthost = namebuf; + dsthost = hostp; } } else { /* no destination name, use source host */ dsthost = srchost; + dstlen = strlen(srchost); } if(*p == ':') { unsigned long port = 0; @@ -624,7 +622,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, num = strtoul(value_ptr, &end_ptr, 10); if((end_ptr != value_ptr) && (num < ULONG_MAX)) { if(strcasecompare("ma", option)) - maxage = num; + maxage = (time_t)num; else if(strcasecompare("persist", option) && (num == 1)) persist = TRUE; } @@ -635,7 +633,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, this is the first entry of the line. */ altsvc_flush(asi, srcalpnid, srchost, srcport); - as = altsvc_createid(srchost, dsthost, + as = altsvc_createid(srchost, dsthost, dstlen, srcalpnid, dstalpnid, srcport, dstport); if(as) { @@ -643,7 +641,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, account. [See RFC 7838 section 3.1] */ as->expires = maxage + time(NULL); as->persist = persist; - Curl_llist_insert_next(&asi->list, asi->list.tail, as, &as->node); + Curl_llist_append(&asi->list, as, &as->node); infof(data, "Added alt-svc: %s:%d over %s", dsthost, dstport, Curl_alpnid2str(dstalpnid)); } @@ -651,7 +649,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, } else break; - /* after the double quote there can be a comma if there's another + /* after the double quote there can be a comma if there is another string or a semicolon if no more */ if(*p == ',') { /* comma means another alternative is presented */ @@ -677,26 +675,26 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, struct altsvc **dstentry, const int versions) /* one or more bits */ { - struct Curl_llist_element *e; - struct Curl_llist_element *n; + struct Curl_llist_node *e; + struct Curl_llist_node *n; time_t now = time(NULL); DEBUGASSERT(asi); DEBUGASSERT(srchost); DEBUGASSERT(dstentry); - for(e = asi->list.head; e; e = n) { - struct altsvc *as = e->ptr; - n = e->next; + for(e = Curl_llist_head(&asi->list); e; e = n) { + struct altsvc *as = Curl_node_elem(e); + n = Curl_node_next(e); if(as->expires < now) { /* an expired entry, remove */ - Curl_llist_remove(&asi->list, e, NULL); + Curl_node_remove(e); altsvc_free(as); continue; } if((as->src.alpnid == srcalpnid) && hostcompare(srchost, as->src.host) && (as->src.port == srcport) && - (versions & as->dst.alpnid)) { + (versions & (int)as->dst.alpnid)) { /* match */ *dstentry = as; return TRUE; diff --git a/deps/curl/lib/altsvc.h b/deps/curl/lib/altsvc.h index 7fea1434..48999efb 100644 --- a/deps/curl/lib/altsvc.h +++ b/deps/curl/lib/altsvc.h @@ -47,8 +47,8 @@ struct altsvc { struct althost dst; time_t expires; bool persist; - int prio; - struct Curl_llist_element node; + unsigned int prio; + struct Curl_llist_node node; }; struct altsvcinfo { diff --git a/deps/curl/lib/amigaos.c b/deps/curl/lib/amigaos.c index 139309b1..1321c53c 100644 --- a/deps/curl/lib/amigaos.c +++ b/deps/curl/lib/amigaos.c @@ -117,7 +117,7 @@ void Curl_amiga_cleanup(void) #ifdef CURLRES_AMIGA /* - * Because we need to handle the different cases in hostip4.c at run-time, + * Because we need to handle the different cases in hostip4.c at runtime, * not at compile-time, based on what was detected in Curl_amiga_init(), * we replace it completely with our own as to not complicate the baseline * code. Assumes malloc/calloc/free are thread safe because Curl_he2ai() diff --git a/deps/curl/lib/arpa_telnet.h b/deps/curl/lib/arpa_telnet.h index 228b4466..d641a01d 100644 --- a/deps/curl/lib/arpa_telnet.h +++ b/deps/curl/lib/arpa_telnet.h @@ -77,7 +77,7 @@ static const char * const telnetoptions[]= #define CURL_GA 249 /* Go Ahead, reverse the line */ #define CURL_SB 250 /* SuBnegotiation */ #define CURL_WILL 251 /* Our side WILL use this option */ -#define CURL_WONT 252 /* Our side WON'T 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_IAC 255 /* Interpret As Command */ diff --git a/deps/curl/lib/asyn-ares.c b/deps/curl/lib/asyn-ares.c index 3d718b34..ae436f23 100644 --- a/deps/curl/lib/asyn-ares.c +++ b/deps/curl/lib/asyn-ares.c @@ -65,7 +65,7 @@ # define CARES_STATICLIB #endif #include -#include /* really old c-ares didn't include this by +#include /* really old c-ares did not include this by itself */ #if ARES_VERSION >= 0x010500 @@ -112,8 +112,8 @@ struct thread_data { /* 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 - default value. Unfortunately, c-ares doesn't expose its default timeout in + 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. See query_completed_cb() for an explanation of how this is used. @@ -126,8 +126,8 @@ static int ares_ver = 0; /* * Curl_resolver_global_init() - the generic low-level asynchronous name - * resolve API. Called from curl_global_init() to initialize global resolver - * environment. Initializes ares library. + * resolve API. Called from curl_global_init() to initialize global resolver + * environment. Initializes ares library. */ int Curl_resolver_global_init(void) { @@ -169,7 +169,7 @@ static void sock_state_cb(void *data, ares_socket_t socket_fd, * * Called from curl_easy_init() -> Curl_open() to initialize resolver * URL-state specific environment ('resolver' member of the UrlState - * structure). Fills the passed pointer by the initialized ares_channel. + * structure). Fills the passed pointer by the initialized ares_channel. */ CURLcode Curl_resolver_init(struct Curl_easy *easy, void **resolver) { @@ -211,7 +211,7 @@ CURLcode Curl_resolver_init(struct Curl_easy *easy, void **resolver) * * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver * URL-state specific environment ('resolver' member of the UrlState - * structure). Destroys the ares channel. + * structure). Destroys the ares channel. */ void Curl_resolver_cleanup(void *resolver) { @@ -222,7 +222,7 @@ void Curl_resolver_cleanup(void *resolver) * Curl_resolver_duphandle() * * Called from curl_easy_duphandle() to duplicate resolver URL-state specific - * environment ('resolver' member of the UrlState structure). Duplicates the + * environment ('resolver' member of the UrlState structure). Duplicates the * 'from' ares channel and passes the resulting channel to the 'to' pointer. */ CURLcode Curl_resolver_duphandle(struct Curl_easy *easy, void **to, void *from) @@ -250,12 +250,12 @@ void Curl_resolver_cancel(struct Curl_easy *data) } /* - * We're equivalent to Curl_resolver_cancel() for the c-ares resolver. We + * We are equivalent to Curl_resolver_cancel() for the c-ares resolver. We * never block. */ void Curl_resolver_kill(struct Curl_easy *data) { - /* We don't need to check the resolver state because we can be called safely + /* We do not need to check the resolver state because we can be called safely at any time and we always do the same thing. */ Curl_resolver_cancel(data); } @@ -280,7 +280,7 @@ static void destroy_async_data(struct Curl_async *async) /* * Curl_resolver_getsock() is called when someone from the outside world - * (using curl_multi_fdset()) wants to get our fd_set setup and we're talking + * (using curl_multi_fdset()) wants to get our fd_set setup and we are talking * with ares. The caller must make sure that this function is only called when * we have a working ares channel. * @@ -290,23 +290,14 @@ static void destroy_async_data(struct Curl_async *async) int Curl_resolver_getsock(struct Curl_easy *data, curl_socket_t *socks) { - struct timeval maxtime; + struct timeval maxtime = { CURL_TIMEOUT_RESOLVE, 0 }; struct timeval timebuf; - struct timeval *timeout; - long milli; int max = ares_getsock((ares_channel)data->state.async.resolver, (ares_socket_t *)socks, MAX_SOCKSPEREASYHANDLE); - - maxtime.tv_sec = CURL_TIMEOUT_RESOLVE; - maxtime.tv_usec = 0; - - timeout = ares_timeout((ares_channel)data->state.async.resolver, &maxtime, - &timebuf); - milli = (long)curlx_tvtoms(timeout); - if(milli == 0) - milli += 10; + struct timeval *timeout = + ares_timeout((ares_channel)data->state.async.resolver, &maxtime, &timebuf); + timediff_t milli = curlx_tvtoms(timeout); Curl_expire(data, milli, EXPIRE_ASYNC_NAME); - return max; } @@ -350,7 +341,7 @@ static int waitperform(struct Curl_easy *data, timediff_t timeout_ms) } if(num) { - nfds = Curl_poll(pfd, num, timeout_ms); + nfds = Curl_poll(pfd, (unsigned int)num, timeout_ms); if(nfds < 0) return -1; } @@ -359,17 +350,17 @@ static int waitperform(struct Curl_easy *data, timediff_t timeout_ms) if(!nfds) /* Call ares_process() unconditionally here, even if we simply timed out - above, as otherwise the ares name resolve won't timeout! */ + above, as otherwise the ares name resolve will not timeout! */ ares_process_fd((ares_channel)data->state.async.resolver, ARES_SOCKET_BAD, ARES_SOCKET_BAD); else { /* move through the descriptors and ask for processing on them */ for(i = 0; i < num; i++) ares_process_fd((ares_channel)data->state.async.resolver, - (pfd[i].revents & (POLLRDNORM|POLLIN))? - pfd[i].fd:ARES_SOCKET_BAD, - (pfd[i].revents & (POLLWRNORM|POLLOUT))? - pfd[i].fd:ARES_SOCKET_BAD); + (pfd[i].revents & (POLLRDNORM|POLLIN)) ? + pfd[i].fd : ARES_SOCKET_BAD, + (pfd[i].revents & (POLLWRNORM|POLLOUT)) ? + pfd[i].fd : ARES_SOCKET_BAD); } return nfds; } @@ -394,8 +385,8 @@ CURLcode Curl_resolver_is_resolved(struct Curl_easy *data, return CURLE_UNRECOVERABLE_POLL; #ifndef HAVE_CARES_GETADDRINFO - /* Now that we've checked for any last minute results above, see if there are - any responses still pending when the EXPIRE_HAPPY_EYEBALLS_DNS timer + /* 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(res && res->num_pending @@ -410,7 +401,7 @@ CURLcode Curl_resolver_is_resolved(struct Curl_easy *data, &res->happy_eyeballs_dns_time, 0, sizeof(res->happy_eyeballs_dns_time)); /* Cancel the raw c-ares request, which will fire query_completed_cb() with - ARES_ECANCELLED synchronously for all pending responses. This will + ARES_ECANCELLED synchronously for all pending responses. This will leave us with res->num_pending == 0, which is perfect for the next block. */ ares_cancel((ares_channel)data->state.async.resolver); @@ -523,7 +514,7 @@ CURLcode Curl_resolver_wait_resolv(struct Curl_easy *data, *entry = data->state.async.dns; if(result) - /* close the connection, since we can't return failure here without + /* close the connection, since we cannot return failure here without cleaning up this connection properly. */ connclose(data->conn, "c-ares resolve failed"); @@ -539,7 +530,7 @@ static void compound_results(struct thread_data *res, if(!ai) return; -#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */ +#ifdef USE_IPV6 /* CURLRES_IPV6 */ if(res->temp_ai && res->temp_ai->ai_family == PF_INET6) { /* We have results already, put the new IPv6 entries at the head of the list. */ @@ -603,57 +594,57 @@ static void query_completed_cb(void *arg, /* (struct connectdata *) */ /* If there are responses still pending, we presume they must be the complementary IPv4 or IPv6 lookups that we started in parallel in - Curl_resolver_getaddrinfo() (for Happy Eyeballs). If we've got a + Curl_resolver_getaddrinfo() (for Happy Eyeballs). If we have got a "definitive" response from one of a set of parallel queries, we need to - think about how long we're willing to wait for more responses. */ + think about how long we are willing to wait for more responses. */ if(res->num_pending /* Only these c-ares status values count as "definitive" for these - purposes. For example, ARES_ENODATA is what we expect when there is - no IPv6 entry for a domain name, and that's not a reason to get more - aggressive in our timeouts for the other response. Other errors are + purposes. For example, ARES_ENODATA is what we expect when there is + no IPv6 entry for a domain name, and that is not a reason to get more + aggressive in our timeouts for the other response. Other errors are either a result of bad input (which should affect all parallel requests), local or network conditions, non-definitive server responses, or us cancelling the request. */ && (status == ARES_SUCCESS || status == ARES_ENOTFOUND)) { - /* Right now, there can only be up to two parallel queries, so don't + /* Right now, there can only be up to two parallel queries, so do not bother handling any other cases. */ DEBUGASSERT(res->num_pending == 1); - /* It's possible that one of these parallel queries could succeed - quickly, but the other could always fail or timeout (when we're + /* it is possible that one of these parallel queries could succeed + quickly, but the other could always fail or timeout (when we are talking to a pool of DNS servers that can only successfully resolve IPv4 address, for example). - It's also possible that the other request could always just take + it is also possible that the other request could always just take longer because it needs more time or only the second DNS server can - fulfill it successfully. But, to align with the philosophy of Happy - Eyeballs, we don't want to wait _too_ long or users will think - requests are slow when IPv6 lookups don't actually work (but IPv4 ones - do). + fulfill it successfully. But, to align with the philosophy of Happy + Eyeballs, we do not want to wait _too_ long or users will think + requests are slow when IPv6 lookups do not actually work (but IPv4 + ones do). 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 - this completing request didn't 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 the - first place. Without modifying c-ares, we can't know exactly where in - its retry cycle we are. We could guess based on how much time has - gone by, but it doesn't really matter. Happy Eyeballs tells us that, - given usable information in hand, we simply don't want to wait "too - much longer" after we get a result. + pending responses. Even though it is typical that this resolved + request came back quickly, that needn't 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 + the first place. Without modifying c-ares, we cannot know exactly + where in its retry cycle we are. We could guess based on how much + time has gone by, but it does not really matter. Happy Eyeballs tells + us that, given usable information in hand, we simply do not want to + wait "too much longer" after we get a result. We simply wait an additional amount of time equal to the default - c-ares query timeout. That is enough time for a typical parallel - response to arrive without being "too long". Even on a network + c-ares query timeout. That is enough time for a typical parallel + response to arrive without being "too long". Even on a network where one of the two types of queries is failing or timing out constantly, this will usually mean we wait a total of the default c-ares timeout (5 seconds) plus the round trip time for the successful - request, which seems bearable. The downside is that c-ares might race + request, which seems bearable. The downside is that c-ares might race with us to issue one more retry just before we give up, but it seems better to "waste" that request instead of trying to guess the perfect - timeout to prevent it. After all, we don't even know where in the + timeout to prevent it. After all, we do not even know where in the c-ares retry cycle each request is. */ res->happy_eyeballs_dns_time = Curl_now(); @@ -684,7 +675,7 @@ static struct Curl_addrinfo *ares2addr(struct ares_addrinfo_node *node) /* settle family-specific sockaddr structure size. */ if(ai->ai_family == AF_INET) ss_size = sizeof(struct sockaddr_in); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else if(ai->ai_family == AF_INET6) ss_size = sizeof(struct sockaddr_in6); #endif @@ -801,7 +792,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data, } #endif /* CURLRES_IPV6 */ hints.ai_family = pf; - hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)? + hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP) ? SOCK_STREAM : SOCK_DGRAM; /* Since the service is a numerical one, set the hint flags * accordingly to save a call to getservbyname in inside C-Ares @@ -849,8 +840,8 @@ CURLcode Curl_set_dns_servers(struct Curl_easy *data, /* If server is NULL or empty, this would purge all DNS servers * from ares library, which will cause any and all queries to fail. - * So, just return OK if none are configured and don't actually make - * any changes to c-ares. This lets c-ares use its defaults, which + * So, just return OK if none are configured and do not actually make + * any changes to c-ares. This lets c-ares use its defaults, which * it gets from the OS (for instance from /etc/resolv.conf on Linux). */ if(!(servers && servers[0])) @@ -932,7 +923,7 @@ CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data, CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data, const char *local_ip6) { -#if defined(HAVE_CARES_SET_LOCAL) && defined(ENABLE_IPV6) +#if defined(HAVE_CARES_SET_LOCAL) && defined(USE_IPV6) unsigned char a6[INET6_ADDRSTRLEN]; if((!local_ip6) || (local_ip6[0] == 0)) { diff --git a/deps/curl/lib/asyn-thread.c b/deps/curl/lib/asyn-thread.c index 5b9d5049..a58e4b79 100644 --- a/deps/curl/lib/asyn-thread.c +++ b/deps/curl/lib/asyn-thread.c @@ -54,7 +54,6 @@ # define RESOLVER_ENOMEM ENOMEM #endif -#include "system_win32.h" #include "urldata.h" #include "sendf.h" #include "hostip.h" @@ -145,22 +144,9 @@ static bool init_resolve_thread(struct Curl_easy *data, const char *hostname, int port, const struct addrinfo *hints); -#ifdef _WIN32 -/* Thread sync data used by GetAddrInfoExW for win8+ */ -struct thread_sync_data_w8 -{ - OVERLAPPED overlapped; - ADDRINFOEXW_ *res; - HANDLE cancel_ev; - ADDRINFOEXW_ hints; -}; -#endif /* Data for synchronization between resolver thread and its parent */ struct thread_sync_data { -#ifdef _WIN32 - struct thread_sync_data_w8 w8; -#endif curl_mutex_t *mtx; int done; int port; @@ -168,7 +154,7 @@ struct thread_sync_data { duplicate */ #ifndef CURL_DISABLE_SOCKETPAIR struct Curl_easy *data; - curl_socket_t sock_pair[2]; /* socket pair */ + curl_socket_t sock_pair[2]; /* eventfd/pipes/socket pair */ #endif int sock_error; struct Curl_addrinfo *res; @@ -179,9 +165,6 @@ struct thread_sync_data { }; struct thread_data { -#ifdef _WIN32 - HANDLE complete_ev; -#endif curl_thread_t thread_hnd; unsigned int poll_interval; timediff_t interval_end; @@ -251,7 +234,7 @@ int init_thread_sync_data(struct thread_data *td, #ifndef CURL_DISABLE_SOCKETPAIR /* create socket pair or pipe */ - if(wakeup_create(&tsd->sock_pair[0]) < 0) { + if(wakeup_create(tsd->sock_pair, FALSE) < 0) { tsd->sock_pair[0] = CURL_SOCKET_BAD; tsd->sock_pair[1] = CURL_SOCKET_BAD; goto err_exit; @@ -286,175 +269,41 @@ static CURLcode getaddrinfo_complete(struct Curl_easy *data) result = Curl_addrinfo_callback(data, tsd->sock_error, tsd->res); /* The tsd->res structure has been copied to async.dns and perhaps the DNS - cache. Set our copy to NULL so destroy_thread_sync_data doesn't free it. + cache. Set our copy to NULL so destroy_thread_sync_data does not free it. */ tsd->res = NULL; return result; } -#ifdef _WIN32 -static VOID WINAPI -query_complete(DWORD err, DWORD bytes, LPWSAOVERLAPPED overlapped) -{ - size_t ss_size; - const ADDRINFOEXW_ *ai; - struct Curl_addrinfo *ca; - struct Curl_addrinfo *cafirst = NULL; - struct Curl_addrinfo *calast = NULL; -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wcast-align" -#endif - struct thread_sync_data *tsd = - CONTAINING_RECORD(overlapped, struct thread_sync_data, w8.overlapped); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - struct thread_data *td = tsd->td; - const ADDRINFOEXW_ *res = tsd->w8.res; - int error = (int)err; - (void)bytes; - - if(error == ERROR_SUCCESS) { - /* traverse the addrinfo list */ - - for(ai = res; ai != NULL; ai = ai->ai_next) { - size_t namelen = ai->ai_canonname ? wcslen(ai->ai_canonname) + 1 : 0; - /* ignore elements with unsupported address family, */ - /* settle family-specific sockaddr structure size. */ - if(ai->ai_family == AF_INET) - ss_size = sizeof(struct sockaddr_in); -#ifdef ENABLE_IPV6 - else if(ai->ai_family == AF_INET6) - ss_size = sizeof(struct sockaddr_in6); -#endif - else - continue; - - /* ignore elements without required address info */ - if(!ai->ai_addr || !(ai->ai_addrlen > 0)) - continue; - - /* ignore elements with bogus address size */ - if((size_t)ai->ai_addrlen < ss_size) - continue; - - ca = malloc(sizeof(struct Curl_addrinfo) + ss_size + namelen); - if(!ca) { - error = EAI_MEMORY; - break; - } - - /* copy each structure member individually, member ordering, */ - /* size, or padding might be different for each platform. */ - ca->ai_flags = ai->ai_flags; - ca->ai_family = ai->ai_family; - ca->ai_socktype = ai->ai_socktype; - ca->ai_protocol = ai->ai_protocol; - ca->ai_addrlen = (curl_socklen_t)ss_size; - ca->ai_addr = NULL; - ca->ai_canonname = NULL; - ca->ai_next = NULL; - - ca->ai_addr = (void *)((char *)ca + sizeof(struct Curl_addrinfo)); - memcpy(ca->ai_addr, ai->ai_addr, ss_size); - - if(namelen) { - size_t i; - ca->ai_canonname = (void *)((char *)ca->ai_addr + ss_size); - for(i = 0; i < namelen; ++i) /* convert wide string to ascii */ - ca->ai_canonname[i] = (char)ai->ai_canonname[i]; - ca->ai_canonname[namelen] = '\0'; - } - - /* if the return list is empty, this becomes the first element */ - if(!cafirst) - cafirst = ca; - - /* add this element last in the return list */ - if(calast) - calast->ai_next = ca; - calast = ca; - } - - /* if we failed, also destroy the Curl_addrinfo list */ - if(error) { - Curl_freeaddrinfo(cafirst); - cafirst = NULL; - } - else if(!cafirst) { -#ifdef EAI_NONAME - /* rfc3493 conformant */ - error = EAI_NONAME; -#else - /* rfc3493 obsoleted */ - error = EAI_NODATA; -#endif -#ifdef USE_WINSOCK - SET_SOCKERRNO(error); -#endif - } - tsd->res = cafirst; - } - - if(tsd->w8.res) { - Curl_FreeAddrInfoExW(tsd->w8.res); - tsd->w8.res = NULL; - } - - if(error) { - tsd->sock_error = SOCKERRNO?SOCKERRNO:error; - if(tsd->sock_error == 0) - tsd->sock_error = RESOLVER_ENOMEM; - } - else { - Curl_addrinfo_set_port(tsd->res, tsd->port); - } - - Curl_mutex_acquire(tsd->mtx); - if(tsd->done) { - /* too late, gotta clean up the mess */ - Curl_mutex_release(tsd->mtx); - destroy_thread_sync_data(tsd); - free(td); - } - else { -#ifndef CURL_DISABLE_SOCKETPAIR - char buf[1]; - if(tsd->sock_pair[1] != CURL_SOCKET_BAD) { - /* DNS has been resolved, signal client task */ - buf[0] = 1; - if(swrite(tsd->sock_pair[1], buf, sizeof(buf)) < 0) { - /* update sock_erro to errno */ - tsd->sock_error = SOCKERRNO; - } - } -#endif - tsd->done = 1; - Curl_mutex_release(tsd->mtx); - if(td->complete_ev) - SetEvent(td->complete_ev); /* Notify caller that the query completed */ - } -} -#endif #ifdef HAVE_GETADDRINFO /* * getaddrinfo_thread() resolves a name and then exits. * - * For builds without ARES, but with ENABLE_IPV6, create a resolver thread + * For builds without ARES, but with USE_IPV6, create a resolver thread * and wait on it. */ -static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg) +static +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) +DWORD +#else +unsigned int +#endif +CURL_STDCALL getaddrinfo_thread(void *arg) { struct thread_sync_data *tsd = (struct thread_sync_data *)arg; struct thread_data *td = tsd->td; char service[12]; int rc; #ifndef CURL_DISABLE_SOCKETPAIR +#ifdef USE_EVENTFD + const void *buf; + const uint64_t val = 1; +#else char buf[1]; +#endif #endif msnprintf(service, sizeof(service), "%d", tsd->port); @@ -462,7 +311,7 @@ static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg) rc = Curl_getaddrinfo_ex(tsd->hostname, service, &tsd->hints, &tsd->res); if(rc) { - tsd->sock_error = SOCKERRNO?SOCKERRNO:rc; + tsd->sock_error = SOCKERRNO ? SOCKERRNO : rc; if(tsd->sock_error == 0) tsd->sock_error = RESOLVER_ENOMEM; } @@ -480,9 +329,13 @@ static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg) else { #ifndef CURL_DISABLE_SOCKETPAIR if(tsd->sock_pair[1] != CURL_SOCKET_BAD) { - /* DNS has been resolved, signal client task */ +#ifdef USE_EVENTFD + buf = &val; +#else buf[0] = 1; - if(wakeup_write(tsd->sock_pair[1], buf, sizeof(buf)) < 0) { +#endif + /* DNS has been resolved, signal client task */ + if(wakeup_write(tsd->sock_pair[1], buf, sizeof(buf)) < 0) { /* update sock_erro to errno */ tsd->sock_error = SOCKERRNO; } @@ -500,7 +353,13 @@ static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg) /* * gethostbyname_thread() resolves a name and then exits. */ -static unsigned int CURL_STDCALL gethostbyname_thread(void *arg) +static +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) +DWORD +#else +unsigned int +#endif +CURL_STDCALL gethostbyname_thread(void *arg) { struct thread_sync_data *tsd = (struct thread_sync_data *)arg; struct thread_data *td = tsd->td; @@ -553,21 +412,9 @@ static void destroy_async_data(struct Curl_async *async) Curl_mutex_release(td->tsd.mtx); if(!done) { -#ifdef _WIN32 - if(td->complete_ev) - CloseHandle(td->complete_ev); - else -#endif Curl_thread_destroy(td->thread_hnd); } else { -#ifdef _WIN32 - if(td->complete_ev) { - Curl_GetAddrInfoExCancel(&td->tsd.w8.cancel_ev); - WaitForSingleObject(td->complete_ev, INFINITE); - CloseHandle(td->complete_ev); - } -#endif if(td->thread_hnd != curl_thread_t_null) Curl_thread_join(&td->thread_hnd); @@ -613,9 +460,6 @@ static bool init_resolve_thread(struct Curl_easy *data, asp->status = 0; asp->dns = NULL; td->thread_hnd = curl_thread_t_null; -#ifdef _WIN32 - td->complete_ev = NULL; -#endif if(!init_thread_sync_data(td, hostname, port, hints)) { asp->tdata = NULL; @@ -631,48 +475,13 @@ static bool init_resolve_thread(struct Curl_easy *data, /* The thread will set this to 1 when complete. */ td->tsd.done = 0; -#ifdef _WIN32 - if(Curl_isWindows8OrGreater && Curl_FreeAddrInfoExW && - Curl_GetAddrInfoExCancel && Curl_GetAddrInfoExW) { -#define MAX_NAME_LEN 256 /* max domain name is 253 chars */ -#define MAX_PORT_LEN 8 - WCHAR namebuf[MAX_NAME_LEN]; - WCHAR portbuf[MAX_PORT_LEN]; - /* calculate required length */ - int w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, hostname, - -1, NULL, 0); - if((w_len > 0) && (w_len < MAX_NAME_LEN)) { - /* do utf8 conversion */ - w_len = MultiByteToWideChar(CP_UTF8, 0, hostname, -1, namebuf, w_len); - if((w_len > 0) && (w_len < MAX_NAME_LEN)) { - swprintf(portbuf, MAX_PORT_LEN, L"%d", port); - td->tsd.w8.hints.ai_family = hints->ai_family; - td->tsd.w8.hints.ai_socktype = hints->ai_socktype; - td->complete_ev = CreateEvent(NULL, TRUE, FALSE, NULL); - if(!td->complete_ev) { - /* failed to start, mark it as done here for proper cleanup. */ - td->tsd.done = 1; - goto err_exit; - } - err = Curl_GetAddrInfoExW(namebuf, portbuf, NS_DNS, - NULL, &td->tsd.w8.hints, &td->tsd.w8.res, - NULL, &td->tsd.w8.overlapped, - &query_complete, &td->tsd.w8.cancel_ev); - if(err != WSA_IO_PENDING) - query_complete(err, 0, &td->tsd.w8.overlapped); - return TRUE; - } - } - } -#endif - #ifdef HAVE_GETADDRINFO td->thread_hnd = Curl_thread_create(getaddrinfo_thread, &td->tsd); #else td->thread_hnd = Curl_thread_create(gethostbyname_thread, &td->tsd); #endif - if(!td->thread_hnd) { + if(td->thread_hnd == curl_thread_t_null) { /* The thread never started, so mark it as done here for proper cleanup. */ td->tsd.done = 1; err = errno; @@ -702,22 +511,9 @@ static CURLcode thread_wait_resolv(struct Curl_easy *data, DEBUGASSERT(data); td = data->state.async.tdata; DEBUGASSERT(td); -#ifdef _WIN32 - DEBUGASSERT(td->complete_ev || td->thread_hnd != curl_thread_t_null); -#else DEBUGASSERT(td->thread_hnd != curl_thread_t_null); -#endif /* wait for the thread to resolve the name */ -#ifdef _WIN32 - if(td->complete_ev) { - WaitForSingleObject(td->complete_ev, INFINITE); - CloseHandle(td->complete_ev); - if(entry) - result = getaddrinfo_complete(data); - } - else -#endif if(Curl_thread_join(&td->thread_hnd)) { if(entry) result = getaddrinfo_complete(data); @@ -751,8 +547,8 @@ void Curl_resolver_kill(struct Curl_easy *data) { struct thread_data *td = data->state.async.tdata; - /* If we're still resolving, we must wait for the threads to fully clean up, - unfortunately. Otherwise, we can simply cancel to clean up any resolver + /* If we are still resolving, we must wait for the threads to fully clean up, + unfortunately. Otherwise, we can simply cancel to clean up any resolver data. */ if(td && td->thread_hnd != curl_thread_t_null && (data->set.quick_exit != 1L)) @@ -816,7 +612,7 @@ CURLcode Curl_resolver_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 */ + /* should be fine even if this converts to 32-bit */ timediff_t elapsed = Curl_timediff(Curl_now(), data->progress.t_startsingle); if(elapsed < 0) @@ -932,7 +728,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data, memset(&hints, 0, sizeof(hints)); hints.ai_family = pf; - hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)? + hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP) ? SOCK_STREAM : SOCK_DGRAM; reslv->start = Curl_now(); diff --git a/deps/curl/lib/asyn.h b/deps/curl/lib/asyn.h index 7e207c4f..0ff20488 100644 --- a/deps/curl/lib/asyn.h +++ b/deps/curl/lib/asyn.h @@ -58,7 +58,7 @@ void Curl_resolver_global_cleanup(void); * Curl_resolver_init() * Called from curl_easy_init() -> Curl_open() to initialize resolver * URL-state specific environment ('resolver' member of the UrlState - * structure). Should fill the passed pointer by the initialized handler. + * structure). Should fill the passed pointer by the initialized handler. * Returning anything else than CURLE_OK fails curl_easy_init() with the * correspondent code. */ @@ -68,7 +68,7 @@ CURLcode Curl_resolver_init(struct Curl_easy *easy, void **resolver); * Curl_resolver_cleanup() * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver * URL-state specific environment ('resolver' member of the UrlState - * structure). Should destroy the handler and free all resources connected to + * structure). Should destroy the handler and free all resources connected to * it. */ void Curl_resolver_cleanup(void *resolver); @@ -76,9 +76,9 @@ void Curl_resolver_cleanup(void *resolver); /* * Curl_resolver_duphandle() * Called from curl_easy_duphandle() to duplicate resolver URL-state specific - * environment ('resolver' member of the UrlState structure). Should + * environment ('resolver' member of the UrlState structure). Should * duplicate the 'from' handle and pass the resulting handle to the 'to' - * pointer. Returning anything else than CURLE_OK causes failed + * pointer. Returning anything else than CURLE_OK causes failed * curl_easy_duphandle() call. */ CURLcode Curl_resolver_duphandle(struct Curl_easy *easy, void **to, @@ -89,7 +89,7 @@ CURLcode Curl_resolver_duphandle(struct Curl_easy *easy, void **to, * * It is called from inside other functions to cancel currently performing * resolver request. Should also free any temporary resources allocated to - * perform a request. This never waits for resolver threads to complete. + * perform a request. This never waits for resolver threads to complete. * * It is safe to call this when conn is in any state. */ @@ -99,8 +99,8 @@ void Curl_resolver_cancel(struct Curl_easy *data); * Curl_resolver_kill(). * * This acts like Curl_resolver_cancel() except it will block until any threads - * associated with the resolver are complete. This never blocks for resolvers - * that do not use threads. This is intended to be the "last chance" function + * associated with the resolver are complete. This never blocks for resolvers + * that do not use threads. This is intended to be the "last chance" function * that cleans up an in-progress resolver completely (before its owner is about * to die). * @@ -161,7 +161,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data, int *waitp); #ifndef CURLRES_ASYNCH -/* convert these functions if an asynch resolver isn't used */ +/* convert these functions if an asynch resolver is not used */ #define Curl_resolver_cancel(x) Curl_nop_stmt #define Curl_resolver_kill(x) Curl_nop_stmt #define Curl_resolver_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST diff --git a/deps/curl/lib/base64.c b/deps/curl/lib/base64.c index 919eb623..8373115d 100644 --- a/deps/curl/lib/base64.c +++ b/deps/curl/lib/base64.c @@ -243,7 +243,7 @@ static CURLcode base64_encode(const char *table64, *outptr = base64data; /* Return the length of the new data */ - *outlen = output - base64data; + *outlen = (size_t)(output - base64data); return CURLE_OK; } diff --git a/deps/curl/lib/bufq.c b/deps/curl/lib/bufq.c index c3245516..547d4d37 100644 --- a/deps/curl/lib/bufq.c +++ b/deps/curl/lib/bufq.c @@ -91,6 +91,23 @@ static size_t chunk_read(struct buf_chunk *chunk, } } +static size_t chunk_unwrite(struct buf_chunk *chunk, size_t len) +{ + size_t n = chunk->w_offset - chunk->r_offset; + DEBUGASSERT(chunk->w_offset >= chunk->r_offset); + if(!n) { + return 0; + } + else if(n <= len) { + chunk->r_offset = chunk->w_offset = 0; + return n; + } + else { + chunk->w_offset -= len; + return len; + } +} + static ssize_t chunk_slurpn(struct buf_chunk *chunk, size_t max_len, Curl_bufq_reader *reader, void *reader_ctx, CURLcode *err) @@ -363,6 +380,49 @@ static void prune_head(struct bufq *q) } } +static struct buf_chunk *chunk_prev(struct buf_chunk *head, + struct buf_chunk *chunk) +{ + while(head) { + if(head == chunk) + return NULL; + if(head->next == chunk) + return head; + head = head->next; + } + return NULL; +} + +static void prune_tail(struct bufq *q) +{ + struct buf_chunk *chunk; + + while(q->tail && chunk_is_empty(q->tail)) { + chunk = q->tail; + q->tail = chunk_prev(q->head, chunk); + if(q->tail) + q->tail->next = NULL; + if(q->head == chunk) + q->head = q->tail; + if(q->pool) { + bufcp_put(q->pool, chunk); + --q->chunk_count; + } + else if((q->chunk_count > q->max_chunks) || + (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. */ + free(chunk); + --q->chunk_count; + } + else { + chunk->next = q->spare; + q->spare = chunk; + } + } +} + static struct buf_chunk *get_non_full_tail(struct bufq *q) { struct buf_chunk *chunk; @@ -424,10 +484,19 @@ CURLcode Curl_bufq_cwrite(struct bufq *q, ssize_t n; CURLcode result; n = Curl_bufq_write(q, (const unsigned char *)buf, len, &result); - *pnwritten = (n < 0)? 0 : (size_t)n; + *pnwritten = (n < 0) ? 0 : (size_t)n; return result; } +CURLcode Curl_bufq_unwrite(struct bufq *q, size_t len) +{ + while(len && q->tail) { + len -= chunk_unwrite(q->tail, len); + prune_tail(q); + } + return len ? CURLE_AGAIN : CURLE_OK; +} + ssize_t Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len, CURLcode *err) { @@ -457,7 +526,7 @@ CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len, ssize_t n; CURLcode result; n = Curl_bufq_read(q, (unsigned char *)buf, len, &result); - *pnread = (n < 0)? 0 : (size_t)n; + *pnread = (n < 0) ? 0 : (size_t)n; return result; } diff --git a/deps/curl/lib/bufq.h b/deps/curl/lib/bufq.h index 027a2b6b..ec415648 100644 --- a/deps/curl/lib/bufq.h +++ b/deps/curl/lib/bufq.h @@ -85,7 +85,7 @@ void Curl_bufcp_free(struct bufc_pool *pool); * preferably never fail (except for memory exhaustion). * * By default and without a pool, a bufq will keep chunks that read - * read empty in its `spare` list. Option `BUFQ_OPT_NO_SPARES` will + * empty in its `spare` list. Option `BUFQ_OPT_NO_SPARES` will * disable that and free chunks once they become empty. * * When providing a pool to a bufq, all chunk creation and spare handling @@ -182,6 +182,12 @@ CURLcode Curl_bufq_cwrite(struct bufq *q, const char *buf, size_t len, size_t *pnwritten); +/** + * Remove `len` bytes from the end of the buffer queue again. + * Returns CURLE_AGAIN if less than `len` bytes were in the queue. + */ +CURLcode Curl_bufq_unwrite(struct bufq *q, size_t len); + /** * Read buf from the start of the buffer queue. The buf is copied * and the amount of copied bytes is returned. diff --git a/deps/curl/lib/bufref.c b/deps/curl/lib/bufref.c index f0a0e2a7..f048b570 100644 --- a/deps/curl/lib/bufref.c +++ b/deps/curl/lib/bufref.c @@ -48,7 +48,7 @@ void Curl_bufref_init(struct bufref *br) } /* - * Free the buffer and re-init the necessary fields. It doesn't touch the + * Free the buffer and re-init the necessary fields. It does not touch the * 'signature' field and thus this buffer reference can be reused. */ diff --git a/deps/curl/lib/c-hyper.c b/deps/curl/lib/c-hyper.c index 41d75817..2b8eb957 100644 --- a/deps/curl/lib/c-hyper.c +++ b/deps/curl/lib/c-hyper.c @@ -119,7 +119,7 @@ size_t Curl_hyper_send(void *userp, hyper_context *ctx, DEBUGF(infof(data, "Curl_hyper_send(%zu)", buflen)); result = Curl_conn_send(data, io_ctx->sockindex, - (void *)buf, buflen, &nwrote); + (void *)buf, buflen, FALSE, &nwrote); if(result == CURLE_AGAIN) { DEBUGF(infof(data, "Curl_hyper_send(%zu) -> EAGAIN", buflen)); /* would block, register interest */ @@ -171,7 +171,7 @@ static int hyper_each_header(void *userdata, len = Curl_dyn_len(&data->state.headerb); headp = Curl_dyn_ptr(&data->state.headerb); - result = Curl_http_header(data, data->conn, headp); + result = Curl_http_header(data, headp, len); if(result) { data->state.hresult = result; return HYPER_ITER_BREAK; @@ -206,8 +206,7 @@ static int hyper_body_chunk(void *userdata, const hyper_buf *chunk) struct SingleRequest *k = &data->req; CURLcode result = CURLE_OK; - if(0 == k->bodywrites) { - bool done = FALSE; + if(!k->bodywritten) { #if defined(USE_NTLM) struct connectdata *conn = data->conn; if(conn->bits.close && @@ -220,27 +219,26 @@ static int hyper_body_chunk(void *userdata, const hyper_buf *chunk) Curl_safefree(data->req.newurl); } #endif - if(data->state.expect100header) { - Curl_expire_done(data, EXPIRE_100_TIMEOUT); + if(Curl_http_exp100_is_selected(data)) { if(data->req.httpcode < 400) { - k->exp100 = EXP100_SEND_DATA; - if(data->hyp.exp100_waker) { - hyper_waker_wake(data->hyp.exp100_waker); - data->hyp.exp100_waker = NULL; + Curl_http_exp100_got100(data); + if(data->hyp.send_body_waker) { + hyper_waker_wake(data->hyp.send_body_waker); + data->hyp.send_body_waker = NULL; } } else { /* >= 4xx */ - k->exp100 = EXP100_FAILED; + Curl_req_abort_sending(data); } } if(data->state.hconnect && (data->req.httpcode/100 != 2) && data->state.authproxy.done) { - done = TRUE; + data->req.done = TRUE; result = CURLE_OK; } else - result = Curl_http_firstwrite(data, data->conn, &done); - if(result || done) { + result = Curl_http_firstwrite(data); + if(result || data->req.done) { infof(data, "Return early from hyper_body_chunk"); data->state.hresult = result; return HYPER_ITER_BREAK; @@ -276,14 +274,13 @@ static CURLcode status_line(struct Curl_easy *data, /* We need to set 'httpcodeq' for functions that check the response code in a single place. */ data->req.httpcode = http_status; - + data->req.httpversion = http_version == HYPER_HTTP_VERSION_1_1 ? 11 : + (http_version == HYPER_HTTP_VERSION_2 ? 20 : 10); if(data->state.hconnect) /* CONNECT */ data->info.httpproxycode = http_status; else { - conn->httpversion = - http_version == HYPER_HTTP_VERSION_1_1 ? 11 : - (http_version == HYPER_HTTP_VERSION_2 ? 20 : 10); + conn->httpversion = (unsigned char)data->req.httpversion; if(http_version == HYPER_HTTP_VERSION_1_0) data->state.httpwant = CURL_HTTP_VERSION_1_0; @@ -327,7 +324,7 @@ static CURLcode empty_header(struct Curl_easy *data) result = hyper_each_header(data, NULL, 0, NULL, 0) ? CURLE_WRITE_ERROR : CURLE_OK; if(result) - failf(data, "hyperstream: couldn't pass blank header"); + failf(data, "hyperstream: could not pass blank header"); /* Hyper does chunked decoding itself. If it was added during * response header processing, remove it again. */ Curl_cwriter_remove_by_name(data, "chunked"); @@ -338,7 +335,6 @@ static CURLcode empty_header(struct Curl_easy *data) CURLcode Curl_hyper_stream(struct Curl_easy *data, struct connectdata *conn, int *didwhat, - bool *done, int select_res) { hyper_response *resp = NULL; @@ -355,20 +351,11 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data, struct SingleRequest *k = &data->req; (void)conn; - if(k->exp100 > EXP100_SEND_DATA) { - struct curltime now = Curl_now(); - timediff_t ms = Curl_timediff(now, k->start100); - if(ms >= data->set.expect_100_timeout) { - /* we've waited long enough, continue anyway */ - k->exp100 = EXP100_SEND_DATA; - k->keepon |= KEEP_SEND; - Curl_expire_done(data, EXPIRE_100_TIMEOUT); - infof(data, "Done waiting for 100-continue after %ldms", (long)ms); - if(data->hyp.exp100_waker) { - hyper_waker_wake(data->hyp.exp100_waker); - data->hyp.exp100_waker = NULL; - } - } + if(data->hyp.send_body_waker) { + /* If there is still something to upload, wake it to give it + * another try. */ + hyper_waker_wake(data->hyp.send_body_waker); + data->hyp.send_body_waker = NULL; } if(select_res & CURL_CSELECT_IN) { @@ -382,8 +369,7 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data, h->write_waker = NULL; } - *done = FALSE; - do { + while(1) { hyper_task_return_type t; task = hyper_executor_poll(h->exec); if(!task) { @@ -407,141 +393,152 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data, switch(code) { case HYPERE_ABORTED_BY_CALLBACK: result = CURLE_OK; - break; + goto out; case HYPERE_UNEXPECTED_EOF: if(!data->req.bytecount) result = CURLE_GOT_NOTHING; else result = CURLE_RECV_ERROR; - break; + goto out; case HYPERE_INVALID_PEER_MESSAGE: /* bump headerbytecount to avoid the count remaining at zero and appearing to not having read anything from the peer at all */ data->req.headerbytecount++; result = CURLE_UNSUPPORTED_PROTOCOL; /* maybe */ - break; + goto out; default: result = CURLE_RECV_ERROR; - break; + goto out; } } - *done = TRUE; + data->req.done = TRUE; hyper_error_free(hypererr); break; } else if(t == HYPER_TASK_EMPTY) { void *userdata = hyper_task_userdata(task); hyper_task_free(task); - if((userdata_t)userdata == USERDATA_RESP_BODY) { + if(userdata == (void *)USERDATA_RESP_BODY) { /* end of transfer */ - *done = TRUE; + data->req.done = TRUE; infof(data, "hyperstream is done"); - if(!k->bodywrites) { - /* hyper doesn't always call the body write callback */ - bool stilldone; - result = Curl_http_firstwrite(data, data->conn, &stilldone); + if(!k->bodywritten) { + /* hyper does not always call the body write callback */ + result = Curl_http_firstwrite(data); } break; } else { /* A background task for hyper; ignore */ + DEBUGF(infof(data, "hyper: some background task done")); continue; } } + else if(t == HYPER_TASK_RESPONSE) { + resp = hyper_task_value(task); + hyper_task_free(task); - DEBUGASSERT(HYPER_TASK_RESPONSE); - - resp = hyper_task_value(task); - hyper_task_free(task); - - *didwhat = KEEP_RECV; - if(!resp) { - failf(data, "hyperstream: couldn't get response"); - return CURLE_RECV_ERROR; - } - - http_status = hyper_response_status(resp); - http_version = hyper_response_version(resp); - reasonp = hyper_response_reason_phrase(resp); - reason_len = hyper_response_reason_phrase_len(resp); - - if(http_status == 417 && data->state.expect100header) { - infof(data, "Got 417 while waiting for a 100"); - data->state.disableexpect = TRUE; - data->req.newurl = strdup(data->state.url); - Curl_req_abort_sending(data); - } - - result = status_line(data, conn, - http_status, http_version, reasonp, reason_len); - if(result) - break; - - headers = hyper_response_headers(resp); - if(!headers) { - failf(data, "hyperstream: couldn't get response headers"); - result = CURLE_RECV_ERROR; - break; - } - - /* the headers are already received */ - hyper_headers_foreach(headers, hyper_each_header, data); - if(data->state.hresult) { - result = data->state.hresult; - break; - } - - result = empty_header(data); - if(result) - break; - - k->deductheadercount = - (100 <= http_status && 199 >= http_status)?k->headerbytecount:0; -#ifdef USE_WEBSOCKETS - if(k->upgr101 == UPGR101_WS) { - if(http_status == 101) { - /* verify the response */ - result = Curl_ws_accept(data, NULL, 0); - if(result) - return result; + *didwhat = KEEP_RECV; + if(!resp) { + failf(data, "hyperstream: could not get response"); + result = CURLE_RECV_ERROR; + goto out; } - else { - failf(data, "Expected 101, got %u", k->httpcode); - result = CURLE_HTTP_RETURNED_ERROR; - break; + + http_status = hyper_response_status(resp); + http_version = hyper_response_version(resp); + reasonp = hyper_response_reason_phrase(resp); + reason_len = hyper_response_reason_phrase_len(resp); + + if(http_status == 417 && Curl_http_exp100_is_selected(data)) { + infof(data, "Got 417 while waiting for a 100"); + data->state.disableexpect = TRUE; + data->req.newurl = strdup(data->state.url); + Curl_req_abort_sending(data); + } + + result = status_line(data, conn, + http_status, http_version, reasonp, reason_len); + if(result) + goto out; + + headers = hyper_response_headers(resp); + if(!headers) { + failf(data, "hyperstream: could not get response headers"); + result = CURLE_RECV_ERROR; + goto out; + } + + /* the headers are already received */ + hyper_headers_foreach(headers, hyper_each_header, data); + if(data->state.hresult) { + result = data->state.hresult; + goto out; + } + + result = empty_header(data); + if(result) + goto out; + + k->deductheadercount = + (100 <= http_status && 199 >= http_status) ? k->headerbytecount : 0; +#ifndef CURL_DISABLE_WEBSOCKETS + if(k->upgr101 == UPGR101_WS) { + if(http_status == 101) { + /* verify the response */ + result = Curl_ws_accept(data, NULL, 0); + if(result) + goto out; + } + else { + failf(data, "Expected 101, got %u", k->httpcode); + result = CURLE_HTTP_RETURNED_ERROR; + goto out; + } } - } #endif - /* Curl_http_auth_act() checks what authentication methods that are - * available and decides which one (if any) to use. It will set 'newurl' - * if an auth method was picked. */ - result = Curl_http_auth_act(data); - if(result) - break; + /* Curl_http_auth_act() checks what authentication methods that are + * available and decides which one (if any) to use. It will set 'newurl' + * if an auth method was picked. */ + result = Curl_http_auth_act(data); + if(result) + goto out; - resp_body = hyper_response_body(resp); - if(!resp_body) { - failf(data, "hyperstream: couldn't get response body"); - result = CURLE_RECV_ERROR; - break; - } - foreach = hyper_body_foreach(resp_body, hyper_body_chunk, data); - if(!foreach) { - failf(data, "hyperstream: body foreach failed"); - result = CURLE_OUT_OF_MEMORY; - break; - } - hyper_task_set_userdata(foreach, (void *)USERDATA_RESP_BODY); - if(HYPERE_OK != hyper_executor_push(h->exec, foreach)) { - failf(data, "Couldn't hyper_executor_push the body-foreach"); - result = CURLE_OUT_OF_MEMORY; - break; - } + resp_body = hyper_response_body(resp); + if(!resp_body) { + failf(data, "hyperstream: could not get response body"); + result = CURLE_RECV_ERROR; + goto out; + } + foreach = hyper_body_foreach(resp_body, hyper_body_chunk, data); + if(!foreach) { + failf(data, "hyperstream: body foreach failed"); + result = CURLE_OUT_OF_MEMORY; + goto out; + } + hyper_task_set_userdata(foreach, (void *)USERDATA_RESP_BODY); + if(HYPERE_OK != hyper_executor_push(h->exec, foreach)) { + failf(data, "Couldn't hyper_executor_push the body-foreach"); + result = CURLE_OUT_OF_MEMORY; + goto out; + } - hyper_response_free(resp); - resp = NULL; - } while(1); + hyper_response_free(resp); + resp = NULL; + } + else { + DEBUGF(infof(data, "hyper: unhandled tasktype %x", t)); + } + } /* while(1) */ + + if(!result && Curl_xfer_needs_flush(data)) { + DEBUGF(infof(data, "Curl_hyper_stream(), connection needs flush")); + result = Curl_xfer_flush(data); + } + +out: + DEBUGF(infof(data, "Curl_hyper_stream() -> %d", result)); if(resp) hyper_response_free(resp); return result; @@ -669,17 +666,6 @@ static int uploadstreamed(void *userdata, hyper_context *ctx, int rc = HYPER_POLL_ERROR; (void)ctx; - if(data->req.exp100 > EXP100_SEND_DATA) { - if(data->req.exp100 == EXP100_FAILED) - return HYPER_POLL_ERROR; - - /* still waiting confirmation */ - if(data->hyp.exp100_waker) - hyper_waker_free(data->hyp.exp100_waker); - data->hyp.exp100_waker = hyper_context_waker(ctx); - return HYPER_POLL_PENDING; - } - result = Curl_multi_xfer_ulbuf_borrow(data, &xfer_ulbuf, &xfer_ulblen); if(result) goto out; @@ -697,12 +683,15 @@ static int uploadstreamed(void *userdata, hyper_context *ctx, goto out; } /* increasing the writebytecount here is a little premature but we - don't know exactly when the body is sent */ + do not know exactly when the body is sent */ data->req.writebytecount += fillcount; + if(eos) + data->req.eos_read = TRUE; Curl_pgrsSetUploadCounter(data, data->req.writebytecount); rc = HYPER_POLL_READY; } else if(eos) { + data->req.eos_read = TRUE; *chunk = NULL; rc = HYPER_POLL_READY; } @@ -714,9 +703,15 @@ static int uploadstreamed(void *userdata, hyper_context *ctx, rc = HYPER_POLL_PENDING; } + if(!data->req.upload_done && data->req.eos_read) { + DEBUGF(infof(data, "hyper: uploadstreamed(), upload is done")); + result = Curl_req_set_upload_done(data); + } + out: Curl_multi_xfer_ulbuf_release(data, xfer_ulbuf); data->state.hresult = result; + DEBUGF(infof(data, "hyper: uploadstreamed() -> %d", result)); return rc; } @@ -730,8 +725,9 @@ static CURLcode finalize_request(struct Curl_easy *data, { CURLcode result = CURLE_OK; struct dynbuf req; - if((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) + if((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) { Curl_pgrsSetUploadSize(data, 0); /* no request body */ + } else { hyper_body *body; Curl_dyn_init(&req, DYN_HTTP_REQUEST); @@ -800,7 +796,7 @@ static void http1xx_cb(void *arg, struct hyper_response *resp) if(!result) { headers = hyper_response_headers(resp); if(!headers) { - failf(data, "hyperstream: couldn't get 1xx response headers"); + failf(data, "hyperstream: could not get 1xx response headers"); result = CURLE_RECV_ERROR; } } @@ -849,21 +845,21 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) *done = TRUE; result = Curl_client_start(data); if(result) - return result; + goto out; /* Add collecting of headers written to client. For a new connection, * we might have done that already, but reuse * or multiplex needs it here as well. */ result = Curl_headers_init(data); if(result) - return result; + goto out; infof(data, "Time for the Hyper dance"); memset(h, 0, sizeof(struct hyptransfer)); result = Curl_http_host(data, conn); if(result) - return result; + goto out; Curl_http_method(data, conn, &method, &httpreq); @@ -874,33 +870,35 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) char *pq = NULL; if(data->state.up.query) { pq = aprintf("%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, conn, method, httpreq, (pq ? pq : data->state.up.path), FALSE); free(pq); if(result) - return result; + goto out; } result = Curl_http_req_set_reader(data, httpreq, &te); if(result) - goto error; + goto out; result = Curl_http_range(data, httpreq); if(result) - return result; + goto out; result = Curl_http_useragent(data); if(result) - return result; + goto out; io = hyper_io_new(); if(!io) { failf(data, "Couldn't create hyper IO"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } /* tell Hyper how to read/write network data */ h->io_ctx.data = data; @@ -915,7 +913,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!h->exec) { failf(data, "Couldn't create hyper executor"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } } @@ -923,12 +921,12 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!options) { failf(data, "Couldn't create hyper client options"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } if(conn->alpn == CURL_HTTP_VERSION_2) { failf(data, "ALPN protocol h2 not supported with Hyper"); result = CURLE_UNSUPPORTED_PROTOCOL; - goto error; + goto out; } hyper_clientconn_options_set_preserve_header_case(options, 1); hyper_clientconn_options_set_preserve_header_order(options, 1); @@ -941,7 +939,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!handshake) { failf(data, "Couldn't create hyper client handshake"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } io = NULL; options = NULL; @@ -949,7 +947,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(HYPERE_OK != hyper_executor_push(h->exec, handshake)) { failf(data, "Couldn't hyper_executor_push the handshake"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } handshake = NULL; /* ownership passed on */ @@ -957,7 +955,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!task) { failf(data, "Couldn't hyper_executor_poll the handshake"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } client = hyper_task_value(task); @@ -967,7 +965,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!req) { failf(data, "Couldn't hyper_request_new"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } if(!Curl_use_http_1_1plus(data, conn)) { @@ -975,60 +973,57 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) HYPER_HTTP_VERSION_1_0)) { failf(data, "error setting HTTP version"); result = CURLE_OUT_OF_MEMORY; - goto error; - } - } - else { - if(!data->state.disableexpect) { - data->state.expect100header = TRUE; + goto out; } } if(hyper_request_set_method(req, (uint8_t *)method, strlen(method))) { failf(data, "error setting method"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } result = request_target(data, conn, method, req); if(result) - goto error; + goto out; headers = hyper_request_headers(req); if(!headers) { failf(data, "hyper_request_headers"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } rc = hyper_request_on_informational(req, http1xx_cb, data); if(rc) { result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } if(data->state.aptr.host) { result = Curl_hyper_header(data, headers, data->state.aptr.host); if(result) - goto error; + goto out; } +#ifndef CURL_DISABLE_PROXY if(data->state.aptr.proxyuserpwd) { result = Curl_hyper_header(data, headers, data->state.aptr.proxyuserpwd); if(result) - goto error; + goto out; } +#endif if(data->state.aptr.userpwd) { result = Curl_hyper_header(data, headers, data->state.aptr.userpwd); if(result) - goto error; + goto out; } if((data->state.use_range && data->state.aptr.rangeline)) { result = Curl_hyper_header(data, headers, data->state.aptr.rangeline); if(result) - goto error; + goto out; } if(data->set.str[STRING_USERAGENT] && @@ -1036,20 +1031,20 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) data->state.aptr.uagent) { result = Curl_hyper_header(data, headers, data->state.aptr.uagent); if(result) - goto error; + goto out; } p_accept = Curl_checkheaders(data, - STRCONST("Accept"))?NULL:"Accept: */*\r\n"; + STRCONST("Accept")) ? NULL : "Accept: */*\r\n"; if(p_accept) { result = Curl_hyper_header(data, headers, p_accept); if(result) - goto error; + goto out; } if(te) { result = Curl_hyper_header(data, headers, te); if(result) - goto error; + goto out; } #ifndef CURL_DISABLE_ALTSVC @@ -1058,11 +1053,11 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) conn->conn_to_host.name, conn->conn_to_port); if(!altused) { result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } result = Curl_hyper_header(data, headers, altused); if(result) - goto error; + goto out; free(altused); } #endif @@ -1073,7 +1068,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) !Curl_checkProxyheaders(data, conn, STRCONST("Proxy-Connection"))) { result = Curl_hyper_header(data, headers, "Proxy-Connection: Keep-Alive"); if(result) - goto error; + goto out; } #endif @@ -1085,17 +1080,17 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) else result = Curl_hyper_header(data, headers, data->state.aptr.ref); if(result) - goto error; + goto out; } #ifdef HAVE_LIBZ /* we only consider transfer-encoding magic if libz support is built-in */ result = Curl_transferencode(data); if(result) - goto error; + goto out; result = Curl_hyper_header(data, headers, data->state.aptr.te); if(result) - goto error; + goto out; #endif if(!Curl_checkheaders(data, STRCONST("Accept-Encoding")) && @@ -1109,29 +1104,29 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) result = Curl_hyper_header(data, headers, data->state.aptr.accept_encoding); if(result) - goto error; + goto out; } else Curl_safefree(data->state.aptr.accept_encoding); result = cookies(data, conn, headers); if(result) - goto error; + goto out; if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS)) result = Curl_ws_request(data, headers); result = Curl_add_timecondition(data, headers); if(result) - goto error; + goto out; result = Curl_add_custom_headers(data, FALSE, headers); if(result) - goto error; + goto out; result = finalize_request(data, headers, req, httpreq); if(result) - goto error; + goto out; Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"\r\n", 2); @@ -1145,14 +1140,14 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!sendtask) { failf(data, "hyper_clientconn_send"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } req = NULL; if(HYPERE_OK != hyper_executor_push(h->exec, sendtask)) { failf(data, "Couldn't hyper_executor_push the send"); result = CURLE_OUT_OF_MEMORY; - goto error; + goto out; } sendtask = NULL; /* ownership passed on */ @@ -1162,36 +1157,34 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) { /* HTTP GET/HEAD download */ Curl_pgrsSetUploadSize(data, 0); /* nothing */ - Curl_xfer_setup(data, FIRSTSOCKET, -1, TRUE, -1); + result = Curl_req_set_upload_done(data); + if(result) + goto out; } + + Curl_xfer_setup1(data, CURL_XFER_SENDRECV, -1, TRUE); conn->datastream = Curl_hyper_stream; - if(data->state.expect100header) - /* Timeout count starts now since with Hyper we don't know exactly when - the full request has been sent. */ - data->req.start100 = Curl_now(); /* clear userpwd and proxyuserpwd to avoid reusing old credentials * from reused connections */ Curl_safefree(data->state.aptr.userpwd); +#ifndef CURL_DISABLE_PROXY Curl_safefree(data->state.aptr.proxyuserpwd); - return CURLE_OK; -error: - DEBUGASSERT(result); - if(io) - hyper_io_free(io); - - if(options) - hyper_clientconn_options_free(options); - - if(handshake) - hyper_task_free(handshake); - - if(client) - hyper_clientconn_free(client); - - if(req) - hyper_request_free(req); +#endif +out: + if(result) { + if(io) + hyper_io_free(io); + if(options) + hyper_clientconn_options_free(options); + if(handshake) + hyper_task_free(handshake); + if(client) + hyper_clientconn_free(client); + if(req) + hyper_request_free(req); + } return result; } @@ -1210,10 +1203,6 @@ void Curl_hyper_done(struct Curl_easy *data) hyper_waker_free(h->write_waker); h->write_waker = NULL; } - if(h->exp100_waker) { - hyper_waker_free(h->exp100_waker); - h->exp100_waker = NULL; - } if(h->send_body_waker) { hyper_waker_free(h->send_body_waker); h->send_body_waker = NULL; @@ -1242,6 +1231,8 @@ static const struct Curl_crtype cr_hyper_protocol = { Curl_creader_def_resume_from, Curl_creader_def_rewind, cr_hyper_unpause, + Curl_creader_def_is_paused, + Curl_creader_def_done, sizeof(struct Curl_creader) }; diff --git a/deps/curl/lib/c-hyper.h b/deps/curl/lib/c-hyper.h index 4a072330..89dd53b8 100644 --- a/deps/curl/lib/c-hyper.h +++ b/deps/curl/lib/c-hyper.h @@ -39,7 +39,6 @@ struct hyptransfer { hyper_waker *write_waker; hyper_waker *read_waker; const hyper_executor *exec; - hyper_waker *exp100_waker; hyper_waker *send_body_waker; struct hyp_io_ctx io_ctx; }; @@ -51,7 +50,6 @@ size_t Curl_hyper_send(void *userp, hyper_context *ctx, CURLcode Curl_hyper_stream(struct Curl_easy *data, struct connectdata *conn, int *didwhat, - bool *done, int select_res); CURLcode Curl_hyper_header(struct Curl_easy *data, hyper_headers *headers, diff --git a/deps/curl/lib/cf-h1-proxy.c b/deps/curl/lib/cf-h1-proxy.c index deb94580..6b7f9831 100644 --- a/deps/curl/lib/cf-h1-proxy.c +++ b/deps/curl/lib/cf-h1-proxy.c @@ -65,7 +65,6 @@ typedef enum { /* struct for HTTP CONNECT tunneling */ struct h1_tunnel_state { - struct HTTP CONNECT; struct dynbuf rcvbuf; struct dynbuf request_data; size_t nsent; @@ -182,8 +181,8 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf, data->info.httpcode = 0; /* clear it as it might've been used for the proxy */ /* If a proxy-authorization header was used for the proxy, then we should - make sure that it isn't accidentally used for the document request - after we've connected. So let's free and clear it here. */ + make sure that it is not accidentally used for the document request + after we have connected. So let's free and clear it here. */ Curl_safefree(data->state.aptr.proxyuserpwd); #ifdef USE_HYPER data->state.hconnect = FALSE; @@ -195,14 +194,16 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf, static void tunnel_free(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct h1_tunnel_state *ts = cf->ctx; - if(ts) { - h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data); - Curl_dyn_free(&ts->rcvbuf); - Curl_dyn_free(&ts->request_data); - Curl_httpchunk_free(data, &ts->ch); - free(ts); - cf->ctx = NULL; + if(cf) { + struct h1_tunnel_state *ts = cf->ctx; + if(ts) { + h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data); + Curl_dyn_free(&ts->rcvbuf); + Curl_dyn_free(&ts->request_data); + Curl_httpchunk_free(data, &ts->ch); + free(ts); + cf->ctx = NULL; + } } } @@ -220,8 +221,8 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, int http_minor; CURLcode result; - /* This only happens if we've looped here due to authentication - reasons, and we don't really use the newly cloned URL here + /* 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); @@ -237,6 +238,8 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, http_minor = (cf->conn->http_proxy.proxytype == CURLPROXY_HTTP_1_0) ? 0 : 1; result = Curl_h1_req_write_head(req, http_minor, &ts->request_data); + if(!result) + result = Curl_creader_set_null(data); out: if(result) @@ -263,7 +266,7 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf, blen -= ts->nsent; buf += ts->nsent; - nwritten = cf->next->cft->do_send(cf->next, data, buf, blen, &result); + nwritten = cf->next->cft->do_send(cf->next, data, buf, blen, FALSE, &result); if(nwritten < 0) { if(result == CURLE_AGAIN) { result = CURLE_OK; @@ -296,7 +299,7 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, (checkprefix("Proxy-authenticate:", header) && (407 == k->httpcode))) { - bool proxy = (k->httpcode == 407) ? TRUE : FALSE; + bool proxy = (k->httpcode == 407); char *auth = Curl_copy_header_value(header); if(!auth) return CURLE_OUT_OF_MEMORY; @@ -418,7 +421,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, if(ts->cl) { /* A Content-Length based body: simply count down the counter - and make sure to break out of the loop when we're done! */ + and make sure to break out of the loop when we are done! */ ts->cl--; if(ts->cl <= 0) { ts->keepon = KEEPON_DONE; @@ -436,7 +439,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, if(result) return result; if(Curl_httpchunk_is_done(data, &ts->ch)) { - /* we're done reading chunks! */ + /* we are done reading chunks! */ infof(data, "chunk reading DONE"); ts->keepon = KEEPON_DONE; } @@ -471,7 +474,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, if(result) return result; - /* Newlines are CRLF, so the CR is ignored as the line isn't + /* Newlines are CRLF, so the CR is ignored as the line is not really terminated until the LF comes. Treat a following CR as end-of-headers as well.*/ @@ -486,15 +489,14 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, ts->keepon = KEEPON_IGNORE; if(ts->cl) { - infof(data, "Ignore %" CURL_FORMAT_CURL_OFF_T - " bytes of response-body", ts->cl); + infof(data, "Ignore %" FMT_OFF_T " bytes of response-body", ts->cl); } else if(ts->chunked_encoding) { infof(data, "Ignore chunked response-body"); } else { /* without content-length or chunked encoding, we - can't keep the connection alive since the close is + cannot keep the connection alive since the close is the end signal so we bail out at once instead */ CURL_TRC_CF(data, cf, "CONNECT: no content-length or chunked"); ts->keepon = KEEPON_DONE; @@ -514,7 +516,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, return result; Curl_dyn_reset(&ts->rcvbuf); - } /* while there's buffer left and loop is requested */ + } /* while there is buffer left and loop is requested */ if(error) result = CURLE_RECV_ERROR; @@ -545,8 +547,8 @@ static CURLcode CONNECT_host(struct Curl_cfilter *cf, if(result) return result; - authority = aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"", - port); + authority = aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname, + ipv6_ip ? "]" : "", port); if(!authority) return CURLE_OUT_OF_MEMORY; @@ -662,8 +664,8 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, goto error; } - /* This only happens if we've looped here due to authentication - reasons, and we don't really use the newly cloned URL here + /* 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); @@ -749,6 +751,10 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, if(result) goto error; + result = Curl_creader_set_null(data); + if(result) + goto error; + sendtask = hyper_clientconn_send(client, req); if(!sendtask) { failf(data, "hyper_clientconn_send"); @@ -832,9 +838,9 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, int didwhat; (void)ts; - *done = FALSE; - result = Curl_hyper_stream(data, cf->conn, &didwhat, done, + result = Curl_hyper_stream(data, cf->conn, &didwhat, CURL_CSELECT_IN | CURL_CSELECT_OUT); + *done = data->req.done; if(result || !*done) return result; if(h->exec) { @@ -918,6 +924,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, * If the other side indicated a connection close, or if someone * else told us to close this connection, do so now. */ + Curl_req_soft_reset(&data->req, data); if(ts->close_connection || conn->bits.close) { /* Close this filter and the sub-chain, re-connect the * sub-chain and continue. Closing this filter will @@ -946,7 +953,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, DEBUGASSERT(ts->tunnel_state == H1_TUNNEL_RESPONSE); if(data->info.httpproxycode/100 != 2) { - /* a non-2xx response and we have no next url to try. */ + /* 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"); @@ -1003,10 +1010,8 @@ out: *done = (result == CURLE_OK) && tunnel_is_established(cf->ctx); if(*done) { cf->connected = TRUE; - /* Restore `data->req` fields that may habe been touched */ - data->req.header = TRUE; /* assume header */ - data->req.bytecount = 0; - data->req.ignorebody = FALSE; + /* 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); @@ -1027,9 +1032,9 @@ static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf, * and not waiting on something, we are tunneling. */ curl_socket_t sock = Curl_conn_cf_get_socket(cf, data); if(ts) { - /* when we've sent a CONNECT to a proxy, we should rather either + /* when we have sent a CONNECT to a proxy, we should rather either wait for the socket to become readable to be able to get the - response headers or if we're still sending the request, wait + response headers or if we are still sending the request, wait for write. */ if(tunnel_want_send(ts)) Curl_pollset_set_out_only(data, ps, sock); @@ -1052,22 +1057,25 @@ static void cf_h1_proxy_close(struct Curl_cfilter *cf, struct Curl_easy *data) { CURL_TRC_CF(data, cf, "close"); - cf->connected = FALSE; - if(cf->ctx) { - h1_tunnel_go_state(cf, cf->ctx, H1_TUNNEL_INIT, data); + if(cf) { + cf->connected = FALSE; + if(cf->ctx) { + h1_tunnel_go_state(cf, cf->ctx, H1_TUNNEL_INIT, data); + } + if(cf->next) + cf->next->cft->do_close(cf->next, data); } - if(cf->next) - cf->next->cft->do_close(cf->next, data); } struct Curl_cftype Curl_cft_h1_proxy = { "H1-PROXY", - CF_TYPE_IP_CONNECT, + CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, 0, cf_h1_proxy_destroy, cf_h1_proxy_connect, cf_h1_proxy_close, + Curl_cf_def_shutdown, Curl_cf_http_proxy_get_host, cf_h1_proxy_adjust_pollset, Curl_cf_def_data_pending, diff --git a/deps/curl/lib/cf-h2-proxy.c b/deps/curl/lib/cf-h2-proxy.c index f8f2f3c4..038952d6 100644 --- a/deps/curl/lib/cf-h2-proxy.c +++ b/deps/curl/lib/cf-h2-proxy.c @@ -38,6 +38,7 @@ #include "http2.h" #include "http_proxy.h" #include "multiif.h" +#include "sendf.h" #include "cf-h2-proxy.h" /* The last 3 #include files should be in this order */ @@ -72,7 +73,6 @@ struct tunnel_stream { char *authority; int32_t stream_id; uint32_t error; - size_t upload_blocked_len; h2_tunnel_state state; BIT(has_final_response); BIT(closed); @@ -98,7 +98,8 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf, return result; ts->authority = /* host:port with IPv6 support */ - aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"", port); + aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname, + ipv6_ip ? "]" : "", port); if(!ts->authority) return CURLE_OUT_OF_MEMORY; @@ -161,8 +162,8 @@ static void h2_tunnel_go_state(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "[%d] new tunnel state 'failed'", ts->stream_id); ts->state = new_state; /* If a proxy-authorization header was used for the proxy, then we should - make sure that it isn't accidentally used for the document request - after we've connected. So let's free and clear it here. */ + make sure that it is not accidentally used for the document request + after we have connected. So let's free and clear it here. */ Curl_safefree(data->state.aptr.proxyuserpwd); break; } @@ -180,7 +181,8 @@ struct cf_h2_proxy_ctx { int32_t goaway_error; int32_t last_stream_id; BIT(conn_closed); - BIT(goaway); + BIT(rcvd_goaway); + BIT(sent_goaway); BIT(nw_out_blocked); }; @@ -215,11 +217,13 @@ static void drain_tunnel(struct Curl_cfilter *cf, struct Curl_easy *data, struct tunnel_stream *tunnel) { + struct cf_h2_proxy_ctx *ctx = cf->ctx; unsigned char bits; (void)cf; bits = CURL_CSELECT_IN; - if(!tunnel->closed && !tunnel->reset && tunnel->upload_blocked_len) + if(!tunnel->closed && !tunnel->reset && + !Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) bits |= CURL_CSELECT_OUT; if(data->state.select_bits != bits) { CURL_TRC_CF(data, cf, "[%d] DRAIN select_bits=%x", @@ -258,7 +262,7 @@ static ssize_t proxy_h2_nw_out_writer(void *writer_ctx, if(cf) { struct Curl_easy *data = CF_DATA_CURRENT(cf); nwritten = Curl_conn_cf_send(cf->next, data, (const char *)buf, buflen, - err); + FALSE, err); CURL_TRC_CF(data, cf, "[0] nw_out_writer(len=%zu) -> %zd, %d", buflen, nwritten, *err); } @@ -426,7 +430,7 @@ static CURLcode proxy_h2_nw_out_flush(struct Curl_cfilter *cf, return result; } CURL_TRC_CF(data, cf, "[0] nw send buffer flushed"); - return Curl_bufq_is_empty(&ctx->outbufq)? CURLE_OK: CURLE_AGAIN; + return Curl_bufq_is_empty(&ctx->outbufq) ? CURLE_OK : CURLE_AGAIN; } /* @@ -601,29 +605,27 @@ static int proxy_h2_fr_print(const nghttp2_frame *frame, return msnprintf(buffer, blen, "FRAME[SETTINGS, len=%d]", (int)frame->hd.length); } - case NGHTTP2_PUSH_PROMISE: { + case NGHTTP2_PUSH_PROMISE: return msnprintf(buffer, blen, "FRAME[PUSH_PROMISE, len=%d, hend=%d]", (int)frame->hd.length, !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS)); - } - case NGHTTP2_PING: { + case NGHTTP2_PING: return msnprintf(buffer, blen, "FRAME[PING, len=%d, ack=%d]", (int)frame->hd.length, - frame->hd.flags&NGHTTP2_FLAG_ACK); - } + frame->hd.flags & NGHTTP2_FLAG_ACK); case NGHTTP2_GOAWAY: { char scratch[128]; size_t s_len = sizeof(scratch)/sizeof(scratch[0]); - 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 msnprintf(buffer, blen, "FRAME[GOAWAY, error=%d, reason='%s', " - "last_stream=%d]", frame->goaway.error_code, - scratch, frame->goaway.last_stream_id); + 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 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 msnprintf(buffer, blen, @@ -693,7 +695,7 @@ static int proxy_h2_on_frame_recv(nghttp2_session *session, } break; case NGHTTP2_GOAWAY: - ctx->goaway = TRUE; + ctx->rcvd_goaway = TRUE; break; default: break; @@ -954,6 +956,9 @@ static CURLcode submit_CONNECT(struct Curl_cfilter *cf, struct httpreq *req = NULL; result = Curl_http_proxy_create_CONNECT(&req, cf, data, 2); + if(result) + goto out; + result = Curl_creader_set_null(data); if(result) goto out; @@ -1074,7 +1079,7 @@ static CURLcode H2_CONNECT(struct Curl_cfilter *cf, } while(ts->state == H2_TUNNEL_INIT); out: - if(result || ctx->tunnel.closed) + if((result && (result != CURLE_AGAIN)) || ctx->tunnel.closed) h2_tunnel_go_state(cf, ts, H2_TUNNEL_FAILED, data); return result; } @@ -1125,7 +1130,12 @@ static CURLcode cf_h2_proxy_connect(struct Curl_cfilter *cf, out: *done = (result == CURLE_OK) && (ts->state == H2_TUNNEL_ESTABLISHED); - cf->connected = *done; + if(*done) { + cf->connected = TRUE; + /* The real request will follow the CONNECT, reset request partially */ + Curl_req_soft_reset(&data->req, data); + Curl_client_reset(data); + } CF_DATA_RESTORE(cf, save); return result; } @@ -1157,6 +1167,50 @@ static void cf_h2_proxy_destroy(struct Curl_cfilter *cf, } } +static CURLcode cf_h2_proxy_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + struct cf_h2_proxy_ctx *ctx = cf->ctx; + struct cf_call_data save; + CURLcode result; + int rv; + + if(!cf->connected || !ctx->h2 || cf->shutdown || ctx->conn_closed) { + *done = TRUE; + return CURLE_OK; + } + + CF_DATA_SAVE(save, cf, data); + + if(!ctx->sent_goaway) { + rv = nghttp2_submit_goaway(ctx->h2, NGHTTP2_FLAG_NONE, + 0, 0, + (const uint8_t *)"shutdown", + sizeof("shutdown")); + if(rv) { + failf(data, "nghttp2_submit_goaway() failed: %s(%d)", + nghttp2_strerror(rv), rv); + result = CURLE_SEND_ERROR; + goto out; + } + ctx->sent_goaway = TRUE; + } + /* GOAWAY submitted, process egress and ingress until nghttp2 is done. */ + result = CURLE_OK; + if(nghttp2_session_want_write(ctx->h2)) + result = proxy_h2_progress_egress(cf, data); + if(!result && nghttp2_session_want_read(ctx->h2)) + result = proxy_h2_progress_ingress(cf, data); + + *done = (ctx->conn_closed || + (!result && !nghttp2_session_want_write(ctx->h2) && + !nghttp2_session_want_read(ctx->h2))); +out: + CF_DATA_RESTORE(cf, save); + cf->shutdown = (result || *done); + return result; +} + static bool cf_h2_proxy_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { @@ -1165,7 +1219,7 @@ static bool cf_h2_proxy_data_pending(struct Curl_cfilter *cf, (ctx && ctx->tunnel.state == H2_TUNNEL_ESTABLISHED && !Curl_bufq_is_empty(&ctx->tunnel.recvbuf))) return TRUE; - return cf->next? cf->next->cft->has_data_pending(cf->next, data) : FALSE; + return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE; } static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, @@ -1173,12 +1227,20 @@ static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, struct easy_pollset *ps) { struct cf_h2_proxy_ctx *ctx = cf->ctx; + struct cf_call_data save; curl_socket_t sock = Curl_conn_cf_get_socket(cf, data); bool want_recv, want_send; - Curl_pollset_check(data, ps, sock, &want_recv, &want_send); + if(!cf->connected && ctx->h2) { + want_send = nghttp2_session_want_write(ctx->h2) || + !Curl_bufq_is_empty(&ctx->outbufq) || + !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); + want_recv = nghttp2_session_want_read(ctx->h2); + } + else + Curl_pollset_check(data, ps, sock, &want_recv, &want_send); + if(ctx->h2 && (want_recv || want_send)) { - struct cf_call_data save; bool c_exhaust, s_exhaust; CF_DATA_SAVE(save, cf, data); @@ -1188,9 +1250,25 @@ static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, 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)); + (!c_exhaust && nghttp2_session_want_write(ctx->h2)) || + !Curl_bufq_is_empty(&ctx->outbufq) || + !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); Curl_pollset_set(data, ps, sock, want_recv, want_send); + CURL_TRC_CF(data, cf, "adjust_pollset, want_recv=%d want_send=%d", + want_recv, want_send); + CF_DATA_RESTORE(cf, save); + } + else if(ctx->sent_goaway && !cf->shutdown) { + /* shutdown in progress */ + CF_DATA_SAVE(save, cf, data); + want_send = nghttp2_session_want_write(ctx->h2) || + !Curl_bufq_is_empty(&ctx->outbufq) || + !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); + want_recv = nghttp2_session_want_read(ctx->h2); + Curl_pollset_set(data, ps, sock, want_recv, want_send); + CURL_TRC_CF(data, cf, "adjust_pollset, want_recv=%d want_send=%d", + want_recv, want_send); CF_DATA_RESTORE(cf, save); } } @@ -1205,7 +1283,7 @@ static ssize_t 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"); /* don't use this anymore */ + connclose(cf->conn, "REFUSED_STREAM"); /* do not use this anymore */ *err = CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */ return -1; } @@ -1250,7 +1328,8 @@ static ssize_t tunnel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, } else if(ctx->tunnel.reset || (ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) || - (ctx->goaway && ctx->last_stream_id < ctx->tunnel.stream_id)) { + (ctx->rcvd_goaway && + ctx->last_stream_id < ctx->tunnel.stream_id)) { *err = CURLE_RECV_ERROR; nread = -1; } @@ -1296,16 +1375,7 @@ static ssize_t cf_h2_proxy_recv(struct Curl_cfilter *cf, } result = proxy_h2_progress_egress(cf, data); - if(result == CURLE_AGAIN) { - /* pending data to send, need to be called again. Ideally, we'd - * monitor the socket for POLLOUT, but we might not be in SENDING - * transfer state any longer and are unable to make this happen. - */ - CURL_TRC_CF(data, cf, "[%d] egress blocked, DRAIN", - ctx->tunnel.stream_id); - drain_tunnel(cf, data, &ctx->tunnel); - } - else if(result) { + if(result && (result != CURLE_AGAIN)) { *err = result; nread = -1; } @@ -1325,15 +1395,16 @@ out: static ssize_t cf_h2_proxy_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_h2_proxy_ctx *ctx = cf->ctx; struct cf_call_data save; int rv; ssize_t nwritten; CURLcode result; - int blocked = 0; + (void)eos; /* TODO, maybe useful for blocks? */ if(ctx->tunnel.state != H2_TUNNEL_ESTABLISHED) { *err = CURLE_SEND_ERROR; return -1; @@ -1345,29 +1416,10 @@ static ssize_t cf_h2_proxy_send(struct Curl_cfilter *cf, *err = CURLE_SEND_ERROR; goto out; } - else if(ctx->tunnel.upload_blocked_len) { - /* the data in `buf` has already been submitted or added to the - * buffers, but have been EAGAINed on the last invocation. */ - DEBUGASSERT(len >= ctx->tunnel.upload_blocked_len); - if(len < ctx->tunnel.upload_blocked_len) { - /* Did we get called again with a smaller `len`? This should not - * happen. We are not prepared to handle that. */ - failf(data, "HTTP/2 proxy, send again with decreased length"); - *err = CURLE_HTTP2; - nwritten = -1; - goto out; - } - nwritten = (ssize_t)ctx->tunnel.upload_blocked_len; - ctx->tunnel.upload_blocked_len = 0; - *err = CURLE_OK; - } else { nwritten = Curl_bufq_write(&ctx->tunnel.sendbuf, buf, len, err); - if(nwritten < 0) { - if(*err != CURLE_AGAIN) - goto out; - nwritten = 0; - } + if(nwritten < 0 && (*err != CURLE_AGAIN)) + goto out; } if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { @@ -1390,52 +1442,13 @@ static ssize_t cf_h2_proxy_send(struct Curl_cfilter *cf, /* Call the nghttp2 send loop and flush to write ALL buffered data, * headers and/or request body completely out to the network */ result = proxy_h2_progress_egress(cf, data); - if(result == CURLE_AGAIN) { - blocked = 1; - } - else if(result) { + if(result && (result != CURLE_AGAIN)) { *err = result; nwritten = -1; goto out; } - else if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { - /* although we wrote everything that nghttp2 wants to send now, - * there is data left in our stream send buffer unwritten. This may - * be due to the stream's HTTP/2 flow window being exhausted. */ - blocked = 1; - } - if(blocked) { - /* Unable to send all data, due to connection blocked or H2 window - * exhaustion. Data is left in our stream buffer, or nghttp2's internal - * frame buffer or our network out buffer. */ - size_t rwin = nghttp2_session_get_stream_remote_window_size( - ctx->h2, ctx->tunnel.stream_id); - if(rwin == 0) { - /* H2 flow window exhaustion. - * FIXME: there is no way to HOLD all transfers that use this - * proxy connection AND to UNHOLD all of them again when the - * window increases. - * We *could* iterate over all data on this conn maybe? */ - CURL_TRC_CF(data, cf, "[%d] remote flow " - "window is exhausted", ctx->tunnel.stream_id); - } - - /* Whatever the cause, we need to return CURL_EAGAIN for this call. - * We have unwritten state that needs us being invoked again and EAGAIN - * is the only way to ensure that. */ - ctx->tunnel.upload_blocked_len = nwritten; - CURL_TRC_CF(data, cf, "[%d] cf_send(len=%zu) BLOCK: win %u/%zu " - "blocked_len=%zu", - ctx->tunnel.stream_id, len, - nghttp2_session_get_remote_window_size(ctx->h2), rwin, - nwritten); - drain_tunnel(cf, data, &ctx->tunnel); - *err = CURLE_AGAIN; - nwritten = -1; - goto out; - } - else if(proxy_h2_should_close_session(ctx)) { + if(proxy_h2_should_close_session(ctx)) { /* nghttp2 thinks this session is done. If the stream has not been * closed, this is an error state for out transfer */ if(ctx->tunnel.closed) { @@ -1468,6 +1481,38 @@ out: return nwritten; } +static CURLcode cf_h2_proxy_flush(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + struct cf_h2_proxy_ctx *ctx = cf->ctx; + struct cf_call_data save; + CURLcode result = CURLE_OK; + + CF_DATA_SAVE(save, cf, data); + if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { + /* resume the potentially suspended tunnel */ + int rv = nghttp2_session_resume_data(ctx->h2, ctx->tunnel.stream_id); + if(nghttp2_is_fatal(rv)) { + result = CURLE_SEND_ERROR; + goto out; + } + } + + result = proxy_h2_progress_egress(cf, data); + +out: + CURL_TRC_CF(data, cf, "[%d] flush -> %d, " + "h2 windows %d-%d (stream-conn), buffers %zu-%zu (stream-conn)", + ctx->tunnel.stream_id, result, + nghttp2_session_get_stream_remote_window_size( + 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)); + CF_DATA_RESTORE(cf, save); + return result; +} + static bool proxy_h2_connisalive(struct Curl_cfilter *cf, struct Curl_easy *data, bool *input_pending) @@ -1480,8 +1525,8 @@ static bool proxy_h2_connisalive(struct Curl_cfilter *cf, return FALSE; if(*input_pending) { - /* This happens before we've sent off a request and the connection is - not in use by any other transfer, there shouldn't be any data here, + /* This happens before we have sent off a request and the connection is + not in use by any other transfer, there should not be any data here, only "protocol frames" */ CURLcode result; ssize_t nread = -1; @@ -1521,22 +1566,69 @@ static bool cf_h2_proxy_is_alive(struct Curl_cfilter *cf, return result; } +static CURLcode cf_h2_proxy_query(struct Curl_cfilter *cf, + struct Curl_easy *data, + int query, int *pres1, void *pres2) +{ + struct cf_h2_proxy_ctx *ctx = cf->ctx; + + switch(query) { + case CF_QUERY_NEED_FLUSH: { + if(!Curl_bufq_is_empty(&ctx->outbufq) || + !Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { + CURL_TRC_CF(data, cf, "needs flush"); + *pres1 = TRUE; + return CURLE_OK; + } + break; + } + default: + break; + } + return cf->next ? + cf->next->cft->query(cf->next, data, query, pres1, pres2) : + CURLE_UNKNOWN_OPTION; +} + +static CURLcode cf_h2_proxy_cntrl(struct Curl_cfilter *cf, + struct Curl_easy *data, + int event, int arg1, void *arg2) +{ + CURLcode result = CURLE_OK; + struct cf_call_data save; + + (void)arg1; + (void)arg2; + + switch(event) { + case CF_CTRL_FLUSH: + CF_DATA_SAVE(save, cf, data); + result = cf_h2_proxy_flush(cf, data); + CF_DATA_RESTORE(cf, save); + break; + default: + break; + } + return result; +} + struct Curl_cftype Curl_cft_h2_proxy = { "H2-PROXY", - CF_TYPE_IP_CONNECT, + CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, CURL_LOG_LVL_NONE, cf_h2_proxy_destroy, cf_h2_proxy_connect, cf_h2_proxy_close, + cf_h2_proxy_shutdown, Curl_cf_http_proxy_get_host, cf_h2_proxy_adjust_pollset, cf_h2_proxy_data_pending, cf_h2_proxy_send, cf_h2_proxy_recv, - Curl_cf_def_cntrl, + cf_h2_proxy_cntrl, cf_h2_proxy_is_alive, Curl_cf_def_conn_keep_alive, - Curl_cf_def_query, + cf_h2_proxy_query, }; CURLcode Curl_cf_h2_proxy_insert_after(struct Curl_cfilter *cf, diff --git a/deps/curl/lib/cf-haproxy.c b/deps/curl/lib/cf-haproxy.c index 90532952..ae2402f2 100644 --- a/deps/curl/lib/cf-haproxy.c +++ b/deps/curl/lib/cf-haproxy.c @@ -70,8 +70,9 @@ static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter*cf, { struct cf_haproxy_ctx *ctx = cf->ctx; CURLcode result; - const char *tcp_version; const char *client_ip; + struct ip_quadruple ipquad; + int is_ipv6; DEBUGASSERT(ctx); DEBUGASSERT(ctx->state == HAPROXY_INIT); @@ -81,19 +82,20 @@ static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter*cf, result = Curl_dyn_addn(&ctx->data_out, STRCONST("PROXY UNKNOWN\r\n")); else { #endif /* USE_UNIX_SOCKETS */ + result = Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad); + if(result) + return result; + /* Emit the correct prefix for IPv6 */ - tcp_version = cf->conn->bits.ipv6 ? "TCP6" : "TCP4"; if(data->set.str[STRING_HAPROXY_CLIENT_IP]) client_ip = data->set.str[STRING_HAPROXY_CLIENT_IP]; else - client_ip = data->info.conn_local_ip; + client_ip = ipquad.local_ip; result = Curl_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n", - tcp_version, - client_ip, - data->info.conn_primary_ip, - data->info.conn_local_port, - data->info.conn_primary_port); + is_ipv6 ? "TCP6" : "TCP4", + client_ip, ipquad.remote_ip, + ipquad.local_port, ipquad.remote_port); #ifdef USE_UNIX_SOCKETS } @@ -129,17 +131,17 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, case HAPROXY_SEND: len = Curl_dyn_len(&ctx->data_out); if(len > 0) { - size_t written; - result = Curl_conn_send(data, cf->sockindex, - Curl_dyn_ptr(&ctx->data_out), - len, &written); - if(result == CURLE_AGAIN) { + ssize_t nwritten; + nwritten = Curl_conn_cf_send(cf->next, data, + Curl_dyn_ptr(&ctx->data_out), len, FALSE, + &result); + if(nwritten < 0) { + if(result != CURLE_AGAIN) + goto out; result = CURLE_OK; - written = 0; + nwritten = 0; } - else if(result) - goto out; - Curl_dyn_tail(&ctx->data_out, len - written); + Curl_dyn_tail(&ctx->data_out, len - (size_t)nwritten); if(Curl_dyn_len(&ctx->data_out) > 0) { result = CURLE_OK; goto out; @@ -189,11 +191,12 @@ static void cf_haproxy_adjust_pollset(struct Curl_cfilter *cf, struct Curl_cftype Curl_cft_haproxy = { "HAPROXY", - 0, + CF_TYPE_PROXY, 0, cf_haproxy_destroy, cf_haproxy_connect, cf_haproxy_close, + Curl_cf_def_shutdown, Curl_cf_def_get_host, cf_haproxy_adjust_pollset, Curl_cf_def_data_pending, @@ -228,7 +231,7 @@ static CURLcode cf_haproxy_create(struct Curl_cfilter **pcf, out: cf_haproxy_ctx_free(ctx); - *pcf = result? NULL : cf; + *pcf = result ? NULL : cf; return result; } diff --git a/deps/curl/lib/cf-https-connect.c b/deps/curl/lib/cf-https-connect.c index b23fa056..dd7cdcb0 100644 --- a/deps/curl/lib/cf-https-connect.c +++ b/deps/curl/lib/cf-https-connect.c @@ -55,7 +55,8 @@ struct cf_hc_baller { CURLcode result; struct curltime started; int reply_ms; - bool enabled; + BIT(enabled); + BIT(shutdown); }; static void cf_hc_baller_reset(struct cf_hc_baller *b, @@ -95,6 +96,21 @@ static bool cf_hc_baller_data_pending(struct cf_hc_baller *b, return b->cf && !b->result && b->cf->cft->has_data_pending(b->cf, data); } +static bool cf_hc_baller_needs_flush(struct cf_hc_baller *b, + struct Curl_easy *data) +{ + return b->cf && !b->result && Curl_conn_cf_needs_flush(b->cf, data); +} + +static CURLcode cf_hc_baller_cntrl(struct cf_hc_baller *b, + struct Curl_easy *data, + int event, int arg1, void *arg2) +{ + if(b->cf && !b->result) + return Curl_conn_cf_cntrl(b->cf, data, FALSE, event, arg1, arg2); + return CURLE_OK; +} + struct cf_hc_ctx { cf_hc_state state; const struct Curl_dns_entry *remotehost; @@ -102,8 +118,8 @@ struct cf_hc_ctx { CURLcode result; /* overall result */ struct cf_hc_baller h3_baller; struct cf_hc_baller h21_baller; - int soft_eyeballs_timeout_ms; - int hard_eyeballs_timeout_ms; + unsigned int soft_eyeballs_timeout_ms; + unsigned int hard_eyeballs_timeout_ms; }; static void cf_hc_baller_init(struct cf_hc_baller *b, @@ -158,6 +174,7 @@ static CURLcode baller_connected(struct Curl_cfilter *cf, { struct cf_hc_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; + int reply_ms; DEBUGASSERT(winner->cf); if(winner != &ctx->h3_baller) @@ -165,15 +182,20 @@ static CURLcode baller_connected(struct Curl_cfilter *cf, if(winner != &ctx->h21_baller) cf_hc_baller_reset(&ctx->h21_baller, data); - CURL_TRC_CF(data, cf, "connect+handshake %s: %dms, 1st data: %dms", - winner->name, (int)Curl_timediff(Curl_now(), winner->started), - cf_hc_baller_reply_ms(winner, data)); + 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)Curl_timediff(Curl_now(), winner->started), + reply_ms); + else + CURL_TRC_CF(data, cf, "deferred handshake %s: %dms", + winner->name, (int)Curl_timediff(Curl_now(), winner->started)); + cf->next = winner->cf; winner->cf = NULL; switch(cf->conn->alpn) { case CURL_HTTP_VERSION_3: - infof(data, "using HTTP/3"); break; case CURL_HTTP_VERSION_2: #ifdef USE_NGHTTP2 @@ -186,16 +208,12 @@ static CURLcode baller_connected(struct Curl_cfilter *cf, return result; } #endif - infof(data, "using HTTP/2"); break; default: - infof(data, "using HTTP/1.x"); break; } ctx->state = CF_HC_SUCCESS; cf->connected = TRUE; - Curl_conn_cf_cntrl(cf->next, data, TRUE, - CF_CTRL_CONN_INFO_UPDATE, 0, NULL); return result; } @@ -264,7 +282,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf, } else if(ctx->h21_baller.enabled) cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21", - cf->conn->transport); + cf->conn->transport); ctx->state = CF_HC_CONNECT; FALLTHROUGH(); @@ -295,8 +313,8 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf, (!ctx->h21_baller.enabled || ctx->h21_baller.result)) { /* both failed or disabled. we give up */ CURL_TRC_CF(data, cf, "connect, all failed"); - result = ctx->result = ctx->h3_baller.enabled? - ctx->h3_baller.result : ctx->h21_baller.result; + result = ctx->result = ctx->h3_baller.enabled ? + ctx->h3_baller.result : ctx->h21_baller.result; ctx->state = CF_HC_FAILURE; goto out; } @@ -322,6 +340,49 @@ out: return result; } +static CURLcode cf_hc_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + struct cf_hc_ctx *ctx = cf->ctx; + struct cf_hc_baller *ballers[2]; + size_t i; + CURLcode result = CURLE_OK; + + DEBUGASSERT(data); + if(cf->connected) { + *done = TRUE; + return CURLE_OK; + } + + /* shutdown all ballers that have not done so already. If one fails, + * continue shutting down others until all are shutdown. */ + ballers[0] = &ctx->h3_baller; + ballers[1] = &ctx->h21_baller; + for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) { + struct cf_hc_baller *b = ballers[i]; + bool bdone = FALSE; + if(!cf_hc_baller_is_active(b) || b->shutdown) + continue; + b->result = b->cf->cft->do_shutdown(b->cf, data, &bdone); + if(b->result || bdone) + b->shutdown = TRUE; /* treat a failed shutdown as done */ + } + + *done = TRUE; + for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) { + if(ballers[i] && !ballers[i]->shutdown) + *done = FALSE; + } + if(*done) { + for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) { + if(ballers[i] && ballers[i]->result) + result = ballers[i]->result; + } + } + CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", result, *done); + return result; +} + static void cf_hc_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, struct easy_pollset *ps) @@ -366,13 +427,13 @@ static struct curltime cf_get_max_baller_time(struct Curl_cfilter *cf, memset(&tmax, 0, sizeof(tmax)); memset(&t, 0, sizeof(t)); - cfb = ctx->h21_baller.enabled? ctx->h21_baller.cf : NULL; + cfb = ctx->h21_baller.enabled ? ctx->h21_baller.cf : NULL; if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) { if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0) tmax = t; } memset(&t, 0, sizeof(t)); - cfb = ctx->h3_baller.enabled? ctx->h3_baller.cf : NULL; + cfb = ctx->h3_baller.enabled ? ctx->h3_baller.cf : NULL; if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) { if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0) tmax = t; @@ -384,6 +445,8 @@ static CURLcode cf_hc_query(struct Curl_cfilter *cf, struct Curl_easy *data, int query, int *pres1, void *pres2) { + struct cf_hc_ctx *ctx = cf->ctx; + if(!cf->connected) { switch(query) { case CF_QUERY_TIMER_CONNECT: { @@ -396,15 +459,40 @@ static CURLcode cf_hc_query(struct Curl_cfilter *cf, *when = cf_get_max_baller_time(cf, data, CF_QUERY_TIMER_APPCONNECT); return CURLE_OK; } + case CF_QUERY_NEED_FLUSH: { + if(cf_hc_baller_needs_flush(&ctx->h3_baller, data) + || cf_hc_baller_needs_flush(&ctx->h21_baller, data)) { + *pres1 = TRUE; + return CURLE_OK; + } + break; + } default: break; } } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } +static CURLcode cf_hc_cntrl(struct Curl_cfilter *cf, + struct Curl_easy *data, + int event, int arg1, void *arg2) +{ + struct cf_hc_ctx *ctx = cf->ctx; + CURLcode result = CURLE_OK; + + if(!cf->connected) { + result = cf_hc_baller_cntrl(&ctx->h3_baller, data, event, arg1, arg2); + if(!result || (result == CURLE_AGAIN)) + result = cf_hc_baller_cntrl(&ctx->h21_baller, data, event, arg1, arg2); + if(result == CURLE_AGAIN) + result = CURLE_OK; + } + return result; +} + static void cf_hc_close(struct Curl_cfilter *cf, struct Curl_easy *data) { CURL_TRC_CF(data, cf, "close"); @@ -434,12 +522,13 @@ struct Curl_cftype Curl_cft_http_connect = { cf_hc_destroy, cf_hc_connect, cf_hc_close, + cf_hc_shutdown, Curl_cf_def_get_host, cf_hc_adjust_pollset, cf_hc_data_pending, Curl_cf_def_send, Curl_cf_def_recv, - Curl_cf_def_cntrl, + cf_hc_cntrl, Curl_cf_def_conn_is_alive, Curl_cf_def_conn_keep_alive, cf_hc_query, @@ -471,7 +560,7 @@ static CURLcode cf_hc_create(struct Curl_cfilter **pcf, cf_hc_reset(cf, data); out: - *pcf = result? NULL : cf; + *pcf = result ? NULL : cf; free(ctx); return result; } @@ -510,7 +599,7 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data, if(data->state.httpwant == CURL_HTTP_VERSION_3ONLY) { result = Curl_conn_may_http3(data, conn); - if(result) /* can't do it */ + if(result) /* cannot do it */ goto out; try_h3 = TRUE; try_h21 = FALSE; diff --git a/deps/curl/lib/cf-socket.c b/deps/curl/lib/cf-socket.c index 33ca7e78..b4840f7e 100644 --- a/deps/curl/lib/cf-socket.c +++ b/deps/curl/lib/cf-socket.c @@ -35,6 +35,9 @@ #elif defined(HAVE_NETINET_TCP_H) #include #endif +#ifdef HAVE_NETINET_UDP_H +#include +#endif #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -53,6 +56,11 @@ #include #endif +#ifdef __DragonFly__ +/* Required for __DragonFly_version */ +#include +#endif + #include "urldata.h" #include "bufq.h" #include "sendf.h" @@ -73,6 +81,7 @@ #include "multihandle.h" #include "rand.h" #include "share.h" +#include "strdup.h" #include "version_win32.h" /* The last 3 #include files should be in this order */ @@ -81,7 +90,7 @@ #include "memdebug.h" -#if defined(ENABLE_IPV6) && defined(IPV6_V6ONLY) && defined(_WIN32) +#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; @@ -115,7 +124,7 @@ static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd) } #ifdef SO_NOSIGPIPE -/* The preferred method on Mac OS X (10.2 and later) to prevent SIGPIPEs when +/* The preferred method on macOS (10.2 and later) to prevent SIGPIPEs when 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? */ @@ -137,8 +146,18 @@ static void nosigpipe(struct Curl_easy *data, #define nosigpipe(x,y) Curl_nop_stmt #endif -#if defined(__DragonFly__) || defined(USE_WINSOCK) -/* DragonFlyBSD and Windows use millisecond units */ +#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) || \ + (defined(__sun) && !defined(TCP_KEEPIDLE)) || \ + (defined(__DragonFly__) && __DragonFly_version < 500702) || \ + (defined(_WIN32) && !defined(TCP_KEEPIDLE)) +/* Solaris < 11.4, DragonFlyBSD < 500702 and Windows < 10.0.16299 + * use millisecond units. */ #define KEEPALIVE_FACTOR(x) (x *= 1000) #else #define KEEPALIVE_FACTOR(x) @@ -158,50 +177,86 @@ static void tcpkeepalive(struct Curl_easy *data, curl_socket_t sockfd) { - int optval = data->set.tcp_keepalive?1:0; + int optval = data->set.tcp_keepalive ? 1 : 0; /* 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 " - "%" CURL_FORMAT_SOCKET_T ": errno %d", + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } else { -#if defined(SIO_KEEPALIVE_VALS) +#if defined(SIO_KEEPALIVE_VALS) /* Windows */ +/* Windows 10, version 1709 (10.0.16299) and later versions */ +#if defined(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) { + infof(data, "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); + } + 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); + } +#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 = optval; + vals.keepalivetime = (u_long)optval; optval = curlx_sltosi(data->set.tcp_keepintvl); KEEPALIVE_FACTOR(optval); - vals.keepaliveinterval = optval; + 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 " - "%" CURL_FORMAT_SOCKET_T ": errno %d", - sockfd, SOCKERRNO); + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } -#else +#endif +#else /* !Windows */ #ifdef TCP_KEEPIDLE optval = curlx_sltosi(data->set.tcp_keepidle); KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set TCP_KEEPIDLE on fd " - "%" CURL_FORMAT_SOCKET_T ": errno %d", + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } #elif defined(TCP_KEEPALIVE) - /* Mac OS X style */ + /* macOS style */ optval = curlx_sltosi(data->set.tcp_keepidle); KEEPALIVE_FACTOR(optval); if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set TCP_KEEPALIVE on fd " - "%" CURL_FORMAT_SOCKET_T ": errno %d", + "%" FMT_SOCKET_T ": errno %d", + sockfd, SOCKERRNO); + } +#elif defined(TCP_KEEPALIVE_THRESHOLD) + /* Solaris <11.4 style */ + optval = curlx_sltosi(data->set.tcp_keepidle); + 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); } #endif @@ -211,9 +266,37 @@ tcpkeepalive(struct Curl_easy *data, if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, (void *)&optval, sizeof(optval)) < 0) { infof(data, "Failed to set TCP_KEEPINTVL on fd " - "%" CURL_FORMAT_SOCKET_T ": errno %d", + "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO); } +#elif defined(TCP_KEEPALIVE_ABORT_THRESHOLD) + /* Solaris <11.4 style */ + /* TCP_KEEPALIVE_ABORT_THRESHOLD should equal to + * TCP_KEEPCNT * TCP_KEEPINTVL on other platforms. + * The default value of TCP_KEEPCNT is 9 on Linux, + * 8 on *BSD/macOS, 5 or 10 on Windows. We use the + * default config for Solaris <11.4 because there is + * no default value for TCP_KEEPCNT on Solaris 11.4. + * + * Note that the consequent probes will not be sent + * at equal intervals on Solaris, but will be sent + * using the exponential backoff algorithm. */ + optval = curlx_sltosi(data->set.tcp_keepcnt) * + curlx_sltosi(data->set.tcp_keepintvl); + 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); + } +#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); + } #endif #endif } @@ -249,11 +332,11 @@ void Curl_sock_assign_addr(struct Curl_sockaddr_ex *dest, dest->protocol = IPPROTO_UDP; break; } - dest->addrlen = ai->ai_addrlen; + dest->addrlen = (unsigned int)ai->ai_addrlen; if(dest->addrlen > sizeof(struct Curl_sockaddr_storage)) dest->addrlen = sizeof(struct Curl_sockaddr_storage); - memcpy(&dest->sa_addr, ai->ai_addr, dest->addrlen); + memcpy(&dest->curl_sa_addr, ai->ai_addr, dest->addrlen); } static CURLcode socket_open(struct Curl_easy *data, @@ -272,11 +355,11 @@ static CURLcode socket_open(struct Curl_easy *data, * might have been changed and this 'new' address will actually be used * here to connect. */ - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); *sockfd = data->set.fopensocket(data->set.opensocket_client, CURLSOCKTYPE_IPCXN, (struct curl_sockaddr *)addr); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); } else { /* opensocket callback not set, so simply create the socket now */ @@ -287,9 +370,9 @@ static CURLcode socket_open(struct Curl_easy *data, /* no socket, no connection */ return CURLE_COULDNT_CONNECT; -#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) +#if defined(USE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) if(data->conn->scope_id && (addr->family == AF_INET6)) { - struct sockaddr_in6 * const sa6 = (void *)&addr->sa_addr; + struct sockaddr_in6 * const sa6 = (void *)&addr->curl_sa_addr; sa6->sin6_scope_id = data->conn->scope_id; } #endif @@ -314,7 +397,7 @@ CURLcode Curl_socket_open(struct Curl_easy *data, struct Curl_sockaddr_ex dummy; if(!addr) - /* if the caller doesn't want info back, use a local temp copy */ + /* if the caller does not want info back, use a local temp copy */ addr = &dummy; Curl_sock_assign_addr(addr, ai, transport); @@ -324,12 +407,15 @@ CURLcode Curl_socket_open(struct Curl_easy *data, static int socket_close(struct Curl_easy *data, struct connectdata *conn, int use_callback, curl_socket_t sock) { + if(CURL_SOCKET_BAD == sock) + return 0; + if(use_callback && conn && conn->fclosesocket) { int rc; Curl_multi_closed(data, sock); - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); rc = conn->fclosesocket(conn->closesocket_client, sock); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); return rc; } @@ -363,14 +449,14 @@ int Curl_socket_close(struct Curl_easy *data, struct connectdata *conn, Buffer Size The problem described in this knowledge-base is applied only to pre-Vista - Windows. Following function trying to detect OS version and skips + Windows. Following function trying to detect OS version and skips SO_SNDBUF adjustment for Windows Vista and above. */ #define DETECT_OS_NONE 0 #define DETECT_OS_PREVISTA 1 #define DETECT_OS_VISTA_OR_LATER 2 -void Curl_sndbufset(curl_socket_t sockfd) +void Curl_sndbuf_init(curl_socket_t sockfd) { int val = CURL_MAX_WRITE_SIZE + 32; int curval = 0; @@ -395,7 +481,88 @@ void Curl_sndbufset(curl_socket_t sockfd) setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (const char *)&val, sizeof(val)); } -#endif +#endif /* USE_WINSOCK */ + +/* + * Curl_parse_interface() + * + * This is used to parse interface argument in the following formats. + * In all the examples, `host` can be an IP address or a hostname. + * + * - can be either an interface name or a host. + * if! - interface name. + * host! - hostname. + * ifhost!! - interface name and hostname. + * + * Parameters: + * + * input [in] - input string. + * len [in] - length of the input string. + * dev [in/out] - address where a pointer to newly allocated memory + * holding the interface-or-host will be stored upon + * completion. + * iface [in/out] - address where a pointer to newly allocated memory + * holding the interface will be stored upon completion. + * host [in/out] - address where a pointer to newly allocated memory + * holding the host will be stored upon completion. + * + * Returns CURLE_OK on success. + */ +CURLcode Curl_parse_interface(const char *input, + char **dev, char **iface, char **host) +{ + static const char if_prefix[] = "if!"; + static const char host_prefix[] = "host!"; + static const char if_host_prefix[] = "ifhost!"; + size_t len; + + DEBUGASSERT(dev); + DEBUGASSERT(iface); + DEBUGASSERT(host); + + len = strlen(input); + if(len > 512) + return CURLE_BAD_FUNCTION_ARGUMENT; + + if(!strncmp(if_prefix, input, strlen(if_prefix))) { + input += strlen(if_prefix); + if(!*input) + return CURLE_BAD_FUNCTION_ARGUMENT; + *iface = Curl_memdup0(input, len - strlen(if_prefix)); + return *iface ? CURLE_OK : CURLE_OUT_OF_MEMORY; + } + else if(!strncmp(host_prefix, input, strlen(host_prefix))) { + input += strlen(host_prefix); + if(!*input) + return CURLE_BAD_FUNCTION_ARGUMENT; + *host = Curl_memdup0(input, len - strlen(host_prefix)); + return *host ? CURLE_OK : CURLE_OUT_OF_MEMORY; + } + else if(!strncmp(if_host_prefix, input, strlen(if_host_prefix))) { + const char *host_part; + input += strlen(if_host_prefix); + len -= strlen(if_host_prefix); + host_part = memchr(input, '!', len); + if(!host_part || !*(host_part + 1)) + return CURLE_BAD_FUNCTION_ARGUMENT; + *iface = Curl_memdup0(input, host_part - input); + if(!*iface) + return CURLE_OUT_OF_MEMORY; + ++host_part; + *host = Curl_memdup0(host_part, len - (host_part - input)); + if(!*host) { + free(*iface); + *iface = NULL; + return CURLE_OUT_OF_MEMORY; + } + return CURLE_OK; + } + + if(!*input) + return CURLE_BAD_FUNCTION_ARGUMENT; + *dev = Curl_memdup0(input, len); + return *dev ? CURLE_OK : CURLE_OUT_OF_MEMORY; +} #ifndef CURL_DISABLE_BINDLOCAL static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, @@ -405,7 +572,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, struct sockaddr *sock = (struct sockaddr *)&sa; /* bind to this address */ curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */ struct sockaddr_in *si4 = (struct sockaddr_in *)&sa; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa; #endif @@ -415,94 +582,92 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, /* how many port numbers to try to bind to, increasing one at a time */ int portnum = data->set.localportrange; const char *dev = data->set.str[STRING_DEVICE]; + const char *iface_input = data->set.str[STRING_INTERFACE]; + const char *host_input = data->set.str[STRING_BINDHOST]; + const char *iface = iface_input ? iface_input : dev; + const char *host = host_input ? host_input : dev; int error; #ifdef IP_BIND_ADDRESS_NO_PORT int on = 1; #endif -#ifndef ENABLE_IPV6 +#ifndef USE_IPV6 (void)scope; #endif /************************************************************* * Select device to bind socket to *************************************************************/ - if(!dev && !port) + if(!iface && !host && !port) /* no local kind of binding was requested */ return CURLE_OK; memset(&sa, 0, sizeof(struct Curl_sockaddr_storage)); - if(dev && (strlen(dev)<255) ) { + if(iface && (strlen(iface) < 255) ) { char myhost[256] = ""; int done = 0; /* -1 for error, 1 for address found */ - bool is_interface = FALSE; - bool is_host = FALSE; - static const char *if_prefix = "if!"; - static const char *host_prefix = "host!"; - - if(strncmp(if_prefix, dev, strlen(if_prefix)) == 0) { - dev += strlen(if_prefix); - is_interface = TRUE; - } - else if(strncmp(host_prefix, dev, strlen(host_prefix)) == 0) { - dev += strlen(host_prefix); - is_host = TRUE; - } + if2ip_result_t if2ip_result = IF2IP_NOT_FOUND; /* interface */ - if(!is_host) { #ifdef SO_BINDTODEVICE - /* - * This binds the local socket to a particular interface. This will - * force even requests to other local interfaces to go out the external - * interface. Only bind to the interface when specified as interface, - * not just as a hostname or ip address. - * - * The interface might be a VRF, eg: vrf-blue, which means it cannot be - * converted to an IP address and would fail Curl_if2ip. Simply try to - * use it straight away. - */ - if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, - dev, (curl_socklen_t)strlen(dev) + 1) == 0) { - /* This is often "errno 1, error: Operation not permitted" if you're - * not running as root or another suitable privileged user. If it - * succeeds it means the parameter was a valid interface and not an IP - * address. Return immediately. - */ - infof(data, "socket successfully bound to interface '%s'", dev); + /* + * This binds the local socket to a particular interface. This will + * force even requests to other local interfaces to go out the external + * interface. Only bind to the interface when specified as interface, + * not just as a hostname or ip address. + * + * The interface might be a VRF, eg: vrf-blue, which means it cannot be + * converted to an IP address and would fail Curl_if2ip. Simply try to + * use it straight away. + */ + if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, + iface, (curl_socklen_t)strlen(iface) + 1) == 0) { + /* This is often "errno 1, error: Operation not permitted" if you are + * not running as root or another suitable privileged user. If it + * succeeds it means the parameter was a valid interface and not an IP + * address. Return immediately. + */ + if(!host_input) { + infof(data, "socket successfully bound to interface '%s'", iface); return CURLE_OK; } -#endif - - switch(Curl_if2ip(af, -#ifdef ENABLE_IPV6 - scope, conn->scope_id, -#endif - dev, myhost, sizeof(myhost))) { - case IF2IP_NOT_FOUND: - if(is_interface) { - /* Do not fall back to treating it as a host name */ - failf(data, "Couldn't bind to interface '%s'", dev); - 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: - is_interface = TRUE; - /* - * We now have the numerical IP address in the 'myhost' buffer - */ - infof(data, "Local Interface %s is ip %s using address family %i", - dev, myhost, af); - done = 1; - break; - } } - if(!is_interface) { +#endif + if(!host_input) { + /* Discover IP from input device, then bind to it */ + if2ip_result = Curl_if2ip(af, +#ifdef USE_IPV6 + scope, conn->scope_id, +#endif + 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, "Couldn't bind to interface '%s' with errno %d: %s", + iface, error, Curl_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) { /* - * This was not an interface, resolve the name as a host name + * This was not an interface, resolve the name as a hostname * or IP number * * Temporarily force name resolution to use only the address type @@ -514,23 +679,24 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, if(af == AF_INET) conn->ip_version = CURL_IPRESOLVE_V4; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else if(af == AF_INET6) conn->ip_version = CURL_IPRESOLVE_V6; #endif - rc = Curl_resolv(data, dev, 80, FALSE, &h); + rc = Curl_resolv(data, host, 80, FALSE, &h); if(rc == CURLRESOLV_PENDING) (void)Curl_resolver_wait_resolv(data, &h); conn->ip_version = ipver; if(h) { + int h_af = h->addr->ai_family; /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */ Curl_printable_address(h->addr, myhost, sizeof(myhost)); infof(data, "Name '%s' family %i resolved to '%s' family %i", - dev, af, myhost, h->addr->ai_family); - Curl_resolv_unlock(data, h); - if(af != h->addr->ai_family) { + host, af, myhost, h_af); + Curl_resolv_unlink(data, &h); /* this will NULL, potential free h */ + if(af != h_af) { /* bad IP version combo, signal the caller to try another address family if available */ return CURLE_UNSUPPORTED_PROTOCOL; @@ -540,14 +706,14 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, else { /* * provided dev was no interface (or interfaces are not supported - * e.g. solaris) no ip address and no domain we fail here + * e.g. Solaris) no ip address and no domain we fail here */ done = -1; } } if(done > 0) { -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 /* IPv6 address */ if(af == AF_INET6) { #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID @@ -562,7 +728,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, if(scope_ptr) { /* The "myhost" string either comes from Curl_if2ip or from Curl_printable_address. The latter returns only numeric scope - IDs and the former returns none at all. So the scope ID, if + IDs and the former returns none at all. So the scope ID, if present, is known to be numeric */ unsigned long scope_id = strtoul(scope_ptr, NULL, 10); if(scope_id > UINT_MAX) @@ -589,14 +755,17 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, /* errorbuf is set false so failf will overwrite any message already in the error buffer, so the user receives this error message instead of a generic resolve error. */ + char buffer[STRERROR_LEN]; data->state.errorbuf = FALSE; - failf(data, "Couldn't bind to '%s'", dev); + data->state.os_errno = error = SOCKERRNO; + failf(data, "Couldn't bind to '%s' with errno %d: %s", + host, error, Curl_strerror(error, buffer, sizeof(buffer))); return CURLE_INTERFACE_FAILED; } } else { /* no device was given, prepare sa to match af's needs */ -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(af == AF_INET6) { si6->sin6_family = AF_INET6; si6->sin6_port = htons(port); @@ -616,16 +785,6 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, for(;;) { if(bind(sockfd, sock, sizeof_sa) >= 0) { /* we succeeded to bind */ - struct Curl_sockaddr_storage add; - curl_socklen_t size = sizeof(add); - memset(&add, 0, sizeof(struct Curl_sockaddr_storage)); - if(getsockname(sockfd, (struct sockaddr *) &add, &size) < 0) { - char buffer[STRERROR_LEN]; - data->state.os_errno = error = SOCKERRNO; - failf(data, "getsockname() failed with errno %d: %s", - error, Curl_strerror(error, buffer, sizeof(buffer))); - return CURLE_INTERFACE_FAILED; - } infof(data, "Local port: %hu", port); conn->bits.bound = TRUE; return CURLE_OK; @@ -639,7 +798,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, /* We reuse/clobber the port variable here below */ if(sock->sa_family == AF_INET) si4->sin_port = ntohs(port); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else si6->sin6_port = ntohs(port); #endif @@ -677,8 +836,8 @@ static bool verifyconnect(curl_socket_t sockfd, int *error) * Gisle Vanem could reproduce the former problems with this function, but * could avoid them by adding this SleepEx() call below: * - * "I don't have Rational Quantify, but the hint from his post was - * ntdll::NtRemoveIoCompletion(). So I'd assume the SleepEx (or maybe + * "I do not have Rational Quantify, but the hint from his post was + * ntdll::NtRemoveIoCompletion(). I would assume the SleepEx (or maybe * just Sleep(0) would be enough?) would release whatever * mutex/critical-section the ntdll call is waiting on. * @@ -696,14 +855,14 @@ static bool verifyconnect(curl_socket_t sockfd, int *error) if(0 != getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize)) err = SOCKERRNO; #ifdef _WIN32_WCE - /* Old WinCE versions don't support SO_ERROR */ + /* 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 doesn't support getsockopt on UDP sockets */ + /* Minix 3.1.x does not support getsockopt on UDP sockets */ if(EBADIOCTL == err) { SET_SOCKERRNO(0); err = 0; @@ -713,7 +872,7 @@ static bool verifyconnect(curl_socket_t sockfd, int *error) /* we are connected, awesome! */ rc = TRUE; else - /* This wasn't a successful connect */ + /* This was not a successful connect */ rc = FALSE; if(error) *error = err; @@ -775,14 +934,14 @@ struct cf_socket_ctx { int transport; struct Curl_sockaddr_ex addr; /* address to connect to */ curl_socket_t sock; /* current attempt socket */ - struct bufq recvbuf; /* used when `buffer_recv` is set */ - char r_ip[MAX_IPADR_LEN]; /* remote IP as string */ - int r_port; /* remote port number */ - char l_ip[MAX_IPADR_LEN]; /* local IP as string */ - int l_port; /* local port number */ + struct ip_quadruple ip; /* The IP quadruple 2x(addr+port) */ struct curltime started_at; /* when socket was created */ struct curltime connected_at; /* when socket connected/got first byte */ struct curltime first_byte_at; /* when first byte was recvd */ +#ifdef USE_WINSOCK + struct curltime last_sndbuf_query_at; /* when SO_SNDBUF last queried */ + ULONG sndbuf_size; /* the last set SO_SNDBUF size */ +#endif int error; /* errno of last failure or 0 */ #ifdef DEBUGBUILD int wblock_percent; /* percent of writes doing EAGAIN */ @@ -791,10 +950,10 @@ struct cf_socket_ctx { size_t recv_max; /* max enforced read size */ #endif BIT(got_first_byte); /* if first byte was received */ + BIT(listening); /* socket is listening */ BIT(accepted); /* socket was accepted, not connected */ BIT(sock_connected); /* socket is "connected", e.g. in UDP */ BIT(active); - BIT(buffer_recv); }; static void cf_socket_ctx_init(struct cf_socket_ctx *ctx, @@ -805,7 +964,6 @@ static void cf_socket_ctx_init(struct cf_socket_ctx *ctx, ctx->sock = CURL_SOCKET_BAD; ctx->transport = transport; Curl_sock_assign_addr(&ctx->addr, ai, transport); - Curl_bufq_init(&ctx->recvbuf, NW_RECV_CHUNK_SIZE, NW_RECV_CHUNKS); #ifdef DEBUGBUILD { char *p = getenv("CURL_DBG_SOCK_WBLOCK"); @@ -836,72 +994,19 @@ static void cf_socket_ctx_init(struct cf_socket_ctx *ctx, #endif } -struct reader_ctx { - struct Curl_cfilter *cf; - struct Curl_easy *data; -}; - -static ssize_t nw_in_read(void *reader_ctx, - unsigned char *buf, size_t len, - CURLcode *err) -{ - struct reader_ctx *rctx = reader_ctx; - struct cf_socket_ctx *ctx = rctx->cf->ctx; - ssize_t nread; - - *err = CURLE_OK; - nread = sread(ctx->sock, buf, len); - - if(-1 == nread) { - int sockerr = SOCKERRNO; - - if( -#ifdef WSAEWOULDBLOCK - /* This is how Windows does it */ - (WSAEWOULDBLOCK == sockerr) -#else - /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned - due to its inability to send off data without blocking. We therefore - treat both error codes the same here */ - (EWOULDBLOCK == sockerr) || (EAGAIN == sockerr) || (EINTR == sockerr) -#endif - ) { - /* this is just a case of EWOULDBLOCK */ - *err = CURLE_AGAIN; - nread = -1; - } - else { - char buffer[STRERROR_LEN]; - - failf(rctx->data, "Recv failure: %s", - Curl_strerror(sockerr, buffer, sizeof(buffer))); - rctx->data->state.os_errno = sockerr; - *err = CURLE_RECV_ERROR; - nread = -1; - } - } - CURL_TRC_CF(rctx->data, rctx->cf, "nw_in_read(len=%zu, fd=%" - CURL_FORMAT_SOCKET_T ") -> %d, err=%d", - len, ctx->sock, (int)nread, *err); - return nread; -} - static void cf_socket_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_socket_ctx *ctx = cf->ctx; if(ctx && CURL_SOCKET_BAD != ctx->sock) { - CURL_TRC_CF(data, cf, "cf_socket_close(%" CURL_FORMAT_SOCKET_T - ")", ctx->sock); + CURL_TRC_CF(data, cf, "cf_socket_close(%" FMT_SOCKET_T ")", ctx->sock); if(ctx->sock == cf->conn->sock[cf->sockindex]) cf->conn->sock[cf->sockindex] = CURL_SOCKET_BAD; socket_close(data, cf->conn, !ctx->accepted, ctx->sock); ctx->sock = CURL_SOCKET_BAD; if(ctx->active && cf->sockindex == FIRSTSOCKET) cf->conn->remote_addr = NULL; - Curl_bufq_reset(&ctx->recvbuf); ctx->active = FALSE; - ctx->buffer_recv = FALSE; memset(&ctx->started_at, 0, sizeof(ctx->started_at)); memset(&ctx->connected_at, 0, sizeof(ctx->connected_at)); } @@ -909,13 +1014,34 @@ static void cf_socket_close(struct Curl_cfilter *cf, struct Curl_easy *data) cf->connected = FALSE; } +static CURLcode cf_socket_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool *done) +{ + if(cf->connected) { + struct cf_socket_ctx *ctx = cf->ctx; + + CURL_TRC_CF(data, cf, "cf_socket_shutdown(%" FMT_SOCKET_T ")", ctx->sock); + /* On TCP, and when the socket looks well and non-blocking mode + * can be enabled, receive dangling bytes before close to avoid + * entering RST states unnecessarily. */ + if(ctx->sock != CURL_SOCKET_BAD && + ctx->transport == TRNSPRT_TCP && + (curlx_nonblock(ctx->sock, TRUE) >= 0)) { + unsigned char buf[1024]; + (void)sread(ctx->sock, buf, sizeof(buf)); + } + } + *done = TRUE; + return CURLE_OK; +} + static void cf_socket_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_socket_ctx *ctx = cf->ctx; cf_socket_close(cf, data); CURL_TRC_CF(data, cf, "destroy"); - Curl_bufq_free(&ctx->recvbuf); free(ctx); cf->ctx = NULL; } @@ -926,7 +1052,8 @@ static CURLcode set_local_ip(struct Curl_cfilter *cf, struct cf_socket_ctx *ctx = cf->ctx; #ifdef HAVE_GETSOCKNAME - if(!(data->conn->handler->protocol & CURLPROTO_TFTP)) { + if((ctx->sock != CURL_SOCKET_BAD) && + !(data->conn->handler->protocol & CURLPROTO_TFTP)) { /* TFTP does not connect, so it cannot get the IP like this */ char buffer[STRERROR_LEN]; @@ -941,7 +1068,7 @@ static CURLcode set_local_ip(struct Curl_cfilter *cf, return CURLE_FAILED_INIT; } if(!Curl_addr2string((struct sockaddr*)&ssloc, slen, - ctx->l_ip, &ctx->l_port)) { + ctx->ip.local_ip, &ctx->ip.local_port)) { failf(data, "ssloc inet_ntop() failed with errno %d: %s", errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_FAILED_INIT; @@ -949,8 +1076,8 @@ static CURLcode set_local_ip(struct Curl_cfilter *cf, } #else (void)data; - ctx->l_ip[0] = 0; - ctx->l_port = -1; + ctx->ip.local_ip[0] = 0; + ctx->ip.local_port = -1; #endif return CURLE_OK; } @@ -961,13 +1088,14 @@ 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 */ - if(!Curl_addr2string(&ctx->addr.sa_addr, ctx->addr.addrlen, - ctx->r_ip, &ctx->r_port)) { + if(!Curl_addr2string(&ctx->addr.curl_sa_addr, + (curl_socklen_t)ctx->addr.addrlen, + ctx->ip.remote_ip, &ctx->ip.remote_port)) { char buffer[STRERROR_LEN]; ctx->error = errno; /* malformed address or bug in inet_ntop, try next address */ - failf(data, "sa_addr inet_ntop() failed with errno %d: %s", + failf(data, "curl_sa_addr inet_ntop() failed with errno %d: %s", errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_FAILED_INIT; } @@ -986,7 +1114,20 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, (void)data; DEBUGASSERT(ctx->sock == CURL_SOCKET_BAD); ctx->started_at = Curl_now(); +#ifdef SOCK_NONBLOCK + /* Do not tuck SOCK_NONBLOCK into socktype when opensocket callback is set + * because we would not know how socketype is about to be used in the + * callback, SOCK_NONBLOCK might get factored out before calling socket(). + */ + if(!data->set.fopensocket) + ctx->addr.socktype |= SOCK_NONBLOCK; +#endif result = socket_open(data, &ctx->addr, &ctx->sock); +#ifdef SOCK_NONBLOCK + /* Restore the socktype after the socket is created. */ + if(!data->set.fopensocket) + ctx->addr.socktype &= ~SOCK_NONBLOCK; +#endif if(result) goto out; @@ -994,16 +1135,16 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, if(result) goto out; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(ctx->addr.family == AF_INET6) { set_ipv6_v6only(ctx->sock, 0); - infof(data, " Trying [%s]:%d...", ctx->r_ip, ctx->r_port); + infof(data, " Trying [%s]:%d...", ctx->ip.remote_ip, ctx->ip.remote_port); } else #endif - infof(data, " Trying %s:%d...", ctx->r_ip, ctx->r_port); + infof(data, " Trying %s:%d...", ctx->ip.remote_ip, ctx->ip.remote_port); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 is_tcp = (ctx->addr.family == AF_INET || ctx->addr.family == AF_INET6) && ctx->addr.socktype == SOCK_STREAM; @@ -1016,18 +1157,18 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, nosigpipe(data, ctx->sock); - Curl_sndbufset(ctx->sock); + Curl_sndbuf_init(ctx->sock); if(is_tcp && data->set.tcp_keepalive) tcpkeepalive(data, ctx->sock); if(data->set.fsockopt) { /* activate callback for setting socket options */ - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); error = data->set.fsockopt(data->set.sockopt_client, ctx->sock, CURLSOCKTYPE_IPCXN); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(error == CURL_SOCKOPT_ALREADY_CONNECTED) isconnected = TRUE; @@ -1040,12 +1181,12 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, #ifndef CURL_DISABLE_BINDLOCAL /* possibly bind the local end to an IP, interface or port */ if(ctx->addr.family == AF_INET -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 || ctx->addr.family == AF_INET6 #endif ) { result = bindlocal(data, cf->conn, ctx->sock, ctx->addr.family, - Curl_ipv6_scope(&ctx->addr.sa_addr)); + Curl_ipv6_scope(&ctx->addr.curl_sa_addr)); if(result) { if(result == CURLE_UNSUPPORTED_PROTOCOL) { /* The address family is not supported on this interface. @@ -1057,8 +1198,27 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, } #endif - /* set socket non-blocking */ - (void)curlx_nonblock(ctx->sock, TRUE); +#ifndef SOCK_NONBLOCK + /* Set socket non-blocking, must be a non-blocking socket for + * a non-blocking connect. */ + error = curlx_nonblock(ctx->sock, TRUE); + if(error < 0) { + result = CURLE_UNSUPPORTED_PROTOCOL; + ctx->error = SOCKERRNO; + goto out; + } +#else + if(data->set.fopensocket) { + /* Set socket non-blocking, must be a non-blocking socket for + * a non-blocking connect. */ + error = curlx_nonblock(ctx->sock, TRUE); + if(error < 0) { + result = CURLE_UNSUPPORTED_PROTOCOL; + ctx->error = SOCKERRNO; + goto out; + } + } +#endif ctx->sock_connected = (ctx->addr.socktype != SOCK_DGRAM); out: if(result) { @@ -1072,7 +1232,7 @@ out: ctx->connected_at = Curl_now(); cf->connected = TRUE; } - CURL_TRC_CF(data, cf, "cf_socket_open() -> %d, fd=%" CURL_FORMAT_SOCKET_T, + CURL_TRC_CF(data, cf, "cf_socket_open() -> %d, fd=%" FMT_SOCKET_T, result, ctx->sock); return result; } @@ -1098,7 +1258,7 @@ static int do_connect(struct Curl_cfilter *cf, struct Curl_easy *data, endpoints.sae_srcif = 0; endpoints.sae_srcaddr = NULL; endpoints.sae_srcaddrlen = 0; - endpoints.sae_dstaddr = &ctx->addr.sa_addr; + endpoints.sae_dstaddr = &ctx->addr.curl_sa_addr; endpoints.sae_dstaddrlen = ctx->addr.addrlen; rc = connectx(ctx->sock, &endpoints, SAE_ASSOCID_ANY, @@ -1106,27 +1266,28 @@ static int do_connect(struct Curl_cfilter *cf, struct Curl_easy *data, NULL, 0, NULL, NULL); } else { - rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen); + rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen); } # else - rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen); + rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen); # endif /* HAVE_BUILTIN_AVAILABLE */ #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 %" - CURL_FORMAT_SOCKET_T, ctx->sock); + infof(data, "Failed to enable TCP Fast Open on fd %" FMT_SOCKET_T, + ctx->sock); - rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen); + rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen); #elif defined(MSG_FASTOPEN) /* old Linux */ if(cf->conn->given->flags & PROTOPT_SSL) - rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen); + rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen); else rc = 0; /* Do nothing */ #endif } else { - rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen); + rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, + (curl_socklen_t)ctx->addr.addrlen); } return rc; } @@ -1149,7 +1310,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf, if(blocking) return CURLE_UNSUPPORTED_PROTOCOL; - *done = FALSE; /* a very negative world view is best */ + *done = FALSE; /* a negative world view is best */ if(ctx->sock == CURL_SOCKET_BAD) { int error; @@ -1167,9 +1328,9 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf, error = SOCKERRNO; set_local_ip(cf, data); CURL_TRC_CF(data, cf, "local address %s port %d...", - ctx->l_ip, ctx->l_port); + ctx->ip.local_ip, ctx->ip.local_port); if(-1 == rc) { - result = socket_connect_result(data, ctx->r_ip, error); + result = socket_connect_result(data, ctx->ip.remote_ip, error); goto out; } } @@ -1214,7 +1375,8 @@ out: { char buffer[STRERROR_LEN]; infof(data, "connect to %s port %u from %s port %d failed: %s", - ctx->r_ip, ctx->r_port, ctx->l_ip, ctx->l_port, + ctx->ip.remote_ip, ctx->ip.remote_port, + ctx->ip.local_ip, ctx->ip.local_port, Curl_strerror(ctx->error, buffer, sizeof(buffer))); } #endif @@ -1234,10 +1396,11 @@ static void cf_socket_get_host(struct Curl_cfilter *cf, const char **pdisplay_host, int *pport) { + struct cf_socket_ctx *ctx = cf->ctx; (void)data; *phost = cf->conn->host.name; *pdisplay_host = cf->conn->host.dispname; - *pport = cf->conn->port; + *pport = ctx->ip.remote_port; } static void cf_socket_adjust_pollset(struct Curl_cfilter *cf, @@ -1247,15 +1410,24 @@ static void cf_socket_adjust_pollset(struct Curl_cfilter *cf, struct cf_socket_ctx *ctx = cf->ctx; if(ctx->sock != CURL_SOCKET_BAD) { - if(!cf->connected) { + /* A listening socket filter needs to be connected before the accept + * for some weird FTP interaction. This should be rewritten, so that + * FTP no longer does the socket checks and accept calls and delegates + * all that to the filter. TODO. */ + if(ctx->listening) { + Curl_pollset_set_in_only(data, ps, ctx->sock); + CURL_TRC_CF(data, cf, "adjust_pollset, listening, POLLIN fd=%" + FMT_SOCKET_T, ctx->sock); + } + else if(!cf->connected) { Curl_pollset_set_out_only(data, ps, ctx->sock); CURL_TRC_CF(data, cf, "adjust_pollset, !connected, POLLOUT fd=%" - CURL_FORMAT_SOCKET_T, ctx->sock); + FMT_SOCKET_T, ctx->sock); } else if(!ctx->active) { Curl_pollset_add_in(data, ps, ctx->sock); CURL_TRC_CF(data, cf, "adjust_pollset, !active, POLLIN fd=%" - CURL_FORMAT_SOCKET_T, ctx->sock); + FMT_SOCKET_T, ctx->sock); } } } @@ -1267,21 +1439,46 @@ static bool cf_socket_data_pending(struct Curl_cfilter *cf, int readable; (void)data; - if(!Curl_bufq_is_empty(&ctx->recvbuf)) - return TRUE; - readable = SOCKET_READABLE(ctx->sock, 0); return (readable > 0 && (readable & CURL_CSELECT_IN)); } +#ifdef USE_WINSOCK + +#ifndef SIO_IDEAL_SEND_BACKLOG_QUERY +#define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747B +#endif + +static void win_update_sndbuf_size(struct cf_socket_ctx *ctx) +{ + ULONG ideal; + DWORD ideallen; + struct curltime n = Curl_now(); + + if(Curl_timediff(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 && + !setsockopt(ctx->sock, SOL_SOCKET, SO_SNDBUF, + (const char *)&ideal, sizeof(ideal))) { + ctx->sndbuf_size = ideal; + } + ctx->last_sndbuf_query_at = n; + } +} + +#endif /* USE_WINSOCK */ + static ssize_t cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_socket_ctx *ctx = cf->ctx; curl_socket_t fdsave; ssize_t nwritten; size_t orig_len = len; + (void)eos; /* unused */ *err = CURLE_OK; fdsave = cf->conn->sock[cf->sockindex]; cf->conn->sock[cf->sockindex] = ctx->sock; @@ -1289,8 +1486,8 @@ static ssize_t cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, #ifdef DEBUGBUILD /* simulate network blocking/partial writes */ if(ctx->wblock_percent > 0) { - unsigned char c; - Curl_rand(data, &c, 1); + unsigned char c = 0; + Curl_rand_bytes(data, FALSE, &c, 1); if(c >= ((100-ctx->wblock_percent)*256/100)) { CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE EWOULDBLOCK", orig_len); *err = CURLE_AGAIN; @@ -1311,7 +1508,7 @@ static ssize_t 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, - &cf->conn->remote_addr->sa_addr, + &cf->conn->remote_addr->curl_sa_addr, cf->conn->remote_addr->addrlen); cf->conn->bits.tcp_fastopen = FALSE; } @@ -1346,6 +1543,11 @@ static ssize_t cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, } } +#if defined(USE_WINSOCK) + if(!*err) + win_update_sndbuf_size(ctx); +#endif + CURL_TRC_CF(data, cf, "send(len=%zu) -> %d, err=%d", orig_len, (int)nwritten, *err); cf->conn->sock[cf->sockindex] = fdsave; @@ -1356,25 +1558,19 @@ static ssize_t cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err) { struct cf_socket_ctx *ctx = cf->ctx; - curl_socket_t fdsave; ssize_t nread; *err = CURLE_OK; - fdsave = cf->conn->sock[cf->sockindex]; - cf->conn->sock[cf->sockindex] = ctx->sock; - #ifdef DEBUGBUILD /* simulate network blocking/partial reads */ if(cf->cft != &Curl_cft_udp && ctx->rblock_percent > 0) { - unsigned char c; + unsigned char c = 0; Curl_rand(data, &c, 1); if(c >= ((100-ctx->rblock_percent)*256/100)) { CURL_TRC_CF(data, cf, "recv(len=%zu) SIMULATE EWOULDBLOCK", len); *err = CURLE_AGAIN; - nread = -1; - cf->conn->sock[cf->sockindex] = fdsave; - return nread; + return -1; } } if(cf->cft != &Curl_cft_udp && ctx->recv_max && ctx->recv_max < len) { @@ -1385,65 +1581,55 @@ static ssize_t cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, } #endif - if(ctx->buffer_recv && !Curl_bufq_is_empty(&ctx->recvbuf)) { - CURL_TRC_CF(data, cf, "recv from buffer"); - nread = Curl_bufq_read(&ctx->recvbuf, (unsigned char *)buf, len, err); - } - else { - struct reader_ctx rctx; + *err = CURLE_OK; + nread = sread(ctx->sock, buf, len); - rctx.cf = cf; - rctx.data = data; + if(-1 == nread) { + int sockerr = SOCKERRNO; - /* "small" reads may trigger filling our buffer, "large" reads - * are probably not worth the additional copy */ - if(ctx->buffer_recv && len < NW_SMALL_READS) { - ssize_t nwritten; - nwritten = Curl_bufq_slurp(&ctx->recvbuf, nw_in_read, &rctx, err); - if(nwritten < 0 && !Curl_bufq_is_empty(&ctx->recvbuf)) { - /* we have a partial read with an error. need to deliver - * what we got, return the error later. */ - CURL_TRC_CF(data, cf, "partial read: empty buffer first"); - nread = Curl_bufq_read(&ctx->recvbuf, (unsigned char *)buf, len, err); - } - else if(nwritten < 0) { - nread = -1; - goto out; - } - else if(nwritten == 0) { - /* eof */ - *err = CURLE_OK; - nread = 0; - } - else { - CURL_TRC_CF(data, cf, "buffered %zd additional bytes", nwritten); - nread = Curl_bufq_read(&ctx->recvbuf, (unsigned char *)buf, len, err); - } + if( +#ifdef WSAEWOULDBLOCK + /* This is how Windows does it */ + (WSAEWOULDBLOCK == sockerr) +#else + /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned + due to its inability to send off data without blocking. We therefore + treat both error codes the same here */ + (EWOULDBLOCK == sockerr) || (EAGAIN == sockerr) || (EINTR == sockerr) +#endif + ) { + /* this is just a case of EWOULDBLOCK */ + *err = CURLE_AGAIN; } else { - nread = nw_in_read(&rctx, (unsigned char *)buf, len, err); + char buffer[STRERROR_LEN]; + + failf(data, "Recv failure: %s", + Curl_strerror(sockerr, buffer, sizeof(buffer))); + data->state.os_errno = sockerr; + *err = CURLE_RECV_ERROR; } } -out: CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, err=%d", len, (int)nread, *err); if(nread > 0 && !ctx->got_first_byte) { ctx->first_byte_at = Curl_now(); ctx->got_first_byte = TRUE; } - cf->conn->sock[cf->sockindex] = fdsave; return nread; } -static void conn_set_primary_ip(struct Curl_cfilter *cf, - struct Curl_easy *data) +static void cf_socket_update_data(struct Curl_cfilter *cf, + struct Curl_easy *data) { - struct cf_socket_ctx *ctx = cf->ctx; - - (void)data; - DEBUGASSERT(sizeof(ctx->r_ip) == sizeof(cf->conn->primary_ip)); - memcpy(cf->conn->primary_ip, ctx->r_ip, sizeof(cf->conn->primary_ip)); + /* Update the IP info held in the transfer, if we have that. */ + if(cf->connected && (cf->sockindex == FIRSTSOCKET)) { + struct cf_socket_ctx *ctx = cf->ctx; + data->info.primary = ctx->ip; + /* not sure if this is redundant... */ + data->info.conn_remote_port = cf->conn->remote_port; + } } static void cf_socket_active(struct Curl_cfilter *cf, struct Curl_easy *data) @@ -1452,20 +1638,16 @@ static void cf_socket_active(struct Curl_cfilter *cf, struct Curl_easy *data) /* use this socket from now on */ cf->conn->sock[cf->sockindex] = ctx->sock; - /* the first socket info gets set at conn and data */ + set_local_ip(cf, data); if(cf->sockindex == FIRSTSOCKET) { + cf->conn->primary = ctx->ip; cf->conn->remote_addr = &ctx->addr; - #ifdef ENABLE_IPV6 - cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6)? TRUE : FALSE; + #ifdef USE_IPV6 + cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6); #endif - conn_set_primary_ip(cf, data); - set_local_ip(cf, data); - Curl_persistconninfo(data, cf->conn, ctx->l_ip, ctx->l_port); - /* buffering is currently disabled by default because we have stalls - * in parallel transfers where not all buffered data is consumed and no - * socket events happen. - */ - ctx->buffer_recv = FALSE; + } + else { + cf->conn->secondary = ctx->ip; } ctx->active = TRUE; } @@ -1481,9 +1663,10 @@ static CURLcode cf_socket_cntrl(struct Curl_cfilter *cf, switch(event) { case CF_CTRL_CONN_INFO_UPDATE: cf_socket_active(cf, data); + cf_socket_update_data(cf, data); break; case CF_CTRL_DATA_SETUP: - Curl_persistconninfo(data, cf->conn, ctx->l_ip, ctx->l_port); + cf_socket_update_data(cf, data); break; case CF_CTRL_FORGET_SOCKET: ctx->sock = CURL_SOCKET_BAD; @@ -1543,7 +1726,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf, case CF_QUERY_CONNECT_REPLY_MS: if(ctx->got_first_byte) { timediff_t ms = Curl_timediff(ctx->first_byte_at, ctx->started_at); - *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX; + *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else *pres1 = -1; @@ -1566,10 +1749,18 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf, } return CURLE_OK; } + case CF_QUERY_IP_INFO: +#ifdef USE_IPV6 + *pres1 = (ctx->addr.family == AF_INET6); +#else + *pres1 = FALSE; +#endif + *(struct ip_quadruple *)pres2 = ctx->ip; + return CURLE_OK; default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -1581,6 +1772,7 @@ struct Curl_cftype Curl_cft_tcp = { cf_socket_destroy, cf_tcp_connect, cf_socket_close, + cf_socket_shutdown, cf_socket_get_host, cf_socket_adjust_pollset, cf_socket_data_pending, @@ -1615,7 +1807,7 @@ CURLcode Curl_cf_tcp_create(struct Curl_cfilter **pcf, result = Curl_cf_create(&cf, &Curl_cft_tcp, ctx); out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { Curl_safefree(cf); Curl_safefree(ctx); @@ -1625,32 +1817,35 @@ out: } static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf, - struct Curl_easy *data) + 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); -#if defined(__APPLE__) && defined(USE_OPENSSL_QUIC) - (void)rc; - /* On macOS OpenSSL QUIC fails on connected sockets. - * see: */ -#else - rc = connect(ctx->sock, &ctx->addr.sa_addr, ctx->addr.addrlen); + rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, + (curl_socklen_t)ctx->addr.addrlen); if(-1 == rc) { - return socket_connect_result(data, ctx->r_ip, SOCKERRNO); + return socket_connect_result(data, ctx->ip.remote_ip, SOCKERRNO); } ctx->sock_connected = TRUE; -#endif set_local_ip(cf, data); - CURL_TRC_CF(data, cf, "%s socket %" CURL_FORMAT_SOCKET_T + CURL_TRC_CF(data, cf, "%s socket %" FMT_SOCKET_T " connected: [%s:%d] -> [%s:%d]", - (ctx->transport == TRNSPRT_QUIC)? "QUIC" : "UDP", - ctx->sock, ctx->l_ip, ctx->l_port, ctx->r_ip, ctx->r_port); + (ctx->transport == TRNSPRT_QUIC) ? "QUIC" : "UDP", + ctx->sock, ctx->ip.local_ip, ctx->ip.local_port, + ctx->ip.remote_ip, ctx->ip.remote_port); - (void)curlx_nonblock(ctx->sock, TRUE); + /* Currently, cf->ctx->sock is always non-blocking because the only + * caller to cf_udp_setup_quic() is cf_udp_connect() that passes the + * 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. + */ switch(ctx->addr.family) { #if defined(__linux__) && defined(IP_MTU_DISCOVER) case AF_INET: { @@ -1669,6 +1864,14 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf, } #endif } + +#if defined(__linux__) && 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 + return CURLE_OK; } @@ -1697,12 +1900,12 @@ static CURLcode cf_udp_connect(struct Curl_cfilter *cf, if(result) goto out; CURL_TRC_CF(data, cf, "cf_udp_connect(), opened socket=%" - CURL_FORMAT_SOCKET_T " (%s:%d)", - ctx->sock, ctx->l_ip, ctx->l_port); + FMT_SOCKET_T " (%s:%d)", + ctx->sock, ctx->ip.local_ip, ctx->ip.local_port); } else { CURL_TRC_CF(data, cf, "cf_udp_connect(), opened socket=%" - CURL_FORMAT_SOCKET_T " (unconnected)", ctx->sock); + FMT_SOCKET_T " (unconnected)", ctx->sock); } *done = TRUE; cf->connected = TRUE; @@ -1718,6 +1921,7 @@ struct Curl_cftype Curl_cft_udp = { cf_socket_destroy, cf_udp_connect, cf_socket_close, + cf_socket_shutdown, cf_socket_get_host, cf_socket_adjust_pollset, cf_socket_data_pending, @@ -1752,7 +1956,7 @@ CURLcode Curl_cf_udp_create(struct Curl_cfilter **pcf, result = Curl_cf_create(&cf, &Curl_cft_udp, ctx); out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { Curl_safefree(cf); Curl_safefree(ctx); @@ -1769,6 +1973,7 @@ struct Curl_cftype Curl_cft_unix = { cf_socket_destroy, cf_tcp_connect, cf_socket_close, + cf_socket_shutdown, cf_socket_get_host, cf_socket_adjust_pollset, cf_socket_data_pending, @@ -1803,7 +2008,7 @@ CURLcode Curl_cf_unix_create(struct Curl_cfilter **pcf, result = Curl_cf_create(&cf, &Curl_cft_unix, ctx); out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { Curl_safefree(cf); Curl_safefree(ctx); @@ -1812,10 +2017,84 @@ out: return result; } +static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + struct cf_socket_ctx *ctx = cf->ctx; + timediff_t timeout_ms = DEFAULT_ACCEPT_TIMEOUT; + timediff_t other; + struct curltime now; + +#ifndef CURL_DISABLE_FTP + if(data->set.accepttimeout > 0) + timeout_ms = data->set.accepttimeout; +#endif + + now = Curl_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 + due to it already having elapsed */ + timeout_ms = other; + else { + /* subtract elapsed time */ + timeout_ms -= Curl_timediff(now, ctx->started_at); + if(!timeout_ms) + /* avoid returning 0 as that means no timeout! */ + timeout_ms = -1; + } + return timeout_ms; +} + +static void cf_tcp_set_accepted_remote_ip(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + struct cf_socket_ctx *ctx = cf->ctx; +#ifdef HAVE_GETPEERNAME + char buffer[STRERROR_LEN]; + struct Curl_sockaddr_storage ssrem; + curl_socklen_t plen; + + ctx->ip.remote_ip[0] = 0; + ctx->ip.remote_port = 0; + plen = sizeof(ssrem); + memset(&ssrem, 0, plen); + if(getpeername(ctx->sock, (struct sockaddr*) &ssrem, &plen)) { + int error = SOCKERRNO; + failf(data, "getpeername() failed with errno %d: %s", + error, Curl_strerror(error, buffer, sizeof(buffer))); + return; + } + 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, Curl_strerror(errno, buffer, sizeof(buffer))); + return; + } +#else + ctx->ip.remote_ip[0] = 0; + ctx->ip.remote_port = 0; + (void)data; +#endif +} + static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, struct Curl_easy *data, bool blocking, bool *done) { + struct cf_socket_ctx *ctx = cf->ctx; +#ifdef USE_IPV6 + struct Curl_sockaddr_storage add; +#else + struct sockaddr_in add; +#endif + curl_socklen_t size = (curl_socklen_t) sizeof(add); + curl_socket_t s_accepted = CURL_SOCKET_BAD; + timediff_t timeout_ms; + int socketstate = 0; + bool incoming = FALSE; + /* we start accepted, if we ever close, we cannot go on */ (void)data; (void)blocking; @@ -1823,7 +2102,79 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, *done = TRUE; return CURLE_OK; } - return CURLE_FAILED_INIT; + + timeout_ms = cf_tcp_accept_timeleft(cf, data); + if(timeout_ms < 0) { + /* if a timeout was already reached, bail out */ + failf(data, "Accept timeout occurred while waiting server connect"); + return CURLE_FTP_ACCEPT_TIMEOUT; + } + + CURL_TRC_CF(data, cf, "Checking for incoming on fd=%" FMT_SOCKET_T + " ip=%s:%d", ctx->sock, ctx->ip.local_ip, ctx->ip.local_port); + socketstate = Curl_socket_check(ctx->sock, CURL_SOCKET_BAD, + CURL_SOCKET_BAD, 0); + CURL_TRC_CF(data, cf, "socket_check -> %x", socketstate); + switch(socketstate) { + case -1: /* error */ + /* let's die here */ + failf(data, "Error while waiting for server connect"); + return CURLE_FTP_ACCEPT_FAILED; + default: + if(socketstate & CURL_CSELECT_IN) { + infof(data, "Ready to accept data connection from server"); + incoming = TRUE; + } + break; + } + + if(!incoming) { + CURL_TRC_CF(data, cf, "nothing heard from the server yet"); + *done = FALSE; + return CURLE_OK; + } + + if(0 == getsockname(ctx->sock, (struct sockaddr *) &add, &size)) { + size = sizeof(add); + s_accepted = accept(ctx->sock, (struct sockaddr *) &add, &size); + } + + if(CURL_SOCKET_BAD == s_accepted) { + failf(data, "Error accept()ing server connect"); + return CURLE_FTP_PORT_FAILED; + } + + infof(data, "Connection accepted from server"); + (void)curlx_nonblock(s_accepted, TRUE); /* enable non-blocking */ + /* Replace any filter on SECONDARY with one listening on this socket */ + ctx->listening = FALSE; + ctx->accepted = TRUE; + socket_close(data, cf->conn, TRUE, ctx->sock); + ctx->sock = s_accepted; + + cf->conn->sock[cf->sockindex] = ctx->sock; + cf_tcp_set_accepted_remote_ip(cf, data); + set_local_ip(cf, data); + ctx->active = TRUE; + ctx->connected_at = Curl_now(); + cf->connected = TRUE; + CURL_TRC_CF(data, cf, "accepted_set(sock=%" FMT_SOCKET_T + ", remote=%s port=%d)", + ctx->sock, ctx->ip.remote_ip, ctx->ip.remote_port); + + if(data->set.fsockopt) { + int error = 0; + + /* activate callback for setting socket options */ + Curl_set_in_callback(data, true); + error = data->set.fsockopt(data->set.sockopt_client, + ctx->sock, CURLSOCKTYPE_ACCEPT); + Curl_set_in_callback(data, false); + + if(error) + return CURLE_ABORTED_BY_CALLBACK; + } + return CURLE_OK; } struct Curl_cftype Curl_cft_tcp_accept = { @@ -1833,6 +2184,7 @@ struct Curl_cftype Curl_cft_tcp_accept = { cf_socket_destroy, cf_tcp_accept_connect, cf_socket_close, + cf_socket_shutdown, cf_socket_get_host, /* TODO: not accurate */ cf_socket_adjust_pollset, cf_socket_data_pending, @@ -1863,19 +2215,19 @@ CURLcode Curl_conn_tcp_listen_set(struct Curl_easy *data, } ctx->transport = conn->transport; ctx->sock = *s; + ctx->listening = TRUE; ctx->accepted = FALSE; result = Curl_cf_create(&cf, &Curl_cft_tcp_accept, ctx); if(result) goto out; Curl_conn_cf_add(data, conn, sockindex, cf); + ctx->started_at = Curl_now(); conn->sock[sockindex] = ctx->sock; set_local_ip(cf, data); - ctx->active = TRUE; - ctx->connected_at = Curl_now(); - cf->connected = TRUE; - CURL_TRC_CF(data, cf, "Curl_conn_tcp_listen_set(%" - CURL_FORMAT_SOCKET_T ")", ctx->sock); + CURL_TRC_CF(data, cf, "set filter for listen socket fd=%" FMT_SOCKET_T + " ip=%s:%d", ctx->sock, + ctx->ip.local_ip, ctx->ip.local_port); out: if(result) { @@ -1885,65 +2237,16 @@ out: return result; } -static void set_accepted_remote_ip(struct Curl_cfilter *cf, - struct Curl_easy *data) +bool Curl_conn_is_tcp_listen(struct Curl_easy *data, + int sockindex) { - struct cf_socket_ctx *ctx = cf->ctx; -#ifdef HAVE_GETPEERNAME - char buffer[STRERROR_LEN]; - struct Curl_sockaddr_storage ssrem; - curl_socklen_t plen; - - ctx->r_ip[0] = 0; - ctx->r_port = 0; - plen = sizeof(ssrem); - memset(&ssrem, 0, plen); - if(getpeername(ctx->sock, (struct sockaddr*) &ssrem, &plen)) { - int error = SOCKERRNO; - failf(data, "getpeername() failed with errno %d: %s", - error, Curl_strerror(error, buffer, sizeof(buffer))); - return; + struct Curl_cfilter *cf = data->conn->cfilter[sockindex]; + while(cf) { + if(cf->cft == &Curl_cft_tcp_accept) + return TRUE; + cf = cf->next; } - if(!Curl_addr2string((struct sockaddr*)&ssrem, plen, - ctx->r_ip, &ctx->r_port)) { - failf(data, "ssrem inet_ntop() failed with errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - return; - } -#else - ctx->r_ip[0] = 0; - ctx->r_port = 0; - (void)data; -#endif -} - -CURLcode Curl_conn_tcp_accepted_set(struct Curl_easy *data, - struct connectdata *conn, - int sockindex, curl_socket_t *s) -{ - struct Curl_cfilter *cf = NULL; - struct cf_socket_ctx *ctx = NULL; - - cf = conn->cfilter[sockindex]; - if(!cf || cf->cft != &Curl_cft_tcp_accept) - return CURLE_FAILED_INIT; - - ctx = cf->ctx; - /* discard the listen socket */ - socket_close(data, conn, TRUE, ctx->sock); - ctx->sock = *s; - conn->sock[sockindex] = ctx->sock; - set_accepted_remote_ip(cf, data); - set_local_ip(cf, data); - ctx->active = TRUE; - ctx->accepted = TRUE; - ctx->connected_at = Curl_now(); - cf->connected = TRUE; - CURL_TRC_CF(data, cf, "accepted_set(sock=%" CURL_FORMAT_SOCKET_T - ", remote=%s port=%d)", - ctx->sock, ctx->r_ip, ctx->r_port); - - return CURLE_OK; + return FALSE; } /** @@ -1961,9 +2264,9 @@ CURLcode Curl_cf_socket_peek(struct Curl_cfilter *cf, struct Curl_easy *data, curl_socket_t *psock, const struct Curl_sockaddr_ex **paddr, - const char **pr_ip_str, int *pr_port, - const char **pl_ip_str, int *pl_port) + struct ip_quadruple *pip) { + (void)data; if(cf_is_socket(cf) && cf->ctx) { struct cf_socket_ctx *ctx = cf->ctx; @@ -1971,17 +2274,8 @@ CURLcode Curl_cf_socket_peek(struct Curl_cfilter *cf, *psock = ctx->sock; if(paddr) *paddr = &ctx->addr; - if(pr_ip_str) - *pr_ip_str = ctx->r_ip; - if(pr_port) - *pr_port = ctx->r_port; - if(pl_port ||pl_ip_str) { - set_local_ip(cf, data); - if(pl_ip_str) - *pl_ip_str = ctx->l_ip; - if(pl_port) - *pl_port = ctx->l_port; - } + if(pip) + *pip = ctx->ip; return CURLE_OK; } return CURLE_FAILED_INIT; diff --git a/deps/curl/lib/cf-socket.h b/deps/curl/lib/cf-socket.h index 87e0f30a..65103490 100644 --- a/deps/curl/lib/cf-socket.h +++ b/deps/curl/lib/cf-socket.h @@ -33,6 +33,7 @@ struct Curl_cfilter; struct Curl_easy; struct connectdata; struct Curl_sockaddr_ex; +struct ip_quadruple; /* * The Curl_sockaddr_ex structure is basically libcurl's external API @@ -51,8 +52,13 @@ struct Curl_sockaddr_ex { struct Curl_sockaddr_storage buff; } _sa_ex_u; }; -#define sa_addr _sa_ex_u.addr +#define curl_sa_addr _sa_ex_u.addr +/* + * 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); /* * Create a socket based on info from 'conn' and 'ai'. @@ -80,9 +86,9 @@ int Curl_socket_close(struct Curl_easy *data, struct connectdata *conn, Buffer Size */ -void Curl_sndbufset(curl_socket_t sockfd); +void Curl_sndbuf_init(curl_socket_t sockfd); #else -#define Curl_sndbufset(y) Curl_nop_stmt +#define Curl_sndbuf_init(y) Curl_nop_stmt #endif /** @@ -141,30 +147,25 @@ CURLcode Curl_conn_tcp_listen_set(struct Curl_easy *data, curl_socket_t *s); /** - * Replace the listen socket with the accept()ed one. + * Return TRUE iff the last filter at `sockindex` was set via + * Curl_conn_tcp_listen_set(). */ -CURLcode Curl_conn_tcp_accepted_set(struct Curl_easy *data, - struct connectdata *conn, - int sockindex, - curl_socket_t *s); +bool Curl_conn_is_tcp_listen(struct Curl_easy *data, + int sockindex); /** * Peek at the socket and remote ip/port the socket filter is using. * The filter owns all returned values. * @param psock pointer to hold socket descriptor or NULL * @param paddr pointer to hold addr reference or NULL - * @param pr_ip_str pointer to hold remote addr as string or NULL - * @param pr_port pointer to hold remote port number or NULL - * @param pl_ip_str pointer to hold local addr as string or NULL - * @param pl_port pointer to hold local port number or NULL + * @param pip pointer to get IP quadruple or NULL * Returns error if the filter is of invalid type. */ CURLcode Curl_cf_socket_peek(struct Curl_cfilter *cf, struct Curl_easy *data, curl_socket_t *psock, const struct Curl_sockaddr_ex **paddr, - const char **pr_ip_str, int *pr_port, - const char **pl_ip_str, int *pl_port); + struct ip_quadruple *pip); extern struct Curl_cftype Curl_cft_tcp; extern struct Curl_cftype Curl_cft_udp; diff --git a/deps/curl/lib/cfilters.c b/deps/curl/lib/cfilters.c index 4e4c8e56..ca1d7b33 100644 --- a/deps/curl/lib/cfilters.c +++ b/deps/curl/lib/cfilters.c @@ -45,7 +45,10 @@ #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) #endif -#ifdef DEBUGBUILD +static void cf_cntrl_update_info(struct Curl_easy *data, + struct connectdata *conn); + +#ifdef UNITTESTS /* used by unit2600.c */ void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data) { @@ -55,6 +58,15 @@ void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data) } #endif +CURLcode Curl_cf_def_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + (void)cf; + (void)data; + *done = TRUE; + return CURLE_OK; +} + static void conn_report_connect_stats(struct Curl_easy *data, struct connectdata *conn); @@ -67,7 +79,7 @@ void Curl_cf_def_get_host(struct Curl_cfilter *cf, struct Curl_easy *data, else { *phost = cf->conn->host.name; *pdisplay_host = cf->conn->host.dispname; - *pport = cf->conn->port; + *pport = cf->conn->primary.remote_port; } } @@ -84,22 +96,23 @@ void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { - return cf->next? + return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE; } ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { - return cf->next? - cf->next->cft->do_send(cf->next, data, buf, len, err) : + return cf->next ? + cf->next->cft->do_send(cf->next, data, buf, len, eos, err) : CURLE_RECV_ERROR; } ssize_t Curl_cf_def_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err) { - return cf->next? + return cf->next ? cf->next->cft->do_recv(cf->next, data, buf, len, err) : CURLE_SEND_ERROR; } @@ -108,7 +121,7 @@ bool Curl_cf_def_conn_is_alive(struct Curl_cfilter *cf, struct Curl_easy *data, bool *input_pending) { - return cf->next? + return cf->next ? cf->next->cft->is_alive(cf->next, data, input_pending) : FALSE; /* pessimistic in absence of data */ } @@ -116,7 +129,7 @@ bool Curl_cf_def_conn_is_alive(struct Curl_cfilter *cf, CURLcode Curl_cf_def_conn_keep_alive(struct Curl_cfilter *cf, struct Curl_easy *data) { - return cf->next? + return cf->next ? cf->next->cft->keep_alive(cf->next, data) : CURLE_OK; } @@ -125,7 +138,7 @@ CURLcode Curl_cf_def_query(struct Curl_cfilter *cf, struct Curl_easy *data, int query, int *pres1, void *pres2) { - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -166,6 +179,62 @@ void Curl_conn_close(struct Curl_easy *data, int index) if(cf) { cf->cft->do_close(cf, data); } + Curl_shutdown_clear(data, index); +} + +CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done) +{ + struct Curl_cfilter *cf; + CURLcode result = CURLE_OK; + timediff_t timeout_ms; + struct curltime now; + + DEBUGASSERT(data->conn); + /* Get the first connected filter that is not shut down already. */ + cf = data->conn->cfilter[sockindex]; + while(cf && (!cf->connected || cf->shutdown)) + cf = cf->next; + + if(!cf) { + *done = TRUE; + return CURLE_OK; + } + + *done = FALSE; + now = Curl_now(); + if(!Curl_shutdown_started(data, sockindex)) { + DEBUGF(infof(data, "shutdown start on%s connection", + sockindex ? " secondary" : "")); + Curl_shutdown_start(data, sockindex, &now); + } + else { + timeout_ms = Curl_shutdown_timeleft(data->conn, sockindex, &now); + if(timeout_ms < 0) { + /* info message, since this might be regarded as acceptable */ + infof(data, "shutdown timeout"); + return CURLE_OPERATION_TIMEDOUT; + } + } + + while(cf) { + if(!cf->shutdown) { + bool cfdone = FALSE; + result = cf->cft->do_shutdown(cf, data, &cfdone); + if(result) { + CURL_TRC_CF(data, cf, "shut down failed with %d", result); + return result; + } + else if(!cfdone) { + CURL_TRC_CF(data, cf, "shut down not done yet"); + return CURLE_OK; + } + CURL_TRC_CF(data, cf, "shut down successfully"); + cf->shutdown = TRUE; + } + cf = cf->next; + } + *done = (!result); + return result; } ssize_t Curl_cf_recv(struct Curl_easy *data, int num, char *buf, @@ -192,7 +261,8 @@ ssize_t Curl_cf_recv(struct Curl_easy *data, int num, char *buf, } ssize_t Curl_cf_send(struct Curl_easy *data, int num, - const void *mem, size_t len, CURLcode *code) + const void *mem, size_t len, bool eos, + CURLcode *code) { struct Curl_cfilter *cf; @@ -204,7 +274,7 @@ ssize_t Curl_cf_send(struct Curl_easy *data, int num, cf = cf->next; } if(cf) { - ssize_t nwritten = cf->cft->do_send(cf, data, mem, len, code); + ssize_t nwritten = cf->cft->do_send(cf, data, mem, len, eos, code); DEBUGASSERT(nwritten >= 0 || *code); DEBUGASSERT(nwritten < 0 || !*code || !len); return nwritten; @@ -315,10 +385,11 @@ void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) } ssize_t Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { if(cf) - return cf->cft->do_send(cf, data, buf, len, err); + return cf->cft->do_send(cf, data, buf, len, eos, err); *err = CURLE_SEND_ERROR; return -1; } @@ -345,16 +416,29 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, cf = data->conn->cfilter[sockindex]; DEBUGASSERT(cf); - if(!cf) + if(!cf) { + *done = FALSE; return CURLE_FAILED_INIT; + } *done = cf->connected; if(!*done) { + if(Curl_conn_needs_flush(data, sockindex)) { + DEBUGF(infof(data, "Curl_conn_connect(index=%d), flush", sockindex)); + result = Curl_conn_flush(data, sockindex); + if(result && (result != CURLE_AGAIN)) + return result; + } + result = cf->cft->do_connect(cf, data, blocking, done); if(!result && *done) { - Curl_conn_ev_update_info(data, data->conn); + /* Now that the complete filter chain is connected, let all filters + * 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); data->conn->keepalive = Curl_now(); + Curl_verboseconnect(data, data->conn, sockindex); } else if(result) { conn_report_connect_stats(data, data->conn); @@ -400,12 +484,12 @@ bool Curl_conn_cf_is_ssl(struct Curl_cfilter *cf) bool Curl_conn_is_ssl(struct connectdata *conn, int sockindex) { - return conn? Curl_conn_cf_is_ssl(conn->cfilter[sockindex]) : FALSE; + return conn ? Curl_conn_cf_is_ssl(conn->cfilter[sockindex]) : FALSE; } bool Curl_conn_is_multiplex(struct connectdata *conn, int sockindex) { - struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL; + struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; for(; cf; cf = cf->next) { if(cf->cft->flags & CF_TYPE_MULTIPLEX) @@ -435,6 +519,21 @@ bool Curl_conn_data_pending(struct Curl_easy *data, int sockindex) return FALSE; } +bool Curl_conn_cf_needs_flush(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + CURLcode result; + int pending = 0; + result = cf ? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH, + &pending, NULL) : CURLE_UNKNOWN_OPTION; + return (result || !pending) ? FALSE : TRUE; +} + +bool Curl_conn_needs_flush(struct Curl_easy *data, int sockindex) +{ + return Curl_conn_cf_needs_flush(data->conn->cfilter[sockindex], data); +} + void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, struct easy_pollset *ps) @@ -442,6 +541,9 @@ void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, /* Get the lowest not-connected filter, if there are any */ while(cf && !cf->connected && cf->next && !cf->next->connected) cf = cf->next; + /* Skip all filters that have already shut down */ + while(cf && cf->shutdown) + cf = cf->next; /* From there on, give all filters a chance to adjust the pollset. * Lower filters are called later, so they may override */ while(cf) { @@ -462,6 +564,42 @@ void Curl_conn_adjust_pollset(struct Curl_easy *data, } } +int Curl_conn_cf_poll(struct Curl_cfilter *cf, + struct Curl_easy *data, + timediff_t timeout_ms) +{ + struct easy_pollset ps; + struct pollfd pfds[MAX_SOCKSPEREASYHANDLE]; + unsigned int i, npfds = 0; + + DEBUGASSERT(cf); + DEBUGASSERT(data); + DEBUGASSERT(data->conn); + memset(&ps, 0, sizeof(ps)); + memset(pfds, 0, sizeof(pfds)); + + Curl_conn_cf_adjust_pollset(cf, data, &ps); + DEBUGASSERT(ps.num <= MAX_SOCKSPEREASYHANDLE); + for(i = 0; i < ps.num; ++i) { + short events = 0; + if(ps.actions[i] & CURL_POLL_IN) { + events |= POLLIN; + } + if(ps.actions[i] & CURL_POLL_OUT) { + events |= POLLOUT; + } + if(events) { + pfds[npfds].fd = ps.sockets[i]; + pfds[npfds].events = events; + ++npfds; + } + } + + if(!npfds) + DEBUGF(infof(data, "no sockets to poll!")); + return Curl_poll(pfds, npfds, timeout_ms); +} + void Curl_conn_get_host(struct Curl_easy *data, int sockindex, const char **phost, const char **pdisplay_host, int *pport) @@ -522,17 +660,26 @@ curl_socket_t Curl_conn_cf_get_socket(struct Curl_cfilter *cf, return CURL_SOCKET_BAD; } +CURLcode Curl_conn_cf_get_ip_info(struct Curl_cfilter *cf, + struct Curl_easy *data, + int *is_ipv6, struct ip_quadruple *ipquad) +{ + if(cf) + return cf->cft->query(cf, data, CF_QUERY_IP_INFO, is_ipv6, ipquad); + return CURLE_UNKNOWN_OPTION; +} + curl_socket_t Curl_conn_get_socket(struct Curl_easy *data, int sockindex) { struct Curl_cfilter *cf; - cf = data->conn? data->conn->cfilter[sockindex] : NULL; + cf = data->conn ? data->conn->cfilter[sockindex] : NULL; /* if the top filter has not connected, ask it (and its sub-filters) * for the socket. Otherwise conn->sock[sockindex] should have it. */ if(cf && !cf->connected) return Curl_conn_cf_get_socket(cf, data); - return data->conn? data->conn->sock[sockindex] : CURL_SOCKET_BAD; + return data->conn ? data->conn->sock[sockindex] : CURL_SOCKET_BAD; } void Curl_conn_forget_socket(struct Curl_easy *data, int sockindex) @@ -588,9 +735,16 @@ CURLcode Curl_conn_ev_data_idle(struct Curl_easy *data) CF_CTRL_DATA_IDLE, 0, NULL); } + +CURLcode Curl_conn_flush(struct Curl_easy *data, int sockindex) +{ + return Curl_conn_cf_cntrl(data->conn->cfilter[sockindex], data, FALSE, + CF_CTRL_FLUSH, 0, NULL); +} + /** * Notify connection filters that the transfer represented by `data` - * is donw with sending data (e.g. has uploaded everything). + * is done with sending data (e.g. has uploaded everything). */ void Curl_conn_ev_data_done_send(struct Curl_easy *data) { @@ -612,8 +766,8 @@ CURLcode Curl_conn_ev_data_pause(struct Curl_easy *data, bool do_pause) CF_CTRL_DATA_PAUSE, do_pause, NULL); } -void Curl_conn_ev_update_info(struct Curl_easy *data, - struct connectdata *conn) +static void cf_cntrl_update_info(struct Curl_easy *data, + struct connectdata *conn) { cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL); } @@ -654,7 +808,7 @@ CURLcode Curl_conn_keep_alive(struct Curl_easy *data, int sockindex) { struct Curl_cfilter *cf = conn->cfilter[sockindex]; - return cf? cf->cft->keep_alive(cf, data) : CURLE_OK; + return cf ? cf->cft->keep_alive(cf, data) : CURLE_OK; } size_t Curl_conn_get_max_concurrent(struct Curl_easy *data, @@ -665,9 +819,22 @@ size_t Curl_conn_get_max_concurrent(struct Curl_easy *data, int n = 0; struct Curl_cfilter *cf = conn->cfilter[sockindex]; - result = cf? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT, - &n, NULL) : CURLE_UNKNOWN_OPTION; - return (result || n <= 0)? 1 : (size_t)n; + result = cf ? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT, + &n, NULL) : CURLE_UNKNOWN_OPTION; + return (result || n <= 0) ? 1 : (size_t)n; +} + +int Curl_conn_get_stream_error(struct Curl_easy *data, + struct connectdata *conn, + int sockindex) +{ + CURLcode result; + int n = 0; + + struct Curl_cfilter *cf = conn->cfilter[sockindex]; + result = cf ? cf->cft->query(cf, data, CF_QUERY_STREAM_ERROR, + &n, NULL) : CURLE_UNKNOWN_OPTION; + return (result || n < 0) ? 0 : n; } int Curl_conn_sockindex(struct Curl_easy *data, curl_socket_t sockfd) @@ -688,14 +855,15 @@ CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex, nread = data->conn->recv[sockindex](data, sockindex, buf, blen, &result); DEBUGASSERT(nread >= 0 || result); DEBUGASSERT(nread < 0 || !result); - *n = (nread >= 0)? (size_t)nread : 0; + *n = (nread >= 0) ? (size_t)nread : 0; return result; } CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, - const void *buf, size_t blen, + const void *buf, size_t blen, bool eos, size_t *pnwritten) { + size_t write_len = blen; ssize_t nwritten; CURLcode result = CURLE_OK; struct connectdata *conn; @@ -705,7 +873,7 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, DEBUGASSERT(data); DEBUGASSERT(data->conn); conn = data->conn; -#ifdef CURLDEBUG +#ifdef DEBUGBUILD { /* Allow debug builds to override this logic to force short sends */ @@ -713,13 +881,16 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, if(p) { size_t altsize = (size_t)strtoul(p, NULL, 10); if(altsize) - blen = CURLMIN(blen, altsize); + write_len = CURLMIN(write_len, altsize); } } #endif - nwritten = conn->send[sockindex](data, sockindex, buf, blen, &result); + if(write_len != blen) + eos = FALSE; + nwritten = conn->send[sockindex](data, sockindex, buf, write_len, eos, + &result); DEBUGASSERT((nwritten >= 0) || result); - *pnwritten = (nwritten < 0)? 0 : (size_t)nwritten; + *pnwritten = (nwritten < 0) ? 0 : (size_t)nwritten; return result; } @@ -729,7 +900,7 @@ void Curl_pollset_reset(struct Curl_easy *data, size_t i; (void)data; memset(ps, 0, sizeof(*ps)); - for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) + for(i = 0; i < MAX_SOCKSPEREASYHANDLE; i++) ps->sockets[i] = CURL_SOCKET_BAD; } @@ -791,8 +962,10 @@ void Curl_pollset_set(struct Curl_easy *data, bool do_in, bool do_out) { Curl_pollset_change(data, ps, sock, - (do_in?CURL_POLL_IN:0)|(do_out?CURL_POLL_OUT:0), - (!do_in?CURL_POLL_IN:0)|(!do_out?CURL_POLL_OUT:0)); + (do_in ? CURL_POLL_IN : 0)| + (do_out ? CURL_POLL_OUT : 0), + (!do_in ? CURL_POLL_IN : 0)| + (!do_out ? CURL_POLL_OUT : 0)); } static void ps_add(struct Curl_easy *data, struct easy_pollset *ps, diff --git a/deps/curl/lib/cfilters.h b/deps/curl/lib/cfilters.h index c90b1f4b..af696f52 100644 --- a/deps/curl/lib/cfilters.h +++ b/deps/curl/lib/cfilters.h @@ -24,11 +24,13 @@ * ***************************************************************************/ +#include "timediff.h" struct Curl_cfilter; struct Curl_easy; struct Curl_dns_entry; struct connectdata; +struct ip_quadruple; /* Callback to destroy resources held by this filter instance. * Implementations MUST NOT chain calls to cf->next. @@ -36,9 +38,17 @@ struct connectdata; typedef void Curl_cft_destroy_this(struct Curl_cfilter *cf, struct Curl_easy *data); +/* Callback to close the connection immediately. */ typedef void Curl_cft_close(struct Curl_cfilter *cf, struct Curl_easy *data); +/* Callback to close the connection filter gracefully, non-blocking. + * Implementations MUST NOT chain calls to cf->next. + */ +typedef CURLcode Curl_cft_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool *done); + typedef CURLcode Curl_cft_connect(struct Curl_cfilter *cf, struct Curl_easy *data, bool blocking, bool *done); @@ -76,10 +86,10 @@ struct easy_pollset; * the pollset. Filters, whose filter "below" is not connected, should * also do no adjustments. * - * Examples: a TLS handshake, while ongoing, might remove POLL_IN - * when it needs to write, or vice versa. A HTTP/2 filter might remove - * POLL_OUT when a stream window is exhausted and a WINDOW_UPDATE needs - * to be received first and add instead POLL_IN. + * Examples: a TLS handshake, while ongoing, might remove POLL_IN when it + * needs to write, or vice versa. An HTTP/2 filter might remove POLL_OUT when + * a stream window is exhausted and a WINDOW_UPDATE needs to be received first + * and add instead POLL_IN. * * @param cf the filter to ask * @param data the easy handle the pollset is about @@ -96,6 +106,7 @@ typedef ssize_t Curl_cft_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* transfer */ const void *buf, /* data to write */ size_t len, /* amount to write */ + bool eos, /* last chunk */ CURLcode *err); /* error to return */ typedef ssize_t Curl_cft_recv(struct Curl_cfilter *cf, @@ -131,6 +142,7 @@ typedef CURLcode Curl_cft_conn_keep_alive(struct Curl_cfilter *cf, /* 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 */ /** * Handle event/control for the filter. @@ -153,6 +165,9 @@ typedef CURLcode Curl_cft_cntrl(struct Curl_cfilter *cf, * were received. * -1 if not determined yet. * - CF_QUERY_SOCKET: the socket used by the filter chain + * - CF_QUERY_NEED_FLUSH: TRUE iff any of the filters have unsent data + * - CF_QUERY_IP_INFO: res1 says if connection used IPv6, res2 is the + * ip quadruple */ /* query res1 res2 */ #define CF_QUERY_MAX_CONCURRENT 1 /* number - */ @@ -160,6 +175,9 @@ typedef CURLcode Curl_cft_cntrl(struct Curl_cfilter *cf, #define CF_QUERY_SOCKET 3 /* - curl_socket_t */ #define CF_QUERY_TIMER_CONNECT 4 /* - struct curltime */ #define CF_QUERY_TIMER_APPCONNECT 5 /* - struct curltime */ +#define CF_QUERY_STREAM_ERROR 6 /* error code - */ +#define CF_QUERY_NEED_FLUSH 7 /* TRUE/FALSE - */ +#define CF_QUERY_IP_INFO 8 /* TRUE/FALSE struct ip_quadruple */ /** * Query the cfilter for properties. Filters ignorant of a query will @@ -178,10 +196,12 @@ typedef CURLcode Curl_cft_query(struct Curl_cfilter *cf, * connection, etc. * CF_TYPE_SSL: provide SSL/TLS * CF_TYPE_MULTIPLEX: provides multiplexing of easy handles + * CF_TYPE_PROXY provides proxying */ #define CF_TYPE_IP_CONNECT (1 << 0) #define CF_TYPE_SSL (1 << 1) #define CF_TYPE_MULTIPLEX (1 << 2) +#define CF_TYPE_PROXY (1 << 3) /* A connection filter type, e.g. specific implementation. */ struct Curl_cftype { @@ -191,6 +211,7 @@ struct Curl_cftype { 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_get_host *get_host; /* host filter talks to */ Curl_cft_adjust_pollset *adjust_pollset; /* adjust transfer poll set */ Curl_cft_data_pending *has_data_pending;/* conn has data pending */ @@ -210,6 +231,7 @@ struct Curl_cfilter { struct connectdata *conn; /* the connection this filter belongs to */ int sockindex; /* the index the filter is installed at */ BIT(connected); /* != 0 iff this filter is connected */ + BIT(shutdown); /* != 0 iff this filter has shut down */ }; /* Default implementations for the type functions, implementing nop. */ @@ -227,7 +249,8 @@ void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data); ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err); + const void *buf, size_t len, bool eos, + CURLcode *err); ssize_t Curl_cf_def_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err); CURLcode Curl_cf_def_cntrl(struct Curl_cfilter *cf, @@ -241,6 +264,8 @@ CURLcode Curl_cf_def_conn_keep_alive(struct Curl_cfilter *cf, CURLcode Curl_cf_def_query(struct Curl_cfilter *cf, struct Curl_easy *data, int query, int *pres1, void *pres2); +CURLcode Curl_cf_def_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done); /** * Create a new filter instance, unattached to the filter chain. @@ -301,7 +326,8 @@ CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, bool blocking, bool *done); void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data); ssize_t Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err); + const void *buf, size_t len, bool eos, + CURLcode *err); ssize_t Curl_conn_cf_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err); CURLcode Curl_conn_cf_cntrl(struct Curl_cfilter *cf, @@ -322,6 +348,12 @@ bool Curl_conn_cf_is_ssl(struct Curl_cfilter *cf); curl_socket_t Curl_conn_cf_get_socket(struct Curl_cfilter *cf, struct Curl_easy *data); +CURLcode Curl_conn_cf_get_ip_info(struct Curl_cfilter *cf, + struct Curl_easy *data, + int *is_ipv6, struct ip_quadruple *ipquad); + +bool Curl_conn_cf_needs_flush(struct Curl_cfilter *cf, + struct Curl_easy *data); #define CURL_CF_SSL_DEFAULT -1 #define CURL_CF_SSL_DISABLE 0 @@ -368,6 +400,13 @@ bool Curl_conn_is_multiplex(struct connectdata *conn, int sockindex); */ void Curl_conn_close(struct Curl_easy *data, int sockindex); +/** + * Shutdown the connection at `sockindex` non-blocking, using timeout + * from `data->set.shutdowntimeout`, default DEFAULT_SHUTDOWN_TIMEOUT_MS. + * Will return CURLE_OK and *done == FALSE if not finished. + */ +CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done); + /** * Return if data is pending in some connection filter at chain * `sockindex` for connection `data->conn`. @@ -375,6 +414,17 @@ void Curl_conn_close(struct Curl_easy *data, int sockindex); bool Curl_conn_data_pending(struct Curl_easy *data, int sockindex); +/** + * Return TRUE if any of the connection filters at chain `sockindex` + * have data still to send. + */ +bool Curl_conn_needs_flush(struct Curl_easy *data, int sockindex); + +/** + * Flush any pending data on the connection filters at chain `sockindex`. + */ +CURLcode Curl_conn_flush(struct Curl_easy *data, int sockindex); + /** * Return the socket used on data's connection for the index. * Returns CURL_SOCKET_BAD if not available. @@ -399,6 +449,15 @@ void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, void Curl_conn_adjust_pollset(struct Curl_easy *data, struct easy_pollset *ps); +/** + * Curl_poll() the filter chain at `cf` with timeout `timeout_ms`. + * Returns 0 on timeout, negative on error or number of sockets + * with requested poll events. + */ +int Curl_conn_cf_poll(struct Curl_cfilter *cf, + struct Curl_easy *data, + timediff_t timeout_ms); + /** * Receive data through the filter chain at `sockindex` for connection * `data->conn`. Copy at most `len` bytes into `buf`. Return the @@ -415,7 +474,7 @@ ssize_t Curl_cf_recv(struct Curl_easy *data, int sockindex, char *buf, * The error code is placed into `*code`. */ ssize_t Curl_cf_send(struct Curl_easy *data, int sockindex, - const void *buf, size_t len, CURLcode *code); + const void *buf, size_t len, bool eos, CURLcode *code); /** * The easy handle `data` is being attached to `conn`. This does @@ -449,7 +508,7 @@ CURLcode Curl_conn_ev_data_idle(struct Curl_easy *data); /** * Notify connection filters that the transfer represented by `data` - * is donw with sending data (e.g. has uploaded everything). + * is done with sending data (e.g. has uploaded everything). */ void Curl_conn_ev_data_done_send(struct Curl_easy *data); @@ -464,12 +523,6 @@ void Curl_conn_ev_data_done(struct Curl_easy *data, bool premature); */ CURLcode Curl_conn_ev_data_pause(struct Curl_easy *data, bool do_pause); -/** - * Inform connection filters to update their info in `conn`. - */ -void Curl_conn_ev_update_info(struct Curl_easy *data, - struct connectdata *conn); - /** * Check if FIRSTSOCKET's cfilter chain deems connection alive. */ @@ -483,7 +536,9 @@ CURLcode Curl_conn_keep_alive(struct Curl_easy *data, struct connectdata *conn, int sockindex); +#ifdef UNITTESTS void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data); +#endif void Curl_conn_get_host(struct Curl_easy *data, int sockindex, const char **phost, const char **pdisplay_host, int *pport); @@ -496,6 +551,12 @@ size_t Curl_conn_get_max_concurrent(struct Curl_easy *data, struct connectdata *conn, int sockindex); +/** + * Get the underlying error code for a transfer stream or 0 if not known. + */ +int Curl_conn_get_stream_error(struct Curl_easy *data, + struct connectdata *conn, + int sockindex); /** * Get the index of the given socket in the connection's sockets. @@ -517,7 +578,7 @@ CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex, * Will return CURLE_AGAIN iff blocked on sending. */ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, - const void *buf, size_t blen, + const void *buf, size_t blen, bool eos, size_t *pnwritten); diff --git a/deps/curl/lib/config-amigaos.h b/deps/curl/lib/config-amigaos.h index d168b446..11e59994 100644 --- a/deps/curl/lib/config-amigaos.h +++ b/deps/curl/lib/config-amigaos.h @@ -71,8 +71,8 @@ #define USE_MANUAL 1 #define CURL_DISABLE_LDAP 1 -#ifndef OS -#define OS "AmigaOS" +#ifndef CURL_OS +#define CURL_OS "AmigaOS" #endif #define PACKAGE "curl" diff --git a/deps/curl/lib/config-dos.h b/deps/curl/lib/config-dos.h index c6fbba79..4e972472 100644 --- a/deps/curl/lib/config-dos.h +++ b/deps/curl/lib/config-dos.h @@ -29,13 +29,13 @@ /* lib/config-dos.h - Hand crafted config file for DOS */ /* ================================================================ */ -#ifndef OS +#ifndef CURL_OS #if defined(DJGPP) - #define OS "MSDOS/djgpp" + #define CURL_OS "MSDOS/djgpp" #elif defined(__HIGHC__) - #define OS "MSDOS/HighC" + #define CURL_OS "MSDOS/HighC" #else - #define OS "MSDOS/?" + #define CURL_OS "MSDOS/?" #endif #endif diff --git a/deps/curl/lib/config-mac.h b/deps/curl/lib/config-mac.h index c29888f8..8d6210c7 100644 --- a/deps/curl/lib/config-mac.h +++ b/deps/curl/lib/config-mac.h @@ -27,11 +27,11 @@ /* =================================================================== */ /* Hand crafted config file for Mac OS 9 */ /* =================================================================== */ -/* On Mac OS X you must run configure to generate curl_config.h file */ +/* On macOS you must run configure to generate curl_config.h file */ /* =================================================================== */ -#ifndef OS -#define OS "mac" +#ifndef CURL_OS +#define CURL_OS "mac" #endif #include diff --git a/deps/curl/lib/config-os400.h b/deps/curl/lib/config-os400.h index 32852bb3..88259d95 100644 --- a/deps/curl/lib/config-os400.h +++ b/deps/curl/lib/config-os400.h @@ -36,8 +36,8 @@ #undef VERSION /* Define cpu-machine-OS */ -#ifndef OS -#define OS "OS/400" +#ifndef CURL_OS +#define CURL_OS "OS/400" #endif /* OS400 supports a 3-argument ASCII version of gethostbyaddr_r(), but its @@ -57,7 +57,7 @@ #undef NEED_REENTRANT /* Define if you want to enable IPv6 support */ -#define ENABLE_IPV6 +#define USE_IPV6 /* Define if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 @@ -65,9 +65,6 @@ /* Define this to 'int' if ssize_t is not an available typedefed type */ #undef ssize_t -/* Define this as a suitable file to read random data from */ -#undef RANDOM_FILE - /* Define to 1 if you have the alarm function. */ #define HAVE_ALARM 1 @@ -107,9 +104,6 @@ /* Define if you have the header file. */ #undef HAVE_IO_H -/* Define if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Define if you have GSS API. */ #define HAVE_GSSAPI @@ -235,9 +229,9 @@ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS -/* Define to enable HTTP3 support (experimental, requires NGTCP2, QUICHE or +/* Define to enable HTTP3 support (experimental, requires NGTCP2, quiche or MSH3) */ -#undef ENABLE_QUIC +#undef USE_HTTP3 /* Version number of package */ #undef VERSION diff --git a/deps/curl/lib/config-plan9.h b/deps/curl/lib/config-plan9.h index aa9623f9..699291a1 100644 --- a/deps/curl/lib/config-plan9.h +++ b/deps/curl/lib/config-plan9.h @@ -28,12 +28,12 @@ #define CURL_CA_BUNDLE "/sys/lib/tls/ca.pem" #define CURL_CA_PATH "/sys/lib/tls" #define CURL_STATICLIB 1 -#define ENABLE_IPV6 1 +#define USE_IPV6 1 #define CURL_DISABLE_LDAP 1 #define NEED_REENTRANT 1 -#ifndef OS -#define OS "plan9" +#ifndef CURL_OS +#define CURL_OS "plan9" #endif #define PACKAGE "curl" #define PACKAGE_NAME "curl" @@ -41,7 +41,6 @@ #define PACKAGE_STRING "curl -" #define PACKAGE_TARNAME "curl" #define PACKAGE_VERSION "-" -#define RANDOM_FILE "/dev/random" #define VERSION "0.0.0" /* TODO */ #define STDC_HEADERS 1 @@ -104,7 +103,7 @@ #define USE_OPENSSL 1 #define HAVE_PIPE 1 -#define HAVE_POLL_FINE 1 +#define HAVE_POLL 1 #define HAVE_POLL_H 1 #define HAVE_PTHREAD_H 1 #define HAVE_SETLOCALE 1 diff --git a/deps/curl/lib/config-riscos.h b/deps/curl/lib/config-riscos.h index f3a8e683..35b28cc5 100644 --- a/deps/curl/lib/config-riscos.h +++ b/deps/curl/lib/config-riscos.h @@ -35,8 +35,8 @@ #undef VERSION /* Define cpu-machine-OS */ -#ifndef OS -#define OS "ARM-RISC OS" +#ifndef CURL_OS +#define CURL_OS "ARM-RISC OS" #endif /* Define if you want the built-in manual */ @@ -55,7 +55,7 @@ #undef NEED_REENTRANT /* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 +#undef USE_IPV6 /* Define if struct sockaddr_in6 has the sin6_scope_id member */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 @@ -63,12 +63,6 @@ /* Define this to 'int' if ssize_t is not an available typedefed type */ #undef ssize_t -/* Define this as a suitable file to read random data from */ -#undef RANDOM_FILE - -/* Define if you want to enable IPv6 support */ -#undef ENABLE_IPV6 - /* Define if you have the alarm function. */ #define HAVE_ALARM @@ -111,9 +105,6 @@ /* Define if you have the header file. */ #undef HAVE_IO_H -/* Define if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Define if you need the malloc.h header file even with stdlib.h */ /* #define NEED_MALLOC_H 1 */ @@ -210,13 +201,6 @@ /* Version number of package */ #undef VERSION -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff --git a/deps/curl/lib/config-win32.h b/deps/curl/lib/config-win32.h index 89ed1a0f..e6abf062 100644 --- a/deps/curl/lib/config-win32.h +++ b/deps/curl/lib/config-win32.h @@ -155,6 +155,9 @@ /* Define if you have the setmode function. */ #define HAVE_SETMODE 1 +/* Define if you have the _setmode function. */ +#define HAVE__SETMODE 1 + /* Define if you have the socket function. */ #define HAVE_SOCKET 1 @@ -475,7 +478,7 @@ Vista #endif /* Define to use the Windows crypto library. */ -#if !defined(CURL_WINDOWS_APP) +#if !defined(CURL_WINDOWS_UWP) #define USE_WIN32_CRYPTO #endif @@ -487,19 +490,19 @@ Vista /* ---------------------------------------------------------------- */ /* Define cpu-machine-OS */ -#ifndef OS +#ifndef CURL_OS #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ -#define OS "i386-pc-win32" +#define CURL_OS "i386-pc-win32" #elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */ -#define OS "x86_64-pc-win32" +#define CURL_OS "x86_64-pc-win32" #elif defined(_M_IA64) || defined(__ia64__) /* Itanium */ -#define OS "ia64-pc-win32" +#define CURL_OS "ia64-pc-win32" #elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 (Windows RT) */ -#define OS "thumbv7a-pc-win32" +#define CURL_OS "thumbv7a-pc-win32" #elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */ -#define OS "aarch64-pc-win32" +#define CURL_OS "aarch64-pc-win32" #else -#define OS "unknown-pc-win32" +#define CURL_OS "unknown-pc-win32" #endif #endif @@ -509,8 +512,4 @@ Vista /* If you want to build curl with the built-in manual */ #define USE_MANUAL 1 -#if defined(USE_IPV6) -# define ENABLE_IPV6 1 -#endif - #endif /* HEADER_CURL_CONFIG_WIN32_H */ diff --git a/deps/curl/lib/config-win32ce.h b/deps/curl/lib/config-win32ce.h index ae3ca290..80765f1f 100644 --- a/deps/curl/lib/config-win32ce.h +++ b/deps/curl/lib/config-win32ce.h @@ -25,7 +25,7 @@ ***************************************************************************/ /* ================================================================ */ -/* lib/config-win32ce.h - Hand crafted config file for windows ce */ +/* lib/config-win32ce.h - Hand crafted config file for Windows CE */ /* ================================================================ */ /* ---------------------------------------------------------------- */ @@ -271,15 +271,15 @@ /* ---------------------------------------------------------------- */ /* Define cpu-machine-OS */ -#ifndef OS -#define OS "i386-pc-win32ce" +#ifndef CURL_OS +#define CURL_OS "i386-pc-win32ce" #endif /* Name of package */ #define PACKAGE "curl" /* ---------------------------------------------------------------- */ -/* WinCE */ +/* Windows CE */ /* ---------------------------------------------------------------- */ #ifndef UNICODE diff --git a/deps/curl/lib/conncache.c b/deps/curl/lib/conncache.c index 63128e1a..589205bc 100644 --- a/deps/curl/lib/conncache.c +++ b/deps/curl/lib/conncache.c @@ -29,13 +29,17 @@ #include "urldata.h" #include "url.h" +#include "cfilters.h" #include "progress.h" #include "multiif.h" #include "sendf.h" #include "conncache.h" +#include "http_negotiate.h" +#include "http_ntlm.h" #include "share.h" #include "sigpipe.h" #include "connect.h" +#include "select.h" #include "strcase.h" /* The last 3 #include files should be in this order */ @@ -43,394 +47,483 @@ #include "curl_memory.h" #include "memdebug.h" -#define HASHKEY_SIZE 128 -static CURLcode bundle_create(struct connectbundle **bundlep) +#define CPOOL_IS_LOCKED(c) ((c) && (c)->locked) + +#define CPOOL_LOCK(c) \ + do { \ + if((c)) { \ + if(CURL_SHARE_KEEP_CONNECT((c)->share)) \ + Curl_share_lock(((c)->idata), CURL_LOCK_DATA_CONNECT, \ + CURL_LOCK_ACCESS_SINGLE); \ + DEBUGASSERT(!(c)->locked); \ + (c)->locked = TRUE; \ + } \ + } while(0) + +#define CPOOL_UNLOCK(c) \ + do { \ + if((c)) { \ + DEBUGASSERT((c)->locked); \ + (c)->locked = FALSE; \ + if(CURL_SHARE_KEEP_CONNECT((c)->share)) \ + Curl_share_unlock((c)->idata, CURL_LOCK_DATA_CONNECT); \ + } \ + } while(0) + + +/* A list of connections to the same destination. */ +struct cpool_bundle { + struct Curl_llist conns; /* connections in the bundle */ + size_t dest_len; /* total length of destination, including NUL */ + 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, + bool aborted); +static void cpool_close_and_destroy(struct cpool *cpool, + struct connectdata *conn, + struct Curl_easy *data, + bool do_shutdown); +static void cpool_run_conn_shutdown(struct Curl_easy *data, + struct connectdata *conn, + bool *done); +static void cpool_run_conn_shutdown_handler(struct Curl_easy *data, + struct connectdata *conn); +static CURLMcode cpool_update_shutdown_ev(struct Curl_multi *multi, + struct Curl_easy *data, + struct connectdata *conn); +static void cpool_shutdown_all(struct cpool *cpool, + struct Curl_easy *data, int timeout_ms); +static void cpool_close_and_destroy_all(struct cpool *cpool); +static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool); + +static struct cpool_bundle *cpool_bundle_create(const char *dest, + size_t dest_len) { - DEBUGASSERT(*bundlep == NULL); - *bundlep = malloc(sizeof(struct connectbundle)); - if(!*bundlep) - return CURLE_OUT_OF_MEMORY; - - (*bundlep)->num_connections = 0; - (*bundlep)->multiuse = BUNDLE_UNKNOWN; - - Curl_llist_init(&(*bundlep)->conn_list, NULL); - return CURLE_OK; + struct cpool_bundle *bundle; + bundle = calloc(1, sizeof(*bundle) + dest_len); + if(!bundle) + return NULL; + Curl_llist_init(&bundle->conns, NULL); + bundle->dest_len = dest_len; + memcpy(bundle->dest, dest, dest_len); + return bundle; } -static void bundle_destroy(struct connectbundle *bundle) +static void cpool_bundle_destroy(struct cpool_bundle *bundle) { + DEBUGASSERT(!Curl_llist_count(&bundle->conns)); free(bundle); } /* Add a connection to a bundle */ -static void bundle_add_conn(struct connectbundle *bundle, - struct connectdata *conn) +static void cpool_bundle_add(struct cpool_bundle *bundle, + struct connectdata *conn) { - Curl_llist_insert_next(&bundle->conn_list, bundle->conn_list.tail, conn, - &conn->bundle_node); - conn->bundle = bundle; - bundle->num_connections++; + DEBUGASSERT(!Curl_node_llist(&conn->cpool_node)); + Curl_llist_append(&bundle->conns, conn, &conn->cpool_node); + conn->bits.in_cpool = TRUE; } /* Remove a connection from a bundle */ -static int bundle_remove_conn(struct connectbundle *bundle, - struct connectdata *conn) +static void cpool_bundle_remove(struct cpool_bundle *bundle, + struct connectdata *conn) { - struct Curl_llist_element *curr; - - curr = bundle->conn_list.head; - while(curr) { - if(curr->ptr == conn) { - Curl_llist_remove(&bundle->conn_list, curr, NULL); - bundle->num_connections--; - conn->bundle = NULL; - return 1; /* we removed a handle */ - } - curr = curr->next; - } - DEBUGASSERT(0); - return 0; + (void)bundle; + DEBUGASSERT(Curl_node_llist(&conn->cpool_node) == &bundle->conns); + Curl_node_remove(&conn->cpool_node); + conn->bits.in_cpool = FALSE; } -static void free_bundle_hash_entry(void *freethis) +static void cpool_bundle_free_entry(void *freethis) { - struct connectbundle *b = (struct connectbundle *) freethis; - - bundle_destroy(b); + cpool_bundle_destroy((struct cpool_bundle *)freethis); } -int Curl_conncache_init(struct conncache *connc, int size) +int Curl_cpool_init(struct cpool *cpool, + Curl_cpool_disconnect_cb *disconnect_cb, + struct Curl_multi *multi, + struct Curl_share *share, + size_t size) { + DEBUGASSERT(!!multi != !!share); /* either one */ + Curl_hash_init(&cpool->dest2bundle, size, Curl_hash_str, + Curl_str_key_compare, cpool_bundle_free_entry); + Curl_llist_init(&cpool->shutdowns, NULL); + + DEBUGASSERT(disconnect_cb); + if(!disconnect_cb) + return 1; + /* allocate a new easy handle to use when closing cached connections */ - connc->closure_handle = curl_easy_init(); - if(!connc->closure_handle) + cpool->idata = curl_easy_init(); + if(!cpool->idata) return 1; /* bad */ - connc->closure_handle->state.internal = true; + cpool->idata->state.internal = TRUE; + /* TODO: this is quirky. We need an internal handle for certain + * operations, but we do not add it to the multi (if there is one). + * But we give it the multi so that socket event operations can work. + * Probably better to have an internal handle owned by the multi that + * can be used for cpool operations. */ + cpool->idata->multi = multi; +#ifdef DEBUGBUILD + if(getenv("CURL_DEBUG")) + cpool->idata->set.verbose = TRUE; +#endif - Curl_hash_init(&connc->hash, size, Curl_hash_str, - Curl_str_key_compare, free_bundle_hash_entry); - connc->closure_handle->state.conn_cache = connc; + cpool->disconnect_cb = disconnect_cb; + cpool->idata->multi = cpool->multi = multi; + cpool->idata->share = cpool->share = share; return 0; /* good */ } -void Curl_conncache_destroy(struct conncache *connc) +void Curl_cpool_destroy(struct cpool *cpool) { - if(connc) - Curl_hash_destroy(&connc->hash); -} - -/* creates a key to find a bundle for this connection */ -static void hashkey(struct connectdata *conn, char *buf, size_t len) -{ - const char *hostname; - long port = conn->remote_port; - DEBUGASSERT(len >= HASHKEY_SIZE); -#ifndef CURL_DISABLE_PROXY - if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) { - hostname = conn->http_proxy.host.name; - port = conn->port; + if(cpool) { + if(cpool->idata) { + cpool_close_and_destroy_all(cpool); + /* The internal closure handle is special and we need to + * disconnect it from multi/share before closing it down. */ + cpool->idata->multi = NULL; + cpool->idata->share = NULL; + Curl_close(&cpool->idata); + } + Curl_hash_destroy(&cpool->dest2bundle); + cpool->multi = NULL; } - else -#endif - if(conn->bits.conn_to_host) - hostname = conn->conn_to_host.name; - else - hostname = conn->host.name; - - /* put the numbers first so that the hostname gets cut off if too long */ -#ifdef ENABLE_IPV6 - msnprintf(buf, len, "%u/%ld/%s", conn->scope_id, port, hostname); -#else - msnprintf(buf, len, "%ld/%s", port, hostname); -#endif - Curl_strntolower(buf, buf, len); } -/* Returns number of connections currently held in the connection cache. - Locks/unlocks the cache itself! -*/ -size_t Curl_conncache_size(struct Curl_easy *data) +static struct cpool *cpool_get_instance(struct Curl_easy *data) { - size_t num; - CONNCACHE_LOCK(data); - num = data->state.conn_cache->num_conn; - CONNCACHE_UNLOCK(data); - return num; -} - -/* Look up the bundle with all the connections to the same host this - connectdata struct is setup to use. - - **NOTE**: When it returns, it holds the connection cache lock! */ -struct connectbundle * -Curl_conncache_find_bundle(struct Curl_easy *data, - struct connectdata *conn, - struct conncache *connc) -{ - struct connectbundle *bundle = NULL; - CONNCACHE_LOCK(data); - if(connc) { - char key[HASHKEY_SIZE]; - hashkey(conn, key, sizeof(key)); - bundle = Curl_hash_pick(&connc->hash, key, strlen(key)); + if(data) { + if(CURL_SHARE_KEEP_CONNECT(data->share)) + return &data->share->cpool; + else if(data->multi_easy) + return &data->multi_easy->cpool; + else if(data->multi) + return &data->multi->cpool; } + return NULL; +} +void Curl_cpool_xfer_init(struct Curl_easy *data) +{ + struct cpool *cpool = cpool_get_instance(data); + + DEBUGASSERT(cpool); + if(cpool) { + CPOOL_LOCK(cpool); + /* the identifier inside the connection cache */ + data->id = cpool->next_easy_id++; + if(cpool->next_easy_id <= 0) + cpool->next_easy_id = 0; + data->state.lastconnect_id = -1; + + /* The closure handle only ever has default timeouts set. To improve the + state somewhat we clone the timeouts from each added handle so that the + closure handle always has the same timeouts as the most recently added + easy handle. */ + cpool->idata->set.timeout = data->set.timeout; + cpool->idata->set.server_response_timeout = + data->set.server_response_timeout; + cpool->idata->set.no_signal = data->set.no_signal; + + CPOOL_UNLOCK(cpool); + } + else { + /* We should not get here, but in a non-debug build, do something */ + data->id = 0; + data->state.lastconnect_id = -1; + } +} + +static struct cpool_bundle *cpool_find_bundle(struct cpool *cpool, + struct connectdata *conn) +{ + return Curl_hash_pick(&cpool->dest2bundle, + conn->destination, conn->destination_len); +} + +static struct cpool_bundle * +cpool_add_bundle(struct cpool *cpool, struct connectdata *conn) +{ + struct cpool_bundle *bundle; + + bundle = cpool_bundle_create(conn->destination, conn->destination_len); + if(!bundle) + return NULL; + + if(!Curl_hash_add(&cpool->dest2bundle, + bundle->dest, bundle->dest_len, bundle)) { + cpool_bundle_destroy(bundle); + return NULL; + } return bundle; } -static void *conncache_add_bundle(struct conncache *connc, - char *key, - struct connectbundle *bundle) +static void cpool_remove_bundle(struct cpool *cpool, + struct cpool_bundle *bundle) { - return Curl_hash_add(&connc->hash, key, strlen(key), bundle); -} - -static void conncache_remove_bundle(struct conncache *connc, - struct connectbundle *bundle) -{ - struct Curl_hash_iterator iter; - struct Curl_hash_element *he; - - if(!connc) + if(!cpool) return; - Curl_hash_start_iterate(&connc->hash, &iter); - - he = Curl_hash_next_element(&iter); - while(he) { - if(he->ptr == bundle) { - /* The bundle is destroyed by the hash destructor function, - free_bundle_hash_entry() */ - Curl_hash_delete(&connc->hash, he->key, he->key_len); - return; - } - - he = Curl_hash_next_element(&iter); - } + Curl_hash_delete(&cpool->dest2bundle, bundle->dest, bundle->dest_len); } -CURLcode Curl_conncache_add_conn(struct Curl_easy *data) +static struct connectdata * +cpool_bundle_get_oldest_idle(struct cpool_bundle *bundle); + +int Curl_cpool_check_limits(struct Curl_easy *data, + struct connectdata *conn) { - CURLcode result = CURLE_OK; - struct connectbundle *bundle = NULL; - struct connectdata *conn = data->conn; - struct conncache *connc = data->state.conn_cache; - DEBUGASSERT(conn); + struct cpool *cpool = cpool_get_instance(data); + struct cpool_bundle *bundle; + size_t dest_limit = 0; + size_t total_limit = 0; + int result = CPOOL_LIMIT_OK; - /* *find_bundle() locks the connection cache */ - bundle = Curl_conncache_find_bundle(data, conn, data->state.conn_cache); - if(!bundle) { - char key[HASHKEY_SIZE]; + if(!cpool) + return CPOOL_LIMIT_OK; - result = bundle_create(&bundle); - if(result) { - goto unlock; + if(data && data->multi) { + dest_limit = data->multi->max_host_connections; + total_limit = data->multi->max_total_connections; + } + + if(!dest_limit && !total_limit) + return CPOOL_LIMIT_OK; + + CPOOL_LOCK(cpool); + if(dest_limit) { + bundle = cpool_find_bundle(cpool, conn); + while(bundle && (Curl_llist_count(&bundle->conns) >= dest_limit)) { + struct connectdata *oldest_idle = NULL; + /* The bundle is full. Extract the oldest connection that may + * be removed now, if there is one. */ + oldest_idle = cpool_bundle_get_oldest_idle(bundle); + if(!oldest_idle) + break; + /* disconnect the old conn and continue */ + DEBUGF(infof(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_cpool_disconnect(data, oldest_idle, FALSE); + + /* in case the bundle was destroyed in disconnect, look it up again */ + bundle = cpool_find_bundle(cpool, conn); } - - hashkey(conn, key, sizeof(key)); - - if(!conncache_add_bundle(data->state.conn_cache, key, bundle)) { - bundle_destroy(bundle); - result = CURLE_OUT_OF_MEMORY; - goto unlock; + if(bundle && (Curl_llist_count(&bundle->conns) >= dest_limit)) { + result = CPOOL_LIMIT_DEST; + goto out; } } - bundle_add_conn(bundle, conn); - conn->connection_id = connc->next_connection_id++; - connc->num_conn++; + if(total_limit) { + while(cpool->num_conn >= total_limit) { + struct connectdata *oldest_idle = cpool_get_oldest_idle(cpool); + if(!oldest_idle) + break; + /* disconnect the old conn and continue */ + DEBUGF(infof(data, "Discarding connection #%" + FMT_OFF_T " from %zu to reach total " + "limit of %zu", + oldest_idle->connection_id, cpool->num_conn, total_limit)); + Curl_cpool_disconnect(data, oldest_idle, FALSE); + } + if(cpool->num_conn >= total_limit) { + result = CPOOL_LIMIT_TOTAL; + goto out; + } + } - DEBUGF(infof(data, "Added connection %" CURL_FORMAT_CURL_OFF_T ". " +out: + CPOOL_UNLOCK(cpool); + return result; +} + +CURLcode Curl_cpool_add_conn(struct Curl_easy *data, + struct connectdata *conn) +{ + CURLcode result = CURLE_OK; + struct cpool_bundle *bundle = NULL; + struct cpool *cpool = cpool_get_instance(data); + DEBUGASSERT(conn); + + DEBUGASSERT(cpool); + if(!cpool) + return CURLE_FAILED_INIT; + + CPOOL_LOCK(cpool); + bundle = cpool_find_bundle(cpool, conn); + if(!bundle) { + bundle = cpool_add_bundle(cpool, conn); + if(!bundle) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } + } + + cpool_bundle_add(bundle, conn); + conn->connection_id = cpool->next_connection_id++; + cpool->num_conn++; + DEBUGF(infof(data, "Added connection %" FMT_OFF_T ". " "The cache now contains %zu members", - conn->connection_id, connc->num_conn)); - -unlock: - CONNCACHE_UNLOCK(data); + conn->connection_id, cpool->num_conn)); +out: + CPOOL_UNLOCK(cpool); return result; } -/* - * Removes the connectdata object from the connection cache, but the transfer - * still owns this connection. - * - * Pass TRUE/FALSE in the 'lock' argument depending on if the parent function - * already holds the lock or not. - */ -void Curl_conncache_remove_conn(struct Curl_easy *data, - struct connectdata *conn, bool lock) +static void cpool_remove_conn(struct cpool *cpool, + struct connectdata *conn) { - struct connectbundle *bundle = conn->bundle; - struct conncache *connc = data->state.conn_cache; - - /* The bundle pointer can be NULL, since this function can be called - due to a failed connection attempt, before being added to a bundle */ - if(bundle) { - if(lock) { - CONNCACHE_LOCK(data); + struct Curl_llist *list = Curl_node_llist(&conn->cpool_node); + DEBUGASSERT(cpool); + if(list) { + /* The connection is certainly in the pool, but where? */ + struct cpool_bundle *bundle = cpool_find_bundle(cpool, conn); + if(bundle && (list == &bundle->conns)) { + cpool_bundle_remove(bundle, conn); + if(!Curl_llist_count(&bundle->conns)) + cpool_remove_bundle(cpool, bundle); + conn->bits.in_cpool = FALSE; + cpool->num_conn--; } - bundle_remove_conn(bundle, conn); - if(bundle->num_connections == 0) - conncache_remove_bundle(connc, bundle); - conn->bundle = NULL; /* removed from it */ - if(connc) { - connc->num_conn--; - DEBUGF(infof(data, "The cache now contains %zu members", - connc->num_conn)); - } - if(lock) { - CONNCACHE_UNLOCK(data); + else { + /* Not in a bundle, already in the shutdown list? */ + DEBUGASSERT(list == &cpool->shutdowns); } } } -/* This function iterates the entire connection cache and calls the function +/* This function iterates the entire connection pool and calls the function func() with the connection pointer as the first argument and the supplied 'param' argument as the other. - The conncache lock is still held when the callback is called. It needs it, + The cpool lock is still held when the callback is called. It needs it, so that it can safely continue traversing the lists once the callback returns. - Returns 1 if the loop was aborted due to the callback's return code. + Returns TRUE if the loop was aborted due to the callback's return code. Return 0 from func() to continue the loop, return 1 to abort it. */ -bool Curl_conncache_foreach(struct Curl_easy *data, - struct conncache *connc, - void *param, - int (*func)(struct Curl_easy *data, - struct connectdata *conn, void *param)) +static bool cpool_foreach(struct Curl_easy *data, + struct cpool *cpool, + void *param, + int (*func)(struct Curl_easy *data, + struct connectdata *conn, void *param)) { struct Curl_hash_iterator iter; - struct Curl_llist_element *curr; struct Curl_hash_element *he; - if(!connc) + if(!cpool) return FALSE; - CONNCACHE_LOCK(data); - Curl_hash_start_iterate(&connc->hash, &iter); + Curl_hash_start_iterate(&cpool->dest2bundle, &iter); he = Curl_hash_next_element(&iter); while(he) { - struct connectbundle *bundle; - - bundle = he->ptr; + struct Curl_llist_node *curr; + struct cpool_bundle *bundle = he->ptr; he = Curl_hash_next_element(&iter); - curr = bundle->conn_list.head; + curr = Curl_llist_head(&bundle->conns); while(curr) { /* Yes, we need to update curr before calling func(), because func() might decide to remove the connection */ - struct connectdata *conn = curr->ptr; - curr = curr->next; + struct connectdata *conn = Curl_node_elem(curr); + curr = Curl_node_next(curr); if(1 == func(data, conn, param)) { - CONNCACHE_UNLOCK(data); return TRUE; } } } - CONNCACHE_UNLOCK(data); return FALSE; } -/* Return the first connection found in the cache. Used when closing all - connections. - - NOTE: no locking is done here as this is presumably only done when cleaning - up a cache! -*/ -static struct connectdata * -conncache_find_first_connection(struct conncache *connc) +/* Return a live connection in the pool or NULL. */ +static struct connectdata *cpool_get_live_conn(struct cpool *cpool) { struct Curl_hash_iterator iter; struct Curl_hash_element *he; - struct connectbundle *bundle; + struct cpool_bundle *bundle; + struct Curl_llist_node *conn_node; - Curl_hash_start_iterate(&connc->hash, &iter); - - he = Curl_hash_next_element(&iter); - while(he) { - struct Curl_llist_element *curr; + Curl_hash_start_iterate(&cpool->dest2bundle, &iter); + for(he = Curl_hash_next_element(&iter); he; + he = Curl_hash_next_element(&iter)) { bundle = he->ptr; - - curr = bundle->conn_list.head; - if(curr) { - return curr->ptr; - } - - he = Curl_hash_next_element(&iter); + conn_node = Curl_llist_head(&bundle->conns); + if(conn_node) + return Curl_node_elem(conn_node); } - return NULL; } /* - * Give ownership of a connection back to the connection cache. Might - * disconnect the oldest existing in there to make space. + * A connection (already in the pool) has become idle. Do any + * cleanups in regard to the pool's limits. * - * Return TRUE if stored, FALSE if closed. + * Return TRUE if idle connection kept in pool, FALSE if closed. */ -bool Curl_conncache_return_conn(struct Curl_easy *data, - struct connectdata *conn) +bool Curl_cpool_conn_now_idle(struct Curl_easy *data, + struct connectdata *conn) { unsigned int maxconnects = !data->multi->maxconnects ? - data->multi->num_easy * 4: data->multi->maxconnects; - struct connectdata *conn_candidate = NULL; + data->multi->num_easy * 4 : data->multi->maxconnects; + struct connectdata *oldest_idle = NULL; + struct cpool *cpool = cpool_get_instance(data); + bool kept = TRUE; conn->lastused = Curl_now(); /* it was used up until now */ - if(maxconnects && Curl_conncache_size(data) > maxconnects) { - infof(data, "Connection cache is full, closing the oldest one"); + if(cpool && maxconnects) { + /* may be called form a callback already under lock */ + bool do_lock = !CPOOL_IS_LOCKED(cpool); + if(do_lock) + CPOOL_LOCK(cpool); + if(cpool->num_conn > maxconnects) { + infof(data, "Connection pool is full, closing the oldest one"); - conn_candidate = Curl_conncache_extract_oldest(data); - if(conn_candidate) { - /* Use the closure handle for this disconnect so that anything that - happens during the disconnect is not stored and associated with the - 'data' handle which already just finished a transfer and it is - important that details from this (unrelated) disconnect does not - taint meta-data in the data handle. */ - struct conncache *connc = data->state.conn_cache; - Curl_disconnect(connc->closure_handle, conn_candidate, - /* dead_connection */ FALSE); + oldest_idle = cpool_get_oldest_idle(cpool); + kept = (oldest_idle != conn); + if(oldest_idle) { + Curl_cpool_disconnect(cpool->idata, oldest_idle, FALSE); + } } + if(do_lock) + CPOOL_UNLOCK(cpool); } - return (conn_candidate == conn) ? FALSE : TRUE; - + return kept; } /* * This function finds the connection in the connection bundle that has been * unused for the longest time. - * - * Does not lock the connection cache! - * - * Returns the pointer to the oldest idle connection, or NULL if none was - * found. */ -struct connectdata * -Curl_conncache_extract_bundle(struct Curl_easy *data, - struct connectbundle *bundle) +static struct connectdata * +cpool_bundle_get_oldest_idle(struct cpool_bundle *bundle) { - struct Curl_llist_element *curr; + struct Curl_llist_node *curr; timediff_t highscore = -1; timediff_t score; struct curltime now; - struct connectdata *conn_candidate = NULL; + struct connectdata *oldest_idle = NULL; struct connectdata *conn; - (void)data; - now = Curl_now(); - - curr = bundle->conn_list.head; + curr = Curl_llist_head(&bundle->conns); while(curr) { - conn = curr->ptr; + conn = Curl_node_elem(curr); if(!CONN_INUSE(conn)) { /* Set higher score for the age passed since the connection was used */ @@ -438,141 +531,836 @@ Curl_conncache_extract_bundle(struct Curl_easy *data, if(score > highscore) { highscore = score; - conn_candidate = conn; + oldest_idle = conn; } } - curr = curr->next; + curr = Curl_node_next(curr); } - if(conn_candidate) { - /* remove it to prevent another thread from nicking it */ - bundle_remove_conn(bundle, conn_candidate); - data->state.conn_cache->num_conn--; - DEBUGF(infof(data, "The cache now contains %zu members", - data->state.conn_cache->num_conn)); - } - - return conn_candidate; + return oldest_idle; } -/* - * This function finds the connection in the connection cache that has been - * unused for the longest time and extracts that from the bundle. - * - * Returns the pointer to the connection, or NULL if none was found. - */ -struct connectdata * -Curl_conncache_extract_oldest(struct Curl_easy *data) +static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool) { - struct conncache *connc = data->state.conn_cache; struct Curl_hash_iterator iter; - struct Curl_llist_element *curr; + struct Curl_llist_node *curr; struct Curl_hash_element *he; + struct connectdata *oldest_idle = NULL; + struct cpool_bundle *bundle; + struct curltime now; timediff_t highscore =- 1; timediff_t score; - struct curltime now; - struct connectdata *conn_candidate = NULL; - struct connectbundle *bundle; - struct connectbundle *bundle_candidate = NULL; now = Curl_now(); + Curl_hash_start_iterate(&cpool->dest2bundle, &iter); - CONNCACHE_LOCK(data); - Curl_hash_start_iterate(&connc->hash, &iter); - - he = Curl_hash_next_element(&iter); - while(he) { + for(he = Curl_hash_next_element(&iter); he; + he = Curl_hash_next_element(&iter)) { struct connectdata *conn; - bundle = he->ptr; - curr = bundle->conn_list.head; - while(curr) { - conn = curr->ptr; - - if(!CONN_INUSE(conn) && !conn->bits.close && - !conn->connect_only) { - /* Set higher score for the age passed since the connection was used */ - score = Curl_timediff(now, conn->lastused); - - if(score > highscore) { - highscore = score; - conn_candidate = conn; - bundle_candidate = bundle; - } + for(curr = Curl_llist_head(&bundle->conns); curr; + curr = Curl_node_next(curr)) { + conn = Curl_node_elem(curr); + if(CONN_INUSE(conn) || conn->bits.close || conn->connect_only) + continue; + /* Set higher score for the age passed since the connection was used */ + score = Curl_timediff(now, conn->lastused); + if(score > highscore) { + highscore = score; + oldest_idle = conn; } - curr = curr->next; } - - he = Curl_hash_next_element(&iter); } - if(conn_candidate) { - /* remove it to prevent another thread from nicking it */ - bundle_remove_conn(bundle_candidate, conn_candidate); - connc->num_conn--; - DEBUGF(infof(data, "The cache now contains %zu members", - connc->num_conn)); - } - CONNCACHE_UNLOCK(data); - - return conn_candidate; + return oldest_idle; } -void Curl_conncache_close_all_connections(struct conncache *connc) +bool Curl_cpool_find(struct Curl_easy *data, + const char *destination, size_t dest_len, + Curl_cpool_conn_match_cb *conn_cb, + Curl_cpool_done_match_cb *done_cb, + void *userdata) { - struct connectdata *conn; - SIGPIPE_VARIABLE(pipe_st); - if(!connc->closure_handle) - return; + struct cpool *cpool = cpool_get_instance(data); + struct cpool_bundle *bundle; + bool result = FALSE; - conn = conncache_find_first_connection(connc); - while(conn) { - sigpipe_ignore(connc->closure_handle, &pipe_st); - /* This will remove the connection from the cache */ - connclose(conn, "kill all"); - Curl_conncache_remove_conn(connc->closure_handle, conn, TRUE); - Curl_disconnect(connc->closure_handle, conn, FALSE); - sigpipe_restore(&pipe_st); + DEBUGASSERT(cpool); + DEBUGASSERT(conn_cb); + if(!cpool) + return FALSE; - conn = conncache_find_first_connection(connc); + CPOOL_LOCK(cpool); + bundle = Curl_hash_pick(&cpool->dest2bundle, (void *)destination, dest_len); + if(bundle) { + struct Curl_llist_node *curr = Curl_llist_head(&bundle->conns); + while(curr) { + struct connectdata *conn = Curl_node_elem(curr); + /* Get next node now. callback might discard current */ + curr = Curl_node_next(curr); + + if(conn_cb(conn, userdata)) { + result = TRUE; + break; + } + } } - sigpipe_ignore(connc->closure_handle, &pipe_st); + if(done_cb) { + result = done_cb(result, userdata); + } + CPOOL_UNLOCK(cpool); + return result; +} - Curl_hostcache_clean(connc->closure_handle, - connc->closure_handle->dns.hostcache); - Curl_close(&connc->closure_handle); +static void cpool_shutdown_discard_all(struct cpool *cpool) +{ + struct Curl_llist_node *e = Curl_llist_head(&cpool->shutdowns); + struct connectdata *conn; + + if(!e) + return; + + DEBUGF(infof(cpool->idata, "cpool_shutdown_discard_all")); + while(e) { + conn = Curl_node_elem(e); + Curl_node_remove(e); + DEBUGF(infof(cpool->idata, "discard connection #%" FMT_OFF_T, + conn->connection_id)); + cpool_close_and_destroy(cpool, conn, NULL, FALSE); + e = Curl_llist_head(&cpool->shutdowns); + } +} + +static void cpool_close_and_destroy_all(struct cpool *cpool) +{ + struct connectdata *conn; + int timeout_ms = 0; + SIGPIPE_VARIABLE(pipe_st); + + DEBUGASSERT(cpool); + /* Move all connections to the shutdown list */ + sigpipe_init(&pipe_st); + CPOOL_LOCK(cpool); + conn = cpool_get_live_conn(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_live_conn(cpool); + } + CPOOL_UNLOCK(cpool); + + /* Just for testing, run graceful shutdown */ +#ifdef DEBUGBUILD + { + char *p = getenv("CURL_GRACEFUL_SHUTDOWN"); + if(p) { + long l = strtol(p, NULL, 10); + if(l > 0 && l < INT_MAX) + timeout_ms = (int)l; + } + } +#endif + sigpipe_apply(cpool->idata, &pipe_st); + cpool_shutdown_all(cpool, cpool->idata, timeout_ms); + + /* discard all connections in the shutdown list */ + cpool_shutdown_discard_all(cpool); + + Curl_hostcache_clean(cpool->idata, cpool->idata->dns.hostcache); sigpipe_restore(&pipe_st); } + +static void cpool_shutdown_destroy_oldest(struct cpool *cpool) +{ + struct Curl_llist_node *e; + struct connectdata *conn; + + e = Curl_llist_head(&cpool->shutdowns); + if(e) { + SIGPIPE_VARIABLE(pipe_st); + conn = Curl_node_elem(e); + Curl_node_remove(e); + sigpipe_init(&pipe_st); + sigpipe_apply(cpool->idata, &pipe_st); + cpool_close_and_destroy(cpool, conn, NULL, FALSE); + sigpipe_restore(&pipe_st); + } +} + +static void cpool_discard_conn(struct cpool *cpool, + struct Curl_easy *data, + struct connectdata *conn, + bool aborted) +{ + bool done = FALSE; + + DEBUGASSERT(data); + DEBUGASSERT(cpool); + DEBUGASSERT(!conn->bits.in_cpool); + + /* + * If this connection is not marked to force-close, leave it open if there + * are other users of it + */ + if(CONN_INUSE(conn) && !aborted) { + DEBUGF(infof(data, "[CCACHE] not discarding #%" FMT_OFF_T + " still in use by %zu transfers", conn->connection_id, + CONN_INUSE(conn))); + return; + } + + /* treat the connection as aborted in CONNECT_ONLY situations, we do + * not know what the APP did with it. */ + if(conn->connect_only) + aborted = TRUE; + conn->bits.aborted = aborted; + + /* We do not shutdown dead connections. The term 'dead' can be misleading + * here, as we also mark errored connections/transfers as 'dead'. + * If we do a shutdown for an aborted transfer, the server might think + * it was successful otherwise (for example an ftps: upload). This is + * not what we want. */ + if(aborted) + done = TRUE; + if(!done) { + /* Attempt to shutdown the connection right away. */ + Curl_attach_connection(data, conn); + cpool_run_conn_shutdown(data, conn, &done); + DEBUGF(infof(data, "[CCACHE] shutdown #%" FMT_OFF_T ", done=%d", + conn->connection_id, done)); + Curl_detach_connection(data); + } + + if(done) { + cpool_close_and_destroy(cpool, conn, data, FALSE); + return; + } + + /* Add the connection to our shutdown list for non-blocking shutdown + * during multi processing. */ + if(data->multi && data->multi->max_shutdown_connections > 0 && + (data->multi->max_shutdown_connections >= + (long)Curl_llist_count(&cpool->shutdowns))) { + DEBUGF(infof(data, "[CCACHE] discarding oldest shutdown connection " + "due to limit of %ld", + data->multi->max_shutdown_connections)); + cpool_shutdown_destroy_oldest(cpool); + } + + if(data->multi && data->multi->socket_cb) { + DEBUGASSERT(cpool == &data->multi->cpool); + /* Start with an empty shutdown pollset, so out internal closure handle + * is added to the sockets. */ + memset(&conn->shutdown_poll, 0, sizeof(conn->shutdown_poll)); + if(cpool_update_shutdown_ev(data->multi, cpool->idata, conn)) { + DEBUGF(infof(data, "[CCACHE] update events for shutdown failed, " + "discarding #%" FMT_OFF_T, + conn->connection_id)); + cpool_close_and_destroy(cpool, conn, data, FALSE); + return; + } + } + + Curl_llist_append(&cpool->shutdowns, conn, &conn->cpool_node); + DEBUGF(infof(data, "[CCACHE] added #%" FMT_OFF_T + " to shutdown list of length %zu", conn->connection_id, + Curl_llist_count(&cpool->shutdowns))); +} + +void Curl_cpool_disconnect(struct Curl_easy *data, + struct connectdata *conn, + bool aborted) +{ + struct cpool *cpool = cpool_get_instance(data); + bool do_lock; + + DEBUGASSERT(cpool); + DEBUGASSERT(data && !data->conn); + if(!cpool) + return; + + /* If this connection is not marked to force-close, leave it open if there + * are other users of it */ + if(CONN_INUSE(conn) && !aborted) { + DEBUGASSERT(0); /* does this ever happen? */ + DEBUGF(infof(data, "Curl_disconnect when inuse: %zu", CONN_INUSE(conn))); + return; + } + + /* This method may be called while we are under lock, e.g. from a + * user callback in find. */ + do_lock = !CPOOL_IS_LOCKED(cpool); + if(do_lock) + CPOOL_LOCK(cpool); + + if(conn->bits.in_cpool) { + cpool_remove_conn(cpool, conn); + DEBUGASSERT(!conn->bits.in_cpool); + } + + /* Run the callback to let it clean up anything it wants to. */ + aborted = cpool->disconnect_cb(data, conn, aborted); + + if(data->multi) { + /* Add it to the multi's cpool for shutdown handling */ + infof(data, "%s connection #%" FMT_OFF_T, + aborted ? "closing" : "shutting down", conn->connection_id); + cpool_discard_conn(&data->multi->cpool, data, conn, aborted); + } + else { + /* No multi available. Make a best-effort shutdown + close */ + infof(data, "closing connection #%" FMT_OFF_T, conn->connection_id); + cpool_close_and_destroy(NULL, conn, data, !aborted); + } + + if(do_lock) + CPOOL_UNLOCK(cpool); +} + +static void cpool_run_conn_shutdown_handler(struct Curl_easy *data, + struct connectdata *conn) +{ + if(!conn->bits.shutdown_handler) { + if(conn->dns_entry) + Curl_resolv_unlink(data, &conn->dns_entry); + + /* Cleanup NTLM connection-related data */ + Curl_http_auth_cleanup_ntlm(conn); + + /* Cleanup NEGOTIATE connection-related data */ + Curl_http_auth_cleanup_negotiate(conn); + + if(conn->handler && conn->handler->disconnect) { + /* This is set if protocol-specific cleanups should be made */ + DEBUGF(infof(data, "connection #%" FMT_OFF_T + ", shutdown protocol handler (aborted=%d)", + conn->connection_id, conn->bits.aborted)); + + conn->handler->disconnect(data, conn, conn->bits.aborted); + } + + /* possible left-overs from the async name resolvers */ + Curl_resolver_cancel(data); + + conn->bits.shutdown_handler = TRUE; + } +} + +static void cpool_run_conn_shutdown(struct Curl_easy *data, + struct connectdata *conn, + bool *done) +{ + CURLcode r1, r2; + bool done1, done2; + + /* We expect to be attached when called */ + DEBUGASSERT(data->conn == conn); + + cpool_run_conn_shutdown_handler(data, conn); + + if(conn->bits.shutdown_filters) { + *done = TRUE; + return; + } + + if(!conn->connect_only && Curl_conn_is_connected(conn, FIRSTSOCKET)) + r1 = Curl_conn_shutdown(data, FIRSTSOCKET, &done1); + else { + r1 = CURLE_OK; + done1 = TRUE; + } + + if(!conn->connect_only && Curl_conn_is_connected(conn, SECONDARYSOCKET)) + r2 = Curl_conn_shutdown(data, SECONDARYSOCKET, &done2); + else { + r2 = CURLE_OK; + done2 = TRUE; + } + + /* we are done when any failed or both report success */ + *done = (r1 || r2 || (done1 && done2)); + if(*done) + conn->bits.shutdown_filters = TRUE; +} + +static CURLcode cpool_add_pollfds(struct cpool *cpool, + struct curl_pollfds *cpfds) +{ + CURLcode result = CURLE_OK; + + if(Curl_llist_head(&cpool->shutdowns)) { + struct Curl_llist_node *e; + struct easy_pollset ps; + struct connectdata *conn; + + for(e = Curl_llist_head(&cpool->shutdowns); e; + e = Curl_node_next(e)) { + conn = Curl_node_elem(e); + memset(&ps, 0, sizeof(ps)); + Curl_attach_connection(cpool->idata, conn); + Curl_conn_adjust_pollset(cpool->idata, &ps); + Curl_detach_connection(cpool->idata); + + result = Curl_pollfds_add_ps(cpfds, &ps); + if(result) { + Curl_pollfds_cleanup(cpfds); + goto out; + } + } + } +out: + return result; +} + +CURLcode Curl_cpool_add_pollfds(struct cpool *cpool, + struct curl_pollfds *cpfds) +{ + CURLcode result; + CPOOL_LOCK(cpool); + result = cpool_add_pollfds(cpool, cpfds); + CPOOL_UNLOCK(cpool); + return result; +} + +CURLcode Curl_cpool_add_waitfds(struct cpool *cpool, + struct curl_waitfds *cwfds) +{ + CURLcode result = CURLE_OK; + + CPOOL_LOCK(cpool); + if(Curl_llist_head(&cpool->shutdowns)) { + struct Curl_llist_node *e; + struct easy_pollset ps; + struct connectdata *conn; + + for(e = Curl_llist_head(&cpool->shutdowns); e; + e = Curl_node_next(e)) { + conn = Curl_node_elem(e); + memset(&ps, 0, sizeof(ps)); + Curl_attach_connection(cpool->idata, conn); + Curl_conn_adjust_pollset(cpool->idata, &ps); + Curl_detach_connection(cpool->idata); + + result = Curl_waitfds_add_ps(cwfds, &ps); + if(result) + goto out; + } + } +out: + CPOOL_UNLOCK(cpool); + return result; +} + +static void cpool_perform(struct cpool *cpool) +{ + struct Curl_easy *data = cpool->idata; + struct Curl_llist_node *e = Curl_llist_head(&cpool->shutdowns); + struct Curl_llist_node *enext; + struct connectdata *conn; + struct curltime *nowp = NULL; + struct curltime now; + timediff_t next_from_now_ms = 0, ms; + bool done; + + if(!e) + return; + + DEBUGASSERT(data); + DEBUGF(infof(data, "[CCACHE] perform, %zu connections being shutdown", + Curl_llist_count(&cpool->shutdowns))); + while(e) { + enext = Curl_node_next(e); + conn = Curl_node_elem(e); + Curl_attach_connection(data, conn); + cpool_run_conn_shutdown(data, conn, &done); + DEBUGF(infof(data, "[CCACHE] shutdown #%" FMT_OFF_T ", done=%d", + conn->connection_id, done)); + Curl_detach_connection(data); + if(done) { + Curl_node_remove(e); + cpool_close_and_destroy(cpool, conn, NULL, FALSE); + } + else { + /* Not done, when does this connection time out? */ + if(!nowp) { + now = Curl_now(); + nowp = &now; + } + ms = Curl_conn_shutdown_timeleft(conn, nowp); + if(ms && ms < next_from_now_ms) + next_from_now_ms = ms; + } + e = enext; + } + + if(next_from_now_ms) + Curl_expire(data, next_from_now_ms, EXPIRE_RUN_NOW); +} + +void Curl_cpool_multi_perform(struct Curl_multi *multi) +{ + CPOOL_LOCK(&multi->cpool); + cpool_perform(&multi->cpool); + CPOOL_UNLOCK(&multi->cpool); +} + + +/* + * Close and destroy the connection. Run the shutdown sequence once, + * of so requested. + */ +static void cpool_close_and_destroy(struct cpool *cpool, + struct connectdata *conn, + struct Curl_easy *data, + bool do_shutdown) +{ + bool done; + + /* there must be a connection to close */ + DEBUGASSERT(conn); + /* it must be removed from the connection pool */ + DEBUGASSERT(!conn->bits.in_cpool); + /* there must be an associated transfer */ + DEBUGASSERT(data || cpool); + if(!data) + data = cpool->idata; + + /* the transfer must be detached from the connection */ + DEBUGASSERT(data && !data->conn); + + Curl_attach_connection(data, conn); + + cpool_run_conn_shutdown_handler(data, conn); + if(do_shutdown) { + /* Make a last attempt to shutdown handlers and filters, if + * not done so already. */ + cpool_run_conn_shutdown(data, conn, &done); + } + + if(cpool) + DEBUGF(infof(data, "[CCACHE] closing #%" FMT_OFF_T, + conn->connection_id)); + else + DEBUGF(infof(data, "closing connection #%" FMT_OFF_T, + conn->connection_id)); + Curl_conn_close(data, SECONDARYSOCKET); + Curl_conn_close(data, FIRSTSOCKET); + Curl_detach_connection(data); + + Curl_conn_free(data, conn); +} + + +static CURLMcode cpool_update_shutdown_ev(struct Curl_multi *multi, + struct Curl_easy *data, + struct connectdata *conn) +{ + struct easy_pollset ps; + CURLMcode mresult; + + DEBUGASSERT(data); + DEBUGASSERT(multi); + DEBUGASSERT(multi->socket_cb); + + memset(&ps, 0, sizeof(ps)); + Curl_attach_connection(data, conn); + Curl_conn_adjust_pollset(data, &ps); + Curl_detach_connection(data); + + mresult = Curl_multi_pollset_ev(multi, data, &ps, &conn->shutdown_poll); + + if(!mresult) /* Remember for next time */ + memcpy(&conn->shutdown_poll, &ps, sizeof(ps)); + return mresult; +} + +void Curl_cpool_multi_socket(struct Curl_multi *multi, + curl_socket_t s, int ev_bitmask) +{ + struct cpool *cpool = &multi->cpool; + struct Curl_easy *data = cpool->idata; + struct Curl_llist_node *e; + struct connectdata *conn; + bool done; + + (void)ev_bitmask; + DEBUGASSERT(multi->socket_cb); + CPOOL_LOCK(cpool); + e = Curl_llist_head(&cpool->shutdowns); + while(e) { + conn = Curl_node_elem(e); + if(s == conn->sock[FIRSTSOCKET] || s == conn->sock[SECONDARYSOCKET]) { + Curl_attach_connection(data, conn); + cpool_run_conn_shutdown(data, conn, &done); + DEBUGF(infof(data, "[CCACHE] shutdown #%" FMT_OFF_T ", done=%d", + conn->connection_id, done)); + Curl_detach_connection(data); + if(done || cpool_update_shutdown_ev(multi, data, conn)) { + Curl_node_remove(e); + cpool_close_and_destroy(cpool, conn, NULL, FALSE); + } + break; + } + e = Curl_node_next(e); + } + CPOOL_UNLOCK(cpool); +} + +#define NUM_POLLS_ON_STACK 10 + +static CURLcode cpool_shutdown_wait(struct cpool *cpool, int timeout_ms) +{ + struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK]; + struct curl_pollfds cpfds; + CURLcode result; + + Curl_pollfds_init(&cpfds, a_few_on_stack, NUM_POLLS_ON_STACK); + + result = cpool_add_pollfds(cpool, &cpfds); + if(result) + goto out; + + Curl_poll(cpfds.pfds, cpfds.n, CURLMIN(timeout_ms, 1000)); + +out: + Curl_pollfds_cleanup(&cpfds); + return result; +} + +static void cpool_shutdown_all(struct cpool *cpool, + struct Curl_easy *data, int timeout_ms) +{ + struct connectdata *conn; + struct curltime started = Curl_now(); + + if(!data) + return; + (void)data; + + DEBUGF(infof(data, "cpool shutdown all")); + + /* Move all connections into the shutdown queue */ + for(conn = cpool_get_live_conn(cpool); conn; + conn = cpool_get_live_conn(cpool)) { + /* Move conn from live set to shutdown or destroy right away */ + DEBUGF(infof(data, "moving connection #%" FMT_OFF_T + " to shutdown queue", conn->connection_id)); + cpool_remove_conn(cpool, conn); + cpool_discard_conn(cpool, data, conn, FALSE); + } + + while(Curl_llist_head(&cpool->shutdowns)) { + timediff_t timespent; + int remain_ms; + + cpool_perform(cpool); + + if(!Curl_llist_head(&cpool->shutdowns)) { + DEBUGF(infof(data, "cpool shutdown ok")); + break; + } + + /* wait for activity, timeout or "nothing" */ + timespent = Curl_timediff(Curl_now(), started); + if(timespent >= (timediff_t)timeout_ms) { + DEBUGF(infof(data, "cpool shutdown %s", + (timeout_ms > 0) ? "timeout" : "best effort done")); + break; + } + + remain_ms = timeout_ms - (int)timespent; + if(cpool_shutdown_wait(cpool, remain_ms)) { + DEBUGF(infof(data, "cpool shutdown all, abort")); + break; + } + } + + /* Due to errors/timeout, we might come here without being done. */ + cpool_shutdown_discard_all(cpool); +} + +struct cpool_reaper_ctx { + struct curltime now; +}; + +static int cpool_reap_dead_cb(struct Curl_easy *data, + struct connectdata *conn, void *param) +{ + struct cpool_reaper_ctx *rctx = param; + if(Curl_conn_seems_dead(conn, data, &rctx->now)) { + /* stop the iteration here, pass back the connection that was pruned */ + Curl_cpool_disconnect(data, conn, FALSE); + return 1; + } + return 0; /* continue iteration */ +} + +/* + * This function scans the data's connection pool for half-open/dead + * connections, closes and removes them. + * The cleanup is done at most once per second. + * + * When called, this transfer has no connection attached. + */ +void Curl_cpool_prune_dead(struct Curl_easy *data) +{ + struct cpool *cpool = cpool_get_instance(data); + struct cpool_reaper_ctx rctx; + timediff_t elapsed; + + if(!cpool) + return; + + rctx.now = Curl_now(); + CPOOL_LOCK(cpool); + elapsed = Curl_timediff(rctx.now, cpool->last_cleanup); + + if(elapsed >= 1000L) { + while(cpool_foreach(data, cpool, &rctx, cpool_reap_dead_cb)) + ; + cpool->last_cleanup = rctx.now; + } + CPOOL_UNLOCK(cpool); +} + +static int conn_upkeep(struct Curl_easy *data, + struct connectdata *conn, + void *param) +{ + struct curltime *now = param; + /* TODO, shall we reap connections that return an error here? */ + Curl_conn_upkeep(data, conn, now); + return 0; /* continue iteration */ +} + +CURLcode Curl_cpool_upkeep(void *data) +{ + struct cpool *cpool = cpool_get_instance(data); + struct curltime now = Curl_now(); + + if(!cpool) + return CURLE_OK; + + CPOOL_LOCK(cpool); + cpool_foreach(data, cpool, &now, conn_upkeep); + CPOOL_UNLOCK(cpool); + return CURLE_OK; +} + +struct cpool_find_ctx { + curl_off_t id; + struct connectdata *conn; +}; + +static int cpool_find_conn(struct Curl_easy *data, + struct connectdata *conn, void *param) +{ + struct cpool_find_ctx *fctx = param; + (void)data; + if(conn->connection_id == fctx->id) { + fctx->conn = conn; + return 1; + } + return 0; +} + +struct connectdata *Curl_cpool_get_conn(struct Curl_easy *data, + curl_off_t conn_id) +{ + struct cpool *cpool = cpool_get_instance(data); + struct cpool_find_ctx fctx; + + if(!cpool) + return NULL; + fctx.id = conn_id; + fctx.conn = NULL; + CPOOL_LOCK(cpool); + cpool_foreach(cpool->idata, cpool, &fctx, cpool_find_conn); + CPOOL_UNLOCK(cpool); + return fctx.conn; +} + +struct cpool_do_conn_ctx { + curl_off_t id; + Curl_cpool_conn_do_cb *cb; + void *cbdata; +}; + +static int cpool_do_conn(struct Curl_easy *data, + struct connectdata *conn, void *param) +{ + struct cpool_do_conn_ctx *dctx = param; + (void)data; + if(conn->connection_id == dctx->id) { + dctx->cb(conn, data, dctx->cbdata); + return 1; + } + return 0; +} + +void Curl_cpool_do_by_id(struct Curl_easy *data, curl_off_t conn_id, + Curl_cpool_conn_do_cb *cb, void *cbdata) +{ + struct cpool *cpool = cpool_get_instance(data); + struct cpool_do_conn_ctx dctx; + + if(!cpool) + return; + dctx.id = conn_id; + dctx.cb = cb; + dctx.cbdata = cbdata; + CPOOL_LOCK(cpool); + cpool_foreach(data, cpool, &dctx, cpool_do_conn); + CPOOL_UNLOCK(cpool); +} + +void Curl_cpool_do_locked(struct Curl_easy *data, + struct connectdata *conn, + Curl_cpool_conn_do_cb *cb, void *cbdata) +{ + struct cpool *cpool = cpool_get_instance(data); + if(cpool) { + CPOOL_LOCK(cpool); + cb(conn, data, cbdata); + CPOOL_UNLOCK(cpool); + } + else + cb(conn, data, cbdata); +} + #if 0 -/* Useful for debugging the connection cache */ -void Curl_conncache_print(struct conncache *connc) +/* Useful for debugging the connection pool */ +void Curl_cpool_print(struct cpool *cpool) { struct Curl_hash_iterator iter; - struct Curl_llist_element *curr; + struct Curl_llist_node *curr; struct Curl_hash_element *he; - if(!connc) + if(!cpool) return; fprintf(stderr, "=Bundle cache=\n"); - Curl_hash_start_iterate(connc->hash, &iter); + Curl_hash_start_iterate(cpool->dest2bundle, &iter); he = Curl_hash_next_element(&iter); while(he) { - struct connectbundle *bundle; + struct cpool_bundle *bundle; struct connectdata *conn; bundle = he->ptr; fprintf(stderr, "%s -", he->key); - curr = bundle->conn_list->head; + curr = Curl_llist_head(bundle->conns); while(curr) { - conn = curr->ptr; + conn = Curl_node_elem(curr); - fprintf(stderr, " [%p %d]", (void *)conn, conn->inuse); - curr = curr->next; + fprintf(stderr, " [%p %d]", (void *)conn, conn->refcount); + curr = Curl_node_next(curr); } fprintf(stderr, "\n"); diff --git a/deps/curl/lib/conncache.h b/deps/curl/lib/conncache.h index c60f8449..a379ee74 100644 --- a/deps/curl/lib/conncache.h +++ b/deps/curl/lib/conncache.h @@ -25,98 +25,177 @@ * ***************************************************************************/ -/* - * All accesses to struct fields and changing of data in the connection cache - * and connectbundles must be done with the conncache LOCKED. The cache might - * be shared. - */ - #include #include "timeval.h" struct connectdata; +struct Curl_easy; +struct curl_pollfds; +struct curl_waitfds; +struct Curl_multi; +struct Curl_share; -struct conncache { - struct Curl_hash hash; +/** + * Callback invoked when disconnecting connections. + * @param data transfer last handling the connection, not attached + * @param conn the connection to discard + * @param aborted if the connection is being aborted + * @return if the connection is being aborted, e.g. should NOT perform + * a shutdown and just close. + **/ +typedef bool Curl_cpool_disconnect_cb(struct Curl_easy *data, + struct connectdata *conn, + bool aborted); + +struct cpool { + /* the pooled connections, bundled per destination */ + struct Curl_hash dest2bundle; size_t num_conn; curl_off_t next_connection_id; curl_off_t next_easy_id; struct curltime last_cleanup; - /* handle used for closing cached connections */ - struct Curl_easy *closure_handle; + struct Curl_llist shutdowns; /* The connections being shut down */ + struct Curl_easy *idata; /* internal handle used for discard */ + struct Curl_multi *multi; /* != NULL iff pool belongs to multi */ + struct Curl_share *share; /* != NULL iff pool belongs to share */ + Curl_cpool_disconnect_cb *disconnect_cb; + BIT(locked); }; -#define BUNDLE_NO_MULTIUSE -1 -#define BUNDLE_UNKNOWN 0 /* initial value */ -#define BUNDLE_MULTIPLEX 2 +/* Init the pool, pass multi only if pool is owned by it. + * returns 1 on error, 0 is fine. + */ +int Curl_cpool_init(struct cpool *cpool, + Curl_cpool_disconnect_cb *disconnect_cb, + struct Curl_multi *multi, + struct Curl_share *share, + size_t size); -#ifdef CURLDEBUG -/* the debug versions of these macros make extra certain that the lock is - never doubly locked or unlocked */ -#define CONNCACHE_LOCK(x) \ - do { \ - if((x)->share) { \ - Curl_share_lock((x), CURL_LOCK_DATA_CONNECT, \ - CURL_LOCK_ACCESS_SINGLE); \ - DEBUGASSERT(!(x)->state.conncache_lock); \ - (x)->state.conncache_lock = TRUE; \ - } \ - } while(0) +/* Destroy all connections and free all members */ +void Curl_cpool_destroy(struct cpool *connc); -#define CONNCACHE_UNLOCK(x) \ - do { \ - if((x)->share) { \ - DEBUGASSERT((x)->state.conncache_lock); \ - (x)->state.conncache_lock = FALSE; \ - Curl_share_unlock((x), CURL_LOCK_DATA_CONNECT); \ - } \ - } while(0) -#else -#define CONNCACHE_LOCK(x) if((x)->share) \ - Curl_share_lock((x), CURL_LOCK_DATA_CONNECT, CURL_LOCK_ACCESS_SINGLE) -#define CONNCACHE_UNLOCK(x) if((x)->share) \ - Curl_share_unlock((x), CURL_LOCK_DATA_CONNECT) -#endif +/* Init the transfer to be used within its connection pool. + * Assigns `data->id`. */ +void Curl_cpool_xfer_init(struct Curl_easy *data); -struct connectbundle { - int multiuse; /* supports multi-use */ - size_t num_connections; /* Number of connections in the bundle */ - struct Curl_llist conn_list; /* The connectdata members of the bundle */ -}; +/** + * Get the connection with the given id from the transfer's pool. + */ +struct connectdata *Curl_cpool_get_conn(struct Curl_easy *data, + curl_off_t conn_id); -/* returns 1 on error, 0 is fine */ -int Curl_conncache_init(struct conncache *, int size); -void Curl_conncache_destroy(struct conncache *connc); +CURLcode Curl_cpool_add_conn(struct Curl_easy *data, + struct connectdata *conn) WARN_UNUSED_RESULT; -/* return the correct bundle, to a host or a proxy */ -struct connectbundle *Curl_conncache_find_bundle(struct Curl_easy *data, - struct connectdata *conn, - struct conncache *connc); -/* returns number of connections currently held in the connection cache */ -size_t Curl_conncache_size(struct Curl_easy *data); +/** + * Return if the pool has reached its configured limits for adding + * the given connection. Will try to discard the oldest, idle + * connections to make space. + */ +#define CPOOL_LIMIT_OK 0 +#define CPOOL_LIMIT_DEST 1 +#define CPOOL_LIMIT_TOTAL 2 +int Curl_cpool_check_limits(struct Curl_easy *data, + struct connectdata *conn); -bool Curl_conncache_return_conn(struct Curl_easy *data, - struct connectdata *conn); -CURLcode Curl_conncache_add_conn(struct Curl_easy *data) WARN_UNUSED_RESULT; -void Curl_conncache_remove_conn(struct Curl_easy *data, - struct connectdata *conn, - bool lock); -bool Curl_conncache_foreach(struct Curl_easy *data, - struct conncache *connc, - void *param, - int (*func)(struct Curl_easy *data, - struct connectdata *conn, - void *param)); +/* Return of conn is suitable. If so, stops iteration. */ +typedef bool Curl_cpool_conn_match_cb(struct connectdata *conn, + void *userdata); -struct connectdata * -Curl_conncache_find_first_connection(struct conncache *connc); +/* Act on the result of the find, may override it. */ +typedef bool Curl_cpool_done_match_cb(bool result, void *userdata); + +/** + * Find a connection in the pool matching `destination`. + * All callbacks are invoked while the pool's lock is held. + * @param data current transfer + * @param destination match agaonst `conn->destination` in pool + * @param dest_len destination length, including terminating NUL + * @param conn_cb must be present, called for each connection in the + * bundle until it returns TRUE + * @param result_cb if not NULL, is called at the end with the result + * of the `conn_cb` or FALSE if never called. + * @return combined result of last conn_db and result_cb or FALSE if no + connections were present. + */ +bool Curl_cpool_find(struct Curl_easy *data, + const char *destination, size_t dest_len, + Curl_cpool_conn_match_cb *conn_cb, + Curl_cpool_done_match_cb *done_cb, + void *userdata); + +/* + * A connection (already in the pool) is now idle. Do any + * cleanups in regard to the pool's limits. + * + * Return TRUE if idle connection kept in pool, FALSE if closed. + */ +bool Curl_cpool_conn_now_idle(struct Curl_easy *data, + struct connectdata *conn); + +/** + * Remove the connection from the pool and tear it down. + * If `aborted` is FALSE, the connection will be shut down first + * before closing and destroying it. + * If the shutdown is not immediately complete, the connection + * will be placed into the pool's shutdown queue. + */ +void Curl_cpool_disconnect(struct Curl_easy *data, + struct connectdata *conn, + bool aborted); + +/** + * This function scans the data's connection pool for half-open/dead + * connections, closes and removes them. + * The cleanup is done at most once per second. + * + * When called, this transfer has no connection attached. + */ +void Curl_cpool_prune_dead(struct Curl_easy *data); + +/** + * Perform upkeep actions on connections in the transfer's pool. + */ +CURLcode Curl_cpool_upkeep(void *data); + +typedef void Curl_cpool_conn_do_cb(struct connectdata *conn, + struct Curl_easy *data, + void *cbdata); + +/** + * Invoke the callback on the pool's connection with the + * given connection id (if it exists). + */ +void Curl_cpool_do_by_id(struct Curl_easy *data, + curl_off_t conn_id, + Curl_cpool_conn_do_cb *cb, void *cbdata); + +/** + * Invoked the callback for the given data + connection under the + * connection pool's lock. + * The callback is always invoked, even if the transfer has no connection + * pool associated. + */ +void Curl_cpool_do_locked(struct Curl_easy *data, + struct connectdata *conn, + Curl_cpool_conn_do_cb *cb, void *cbdata); + +/** + * Add sockets and POLLIN/OUT flags for connections handled by the pool. + */ +CURLcode Curl_cpool_add_pollfds(struct cpool *connc, + struct curl_pollfds *cpfds); +CURLcode Curl_cpool_add_waitfds(struct cpool *connc, + struct curl_waitfds *cwfds); + +/** + * Perform maintenance on connections in the pool. Specifically, + * progress the shutdown of connections in the queue. + */ +void Curl_cpool_multi_perform(struct Curl_multi *multi); + +void Curl_cpool_multi_socket(struct Curl_multi *multi, + curl_socket_t s, int ev_bitmask); -struct connectdata * -Curl_conncache_extract_bundle(struct Curl_easy *data, - struct connectbundle *bundle); -struct connectdata * -Curl_conncache_extract_oldest(struct Curl_easy *data); -void Curl_conncache_close_all_connections(struct conncache *connc); -void Curl_conncache_print(struct conncache *connc); #endif /* HEADER_CURL_CONNCACHE_H */ diff --git a/deps/curl/lib/connect.c b/deps/curl/lib/connect.c index 5e0f8b23..ee3b4c8a 100644 --- a/deps/curl/lib/connect.c +++ b/deps/curl/lib/connect.c @@ -90,7 +90,7 @@ /* * Curl_timeleft() returns the amount of milliseconds left allowed for the - * transfer/connection. If the value is 0, there's no timeout (ie there's + * 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. * @param data the transfer to check on @@ -139,32 +139,73 @@ timediff_t Curl_timeleft(struct Curl_easy *data, 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; + return (ctimeleft_ms < timeleft_ms) ? ctimeleft_ms : timeleft_ms; } -/* Copies connection info into the transfer handle to make it available when - the transfer handle is no longer associated with the connection. */ -void Curl_persistconninfo(struct Curl_easy *data, struct connectdata *conn, - char *local_ip, int local_port) +void Curl_shutdown_start(struct Curl_easy *data, int sockindex, + struct curltime *nowp) { - memcpy(data->info.conn_primary_ip, conn->primary_ip, MAX_IPADR_LEN); - if(local_ip && local_ip[0]) - memcpy(data->info.conn_local_ip, local_ip, MAX_IPADR_LEN); - else - data->info.conn_local_ip[0] = 0; - data->info.conn_scheme = conn->handler->scheme; - /* conn_protocol can only provide "old" protocols */ - data->info.conn_protocol = (conn->handler->protocol) & CURLPROTO_MASK; - data->info.conn_primary_port = conn->port; - data->info.conn_remote_port = conn->remote_port; - data->info.conn_local_port = local_port; - data->info.used_proxy = -#ifdef CURL_DISABLE_PROXY - 0 -#else - conn->bits.proxy -#endif - ; + struct curltime now; + + DEBUGASSERT(data->conn); + if(!nowp) { + now = Curl_now(); + nowp = &now; + } + data->conn->shutdown.start[sockindex] = *nowp; + data->conn->shutdown.timeout_ms = (data->set.shutdowntimeout > 0) ? + data->set.shutdowntimeout : DEFAULT_SHUTDOWN_TIMEOUT_MS; +} + +timediff_t Curl_shutdown_timeleft(struct connectdata *conn, int sockindex, + struct curltime *nowp) +{ + struct curltime now; + timediff_t left_ms; + + if(!conn->shutdown.start[sockindex].tv_sec || !conn->shutdown.timeout_ms) + return 0; /* not started or no limits */ + + if(!nowp) { + now = Curl_now(); + nowp = &now; + } + left_ms = conn->shutdown.timeout_ms - + Curl_timediff(*nowp, conn->shutdown.start[sockindex]); + return left_ms ? left_ms : -1; +} + +timediff_t Curl_conn_shutdown_timeleft(struct connectdata *conn, + struct curltime *nowp) +{ + timediff_t left_ms = 0, ms; + struct curltime now; + int i; + + for(i = 0; conn->shutdown.timeout_ms && (i < 2); ++i) { + if(!conn->shutdown.start[i].tv_sec) + continue; + if(!nowp) { + now = Curl_now(); + nowp = &now; + } + ms = Curl_shutdown_timeleft(conn, i, nowp); + if(ms && (!left_ms || ms < left_ms)) + left_ms = ms; + } + return left_ms; +} + +void Curl_shutdown_clear(struct Curl_easy *data, int sockindex) +{ + struct curltime *pt = &data->conn->shutdown.start[sockindex]; + memset(pt, 0, sizeof(*pt)); +} + +bool Curl_shutdown_started(struct Curl_easy *data, int sockindex) +{ + struct curltime *pt = &data->conn->shutdown.start[sockindex]; + return (pt->tv_sec > 0) || (pt->tv_usec > 0); } static const struct Curl_addrinfo * @@ -195,7 +236,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, char *addr, int *port) { struct sockaddr_in *si = NULL; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 *si6 = NULL; #endif #if (defined(HAVE_SYS_UN_H) || defined(WIN32_SOCKADDR_UN)) && defined(AF_UNIX) @@ -214,7 +255,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, return TRUE; } break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: si6 = (struct sockaddr_in6 *)(void *) sa; if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr, @@ -246,23 +287,6 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, return FALSE; } -struct connfind { - curl_off_t id_tofind; - struct connectdata *found; -}; - -static int conn_is_conn(struct Curl_easy *data, - struct connectdata *conn, void *param) -{ - struct connfind *f = (struct connfind *)param; - (void)data; - if(conn->connection_id == f->id_tofind) { - f->found = conn; - return 1; - } - return 0; -} - /* * Used to extract socket and connectdata struct for the most recent * transfer on the given Curl_easy. @@ -279,30 +303,19 @@ curl_socket_t Curl_getconnectinfo(struct Curl_easy *data, * - that is associated with a multi handle, and whose connection * was detached with CURLOPT_CONNECT_ONLY */ - if((data->state.lastconnect_id != -1) && (data->multi_easy || data->multi)) { - struct connectdata *c; - struct connfind find; - find.id_tofind = data->state.lastconnect_id; - find.found = NULL; + if(data->state.lastconnect_id != -1) { + struct connectdata *conn; - Curl_conncache_foreach(data, - data->share && (data->share->specifier - & (1<< CURL_LOCK_DATA_CONNECT))? - &data->share->conn_cache: - data->multi_easy? - &data->multi_easy->conn_cache: - &data->multi->conn_cache, &find, conn_is_conn); - - if(!find.found) { + conn = Curl_cpool_get_conn(data, data->state.lastconnect_id); + if(!conn) { data->state.lastconnect_id = -1; return CURL_SOCKET_BAD; } - c = find.found; if(connp) /* only store this if the caller cares for it */ - *connp = c; - return c->sock[FIRSTSOCKET]; + *connp = conn; + return conn->sock[FIRSTSOCKET]; } return CURL_SOCKET_BAD; } @@ -317,7 +330,7 @@ void Curl_conncontrol(struct connectdata *conn, #endif ) { - /* close if a connection, or a stream that isn't multiplexed. */ + /* close if a connection, or a stream that is not multiplexed. */ /* This function will be called both before and after this connection is associated with a transfer. */ bool closeit, is_multiplex; @@ -358,6 +371,7 @@ struct eyeballer { BIT(has_started); /* attempts have started */ BIT(is_done); /* out of addresses/time */ BIT(connected); /* cf has connected */ + BIT(shutdown); /* cf has shutdown */ BIT(inconclusive); /* connect was not a hard failure, we * might talk to a restarting server */ }; @@ -400,9 +414,9 @@ static CURLcode eyeballer_new(struct eyeballer **pballer, if(!baller) return CURLE_OUT_OF_MEMORY; - baller->name = ((ai_family == AF_INET)? "ipv4" : ( -#ifdef ENABLE_IPV6 - (ai_family == AF_INET6)? "ipv6" : + baller->name = ((ai_family == AF_INET) ? "ipv4" : ( +#ifdef USE_IPV6 + (ai_family == AF_INET6) ? "ipv6" : #endif "ip")); baller->cf_create = cf_create; @@ -410,7 +424,7 @@ static CURLcode eyeballer_new(struct eyeballer **pballer, baller->ai_family = ai_family; baller->primary = primary; baller->delay_ms = delay_ms; - baller->timeoutms = addr_next_match(baller->addr, baller->ai_family)? + baller->timeoutms = addr_next_match(baller->addr, baller->ai_family) ? USETIME(timeout_ms) : timeout_ms; baller->timeout_id = timeout_id; baller->result = CURLE_COULDNT_CONNECT; @@ -464,7 +478,7 @@ static void baller_initiate(struct Curl_cfilter *cf, CURLcode result; - /* Don't close a previous cfilter yet to ensure that the next IP's + /* Do not close a previous cfilter yet to ensure that the next IP's socket gets a different file descriptor, which can prevent bugs when the curl_multi_socket_action interface is used with certain select() replacements such as kqueue. */ @@ -533,9 +547,11 @@ static CURLcode baller_start_next(struct Curl_cfilter *cf, { if(cf->sockindex == FIRSTSOCKET) { baller_next_addr(baller); - /* If we get inconclusive answers from the server(s), we make - * a second iteration over the address list */ - if(!baller->addr && baller->inconclusive && !baller->rewinded) + /* If we get inconclusive answers from the server(s), we start + * again until this whole thing times out. This allows us to + * connect to servers that are gracefully restarting and the + * packet routing to the new instance has not happened yet (e.g. QUIC). */ + if(!baller->addr && baller->inconclusive) baller_rewind(baller); baller_start(cf, data, baller, timeoutms); } @@ -567,7 +583,7 @@ static CURLcode baller_connect(struct Curl_cfilter *cf, baller->is_done = TRUE; } else if(Curl_timediff(*now, baller->started) >= baller->timeoutms) { - infof(data, "%s connect timeout after %" CURL_FORMAT_TIMEDIFF_T + infof(data, "%s connect timeout after %" FMT_TIMEDIFF_T "ms, move on!", baller->name, baller->timeoutms); #if defined(ETIMEDOUT) baller->error = ETIMEDOUT; @@ -603,7 +619,7 @@ static CURLcode is_connected(struct Curl_cfilter *cf, * If transport is QUIC, we need to shutdown the ongoing 'other' * cot ballers in a QUIC appropriate way. */ evaluate: - *connected = FALSE; /* a very negative world view is best */ + *connected = FALSE; /* a negative world view is best */ now = Curl_now(); ongoing = not_started = 0; for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { @@ -658,7 +674,7 @@ evaluate: /* Nothing connected, check the time before we might * start new ballers or return ok. */ if((ongoing || not_started) && Curl_timeleft(data, &now, TRUE) < 0) { - failf(data, "Connection timeout after %" CURL_FORMAT_CURL_OFF_T " ms", + failf(data, "Connection timeout after %" FMT_OFF_T " ms", Curl_timediff(now, data->progress.t_startsingle)); return CURLE_OPERATION_TIMEDOUT; } @@ -681,8 +697,7 @@ evaluate: CURL_TRC_CF(data, cf, "%s done", baller->name); } else { - CURL_TRC_CF(data, cf, "%s starting (timeout=%" - CURL_FORMAT_TIMEDIFF_T "ms)", + CURL_TRC_CF(data, cf, "%s starting (timeout=%" FMT_TIMEDIFF_T "ms)", baller->name, baller->timeoutms); ++ongoing; ++added; @@ -727,8 +742,8 @@ evaluate: hostname = conn->host.name; failf(data, "Failed to connect to %s port %u after " - "%" CURL_FORMAT_TIMEDIFF_T " ms: %s", - hostname, conn->port, + "%" FMT_TIMEDIFF_T " ms: %s", + hostname, conn->primary.remote_port, Curl_timediff(now, data->progress.t_startsingle), curl_easy_strerror(result)); @@ -744,7 +759,7 @@ evaluate: } /* - * Connect to the given host with timeout, proxy or remote doesn't matter. + * Connect to the given host with timeout, proxy or remote does not matter. * There might be more than one IP address to try out. */ static CURLcode start_connect(struct Curl_cfilter *cf, @@ -754,9 +769,9 @@ static CURLcode start_connect(struct Curl_cfilter *cf, struct cf_he_ctx *ctx = cf->ctx; struct connectdata *conn = cf->conn; CURLcode result = CURLE_COULDNT_CONNECT; - int ai_family0, ai_family1; + int ai_family0 = 0, ai_family1 = 0; timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); - const struct Curl_addrinfo *addr0, *addr1; + const struct Curl_addrinfo *addr0 = NULL, *addr1 = NULL; if(timeout_ms < 0) { /* a precaution, no need to continue if time already is up */ @@ -775,33 +790,33 @@ static CURLcode start_connect(struct Curl_cfilter *cf, * the 2 connect attempt ballers to try different families, if possible. * */ - if(conn->ip_version == CURL_IPRESOLVE_WHATEVER) { - /* any IP version is allowed */ - ai_family0 = remotehost->addr? - remotehost->addr->ai_family : 0; -#ifdef ENABLE_IPV6 - ai_family1 = ai_family0 == AF_INET6 ? - AF_INET : AF_INET6; -#else - ai_family1 = AF_UNSPEC; + if(conn->ip_version == CURL_IPRESOLVE_V6) { +#ifdef USE_IPV6 + ai_family0 = AF_INET6; + addr0 = addr_first_match(remotehost->addr, ai_family0); #endif } + else if(conn->ip_version == CURL_IPRESOLVE_V4) { + ai_family0 = AF_INET; + addr0 = addr_first_match(remotehost->addr, ai_family0); + } else { - /* only one IP version is allowed */ - ai_family0 = (conn->ip_version == CURL_IPRESOLVE_V4) ? - AF_INET : -#ifdef ENABLE_IPV6 - AF_INET6; -#else - AF_UNSPEC; + /* no user preference, we try ipv6 always first when available */ +#ifdef USE_IPV6 + ai_family0 = AF_INET6; + addr0 = addr_first_match(remotehost->addr, ai_family0); #endif - ai_family1 = AF_UNSPEC; + /* next candidate is ipv4 */ + ai_family1 = AF_INET; + addr1 = addr_first_match(remotehost->addr, ai_family1); + /* no ip address families, probably AF_UNIX or something, use the + * address family given to us */ + if(!addr1 && !addr0 && remotehost->addr) { + ai_family0 = remotehost->addr->ai_family; + addr0 = addr_first_match(remotehost->addr, ai_family0); + } } - /* Get the first address in the list that matches the family, - * this might give NULL, if we do not have any matches. */ - addr0 = addr_first_match(remotehost->addr, ai_family0); - addr1 = addr_first_match(remotehost->addr, ai_family1); if(!addr0 && addr1) { /* switch around, so a single baller always uses addr0 */ addr0 = addr1; @@ -820,8 +835,7 @@ static CURLcode start_connect(struct Curl_cfilter *cf, timeout_ms, EXPIRE_DNS_PER_NAME); if(result) return result; - CURL_TRC_CF(data, cf, "created %s (timeout %" - CURL_FORMAT_TIMEDIFF_T "ms)", + CURL_TRC_CF(data, cf, "created %s (timeout %" FMT_TIMEDIFF_T "ms)", ctx->baller[0]->name, ctx->baller[0]->timeoutms); if(addr1) { /* second one gets a delayed start */ @@ -832,8 +846,7 @@ static CURLcode start_connect(struct Curl_cfilter *cf, timeout_ms, EXPIRE_DNS_PER_NAME2); if(result) return result; - CURL_TRC_CF(data, cf, "created %s (timeout %" - CURL_FORMAT_TIMEDIFF_T "ms)", + CURL_TRC_CF(data, cf, "created %s (timeout %" FMT_TIMEDIFF_T "ms)", ctx->baller[1]->name, ctx->baller[1]->timeoutms); Curl_expire(data, data->set.happy_eyeballs_timeout, EXPIRE_HAPPY_EYEBALLS); @@ -857,6 +870,46 @@ static void cf_he_ctx_clear(struct Curl_cfilter *cf, struct Curl_easy *data) ctx->winner = NULL; } +static CURLcode cf_he_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + struct cf_he_ctx *ctx = cf->ctx; + size_t i; + CURLcode result = CURLE_OK; + + DEBUGASSERT(data); + if(cf->connected) { + *done = TRUE; + return CURLE_OK; + } + + /* shutdown all ballers that have not done so already. If one fails, + * continue shutting down others until all are shutdown. */ + for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { + struct eyeballer *baller = ctx->baller[i]; + bool bdone = FALSE; + if(!baller || !baller->cf || baller->shutdown) + continue; + baller->result = baller->cf->cft->do_shutdown(baller->cf, data, &bdone); + if(baller->result || bdone) + baller->shutdown = TRUE; /* treat a failed shutdown as done */ + } + + *done = TRUE; + for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { + if(ctx->baller[i] && !ctx->baller[i]->shutdown) + *done = FALSE; + } + if(*done) { + for(i = 0; i < ARRAYSIZE(ctx->baller); i++) { + if(ctx->baller[i] && ctx->baller[i]->result) + result = ctx->baller[i]->result; + } + } + CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", result, *done); + return result; +} + static void cf_he_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, struct easy_pollset *ps) @@ -913,12 +966,20 @@ static CURLcode cf_he_connect(struct Curl_cfilter *cf, cf->next = ctx->winner->cf; ctx->winner->cf = NULL; cf_he_ctx_clear(cf, data); - Curl_conn_cf_cntrl(cf->next, data, TRUE, - CF_CTRL_CONN_INFO_UPDATE, 0, NULL); if(cf->conn->handler->protocol & PROTO_FAMILY_SSH) - Curl_pgrsTime(data, TIMER_APPCONNECT); /* we're connected already */ - Curl_verboseconnect(data, cf->conn); + Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */ + if(Curl_trc_cf_is_verbose(cf, data)) { + struct ip_quadruple ipquad; + int is_ipv6; + if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) { + const char *host, *disphost; + int port; + cf->next->cft->get_host(cf->next, data, &host, &disphost, &port); + CURL_TRC_CF(data, cf, "Connected to %s (%s) port %u", + disphost, ipquad.remote_ip, ipquad.remote_port); + } + } data->info.numconnects++; /* to track the # of connections made */ } break; @@ -1028,7 +1089,7 @@ static CURLcode cf_he_query(struct Curl_cfilter *cf, } } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -1052,6 +1113,7 @@ struct Curl_cftype Curl_cft_happy_eyeballs = { cf_he_destroy, cf_he_connect, cf_he_close, + cf_he_shutdown, Curl_cf_def_get_host, cf_he_adjust_pollset, cf_he_data_pending, @@ -1112,12 +1174,12 @@ struct transport_provider { }; static -#ifndef DEBUGBUILD +#ifndef UNITTESTS const #endif struct transport_provider transport_providers[] = { { TRNSPRT_TCP, Curl_cf_tcp_create }, -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 { TRNSPRT_QUIC, Curl_cf_quic_create }, #endif #ifndef CURL_DISABLE_TFTP @@ -1316,6 +1378,7 @@ struct Curl_cftype Curl_cft_setup = { cf_setup_destroy, cf_setup_connect, cf_setup_close, + Curl_cf_def_shutdown, Curl_cf_def_get_host, Curl_cf_def_adjust_pollset, Curl_cf_def_data_pending, @@ -1354,7 +1417,7 @@ static CURLcode cf_setup_create(struct Curl_cfilter **pcf, ctx = NULL; out: - *pcf = result? NULL : cf; + *pcf = result ? NULL : cf; free(ctx); return result; } @@ -1378,7 +1441,7 @@ out: return result; } -#ifdef DEBUGBUILD +#ifdef UNITTESTS /* used by unit2600.c */ void Curl_debug_set_transport_provider(int transport, cf_ip_connect_create *cf_create) @@ -1391,7 +1454,7 @@ void Curl_debug_set_transport_provider(int transport, } } } -#endif /* DEBUGBUILD */ +#endif /* UNITTESTS */ CURLcode Curl_cf_setup_insert_after(struct Curl_cfilter *cf_at, struct Curl_easy *data, diff --git a/deps/curl/lib/connect.h b/deps/curl/lib/connect.h index 58264bdb..160db942 100644 --- a/deps/curl/lib/connect.h +++ b/deps/curl/lib/connect.h @@ -30,8 +30,9 @@ #include "timeval.h" struct Curl_dns_entry; +struct ip_quadruple; -/* generic function that returns how much time there's left to run, according +/* 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, @@ -39,6 +40,26 @@ timediff_t Curl_timeleft(struct Curl_easy *data, #define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */ +#define DEFAULT_SHUTDOWN_TIMEOUT_MS (2 * 1000) + +void Curl_shutdown_start(struct Curl_easy *data, int sockindex, + struct curltime *nowp); + +/* return how much time there is left to shutdown the connection at + * sockindex. Returns 0 if there is no limit or shutdown has not started. */ +timediff_t Curl_shutdown_timeleft(struct connectdata *conn, int sockindex, + struct curltime *nowp); + +/* return how much time there is left to shutdown the connection. + * Returns 0 if there is no limit or shutdown has not started. */ +timediff_t Curl_conn_shutdown_timeleft(struct connectdata *conn, + struct curltime *nowp); + +void Curl_shutdown_clear(struct Curl_easy *data, int sockindex); + +/* TRUE iff shutdown has been started */ +bool Curl_shutdown_started(struct Curl_easy *data, int sockindex); + /* * Used to extract socket and connectdata struct for the most recent * transfer on the given Curl_easy. @@ -51,9 +72,6 @@ curl_socket_t Curl_getconnectinfo(struct Curl_easy *data, bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, char *addr, int *port); -void Curl_persistconninfo(struct Curl_easy *data, struct connectdata *conn, - char *local_ip, int local_port); - /* * Curl_conncontrol() marks the end of a connection/stream. The 'closeit' * argument specifies if it is the end of a connection or a stream. @@ -124,7 +142,7 @@ CURLcode Curl_conn_setup(struct Curl_easy *data, extern struct Curl_cftype Curl_cft_happy_eyeballs; extern struct Curl_cftype Curl_cft_setup; -#ifdef DEBUGBUILD +#ifdef UNITTESTS void Curl_debug_set_transport_provider(int transport, cf_ip_connect_create *cf_create); #endif diff --git a/deps/curl/lib/content_encoding.c b/deps/curl/lib/content_encoding.c index c1abf24e..a4b16dda 100644 --- a/deps/curl/lib/content_encoding.c +++ b/deps/curl/lib/content_encoding.c @@ -33,13 +33,13 @@ #endif #ifdef HAVE_BROTLI -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) /* Ignore -Wvla warnings in brotli headers */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvla" #endif #include -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif #endif @@ -79,10 +79,10 @@ #define GZIP_MAGIC_1 0x8b /* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */ #define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ #define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define ORIG_NAME 0x08 /* bit 3 set: original filename present */ #define COMMENT 0x10 /* bit 4 set: file comment present */ #define RESERVED 0xE0 /* bits 5..7: reserved */ @@ -154,7 +154,7 @@ static CURLcode process_trailer(struct Curl_easy *data, { z_stream *z = &zp->z; CURLcode result = CURLE_OK; - uInt len = z->avail_in < zp->trailerlen? z->avail_in: zp->trailerlen; + uInt len = z->avail_in < zp->trailerlen ? z->avail_in : zp->trailerlen; /* Consume expected trailer bytes. Terminate stream if exhausted. Issue an error if unexpected bytes follow. */ @@ -192,7 +192,7 @@ static CURLcode inflate_stream(struct Curl_easy *data, zp->zlib_init != ZLIB_GZIP_INFLATING) return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR); - /* Dynamically allocate a buffer for decompression because it's uncommonly + /* Dynamically allocate a buffer for decompression because it is uncommonly large to hold on the stack */ decomp = malloc(DSIZ); if(!decomp) @@ -246,7 +246,7 @@ static CURLcode inflate_stream(struct Curl_easy *data, to fix and continue anyway */ if(zp->zlib_init == ZLIB_INIT) { /* Do not use inflateReset2(): only available since zlib 1.2.3.4. */ - (void) inflateEnd(z); /* don't care about the return code */ + (void) inflateEnd(z); /* do not care about the return code */ if(inflateInit2(z, -MAX_WBITS) == Z_OK) { z->next_in = orig_in; z->avail_in = nread; @@ -266,7 +266,7 @@ static CURLcode inflate_stream(struct Curl_easy *data, } free(decomp); - /* We're about to leave this call so the `nread' data bytes won't be seen + /* We are about to leave this call so the `nread' data bytes will not be seen again. If we are in a state that would wrongly allow restart in raw mode at the next call, assume output has already started. */ if(nread && zp->zlib_init == ZLIB_INIT) @@ -300,7 +300,7 @@ static CURLcode deflate_do_write(struct Curl_easy *data, struct zlib_writer *zp = (struct zlib_writer *) writer; z_stream *z = &zp->z; /* zlib state structure */ - if(!(type & CLIENTWRITE_BODY)) + if(!(type & CLIENTWRITE_BODY) || !nbytes) return Curl_cwriter_write(data, writer->next, type, buf, nbytes); /* Set the compressed input when this function is called */ @@ -388,7 +388,7 @@ static gzip_status check_gzip_header(unsigned char const *data, ssize_t len, flags = data[3]; if(method != Z_DEFLATED || (flags & RESERVED) != 0) { - /* Can't handle this compression method or unknown flag */ + /* cannot handle this compression method or unknown flag */ return GZIP_BAD; } @@ -412,7 +412,7 @@ static gzip_status check_gzip_header(unsigned char const *data, ssize_t len, } if(flags & ORIG_NAME) { - /* Skip over NUL-terminated file name */ + /* Skip over NUL-terminated filename */ while(len && *data) { --len; ++data; @@ -457,7 +457,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data, struct zlib_writer *zp = (struct zlib_writer *) writer; z_stream *z = &zp->z; /* zlib state structure */ - if(!(type & CLIENTWRITE_BODY)) + if(!(type & CLIENTWRITE_BODY) || !nbytes) return Curl_cwriter_write(data, writer->next, type, buf, nbytes); if(zp->zlib_init == ZLIB_INIT_GZIP) { @@ -474,10 +474,10 @@ static CURLcode gzip_do_write(struct Curl_easy *data, return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR); #else - /* This next mess is to get around the potential case where there isn't - * enough data passed in to skip over the gzip header. If that happens, we - * malloc a block and copy what we have then wait for the next call. If - * there still isn't enough (this is definitely a worst-case scenario), we + /* This next mess is to get around the potential case where there is not + * enough data passed in to skip over the gzip header. If that happens, we + * malloc a block and copy what we have then wait for the next call. If + * there still is not enough (this is definitely a worst-case scenario), we * make the block bigger, copy the next part in and keep waiting. * * This is only required with zlib versions < 1.2.0.4 as newer versions @@ -499,11 +499,11 @@ static CURLcode gzip_do_write(struct Curl_easy *data, break; case GZIP_UNDERFLOW: - /* We need more data so we can find the end of the gzip header. It's + /* We need more data so we can find the end of the gzip header. it is * possible that the memory block we malloc here will never be freed if - * the transfer abruptly aborts after this point. Since it's unlikely + * the transfer abruptly aborts after this point. Since it is unlikely * that circumstances will be right for this code path to be followed in - * the first place, and it's even more unlikely for a transfer to fail + * the first place, and it is even more unlikely for a transfer to fail * immediately afterwards, it should seldom be a problem. */ z->avail_in = (uInt) nbytes; @@ -513,7 +513,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data, } memcpy(z->next_in, buf, z->avail_in); zp->zlib_init = ZLIB_GZIP_HEADER; /* Need more gzip header data state */ - /* We don't have any data to inflate yet */ + /* We do not have any data to inflate yet */ return CURLE_OK; case GZIP_BAD: @@ -536,18 +536,18 @@ static CURLcode gzip_do_write(struct Curl_easy *data, /* Append the new block of data to the previous one */ memcpy(z->next_in + z->avail_in - nbytes, buf, nbytes); - switch(check_gzip_header(z->next_in, z->avail_in, &hlen)) { + switch(check_gzip_header(z->next_in, (ssize_t)z->avail_in, &hlen)) { case GZIP_OK: /* This is the zlib stream data */ free(z->next_in); - /* Don't point into the malloced block since we just freed it */ + /* Do not point into the malloced block since we just freed it */ z->next_in = (Bytef *) buf + hlen + nbytes - z->avail_in; - z->avail_in = (uInt) (z->avail_in - hlen); + z->avail_in = z->avail_in - (uInt)hlen; zp->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */ break; case GZIP_UNDERFLOW: - /* We still don't have any data to inflate! */ + /* We still do not have any data to inflate! */ return CURLE_OK; case GZIP_BAD: @@ -572,11 +572,11 @@ static CURLcode gzip_do_write(struct Curl_easy *data, } if(z->avail_in == 0) { - /* We don't have any data to inflate; wait until next time */ + /* We do not have any data to inflate; wait until next time */ return CURLE_OK; } - /* We've parsed the header, now uncompress the data */ + /* We have parsed the header, now uncompress the data */ return inflate_stream(data, writer, type, ZLIB_GZIP_INFLATING); #endif } @@ -654,7 +654,7 @@ static CURLcode brotli_do_init(struct Curl_easy *data, (void) data; bp->br = BrotliDecoderCreateInstance(NULL, NULL, NULL); - return bp->br? CURLE_OK: CURLE_OUT_OF_MEMORY; + return bp->br ? CURLE_OK : CURLE_OUT_OF_MEMORY; } static CURLcode brotli_do_write(struct Curl_easy *data, @@ -669,7 +669,7 @@ static CURLcode brotli_do_write(struct Curl_easy *data, CURLcode result = CURLE_OK; BrotliDecoderResult r = BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT; - if(!(type & CLIENTWRITE_BODY)) + if(!(type & CLIENTWRITE_BODY) || !nbytes) return Curl_cwriter_write(data, writer->next, type, buf, nbytes); if(!bp->br) @@ -762,7 +762,7 @@ static CURLcode zstd_do_write(struct Curl_easy *data, ZSTD_outBuffer out; size_t errorCode; - if(!(type & CLIENTWRITE_BODY)) + if(!(type & CLIENTWRITE_BODY) || !nbytes) return Curl_cwriter_write(data, writer->next, type, buf, nbytes); if(!zp->decomp) { @@ -909,18 +909,18 @@ static CURLcode error_do_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes) { - char all[256]; - (void)Curl_all_content_encodings(all, sizeof(all)); - (void) writer; (void) buf; (void) nbytes; - if(!(type & CLIENTWRITE_BODY)) + if(!(type & CLIENTWRITE_BODY) || !nbytes) return Curl_cwriter_write(data, writer->next, type, buf, nbytes); - - failf(data, "Unrecognized content encoding type. " - "libcurl understands %s content encodings.", all); + else { + char all[256]; + (void)Curl_all_content_encodings(all, sizeof(all)); + failf(data, "Unrecognized content encoding type. " + "libcurl understands %s content encodings.", all); + } return CURLE_BAD_CONTENT_ENCODING; } @@ -966,18 +966,19 @@ static const struct Curl_cwtype *find_unencode_writer(const char *name, return NULL; } -/* Set-up the unencoding stack from the Content-Encoding header value. +/* Setup the unencoding stack from the Content-Encoding header value. * See RFC 7231 section 3.1.2.2. */ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data, const char *enclist, int is_transfer) { - Curl_cwriter_phase phase = is_transfer? - CURL_CW_TRANSFER_DECODE:CURL_CW_CONTENT_DECODE; + Curl_cwriter_phase phase = is_transfer ? + CURL_CW_TRANSFER_DECODE : CURL_CW_CONTENT_DECODE; CURLcode result; do { const char *name; size_t namelen; + bool is_chunked = FALSE; /* Parse a single encoding name. */ while(ISBLANK(*enclist) || *enclist == ',') @@ -993,12 +994,17 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data, const struct Curl_cwtype *cwt; struct Curl_cwriter *writer; + CURL_TRC_WRITE(data, "looking for %s decoder: %.*s", + is_transfer ? "transfer" : "content", (int)namelen, name); + is_chunked = (is_transfer && (namelen == 7) && + strncasecompare(name, "chunked", 7)); /* if we skip the decoding in this phase, do not look further. * Exception is "chunked" transfer-encoding which always must happen */ - if((is_transfer && !data->set.http_transfer_encoding && - (namelen != 7 || !strncasecompare(name, "chunked", 7))) || + if((is_transfer && !data->set.http_transfer_encoding && !is_chunked) || (!is_transfer && data->set.http_ce_skip)) { /* not requested, ignore */ + CURL_TRC_WRITE(data, "decoder not requested, ignored: %.*s", + (int)namelen, name); return CURLE_OK; } @@ -1009,10 +1015,38 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data, } cwt = find_unencode_writer(name, namelen, phase); + if(cwt && is_chunked && Curl_cwriter_get_by_type(data, cwt)) { + /* A 'chunked' transfer encoding has already been added. + * Ignore duplicates. See #13451. + * Also RFC 9112, ch. 6.1: + * "A sender MUST NOT apply the chunked transfer coding more than + * once to a message body." + */ + CURL_TRC_WRITE(data, "ignoring duplicate 'chunked' decoder"); + return CURLE_OK; + } + + if(is_transfer && !is_chunked && + Curl_cwriter_get_by_name(data, "chunked")) { + /* RFC 9112, ch. 6.1: + * "If any transfer coding other than chunked is applied to a + * response's content, the sender MUST either apply chunked as the + * final transfer coding or terminate the message by closing the + * connection." + * "chunked" must be the last added to be the first in its phase, + * reject this. + */ + failf(data, "Reject response due to 'chunked' not being the last " + "Transfer-Encoding"); + return CURLE_BAD_CONTENT_ENCODING; + } + if(!cwt) cwt = &error_writer; /* Defer error at use. */ result = Curl_cwriter_create(&writer, data, cwt, phase); + CURL_TRC_WRITE(data, "added %s decoder %s -> %d", + is_transfer ? "transfer" : "content", cwt->name, result); if(result) return result; diff --git a/deps/curl/lib/cookie.c b/deps/curl/lib/cookie.c index c1ed2913..ca8c3c59 100644 --- a/deps/curl/lib/cookie.c +++ b/deps/curl/lib/cookie.c @@ -28,41 +28,27 @@ RECEIVING COOKIE INFORMATION ============================ -struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, - const char *file, struct CookieInfo *inc, bool newsession); +Curl_cookie_init() Inits a cookie struct to store data in a local file. This is always called before any cookies are set. -struct Cookie *Curl_cookie_add(struct Curl_easy *data, - struct CookieInfo *c, bool httpheader, bool noexpire, - char *lineptr, const char *domain, const char *path, - bool secure); +Curl_cookie_add() - The 'lineptr' parameter is a full "Set-cookie:" line as - received from a server. - - The function need to replace previously stored lines that this new - line supersedes. - - It may remove lines that are expired. - - It should return an indication of success/error. + Adds a cookie to the in-memory cookie jar. SENDING COOKIE INFORMATION ========================== -struct Cookies *Curl_cookie_getlist(struct CookieInfo *cookie, - char *host, char *path, bool secure); +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 haven't expired. - + It shall only return cookies that have not expired. Example set of cookies: @@ -102,6 +88,7 @@ Example set of cookies: #include "rename.h" #include "fopen.h" #include "strdup.h" +#include "llist.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -150,7 +137,7 @@ static bool cookie_tailmatch(const char *cookie_domain, } /* - * matching cookie path and url path + * matching cookie path and URL path * RFC6265 5.1.4 Paths and Path-Match */ static bool pathmatch(const char *cookie_path, const char *request_uri) @@ -245,7 +232,7 @@ static const char *get_top_domain(const char * const domain, size_t *outlen) if(outlen) *outlen = len; - return first? first: domain; + return first ? first : domain; } /* Avoid C1001, an "internal error" with MSVC14 */ @@ -262,8 +249,9 @@ static size_t cookie_hash_domain(const char *domain, const size_t len) size_t h = 5381; while(domain < end) { + size_t j = (size_t)Curl_raw_toupper(*domain++); h += h << 5; - h ^= Curl_raw_toupper(*domain++); + h ^= j; } return (h % COOKIE_HASH_SIZE); @@ -334,17 +322,17 @@ void Curl_cookie_loadfiles(struct Curl_easy *data) if(list) { Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); while(list) { - struct CookieInfo *newcookies = + struct CookieInfo *ci = Curl_cookie_init(data, list->data, data->cookies, data->set.cookiesession); - if(!newcookies) + 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 = newcookies; + data->cookies = ci; list = list->next; } Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); @@ -373,55 +361,50 @@ static void strstore(char **str, const char *newstr, size_t len) * * Remove expired cookies from the hash by inspecting the expires timestamp on * each cookie in the hash, freeing and deleting any where the timestamp is in - * the past. If the cookiejar has recorded the next timestamp at which one or + * the past. If the cookiejar has recorded the next timestamp at which one or * more cookies expire, then processing will exit early in case this timestamp * is in the future. */ -static void remove_expired(struct CookieInfo *cookies) +static void remove_expired(struct CookieInfo *ci) { - struct Cookie *co, *nx; + struct Cookie *co; curl_off_t now = (curl_off_t)time(NULL); unsigned int i; /* * If the earliest expiration timestamp in the jar is in the future we can - * skip scanning the whole jar and instead exit early as there won't be any - * cookies to evict. If we need to evict however, reset the next_expiration - * counter in order to track the next one. In case the recorded first - * expiration is the max offset, then perform the safe fallback of checking - * all cookies. + * skip scanning the whole jar and instead exit early as there will not be + * any cookies to evict. If we need to evict however, reset the + * next_expiration counter in order to track the next one. In case the + * recorded first expiration is the max offset, then perform the safe + * fallback of checking all cookies. */ - if(now < cookies->next_expiration && - cookies->next_expiration != CURL_OFF_T_MAX) + if(now < ci->next_expiration && + ci->next_expiration != CURL_OFF_T_MAX) return; else - cookies->next_expiration = CURL_OFF_T_MAX; + ci->next_expiration = CURL_OFF_T_MAX; for(i = 0; i < COOKIE_HASH_SIZE; i++) { - struct Cookie *pv = NULL; - co = cookies->cookies[i]; - while(co) { - nx = co->next; + struct Curl_llist_node *n; + struct Curl_llist_node *e = NULL; + + for(n = Curl_llist_head(&ci->cookielist[i]); n; n = e) { + co = Curl_node_elem(n); + e = Curl_node_next(n); if(co->expires && co->expires < now) { - if(!pv) { - cookies->cookies[i] = co->next; - } - else { - pv->next = co->next; - } - cookies->numcookies--; + Curl_node_remove(n); freecookie(co); + ci->numcookies--; } else { /* - * If this cookie has an expiration timestamp earlier than what we've - * seen so far then record it for the next round of expirations. + * If this cookie has an expiration timestamp earlier than what we + * have seen so far then record it for the next round of expirations. */ - if(co->expires && co->expires < cookies->next_expiration) - cookies->next_expiration = co->expires; - pv = co; + if(co->expires && co->expires < ci->next_expiration) + ci->next_expiration = co->expires; } - co = nx; } } } @@ -469,563 +452,495 @@ static int invalid_octets(const char *p) return (p[len] != '\0'); } -/* - * Curl_cookie_add - * - * Add a single cookie line to the cookie keeping object. Be aware that - * sometimes we get an IP-only host name, 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 * -Curl_cookie_add(struct Curl_easy *data, - struct CookieInfo *c, - bool httpheader, /* TRUE if HTTP header-style line */ - bool noexpire, /* if TRUE, skip remove_expired() */ - const char *lineptr, /* first character of the line */ - const char *domain, /* default domain */ - const char *path, /* full path used when this cookie is set, - used to get default path for the cookie - unless set */ - bool secure) /* TRUE if connection is over secure origin */ +#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 */ +#define CERR_PSL 14 /* a public suffix */ +#define CERR_LIVE_WINS 15 + +static int +parse_cookie_header(struct Curl_easy *data, + struct Cookie *co, + struct CookieInfo *ci, + const char *ptr, + const char *domain, /* default domain */ + const char *path, /* full path used when this cookie is + set, used to get default path for + the cookie unless set */ + bool secure) /* TRUE if connection is over secure + origin */ { - struct Cookie *clist; - struct Cookie *co; - struct Cookie *lastc = NULL; - struct Cookie *replace_co = NULL; - struct Cookie *replace_clist = NULL; - time_t now = time(NULL); - bool replace_old = FALSE; - bool badcookie = FALSE; /* cookies are good by default. mmmmm yummy */ - size_t myhash; + /* This line was read off an HTTP-header */ + time_t now; + size_t linelength = strlen(ptr); + if(linelength > MAX_COOKIE_LINE) + /* discard overly long lines at once */ + return CERR_TOO_LONG; - DEBUGASSERT(data); - DEBUGASSERT(MAX_SET_COOKIE_AMOUNT <= 255); /* counter is an unsigned char */ - if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT) - return NULL; + now = time(NULL); + do { + size_t vlen; + size_t nlen; - /* First, alloc and init a new struct for it */ - co = calloc(1, sizeof(struct Cookie)); - if(!co) - return NULL; /* bail out if we're this low on memory */ + while(*ptr && ISBLANK(*ptr)) + ptr++; - if(httpheader) { - /* This line was read off an HTTP-header */ - const char *ptr; + /* we have a = pair or a stand-alone word here */ + nlen = strcspn(ptr, ";\t\r\n="); + if(nlen) { + bool done = FALSE; + bool sep = FALSE; + const char *namep = ptr; + const char *valuep; - size_t linelength = strlen(lineptr); - if(linelength > MAX_COOKIE_LINE) { - /* discard overly long lines at once */ - free(co); - return NULL; - } + ptr += nlen; - ptr = lineptr; - do { - size_t vlen; - size_t nlen; + /* trim trailing spaces and tabs after name */ + while(nlen && ISBLANK(namep[nlen - 1])) + nlen--; - while(*ptr && ISBLANK(*ptr)) - ptr++; + if(*ptr == '=') { + vlen = strcspn(++ptr, ";\r\n"); + valuep = ptr; + sep = TRUE; + ptr = &valuep[vlen]; - /* we have a = pair or a stand-alone word here */ - nlen = strcspn(ptr, ";\t\r\n="); - if(nlen) { - bool done = FALSE; - bool sep = FALSE; - const char *namep = ptr; - const char *valuep; + /* Strip off trailing whitespace from the value */ + while(vlen && ISBLANK(valuep[vlen-1])) + vlen--; - ptr += nlen; - - /* trim trailing spaces and tabs after name */ - while(nlen && ISBLANK(namep[nlen - 1])) - nlen--; - - if(*ptr == '=') { - vlen = strcspn(++ptr, ";\r\n"); - valuep = ptr; - sep = TRUE; - ptr = &valuep[vlen]; - - /* Strip off trailing whitespace from the value */ - while(vlen && ISBLANK(valuep[vlen-1])) - vlen--; - - /* Skip leading whitespace from the value */ - while(vlen && ISBLANK(*valuep)) { - valuep++; - vlen--; - } - - /* Reject cookies with a TAB inside the value */ - if(memchr(valuep, '\t', vlen)) { - freecookie(co); - infof(data, "cookie contains TAB, dropping"); - return NULL; - } - } - else { - valuep = NULL; - vlen = 0; + /* Skip leading whitespace from the value */ + while(vlen && ISBLANK(*valuep)) { + valuep++; + vlen--; } - /* - * 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(nlen >= (MAX_NAME-1) || vlen >= (MAX_NAME-1) || - ((nlen + vlen) > MAX_NAME)) { - freecookie(co); - infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", - nlen, vlen); - return NULL; + /* Reject cookies with a TAB inside the value */ + if(memchr(valuep, '\t', vlen)) { + infof(data, "cookie contains TAB, dropping"); + return CERR_TAB; } - - /* - * 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(nlen >= 7 && namep[0] == '_' && namep[1] == '_') { - if(strncasecompare("__Secure-", namep, 9)) - co->prefix |= COOKIE_PREFIX__SECURE; - else if(strncasecompare("__Host-", namep, 7)) - co->prefix |= COOKIE_PREFIX__HOST; - } - - /* - * 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) { - /* The very first name/value pair is the actual cookie name */ - if(!sep) { - /* Bad name/value pair. */ - badcookie = TRUE; - break; - } - strstore(&co->name, namep, nlen); - strstore(&co->value, valuep, vlen); - done = TRUE; - if(!co->name || !co->value) { - badcookie = TRUE; - break; - } - if(invalid_octets(co->value) || invalid_octets(co->name)) { - infof(data, "invalid octets in name/value, cookie dropped"); - badcookie = TRUE; - break; - } - } - else if(!vlen) { - /* - * this was a "=" with no content, and we must allow - * 'secure' and 'httponly' specified this weirdly - */ - 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 - * reading from file - */ - if((nlen == 6) && strncasecompare("secure", namep, 6)) { - if(secure || !c->running) { - co->secure = TRUE; - } - else { - badcookie = TRUE; - break; - } - } - else if((nlen == 8) && strncasecompare("httponly", namep, 8)) - co->httponly = TRUE; - else if(sep) - /* there was a '=' so we're not done parsing this field */ - done = FALSE; - } - if(done) - ; - else if((nlen == 4) && strncasecompare("path", namep, 4)) { - strstore(&co->path, valuep, vlen); - if(!co->path) { - badcookie = TRUE; /* out of memory bad */ - break; - } - free(co->spath); /* if this is set again */ - co->spath = sanitize_cookie_path(co->path); - if(!co->spath) { - badcookie = TRUE; /* out of memory bad */ - break; - } - } - else if((nlen == 6) && - strncasecompare("domain", namep, 6) && vlen) { - bool is_ip; - - /* - * Now, we make sure that our host is within the given domain, or - * the given domain is not valid and thus cannot be set. - */ - - if('.' == valuep[0]) { - valuep++; /* ignore preceding dot */ - vlen--; - } - -#ifndef USE_LIBPSL - /* - * Without PSL we don't know when the incoming cookie is set on a - * TLD or otherwise "protected" suffix. To reduce risk, we require a - * dot OR the exact host name being "localhost". - */ - if(bad_domain(valuep, vlen)) - domain = ":"; -#endif - - is_ip = Curl_host_is_ipnum(domain ? domain : valuep); - - if(!domain - || (is_ip && !strncmp(valuep, domain, vlen) && - (vlen == strlen(domain))) - || (!is_ip && cookie_tailmatch(valuep, vlen, domain))) { - strstore(&co->domain, valuep, vlen); - if(!co->domain) { - badcookie = TRUE; - break; - } - if(!is_ip) - co->tailmatch = TRUE; /* we always do that if the domain name was - given */ - } - else { - /* - * We did not get a tailmatch and then the attempted set domain is - * not a domain to which the current host belongs. Mark as bad. - */ - badcookie = TRUE; - infof(data, "skipped cookie with bad tailmatch domain: %s", - valuep); - } - } - else if((nlen == 7) && strncasecompare("version", namep, 7)) { - /* just ignore */ - } - else if((nlen == 7) && strncasecompare("max-age", namep, 7)) { - /* - * Defined in RFC2109: - * - * Optional. The Max-Age attribute defines the lifetime of the - * cookie, in seconds. The delta-seconds value is a decimal non- - * negative integer. After delta-seconds seconds elapse, the - * client should discard the cookie. A value of zero means the - * cookie should be discarded immediately. - */ - CURLofft offt; - const char *maxage = valuep; - offt = curlx_strtoofft((*maxage == '\"')? - &maxage[1]:&maxage[0], NULL, 10, - &co->expires); - switch(offt) { - case CURL_OFFT_FLOW: - /* overflow, used max value */ - co->expires = CURL_OFF_T_MAX; - break; - case CURL_OFFT_INVAL: - /* negative or otherwise bad, expire */ - co->expires = 1; - break; - case CURL_OFFT_OK: - if(!co->expires) - /* already expired */ - co->expires = 1; - else if(CURL_OFF_T_MAX - now < co->expires) - /* would overflow */ - co->expires = CURL_OFF_T_MAX; - else - co->expires += now; - break; - } - } - else if((nlen == 7) && strncasecompare("expires", namep, 7)) { - char date[128]; - if(!co->expires && (vlen < sizeof(date))) { - /* copy the date so that it can be null terminated */ - memcpy(date, valuep, vlen); - date[vlen] = 0; - /* - * Let max-age have priority. - * - * If the date cannot get parsed for whatever reason, the cookie - * will be treated as a session cookie - */ - co->expires = Curl_getdate_capped(date); - - /* - * Session cookies have expires set to 0 so if we get that back - * from the date parser let's add a second to make it a - * non-session cookie - */ - if(co->expires == 0) - co->expires = 1; - else if(co->expires < 0) - co->expires = 0; - } - } - - /* - * Else, this is the second (or more) name we don't know about! - */ } else { - /* this is an "illegal" = pair */ + valuep = NULL; + vlen = 0; } - while(*ptr && ISBLANK(*ptr)) - ptr++; - if(*ptr == ';') - ptr++; - else - break; - } while(1); - - if(!badcookie && !co->domain) { - if(domain) { - /* no domain was given in the header line, set the default */ - co->domain = strdup(domain); - if(!co->domain) - badcookie = TRUE; + /* + * 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(nlen >= (MAX_NAME-1) || vlen >= (MAX_NAME-1) || + ((nlen + vlen) > MAX_NAME)) { + infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", + nlen, vlen); + return CERR_TOO_BIG; } - } - - if(!badcookie && !co->path && path) { - /* - * No path was given in the header line, set the default. Note that the - * passed-in path to this function MAY have a '?' and following part that - * MUST NOT be stored as part of the path. - */ - char *queryp = strchr(path, '?'); /* - * queryp is where the interesting part of the path ends, so now we - * want to the find the last + * 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. */ - char *endslash; - if(!queryp) - endslash = strrchr(path, '/'); - else - endslash = memrchr(path, '/', (queryp - 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) - badcookie = TRUE; /* out of memory bad */ + if(nlen >= 7 && namep[0] == '_' && namep[1] == '_') { + if(strncasecompare("__Secure-", namep, 9)) + co->prefix_secure = TRUE; + else if(strncasecompare("__Host-", namep, 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) { + /* The very first name/value pair is the actual cookie name */ + if(!sep) + /* Bad name/value pair. */ + return CERR_NO_SEP; + + strstore(&co->name, namep, nlen); + strstore(&co->value, valuep, vlen); + done = TRUE; + if(!co->name || !co->value) + return CERR_NO_NAME_VALUE; + + if(invalid_octets(co->value) || invalid_octets(co->name)) { + infof(data, "invalid octets in name/value, cookie dropped"); + return CERR_INVALID_OCTET; } - else - badcookie = TRUE; } - } - - /* - * If we didn't get a cookie name, or a bad one, the this is an illegal - * line so bail out. - */ - if(badcookie || !co->name) { - freecookie(co); - return NULL; - } - data->req.setcookies++; - } - else { - /* - * This line is NOT an HTTP header style line, we do offer support for - * reading the odd netscape cookies-file format here - */ - char *ptr; - char *firstptr; - char *tok_buf = NULL; - int fields; - - /* - * IE introduced HTTP-only cookies to prevent XSS attacks. Cookies marked - * with httpOnly after the domain name are not accessible from javascripts, - * but since curl does not operate at javascript level, we include them - * anyway. In Firefox's cookie files, these lines are preceded with - * #HttpOnly_ and then everything is as usual, so we skip 10 characters of - * the line.. - */ - if(strncmp(lineptr, "#HttpOnly_", 10) == 0) { - lineptr += 10; - co->httponly = TRUE; - } - - if(lineptr[0]=='#') { - /* don't even try the comments */ - free(co); - return NULL; - } - /* strip off the possible end-of-line characters */ - ptr = strchr(lineptr, '\r'); - if(ptr) - *ptr = 0; /* clear it */ - ptr = strchr(lineptr, '\n'); - if(ptr) - *ptr = 0; /* clear it */ - - firstptr = strtok_r((char *)lineptr, "\t", &tok_buf); /* tokenize on TAB */ - - /* - * Now loop through the fields and init the struct we already have - * allocated - */ - for(ptr = firstptr, fields = 0; ptr && !badcookie; - ptr = strtok_r(NULL, "\t", &tok_buf), fields++) { - switch(fields) { - case 0: - if(ptr[0]=='.') /* skip preceding dots */ - ptr++; - co->domain = strdup(ptr); - if(!co->domain) - badcookie = TRUE; - break; - case 1: + else if(!vlen) { /* - * flag: A TRUE/FALSE value indicating if all machines within a given - * domain can access the variable. Set TRUE when the cookie says - * .domain.com and to false when the domain is complete www.domain.com + * this was a "=" with no content, and we must allow + * 'secure' and 'httponly' specified this weirdly */ - co->tailmatch = strcasecompare(ptr, "TRUE")?TRUE:FALSE; - break; - case 2: - /* The file format allows the path field to remain not filled in */ - if(strcmp("TRUE", ptr) && strcmp("FALSE", ptr)) { - /* only if the path doesn't look like a boolean option! */ - co->path = strdup(ptr); - if(!co->path) - badcookie = TRUE; - else { - co->spath = sanitize_cookie_path(co->path); - if(!co->spath) { - badcookie = TRUE; /* out of memory bad */ - } + 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 + * reading from file + */ + if((nlen == 6) && strncasecompare("secure", namep, 6)) { + if(secure || !ci->running) { + co->secure = TRUE; } + else { + return CERR_BAD_SECURE; + } + } + else if((nlen == 8) && strncasecompare("httponly", namep, 8)) + co->httponly = TRUE; + else if(sep) + /* there was a '=' so we are not done parsing this field */ + done = FALSE; + } + if(done) + ; + else if((nlen == 4) && strncasecompare("path", namep, 4)) { + strstore(&co->path, valuep, vlen); + if(!co->path) + return CERR_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; + } + else if((nlen == 6) && + strncasecompare("domain", namep, 6) && vlen) { + bool is_ip; + + /* + * Now, we make sure that our host is within the given domain, or + * the given domain is not valid and thus cannot be set. + */ + + if('.' == valuep[0]) { + valuep++; /* ignore preceding dot */ + vlen--; + } + +#ifndef USE_LIBPSL + /* + * Without PSL we do not know when the incoming cookie is set on a + * TLD or otherwise "protected" suffix. To reduce risk, we require a + * dot OR the exact hostname being "localhost". + */ + if(bad_domain(valuep, vlen)) + domain = ":"; +#endif + + is_ip = Curl_host_is_ipnum(domain ? domain : valuep); + + if(!domain + || (is_ip && !strncmp(valuep, domain, vlen) && + (vlen == strlen(domain))) + || (!is_ip && cookie_tailmatch(valuep, vlen, domain))) { + strstore(&co->domain, valuep, vlen); + if(!co->domain) + return CERR_OUT_OF_MEMORY; + + if(!is_ip) + co->tailmatch = TRUE; /* we always do that if the domain name was + given */ + } + else { + /* + * We did not get a tailmatch and then the attempted set domain is + * not a domain to which the current host belongs. Mark as bad. + */ + infof(data, "skipped cookie with bad tailmatch domain: %s", + valuep); + return CERR_NO_TAILMATCH; + } + } + else if((nlen == 7) && strncasecompare("version", namep, 7)) { + /* just ignore */ + } + else if((nlen == 7) && strncasecompare("max-age", namep, 7)) { + /* + * Defined in RFC2109: + * + * Optional. The Max-Age attribute defines the lifetime of the + * cookie, in seconds. The delta-seconds value is a decimal non- + * negative integer. After delta-seconds seconds elapse, the + * client should discard the cookie. A value of zero means the + * cookie should be discarded immediately. + */ + CURLofft offt; + const char *maxage = valuep; + offt = curlx_strtoofft((*maxage == '\"') ? + &maxage[1] : &maxage[0], NULL, 10, + &co->expires); + switch(offt) { + case CURL_OFFT_FLOW: + /* overflow, used max value */ + co->expires = CURL_OFF_T_MAX; + break; + case CURL_OFFT_INVAL: + /* negative or otherwise bad, expire */ + co->expires = 1; + break; + case CURL_OFFT_OK: + if(!co->expires) + /* already expired */ + co->expires = 1; + else if(CURL_OFF_T_MAX - now < co->expires) + /* would overflow */ + co->expires = CURL_OFF_T_MAX; + else + co->expires += now; break; } - /* this doesn't look like a path, make one up! */ - co->path = strdup("/"); - if(!co->path) - badcookie = TRUE; - co->spath = strdup("/"); - if(!co->spath) - badcookie = TRUE; - fields++; /* add a field and fall down to secure */ - FALLTHROUGH(); - case 3: - co->secure = FALSE; - if(strcasecompare(ptr, "TRUE")) { - if(secure || c->running) - co->secure = TRUE; - else - badcookie = TRUE; - } - break; - case 4: - if(curlx_strtoofft(ptr, NULL, 10, &co->expires)) - badcookie = TRUE; - break; - case 5: - co->name = strdup(ptr); - if(!co->name) - badcookie = TRUE; - else { - /* For Netscape file format cookies we check prefix on the name */ - if(strncasecompare("__Secure-", co->name, 9)) - co->prefix |= COOKIE_PREFIX__SECURE; - else if(strncasecompare("__Host-", co->name, 7)) - co->prefix |= COOKIE_PREFIX__HOST; - } - break; - case 6: - co->value = strdup(ptr); - if(!co->value) - badcookie = TRUE; - break; } - } - if(6 == fields) { - /* we got a cookie with blank contents, fix it */ - co->value = strdup(""); - if(!co->value) - badcookie = TRUE; - else - fields++; - } + else if((nlen == 7) && strncasecompare("expires", namep, 7)) { + if(!co->expires) { + /* + * Let max-age have priority. + * + * If the date cannot get parsed for whatever reason, the cookie + * will be treated as a session cookie + */ + co->expires = Curl_getdate_capped(valuep); - if(!badcookie && (7 != fields)) - /* we did not find the sufficient number of fields */ - badcookie = TRUE; + /* + * Session cookies have expires set to 0 so if we get that back + * from the date parser let's add a second to make it a + * non-session cookie + */ + if(co->expires == 0) + co->expires = 1; + else if(co->expires < 0) + co->expires = 0; + } + } - if(badcookie) { - freecookie(co); - return NULL; + /* + * Else, this is the second (or more) name we do not know about! + */ } - - } - - if(co->prefix & COOKIE_PREFIX__SECURE) { - /* The __Secure- prefix only requires that the cookie be set secure */ - if(!co->secure) { - freecookie(co); - return NULL; - } - } - if(co->prefix & COOKIE_PREFIX__HOST) { - /* - * 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) - ; else { - freecookie(co); - return NULL; + /* this is an "illegal" = pair */ + } + + while(*ptr && ISBLANK(*ptr)) + ptr++; + if(*ptr == ';') + ptr++; + else + break; + } while(1); + + if(!co->domain && domain) { + /* no domain was given in the header line, set the default */ + co->domain = strdup(domain); + if(!co->domain) + return CERR_OUT_OF_MEMORY; + } + + if(!co->path && path) { + /* + * No path was given in the header line, set the default. Note that the + * passed-in path to this function MAY have a '?' and following part that + * MUST NOT be stored as part of the path. + */ + char *queryp = strchr(path, '?'); + + /* + * queryp is where the interesting part of the path ends, so now we + * want to the find the last + */ + char *endslash; + if(!queryp) + endslash = strrchr(path, '/'); + else + endslash = memrchr(path, '/', (queryp - 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 CERR_OUT_OF_MEMORY; + } + else + return CERR_OUT_OF_MEMORY; } } - if(!c->running && /* read from a file */ - c->newsession && /* clean session cookies */ - !co->expires) { /* this is a session cookie since it doesn't expire! */ - freecookie(co); - return NULL; - } - - co->livecookie = c->running; - co->creationtime = ++c->lastct; - /* - * Now we have parsed the incoming line, we must now check if this supersedes - * an already existing cookie, which it may if the previous have the same - * domain and path as this. + * If we did not get a cookie name, or a bad one, the this is an illegal + * line so bail out. */ + if(!co->name) + return CERR_BAD; - /* at first, remove expired cookies */ - if(!noexpire) - remove_expired(c); + data->req.setcookies++; + return CERR_OK; +} +static int +parse_netscape(struct Cookie *co, + struct CookieInfo *ci, + 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 + * reading the odd netscape cookies-file format here + */ + char *ptr; + char *firstptr; + char *tok_buf = NULL; + int fields; + + /* + * In 2008, Internet Explorer introduced HTTP-only cookies to prevent XSS + * attacks. Cookies marked httpOnly are not accessible to JavaScript. In + * Firefox's cookie files, they are prefixed #HttpOnly_ and the rest + * remains as usual, so we skip 10 characters of the line. + */ + if(strncmp(lineptr, "#HttpOnly_", 10) == 0) { + lineptr += 10; + co->httponly = TRUE; + } + + if(lineptr[0]=='#') + /* do not even try the comments */ + return CERR_COMMENT; + + /* strip off the possible end-of-line characters */ + ptr = strchr(lineptr, '\r'); + if(ptr) + *ptr = 0; /* clear it */ + ptr = strchr(lineptr, '\n'); + if(ptr) + *ptr = 0; /* clear it */ + + firstptr = strtok_r((char *)lineptr, "\t", &tok_buf); /* tokenize on TAB */ + + /* + * Now loop through the fields and init the struct we already have + * allocated + */ + fields = 0; + for(ptr = firstptr; ptr; ptr = strtok_r(NULL, "\t", &tok_buf), fields++) { + switch(fields) { + case 0: + if(ptr[0]=='.') /* skip preceding dots */ + ptr++; + co->domain = strdup(ptr); + if(!co->domain) + return CERR_OUT_OF_MEMORY; + break; + case 1: + /* + * flag: A TRUE/FALSE value indicating if all machines within a given + * domain can access the variable. Set TRUE when the cookie says + * .domain.com and to false when the domain is complete www.domain.com + */ + co->tailmatch = !!strcasecompare(ptr, "TRUE"); + break; + case 2: + /* The file format allows the path field to remain not filled in */ + if(strcmp("TRUE", ptr) && strcmp("FALSE", ptr)) { + /* only if the path does not look like a boolean option! */ + co->path = strdup(ptr); + if(!co->path) + return CERR_OUT_OF_MEMORY; + else { + co->spath = sanitize_cookie_path(co->path); + if(!co->spath) + return CERR_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; + co->spath = strdup("/"); + if(!co->spath) + return CERR_OUT_OF_MEMORY; + fields++; /* add a field and fall down to secure */ + FALLTHROUGH(); + case 3: + co->secure = FALSE; + if(strcasecompare(ptr, "TRUE")) { + if(secure || ci->running) + co->secure = TRUE; + else + return CERR_BAD_SECURE; + } + break; + case 4: + if(curlx_strtoofft(ptr, NULL, 10, &co->expires)) + return CERR_RANGE; + break; + case 5: + co->name = strdup(ptr); + if(!co->name) + return CERR_OUT_OF_MEMORY; + else { + /* For Netscape file format cookies we check prefix on the name */ + if(strncasecompare("__Secure-", co->name, 9)) + co->prefix_secure = TRUE; + else if(strncasecompare("__Host-", co->name, 7)) + co->prefix_host = TRUE; + } + break; + case 6: + co->value = strdup(ptr); + if(!co->value) + return CERR_OUT_OF_MEMORY; + break; + } + } + if(6 == fields) { + /* we got a cookie with blank contents, fix it */ + co->value = strdup(""); + if(!co->value) + return CERR_OUT_OF_MEMORY; + else + fields++; + } + + if(7 != fields) + /* we did not find the sufficient number of fields */ + return CERR_FIELDS; + + return CERR_OK; +} + +static int +is_public_suffix(struct Curl_easy *data, + struct Cookie *co, + const char *domain) +{ #ifdef USE_LIBPSL /* * Check if the domain is a Public Suffix and if yes, ignore the cookie. We - * must also check that the data handle isn't NULL since the psl code will + * must also check that the data handle is not NULL since the psl code will * dereference it. */ + DEBUGF(infof(data, "PSL check set-cookie '%s' for domain=%s in %s", + co->name, co->domain, domain)); if(data && (domain && co->domain && !Curl_host_is_ipnum(co->domain))) { bool acceptable = FALSE; char lcase[256]; @@ -1047,17 +962,33 @@ Curl_cookie_add(struct Curl_easy *data, if(!acceptable) { infof(data, "cookie '%s' dropped, domain '%s' must not " - "set cookies for '%s'", co->name, domain, co->domain); - freecookie(co); - return NULL; + "set cookies for '%s'", co->name, domain, co->domain); + return CERR_PSL; } } +#else + (void)data; + (void)co; + (void)domain; + DEBUGF(infof(data, "NO PSL to check set-cookie '%s' for domain=%s in %s", + co->name, co->domain, domain)); #endif + return CERR_OK; +} - /* A non-secure cookie may not overlay an existing secure cookie. */ - myhash = cookiehash(co->domain); - clist = c->cookies[myhash]; - while(clist) { +static int +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; + struct Curl_llist_node *n; + size_t myhash = cookiehash(co->domain); + for(n = Curl_llist_head(&ci->cookielist[myhash]); n; n = Curl_node_next(n)) { + struct Cookie *clist = Curl_node_elem(n); if(strcasecompare(clist->name, co->name)) { /* the names are identical */ bool matching_domains = FALSE; @@ -1093,13 +1024,12 @@ Curl_cookie_add(struct Curl_easy *data, if(strncasecompare(clist->spath, co->spath, cllen)) { infof(data, "cookie '%s' for domain '%s' dropped, would " "overlay an existing cookie", co->name, co->domain); - freecookie(co); - return NULL; + return CERR_BAD_SECURE; } } } - if(!replace_co && strcasecompare(clist->name, co->name)) { + if(!replace_n && strcasecompare(clist->name, co->name)) { /* the names are identical */ if(clist->domain && co->domain) { @@ -1123,67 +1053,142 @@ Curl_cookie_add(struct Curl_easy *data, if(replace_old && !co->livecookie && clist->livecookie) { /* - * Both cookies matched fine, except that the already present cookie is - * "live", which means it was set from a header, while the new one was - * read from a file and thus isn't "live". "live" cookies are preferred - * so the new cookie is freed. + * Both cookies matched fine, except that the already present cookie + * is "live", which means it was set from a header, while the new one + * was read from a file and thus is not "live". "live" cookies are + * preferred so the new cookie is freed. */ - freecookie(co); - return NULL; - } - if(replace_old) { - replace_co = co; - replace_clist = clist; + return CERR_LIVE_WINS; } + if(replace_old) + replace_n = n; } - lastc = clist; - clist = clist->next; } - if(replace_co) { - co = replace_co; - clist = replace_clist; - co->next = clist->next; /* get the next-pointer first */ + if(replace_n) { + struct Cookie *repl = Curl_node_elem(replace_n); /* when replacing, creationtime is kept from old */ - co->creationtime = clist->creationtime; + co->creationtime = repl->creationtime; - /* then free all the old pointers */ - free(clist->name); - free(clist->value); - free(clist->domain); - free(clist->path); - free(clist->spath); + /* unlink the old */ + Curl_node_remove(replace_n); - *clist = *co; /* then store all the new data */ - - free(co); /* free the newly allocated memory */ - co = clist; + /* free the old cookie */ + freecookie(repl); } + *replacep = replace_old; + return CERR_OK; +} - if(c->running) - /* Only show this when NOT reading the cookies from a file */ - infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, " - "expire %" CURL_FORMAT_CURL_OFF_T, - replace_old?"Replaced":"Added", co->name, co->value, - co->domain, co->path, co->expires); +/* + * Curl_cookie_add + * + * Add a single cookie line to the cookie keeping object. Be aware that + * 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 * +Curl_cookie_add(struct Curl_easy *data, + struct CookieInfo *ci, + bool httpheader, /* TRUE if HTTP header-style line */ + bool noexpire, /* if TRUE, skip remove_expired() */ + const char *lineptr, /* first character of the line */ + const char *domain, /* default domain */ + const char *path, /* full path used when this cookie is set, + used to get default path for the cookie + unless set */ + bool secure) /* TRUE if connection is over secure origin */ +{ + struct Cookie *co; + size_t myhash; + int rc; + bool replaces = FALSE; - if(!replace_old) { - /* then make the last item point on this new one */ - if(lastc) - lastc->next = co; + DEBUGASSERT(data); + DEBUGASSERT(MAX_SET_COOKIE_AMOUNT <= 255); /* counter is an unsigned char */ + if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT) + return NULL; + + /* 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 */ + + if(httpheader) + rc = parse_cookie_header(data, co, ci, lineptr, domain, path, secure); + else + rc = parse_netscape(co, ci, lineptr, secure); + + if(rc) + goto fail; + + if(co->prefix_secure && !co->secure) + /* The __Secure- prefix only requires that the cookie be set secure */ + goto fail; + + if(co->prefix_host) { + /* + * 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) + ; else - c->cookies[myhash] = co; - c->numcookies++; /* one more cookie in the jar */ + goto fail; } + if(!ci->running && /* read from a file */ + ci->newsession && /* clean session cookies */ + !co->expires) /* this is a session cookie since it does not expire */ + goto fail; + + co->livecookie = ci->running; + co->creationtime = ++ci->lastct; + /* - * Now that we've added a new cookie to the jar, update the expiration + * Now we have parsed the incoming line, we must now check if this supersedes + * an already existing cookie, which it may if the previous have the same + * domain and path as this. + */ + + /* remove expired cookies */ + if(!noexpire) + remove_expired(ci); + + if(is_public_suffix(data, co, domain)) + goto fail; + + if(replace_existing(data, co, ci, secure, &replaces)) + goto fail; + + /* add this cookie to the list */ + myhash = cookiehash(co->domain); + Curl_llist_append(&ci->cookielist[myhash], co, &co->node); + + if(ci->running) + /* 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, + co->domain, co->path, co->expires); + + if(!replaces) + ci->numcookies++; /* one more cookie in the jar */ + + /* + * Now that we have added a new cookie to the jar, update the expiration * tracker in case it is the next one to expire. */ - if(co->expires && (co->expires < c->next_expiration)) - c->next_expiration = co->expires; + if(co->expires && (co->expires < ci->next_expiration)) + ci->next_expiration = co->expires; return co; +fail: + freecookie(co); + return NULL; } @@ -1203,28 +1208,30 @@ Curl_cookie_add(struct Curl_easy *data, */ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, const char *file, - struct CookieInfo *inc, + struct CookieInfo *ci, bool newsession) { - struct CookieInfo *c; FILE *handle = NULL; - if(!inc) { - /* we didn't get a struct, create one */ - c = calloc(1, sizeof(struct CookieInfo)); - if(!c) + if(!ci) { + int i; + + /* we did not get a struct, create one */ + ci = calloc(1, sizeof(struct CookieInfo)); + if(!ci) return NULL; /* failed to get memory */ + + /* 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 don't have enough + * Initialize the next_expiration time to signal that we do not have enough * information yet. */ - c->next_expiration = CURL_OFF_T_MAX; + ci->next_expiration = CURL_OFF_T_MAX; } - else { - /* we got an already existing one, use that */ - c = inc; - } - c->newsession = newsession; /* new session? */ + ci->newsession = newsession; /* new session? */ if(data) { FILE *fp = NULL; @@ -1240,7 +1247,7 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, } } - c->running = FALSE; /* this is not running, this is init */ + ci->running = FALSE; /* this is not running, this is init */ if(fp) { struct dynbuf buf; Curl_dyn_init(&buf, MAX_COOKIE_LINE); @@ -1255,7 +1262,7 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, lineptr++; } - Curl_cookie_add(data, c, headerline, TRUE, lineptr, NULL, NULL, TRUE); + Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL, NULL, TRUE); } Curl_dyn_free(&buf); /* free the line buffer */ @@ -1263,16 +1270,16 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, * Remove expired cookies from the hash. We must make sure to run this * after reading the file, and not on every cookie. */ - remove_expired(c); + remove_expired(ci); if(handle) fclose(handle); } data->state.cookie_engine = TRUE; } - c->running = TRUE; /* now, we're running */ + ci->running = TRUE; /* now, we are running */ - return c; + return ci; } /* @@ -1327,38 +1334,6 @@ static int cookie_sort_ct(const void *p1, const void *p2) return (c2->creationtime > c1->creationtime) ? 1 : -1; } -#define CLONE(field) \ - do { \ - if(src->field) { \ - d->field = strdup(src->field); \ - if(!d->field) \ - goto fail; \ - } \ - } while(0) - -static struct Cookie *dup_cookie(struct Cookie *src) -{ - struct Cookie *d = calloc(1, sizeof(struct Cookie)); - if(d) { - CLONE(domain); - CLONE(path); - CLONE(spath); - CLONE(name); - CLONE(value); - d->expires = src->expires; - d->tailmatch = src->tailmatch; - d->secure = src->secure; - d->livecookie = src->livecookie; - d->httponly = src->httponly; - d->creationtime = src->creationtime; - } - return d; - -fail: - freecookie(d); - return NULL; -} - /* * Curl_cookie_getlist * @@ -1366,34 +1341,38 @@ fail: * 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 haven't expired. + * It shall only return cookies that have not expired. + * + * Returns 0 when there is a list returned. Otherwise non-zero. */ -struct Cookie *Curl_cookie_getlist(struct Curl_easy *data, - struct CookieInfo *c, - const char *host, const char *path, - bool secure) +int Curl_cookie_getlist(struct Curl_easy *data, + struct CookieInfo *ci, + const char *host, const char *path, + bool secure, + struct Curl_llist *list) { - struct Cookie *newco; - struct Cookie *co; - struct Cookie *mainco = NULL; size_t matches = 0; bool is_ip; const size_t myhash = cookiehash(host); + struct Curl_llist_node *n; - if(!c || !c->cookies[myhash]) - return NULL; /* no cookie struct or no cookies in the struct */ + Curl_llist_init(list, NULL); + + if(!ci || !Curl_llist_count(&ci->cookielist[myhash])) + return 1; /* no cookie struct or no cookies in the struct */ /* at first, remove expired cookies */ - remove_expired(c); + remove_expired(ci); /* check if host is an IP(v4|v6) address */ is_ip = Curl_host_is_ipnum(host); - co = c->cookies[myhash]; + for(n = Curl_llist_head(&ci->cookielist[myhash]); + n; n = Curl_node_next(n)) { + struct Cookie *co = Curl_node_elem(n); - while(co) { - /* if the cookie requires we're secure we must only continue if we are! */ - if(co->secure?secure:TRUE) { + /* if the cookie requires we are secure we must only continue if we are! */ + if(co->secure ? secure : TRUE) { /* now check if the domain is correct */ if(!co->domain || @@ -1412,31 +1391,18 @@ struct Cookie *Curl_cookie_getlist(struct Curl_easy *data, if(!co->spath || pathmatch(co->spath, path) ) { /* - * and now, we know this is a match and we should create an - * entry for the return-linked-list + * This is a match and we add it to the return-linked-list */ - - newco = dup_cookie(co); - if(newco) { - /* then modify our next */ - newco->next = mainco; - - /* point the main to us */ - mainco = newco; - - matches++; - if(matches >= MAX_COOKIE_SEND_AMOUNT) { - infof(data, "Included max number of cookies (%zu) in request!", - matches); - break; - } + Curl_llist_append(list, co, &co->getnode); + matches++; + if(matches >= MAX_COOKIE_SEND_AMOUNT) { + infof(data, "Included max number of cookies (%zu) in request!", + matches); + break; } - else - goto fail; } } } - co = co->next; } if(matches) { @@ -1453,30 +1419,29 @@ struct Cookie *Curl_cookie_getlist(struct Curl_easy *data, if(!array) goto fail; - co = mainco; + n = Curl_llist_head(list); - for(i = 0; co; co = co->next) - array[i++] = co; + for(i = 0; n; n = Curl_node_next(n)) + array[i++] = Curl_node_elem(n); /* now sort the cookie pointers in path length order */ qsort(array, matches, sizeof(struct Cookie *), cookie_sort); /* remake the linked list order according to the new order */ + Curl_llist_destroy(list, NULL); - mainco = array[0]; /* start here */ - for(i = 0; inext = array[i + 1]; - array[matches-1]->next = NULL; /* terminate the list */ + for(i = 0; i < matches; i++) + Curl_llist_append(list, array[i], &array[i]->getnode); free(array); /* remove the temporary data again */ } - return mainco; /* return the new list */ + return 0; /* success */ fail: /* failure, clear up the allocated chain and return NULL */ - Curl_cookie_freelist(mainco); - return NULL; + Curl_llist_destroy(list, NULL); + return 2; /* error */ } /* @@ -1484,30 +1449,21 @@ fail: * * Clear all existing cookies and reset the counter. */ -void Curl_cookie_clearall(struct CookieInfo *cookies) +void Curl_cookie_clearall(struct CookieInfo *ci) { - if(cookies) { + if(ci) { unsigned int i; for(i = 0; i < COOKIE_HASH_SIZE; i++) { - Curl_cookie_freelist(cookies->cookies[i]); - cookies->cookies[i] = NULL; + struct Curl_llist_node *n; + for(n = Curl_llist_head(&ci->cookielist[i]); n;) { + struct Cookie *c = Curl_node_elem(n); + struct Curl_llist_node *e = Curl_node_next(n); + Curl_node_remove(n); + freecookie(c); + n = e; + } } - cookies->numcookies = 0; - } -} - -/* - * Curl_cookie_freelist - * - * Free a list of cookies previously returned by Curl_cookie_getlist(); - */ -void Curl_cookie_freelist(struct Cookie *co) -{ - struct Cookie *next; - while(co) { - next = co->next; - freecookie(co); - co = next; + ci->numcookies = 0; } } @@ -1516,39 +1472,26 @@ void Curl_cookie_freelist(struct Cookie *co) * * Free all session cookies in the cookies list. */ -void Curl_cookie_clearsess(struct CookieInfo *cookies) +void Curl_cookie_clearsess(struct CookieInfo *ci) { - struct Cookie *first, *curr, *next, *prev = NULL; unsigned int i; - if(!cookies) + if(!ci) return; for(i = 0; i < COOKIE_HASH_SIZE; i++) { - if(!cookies->cookies[i]) - continue; + struct Curl_llist_node *n = Curl_llist_head(&ci->cookielist[i]); + struct Curl_llist_node *e = NULL; - first = curr = prev = cookies->cookies[i]; - - for(; curr; curr = next) { - next = curr->next; + for(; n; n = e) { + struct Cookie *curr = Curl_node_elem(n); + e = Curl_node_next(n); /* in case the node is removed, get it early */ if(!curr->expires) { - if(first == curr) - first = next; - - if(prev == curr) - prev = next; - else - prev->next = next; - + Curl_node_remove(n); freecookie(curr); - cookies->numcookies--; + ci->numcookies--; } - else - prev = curr; } - - cookies->cookies[i] = first; } } @@ -1557,13 +1500,11 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies) * * Free a "cookie object" previous created with Curl_cookie_init(). */ -void Curl_cookie_cleanup(struct CookieInfo *c) +void Curl_cookie_cleanup(struct CookieInfo *ci) { - if(c) { - unsigned int i; - for(i = 0; i < COOKIE_HASH_SIZE; i++) - Curl_cookie_freelist(c->cookies[i]); - free(c); /* free the base struct as well */ + if(ci) { + Curl_cookie_clearall(ci); + free(ci); /* free the base struct as well */ } } @@ -1582,47 +1523,47 @@ static char *get_netscape_format(const struct Cookie *co) "%s\t" /* tailmatch */ "%s\t" /* path */ "%s\t" /* secure */ - "%" CURL_FORMAT_CURL_OFF_T "\t" /* expires */ + "%" FMT_OFF_T "\t" /* expires */ "%s\t" /* name */ "%s", /* value */ - co->httponly?"#HttpOnly_":"", + co->httponly ? "#HttpOnly_" : "", /* * Make sure all domains are prefixed with a dot if they allow * tailmatching. This is Mozilla-style. */ - (co->tailmatch && co->domain && co->domain[0] != '.')? ".":"", - co->domain?co->domain:"unknown", - co->tailmatch?"TRUE":"FALSE", - co->path?co->path:"/", - co->secure?"TRUE":"FALSE", + (co->tailmatch && co->domain && co->domain[0] != '.') ? "." : "", + co->domain ? co->domain : "unknown", + co->tailmatch ? "TRUE" : "FALSE", + co->path ? co->path : "/", + co->secure ? "TRUE" : "FALSE", co->expires, co->name, - co->value?co->value:""); + co->value ? co->value : ""); } /* * cookie_output() * * Writes all internally known cookies to the specified file. Specify - * "-" as file name to write to stdout. + * "-" as filename to write to stdout. * * The function returns non-zero on write failure. */ static CURLcode cookie_output(struct Curl_easy *data, - struct CookieInfo *c, const char *filename) + struct CookieInfo *ci, + const char *filename) { - struct Cookie *co; FILE *out = NULL; bool use_stdout = FALSE; char *tempstore = NULL; CURLcode error = CURLE_OK; - if(!c) + if(!ci) /* no cookie engine alive */ return CURLE_OK; /* at first, remove expired cookies */ - remove_expired(c); + remove_expired(ci); if(!strcmp("-", filename)) { /* use stdout */ @@ -1640,12 +1581,13 @@ static CURLcode cookie_output(struct Curl_easy *data, "# This file was generated by libcurl! Edit at your own risk.\n\n", out); - if(c->numcookies) { + if(ci->numcookies) { unsigned int i; size_t nvalid = 0; struct Cookie **array; + struct Curl_llist_node *n; - array = calloc(1, sizeof(struct Cookie *) * c->numcookies); + array = calloc(1, sizeof(struct Cookie *) * ci->numcookies); if(!array) { error = CURLE_OUT_OF_MEMORY; goto error; @@ -1653,7 +1595,9 @@ 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(co = c->cookies[i]; co; co = co->next) { + 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; array[nvalid++] = co; @@ -1705,15 +1649,17 @@ static struct curl_slist *cookie_list(struct Curl_easy *data) { struct curl_slist *list = NULL; struct curl_slist *beg; - struct Cookie *c; - char *line; unsigned int i; + struct Curl_llist_node *n; if(!data->cookies || (data->cookies->numcookies == 0)) return NULL; for(i = 0; i < COOKIE_HASH_SIZE; i++) { - for(c = data->cookies->cookies[i]; c; c = c->next) { + for(n = Curl_llist_head(&data->cookies->cookielist[i]); n; + n = Curl_node_next(n)) { + struct Cookie *c = Curl_node_elem(n); + char *line; if(!c->domain) continue; line = get_netscape_format(c); diff --git a/deps/curl/lib/cookie.h b/deps/curl/lib/cookie.h index 012dd892..c98f3602 100644 --- a/deps/curl/lib/cookie.h +++ b/deps/curl/lib/cookie.h @@ -27,20 +27,24 @@ #include +#include "llist.h" + struct Cookie { - struct Cookie *next; /* next in the chain */ - char *name; /* = value */ - char *value; /* name = */ + 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 = */ - bool tailmatch; /* whether we do tail-matching of the domain name */ - bool secure; /* whether the 'secure' keyword was used */ - bool livecookie; /* updated from a server, not a stored file */ - bool httponly; /* true if the httponly directive is present */ - int creationtime; /* time when the cookie was written */ - unsigned char prefix; /* bitmap fields indicating which prefix are set */ + char *domain; /* domain = */ + curl_off_t expires; /* expires = */ + 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 */ }; /* @@ -53,8 +57,8 @@ struct Cookie { #define COOKIE_HASH_SIZE 63 struct CookieInfo { - /* linked list of cookies we know of */ - struct Cookie *cookies[COOKIE_HASH_SIZE]; + /* 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 */ int numcookies; /* number of cookies in the "jar" */ int lastct; /* last creation-time used in the jar */ @@ -75,7 +79,7 @@ struct CookieInfo { /** Limits for INCOMING cookies **/ -/* The longest we allow a line to be when reading a cookie from a HTTP header +/* The longest we allow a line to be when reading a cookie from an HTTP header or from a cookie jar */ #define MAX_COOKIE_LINE 5000 @@ -112,10 +116,10 @@ struct Cookie *Curl_cookie_add(struct Curl_easy *data, const char *domain, const char *path, bool secure); -struct Cookie *Curl_cookie_getlist(struct Curl_easy *data, - struct CookieInfo *c, const char *host, - const char *path, bool secure); -void Curl_cookie_freelist(struct Cookie *cookies); +int Curl_cookie_getlist(struct Curl_easy *data, + struct CookieInfo *c, const char *host, + const char *path, bool secure, + struct Curl_llist *list); void Curl_cookie_clearall(struct CookieInfo *cookies); void Curl_cookie_clearsess(struct CookieInfo *cookies); diff --git a/deps/curl/lib/curl_addrinfo.c b/deps/curl/lib/curl_addrinfo.c index f9211d3f..44e10e9c 100644 --- a/deps/curl/lib/curl_addrinfo.c +++ b/deps/curl/lib/curl_addrinfo.c @@ -95,7 +95,7 @@ Curl_freeaddrinfo(struct Curl_addrinfo *cahead) * the only difference that instead of returning a linked list of * addrinfo structs this one returns a linked list of Curl_addrinfo * ones. The memory allocated by this function *MUST* be free'd with - * Curl_freeaddrinfo(). For each successful call to this function + * Curl_freeaddrinfo(). For each successful call to this function * there must be an associated call later to Curl_freeaddrinfo(). * * There should be no single call to system's getaddrinfo() in the @@ -130,7 +130,7 @@ Curl_getaddrinfo_ex(const char *nodename, /* settle family-specific sockaddr structure size. */ if(ai->ai_family == AF_INET) ss_size = sizeof(struct sockaddr_in); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else if(ai->ai_family == AF_INET6) ss_size = sizeof(struct sockaddr_in6); #endif @@ -221,7 +221,7 @@ Curl_getaddrinfo_ex(const char *nodename, * stack, but usable also for IPv4, all hosts and environments. * * The memory allocated by this function *MUST* be free'd later on calling - * Curl_freeaddrinfo(). For each successful call to this function there + * Curl_freeaddrinfo(). For each successful call to this function there * must be an associated call later to Curl_freeaddrinfo(). * * Curl_addrinfo defined in "lib/curl_addrinfo.h" @@ -259,7 +259,7 @@ Curl_he2ai(const struct hostent *he, int port) struct Curl_addrinfo *prevai = NULL; struct Curl_addrinfo *firstai = NULL; struct sockaddr_in *addr; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 *addr6; #endif CURLcode result = CURLE_OK; @@ -275,7 +275,7 @@ Curl_he2ai(const struct hostent *he, int port) for(i = 0; (curr = he->h_addr_list[i]) != NULL; i++) { size_t ss_size; size_t namelen = strlen(he->h_name) + 1; /* include null-terminator */ -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(he->h_addrtype == AF_INET6) ss_size = sizeof(struct sockaddr_in6); else @@ -317,16 +317,24 @@ Curl_he2ai(const struct hostent *he, int port) addr = (void *)ai->ai_addr; /* storage area for this info */ memcpy(&addr->sin_addr, curr, sizeof(struct in_addr)); +#ifdef __MINGW32__ + addr->sin_family = (short)(he->h_addrtype); +#else addr->sin_family = (CURL_SA_FAMILY_T)(he->h_addrtype); +#endif addr->sin_port = htons((unsigned short)port); break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: addr6 = (void *)ai->ai_addr; /* storage area for this info */ memcpy(&addr6->sin6_addr, curr, sizeof(struct in6_addr)); +#ifdef __MINGW32__ + addr6->sin6_family = (short)(he->h_addrtype); +#else addr6->sin6_family = (CURL_SA_FAMILY_T)(he->h_addrtype); +#endif addr6->sin6_port = htons((unsigned short)port); break; #endif @@ -348,7 +356,7 @@ struct namebuff { struct hostent hostentry; union { struct in_addr ina4; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct in6_addr ina6; #endif } addrentry; @@ -359,7 +367,7 @@ struct namebuff { /* * Curl_ip2addr() * - * This function takes an internet address, in binary form, as input parameter + * 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 * returns a Curl_addrinfo chain filled in correctly with information for the * given address/host @@ -401,7 +409,7 @@ Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port) addrentry = (void *)&buf->addrentry.ina4; memcpy(addrentry, inaddr, sizeof(struct in_addr)); break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: addrsize = sizeof(struct in6_addr); addrentry = (void *)&buf->addrentry.ina6; @@ -447,7 +455,7 @@ struct Curl_addrinfo *Curl_str2addr(char *address, int port) if(Curl_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); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 { struct in6_addr in6; if(Curl_inet_pton(AF_INET6, address, &in6) > 0) @@ -511,7 +519,7 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, * * This is strictly for memory tracing and are using the same style as the * family otherwise present in memdebug.c. I put these ones here since they - * require a bunch of structs I didn't want to include in memdebug.c + * require a bunch of structs I did not want to include in memdebug.c */ void @@ -535,7 +543,7 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis, * * This is strictly for memory tracing and are using the same style as the * family otherwise present in memdebug.c. I put these ones here since they - * require a bunch of structs I didn't want to include in memdebug.c + * require a bunch of structs I did not want to include in memdebug.c */ int @@ -563,14 +571,14 @@ curl_dbg_getaddrinfo(const char *hostname, #if defined(HAVE_GETADDRINFO) && defined(USE_RESOLVE_ON_IPS) /* - * Work-arounds the sin6_port is always zero bug on iOS 9.3.2 and Mac OS X + * Work-arounds the sin6_port is always zero bug on iOS 9.3.2 and macOS * 10.11.5. */ void Curl_addrinfo_set_port(struct Curl_addrinfo *addrinfo, int port) { struct Curl_addrinfo *ca; struct sockaddr_in *addr; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 *addr6; #endif for(ca = addrinfo; ca != NULL; ca = ca->ai_next) { @@ -580,7 +588,7 @@ void Curl_addrinfo_set_port(struct Curl_addrinfo *addrinfo, int port) addr->sin_port = htons((unsigned short)port); break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: addr6 = (void *)ca->ai_addr; /* storage area for this info */ addr6->sin6_port = htons((unsigned short)port); diff --git a/deps/curl/lib/curl_addrinfo.h b/deps/curl/lib/curl_addrinfo.h index c757c49c..9ceac997 100644 --- a/deps/curl/lib/curl_addrinfo.h +++ b/deps/curl/lib/curl_addrinfo.h @@ -44,9 +44,9 @@ /* * Curl_addrinfo is our internal struct definition that we use to allow - * consistent internal handling of this data. We use this even when the - * system provides an addrinfo structure definition. And we use this for - * all sorts of IPv4 and IPV6 builds. + * consistent internal handling of this data. We use this even when the system + * provides an addrinfo structure definition. We use this for all sorts of + * IPv4 and IPV6 builds. */ struct Curl_addrinfo { diff --git a/deps/curl/lib/curl_config.h.cmake b/deps/curl/lib/curl_config.h.cmake index 0f4db698..32a8208b 100644 --- a/deps/curl/lib/curl_config.h.cmake +++ b/deps/curl/lib/curl_config.h.cmake @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -/* lib/curl_config.h.in. Generated somehow by cmake. */ /* Location of default ca bundle */ #cmakedefine CURL_CA_BUNDLE "${CURL_CA_BUNDLE}" @@ -56,7 +55,7 @@ /* disables negotiate authentication */ #cmakedefine CURL_DISABLE_NEGOTIATE_AUTH 1 -/* disables AWS-SIG4 */ +/* disables aws-sigv4 */ #cmakedefine CURL_DISABLE_AWS 1 /* disables DICT */ @@ -89,6 +88,9 @@ /* disables HTTP */ #cmakedefine CURL_DISABLE_HTTP 1 +/* disabled all HTTP authentication methods */ +#cmakedefine CURL_DISABLE_HTTP_AUTH 1 + /* disables IMAP */ #cmakedefine CURL_DISABLE_IMAP 1 @@ -128,15 +130,27 @@ /* disables proxies */ #cmakedefine CURL_DISABLE_PROXY 1 +/* disables IPFS from the curl tool */ +#cmakedefine CURL_DISABLE_IPFS 1 + /* disables RTSP */ #cmakedefine CURL_DISABLE_RTSP 1 +/* disables SHA-512/256 hash algorithm */ +#cmakedefine CURL_DISABLE_SHA512_256 1 + +/* disabled shuffle DNS feature */ +#cmakedefine CURL_DISABLE_SHUFFLE_DNS 1 + /* disables SMB */ #cmakedefine CURL_DISABLE_SMB 1 /* disables SMTP */ #cmakedefine CURL_DISABLE_SMTP 1 +/* disabled WebSockets */ +#cmakedefine CURL_DISABLE_WEBSOCKETS 1 + /* disables use of socketpair for curl_multi_poll */ #cmakedefine CURL_DISABLE_SOCKETPAIR 1 @@ -149,6 +163,12 @@ /* disables verbose strings */ #cmakedefine CURL_DISABLE_VERBOSE_STRINGS 1 +/* disables unsafe CA bundle search on Windows from the curl tool */ +#cmakedefine CURL_DISABLE_CA_SEARCH 1 + +/* safe CA bundle search (within the curl tool directory) on Windows */ +#cmakedefine CURL_CA_SEARCH_SAFE 1 + /* to make a symbol visible */ #cmakedefine CURL_EXTERN_SYMBOL ${CURL_EXTERN_SYMBOL} /* Ensure using CURL_EXTERN_SYMBOL is possible */ @@ -163,7 +183,7 @@ #cmakedefine USE_WIN32_LDAP 1 /* Define if you want to enable IPv6 support */ -#cmakedefine ENABLE_IPV6 1 +#cmakedefine USE_IPV6 1 /* Define to 1 if you have the alarm function. */ #cmakedefine HAVE_ALARM 1 @@ -199,6 +219,15 @@ /* Define to 1 if you have the `closesocket' function. */ #cmakedefine HAVE_CLOSESOCKET 1 +/* Define to 1 if you have the `CloseSocket' function. */ +#cmakedefine HAVE_CLOSESOCKET_CAMEL 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DIRENT_H 1 + +/* Define to 1 if you have the `opendir' function. */ +#cmakedefine HAVE_OPENDIR 1 + /* Define to 1 if you have the fcntl function. */ #cmakedefine HAVE_FCNTL 1 @@ -292,15 +321,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_GSSAPI_GSSAPI_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_GSSAPI_GSSAPI_KRB5_H 1 - /* if you have the GNU gssapi libraries */ #cmakedefine HAVE_GSSGNU 1 -/* Define to 1 if you have the `idna_strerror' function. */ -#cmakedefine HAVE_IDNA_STRERROR 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IFADDRS_H 1 @@ -341,9 +364,6 @@ /* Define to 1 if you have the lber.h header file. */ #cmakedefine HAVE_LBER_H 1 -/* Define to 1 if you have the ldap.h header file. */ -#cmakedefine HAVE_LDAP_H 1 - /* Use LDAPS implementation */ #cmakedefine HAVE_LDAP_SSL 1 @@ -362,12 +382,6 @@ /* Define to 1 if you have the idn2.h header file. */ #cmakedefine HAVE_IDN2_H 1 -/* Define to 1 if you have the `socket' library (-lsocket). */ -#cmakedefine HAVE_LIBSOCKET 1 - -/* Define to 1 if you have the `ssh2' library (-lssh2). */ -#cmakedefine HAVE_LIBSSH2 1 - /* if zlib is available */ #cmakedefine HAVE_LIBZ 1 @@ -395,6 +409,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_IN_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_IN6_H 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NETINET_TCP_H 1 @@ -413,8 +430,11 @@ /* Define to 1 if you have the `pipe' function. */ #cmakedefine HAVE_PIPE 1 -/* If you have a fine poll */ -#cmakedefine HAVE_POLL_FINE 1 +/* Define to 1 if you have the `eventfd' function. */ +#cmakedefine HAVE_EVENTFD 1 + +/* If you have poll */ +#cmakedefine HAVE_POLL 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_POLL_H 1 @@ -446,6 +466,9 @@ /* Define to 1 if you have the sendmsg function. */ #cmakedefine HAVE_SENDMSG 1 +/* Define to 1 if you have the sendmmsg function. */ +#cmakedefine HAVE_SENDMMSG 1 + /* Define to 1 if you have the 'fsetxattr' function. */ #cmakedefine HAVE_FSETXATTR 1 @@ -461,6 +484,9 @@ /* Define to 1 if you have the `setmode' function. */ #cmakedefine HAVE_SETMODE 1 +/* Define to 1 if you have the `_setmode' function. */ +#cmakedefine HAVE__SETMODE 1 + /* Define to 1 if you have the `setrlimit' function. */ #cmakedefine HAVE_SETRLIMIT 1 @@ -488,6 +514,9 @@ /* Define to 1 if you have the `socket' function. */ #cmakedefine HAVE_SOCKET 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_PROTO_BSDSOCKET_H 1 + /* Define to 1 if you have the socketpair function. */ #cmakedefine HAVE_SOCKETPAIR 1 @@ -533,6 +562,9 @@ /* Define to 1 if you have the timeval struct. */ #cmakedefine HAVE_STRUCT_TIMEVAL 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_EVENTFD_H 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_FILIO_H 1 @@ -596,9 +628,6 @@ /* Define this symbol if your OS supports changing the contents of argv */ #cmakedefine HAVE_WRITABLE_ARGV 1 -/* Define to 1 if you need the lber.h header file even with ldap.h */ -#cmakedefine NEED_LBER_H 1 - /* Define to 1 if you need the malloc.h header file even with stdlib.h */ #cmakedefine NEED_MALLOC_H 1 @@ -606,7 +635,7 @@ #cmakedefine NEED_REENTRANT 1 /* cpu-machine-OS */ -#cmakedefine OS ${OS} +#cmakedefine CURL_OS ${CURL_OS} /* Name of package */ #cmakedefine PACKAGE ${PACKAGE} @@ -626,9 +655,6 @@ /* Define to the version of this package. */ #cmakedefine PACKAGE_VERSION ${PACKAGE_VERSION} -/* a suitable file to read random data from */ -#cmakedefine RANDOM_FILE "${RANDOM_FILE}" - /* Note: SIZEOF_* variables are fetched with CMake through check_type_size(). As per CMake documentation on CheckTypeSize, C preprocessor code is @@ -671,7 +697,7 @@ ${SIZEOF_TIME_T_CODE} /* Define if you want to enable POSIX threaded DNS lookup */ #cmakedefine USE_THREADS_POSIX 1 -/* Define if you want to enable WIN32 threaded DNS lookup */ +/* Define if you want to enable Win32 threaded DNS lookup */ #cmakedefine USE_THREADS_WIN32 1 /* if GnuTLS is enabled */ @@ -686,16 +712,28 @@ ${SIZEOF_TIME_T_CODE} /* if BearSSL is enabled */ #cmakedefine USE_BEARSSL 1 -/* if WolfSSL is enabled */ +/* if Rustls is enabled */ +#cmakedefine USE_RUSTLS 1 + +/* if wolfSSL is enabled */ #cmakedefine USE_WOLFSSL 1 -/* if libSSH is in use */ +/* if wolfSSL has the wolfSSL_DES_ecb_encrypt function. */ +#cmakedefine HAVE_WOLFSSL_DES_ECB_ENCRYPT 1 + +/* if wolfSSL has the wolfSSL_BIO_set_shutdown function. */ +#cmakedefine HAVE_WOLFSSL_FULL_BIO 1 + +/* if libssh is in use */ #cmakedefine USE_LIBSSH 1 -/* if libSSH2 is in use */ +/* if libssh2 is in use */ #cmakedefine USE_LIBSSH2 1 -/* if libPSL is in use */ +/* if wolfssh is in use */ +#cmakedefine USE_WOLFSSH 1 + +/* if libpsl is in use */ #cmakedefine USE_LIBPSL 1 /* if you want to use OpenLDAP code instead of legacy ldap implementation */ @@ -704,7 +742,19 @@ ${SIZEOF_TIME_T_CODE} /* if OpenSSL is in use */ #cmakedefine USE_OPENSSL 1 -/* Define to 1 if you don't want the OpenSSL configuration to be loaded +/* if librtmp/rtmpdump is in use */ +#cmakedefine USE_LIBRTMP 1 + +/* if GSASL is in use */ +#cmakedefine USE_GSASL 1 + +/* if libuv is in use */ +#cmakedefine USE_LIBUV 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UV_H 1 + +/* Define to 1 if you do not want the OpenSSL configuration to be loaded automatically */ #cmakedefine CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1 @@ -747,11 +797,6 @@ ${SIZEOF_TIME_T_CODE} /* Version number of package */ #cmakedefine VERSION ${VERSION} -/* Define to 1 if OS is AIX. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ #cmakedefine _FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} @@ -767,12 +812,6 @@ ${SIZEOF_TIME_T_CODE} /* Type to use in place of in_addr_t when system does not provide it. */ #cmakedefine in_addr_t ${in_addr_t} -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - /* Define to `unsigned int' if does not define. */ #cmakedefine size_t ${size_t} @@ -785,8 +824,8 @@ ${SIZEOF_TIME_T_CODE} /* to enable Windows IDN */ #cmakedefine USE_WIN32_IDN 1 -/* Define to 1 to enable websocket support. */ -#cmakedefine USE_WEBSOCKETS 1 +/* to enable Apple IDN */ +#cmakedefine USE_APPLE_IDN 1 /* Define to 1 if OpenSSL has the SSL_CTX_set_srp_username function. */ #cmakedefine HAVE_OPENSSL_SRP 1 @@ -796,3 +835,9 @@ ${SIZEOF_TIME_T_CODE} /* Define to 1 to enable TLS-SRP support. */ #cmakedefine USE_TLS_SRP 1 + +/* Define to 1 to query for HTTPSRR when using DoH */ +#cmakedefine USE_HTTPSRR 1 + +/* if ECH support is available */ +#cmakedefine USE_ECH 1 diff --git a/deps/curl/lib/curl_des.c b/deps/curl/lib/curl_des.c index f8d2b2cc..15836f58 100644 --- a/deps/curl/lib/curl_des.c +++ b/deps/curl/lib/curl_des.c @@ -24,10 +24,10 @@ #include "curl_setup.h" -#if defined(USE_CURL_NTLM_CORE) && !defined(USE_WOLFSSL) && \ - (defined(USE_GNUTLS) || \ - defined(USE_SECTRANSP) || \ - defined(USE_OS400CRYPTO) || \ +#if defined(USE_CURL_NTLM_CORE) && \ + (defined(USE_GNUTLS) || \ + defined(USE_SECTRANSP) || \ + defined(USE_OS400CRYPTO) || \ defined(USE_WIN32_CRYPTO)) #include "curl_des.h" @@ -36,7 +36,7 @@ * 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 doesn't have its own version. + * 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: * diff --git a/deps/curl/lib/curl_des.h b/deps/curl/lib/curl_des.h index 66525ab4..2dd498da 100644 --- a/deps/curl/lib/curl_des.h +++ b/deps/curl/lib/curl_des.h @@ -26,10 +26,10 @@ #include "curl_setup.h" -#if defined(USE_CURL_NTLM_CORE) && !defined(USE_WOLFSSL) && \ - (defined(USE_GNUTLS) || \ - defined(USE_SECTRANSP) || \ - defined(USE_OS400CRYPTO) || \ +#if defined(USE_CURL_NTLM_CORE) && \ + (defined(USE_GNUTLS) || \ + defined(USE_SECTRANSP) || \ + defined(USE_OS400CRYPTO) || \ defined(USE_WIN32_CRYPTO)) /* Applies odd parity to the given byte array */ diff --git a/deps/curl/lib/curl_endian.c b/deps/curl/lib/curl_endian.c index 11c662a4..d982e312 100644 --- a/deps/curl/lib/curl_endian.c +++ b/deps/curl/lib/curl_endian.c @@ -30,7 +30,7 @@ * Curl_read16_le() * * This function converts a 16-bit integer from the little endian format, as - * used in the incoming package to whatever endian format we're using + * used in the incoming package to whatever endian format we are using * natively. * * Parameters: @@ -49,7 +49,7 @@ unsigned short Curl_read16_le(const unsigned char *buf) * Curl_read32_le() * * This function converts a 32-bit integer from the little endian format, as - * used in the incoming package to whatever endian format we're using + * used in the incoming package to whatever endian format we are using * natively. * * Parameters: @@ -68,7 +68,7 @@ unsigned int Curl_read32_le(const unsigned char *buf) * Curl_read16_be() * * This function converts a 16-bit integer from the big endian format, as - * used in the incoming package to whatever endian format we're using + * used in the incoming package to whatever endian format we are using * natively. * * Parameters: diff --git a/deps/curl/lib/curl_fnmatch.c b/deps/curl/lib/curl_fnmatch.c index 5f9ca4f1..ffac8048 100644 --- a/deps/curl/lib/curl_fnmatch.c +++ b/deps/curl/lib/curl_fnmatch.c @@ -80,7 +80,7 @@ static int parsekeyword(unsigned char **pattern, unsigned char *charset) unsigned char *p = *pattern; bool found = FALSE; for(i = 0; !found; i++) { - char c = *p++; + char c = (char)*p++; if(i >= KEYLEN) return SETCHARSET_FAIL; switch(state) { @@ -161,7 +161,7 @@ static void setcharorrange(unsigned char **pp, unsigned char *charset) } } -/* returns 1 (true) if pattern is OK, 0 if is bad ("p" is pattern pointer) */ +/* returns 1 (TRUE) if pattern is OK, 0 if is bad ("p" is pattern pointer) */ static int setcharset(unsigned char **p, unsigned char *charset) { setcharset_state state = CURLFNM_SCHS_DEFAULT; @@ -293,7 +293,7 @@ static int loop(const unsigned char *pattern, const unsigned char *string, p++; break; case '\0': - return *s? CURL_FNMATCH_NOMATCH: CURL_FNMATCH_MATCH; + return *s ? CURL_FNMATCH_NOMATCH : CURL_FNMATCH_MATCH; case '\\': if(p[1]) p++; @@ -303,7 +303,7 @@ static int loop(const unsigned char *pattern, const unsigned char *string, case '[': pp = p + 1; /* Copy in case of syntax error in set. */ if(setcharset(&pp, charset)) { - int found = FALSE; + bool found = FALSE; if(!*s) return CURL_FNMATCH_NOMATCH; if(charset[(unsigned int)*s]) diff --git a/deps/curl/lib/curl_fnmatch.h b/deps/curl/lib/curl_fnmatch.h index 595646ff..b8c2a435 100644 --- a/deps/curl/lib/curl_fnmatch.h +++ b/deps/curl/lib/curl_fnmatch.h @@ -31,7 +31,7 @@ /* default pattern matching function * ================================= * Implemented with recursive backtracking, if you want to use Curl_fnmatch, - * please note that there is not implemented UTF/UNICODE support. + * please note that there is not implemented UTF/Unicode support. * * Implemented features: * '?' notation, does not match UTF characters diff --git a/deps/curl/lib/curl_gethostname.c b/deps/curl/lib/curl_gethostname.c index 706b2e68..617a8ad5 100644 --- a/deps/curl/lib/curl_gethostname.c +++ b/deps/curl/lib/curl_gethostname.c @@ -28,26 +28,17 @@ /* * Curl_gethostname() is a wrapper around gethostname() which allows - * overriding the host name that the function would normally return. + * overriding the hostname that the function would normally return. * This capability is used by the test suite to verify exact matching * of NTLM authentication, which exercises libcurl's MD4 and DES code * as well as by the SMTP module when a hostname is not provided. * - * For libcurl debug enabled builds host name overriding takes place + * For libcurl debug enabled builds hostname overriding takes place * when environment variable CURL_GETHOSTNAME is set, using the value - * held by the variable to override returned host name. + * held by the variable to override returned hostname. * * Note: The function always returns the un-qualified hostname rather * than being provider dependent. - * - * For libcurl shared library release builds the test suite preloads - * another shared library named libhostname using the LD_PRELOAD - * mechanism which intercepts, and might override, the gethostname() - * function call. In this case a given platform must support the - * LD_PRELOAD mechanism and additionally have environment variable - * CURL_GETHOSTNAME set in order to override the returned host name. - * - * For libcurl static library release builds no overriding takes place. */ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) @@ -65,10 +56,13 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) #ifdef DEBUGBUILD - /* Override host name when environment variable CURL_GETHOSTNAME is set */ + /* Override hostname when environment variable CURL_GETHOSTNAME is set */ const char *force_hostname = getenv("CURL_GETHOSTNAME"); if(force_hostname) { - strncpy(name, force_hostname, namelen); + if(strlen(force_hostname) < (size_t)namelen) + strcpy(name, force_hostname); + else + return 1; /* can't do it */ err = 0; } else { @@ -78,9 +72,6 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) #else /* DEBUGBUILD */ - /* The call to system's gethostname() might get intercepted by the - libhostname library when libcurl is built as a non-debug shared - library when running the test suite. */ name[0] = '\0'; err = gethostname(name, namelen); diff --git a/deps/curl/lib/curl_gssapi.c b/deps/curl/lib/curl_gssapi.c index c6fe1256..b7e774ce 100644 --- a/deps/curl/lib/curl_gssapi.c +++ b/deps/curl/lib/curl_gssapi.c @@ -35,7 +35,7 @@ #include "memdebug.h" #if defined(__GNUC__) -#define CURL_ALIGN8 __attribute__ ((aligned(8))) +#define CURL_ALIGN8 __attribute__((aligned(8))) #else #define CURL_ALIGN8 #endif diff --git a/deps/curl/lib/curl_hmac.h b/deps/curl/lib/curl_hmac.h index 7a5387a9..ed5035ca 100644 --- a/deps/curl/lib/curl_hmac.h +++ b/deps/curl/lib/curl_hmac.h @@ -32,30 +32,28 @@ #define HMAC_MD5_LENGTH 16 -typedef CURLcode (* HMAC_hinit_func)(void *context); -typedef void (* HMAC_hupdate_func)(void *context, - const unsigned char *data, - unsigned int len); -typedef void (* HMAC_hfinal_func)(unsigned char *result, void *context); - +typedef CURLcode (*HMAC_hinit)(void *context); +typedef void (*HMAC_hupdate)(void *context, + const unsigned char *data, + unsigned int len); +typedef void (*HMAC_hfinal)(unsigned char *result, void *context); /* Per-hash function HMAC parameters. */ struct HMAC_params { - HMAC_hinit_func - hmac_hinit; /* Initialize context procedure. */ - HMAC_hupdate_func hmac_hupdate; /* Update context with data. */ - HMAC_hfinal_func hmac_hfinal; /* Get final result procedure. */ - unsigned int hmac_ctxtsize; /* Context structure size. */ - unsigned int hmac_maxkeylen; /* Maximum key length (bytes). */ - unsigned int hmac_resultlen; /* Result length (bytes). */ + HMAC_hinit hinit; /* Initialize context procedure. */ + HMAC_hupdate hupdate; /* Update context with data. */ + HMAC_hfinal hfinal; /* Get final result procedure. */ + unsigned int ctxtsize; /* Context structure size. */ + unsigned int maxkeylen; /* Maximum key length (bytes). */ + unsigned int resultlen; /* Result length (bytes). */ }; /* HMAC computation context. */ struct HMAC_context { - const struct HMAC_params *hmac_hash; /* Hash function definition. */ - void *hmac_hashctxt1; /* Hash function context 1. */ - void *hmac_hashctxt2; /* Hash function context 2. */ + const struct HMAC_params *hash; /* Hash function definition. */ + void *hashctxt1; /* Hash function context 1. */ + void *hashctxt2; /* Hash function context 2. */ }; diff --git a/deps/curl/lib/curl_md5.h b/deps/curl/lib/curl_md5.h index 61671c30..ec27503b 100644 --- a/deps/curl/lib/curl_md5.h +++ b/deps/curl/lib/curl_md5.h @@ -31,11 +31,11 @@ #define MD5_DIGEST_LEN 16 -typedef CURLcode (* Curl_MD5_init_func)(void *context); -typedef void (* Curl_MD5_update_func)(void *context, - const unsigned char *data, - unsigned int len); -typedef void (* Curl_MD5_final_func)(unsigned char *result, void *context); +typedef CURLcode (*Curl_MD5_init_func)(void *context); +typedef void (*Curl_MD5_update_func)(void *context, + const unsigned char *data, + unsigned int len); +typedef void (*Curl_MD5_final_func)(unsigned char *result, void *context); struct MD5_params { Curl_MD5_init_func md5_init_func; /* Initialize context procedure */ @@ -50,8 +50,8 @@ struct MD5_context { void *md5_hashctx; /* Hash function context */ }; -extern const struct MD5_params Curl_DIGEST_MD5[1]; -extern const struct HMAC_params Curl_HMAC_MD5[1]; +extern const struct MD5_params Curl_DIGEST_MD5; +extern const struct HMAC_params Curl_HMAC_MD5; CURLcode Curl_md5it(unsigned char *output, const unsigned char *input, const size_t len); diff --git a/deps/curl/lib/curl_memory.h b/deps/curl/lib/curl_memory.h index 714ad71c..7f110dab 100644 --- a/deps/curl/lib/curl_memory.h +++ b/deps/curl/lib/curl_memory.h @@ -84,6 +84,7 @@ #undef socketpair #endif +#ifndef CURL_NO_GETADDRINFO_OVERRIDE #ifdef HAVE_GETADDRINFO #if defined(getaddrinfo) && defined(__osf__) #undef ogetaddrinfo @@ -95,6 +96,7 @@ #ifdef HAVE_FREEADDRINFO #undef freeaddrinfo #endif /* HAVE_FREEADDRINFO */ +#endif /* !CURL_NO_GETADDRINFO_OVERRIDE */ /* sclose is probably already defined, redefine it! */ #undef sclose diff --git a/deps/curl/lib/curl_memrchr.c b/deps/curl/lib/curl_memrchr.c index 3f3dc6de..c6d55f10 100644 --- a/deps/curl/lib/curl_memrchr.c +++ b/deps/curl/lib/curl_memrchr.c @@ -33,6 +33,9 @@ #include "memdebug.h" #ifndef HAVE_MEMRCHR +#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) || \ + defined(USE_OPENSSL) || \ + defined(USE_SCHANNEL) /* * Curl_memrchr() @@ -61,4 +64,5 @@ Curl_memrchr(const void *s, int c, size_t n) return NULL; } +#endif #endif /* HAVE_MEMRCHR */ diff --git a/deps/curl/lib/curl_memrchr.h b/deps/curl/lib/curl_memrchr.h index 45bb38c6..67a21ef3 100644 --- a/deps/curl/lib/curl_memrchr.h +++ b/deps/curl/lib/curl_memrchr.h @@ -34,11 +34,15 @@ #endif #else /* HAVE_MEMRCHR */ +#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) || \ + defined(USE_OPENSSL) || \ + defined(USE_SCHANNEL) void *Curl_memrchr(const void *s, int c, size_t n); #define memrchr(x,y,z) Curl_memrchr((x),(y),(z)) +#endif #endif /* HAVE_MEMRCHR */ #endif /* HEADER_CURL_MEMRCHR_H */ diff --git a/deps/curl/lib/curl_multibyte.c b/deps/curl/lib/curl_multibyte.c index ff210985..86ac74ff 100644 --- a/deps/curl/lib/curl_multibyte.c +++ b/deps/curl/lib/curl_multibyte.c @@ -159,21 +159,4 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) #endif } -int curlx_win32_access(const char *path, int mode) -{ -#if defined(_UNICODE) - int result = -1; - wchar_t *path_w = curlx_convert_UTF8_to_wchar(path); - if(path_w) { - result = _waccess(path_w, mode); - curlx_unicodefree(path_w); - } - else - errno = EINVAL; - return result; -#else - return _access(path, mode); -#endif -} - #endif /* USE_WIN32_LARGE_FILES || USE_WIN32_SMALL_FILES */ diff --git a/deps/curl/lib/curl_multibyte.h b/deps/curl/lib/curl_multibyte.h index 8b9ac719..dec384e2 100644 --- a/deps/curl/lib/curl_multibyte.h +++ b/deps/curl/lib/curl_multibyte.h @@ -39,19 +39,20 @@ char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); * 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. + * to differentiate Unicode from non-Unicode builds. * - * In the case of a non-UNICODE build the tchar strings are char strings that + * 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. + * significance of the conversion functions is primarily for Unicode builds. * * 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'll notice that curlx function-like - * macros call free and strdup in parentheses, eg (strdup)(ptr), and that's to - * ensure that the curl memdebug override macros do not replace them. + * 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. */ #if defined(UNICODE) && defined(_WIN32) diff --git a/deps/curl/lib/curl_ntlm_core.c b/deps/curl/lib/curl_ntlm_core.c index 6f6d75c0..3cc885e0 100644 --- a/deps/curl/lib/curl_ntlm_core.c +++ b/deps/curl/lib/curl_ntlm_core.c @@ -57,9 +57,14 @@ #if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_DEPRECATED_3_0) #define USE_OPENSSL_DES #endif +#elif defined(USE_WOLFSSL) + #include + #if !defined(NO_DES3) + #define USE_OPENSSL_DES + #endif #endif -#if defined(USE_OPENSSL_DES) || defined(USE_WOLFSSL) +#if defined(USE_OPENSSL_DES) #if defined(USE_OPENSSL) # include @@ -67,7 +72,6 @@ # include # include #else -# include # include # include # include @@ -110,7 +114,7 @@ #elif defined(USE_WIN32_CRYPTO) # include #else -# error "Can't compile NTLM support without a crypto library with DES." +# error "cannot compile NTLM support without a crypto library with DES." # define CURL_NTLM_NOT_SUPPORTED #endif @@ -137,20 +141,20 @@ */ static void extend_key_56_to_64(const unsigned char *key_56, char *key) { - key[0] = key_56[0]; - key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1)); - key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2)); - key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3)); - key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4)); - key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5)); - key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6)); - key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF); + key[0] = (char)key_56[0]; + key[1] = (char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1)); + key[2] = (char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2)); + key[3] = (char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3)); + key[4] = (char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4)); + key[5] = (char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5)); + key[6] = (char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6)); + key[7] = (char) ((key_56[6] << 1) & 0xFF); } #endif -#if defined(USE_OPENSSL_DES) || defined(USE_WOLFSSL) +#if defined(USE_OPENSSL_DES) /* - * Turns a 56 bit key into the 64 bit, odd parity key and sets the key. The + * Turns a 56-bit key into a 64-bit, odd parity key and sets the key. The * key schedule ks is also set. */ static void setup_des_key(const unsigned char *key_56, @@ -158,7 +162,7 @@ static void setup_des_key(const unsigned char *key_56, { DES_cblock key; - /* Expand the 56-bit key to 64-bits */ + /* Expand the 56-bit key to 64 bits */ extend_key_56_to_64(key_56, (char *) &key); /* Set the key parity to odd */ @@ -175,7 +179,7 @@ static void setup_des_key(const unsigned char *key_56, { char key[8]; - /* Expand the 56-bit key to 64-bits */ + /* Expand the 56-bit key to 64 bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ @@ -193,7 +197,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, mbedtls_des_context ctx; char key[8]; - /* Expand the 56-bit key to 64-bits */ + /* Expand the 56-bit key to 64 bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ @@ -214,7 +218,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, size_t out_len; CCCryptorStatus err; - /* Expand the 56-bit key to 64-bits */ + /* Expand the 56-bit key to 64 bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ @@ -240,7 +244,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, ctl.Func_ID = ENCRYPT_ONLY; ctl.Data_Len = sizeof(key); - /* Expand the 56-bit key to 64-bits */ + /* Expand the 56-bit key to 64 bits */ extend_key_56_to_64(key_56, ctl.Crypto_Key); /* Set the key parity to odd */ @@ -278,7 +282,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, blob.hdr.aiKeyAlg = CALG_DES; blob.len = sizeof(blob.key); - /* Expand the 56-bit key to 64-bits */ + /* Expand the 56-bit key to 64 bits */ extend_key_56_to_64(key_56, blob.key); /* Set the key parity to odd */ @@ -313,7 +317,7 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys, const unsigned char *plaintext, unsigned char *results) { -#if defined(USE_OPENSSL_DES) || defined(USE_WOLFSSL) +#if defined(USE_OPENSSL_DES) DES_key_schedule ks; setup_des_key(keys, DESKEY(ks)); @@ -367,7 +371,7 @@ CURLcode Curl_ntlm_core_mk_lm_hash(const char *password, { /* Create LanManager hashed password. */ -#if defined(USE_OPENSSL_DES) || defined(USE_WOLFSSL) +#if defined(USE_OPENSSL_DES) DES_key_schedule ks; setup_des_key(pw, DESKEY(ks)); @@ -466,20 +470,20 @@ static void time2filetime(struct ms_filetime *ft, time_t t) unsigned int r, s; unsigned int i; - ft->dwLowDateTime = t & 0xFFFFFFFF; + ft->dwLowDateTime = (unsigned int)t & 0xFFFFFFFF; ft->dwHighDateTime = 0; # ifndef HAVE_TIME_T_UNSIGNED /* Extend sign if needed. */ if(ft->dwLowDateTime & 0x80000000) - ft->dwHighDateTime = ~0; + ft->dwHighDateTime = ~(unsigned int)0; # endif /* Bias seconds to Jan 1, 1601. 134774 days = 11644473600 seconds = 0x2B6109100 */ r = ft->dwLowDateTime; ft->dwLowDateTime = (ft->dwLowDateTime + 0xB6109100U) & 0xFFFFFFFF; - ft->dwHighDateTime += ft->dwLowDateTime < r? 0x03: 0x02; + ft->dwHighDateTime += ft->dwLowDateTime < r ? 0x03 : 0x02; /* Convert to tenths of microseconds. */ ft->dwHighDateTime *= 10000000; @@ -524,7 +528,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, ascii_uppercase_to_unicode_le(identity, user, userlen); ascii_to_unicode_le(identity + (userlen << 1), domain, domlen); - result = Curl_hmacit(Curl_HMAC_MD5, ntlmhash, 16, identity, identity_len, + result = Curl_hmacit(&Curl_HMAC_MD5, ntlmhash, 16, identity, identity_len, ntlmv2hash); free(identity); @@ -534,13 +538,13 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, /* * Curl_ntlm_core_mk_ntlmv2_resp() * - * This creates the NTLMv2 response as set in the ntlm type-3 message. + * This creates the NTLMv2 response as set in the NTLM type-3 message. * * Parameters: * - * ntlmv2hash [in] - The ntlmv2 hash (16 bytes) + * ntlmv2hash [in] - The NTLMv2 hash (16 bytes) * challenge_client [in] - The client nonce (8 bytes) - * ntlm [in] - The ntlm data struct being used to read TargetInfo + * ntlm [in] - The NTLM data struct being used to read TargetInfo and Server challenge received in the type-2 message * ntresp [out] - The address where a pointer to newly allocated * memory holding the NTLMv2 response. @@ -609,7 +613,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, /* Concatenate the Type 2 challenge with the BLOB and do HMAC MD5 */ memcpy(ptr + 8, &ntlm->nonce[0], 8); - result = Curl_hmacit(Curl_HMAC_MD5, ntlmv2hash, HMAC_MD5_LENGTH, ptr + 8, + result = Curl_hmacit(&Curl_HMAC_MD5, ntlmv2hash, HMAC_MD5_LENGTH, ptr + 8, NTLMv2_BLOB_LEN + 8, hmac_output); if(result) { free(ptr); @@ -629,11 +633,11 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, /* * Curl_ntlm_core_mk_lmv2_resp() * - * This creates the LMv2 response as used in the ntlm type-3 message. + * This creates the LMv2 response as used in the NTLM type-3 message. * * Parameters: * - * ntlmv2hash [in] - The ntlmv2 hash (16 bytes) + * ntlmv2hash [in] - The NTLMv2 hash (16 bytes) * challenge_client [in] - The client nonce (8 bytes) * challenge_client [in] - The server challenge (8 bytes) * lmresp [out] - The LMv2 response (24 bytes) @@ -652,12 +656,12 @@ CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash, memcpy(&data[0], challenge_server, 8); memcpy(&data[8], challenge_client, 8); - result = Curl_hmacit(Curl_HMAC_MD5, ntlmv2hash, 16, &data[0], 16, + result = Curl_hmacit(&Curl_HMAC_MD5, ntlmv2hash, 16, &data[0], 16, hmac_output); if(result) return result; - /* Concatenate the HMAC MD5 output with the client nonce */ + /* Concatenate the HMAC MD5 output with the client nonce */ memcpy(lmresp, hmac_output, 16); memcpy(lmresp + 16, challenge_client, 8); diff --git a/deps/curl/lib/curl_ntlm_core.h b/deps/curl/lib/curl_ntlm_core.h index 0c62ee05..e2e4b1bd 100644 --- a/deps/curl/lib/curl_ntlm_core.h +++ b/deps/curl/lib/curl_ntlm_core.h @@ -28,13 +28,6 @@ #if defined(USE_CURL_NTLM_CORE) -#if defined(USE_OPENSSL) -# include -#elif defined(USE_WOLFSSL) -# include -# include -#endif - /* Helpers to generate function byte arguments in little endian order */ #define SHORTPAIR(x) ((int)((x) & 0xff)), ((int)(((x) >> 8) & 0xff)) #define LONGQUARTET(x) ((int)((x) & 0xff)), ((int)(((x) >> 8) & 0xff)), \ diff --git a/deps/curl/lib/curl_ntlm_wb.c b/deps/curl/lib/curl_ntlm_wb.c deleted file mode 100644 index acb00939..00000000 --- a/deps/curl/lib/curl_ntlm_wb.c +++ /dev/null @@ -1,500 +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" - -#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) && \ - defined(NTLM_WB_ENABLED) - -/* - * NTLM details: - * - * https://davenport.sourceforge.net/ntlm.html - * https://www.innovation.ch/java/ntlm.html - */ - -#define DEBUG_ME 0 - -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#include -#ifdef HAVE_PWD_H -#include -#endif - -#include "urldata.h" -#include "sendf.h" -#include "select.h" -#include "vauth/ntlm.h" -#include "curl_ntlm_core.h" -#include "curl_ntlm_wb.h" -#include "url.h" -#include "strerror.h" -#include "strdup.h" -#include "strcase.h" - -/* The last 3 #include files should be in this order */ -#include "curl_printf.h" -#include "curl_memory.h" -#include "memdebug.h" - -#if DEBUG_ME -# define DEBUG_OUT(x) x -#else -# define DEBUG_OUT(x) Curl_nop_stmt -#endif - -/* Portable 'sclose_nolog' used only in child process instead of 'sclose' - to avoid fooling the socket leak detector */ -#ifdef HAVE_PIPE -# define sclose_nolog(x) close((x)) -#elif defined(HAVE_CLOSESOCKET) -# define sclose_nolog(x) closesocket((x)) -#elif defined(HAVE_CLOSESOCKET_CAMEL) -# define sclose_nolog(x) CloseSocket((x)) -#else -# define sclose_nolog(x) close((x)) -#endif - -static void ntlm_wb_cleanup(struct ntlmdata *ntlm) -{ - if(ntlm->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD) { - sclose(ntlm->ntlm_auth_hlpr_socket); - ntlm->ntlm_auth_hlpr_socket = CURL_SOCKET_BAD; - } - - if(ntlm->ntlm_auth_hlpr_pid) { - int i; - for(i = 0; i < 4; i++) { - pid_t ret = waitpid(ntlm->ntlm_auth_hlpr_pid, NULL, WNOHANG); - if(ret == ntlm->ntlm_auth_hlpr_pid || errno == ECHILD) - break; - switch(i) { - case 0: - kill(ntlm->ntlm_auth_hlpr_pid, SIGTERM); - break; - case 1: - /* Give the process another moment to shut down cleanly before - bringing down the axe */ - Curl_wait_ms(1); - break; - case 2: - kill(ntlm->ntlm_auth_hlpr_pid, SIGKILL); - break; - case 3: - break; - } - } - ntlm->ntlm_auth_hlpr_pid = 0; - } - - Curl_safefree(ntlm->challenge); - Curl_safefree(ntlm->response); -} - -static CURLcode ntlm_wb_init(struct Curl_easy *data, struct ntlmdata *ntlm, - const char *userp) -{ - curl_socket_t sockfds[2]; - pid_t child_pid; - const char *username; - char *slash, *domain = NULL; - const char *ntlm_auth = NULL; - char *ntlm_auth_alloc = NULL; -#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID) - struct passwd pw, *pw_res; - char pwbuf[1024]; -#endif - char buffer[STRERROR_LEN]; - -#if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) data; -#endif - - /* Return if communication with ntlm_auth already set up */ - if(ntlm->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD || - ntlm->ntlm_auth_hlpr_pid) - return CURLE_OK; - - username = userp; - /* The real ntlm_auth really doesn't like being invoked with an - empty username. It won't make inferences for itself, and expects - the client to do so (mostly because it's really designed for - servers like squid to use for auth, and client support is an - afterthought for it). So try hard to provide a suitable username - if we don't already have one. But if we can't, provide the - empty one anyway. Perhaps they have an implementation of the - ntlm_auth helper which *doesn't* need it so we might as well try */ - if(!username || !username[0]) { - username = getenv("NTLMUSER"); - if(!username || !username[0]) - username = getenv("LOGNAME"); - if(!username || !username[0]) - username = getenv("USER"); -#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID) - if((!username || !username[0]) && - !getpwuid_r(geteuid(), &pw, pwbuf, sizeof(pwbuf), &pw_res) && - pw_res) { - username = pw.pw_name; - } -#endif - if(!username || !username[0]) - username = userp; - } - slash = strpbrk(username, "\\/"); - if(slash) { - domain = strdup(username); - if(!domain) - return CURLE_OUT_OF_MEMORY; - slash = domain + (slash - username); - *slash = '\0'; - username = username + (slash - domain) + 1; - } - - /* For testing purposes, when DEBUGBUILD is defined and environment - variable CURL_NTLM_WB_FILE is set a fake_ntlm is used to perform - NTLM challenge/response which only accepts commands and output - strings pre-written in test case definitions */ -#ifdef DEBUGBUILD - ntlm_auth_alloc = curl_getenv("CURL_NTLM_WB_FILE"); - if(ntlm_auth_alloc) - ntlm_auth = ntlm_auth_alloc; - else -#endif - ntlm_auth = NTLM_WB_FILE; - - if(access(ntlm_auth, X_OK) != 0) { - failf(data, "Could not access ntlm_auth: %s errno %d: %s", - ntlm_auth, errno, Curl_strerror(errno, buffer, sizeof(buffer))); - goto done; - } - - if(wakeup_create(sockfds)) { - failf(data, "Could not open socket pair. errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - goto done; - } - - child_pid = fork(); - if(child_pid == -1) { - wakeup_close(sockfds[0]); - wakeup_close(sockfds[1]); - failf(data, "Could not fork. errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - goto done; - } - else if(!child_pid) { - /* - * child process - */ - - /* Don't use sclose in the child since it fools the socket leak detector */ - sclose_nolog(sockfds[0]); - if(dup2(sockfds[1], STDIN_FILENO) == -1) { - failf(data, "Could not redirect child stdin. errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - exit(1); - } - - if(dup2(sockfds[1], STDOUT_FILENO) == -1) { - failf(data, "Could not redirect child stdout. errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - exit(1); - } - - if(domain) - execl(ntlm_auth, ntlm_auth, - "--helper-protocol", "ntlmssp-client-1", - "--use-cached-creds", - "--username", username, - "--domain", domain, - NULL); - else - execl(ntlm_auth, ntlm_auth, - "--helper-protocol", "ntlmssp-client-1", - "--use-cached-creds", - "--username", username, - NULL); - - sclose_nolog(sockfds[1]); - failf(data, "Could not execl(). errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - exit(1); - } - - sclose(sockfds[1]); - ntlm->ntlm_auth_hlpr_socket = sockfds[0]; - ntlm->ntlm_auth_hlpr_pid = child_pid; - free(domain); - free(ntlm_auth_alloc); - return CURLE_OK; - -done: - free(domain); - free(ntlm_auth_alloc); - return CURLE_REMOTE_ACCESS_DENIED; -} - -/* if larger than this, something is seriously wrong */ -#define MAX_NTLM_WB_RESPONSE 100000 - -static CURLcode ntlm_wb_response(struct Curl_easy *data, struct ntlmdata *ntlm, - const char *input, curlntlm state) -{ - size_t len_in = strlen(input), len_out = 0; - struct dynbuf b; - char *ptr = NULL; - unsigned char buf[1024]; - Curl_dyn_init(&b, MAX_NTLM_WB_RESPONSE); - - while(len_in > 0) { - ssize_t written = wakeup_write(ntlm->ntlm_auth_hlpr_socket, input, len_in); - if(written == -1) { - /* Interrupted by a signal, retry it */ - if(errno == EINTR) - continue; - /* write failed if other errors happen */ - goto done; - } - input += written; - len_in -= written; - } - /* Read one line */ - while(1) { - ssize_t size = - wakeup_read(ntlm->ntlm_auth_hlpr_socket, buf, sizeof(buf)); - if(size == -1) { - if(errno == EINTR) - continue; - goto done; - } - else if(size == 0) - goto done; - - if(Curl_dyn_addn(&b, buf, size)) - goto done; - - len_out = Curl_dyn_len(&b); - ptr = Curl_dyn_ptr(&b); - if(len_out && ptr[len_out - 1] == '\n') { - ptr[len_out - 1] = '\0'; - break; /* done! */ - } - /* loop */ - } - - /* Samba/winbind installed but not configured */ - if(state == NTLMSTATE_TYPE1 && - len_out == 3 && - ptr[0] == 'P' && ptr[1] == 'W') - goto done; - /* invalid response */ - if(len_out < 4) - goto done; - if(state == NTLMSTATE_TYPE1 && - (ptr[0]!='Y' || ptr[1]!='R' || ptr[2]!=' ')) - goto done; - if(state == NTLMSTATE_TYPE2 && - (ptr[0]!='K' || ptr[1]!='K' || ptr[2]!=' ') && - (ptr[0]!='A' || ptr[1]!='F' || ptr[2]!=' ')) - goto done; - - ntlm->response = strdup(ptr + 3); - Curl_dyn_free(&b); - if(!ntlm->response) - return CURLE_OUT_OF_MEMORY; - return CURLE_OK; -done: - Curl_dyn_free(&b); - return CURLE_REMOTE_ACCESS_DENIED; -} - -CURLcode Curl_input_ntlm_wb(struct Curl_easy *data, - struct connectdata *conn, - bool proxy, - const char *header) -{ - struct ntlmdata *ntlm = proxy ? &conn->proxyntlm : &conn->ntlm; - curlntlm *state = proxy ? &conn->proxy_ntlm_state : &conn->http_ntlm_state; - - (void) data; /* In case it gets unused by nop log macros. */ - - if(!checkprefix("NTLM", header)) - return CURLE_BAD_CONTENT_ENCODING; - - header += strlen("NTLM"); - while(*header && ISSPACE(*header)) - header++; - - if(*header) { - ntlm->challenge = strdup(header); - if(!ntlm->challenge) - return CURLE_OUT_OF_MEMORY; - - *state = NTLMSTATE_TYPE2; /* We got a type-2 message */ - } - else { - if(*state == NTLMSTATE_LAST) { - infof(data, "NTLM auth restarted"); - Curl_http_auth_cleanup_ntlm_wb(conn); - } - else if(*state == NTLMSTATE_TYPE3) { - infof(data, "NTLM handshake rejected"); - Curl_http_auth_cleanup_ntlm_wb(conn); - *state = NTLMSTATE_NONE; - return CURLE_REMOTE_ACCESS_DENIED; - } - else if(*state >= NTLMSTATE_TYPE1) { - infof(data, "NTLM handshake failure (internal error)"); - return CURLE_REMOTE_ACCESS_DENIED; - } - - *state = NTLMSTATE_TYPE1; /* We should send away a type-1 */ - } - - return CURLE_OK; -} - -/* - * This is for creating ntlm header output by delegating challenge/response - * to Samba's winbind daemon helper ntlm_auth. - */ -CURLcode Curl_output_ntlm_wb(struct Curl_easy *data, struct connectdata *conn, - bool proxy) -{ - /* point to the address of the pointer that holds the string to send to the - server, which is for a plain host or for an HTTP proxy */ - char **allocuserpwd; - /* point to the name and password for this */ - const char *userp; - struct ntlmdata *ntlm; - curlntlm *state; - struct auth *authp; - - CURLcode res = CURLE_OK; - - DEBUGASSERT(conn); - DEBUGASSERT(data); - - if(proxy) { -#ifndef CURL_DISABLE_PROXY - allocuserpwd = &data->state.aptr.proxyuserpwd; - userp = conn->http_proxy.user; - ntlm = &conn->proxyntlm; - state = &conn->proxy_ntlm_state; - authp = &data->state.authproxy; -#else - return CURLE_NOT_BUILT_IN; -#endif - } - else { - allocuserpwd = &data->state.aptr.userpwd; - userp = conn->user; - ntlm = &conn->ntlm; - state = &conn->http_ntlm_state; - authp = &data->state.authhost; - } - authp->done = FALSE; - - /* not set means empty */ - if(!userp) - userp = ""; - - switch(*state) { - case NTLMSTATE_TYPE1: - default: - /* Use Samba's 'winbind' daemon to support NTLM authentication, - * by delegating the NTLM challenge/response protocol to a helper - * in ntlm_auth. - * https://web.archive.org/web/20190925164737 - * /devel.squid-cache.org/ntlm/squid_helper_protocol.html - * https://www.samba.org/samba/docs/man/manpages-3/winbindd.8.html - * https://www.samba.org/samba/docs/man/manpages-3/ntlm_auth.1.html - * Preprocessor symbol 'NTLM_WB_ENABLED' is defined when this - * feature is enabled and 'NTLM_WB_FILE' symbol holds absolute - * filename of ntlm_auth helper. - * If NTLM authentication using winbind fails, go back to original - * request handling process. - */ - /* Create communication with ntlm_auth */ - res = ntlm_wb_init(data, ntlm, userp); - if(res) - return res; - res = ntlm_wb_response(data, ntlm, "YR\n", *state); - if(res) - return res; - - free(*allocuserpwd); - *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", - proxy ? "Proxy-" : "", - ntlm->response); - DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd)); - Curl_safefree(ntlm->response); - if(!*allocuserpwd) - return CURLE_OUT_OF_MEMORY; - break; - - case NTLMSTATE_TYPE2: { - char *input = aprintf("TT %s\n", ntlm->challenge); - if(!input) - return CURLE_OUT_OF_MEMORY; - res = ntlm_wb_response(data, ntlm, input, *state); - free(input); - if(res) - return res; - - free(*allocuserpwd); - *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", - proxy ? "Proxy-" : "", - ntlm->response); - DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd)); - *state = NTLMSTATE_TYPE3; /* we sent a type-3 */ - authp->done = TRUE; - Curl_http_auth_cleanup_ntlm_wb(conn); - if(!*allocuserpwd) - return CURLE_OUT_OF_MEMORY; - break; - } - case NTLMSTATE_TYPE3: - /* connection is already authenticated, - * don't send a header in future requests */ - *state = NTLMSTATE_LAST; - FALLTHROUGH(); - case NTLMSTATE_LAST: - Curl_safefree(*allocuserpwd); - authp->done = TRUE; - break; - } - - return CURLE_OK; -} - -void Curl_http_auth_cleanup_ntlm_wb(struct connectdata *conn) -{ - ntlm_wb_cleanup(&conn->ntlm); - ntlm_wb_cleanup(&conn->proxyntlm); -} - -#endif /* !CURL_DISABLE_HTTP && USE_NTLM && NTLM_WB_ENABLED */ diff --git a/deps/curl/lib/curl_printf.h b/deps/curl/lib/curl_printf.h index c2457d2a..e851b14a 100644 --- a/deps/curl/lib/curl_printf.h +++ b/deps/curl/lib/curl_printf.h @@ -29,6 +29,10 @@ * *rintf() functions. */ +#ifndef CURL_TEMP_PRINTF +#error "CURL_TEMP_PRINTF must be set before including curl/mprintf.h" +#endif + #include #define MERR_OK 0 @@ -40,7 +44,6 @@ # undef msnprintf # undef vprintf # undef vfprintf -# undef vsnprintf # undef mvsnprintf # undef aprintf # undef vaprintf diff --git a/deps/curl/lib/curl_range.c b/deps/curl/lib/curl_range.c index d499953c..49fb5f07 100644 --- a/deps/curl/lib/curl_range.c +++ b/deps/curl/lib/curl_range.c @@ -55,15 +55,13 @@ CURLcode Curl_range(struct Curl_easy *data) if((to_t == CURL_OFFT_INVAL) && !from_t) { /* X - */ data->state.resume_from = from; - DEBUGF(infof(data, "RANGE %" CURL_FORMAT_CURL_OFF_T " to end of file", - from)); + DEBUGF(infof(data, "RANGE %" FMT_OFF_T " to end of file", from)); } else if((from_t == CURL_OFFT_INVAL) && !to_t) { /* -Y */ data->req.maxdownload = to; data->state.resume_from = -to; - DEBUGF(infof(data, "RANGE the last %" CURL_FORMAT_CURL_OFF_T " bytes", - to)); + DEBUGF(infof(data, "RANGE the last %" FMT_OFF_T " bytes", to)); } else { /* X-Y */ @@ -79,13 +77,12 @@ CURLcode Curl_range(struct Curl_easy *data) data->req.maxdownload = totalsize + 1; /* include last byte */ data->state.resume_from = from; - DEBUGF(infof(data, "RANGE from %" CURL_FORMAT_CURL_OFF_T - " getting %" CURL_FORMAT_CURL_OFF_T " bytes", + DEBUGF(infof(data, "RANGE from %" FMT_OFF_T + " getting %" FMT_OFF_T " bytes", from, data->req.maxdownload)); } - DEBUGF(infof(data, "range-download from %" CURL_FORMAT_CURL_OFF_T - " to %" CURL_FORMAT_CURL_OFF_T ", totally %" - CURL_FORMAT_CURL_OFF_T " bytes", + DEBUGF(infof(data, "range-download from %" FMT_OFF_T + " to %" FMT_OFF_T ", totally %" FMT_OFF_T " bytes", from, to, data->req.maxdownload)); } else diff --git a/deps/curl/lib/curl_rtmp.c b/deps/curl/lib/curl_rtmp.c index b2f2adad..59fcc4e1 100644 --- a/deps/curl/lib/curl_rtmp.c +++ b/deps/curl/lib/curl_rtmp.c @@ -35,8 +35,10 @@ #include "warnless.h" #include #include + +/* The last 3 #include files should be in this order */ +#include "curl_printf.h" #include "curl_memory.h" -/* The last #include file should be: */ #include "memdebug.h" #if defined(_WIN32) && !defined(USE_LWIPSOCK) @@ -66,7 +68,7 @@ static Curl_send rtmp_send; */ const struct Curl_handler Curl_handler_rtmp = { - "RTMP", /* scheme */ + "rtmp", /* scheme */ rtmp_setup_connection, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ @@ -80,6 +82,7 @@ const struct Curl_handler Curl_handler_rtmp = { ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTMP, /* defport */ @@ -89,7 +92,7 @@ const struct Curl_handler Curl_handler_rtmp = { }; const struct Curl_handler Curl_handler_rtmpt = { - "RTMPT", /* scheme */ + "rtmpt", /* scheme */ rtmp_setup_connection, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ @@ -103,6 +106,7 @@ const struct Curl_handler Curl_handler_rtmpt = { ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTMPT, /* defport */ @@ -112,7 +116,7 @@ const struct Curl_handler Curl_handler_rtmpt = { }; const struct Curl_handler Curl_handler_rtmpe = { - "RTMPE", /* scheme */ + "rtmpe", /* scheme */ rtmp_setup_connection, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ @@ -126,6 +130,7 @@ const struct Curl_handler Curl_handler_rtmpe = { ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTMP, /* defport */ @@ -135,7 +140,7 @@ const struct Curl_handler Curl_handler_rtmpe = { }; const struct Curl_handler Curl_handler_rtmpte = { - "RTMPTE", /* scheme */ + "rtmpte", /* scheme */ rtmp_setup_connection, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ @@ -149,6 +154,7 @@ const struct Curl_handler Curl_handler_rtmpte = { ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTMPT, /* defport */ @@ -158,7 +164,7 @@ const struct Curl_handler Curl_handler_rtmpte = { }; const struct Curl_handler Curl_handler_rtmps = { - "RTMPS", /* scheme */ + "rtmps", /* scheme */ rtmp_setup_connection, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ @@ -172,6 +178,7 @@ const struct Curl_handler Curl_handler_rtmps = { ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTMPS, /* defport */ @@ -181,7 +188,7 @@ const struct Curl_handler Curl_handler_rtmps = { }; const struct Curl_handler Curl_handler_rtmpts = { - "RTMPTS", /* scheme */ + "rtmpts", /* scheme */ rtmp_setup_connection, /* setup_connection */ rtmp_do, /* do_it */ rtmp_done, /* done */ @@ -195,6 +202,7 @@ const struct Curl_handler Curl_handler_rtmpts = { ZERO_NULL, /* perform_getsock */ rtmp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTMPS, /* defport */ @@ -228,7 +236,7 @@ static CURLcode rtmp_connect(struct Curl_easy *data, bool *done) r->m_sb.sb_socket = (int)conn->sock[FIRSTSOCKET]; - /* We have to know if it's a write before we send the + /* We have to know if it is a write before we send the * connect request packet */ if(data->state.upload) @@ -247,7 +255,7 @@ static CURLcode rtmp_connect(struct Curl_easy *data, bool *done) return CURLE_FAILED_INIT; /* Clients must send a periodic BytesReceived report to the server */ - r->m_bSendCounter = true; + r->m_bSendCounter = TRUE; *done = TRUE; conn->recv[FIRSTSOCKET] = rtmp_recv; @@ -265,10 +273,10 @@ static CURLcode rtmp_do(struct Curl_easy *data, bool *done) if(data->state.upload) { Curl_pgrsSetUploadSize(data, data->state.infilesize); - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); } else - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); *done = TRUE; return CURLE_OK; } @@ -321,13 +329,14 @@ static ssize_t rtmp_recv(struct Curl_easy *data, int sockindex, char *buf, } static ssize_t rtmp_send(struct Curl_easy *data, int sockindex, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, CURLcode *err) { struct connectdata *conn = data->conn; RTMP *r = conn->proto.rtmp; ssize_t num; (void)sockindex; /* unused */ + (void)eos; /* unused */ num = RTMP_Write(r, (char *)buf, curlx_uztosi(len)); if(num < 0) @@ -335,4 +344,20 @@ static ssize_t rtmp_send(struct Curl_easy *data, int sockindex, return num; } + +void Curl_rtmp_version(char *version, size_t len) +{ + char suff[2]; + if(RTMP_LIB_VERSION & 0xff) { + suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1; + suff[1] = '\0'; + } + else + suff[0] = '\0'; + + msnprintf(version, len, "librtmp/%d.%d%s", + RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, + suff); +} + #endif /* USE_LIBRTMP */ diff --git a/deps/curl/lib/curl_rtmp.h b/deps/curl/lib/curl_rtmp.h index 9b93ee06..339d3a43 100644 --- a/deps/curl/lib/curl_rtmp.h +++ b/deps/curl/lib/curl_rtmp.h @@ -30,6 +30,8 @@ extern const struct Curl_handler Curl_handler_rtmpe; extern const struct Curl_handler Curl_handler_rtmpte; extern const struct Curl_handler Curl_handler_rtmps; extern const struct Curl_handler Curl_handler_rtmpts; + +void Curl_rtmp_version(char *version, size_t len); #endif #endif /* HEADER_CURL_RTMP_H */ diff --git a/deps/curl/lib/curl_sasl.c b/deps/curl/lib/curl_sasl.c index 66639cba..24f8c8c5 100644 --- a/deps/curl/lib/curl_sasl.c +++ b/deps/curl/lib/curl_sasl.c @@ -328,7 +328,7 @@ bool Curl_sasl_can_authenticate(struct SASL *sasl, struct Curl_easy *data) if(data->state.aptr.user) return TRUE; - /* EXTERNAL can authenticate without a user name and/or password */ + /* EXTERNAL can authenticate without a username and/or password */ if(sasl->authmechs & sasl->prefmech & SASL_MECH_EXTERNAL) return TRUE; @@ -376,7 +376,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data, sasl->authused = SASL_MECH_EXTERNAL; if(force_ir || data->set.sasl_ir) - result = Curl_auth_create_external_message(conn->user, &resp); + Curl_auth_create_external_message(conn->user, &resp); } else if(data->state.aptr.user) { #if defined(USE_KERBEROS5) @@ -498,7 +498,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data, sasl->authused = SASL_MECH_LOGIN; if(force_ir || data->set.sasl_ir) - result = Curl_auth_create_login_message(conn->user, &resp); + Curl_auth_create_login_message(conn->user, &resp); } } @@ -576,14 +576,14 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, conn->user, conn->passwd, &resp); break; case SASL_LOGIN: - result = Curl_auth_create_login_message(conn->user, &resp); + Curl_auth_create_login_message(conn->user, &resp); newstate = SASL_LOGIN_PASSWD; break; case SASL_LOGIN_PASSWD: - result = Curl_auth_create_login_message(conn->passwd, &resp); + Curl_auth_create_login_message(conn->passwd, &resp); break; case SASL_EXTERNAL: - result = Curl_auth_create_external_message(conn->user, &resp); + Curl_auth_create_external_message(conn->user, &resp); break; #ifdef USE_GSASL case SASL_GSASL: diff --git a/deps/curl/lib/curl_setup.h b/deps/curl/lib/curl_setup.h index 286acc37..cfab1408 100644 --- a/deps/curl/lib/curl_setup.h +++ b/deps/curl/lib/curl_setup.h @@ -28,9 +28,12 @@ #define CURL_NO_OLDIES #endif +/* Tell "curl/curl.h" not to include "curl/mprintf.h" */ +#define CURL_SKIP_INCLUDE_MPRINTF + /* FIXME: Delete this once the warnings have been fixed. */ #if !defined(CURL_WARN_SIGN_CONVERSION) -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic ignored "-Wsign-conversion" #endif #endif @@ -40,6 +43,45 @@ #include <_mingw.h> #endif +/* Workaround for Homebrew gcc 12.4.0, 13.3.0, 14.1.0 and newer (as of 14.1.0) + that started advertising the `availability` attribute, which then gets used + by Apple SDK, but, in a way incompatible with gcc, resulting in misc errors + inside SDK headers, e.g.: + error: attributes should be specified before the declarator in a function + definition + error: expected ',' or '}' before + Followed by missing declarations. + Fix it by overriding the built-in feature-check macro used by the headers + to enable the problematic attributes. This makes the feature check fail. */ +#if defined(__APPLE__) && \ + !defined(__clang__) && \ + defined(__GNUC__) && __GNUC__ >= 12 && \ + defined(__has_attribute) +#define availability curl_pp_attribute_disabled +#endif + +#if defined(__APPLE__) +#include +#include +/* Fixup faulty target macro initialization in macOS SDK since v14.4 (as of + 15.0 beta). The SDK target detection in `TargetConditionals.h` correctly + detects macOS, but fails to set the macro's old name `TARGET_OS_OSX`, then + continues to set it to a default value of 0. Other parts of the SDK still + rely on the old name, and with this inconsistency our builds fail due to + missing declarations. It happens when using mainline llvm older than v18. + Later versions fixed it by predefining these target macros, avoiding the + faulty dynamic detection. gcc is not affected (for now) because it lacks + the necessary dynamic detection features, so the SDK falls back to + a codepath that sets both the old and new macro to 1. */ +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC && \ + defined(TARGET_OS_OSX) && !TARGET_OS_OSX && \ + (!defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE) && \ + (!defined(TARGET_OS_SIMULATOR) || !TARGET_OS_SIMULATOR) +#undef TARGET_OS_OSX +#define TARGET_OS_OSX TARGET_OS_MAC +#endif +#endif + /* * Disable Visual Studio warnings: * 4127 "conditional expression is constant" @@ -50,7 +92,7 @@ #ifdef _WIN32 /* - * Don't include unneeded stuff in Windows headers to avoid compiler + * Do not include unneeded stuff in Windows headers to avoid compiler * warnings and macro clashes. * Make sure to define this macro before including any Windows headers. */ @@ -67,11 +109,16 @@ # include # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# define CURL_WINDOWS_APP +# define CURL_WINDOWS_UWP # endif # endif #endif +/* Compatibility */ +#if defined(ENABLE_IPV6) +# define USE_IPV6 1 +#endif + /* * Include configuration script results or hand-crafted * configuration file for platforms which lack config tool. @@ -161,6 +208,11 @@ /* please, do it beyond the point further indicated in this file. */ /* ================================================================ */ +/* Give calloc a chance to be dragging in early, so we do not redefine */ +#if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) +# include +#endif + /* * Disable other protocols when http is the only one desired. */ @@ -275,7 +327,7 @@ /* curl uses its own printf() function internally. It understands the GNU * format. Use this format, so that is matches the GNU format attribute we - * use with the mingw compiler, allowing it to verify them at compile-time. + * use with the MinGW compiler, allowing it to verify them at compile-time. */ #ifdef __MINGW32__ # undef CURL_FORMAT_CURL_OFF_T @@ -286,7 +338,8 @@ /* based on logic in "curl/mprintf.h" */ -#if (defined(__GNUC__) || defined(__clang__)) && \ +#if (defined(__GNUC__) || defined(__clang__) || \ + defined(__IAR_SYSTEMS_ICC__)) && \ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ !defined(CURL_NO_FMT_CHECKS) #if defined(__MINGW32__) && !defined(__clang__) @@ -300,16 +353,31 @@ #define CURL_PRINTF(fmt, arg) #endif +/* Override default printf mask check rules in "curl/mprintf.h" */ +#define CURL_TEMP_PRINTF CURL_PRINTF + +/* Workaround for mainline llvm v16 and earlier missing a built-in macro + expected by macOS SDK v14 / Xcode v15 (2023) and newer. + gcc (as of v14) is also missing it. */ +#if defined(__APPLE__) && \ + ((!defined(__apple_build_version__) && \ + defined(__clang__) && __clang_major__ < 17) || \ + (defined(__GNUC__) && __GNUC__ <= 14)) && \ + defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ + !defined(__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__) +#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ \ + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +#endif + /* * Use getaddrinfo to resolve the IPv4 address literal. If the current network - * interface doesn't support IPv4, but supports IPv6, NAT64, and DNS64, + * interface does not support IPv4, but supports IPv6, NAT64, and DNS64, * performing this task will result in a synthesized IPv6 address. */ #if defined(__APPLE__) && !defined(USE_ARES) -#include #define USE_RESOLVE_ON_IPS 1 # if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && \ - defined(ENABLE_IPV6) + defined(USE_IPV6) # define CURL_MACOS_CALL_COPYPROXIES 1 # endif #endif @@ -387,7 +455,7 @@ #endif /* - * Large file (>2Gb) support using WIN32 functions. + * Large file (>2Gb) support using Win32 functions. */ #ifdef USE_WIN32_LARGE_FILES @@ -404,15 +472,13 @@ # define LSEEK_ERROR (__int64)-1 # define open curlx_win32_open # define fopen(fname,mode) curlx_win32_fopen(fname, mode) -# define access(fname,mode) curlx_win32_access(fname, mode) int curlx_win32_open(const char *filename, int oflag, ...); int curlx_win32_stat(const char *path, struct_stat *buffer); FILE *curlx_win32_fopen(const char *filename, const char *mode); - int curlx_win32_access(const char *path, int mode); #endif /* - * Small file (<2Gb) support using WIN32 functions. + * Small file (<2Gb) support using Win32 functions. */ #ifdef USE_WIN32_SMALL_FILES @@ -427,11 +493,9 @@ # define struct_stat struct _stat # define open curlx_win32_open # define fopen(fname,mode) curlx_win32_fopen(fname, mode) -# define access(fname,mode) curlx_win32_access(fname, mode) int curlx_win32_stat(const char *path, struct_stat *buffer); int curlx_win32_open(const char *filename, int oflag, ...); FILE *curlx_win32_fopen(const char *filename, const char *mode); - int curlx_win32_access(const char *path, int mode); # endif # define LSEEK_ERROR (long)-1 #endif @@ -445,7 +509,7 @@ #endif #ifndef SIZEOF_TIME_T -/* assume default size of time_t to be 32 bit */ +/* assume default size of time_t to be 32 bits */ #define SIZEOF_TIME_T 4 #endif @@ -460,15 +524,15 @@ #endif #if SIZEOF_CURL_SOCKET_T < 8 -# define CURL_FORMAT_SOCKET_T "d" +# define FMT_SOCKET_T "d" #elif defined(__MINGW32__) -# define CURL_FORMAT_SOCKET_T "zd" +# define FMT_SOCKET_T "zd" #else -# define CURL_FORMAT_SOCKET_T "qd" +# define FMT_SOCKET_T "qd" #endif /* - * Default sizeof(off_t) in case it hasn't been defined in config file. + * Default sizeof(off_t) in case it has not been defined in config file. */ #ifndef SIZEOF_OFF_T @@ -506,13 +570,19 @@ # 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 + #if (SIZEOF_TIME_T == 4) # ifdef HAVE_TIME_T_UNSIGNED # define TIME_T_MAX UINT_MAX @@ -532,7 +602,7 @@ #endif #ifndef SIZE_T_MAX -/* some limits.h headers have this defined, some don't */ +/* some limits.h headers have this defined, some do not */ #if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4) #define SIZE_T_MAX 18446744073709551615U #else @@ -541,7 +611,7 @@ #endif #ifndef SSIZE_T_MAX -/* some limits.h headers have this defined, some don't */ +/* some limits.h headers have this defined, some do not */ #if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4) #define SSIZE_T_MAX 9223372036854775807 #else @@ -550,7 +620,7 @@ #endif /* - * Arg 2 type for gethostname in case it hasn't been defined in config file. + * Arg 2 type for gethostname in case it has not been defined in config file. */ #ifndef GETHOSTNAME_TYPE_ARG2 @@ -617,9 +687,9 @@ * Mutually exclusive CURLRES_* definitions. */ -#if defined(ENABLE_IPV6) && defined(HAVE_GETADDRINFO) +#if defined(USE_IPV6) && defined(HAVE_GETADDRINFO) # define CURLRES_IPV6 -#elif defined(ENABLE_IPV6) && (defined(_WIN32) || defined(__CYGWIN__)) +#elif defined(USE_IPV6) && (defined(_WIN32) || defined(__CYGWIN__)) /* assume on Windows that IPv6 without getaddrinfo is a broken build */ # error "Unexpected build: IPv6 is enabled but getaddrinfo was not found." #else @@ -641,13 +711,14 @@ /* ---------------------------------------------------------------- */ -#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H) && !defined(USE_WIN32_IDN) +#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H) && \ + !defined(USE_WIN32_IDN) && !defined(USE_APPLE_IDN) /* The lib and header are present */ #define USE_LIBIDN2 #endif -#if defined(USE_LIBIDN2) && defined(USE_WIN32_IDN) -#error "Both libidn2 and WinIDN are enabled, choose one." +#if defined(USE_LIBIDN2) && (defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN)) +#error "libidn2 cannot be enabled with WinIDN or AppleIDN, choose one." #endif #define LIBIDN_REQUIRED_VERSION "0.4.1" @@ -658,6 +729,11 @@ #define USE_SSL /* SSL support has been enabled */ #endif +#if defined(USE_WOLFSSL) && defined(USE_GNUTLS) +/* Avoid defining unprefixed wolfSSL SHA macros colliding with nettle ones */ +#define NO_OLD_WC_NAMES +#endif + /* Single point where USE_SPNEGO definition might be defined */ #if !defined(CURL_DISABLE_NEGOTIATE_AUTH) && \ (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)) @@ -701,6 +777,13 @@ ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) # define UNUSED_PARAM __attribute__((__unused__)) # define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#elif defined(__IAR_SYSTEMS_ICC__) +# define UNUSED_PARAM __attribute__((__unused__)) +# if (__VER__ >= 9040001) +# define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define WARN_UNUSED_RESULT +# endif #else # define UNUSED_PARAM /* NOTHING */ # define WARN_UNUSED_RESULT @@ -709,7 +792,8 @@ /* noreturn attribute */ #if !defined(CURL_NORETURN) -#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__clang__) +#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__clang__) || \ + defined(__IAR_SYSTEMS_ICC__) # define CURL_NORETURN __attribute__((__noreturn__)) #elif defined(_MSC_VER) && (_MSC_VER >= 1200) # define CURL_NORETURN __declspec(noreturn) @@ -751,12 +835,12 @@ #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!" +# error "Winsock and lwIP TCP/IP stack definitions shall not coexist!" # endif #endif /* - * shutdown() flags for systems that don't define them + * shutdown() flags for systems that do not define them */ #ifndef SHUT_RD @@ -789,7 +873,7 @@ Therefore we specify it explicitly. https://github.com/curl/curl/pull/258 #define FOPEN_WRITETEXT "wt" #define FOPEN_APPENDTEXT "at" #elif defined(__CYGWIN__) -/* Cygwin has specific behavior we need to address when WIN32 is not defined. +/* Cygwin has specific behavior we need to address when _WIN32 is not defined. https://cygwin.com/cygwin-ug-net/using-textbinary.html For write we want our output to have line endings of LF and be compatible with other Cygwin utilities. For read we want to handle input that may have line @@ -804,7 +888,7 @@ endings either CRLF or LF so 't' is appropriate. #define FOPEN_APPENDTEXT "a" #endif -/* for systems that don't detect this in configure */ +/* for systems that do not detect this in configure */ #ifndef CURL_SA_FAMILY_T # if defined(HAVE_SA_FAMILY_T) # define CURL_SA_FAMILY_T sa_family_t @@ -833,7 +917,7 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result); #endif -#ifdef DEBUGBUILD +#ifdef UNITTESTS #define UNITTEST #else #define UNITTEST static @@ -852,7 +936,6 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, #error "Multi-SSL combined with QUIC is not supported" #endif -#define ENABLE_QUIC #define USE_HTTP3 #endif @@ -883,4 +966,26 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, #define OPENSSL_SUPPRESS_DEPRECATED #endif +#if defined(inline) + /* 'inline' is defined as macro and assumed to be correct */ + /* No need for 'inline' replacement */ +#elif defined(__cplusplus) + /* The code is compiled with C++ compiler. + C++ always supports 'inline'. */ + /* No need for 'inline' replacement */ +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 + /* C99 (and later) supports 'inline' keyword */ + /* No need for 'inline' replacement */ +#elif defined(__GNUC__) && __GNUC__ >= 3 + /* GCC supports '__inline__' as an extension */ +# define inline __inline__ +#elif defined(_MSC_VER) && _MSC_VER >= 1400 + /* MSC supports '__inline' from VS 2005 (or even earlier) */ +# define inline __inline +#else + /* Probably 'inline' is not supported by compiler. + Define to the empty string to be on the safe side. */ +# define inline /* empty */ +#endif + #endif /* HEADER_CURL_SETUP_H */ diff --git a/deps/curl/lib/curl_setup_once.h b/deps/curl/lib/curl_setup_once.h index bf0ee663..1521e69f 100644 --- a/deps/curl/lib/curl_setup_once.h +++ b/deps/curl/lib/curl_setup_once.h @@ -106,7 +106,7 @@ #endif /* - * Definition of timeval struct for platforms that don't have it. + * Definition of timeval struct for platforms that do not have it. */ #ifndef HAVE_STRUCT_TIMEVAL @@ -130,7 +130,7 @@ struct timeval { #if defined(__minix) -/* Minix doesn't support recv on TCP sockets */ +/* 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)) @@ -143,7 +143,7 @@ struct timeval { * * HAVE_RECV is defined if you have a function named recv() * which is used to read incoming data from sockets. If your - * function has another name then don't define HAVE_RECV. + * function has another name then do not define HAVE_RECV. * * If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2, * RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also @@ -151,7 +151,7 @@ struct timeval { * * HAVE_SEND is defined if you have a function named send() * which is used to write outgoing data on a connected socket. - * If yours has another name then don't define HAVE_SEND. + * If yours has another name then do not define HAVE_SEND. * * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2, * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and @@ -164,15 +164,13 @@ struct timeval { (RECV_TYPE_ARG4)(0)) #else /* HAVE_RECV */ #ifndef sread - /* */ - Error Missing_definition_of_macro_sread - /* */ +#error "Missing definition of macro sread!" #endif #endif /* HAVE_RECV */ #if defined(__minix) -/* Minix doesn't support send on TCP sockets */ +/* Minix does not support send on TCP sockets */ #define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \ (SEND_TYPE_ARG2)(y), \ (SEND_TYPE_ARG3)(z)) @@ -184,9 +182,7 @@ struct timeval { (SEND_TYPE_ARG4)(SEND_4TH_ARG)) #else /* HAVE_SEND */ #ifndef swrite - /* */ - Error Missing_definition_of_macro_swrite - /* */ +#error "Missing definition of macro swrite!" #endif #endif /* HAVE_SEND */ @@ -230,7 +226,7 @@ struct timeval { /* * 'bool' exists on platforms with , i.e. C99 platforms. - * On non-C99 platforms there's no bool, so define an enum for that. + * 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. */ @@ -242,7 +238,7 @@ struct timeval { } bool; /* - * Use a define to let 'true' and 'false' use those enums. There + * Use a define to let 'true' and 'false' use those enums. There * are currently no use of true and false in libcurl proper, but * there are some in the examples. This will cater for any later * code happening to use true and false. diff --git a/deps/curl/lib/curl_sha256.h b/deps/curl/lib/curl_sha256.h index d99f958f..00e5b74c 100644 --- a/deps/curl/lib/curl_sha256.h +++ b/deps/curl/lib/curl_sha256.h @@ -31,15 +31,10 @@ #include #include "curl_hmac.h" -extern const struct HMAC_params Curl_HMAC_SHA256[1]; +extern const struct HMAC_params Curl_HMAC_SHA256; -#ifdef USE_WOLFSSL -/* SHA256_DIGEST_LENGTH is an enum value in wolfSSL. Need to import it from - * sha.h */ -#include -#include -#else -#define SHA256_DIGEST_LENGTH 32 +#ifndef CURL_SHA256_DIGEST_LENGTH +#define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */ #endif CURLcode Curl_sha256it(unsigned char *outbuffer, const unsigned char *input, diff --git a/deps/curl/lib/curl_sha512_256.c b/deps/curl/lib/curl_sha512_256.c index 1dd07dbc..80fd8cf1 100644 --- a/deps/curl/lib/curl_sha512_256.c +++ b/deps/curl/lib/curl_sha512_256.c @@ -34,17 +34,17 @@ * * GnuTLS * * wolfSSL * * Schannel SSPI - * * SecureTransport (Darwin) + * * Secure Transport (Darwin) * * mbedTLS * * BearSSL - * * rustls + * * Rustls * Skip the backend if it does not support the required algorithm */ #if defined(USE_OPENSSL) # include # if (!defined(LIBRESSL_VERSION_NUMBER) && \ defined(OPENSSL_VERSION_NUMBER) && \ - (OPENSSL_VERSION_NUMBER >= 0x10100010L)) || \ + (OPENSSL_VERSION_NUMBER >= 0x10101000L)) || \ (defined(LIBRESSL_VERSION_NUMBER) && \ (LIBRESSL_VERSION_NUMBER >= 0x3080000fL)) # include @@ -52,6 +52,27 @@ # include # define USE_OPENSSL_SHA512_256 1 # define HAS_SHA512_256_IMPLEMENTATION 1 +# ifdef __NetBSD__ +/* Some NetBSD versions has a bug in SHA-512/256. + * See https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58039 + * The problematic versions: + * - NetBSD before 9.4 + * - NetBSD 9 all development versions (9.99.x) + * - NetBSD 10 development versions (10.99.x) before 10.99.11 + * The bug was fixed in NetBSD 9.4 release, NetBSD 10.0 release, + * NetBSD 10.99.11 development. + * It is safe to apply the workaround even if the bug is not present, as + * the workaround just reduces performance slightly. */ +# include +# if __NetBSD_Version__ < 904000000 || \ + (__NetBSD_Version__ >= 999000000 && \ + __NetBSD_Version__ < 1000000000) || \ + (__NetBSD_Version__ >= 1099000000 && \ + __NetBSD_Version__ < 1099001100) +# define NEED_NETBSD_SHA512_256_WORKAROUND 1 +# include +# endif +# endif # endif # endif #endif /* USE_OPENSSL */ @@ -72,13 +93,13 @@ /** * Size of the SHA-512/256 single processing block in bytes. */ -#define SHA512_256_BLOCK_SIZE 128 +#define CURL_SHA512_256_BLOCK_SIZE 128 /** * Size of the SHA-512/256 resulting digest in bytes. * This is the final digest size, not intermediate hash. */ -#define SHA512_256_DIGEST_SIZE SHA512_256_DIGEST_LENGTH +#define CURL_SHA512_256_DIGEST_SIZE CURL_SHA512_256_DIGEST_LENGTH /** * Context type used for SHA-512/256 calculations @@ -103,9 +124,9 @@ Curl_sha512_256_init(void *context) if(EVP_DigestInit_ex(*ctx, EVP_sha512_256(), NULL)) { /* Check whether the header and this file use the same numbers */ - DEBUGASSERT(EVP_MD_CTX_size(*ctx) == SHA512_256_DIGEST_SIZE); + DEBUGASSERT(EVP_MD_CTX_size(*ctx) == CURL_SHA512_256_DIGEST_SIZE); /* Check whether the block size is correct */ - DEBUGASSERT(EVP_MD_CTX_block_size(*ctx) == SHA512_256_BLOCK_SIZE); + DEBUGASSERT(EVP_MD_CTX_block_size(*ctx) == CURL_SHA512_256_BLOCK_SIZE); return CURLE_OK; /* Success */ } @@ -142,7 +163,8 @@ Curl_sha512_256_update(void *context, * Finalise SHA-512/256 calculation, return digest. * * @param context the calculation context - * @param[out] digest set to the hash, must be #SHA512_256_DIGEST_SIZE bytes + * @param[out] digest set to the hash, must be #CURL_SHA512_256_DIGEST_SIZE + # bytes * @return CURLE_OK if succeed, * error code otherwise */ @@ -153,7 +175,18 @@ Curl_sha512_256_finish(unsigned char *digest, CURLcode ret; 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: + https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58039 */ + unsigned char tmp_digest[CURL_SHA512_256_DIGEST_SIZE * 2]; + ret = EVP_DigestFinal_ex(*ctx, + tmp_digest, NULL) ? CURLE_OK : CURLE_SSL_CIPHER; + if(ret == CURLE_OK) + memcpy(digest, tmp_digest, CURL_SHA512_256_DIGEST_SIZE); + explicit_memset(tmp_digest, 0, sizeof(tmp_digest)); +#else /* ! NEED_NETBSD_SHA512_256_WORKAROUND */ ret = EVP_DigestFinal_ex(*ctx, digest, NULL) ? CURLE_OK : CURLE_SSL_CIPHER; +#endif /* ! NEED_NETBSD_SHA512_256_WORKAROUND */ EVP_MD_CTX_destroy(*ctx); *ctx = NULL; @@ -163,6 +196,9 @@ Curl_sha512_256_finish(unsigned char *digest, #elif defined(USE_GNUTLS_SHA512_256) +#define CURL_SHA512_256_BLOCK_SIZE SHA512_256_BLOCK_SIZE +#define CURL_SHA512_256_DIGEST_SIZE SHA512_256_DIGEST_SIZE + /** * Context type used for SHA-512/256 calculations */ @@ -180,7 +216,7 @@ Curl_sha512_256_init(void *context) Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; /* Check whether the header and this file use the same numbers */ - DEBUGASSERT(SHA512_256_DIGEST_LENGTH == SHA512_256_DIGEST_SIZE); + DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE); sha512_256_init(ctx); @@ -215,7 +251,8 @@ Curl_sha512_256_update(void *context, * Finalise SHA-512/256 calculation, return digest. * * @param context the calculation context - * @param[out] digest set to the hash, must be #SHA512_256_DIGEST_SIZE bytes + * @param[out] digest set to the hash, must be #CURL_SHA512_256_DIGEST_SIZE + # bytes * @return always CURLE_OK */ static CURLcode @@ -224,7 +261,8 @@ Curl_sha512_256_finish(unsigned char *digest, { Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; - sha512_256_digest(ctx, (size_t)SHA512_256_DIGEST_SIZE, (uint8_t *)digest); + sha512_256_digest(ctx, + (size_t)CURL_SHA512_256_DIGEST_SIZE, (uint8_t *)digest); return CURLE_OK; } @@ -238,9 +276,9 @@ Curl_sha512_256_finish(unsigned char *digest, * ** written by Evgeny Grin (Karlson2k) for GNU libmicrohttpd. ** * * ** The author ported the code to libcurl. The ported code is provided ** * * ** under curl license. ** * - * ** This is a minimal version with minimal optimisations. Performance ** * + * ** This is a minimal version with minimal optimizations. Performance ** * * ** can be significantly improved. Big-endian store and load macros ** * - * ** are obvious targets for optimisation. ** */ + * ** are obvious targets for optimization. ** */ #ifdef __GNUC__ # if defined(__has_attribute) && defined(__STDC_VERSION__) @@ -254,29 +292,13 @@ Curl_sha512_256_finish(unsigned char *digest, defined(_MSC_VER) && !defined(__GNUC__) && !defined(__clang__) # if _MSC_VER >= 1400 # define MHDX_INLINE __forceinline -# else -# define MHDX_INLINE /* empty */ # endif #endif #if !defined(MHDX_INLINE) -# if defined(inline) - /* Assume that 'inline' macro was already defined correctly by - * the build system. */ -# define MHDX_INLINE inline -# elif defined(__cplusplus) - /* The code is compiled with C++ compiler. - * C++ always supports 'inline'. */ -# define MHDX_INLINE inline -# elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 - /* C99 (and later) supports 'inline' keyword */ -# define MHDX_INLINE inline -# elif defined(__GNUC__) && __GNUC__ >= 3 - /* GCC supports '__inline__' as an extension */ -# define MHDX_INLINE __inline__ -# else -# define MHDX_INLINE /* empty */ -# endif + /* Assume that 'inline' keyword works or the + * macro was already defined correctly. */ +# define MHDX_INLINE inline #endif /* Bits manipulation macros and functions. @@ -312,7 +334,7 @@ MHDx_rotr64(curl_uint64_t value, unsigned int bits) bits %= 64; if(0 == bits) return value; - /* Defined in a form which modern compiler could optimise. */ + /* Defined in a form which modern compiler could optimize. */ return (value >> bits) | (value << (64 - bits)); } @@ -344,7 +366,7 @@ MHDx_rotr64(curl_uint64_t value, unsigned int bits) * Size of the SHA-512/256 resulting digest in bytes * This is the final digest size, not intermediate hash. */ -#define SHA512_256_DIGEST_SIZE \ +#define CURL_SHA512_256_DIGEST_SIZE \ (SHA512_256_DIGEST_SIZE_WORDS * SHA512_256_BYTES_IN_WORD) /** @@ -355,7 +377,7 @@ MHDx_rotr64(curl_uint64_t value, unsigned int bits) /** * Size of the SHA-512/256 single processing block in bytes. */ -#define SHA512_256_BLOCK_SIZE (SHA512_256_BLOCK_SIZE_BITS / 8) +#define CURL_SHA512_256_BLOCK_SIZE (SHA512_256_BLOCK_SIZE_BITS / 8) /** * Size of the SHA-512/256 single processing block in words. @@ -409,7 +431,7 @@ MHDx_sha512_256_init(void *context) struct mhdx_sha512_256ctx *const ctx = (struct mhdx_sha512_256ctx *) context; /* Check whether the header and this file use the same numbers */ - DEBUGASSERT(SHA512_256_DIGEST_LENGTH == SHA512_256_DIGEST_SIZE); + DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE); DEBUGASSERT(sizeof(curl_uint64_t) == 8); @@ -437,7 +459,7 @@ MHDx_sha512_256_init(void *context) * 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 #SHA512_256_BLOCK_SIZE bytes block + * @param data the data buffer with #CURL_SHA512_256_BLOCK_SIZE bytes block */ static void MHDx_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], @@ -458,10 +480,10 @@ MHDx_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], See FIPS PUB 180-4 section 5.2.2, 6.7, 6.4. */ curl_uint64_t W[16]; - /* 'Ch' and 'Maj' macro functions are defined with widely-used optimisation. + /* 'Ch' and 'Maj' macro functions are defined with widely-used optimization. See FIPS PUB 180-4 formulae 4.8, 4.9. */ -#define Ch(x,y,z) ( (z) ^ ((x) & ((y) ^ (z))) ) -#define 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. */ @@ -531,9 +553,9 @@ MHDx_sha512_256_transform(curl_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)) + Ch ((vE),(vF),(vG)) + (kt) + (wt)); \ - (vH) += SIG0 ((vA)) + 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 @@ -620,9 +642,9 @@ MHDx_sha512_256_update(void *context, if(0 == length) return CURLE_OK; /* Shortcut, do nothing */ - /* Note: (count & (SHA512_256_BLOCK_SIZE-1)) - equals (count % SHA512_256_BLOCK_SIZE) for this block size. */ - bytes_have = (unsigned int) (ctx->count & (SHA512_256_BLOCK_SIZE - 1)); + /* 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)); ctx->count += length; if(length > ctx->count) ctx->count_bits_hi += 1U << 3; /* Value wrap */ @@ -630,7 +652,7 @@ MHDx_sha512_256_update(void *context, ctx->count &= CURL_UINT64_C(0x1FFFFFFFFFFFFFFF); if(0 != bytes_have) { - unsigned int bytes_left = SHA512_256_BLOCK_SIZE - bytes_have; + unsigned int bytes_left = CURL_SHA512_256_BLOCK_SIZE - bytes_have; if(length >= bytes_left) { /* Combine new data with data in the buffer and process the full block. */ @@ -644,12 +666,12 @@ MHDx_sha512_256_update(void *context, } } - while(SHA512_256_BLOCK_SIZE <= length) { + while(CURL_SHA512_256_BLOCK_SIZE <= length) { /* Process any full blocks of new data directly, without copying to the buffer. */ MHDx_sha512_256_transform(ctx->H, data); - data += SHA512_256_BLOCK_SIZE; - length -= SHA512_256_BLOCK_SIZE; + data += CURL_SHA512_256_BLOCK_SIZE; + length -= CURL_SHA512_256_BLOCK_SIZE; } if(0 != length) { @@ -678,7 +700,8 @@ MHDx_sha512_256_update(void *context, * Finalise SHA-512/256 calculation, return digest. * * @param context the calculation context - * @param[out] digest set to the hash, must be #SHA512_256_DIGEST_SIZE bytes + * @param[out] digest set to the hash, must be #CURL_SHA512_256_DIGEST_SIZE + # bytes * @return always CURLE_OK */ static CURLcode @@ -696,9 +719,9 @@ MHDx_sha512_256_finish(unsigned char *digest, not change the amount of hashed data. */ num_bits = ctx->count << 3; - /* Note: (count & (SHA512_256_BLOCK_SIZE-1)) - equals (count % SHA512_256_BLOCK_SIZE) for this block size. */ - bytes_have = (unsigned int) (ctx->count & (SHA512_256_BLOCK_SIZE - 1)); + /* 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)); /* 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 @@ -712,12 +735,12 @@ MHDx_sha512_256_finish(unsigned char *digest, processed when formed). */ ((unsigned char *) ctx_buf)[bytes_have++] = 0x80U; - if(SHA512_256_BLOCK_SIZE - bytes_have < SHA512_256_SIZE_OF_LEN_ADD) { + 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 < SHA512_256_BLOCK_SIZE) + if(bytes_have < CURL_SHA512_256_BLOCK_SIZE) memset(((unsigned char *) ctx_buf) + bytes_have, 0, - SHA512_256_BLOCK_SIZE - bytes_have); + CURL_SHA512_256_BLOCK_SIZE - bytes_have); /* Process the full block. */ MHDx_sha512_256_transform(ctx->H, ctx->buffer); /* Start the new block. */ @@ -726,17 +749,17 @@ MHDx_sha512_256_finish(unsigned char *digest, /* Pad the rest of the buffer with zeros. */ memset(((unsigned char *) ctx_buf) + bytes_have, 0, - SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD - bytes_have); + 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 */ MHDX_PUT_64BIT_BE(((unsigned char *) ctx_buf) \ - + SHA512_256_BLOCK_SIZE \ + + CURL_SHA512_256_BLOCK_SIZE \ - SHA512_256_SIZE_OF_LEN_ADD, \ ctx->count_bits_hi); MHDX_PUT_64BIT_BE(((unsigned char *) ctx_buf) \ - + SHA512_256_BLOCK_SIZE \ + + CURL_SHA512_256_BLOCK_SIZE \ - SHA512_256_SIZE_OF_LEN_ADD \ + SHA512_256_BYTES_IN_WORD, \ num_bits); @@ -825,9 +848,9 @@ const struct HMAC_params Curl_HMAC_SHA512_256[] = { /* Context structure size. */ sizeof(Curl_sha512_256_ctx), /* Maximum key length (bytes). */ - SHA512_256_BLOCK_SIZE, + CURL_SHA512_256_BLOCK_SIZE, /* Result length (bytes). */ - SHA512_256_DIGEST_SIZE + CURL_SHA512_256_DIGEST_SIZE } }; diff --git a/deps/curl/lib/curl_sha512_256.h b/deps/curl/lib/curl_sha512_256.h index 30a9f140..a84e77bc 100644 --- a/deps/curl/lib/curl_sha512_256.h +++ b/deps/curl/lib/curl_sha512_256.h @@ -33,7 +33,7 @@ extern const struct HMAC_params Curl_HMAC_SHA512_256[1]; -#define SHA512_256_DIGEST_LENGTH 32 +#define CURL_SHA512_256_DIGEST_LENGTH 32 CURLcode Curl_sha512_256it(unsigned char *output, const unsigned char *input, diff --git a/deps/curl/lib/curl_sspi.c b/deps/curl/lib/curl_sspi.c index eb21e7e2..680bb661 100644 --- a/deps/curl/lib/curl_sspi.c +++ b/deps/curl/lib/curl_sspi.c @@ -52,10 +52,10 @@ typedef PSecurityFunctionTable (APIENTRY *INITSECURITYINTERFACE_FN)(VOID); #endif /* Handle of security.dll or secur32.dll, depending on Windows version */ -HMODULE s_hSecDll = NULL; +HMODULE Curl_hSecDll = NULL; /* Pointer to SSPI dispatch table */ -PSecurityFunctionTable s_pSecFn = NULL; +PSecurityFunctionTable Curl_pSecFn = NULL; /* * Curl_sspi_global_init() @@ -79,29 +79,29 @@ CURLcode Curl_sspi_global_init(void) INITSECURITYINTERFACE_FN pInitSecurityInterface; /* If security interface is not yet initialized try to do this */ - if(!s_hSecDll) { + if(!Curl_hSecDll) { /* Security Service Provider Interface (SSPI) functions are located in * security.dll on WinNT 4.0 and in secur32.dll on Win9x. Win2K and XP * have both these DLLs (security.dll forwards calls to secur32.dll) */ /* Load SSPI dll into the address space of the calling process */ if(curlx_verify_windows_version(4, 0, 0, PLATFORM_WINNT, VERSION_EQUAL)) - s_hSecDll = Curl_load_library(TEXT("security.dll")); + Curl_hSecDll = Curl_load_library(TEXT("security.dll")); else - s_hSecDll = Curl_load_library(TEXT("secur32.dll")); - if(!s_hSecDll) + Curl_hSecDll = Curl_load_library(TEXT("secur32.dll")); + if(!Curl_hSecDll) return CURLE_FAILED_INIT; /* Get address of the InitSecurityInterfaceA function from the SSPI dll */ pInitSecurityInterface = CURLX_FUNCTION_CAST(INITSECURITYINTERFACE_FN, - (GetProcAddress(s_hSecDll, SECURITYENTRYPOINT))); + (GetProcAddress(Curl_hSecDll, SECURITYENTRYPOINT))); if(!pInitSecurityInterface) return CURLE_FAILED_INIT; /* Get pointer to Security Service Provider Interface dispatch table */ - s_pSecFn = pInitSecurityInterface(); - if(!s_pSecFn) + Curl_pSecFn = pInitSecurityInterface(); + if(!Curl_pSecFn) return CURLE_FAILED_INIT; } @@ -119,10 +119,10 @@ CURLcode Curl_sspi_global_init(void) */ void Curl_sspi_global_cleanup(void) { - if(s_hSecDll) { - FreeLibrary(s_hSecDll); - s_hSecDll = NULL; - s_pSecFn = NULL; + if(Curl_hSecDll) { + FreeLibrary(Curl_hSecDll); + Curl_hSecDll = NULL; + Curl_pSecFn = NULL; } } @@ -134,7 +134,7 @@ void Curl_sspi_global_cleanup(void) * * Parameters: * - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * identity [in/out] - The identity structure. * diff --git a/deps/curl/lib/curl_sspi.h b/deps/curl/lib/curl_sspi.h index b26c3915..535a1ff6 100644 --- a/deps/curl/lib/curl_sspi.h +++ b/deps/curl/lib/curl_sspi.h @@ -57,8 +57,8 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp, void Curl_sspi_free_identity(SEC_WINNT_AUTH_IDENTITY *identity); /* Forward-declaration of global variables defined in curl_sspi.c */ -extern HMODULE s_hSecDll; -extern PSecurityFunctionTable s_pSecFn; +extern HMODULE Curl_hSecDll; +extern PSecurityFunctionTable Curl_pSecFn; /* Provide some definitions missing in old headers */ #define SP_NAME_DIGEST "WDigest" diff --git a/deps/curl/lib/curl_threads.c b/deps/curl/lib/curl_threads.c index 222d9364..fbbbf9b2 100644 --- a/deps/curl/lib/curl_threads.c +++ b/deps/curl/lib/curl_threads.c @@ -35,7 +35,9 @@ #endif #include "curl_threads.h" +#ifdef BUILDING_LIBCURL #include "curl_memory.h" +#endif /* The last #include file should be: */ #include "memdebug.h" @@ -100,18 +102,23 @@ int Curl_thread_join(curl_thread_t *hnd) #elif defined(USE_THREADS_WIN32) -/* !checksrc! disable SPACEBEFOREPAREN 1 */ -curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *), +curl_thread_t Curl_thread_create( +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) + DWORD +#else + unsigned int +#endif + (CURL_STDCALL *func) (void *), void *arg) { -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) typedef HANDLE curl_win_thread_handle_t; #else typedef uintptr_t curl_win_thread_handle_t; #endif curl_thread_t t; curl_win_thread_handle_t thread_handle; -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) thread_handle = CreateThread(NULL, 0, func, arg, 0, NULL); #else thread_handle = _beginthreadex(NULL, 0, func, arg, 0, NULL); @@ -131,7 +138,8 @@ curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *), void Curl_thread_destroy(curl_thread_t hnd) { - CloseHandle(hnd); + if(hnd != curl_thread_t_null) + CloseHandle(hnd); } int Curl_thread_join(curl_thread_t *hnd) diff --git a/deps/curl/lib/curl_threads.h b/deps/curl/lib/curl_threads.h index 27a478d4..c9f18a4e 100644 --- a/deps/curl/lib/curl_threads.h +++ b/deps/curl/lib/curl_threads.h @@ -52,8 +52,13 @@ #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) -/* !checksrc! disable SPACEBEFOREPAREN 1 */ -curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *), +curl_thread_t Curl_thread_create( +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) + DWORD +#else + unsigned int +#endif + (CURL_STDCALL *func) (void *), void *arg); void Curl_thread_destroy(curl_thread_t hnd); diff --git a/deps/curl/lib/curl_trc.c b/deps/curl/lib/curl_trc.c index fa6ad229..8f1be07e 100644 --- a/deps/curl/lib/curl_trc.c +++ b/deps/curl/lib/curl_trc.c @@ -53,6 +53,9 @@ #include "curl_memory.h" #include "memdebug.h" +#ifndef ARRAYSIZE +#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) +#endif void Curl_debug(struct Curl_easy *data, curl_infotype type, char *ptr, size_t size) @@ -62,7 +65,7 @@ void Curl_debug(struct Curl_easy *data, curl_infotype type, "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; if(data->set.fdebug) { bool inCallback = Curl_is_in_callback(data); - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); (void)(*data->set.fdebug)(data, type, ptr, size, data->set.debugdata); Curl_set_in_callback(data, inCallback); } @@ -111,21 +114,36 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...) /* Curl_infof() is for info message along the way */ #define MAXINFO 2048 +static void trc_infof(struct Curl_easy *data, struct curl_trc_feat *feat, + const char * const fmt, va_list ap) CURL_PRINTF(3, 0); + +static void trc_infof(struct Curl_easy *data, struct curl_trc_feat *feat, + const char * const fmt, va_list ap) +{ + int len = 0; + char buffer[MAXINFO + 5]; + if(feat) + len = msnprintf(buffer, (MAXINFO + 1), "[%s] ", feat->name); + len += mvsnprintf(buffer + len, (MAXINFO + 1) - len, fmt, ap); + if(len >= MAXINFO) { /* too long, shorten with '...' */ + --len; + buffer[len++] = '.'; + buffer[len++] = '.'; + buffer[len++] = '.'; + } + buffer[len++] = '\n'; + buffer[len] = '\0'; + Curl_debug(data, CURLINFO_TEXT, buffer, len); +} + void Curl_infof(struct Curl_easy *data, const char *fmt, ...) { DEBUGASSERT(!strchr(fmt, '\n')); if(Curl_trc_is_verbose(data)) { va_list ap; - int len = 0; - char buffer[MAXINFO + 2]; - if(data->state.feat) - len = msnprintf(buffer, MAXINFO, "[%s] ", data->state.feat->name); va_start(ap, fmt); - len += mvsnprintf(buffer + len, MAXINFO - len, fmt, ap); + trc_infof(data, data->state.feat, fmt, ap); va_end(ap); - buffer[len++] = '\n'; - buffer[len] = '\0'; - Curl_debug(data, CURLINFO_TEXT, buffer, len); } } @@ -154,53 +172,193 @@ void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf, } } -static struct curl_trc_feat *trc_feats[] = { -#ifndef CURL_DISABLE_DOH - &Curl_doh_trc, -#endif - NULL, +struct curl_trc_feat Curl_trc_feat_read = { + "READ", + CURL_LOG_LVL_NONE, +}; +struct curl_trc_feat Curl_trc_feat_write = { + "WRITE", + CURL_LOG_LVL_NONE, }; -static struct Curl_cftype *cf_types[] = { - &Curl_cft_tcp, - &Curl_cft_udp, - &Curl_cft_unix, - &Curl_cft_tcp_accept, - &Curl_cft_happy_eyeballs, - &Curl_cft_setup, +void Curl_trc_read(struct Curl_easy *data, const char *fmt, ...) +{ + DEBUGASSERT(!strchr(fmt, '\n')); + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) { + va_list ap; + va_start(ap, fmt); + trc_infof(data, &Curl_trc_feat_read, fmt, ap); + va_end(ap); + } +} + +void Curl_trc_write(struct Curl_easy *data, const char *fmt, ...) +{ + DEBUGASSERT(!strchr(fmt, '\n')); + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) { + va_list ap; + va_start(ap, fmt); + trc_infof(data, &Curl_trc_feat_write, fmt, ap); + va_end(ap); + } +} + +#ifndef CURL_DISABLE_FTP +struct curl_trc_feat Curl_trc_feat_ftp = { + "FTP", + CURL_LOG_LVL_NONE, +}; + +void Curl_trc_ftp(struct Curl_easy *data, const char *fmt, ...) +{ + DEBUGASSERT(!strchr(fmt, '\n')); + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) { + va_list ap; + va_start(ap, fmt); + trc_infof(data, &Curl_trc_feat_ftp, fmt, ap); + va_end(ap); + } +} +#endif /* !CURL_DISABLE_FTP */ + +#ifndef CURL_DISABLE_SMTP +struct curl_trc_feat Curl_trc_feat_smtp = { + "SMTP", + CURL_LOG_LVL_NONE, +}; + +void Curl_trc_smtp(struct Curl_easy *data, const char *fmt, ...) +{ + DEBUGASSERT(!strchr(fmt, '\n')); + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) { + va_list ap; + va_start(ap, fmt); + trc_infof(data, &Curl_trc_feat_smtp, fmt, ap); + va_end(ap); + } +} +#endif /* !CURL_DISABLE_SMTP */ + +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) +struct curl_trc_feat Curl_trc_feat_ws = { + "WS", + CURL_LOG_LVL_NONE, +}; + +void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...) +{ + DEBUGASSERT(!strchr(fmt, '\n')); + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) { + va_list ap; + va_start(ap, fmt); + trc_infof(data, &Curl_trc_feat_ws, fmt, ap); + va_end(ap); + } +} +#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */ + +#define TRC_CT_NONE (0) +#define TRC_CT_PROTOCOL (1<<(0)) +#define TRC_CT_NETWORK (1<<(1)) +#define TRC_CT_PROXY (1<<(2)) + +struct trc_feat_def { + struct curl_trc_feat *feat; + unsigned int category; +}; + +static struct trc_feat_def trc_feats[] = { + { &Curl_trc_feat_read, TRC_CT_NONE }, + { &Curl_trc_feat_write, TRC_CT_NONE }, +#ifndef CURL_DISABLE_FTP + { &Curl_trc_feat_ftp, TRC_CT_PROTOCOL }, +#endif +#ifndef CURL_DISABLE_DOH + { &Curl_doh_trc, TRC_CT_NETWORK }, +#endif +#ifndef CURL_DISABLE_SMTP + { &Curl_trc_feat_smtp, TRC_CT_PROTOCOL }, +#endif +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) + { &Curl_trc_feat_ws, TRC_CT_PROTOCOL }, +#endif +}; + +struct trc_cft_def { + struct Curl_cftype *cft; + unsigned int category; +}; + +static struct trc_cft_def trc_cfts[] = { + { &Curl_cft_tcp, TRC_CT_NETWORK }, + { &Curl_cft_udp, TRC_CT_NETWORK }, + { &Curl_cft_unix, TRC_CT_NETWORK }, + { &Curl_cft_tcp_accept, TRC_CT_NETWORK }, + { &Curl_cft_happy_eyeballs, TRC_CT_NETWORK }, + { &Curl_cft_setup, TRC_CT_PROTOCOL }, #ifdef USE_NGHTTP2 - &Curl_cft_nghttp2, + { &Curl_cft_nghttp2, TRC_CT_PROTOCOL }, #endif #ifdef USE_SSL - &Curl_cft_ssl, + { &Curl_cft_ssl, TRC_CT_NETWORK }, #ifndef CURL_DISABLE_PROXY - &Curl_cft_ssl_proxy, + { &Curl_cft_ssl_proxy, TRC_CT_PROXY }, #endif #endif #if !defined(CURL_DISABLE_PROXY) #if !defined(CURL_DISABLE_HTTP) - &Curl_cft_h1_proxy, + { &Curl_cft_h1_proxy, TRC_CT_PROXY }, #ifdef USE_NGHTTP2 - &Curl_cft_h2_proxy, + { &Curl_cft_h2_proxy, TRC_CT_PROXY }, #endif - &Curl_cft_http_proxy, + { &Curl_cft_http_proxy, TRC_CT_PROXY }, #endif /* !CURL_DISABLE_HTTP */ - &Curl_cft_haproxy, - &Curl_cft_socks_proxy, + { &Curl_cft_haproxy, TRC_CT_PROXY }, + { &Curl_cft_socks_proxy, TRC_CT_PROXY }, #endif /* !CURL_DISABLE_PROXY */ -#ifdef ENABLE_QUIC - &Curl_cft_http3, +#ifdef USE_HTTP3 + { &Curl_cft_http3, TRC_CT_PROTOCOL }, #endif #if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER) - &Curl_cft_http_connect, + { &Curl_cft_http_connect, TRC_CT_PROTOCOL }, #endif - NULL, }; -CURLcode Curl_trc_opt(const char *config) +static void trc_apply_level_by_name(const char * const token, int lvl) +{ + size_t i; + + for(i = 0; i < ARRAYSIZE(trc_cfts); ++i) { + if(strcasecompare(token, trc_cfts[i].cft->name)) { + trc_cfts[i].cft->log_level = lvl; + break; + } + } + for(i = 0; i < ARRAYSIZE(trc_feats); ++i) { + if(strcasecompare(token, trc_feats[i].feat->name)) { + trc_feats[i].feat->log_level = lvl; + break; + } + } +} + +static void trc_apply_level_by_category(int category, int lvl) +{ + size_t i; + + for(i = 0; i < ARRAYSIZE(trc_cfts); ++i) { + if(!category || (trc_cfts[i].category & category)) + trc_cfts[i].cft->log_level = lvl; + } + for(i = 0; i < ARRAYSIZE(trc_feats); ++i) { + if(!category || (trc_feats[i].category & category)) + trc_feats[i].feat->log_level = lvl; + } +} + +static CURLcode trc_opt(const char *config) { char *token, *tok_buf, *tmp; - size_t i; int lvl; tmp = strdup(config); @@ -222,42 +380,46 @@ CURLcode Curl_trc_opt(const char *config) lvl = CURL_LOG_LVL_INFO; break; } - for(i = 0; cf_types[i]; ++i) { - if(strcasecompare(token, "all")) { - cf_types[i]->log_level = lvl; - } - else if(strcasecompare(token, cf_types[i]->name)) { - cf_types[i]->log_level = lvl; - break; - } - } - for(i = 0; trc_feats[i]; ++i) { - if(strcasecompare(token, "all")) { - trc_feats[i]->log_level = lvl; - } - else if(strcasecompare(token, trc_feats[i]->name)) { - trc_feats[i]->log_level = lvl; - break; - } - } + if(strcasecompare(token, "all")) + trc_apply_level_by_category(TRC_CT_NONE, lvl); + else if(strcasecompare(token, "protocol")) + trc_apply_level_by_category(TRC_CT_PROTOCOL, lvl); + else if(strcasecompare(token, "network")) + trc_apply_level_by_category(TRC_CT_NETWORK, lvl); + else if(strcasecompare(token, "proxy")) + trc_apply_level_by_category(TRC_CT_PROXY, lvl); + else + trc_apply_level_by_name(token, lvl); + token = strtok_r(NULL, ", ", &tok_buf); } free(tmp); return CURLE_OK; } +CURLcode Curl_trc_opt(const char *config) +{ + CURLcode result = config ? trc_opt(config) : CURLE_OK; +#ifdef DEBUGBUILD + /* CURL_DEBUG can override anything */ + if(!result) { + const char *dbg_config = getenv("CURL_DEBUG"); + if(dbg_config) + result = trc_opt(dbg_config); + } +#endif /* DEBUGBUILD */ + return result; +} + CURLcode Curl_trc_init(void) { #ifdef DEBUGBUILD - /* WIP: we use the auto-init from an env var only in DEBUG builds for - * convenience. */ - const char *config = getenv("CURL_DEBUG"); - if(config) { - return Curl_trc_opt(config); - } -#endif /* DEBUGBUILD */ + return Curl_trc_opt(NULL); +#else return CURLE_OK; +#endif } + #else /* defined(CURL_DISABLE_VERBOSE_STRINGS) */ CURLcode Curl_trc_init(void) diff --git a/deps/curl/lib/curl_trc.h b/deps/curl/lib/curl_trc.h index 92b0533c..67a7f4aa 100644 --- a/deps/curl/lib/curl_trc.h +++ b/deps/curl/lib/curl_trc.h @@ -77,11 +77,47 @@ void Curl_failf(struct Curl_easy *data, #define CURL_TRC_CF(data, cf, ...) \ do { if(Curl_trc_cf_is_verbose(cf, data)) \ Curl_trc_cf_infof(data, cf, __VA_ARGS__); } while(0) +#define CURL_TRC_WRITE(data, ...) \ + do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \ + Curl_trc_write(data, __VA_ARGS__); } while(0) +#define CURL_TRC_READ(data, ...) \ + do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \ + Curl_trc_read(data, __VA_ARGS__); } while(0) + +#ifndef CURL_DISABLE_FTP +#define CURL_TRC_FTP(data, ...) \ + do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \ + Curl_trc_ftp(data, __VA_ARGS__); } while(0) +#endif /* !CURL_DISABLE_FTP */ +#ifndef CURL_DISABLE_SMTP +#define CURL_TRC_SMTP(data, ...) \ + do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) \ + Curl_trc_smtp(data, __VA_ARGS__); } while(0) +#endif /* !CURL_DISABLE_SMTP */ +#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)) \ + Curl_trc_ws(data, __VA_ARGS__); } while(0) +#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */ + +#else /* CURL_HAVE_C99 */ -#else #define infof Curl_infof #define CURL_TRC_CF Curl_trc_cf_infof +#define CURL_TRC_WRITE Curl_trc_write +#define CURL_TRC_READ Curl_trc_read + +#ifndef CURL_DISABLE_FTP +#define CURL_TRC_FTP Curl_trc_ftp #endif +#ifndef CURL_DISABLE_SMTP +#define CURL_TRC_SMTP Curl_trc_smtp +#endif +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) +#define CURL_TRC_WS Curl_trc_ws +#endif + +#endif /* !CURL_HAVE_C99 */ #ifndef CURL_DISABLE_VERBOSE_STRINGS /* informational messages enabled */ @@ -90,6 +126,8 @@ struct curl_trc_feat { const char *name; int log_level; }; +extern struct curl_trc_feat Curl_trc_feat_read; +extern struct curl_trc_feat Curl_trc_feat_write; #define Curl_trc_is_verbose(data) \ ((data) && (data)->set.verbose && \ @@ -97,10 +135,10 @@ struct curl_trc_feat { ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO))) #define Curl_trc_cf_is_verbose(cf, data) \ (Curl_trc_is_verbose(data) && \ - (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO) + (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO) #define Curl_trc_ft_is_verbose(data, ft) \ - (Curl_trc_is_verbose(data) && \ - (ft)->log_level >= CURL_LOG_LVL_INFO) + (Curl_trc_is_verbose(data) && \ + (ft)->log_level >= CURL_LOG_LVL_INFO) /** * Output an informational message when transfer's verbose logging is enabled. @@ -114,13 +152,34 @@ void Curl_infof(struct Curl_easy *data, */ void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf, const char *fmt, ...) CURL_PRINTF(3, 4); +void Curl_trc_write(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +void Curl_trc_read(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); + +#ifndef CURL_DISABLE_FTP +extern struct curl_trc_feat Curl_trc_feat_ftp; +void Curl_trc_ftp(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif +#ifndef CURL_DISABLE_SMTP +extern struct curl_trc_feat Curl_trc_feat_smtp; +void Curl_trc_smtp(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, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif + #else /* defined(CURL_DISABLE_VERBOSE_STRINGS) */ /* All informational messages are not compiled in for size savings */ -#define Curl_trc_is_verbose(d) ((void)(d), FALSE) -#define Curl_trc_cf_is_verbose(x,y) ((void)(x), (void)(y), FALSE) -#define Curl_trc_ft_is_verbose(x,y) ((void)(x), (void)(y), FALSE) +#define Curl_trc_is_verbose(d) (FALSE) +#define Curl_trc_cf_is_verbose(x,y) (FALSE) +#define Curl_trc_ft_is_verbose(x,y) (FALSE) static void Curl_infof(struct Curl_easy *data, const char *fmt, ...) { @@ -134,6 +193,37 @@ static void Curl_trc_cf_infof(struct Curl_easy *data, (void)data; (void)cf; (void)fmt; } +struct curl_trc_feat; + +static void Curl_trc_write(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} + +static void Curl_trc_read(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} + +#ifndef CURL_DISABLE_FTP +static void Curl_trc_ftp(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} +#endif +#ifndef CURL_DISABLE_SMTP +static void Curl_trc_smtp(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} +#endif +#if !defined(CURL_DISABLE_WEBSOCKETS) || !defined(CURL_DISABLE_HTTP) +static void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} +#endif + #endif /* !defined(CURL_DISABLE_VERBOSE_STRINGS) */ #endif /* HEADER_CURL_TRC_H */ diff --git a/deps/curl/lib/curlx.h b/deps/curl/lib/curlx.h index 7a753d68..f0e4e647 100644 --- a/deps/curl/lib/curlx.h +++ b/deps/curl/lib/curlx.h @@ -31,10 +31,8 @@ * be. */ -#include -/* this is still a public header file that provides the curl_mprintf() - functions while they still are offered publicly. They will be made library- - private one day */ +/* map standard printf functions to curl implementations */ +#include "curl_printf.h" #include "strcase.h" /* "strcase.h" provides the strcasecompare protos */ @@ -68,51 +66,4 @@ #include "version_win32.h" /* "version_win32.h" provides curlx_verify_windows_version() */ -/* Now setup curlx_ * names for the functions that are to become curlx_ and - be removed from a future libcurl official API: - curlx_getenv - curlx_mprintf (and its variations) - curlx_strcasecompare - curlx_strncasecompare - -*/ - -#define curlx_getenv curl_getenv -#define curlx_mvsnprintf curl_mvsnprintf -#define curlx_msnprintf curl_msnprintf -#define curlx_maprintf curl_maprintf -#define curlx_mvaprintf curl_mvaprintf -#define curlx_msprintf curl_msprintf -#define curlx_mprintf curl_mprintf -#define curlx_mfprintf curl_mfprintf -#define curlx_mvsprintf curl_mvsprintf -#define curlx_mvprintf curl_mvprintf -#define curlx_mvfprintf curl_mvfprintf - -#ifdef ENABLE_CURLX_PRINTF -/* If this define is set, we define all "standard" printf() functions to use - the curlx_* version instead. It makes the source code transparent and - easier to understand/patch. Undefine them first. */ -# undef printf -# undef fprintf -# undef sprintf -# undef msnprintf -# undef vprintf -# undef vfprintf -# undef vsprintf -# undef mvsnprintf -# undef aprintf -# undef vaprintf - -# define printf curlx_mprintf -# define fprintf curlx_mfprintf -# define sprintf curlx_msprintf -# define msnprintf curlx_msnprintf -# define vprintf curlx_mvprintf -# define vfprintf curlx_mvfprintf -# define mvsnprintf curlx_mvsnprintf -# define aprintf curlx_maprintf -# define vaprintf curlx_mvaprintf -#endif /* ENABLE_CURLX_PRINTF */ - #endif /* HEADER_CURL_CURLX_H */ diff --git a/deps/curl/lib/cw-out.c b/deps/curl/lib/cw-out.c index 25a27a68..4d3df0a6 100644 --- a/deps/curl/lib/cw-out.c +++ b/deps/curl/lib/cw-out.c @@ -102,6 +102,8 @@ static void cw_out_buf_free(struct cw_out_buf *cwbuf) struct cw_out_ctx { struct Curl_cwriter super; struct cw_out_buf *buf; + BIT(paused); + BIT(errored); }; static CURLcode cw_out_write(struct Curl_easy *data, @@ -175,8 +177,8 @@ static void cw_get_writefunc(struct Curl_easy *data, cw_out_type otype, *pmin_write = 0; break; case CW_OUT_HDS: - *pwcb = data->set.fwrite_header? data->set.fwrite_header : - (data->set.writeheader? data->set.fwrite_func : NULL); + *pwcb = data->set.fwrite_header ? data->set.fwrite_header : + (data->set.writeheader ? data->set.fwrite_func : NULL); *pwcb_data = data->set.writeheader; *pmax_write = 0; /* do not chunk-write headers, write them as they are */ *pmin_write = 0; @@ -201,7 +203,10 @@ static CURLcode cw_out_ptr_flush(struct cw_out_ctx *ctx, size_t max_write, min_write; size_t wlen, nwritten; - (void)ctx; + /* If we errored once, we do not invoke the client callback again */ + if(ctx->errored) + return CURLE_WRITE_ERROR; + /* write callbacks may get NULLed by the client between calls. */ cw_get_writefunc(data, otype, &wcb, &wcb_data, &max_write, &min_write); if(!wcb) { @@ -210,28 +215,37 @@ static CURLcode cw_out_ptr_flush(struct cw_out_ctx *ctx, } *pconsumed = 0; - while(blen && !(data->req.keepon & KEEP_RECV_PAUSE)) { + while(blen && !ctx->paused) { if(!flush_all && blen < min_write) break; - wlen = max_write? CURLMIN(blen, max_write) : blen; + wlen = max_write ? CURLMIN(blen, max_write) : blen; Curl_set_in_callback(data, TRUE); nwritten = wcb((char *)buf, 1, wlen, wcb_data); Curl_set_in_callback(data, FALSE); + CURL_TRC_WRITE(data, "cw_out, wrote %zu %s bytes -> %zu", + wlen, (otype == CW_OUT_BODY) ? "body" : "header", + nwritten); if(CURL_WRITEFUNC_PAUSE == nwritten) { if(data->conn && data->conn->handler->flags & PROTOPT_NONETWORK) { /* Protocols that work without network cannot be paused. This is - actually only FILE:// just now, and it can't pause since the - transfer isn't done using the "normal" procedure. */ + actually only FILE:// just now, and it cannot pause since the + transfer is not done using the "normal" procedure. */ failf(data, "Write callback asked for PAUSE when not supported"); return CURLE_WRITE_ERROR; } /* mark the connection as RECV paused */ data->req.keepon |= KEEP_RECV_PAUSE; + ctx->paused = TRUE; + CURL_TRC_WRITE(data, "cw_out, PAUSE requested by client"); break; } - if(nwritten != wlen) { + else if(CURL_WRITEFUNC_ERROR == nwritten) { + failf(data, "client returned ERROR on write of %zu bytes", wlen); + return CURLE_WRITE_ERROR; + } + else if(nwritten != wlen) { failf(data, "Failure writing output to destination, " - "passed %zu returned %zu", wlen, nwritten); + "passed %zu returned %zd", wlen, nwritten); return CURLE_WRITE_ERROR; } *pconsumed += nwritten; @@ -283,7 +297,7 @@ static CURLcode cw_out_flush_chain(struct cw_out_ctx *ctx, if(!cwbuf) return CURLE_OK; - if(data->req.keepon & KEEP_RECV_PAUSE) + if(ctx->paused) return CURLE_OK; /* write the end of the chain until it blocks or gets empty */ @@ -296,7 +310,7 @@ static CURLcode cw_out_flush_chain(struct cw_out_ctx *ctx, return result; if(*plast) { /* could not write last, paused again? */ - DEBUGASSERT(data->req.keepon & KEEP_RECV_PAUSE); + DEBUGASSERT(ctx->paused); return CURLE_OK; } } @@ -338,14 +352,14 @@ static CURLcode cw_out_do_write(struct cw_out_ctx *ctx, bool flush_all, const char *buf, size_t blen) { - CURLcode result; + CURLcode result = CURLE_OK; /* if we have buffered data and it is a different type than what * we are writing now, try to flush all */ if(ctx->buf && ctx->buf->type != otype) { result = cw_out_flush_chain(ctx, data, &ctx->buf, TRUE); if(result) - return result; + goto out; } if(ctx->buf) { @@ -355,7 +369,7 @@ static CURLcode cw_out_do_write(struct cw_out_ctx *ctx, return result; result = cw_out_flush_chain(ctx, data, &ctx->buf, flush_all); if(result) - return result; + goto out; } else { /* nothing buffered, try direct write */ @@ -368,10 +382,18 @@ static CURLcode cw_out_do_write(struct cw_out_ctx *ctx, /* did not write all, append the rest */ result = cw_out_append(ctx, otype, buf + consumed, blen - consumed); if(result) - return result; + goto out; } } - return CURLE_OK; + +out: + if(result) { + /* We do not want to invoked client callbacks a second time after + * encountering an error. See issue #13337 */ + ctx->errored = TRUE; + cw_out_bufs_free(ctx); + } + return result; } static CURLcode cw_out_write(struct Curl_easy *data, @@ -380,9 +402,8 @@ static CURLcode cw_out_write(struct Curl_easy *data, { struct cw_out_ctx *ctx = writer->ctx; CURLcode result; - bool flush_all; + bool flush_all = !!(type & CLIENTWRITE_EOS); - flush_all = (type & CLIENTWRITE_EOS)? TRUE:FALSE; if((type & CLIENTWRITE_BODY) || ((type & CLIENTWRITE_HEADER) && data->set.include_header)) { result = cw_out_do_write(ctx, data, CW_OUT_BODY, flush_all, buf, blen); @@ -409,10 +430,12 @@ bool Curl_cw_out_is_paused(struct Curl_easy *data) return FALSE; ctx = (struct cw_out_ctx *)cw_out; - return cw_out_bufs_len(ctx) > 0; + CURL_TRC_WRITE(data, "cw-out is%spaused", ctx->paused ? "" : " not"); + return ctx->paused; } -static CURLcode cw_out_flush(struct Curl_easy *data, bool flush_all) +static CURLcode cw_out_flush(struct Curl_easy *data, + bool unpause, bool flush_all) { struct Curl_cwriter *cw_out; CURLcode result = CURLE_OK; @@ -420,18 +443,31 @@ static CURLcode cw_out_flush(struct Curl_easy *data, bool flush_all) cw_out = Curl_cwriter_get_by_type(data, &Curl_cwt_out); if(cw_out) { struct cw_out_ctx *ctx = (struct cw_out_ctx *)cw_out; + if(ctx->errored) + return CURLE_WRITE_ERROR; + if(unpause && ctx->paused) + ctx->paused = FALSE; + if(ctx->paused) + return CURLE_OK; /* not doing it */ result = cw_out_flush_chain(ctx, data, &ctx->buf, flush_all); + if(result) { + ctx->errored = TRUE; + cw_out_bufs_free(ctx); + return result; + } } return result; } -CURLcode Curl_cw_out_flush(struct Curl_easy *data) +CURLcode Curl_cw_out_unpause(struct Curl_easy *data) { - return cw_out_flush(data, FALSE); + CURL_TRC_WRITE(data, "cw-out unpause"); + return cw_out_flush(data, TRUE, FALSE); } CURLcode Curl_cw_out_done(struct Curl_easy *data) { - return cw_out_flush(data, TRUE); + CURL_TRC_WRITE(data, "cw-out done"); + return cw_out_flush(data, FALSE, TRUE); } diff --git a/deps/curl/lib/cw-out.h b/deps/curl/lib/cw-out.h index c13e8538..ca4c2e43 100644 --- a/deps/curl/lib/cw-out.h +++ b/deps/curl/lib/cw-out.h @@ -43,7 +43,7 @@ bool Curl_cw_out_is_paused(struct Curl_easy *data); /** * Flush any buffered date to the client, chunk collation still applies. */ -CURLcode Curl_cw_out_flush(struct Curl_easy *data); +CURLcode Curl_cw_out_unpause(struct Curl_easy *data); /** * Mark EndOfStream reached and flush ALL data to the client. diff --git a/deps/curl/lib/dict.c b/deps/curl/lib/dict.c index f3776788..7d9c18dc 100644 --- a/deps/curl/lib/dict.c +++ b/deps/curl/lib/dict.c @@ -76,7 +76,7 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done); */ const struct Curl_handler Curl_handler_dict = { - "DICT", /* scheme */ + "dict", /* scheme */ ZERO_NULL, /* setup_connection */ dict_do, /* do_it */ ZERO_NULL, /* done */ @@ -90,6 +90,7 @@ const struct Curl_handler Curl_handler_dict = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_DICT, /* defport */ @@ -145,7 +146,7 @@ static CURLcode sendf(struct Curl_easy *data, const char *fmt, ...) for(;;) { /* Write the buffer to the socket */ - result = Curl_xfer_send(data, sptr, write_len, &bytes_written); + result = Curl_xfer_send(data, sptr, write_len, FALSE, &bytes_written); if(result) break; @@ -240,7 +241,7 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done) failf(data, "Failed sending DICT request"); goto error; } - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); /* no upload */ + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); /* no upload */ } else if(strncasecompare(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) || strncasecompare(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) || @@ -286,7 +287,7 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done) failf(data, "Failed sending DICT request"); goto error; } - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); } else { @@ -308,7 +309,7 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done) goto error; } - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); } } diff --git a/deps/curl/lib/dllmain.c b/deps/curl/lib/dllmain.c new file mode 100644 index 00000000..41e97b37 --- /dev/null +++ b/deps/curl/lib/dllmain.c @@ -0,0 +1,81 @@ +/*************************************************************************** + * _ _ ____ _ + * 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" + +#ifdef USE_OPENSSL +#include +#endif + +/* The fourth-to-last include */ +#ifdef __CYGWIN__ +#define WIN32_LEAN_AND_MEAN +#include +#ifdef _WIN32 +#undef _WIN32 +#endif +#endif + +/* The last 3 #include files should be in this order */ +#include "curl_printf.h" +#include "curl_memory.h" +#include "memdebug.h" + +/* DllMain() must only be defined for Windows and Cygwin DLL builds. */ +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(CURL_STATICLIB) + +#if defined(USE_OPENSSL) && \ + !defined(OPENSSL_IS_AWSLC) && \ + !defined(OPENSSL_IS_BORINGSSL) && \ + !defined(LIBRESSL_VERSION_NUMBER) && \ + (OPENSSL_VERSION_NUMBER >= 0x10100000L) +#define PREVENT_OPENSSL_MEMLEAK +#endif + +#ifdef PREVENT_OPENSSL_MEMLEAK +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + (void)hinstDLL; + (void)lpvReserved; + + switch(fdwReason) { + case DLL_PROCESS_ATTACH: + break; + case DLL_PROCESS_DETACH: + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + /* Call OPENSSL_thread_stop to prevent a memory leak in case OpenSSL is + linked statically. + https://github.com/curl/curl/issues/12327#issuecomment-1826405944 */ + OPENSSL_thread_stop(); + break; + } + return TRUE; +} +#endif /* OpenSSL */ + +#endif /* DLL build */ diff --git a/deps/curl/lib/doh.c b/deps/curl/lib/doh.c index 33e71416..8769372e 100644 --- a/deps/curl/lib/doh.c +++ b/deps/curl/lib/doh.c @@ -42,9 +42,13 @@ #include "curl_printf.h" #include "curl_memory.h" #include "memdebug.h" +#include "escape.h" #define DNS_CLASS_IN 0x01 +/* doh_print_buf truncates if the hex string will be more than this */ +#define LOCAL_PB_HEXMAX 400 + #ifndef CURL_DISABLE_VERBOSE_STRINGS static const char * const errors[]={ "", @@ -78,32 +82,32 @@ struct curl_trc_feat Curl_doh_trc = { /* @unittest 1655 */ -UNITTEST DOHcode doh_encode(const char *host, - DNStype dnstype, - unsigned char *dnsp, /* buffer */ - size_t len, /* buffer size */ - size_t *olen) /* output length */ +UNITTEST DOHcode doh_req_encode(const char *host, + DNStype dnstype, + unsigned char *dnsp, /* buffer */ + size_t len, /* buffer size */ + size_t *olen) /* output length */ { const size_t hostlen = strlen(host); unsigned char *orig = dnsp; const char *hostp = host; /* The expected output length is 16 bytes more than the length of - * the QNAME-encoding of the host name. + * the QNAME-encoding of the hostname. * * A valid DNS name may not contain a zero-length label, except at - * the end. For this reason, a name beginning with a dot, or + * the end. For this reason, a name beginning with a dot, or * containing a sequence of two or more consecutive dots, is invalid * and cannot be encoded as a QNAME. * - * If the host name ends with a trailing dot, the corresponding - * QNAME-encoding is one byte longer than the host name. If (as is + * If the hostname ends with a trailing dot, the corresponding + * QNAME-encoding is one byte longer than the hostname. If (as is * also valid) the hostname is shortened by the omission of the * trailing dot, then its QNAME-encoding will be two bytes longer - * than the host name. + * than the hostname. * * Each [ label, dot ] pair is encoded as [ length, label ], - * preserving overall length. A final [ label ] without a dot is + * preserving overall length. A final [ label ] without a dot is * also encoded as [ length, label ], increasing overall length * by one. The encoding is completed by appending a zero byte, * representing the zero-length root label, again increasing @@ -161,7 +165,7 @@ UNITTEST DOHcode doh_encode(const char *host, *dnsp++ = 0; /* append zero-length label for root */ /* 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 >> 8)); /* upper 8 bit TYPE */ *dnsp++ = (unsigned char)(255 & dnstype); /* lower 8 bit TYPE */ *dnsp++ = '\0'; /* upper 8 bit CLASS */ @@ -176,7 +180,7 @@ UNITTEST DOHcode doh_encode(const char *host, } static size_t -doh_write_cb(const void *contents, size_t size, size_t nmemb, void *userp) +doh_write_cb(char *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct dynbuf *mem = (struct dynbuf *)userp; @@ -187,53 +191,80 @@ doh_write_cb(const void *contents, size_t size, size_t nmemb, void *userp) return realsize; } +#if defined(USE_HTTPSRR) && defined(DEBUGBUILD) +static void doh_print_buf(struct Curl_easy *data, + const char *prefix, + unsigned char *buf, size_t len) +{ + unsigned char hexstr[LOCAL_PB_HEXMAX]; + size_t hlen = LOCAL_PB_HEXMAX; + bool truncated = FALSE; + + if(len > (LOCAL_PB_HEXMAX / 2)) + truncated = TRUE; + Curl_hexencode(buf, len, hexstr, hlen); + if(!truncated) + infof(data, "%s: len=%d, val=%s", prefix, (int)len, hexstr); + else + infof(data, "%s: len=%d (truncated)val=%s", prefix, (int)len, hexstr); + return; +} +#endif + /* called from multi.c when this DoH transfer is complete */ static int doh_done(struct Curl_easy *doh, CURLcode result) { - struct Curl_easy *data = doh->set.dohfor; - struct dohdata *dohp = data->req.doh; - /* so one of the DoH request done for the 'data' transfer is now complete! */ - dohp->pending--; - infof(doh, "a DoH request is completed, %u to go", dohp->pending); - if(result) - infof(doh, "DoH request %s", curl_easy_strerror(result)); + struct Curl_easy *data; /* the transfer that asked for the DoH probe */ - if(!dohp->pending) { - /* DoH completed */ - curl_slist_free_all(dohp->headers); - dohp->headers = NULL; - Curl_expire(data, 0, EXPIRE_RUN_NOW); + data = Curl_multi_get_handle(doh->multi, doh->set.dohfor_mid); + if(!data) { + DEBUGF(infof(doh, "doh_done: xfer for mid=%" FMT_OFF_T + " not found", doh->set.dohfor_mid)); + DEBUGASSERT(0); + } + else { + struct doh_probes *dohp = data->req.doh; + /* one of the DoH request done for the 'data' transfer is now complete! */ + dohp->pending--; + infof(doh, "a DoH request is completed, %u to go", dohp->pending); + if(result) + infof(doh, "DoH request %s", curl_easy_strerror(result)); + + if(!dohp->pending) { + /* DoH completed, run the transfer picking up the results */ + Curl_expire(data, 0, EXPIRE_RUN_NOW); + } } return 0; } -#define ERROR_CHECK_SETOPT(x,y) \ -do { \ - result = curl_easy_setopt(doh, x, y); \ - if(result && \ - result != CURLE_NOT_BUILT_IN && \ - result != CURLE_UNKNOWN_OPTION) \ - goto error; \ -} while(0) +#define ERROR_CHECK_SETOPT(x,y) \ + do { \ + result = curl_easy_setopt((CURL *)doh, x, y); \ + if(result && \ + result != CURLE_NOT_BUILT_IN && \ + result != CURLE_UNKNOWN_OPTION) \ + goto error; \ + } while(0) -static CURLcode dohprobe(struct Curl_easy *data, - struct dnsprobe *p, DNStype dnstype, - const char *host, - const char *url, CURLM *multi, - struct curl_slist *headers) +static CURLcode doh_run_probe(struct Curl_easy *data, + struct doh_probe *p, DNStype dnstype, + const char *host, + const char *url, CURLM *multi, + struct curl_slist *headers) { struct Curl_easy *doh = NULL; CURLcode result = CURLE_OK; timediff_t timeout_ms; - DOHcode d = doh_encode(host, dnstype, p->dohbuffer, sizeof(p->dohbuffer), - &p->dohlen); + DOHcode d = doh_req_encode(host, dnstype, p->req_body, sizeof(p->req_body), + &p->req_body_len); if(d) { failf(data, "Failed to encode DoH packet [%d]", d); return CURLE_OUT_OF_MEMORY; } p->dnstype = dnstype; - Curl_dyn_init(&p->serverdoh, DYN_DOH_RESPONSE); + Curl_dyn_init(&p->resp_body, DYN_DOH_RESPONSE); timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms <= 0) { @@ -242,126 +273,126 @@ static CURLcode dohprobe(struct Curl_easy *data, } /* Curl_open() is the internal version of curl_easy_init() */ result = Curl_open(&doh); - if(!result) { - /* pass in the struct pointer via a local variable to please coverity and - the gcc typecheck helpers */ - struct dynbuf *resp = &p->serverdoh; - doh->state.internal = true; -#ifndef CURL_DISABLE_VERBOSE_STRINGS - doh->state.feat = &Curl_doh_trc; -#endif - ERROR_CHECK_SETOPT(CURLOPT_URL, url); - ERROR_CHECK_SETOPT(CURLOPT_DEFAULT_PROTOCOL, "https"); - ERROR_CHECK_SETOPT(CURLOPT_WRITEFUNCTION, doh_write_cb); - ERROR_CHECK_SETOPT(CURLOPT_WRITEDATA, resp); - ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDS, p->dohbuffer); - ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDSIZE, (long)p->dohlen); - ERROR_CHECK_SETOPT(CURLOPT_HTTPHEADER, headers); -#ifdef USE_HTTP2 - ERROR_CHECK_SETOPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); - ERROR_CHECK_SETOPT(CURLOPT_PIPEWAIT, 1L); -#endif -#ifndef CURLDEBUG - /* enforce HTTPS if not debug */ - ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); -#else - /* in debug mode, also allow http */ - ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS); -#endif - ERROR_CHECK_SETOPT(CURLOPT_TIMEOUT_MS, (long)timeout_ms); - ERROR_CHECK_SETOPT(CURLOPT_SHARE, data->share); - if(data->set.err && data->set.err != stderr) - ERROR_CHECK_SETOPT(CURLOPT_STDERR, data->set.err); - if(Curl_trc_ft_is_verbose(data, &Curl_doh_trc)) - ERROR_CHECK_SETOPT(CURLOPT_VERBOSE, 1L); - if(data->set.no_signal) - ERROR_CHECK_SETOPT(CURLOPT_NOSIGNAL, 1L); - - ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYHOST, - data->set.doh_verifyhost ? 2L : 0L); - ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYPEER, - data->set.doh_verifypeer ? 1L : 0L); - ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYSTATUS, - 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 - - Note DoH does not inherit the user's proxy server so proxy SSL settings - have no effect and are not inherited. If that changes then two new - options should be added to check doh proxy insecure separately, - CURLOPT_DOH_PROXY_SSL_VERIFYHOST and CURLOPT_DOH_PROXY_SSL_VERIFYPEER. - */ - if(data->set.ssl.falsestart) - ERROR_CHECK_SETOPT(CURLOPT_SSL_FALSESTART, 1L); - if(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]); - } - if(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]); - } - if(data->set.ssl.certinfo) - ERROR_CHECK_SETOPT(CURLOPT_CERTINFO, 1L); - if(data->set.ssl.fsslctx) - ERROR_CHECK_SETOPT(CURLOPT_SSL_CTX_FUNCTION, data->set.ssl.fsslctx); - if(data->set.ssl.fsslctxp) - ERROR_CHECK_SETOPT(CURLOPT_SSL_CTX_DATA, data->set.ssl.fsslctxp); - if(data->set.fdebug) - ERROR_CHECK_SETOPT(CURLOPT_DEBUGFUNCTION, data->set.fdebug); - if(data->set.debugdata) - ERROR_CHECK_SETOPT(CURLOPT_DEBUGDATA, data->set.debugdata); - if(data->set.str[STRING_SSL_EC_CURVES]) { - ERROR_CHECK_SETOPT(CURLOPT_SSL_EC_CURVES, - data->set.str[STRING_SSL_EC_CURVES]); - } - - { - long mask = - (data->set.ssl.enable_beast ? - CURLSSLOPT_ALLOW_BEAST : 0) | - (data->set.ssl.no_revoke ? - CURLSSLOPT_NO_REVOKE : 0) | - (data->set.ssl.no_partialchain ? - CURLSSLOPT_NO_PARTIALCHAIN : 0) | - (data->set.ssl.revoke_best_effort ? - CURLSSLOPT_REVOKE_BEST_EFFORT : 0) | - (data->set.ssl.native_ca_store ? - CURLSSLOPT_NATIVE_CA : 0) | - (data->set.ssl.auto_client_cert ? - CURLSSLOPT_AUTO_CLIENT_CERT : 0); - - (void)curl_easy_setopt(doh, CURLOPT_SSL_OPTIONS, mask); - } - - doh->set.fmultidone = doh_done; - doh->set.dohfor = data; /* identify for which transfer this is done */ - p->easy = doh; - - /* DoH handles must not inherit private_data. The handles may be passed to - the user via callbacks and the user will be able to identify them as - internal handles because private data is not set. The user can then set - private_data via CURLOPT_PRIVATE if they so choose. */ - DEBUGASSERT(!doh->set.private_data); - - if(curl_multi_add_handle(multi, doh)) - goto error; - } - else + if(result) goto error; + + /* pass in the struct pointer via a local variable to please coverity and + the gcc typecheck helpers */ + doh->state.internal = TRUE; +#ifndef CURL_DISABLE_VERBOSE_STRINGS + doh->state.feat = &Curl_doh_trc; +#endif + ERROR_CHECK_SETOPT(CURLOPT_URL, url); + ERROR_CHECK_SETOPT(CURLOPT_DEFAULT_PROTOCOL, "https"); + ERROR_CHECK_SETOPT(CURLOPT_WRITEFUNCTION, doh_write_cb); + ERROR_CHECK_SETOPT(CURLOPT_WRITEDATA, &p->resp_body); + ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDS, p->req_body); + ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDSIZE, (long)p->req_body_len); + ERROR_CHECK_SETOPT(CURLOPT_HTTPHEADER, headers); +#ifdef USE_HTTP2 + ERROR_CHECK_SETOPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); + ERROR_CHECK_SETOPT(CURLOPT_PIPEWAIT, 1L); +#endif +#ifndef DEBUGBUILD + /* enforce HTTPS if not debug */ + ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); +#else + /* in debug mode, also allow http */ + 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); + if(data->set.err && data->set.err != stderr) + ERROR_CHECK_SETOPT(CURLOPT_STDERR, data->set.err); + if(Curl_trc_ft_is_verbose(data, &Curl_doh_trc)) + ERROR_CHECK_SETOPT(CURLOPT_VERBOSE, 1L); + if(data->set.no_signal) + ERROR_CHECK_SETOPT(CURLOPT_NOSIGNAL, 1L); + + ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYHOST, + data->set.doh_verifyhost ? 2L : 0L); + ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYPEER, + data->set.doh_verifypeer ? 1L : 0L); + ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYSTATUS, + 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 + + Note DoH does not inherit the user's proxy server so proxy SSL settings + have no effect and are not inherited. If that changes then two new + options should be added to check doh proxy insecure separately, + CURLOPT_DOH_PROXY_SSL_VERIFYHOST and CURLOPT_DOH_PROXY_SSL_VERIFYPEER. + */ + if(data->set.ssl.falsestart) + ERROR_CHECK_SETOPT(CURLOPT_SSL_FALSESTART, 1L); + if(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]); + } + if(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]); + } + if(data->set.ssl.certinfo) + ERROR_CHECK_SETOPT(CURLOPT_CERTINFO, 1L); + if(data->set.ssl.fsslctx) + ERROR_CHECK_SETOPT(CURLOPT_SSL_CTX_FUNCTION, data->set.ssl.fsslctx); + if(data->set.ssl.fsslctxp) + ERROR_CHECK_SETOPT(CURLOPT_SSL_CTX_DATA, data->set.ssl.fsslctxp); + if(data->set.fdebug) + ERROR_CHECK_SETOPT(CURLOPT_DEBUGFUNCTION, data->set.fdebug); + if(data->set.debugdata) + ERROR_CHECK_SETOPT(CURLOPT_DEBUGDATA, data->set.debugdata); + if(data->set.str[STRING_SSL_EC_CURVES]) { + ERROR_CHECK_SETOPT(CURLOPT_SSL_EC_CURVES, + data->set.str[STRING_SSL_EC_CURVES]); + } + + { + long mask = + (data->set.ssl.enable_beast ? + CURLSSLOPT_ALLOW_BEAST : 0) | + (data->set.ssl.no_revoke ? + CURLSSLOPT_NO_REVOKE : 0) | + (data->set.ssl.no_partialchain ? + CURLSSLOPT_NO_PARTIALCHAIN : 0) | + (data->set.ssl.revoke_best_effort ? + CURLSSLOPT_REVOKE_BEST_EFFORT : 0) | + (data->set.ssl.native_ca_store ? + CURLSSLOPT_NATIVE_CA : 0) | + (data->set.ssl.auto_client_cert ? + CURLSSLOPT_AUTO_CLIENT_CERT : 0); + + (void)curl_easy_setopt(doh, CURLOPT_SSL_OPTIONS, mask); + } + + doh->set.fmultidone = doh_done; + doh->set.dohfor_mid = data->mid; /* for which transfer this is done */ + + /* DoH handles must not inherit private_data. The handles may be passed to + the user via callbacks and the user will be able to identify them as + internal handles because private data is not set. The user can then set + private_data via CURLOPT_PRIVATE if they so choose. */ + DEBUGASSERT(!doh->set.private_data); + + if(curl_multi_add_handle(multi, doh)) + goto error; + + p->easy_mid = doh->mid; return CURLE_OK; error: Curl_close(&doh); + p->easy_mid = -1; return result; } @@ -376,9 +407,15 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, int *waitp) { CURLcode result = CURLE_OK; - int slot; - struct dohdata *dohp; + struct doh_probes *dohp; struct connectdata *conn = data->conn; + size_t i; +#ifdef USE_HTTPSRR + /* for now, this is only used when ECH is enabled */ +# ifdef USE_ECH + char *qname = NULL; +# endif +#endif *waitp = FALSE; (void)hostname; (void)port; @@ -387,54 +424,83 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, DEBUGASSERT(conn); /* start clean, consider allocating this struct on demand */ - dohp = data->req.doh = calloc(1, sizeof(struct dohdata)); + dohp = data->req.doh = calloc(1, sizeof(struct doh_probes)); if(!dohp) return NULL; + for(i = 0; i < DOH_SLOT_COUNT; ++i) { + dohp->probe[i].easy_mid = -1; + } + conn->bits.doh = TRUE; dohp->host = hostname; dohp->port = port; - dohp->headers = + dohp->req_hds = curl_slist_append(NULL, "Content-Type: application/dns-message"); - if(!dohp->headers) + if(!dohp->req_hds) goto error; /* create IPv4 DoH request */ - result = dohprobe(data, &dohp->probe[DOH_PROBE_SLOT_IPADDR_V4], - DNS_TYPE_A, hostname, data->set.str[STRING_DOH], - data->multi, dohp->headers); + result = doh_run_probe(data, &dohp->probe[DOH_SLOT_IPV4], + DNS_TYPE_A, hostname, data->set.str[STRING_DOH], + data->multi, dohp->req_hds); if(result) goto error; dohp->pending++; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if((conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data)) { /* create IPv6 DoH request */ - result = dohprobe(data, &dohp->probe[DOH_PROBE_SLOT_IPADDR_V6], - DNS_TYPE_AAAA, hostname, data->set.str[STRING_DOH], - data->multi, dohp->headers); + result = doh_run_probe(data, &dohp->probe[DOH_SLOT_IPV6], + DNS_TYPE_AAAA, hostname, data->set.str[STRING_DOH], + data->multi, dohp->req_hds); if(result) goto error; dohp->pending++; } +#endif + +#ifdef USE_HTTPSRR + /* + * TODO: Figure out the conditions under which we want to make + * a request for an HTTPS RR when we are not doing ECH. For now, + * making this request breaks a bunch of DoH tests, e.g. test2100, + * where the additional request does not match the pre-cooked data + * files, so there is a bit of work attached to making the request + * in a non-ECH use-case. For the present, we will only make the + * request when ECH is enabled in the build and is being used for + * the curl operation. + */ +# ifdef USE_ECH + if(data->set.tls_ech & CURLECH_ENABLE + || data->set.tls_ech & CURLECH_HARD) { + if(port == 443) + qname = strdup(hostname); + else + qname = aprintf("_%d._https.%s", port, hostname); + if(!qname) + goto error; + result = doh_run_probe(data, &dohp->probe[DOH_SLOT_HTTPS_RR], + DNS_TYPE_HTTPS, qname, data->set.str[STRING_DOH], + data->multi, dohp->req_hds); + Curl_safefree(qname); + if(result) + goto error; + dohp->pending++; + } +# endif #endif *waitp = TRUE; /* this never returns synchronously */ return NULL; error: - curl_slist_free_all(dohp->headers); - data->req.doh->headers = NULL; - for(slot = 0; slot < DOH_PROBE_SLOTS; slot++) { - (void)curl_multi_remove_handle(data->multi, dohp->probe[slot].easy); - Curl_close(&dohp->probe[slot].easy); - } - Curl_safefree(data->req.doh); + Curl_doh_cleanup(data); return NULL; } -static DOHcode skipqname(const unsigned char *doh, size_t dohlen, - unsigned int *indexp) +static DOHcode doh_skipqname(const unsigned char *doh, size_t dohlen, + unsigned int *indexp) { unsigned char length; do { @@ -457,12 +523,13 @@ static DOHcode skipqname(const unsigned char *doh, size_t dohlen, return DOH_OK; } -static unsigned short get16bit(const unsigned char *doh, int index) +static unsigned short doh_get16bit(const unsigned char *doh, + unsigned int index) { return (unsigned short)((doh[index] << 8) | doh[index + 1]); } -static unsigned int get32bit(const unsigned char *doh, int index) +static unsigned int doh_get32bit(const unsigned char *doh, unsigned int index) { /* make clang and gcc optimize this to bswap by incrementing the pointer first. */ @@ -470,12 +537,13 @@ static unsigned int get32bit(const unsigned char *doh, int index) /* avoid undefined behavior by casting to unsigned before shifting 24 bits, possibly into the sign bit. codegen is same, but - ub sanitizer won't be upset */ + ub sanitizer will not be upset */ return ((unsigned)doh[0] << 24) | ((unsigned)doh[1] << 16) | ((unsigned)doh[2] << 8) | doh[3]; } -static DOHcode store_a(const unsigned char *doh, int index, struct dohentry *d) +static void doh_store_a(const unsigned char *doh, int index, + struct dohentry *d) { /* silently ignore addresses over the limit */ if(d->numaddr < DOH_MAX_ADDR) { @@ -484,12 +552,10 @@ static DOHcode store_a(const unsigned char *doh, int index, struct dohentry *d) memcpy(&a->ip.v4, &doh[index], 4); d->numaddr++; } - return DOH_OK; } -static DOHcode store_aaaa(const unsigned char *doh, - int index, - struct dohentry *d) +static void doh_store_aaaa(const unsigned char *doh, int index, + struct dohentry *d) { /* silently ignore addresses over the limit */ if(d->numaddr < DOH_MAX_ADDR) { @@ -498,13 +564,27 @@ static DOHcode store_aaaa(const unsigned char *doh, memcpy(&a->ip.v6, &doh[index], 16); d->numaddr++; } - return DOH_OK; } -static DOHcode store_cname(const unsigned char *doh, - size_t dohlen, - unsigned int index, - struct dohentry *d) +#ifdef USE_HTTPSRR +static DOHcode doh_store_https(const unsigned char *doh, int index, + struct dohentry *d, uint16_t len) +{ + /* silently ignore RRs over the limit */ + if(d->numhttps_rrs < DOH_MAX_HTTPS) { + struct dohhttps_rr *h = &d->https_rrs[d->numhttps_rrs]; + h->val = Curl_memdup(&doh[index], len); + if(!h->val) + return DOH_OUT_OF_MEM; + h->len = len; + d->numhttps_rrs++; + } + return DOH_OK; +} +#endif + +static DOHcode doh_store_cname(const unsigned char *doh, size_t dohlen, + unsigned int index, struct dohentry *d) { struct dynbuf *c; unsigned int loop = 128; /* a valid DNS name can never loop this much */ @@ -526,7 +606,7 @@ static DOHcode store_cname(const unsigned char *doh, /* move to the new index */ newpos = (length & 0x3f) << 8 | doh[index + 1]; - index = newpos; + index = (unsigned int)newpos; continue; } else if(length & 0xc0) @@ -553,36 +633,40 @@ static DOHcode store_cname(const unsigned char *doh, return DOH_OK; } -static DOHcode rdata(const unsigned char *doh, - size_t dohlen, - unsigned short rdlength, - unsigned short type, - int index, - struct dohentry *d) +static DOHcode doh_rdata(const unsigned char *doh, + size_t dohlen, + unsigned short rdlength, + unsigned short type, + int index, + struct dohentry *d) { /* RDATA - A (TYPE 1): 4 bytes - AAAA (TYPE 28): 16 bytes - - NS (TYPE 2): N bytes */ + - NS (TYPE 2): N bytes + - HTTPS (TYPE 65): N bytes */ DOHcode rc; switch(type) { case DNS_TYPE_A: if(rdlength != 4) return DOH_DNS_RDATA_LEN; - rc = store_a(doh, index, d); - if(rc) - return rc; + doh_store_a(doh, index, d); break; case DNS_TYPE_AAAA: if(rdlength != 16) return DOH_DNS_RDATA_LEN; - rc = store_aaaa(doh, index, d); + doh_store_aaaa(doh, index, d); + break; +#ifdef USE_HTTPSRR + case DNS_TYPE_HTTPS: + rc = doh_store_https(doh, index, d, rdlength); if(rc) return rc; break; +#endif case DNS_TYPE_CNAME: - rc = store_cname(doh, dohlen, index, d); + rc = doh_store_cname(doh, dohlen, (unsigned int)index, d); if(rc) return rc; break; @@ -606,10 +690,10 @@ UNITTEST void de_init(struct dohentry *de) } -UNITTEST DOHcode doh_decode(const unsigned char *doh, - size_t dohlen, - DNStype dnstype, - struct dohentry *d) +UNITTEST DOHcode doh_resp_decode(const unsigned char *doh, + size_t dohlen, + DNStype dnstype, + struct dohentry *d) { unsigned char rcode; unsigned short qdcount; @@ -629,9 +713,9 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(rcode) return DOH_DNS_BAD_RCODE; /* bad rcode */ - qdcount = get16bit(doh, 4); + qdcount = doh_get16bit(doh, 4); while(qdcount) { - rc = skipqname(doh, dohlen, &index); + rc = doh_skipqname(doh, dohlen, &index); if(rc) return rc; /* bad qname */ if(dohlen < (index + 4)) @@ -640,19 +724,19 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, qdcount--; } - ancount = get16bit(doh, 6); + ancount = doh_get16bit(doh, 6); while(ancount) { unsigned short class; unsigned int ttl; - rc = skipqname(doh, dohlen, &index); + rc = doh_skipqname(doh, dohlen, &index); if(rc) return rc; /* bad qname */ if(dohlen < (index + 2)) return DOH_DNS_OUT_OF_RANGE; - type = get16bit(doh, index); + type = doh_get16bit(doh, index); if((type != DNS_TYPE_CNAME) /* may be synthesized from DNAME */ && (type != DNS_TYPE_DNAME) /* if present, accept and ignore */ && (type != dnstype)) @@ -662,7 +746,7 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(dohlen < (index + 2)) return DOH_DNS_OUT_OF_RANGE; - class = get16bit(doh, index); + class = doh_get16bit(doh, index); if(DNS_CLASS_IN != class) return DOH_DNS_UNEXPECTED_CLASS; /* unsupported */ index += 2; @@ -670,7 +754,7 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(dohlen < (index + 4)) return DOH_DNS_OUT_OF_RANGE; - ttl = get32bit(doh, index); + ttl = doh_get32bit(doh, index); if(ttl < d->ttl) d->ttl = ttl; index += 4; @@ -678,21 +762,21 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(dohlen < (index + 2)) return DOH_DNS_OUT_OF_RANGE; - rdlength = get16bit(doh, index); + rdlength = doh_get16bit(doh, index); index += 2; if(dohlen < (index + rdlength)) return DOH_DNS_OUT_OF_RANGE; - rc = rdata(doh, dohlen, rdlength, type, index, d); + rc = doh_rdata(doh, dohlen, rdlength, type, (int)index, d); if(rc) - return rc; /* bad rdata */ + return rc; /* bad doh_rdata */ index += rdlength; ancount--; } - nscount = get16bit(doh, 8); + nscount = doh_get16bit(doh, 8); while(nscount) { - rc = skipqname(doh, dohlen, &index); + rc = doh_skipqname(doh, dohlen, &index); if(rc) return rc; /* bad qname */ @@ -704,7 +788,7 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(dohlen < (index + 2)) return DOH_DNS_OUT_OF_RANGE; - rdlength = get16bit(doh, index); + rdlength = doh_get16bit(doh, index); index += 2; if(dohlen < (index + rdlength)) return DOH_DNS_OUT_OF_RANGE; @@ -712,9 +796,9 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, nscount--; } - arcount = get16bit(doh, 10); + arcount = doh_get16bit(doh, 10); while(arcount) { - rc = skipqname(doh, dohlen, &index); + rc = doh_skipqname(doh, dohlen, &index); if(rc) return rc; /* bad qname */ @@ -726,7 +810,7 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(dohlen < (index + 2)) return DOH_DNS_OUT_OF_RANGE; - rdlength = get16bit(doh, index); + rdlength = doh_get16bit(doh, index); index += 2; if(dohlen < (index + rdlength)) return DOH_DNS_OUT_OF_RANGE; @@ -737,7 +821,11 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, if(index != dohlen) return DOH_DNS_MALFORMAT; /* something is wrong */ +#ifdef USE_HTTTPS + if((type != DNS_TYPE_NS) && !d->numcname && !d->numaddr && !d->numhttps_rrs) +#else if((type != DNS_TYPE_NS) && !d->numcname && !d->numaddr) +#endif /* nothing stored! */ return DOH_NO_CONTENT; @@ -745,8 +833,8 @@ UNITTEST DOHcode doh_decode(const unsigned char *doh, } #ifndef CURL_DISABLE_VERBOSE_STRINGS -static void showdoh(struct Curl_easy *data, - const struct dohentry *d) +static void doh_show(struct Curl_easy *data, + const struct dohentry *d) { int i; infof(data, "[DoH] TTL: %u seconds", d->ttl); @@ -759,15 +847,13 @@ static void showdoh(struct Curl_easy *data, } else if(a->type == DNS_TYPE_AAAA) { int j; - char buffer[128]; - char *ptr; - size_t len; - len = msnprintf(buffer, 128, "[DoH] AAAA: "); - ptr = &buffer[len]; + char buffer[128] = "[DoH] AAAA: "; + size_t len = strlen(buffer); + char *ptr = &buffer[len]; len = sizeof(buffer) - len; for(j = 0; j < 16; j += 2) { size_t l; - msnprintf(ptr, len, "%s%02x%02x", j?":":"", d->addr[i].ip.v6[j], + msnprintf(ptr, len, "%s%02x%02x", j ? ":" : "", d->addr[i].ip.v6[j], d->addr[i].ip.v6[j + 1]); l = strlen(ptr); len -= l; @@ -776,12 +862,22 @@ static void showdoh(struct Curl_easy *data, infof(data, "%s", buffer); } } +#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); +# else + infof(data, "DoH HTTPS RR: length %d", d->https_rrs[i].len); +# endif + } +#endif for(i = 0; i < d->numcname; i++) { infof(data, "CNAME: %s", Curl_dyn_ptr(&d->cname[i])); } } #else -#define showdoh(x,y) +#define doh_show(x,y) #endif /* @@ -789,11 +885,11 @@ static void showdoh(struct Curl_easy *data, * * This function returns a pointer to the first element of a newly allocated * Curl_addrinfo struct linked list filled with the data from a set of DoH - * lookups. Curl_addrinfo is meant to work like the addrinfo struct does for + * lookups. Curl_addrinfo is meant to work like the addrinfo struct does for * a IPv6 stack, but usable also for IPv4, all hosts and environments. * * The memory allocated by this function *MUST* be free'd later on calling - * Curl_freeaddrinfo(). For each successful call to this function there + * Curl_freeaddrinfo(). For each successful call to this function there * must be an associated call later to Curl_freeaddrinfo(). */ @@ -804,7 +900,7 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname, struct Curl_addrinfo *prevai = NULL; struct Curl_addrinfo *firstai = NULL; struct sockaddr_in *addr; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 *addr6; #endif CURLcode result = CURLE_OK; @@ -820,8 +916,8 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname, size_t ss_size; CURL_SA_FAMILY_T addrtype; if(de->addr[i].type == DNS_TYPE_AAAA) { -#ifndef ENABLE_IPV6 - /* we can't handle IPv6 addresses */ +#ifndef USE_IPV6 + /* we cannot handle IPv6 addresses */ continue; #else ss_size = sizeof(struct sockaddr_in6); @@ -865,16 +961,24 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname, addr = (void *)ai->ai_addr; /* storage area for this info */ DEBUGASSERT(sizeof(struct in_addr) == sizeof(de->addr[i].ip.v4)); memcpy(&addr->sin_addr, &de->addr[i].ip.v4, sizeof(struct in_addr)); +#ifdef __MINGW32__ + addr->sin_family = (short)addrtype; +#else addr->sin_family = addrtype; +#endif addr->sin_port = htons((unsigned short)port); break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: addr6 = (void *)ai->ai_addr; /* storage area for this info */ DEBUGASSERT(sizeof(struct in6_addr) == sizeof(de->addr[i].ip.v6)); memcpy(&addr6->sin6_addr, &de->addr[i].ip.v6, sizeof(struct in6_addr)); +#ifdef __MINGW32__ + addr6->sin6_family = (short)addrtype; +#else addr6->sin6_family = addrtype; +#endif addr6->sin6_port = htons((unsigned short)port); break; #endif @@ -893,9 +997,20 @@ static CURLcode doh2ai(const struct dohentry *de, const char *hostname, } #ifndef CURL_DISABLE_VERBOSE_STRINGS -static const char *type2name(DNStype dnstype) +static const char *doh_type2name(DNStype dnstype) { - return (dnstype == DNS_TYPE_A)?"A":"AAAA"; + switch(dnstype) { + case DNS_TYPE_A: + return "A"; + case DNS_TYPE_AAAA: + return "AAAA"; +#ifdef USE_HTTPSRR + case DNS_TYPE_HTTPS: + return "HTTPS"; +#endif + default: + return "unknown"; + } } #endif @@ -905,63 +1020,328 @@ UNITTEST void de_cleanup(struct dohentry *d) for(i = 0; i < d->numcname; i++) { Curl_dyn_free(&d->cname[i]); } +#ifdef USE_HTTPSRR + for(i = 0; i < d->numhttps_rrs; i++) + Curl_safefree(d->https_rrs[i].val); +#endif } +#ifdef USE_HTTPSRR + +/* + * @brief decode the DNS name in a binary RRData + * @param buf points to the buffer (in/out) + * @param remaining points to the remaining buffer length (in/out) + * @param dnsname returns the string form name on success + * @return is 1 for success, error otherwise + * + * The encoding here is defined in + * https://tools.ietf.org/html/rfc1035#section-3.1 + * + * The input buffer pointer will be modified so it points to + * just after the end of the DNS name encoding on output. (And + * that is why it is an "unsigned char **" :-) + */ +static CURLcode doh_decode_rdata_name(unsigned char **buf, size_t *remaining, + char **dnsname) +{ + unsigned char *cp = NULL; + int rem = 0; + unsigned char clen = 0; /* chunk len */ + struct dynbuf thename; + + DEBUGASSERT(buf && remaining && dnsname); + if(!buf || !remaining || !dnsname) + return CURLE_OUT_OF_MEMORY; + rem = (int)*remaining; + if(rem <= 0) { + Curl_dyn_free(&thename); + return CURLE_OUT_OF_MEMORY; + } + Curl_dyn_init(&thename, CURL_MAXLEN_host_name); + cp = *buf; + clen = *cp++; + if(clen == 0) { + /* special case - return "." as name */ + if(Curl_dyn_addn(&thename, ".", 1)) + return CURLE_OUT_OF_MEMORY; + } + while(clen) { + if(clen >= rem) { + Curl_dyn_free(&thename); + return CURLE_OUT_OF_MEMORY; + } + if(Curl_dyn_addn(&thename, cp, clen) || + Curl_dyn_addn(&thename, ".", 1)) + return CURLE_TOO_LARGE; + + cp += clen; + rem -= (clen + 1); + if(rem <= 0) { + Curl_dyn_free(&thename); + return CURLE_OUT_OF_MEMORY; + } + clen = *cp++; + } + *buf = cp; + *remaining = rem - 1; + *dnsname = Curl_dyn_ptr(&thename); + return CURLE_OK; +} + +static CURLcode doh_decode_rdata_alpn(unsigned char *rrval, size_t len, + char **alpns) +{ + /* + * spec here is as per draft-ietf-dnsop-svcb-https, section-7.1.1 + * encoding is catenated list of strings each preceded by a one + * octet length + * output is comma-sep list of the strings + * implementations may or may not handle quoting of comma within + * string values, so we might see a comma within the wire format + * version of a string, in which case we will precede that by a + * backslash - same goes for a backslash character, and of course + * we need to use two backslashes in strings when we mean one;-) + */ + int remaining = (int) len; + char *oval; + size_t i; + unsigned char *cp = rrval; + struct dynbuf dval; + + if(!alpns) + return CURLE_OUT_OF_MEMORY; + Curl_dyn_init(&dval, DYN_DOH_RESPONSE); + remaining = (int)len; + cp = rrval; + while(remaining > 0) { + size_t tlen = (size_t) *cp++; + + /* if not 1st time, add comma */ + if(remaining != (int)len && Curl_dyn_addn(&dval, ",", 1)) + goto err; + remaining--; + if(tlen > (size_t)remaining) + goto err; + /* add escape char if needed, clunky but easier to read */ + for(i = 0; i != tlen; i++) { + if('\\' == *cp || ',' == *cp) { + if(Curl_dyn_addn(&dval, "\\", 1)) + goto err; + } + if(Curl_dyn_addn(&dval, cp++, 1)) + goto err; + } + remaining -= (int)tlen; + } + /* this string is always null terminated */ + oval = Curl_dyn_ptr(&dval); + if(!oval) + goto err; + *alpns = oval; + return CURLE_OK; +err: + Curl_dyn_free(&dval); + return CURLE_BAD_CONTENT_ENCODING; +} + +#ifdef DEBUGBUILD +static CURLcode doh_test_alpn_escapes(void) +{ + /* we will use an example from draft-ietf-dnsop-svcb, figure 10 */ + static unsigned char example[] = { + 0x08, /* length 8 */ + 0x66, 0x5c, 0x6f, 0x6f, 0x2c, 0x62, 0x61, 0x72, /* value "f\\oo,bar" */ + 0x02, /* length 2 */ + 0x68, 0x32 /* value "h2" */ + }; + size_t example_len = sizeof(example); + char *aval = NULL; + static const char *expected = "f\\\\oo\\,bar,h2"; + + if(doh_decode_rdata_alpn(example, example_len, &aval) != CURLE_OK) + return CURLE_BAD_CONTENT_ENCODING; + if(strlen(aval) != strlen(expected)) + return CURLE_BAD_CONTENT_ENCODING; + if(memcmp(aval, expected, strlen(aval))) + return CURLE_BAD_CONTENT_ENCODING; + return CURLE_OK; +} +#endif + +static CURLcode doh_resp_decode_httpsrr(unsigned char *rrval, size_t len, + struct Curl_https_rrinfo **hrr) +{ + size_t remaining = len; + unsigned char *cp = rrval; + uint16_t pcode = 0, plen = 0; + struct Curl_https_rrinfo *lhrr = NULL; + char *dnsname = NULL; + +#ifdef DEBUGBUILD + /* a few tests of escaping, should not be here but ok for now */ + if(doh_test_alpn_escapes() != CURLE_OK) + return CURLE_OUT_OF_MEMORY; +#endif + lhrr = calloc(1, sizeof(struct Curl_https_rrinfo)); + if(!lhrr) + return CURLE_OUT_OF_MEMORY; + lhrr->val = Curl_memdup(rrval, len); + if(!lhrr->val) + goto err; + lhrr->len = len; + if(remaining <= 2) + goto err; + lhrr->priority = (uint16_t)((cp[0] << 8) + cp[1]); + cp += 2; + remaining -= (uint16_t)2; + if(doh_decode_rdata_name(&cp, &remaining, &dnsname) != CURLE_OK) + goto err; + lhrr->target = dnsname; + while(remaining >= 4) { + pcode = (uint16_t)((*cp << 8) + (*(cp + 1))); + cp += 2; + plen = (uint16_t)((*cp << 8) + (*(cp + 1))); + cp += 2; + remaining -= 4; + if(pcode == HTTPS_RR_CODE_ALPN) { + if(doh_decode_rdata_alpn(cp, plen, &lhrr->alpns) != CURLE_OK) + goto err; + } + if(pcode == HTTPS_RR_CODE_NO_DEF_ALPN) + lhrr->no_def_alpn = TRUE; + else if(pcode == HTTPS_RR_CODE_IPV4) { + if(!plen) + goto err; + lhrr->ipv4hints = Curl_memdup(cp, plen); + if(!lhrr->ipv4hints) + goto err; + lhrr->ipv4hints_len = (size_t)plen; + } + else if(pcode == HTTPS_RR_CODE_ECH) { + if(!plen) + goto err; + lhrr->echconfiglist = Curl_memdup(cp, plen); + if(!lhrr->echconfiglist) + goto err; + lhrr->echconfiglist_len = (size_t)plen; + } + else if(pcode == HTTPS_RR_CODE_IPV6) { + if(!plen) + goto err; + lhrr->ipv6hints = Curl_memdup(cp, plen); + if(!lhrr->ipv6hints) + goto err; + lhrr->ipv6hints_len = (size_t)plen; + } + if(plen > 0 && plen <= remaining) { + cp += plen; + remaining -= plen; + } + } + DEBUGASSERT(!remaining); + *hrr = lhrr; + return CURLE_OK; +err: + if(lhrr) { + Curl_safefree(lhrr->target); + Curl_safefree(lhrr->echconfiglist); + Curl_safefree(lhrr->val); + Curl_safefree(lhrr->alpns); + Curl_safefree(lhrr); + } + return CURLE_OUT_OF_MEMORY; +} + +# ifdef DEBUGBUILD +static 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); + if(hrr->alpns) + infof(data, "HTTPS RR: alpns %s", hrr->alpns); + else + infof(data, "HTTPS RR: no alpns"); + if(hrr->no_def_alpn) + infof(data, "HTTPS RR: no_def_alpn set"); + else + infof(data, "HTTPS RR: no_def_alpn not set"); + if(hrr->ipv4hints) { + doh_print_buf(data, "HTTPS RR: ipv4hints", + hrr->ipv4hints, hrr->ipv4hints_len); + } + else + infof(data, "HTTPS RR: no ipv4hints"); + if(hrr->echconfiglist) { + doh_print_buf(data, "HTTPS RR: ECHConfigList", + hrr->echconfiglist, hrr->echconfiglist_len); + } + else + infof(data, "HTTPS RR: no ECHConfigList"); + if(hrr->ipv6hints) { + doh_print_buf(data, "HTTPS RR: ipv6hint", + hrr->ipv6hints, hrr->ipv6hints_len); + } + else + infof(data, "HTTPS RR: no ipv6hints"); + return; +} +# endif +#endif + CURLcode Curl_doh_is_resolved(struct Curl_easy *data, struct Curl_dns_entry **dnsp) { CURLcode result; - struct dohdata *dohp = data->req.doh; + struct doh_probes *dohp = data->req.doh; *dnsp = NULL; /* defaults to no response */ if(!dohp) return CURLE_OUT_OF_MEMORY; - if(!dohp->probe[DOH_PROBE_SLOT_IPADDR_V4].easy && - !dohp->probe[DOH_PROBE_SLOT_IPADDR_V6].easy) { + if(dohp->probe[DOH_SLOT_IPV4].easy_mid < 0 && + dohp->probe[DOH_SLOT_IPV6].easy_mid < 0) { failf(data, "Could not DoH-resolve: %s", data->state.async.hostname); - return CONN_IS_PROXIED(data->conn)?CURLE_COULDNT_RESOLVE_PROXY: + return CONN_IS_PROXIED(data->conn) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST; } else if(!dohp->pending) { - DOHcode rc[DOH_PROBE_SLOTS] = { - DOH_OK, DOH_OK - }; + DOHcode rc[DOH_SLOT_COUNT]; struct dohentry de; int slot; + + memset(rc, 0, sizeof(rc)); /* remove DoH handles from multi handle and close them */ - for(slot = 0; slot < DOH_PROBE_SLOTS; slot++) { - curl_multi_remove_handle(data->multi, dohp->probe[slot].easy); - Curl_close(&dohp->probe[slot].easy); - } + Curl_doh_close(data); /* parse the responses, create the struct and return it! */ de_init(&de); - for(slot = 0; slot < DOH_PROBE_SLOTS; slot++) { - struct dnsprobe *p = &dohp->probe[slot]; + for(slot = 0; slot < DOH_SLOT_COUNT; slot++) { + struct doh_probe *p = &dohp->probe[slot]; if(!p->dnstype) continue; - rc[slot] = doh_decode(Curl_dyn_uptr(&p->serverdoh), - Curl_dyn_len(&p->serverdoh), - p->dnstype, - &de); - Curl_dyn_free(&p->serverdoh); + rc[slot] = doh_resp_decode(Curl_dyn_uptr(&p->resp_body), + Curl_dyn_len(&p->resp_body), + p->dnstype, &de); + Curl_dyn_free(&p->resp_body); #ifndef CURL_DISABLE_VERBOSE_STRINGS if(rc[slot]) { infof(data, "DoH: %s type %s for %s", doh_strerror(rc[slot]), - type2name(p->dnstype), dohp->host); + doh_type2name(p->dnstype), dohp->host); } #endif } /* next slot */ result = CURLE_COULDNT_RESOLVE_HOST; /* until we know better */ - if(!rc[DOH_PROBE_SLOT_IPADDR_V4] || !rc[DOH_PROBE_SLOT_IPADDR_V6]) { + if(!rc[DOH_SLOT_IPV4] || !rc[DOH_SLOT_IPV6]) { /* we have an address, of one kind or other */ struct Curl_dns_entry *dns; struct Curl_addrinfo *ai; if(Curl_trc_ft_is_verbose(data, &Curl_doh_trc)) { - infof(data, "[DoH] Host name: %s", dohp->host); - showdoh(data, &de); + infof(data, "[DoH] hostname: %s", dohp->host); + doh_show(data, &de); } result = doh2ai(&de, dohp->host, dohp->port, &ai); @@ -974,7 +1354,7 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); /* we got a response, store it in the cache */ - dns = Curl_cache_addr(data, ai, dohp->host, 0, dohp->port); + dns = Curl_cache_addr(data, ai, dohp->host, 0, dohp->port, FALSE); if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); @@ -991,10 +1371,26 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, } /* address processing done */ /* Now process any build-specific attributes retrieved from DNS */ +#ifdef USE_HTTPSRR + if(de.numhttps_rrs > 0 && result == CURLE_OK && *dnsp) { + struct Curl_https_rrinfo *hrr = NULL; + result = doh_resp_decode_httpsrr(de.https_rrs->val, de.https_rrs->len, + &hrr); + if(result) { + infof(data, "Failed to decode HTTPS RR"); + return result; + } + infof(data, "Some HTTPS RR to process"); +# ifdef DEBUGBUILD + doh_print_httpsrr(data, hrr); +# endif + (*dnsp)->hinfo = hrr; + } +#endif /* All done */ de_cleanup(&de); - Curl_safefree(data->req.doh); + Curl_doh_cleanup(data); return result; } /* !dohp->pending */ @@ -1003,4 +1399,44 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, return CURLE_OK; } +void Curl_doh_close(struct Curl_easy *data) +{ + struct doh_probes *doh = data->req.doh; + if(doh && data->multi) { + struct Curl_easy *probe_data; + curl_off_t mid; + size_t slot; + for(slot = 0; slot < DOH_SLOT_COUNT; slot++) { + mid = doh->probe[slot].easy_mid; + if(mid < 0) + continue; + doh->probe[slot].easy_mid = -1; + /* should have been called before data is removed from multi handle */ + DEBUGASSERT(data->multi); + probe_data = data->multi ? Curl_multi_get_handle(data->multi, mid) : + NULL; + if(!probe_data) { + DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%" + FMT_OFF_T " not found!", + doh->probe[slot].easy_mid)); + continue; + } + /* data->multi might already be reset at this time */ + curl_multi_remove_handle(data->multi, probe_data); + Curl_close(&probe_data); + } + } +} + +void Curl_doh_cleanup(struct Curl_easy *data) +{ + struct doh_probes *doh = data->req.doh; + if(doh) { + Curl_doh_close(data); + curl_slist_free_all(doh->req_hds); + data->req.doh->req_hds = NULL; + Curl_safefree(data->req.doh); + } +} + #endif /* CURL_DISABLE_DOH */ diff --git a/deps/curl/lib/doh.h b/deps/curl/lib/doh.h index ffcf7a03..aae32a65 100644 --- a/deps/curl/lib/doh.h +++ b/deps/curl/lib/doh.h @@ -26,6 +26,9 @@ #include "urldata.h" #include "curl_addrinfo.h" +#ifdef USE_HTTPSRR +# include +#endif #ifndef CURL_DISABLE_DOH @@ -51,22 +54,44 @@ typedef enum { DNS_TYPE_NS = 2, DNS_TYPE_CNAME = 5, DNS_TYPE_AAAA = 28, - DNS_TYPE_DNAME = 39 /* RFC6672 */ + DNS_TYPE_DNAME = 39, /* RFC6672 */ + DNS_TYPE_HTTPS = 65 } DNStype; /* one of these for each DoH request */ -struct dnsprobe { - CURL *easy; +struct doh_probe { + curl_off_t easy_mid; /* multi id of easy handle doing the lookup */ DNStype dnstype; - unsigned char dohbuffer[512]; - size_t dohlen; - struct dynbuf serverdoh; + unsigned char req_body[512]; + size_t req_body_len; + struct dynbuf resp_body; }; -struct dohdata { - struct curl_slist *headers; - struct dnsprobe probe[DOH_PROBE_SLOTS]; - unsigned int pending; /* still outstanding requests */ +enum doh_slot_num { + /* Explicit values for first two symbols so as to match hard-coded + * constants in existing code + */ + DOH_SLOT_IPV4 = 0, /* make 'V4' stand out for readability */ + DOH_SLOT_IPV6 = 1, /* 'V6' likewise */ + + /* Space here for (possibly build-specific) additional slot definitions */ +#ifdef USE_HTTPSRR + DOH_SLOT_HTTPS_RR = 2, /* for HTTPS RR */ +#endif + + /* for example */ + /* #ifdef WANT_DOH_FOOBAR_TXT */ + /* DOH_PROBE_SLOT_FOOBAR_TXT, */ + /* #endif */ + + /* AFTER all slot definitions, establish how many we have */ + DOH_SLOT_COUNT +}; + +struct doh_probes { + struct curl_slist *req_hds; + struct doh_probe probe[DOH_SLOT_COUNT]; + unsigned int pending; /* still outstanding probes */ int port; const char *host; }; @@ -84,10 +109,9 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, CURLcode Curl_doh_is_resolved(struct Curl_easy *data, struct Curl_dns_entry **dns); -int Curl_doh_getsock(struct connectdata *conn, curl_socket_t *socks); - #define DOH_MAX_ADDR 24 #define DOH_MAX_CNAME 4 +#define DOH_MAX_HTTPS 4 struct dohaddr { int type; @@ -97,27 +121,62 @@ struct dohaddr { } ip; }; +#ifdef USE_HTTPSRR + +/* + * These are the code points for DNS wire format SvcParams as + * per draft-ietf-dnsop-svcb-https + * Not all are supported now, and even those that are may need + * more work in future to fully support the spec. + */ +#define HTTPS_RR_CODE_ALPN 0x01 +#define HTTPS_RR_CODE_NO_DEF_ALPN 0x02 +#define HTTPS_RR_CODE_PORT 0x03 +#define HTTPS_RR_CODE_IPV4 0x04 +#define HTTPS_RR_CODE_ECH 0x05 +#define HTTPS_RR_CODE_IPV6 0x06 + +/* + * These may need escaping when found within an ALPN string + * value. + */ +#define COMMA_CHAR ',' +#define BACKSLASH_CHAR '\\' + +struct dohhttps_rr { + uint16_t len; /* raw encoded length */ + unsigned char *val; /* raw encoded octets */ +}; +#endif + struct dohentry { struct dynbuf cname[DOH_MAX_CNAME]; struct dohaddr addr[DOH_MAX_ADDR]; int numaddr; unsigned int ttl; int numcname; +#ifdef USE_HTTPSRR + struct dohhttps_rr https_rrs[DOH_MAX_HTTPS]; + int numhttps_rrs; +#endif }; +void Curl_doh_close(struct Curl_easy *data); +void Curl_doh_cleanup(struct Curl_easy *data); -#ifdef DEBUGBUILD -DOHcode doh_encode(const char *host, - DNStype dnstype, - unsigned char *dnsp, /* buffer */ - size_t len, /* buffer size */ - size_t *olen); /* output length */ -DOHcode doh_decode(const unsigned char *doh, - size_t dohlen, - DNStype dnstype, - struct dohentry *d); -void de_init(struct dohentry *d); -void de_cleanup(struct dohentry *d); +#ifdef UNITTESTS +UNITTEST DOHcode doh_req_encode(const char *host, + DNStype dnstype, + unsigned char *dnsp, /* buffer */ + size_t len, /* buffer size */ + size_t *olen); /* output length */ +UNITTEST DOHcode doh_resp_decode(const unsigned char *doh, + size_t dohlen, + DNStype dnstype, + struct dohentry *d); + +UNITTEST void de_init(struct dohentry *d); +UNITTEST void de_cleanup(struct dohentry *d); #endif extern struct curl_trc_feat Curl_doh_trc; diff --git a/deps/curl/lib/dynbuf.c b/deps/curl/lib/dynbuf.c index a4c599d1..eab07efb 100644 --- a/deps/curl/lib/dynbuf.c +++ b/deps/curl/lib/dynbuf.c @@ -51,7 +51,7 @@ void Curl_dyn_init(struct dynbuf *s, size_t toobig) } /* - * free the buffer and re-init the necessary fields. It doesn't touch the + * free the buffer and re-init the necessary fields. It does not touch the * 'init' field and thus this buffer can be reused to add data to again. */ void Curl_dyn_free(struct dynbuf *s) @@ -71,7 +71,7 @@ static CURLcode dyn_nappend(struct dynbuf *s, size_t a = s->allc; size_t fit = len + indx + 1; /* new string + old string + zero byte */ - /* try to detect if there's rubbish in the struct */ + /* try to detect if there is rubbish in the struct */ DEBUGASSERT(s->init == DYNINIT); DEBUGASSERT(s->toobig); DEBUGASSERT(indx < s->toobig); @@ -213,7 +213,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) } /* If we failed, we cleanup the whole buffer and return error */ Curl_dyn_free(s); - return CURLE_OK; + return CURLE_OUT_OF_MEMORY; #endif } diff --git a/deps/curl/lib/dynhds.c b/deps/curl/lib/dynhds.c index d7548959..2c92ca63 100644 --- a/deps/curl/lib/dynhds.c +++ b/deps/curl/lib/dynhds.c @@ -141,7 +141,7 @@ void Curl_dynhds_set_opts(struct dynhds *dynhds, int opts) struct dynhds_entry *Curl_dynhds_getn(struct dynhds *dynhds, size_t n) { DEBUGASSERT(dynhds); - return (n < dynhds->hds_len)? dynhds->hds[n] : NULL; + return (n < dynhds->hds_len) ? dynhds->hds[n] : NULL; } struct dynhds_entry *Curl_dynhds_get(struct dynhds *dynhds, const char *name, @@ -272,10 +272,10 @@ CURLcode Curl_dynhds_h1_add_line(struct dynhds *dynhds, CURLcode Curl_dynhds_h1_cadd_line(struct dynhds *dynhds, const char *line) { - return Curl_dynhds_h1_add_line(dynhds, line, line? strlen(line) : 0); + return Curl_dynhds_h1_add_line(dynhds, line, line ? strlen(line) : 0); } -#ifdef DEBUGBUILD +#ifdef UNITTESTS /* used by unit2602.c */ bool Curl_dynhds_contains(struct dynhds *dynhds, diff --git a/deps/curl/lib/dynhds.h b/deps/curl/lib/dynhds.h index 3b536000..fb162a30 100644 --- a/deps/curl/lib/dynhds.h +++ b/deps/curl/lib/dynhds.h @@ -95,6 +95,9 @@ struct dynhds_entry *Curl_dynhds_get(struct dynhds *dynhds, const char *name, size_t namelen); struct dynhds_entry *Curl_dynhds_cget(struct dynhds *dynhds, const char *name); +#ifdef UNITTESTS +/* used by unit2602.c */ + /** * Return TRUE iff one or more headers with the given name exist. */ @@ -115,20 +118,6 @@ size_t Curl_dynhds_count_name(struct dynhds *dynhds, */ size_t Curl_dynhds_ccount_name(struct dynhds *dynhds, const char *name); -/** - * Add a header, name + value, to `dynhds` at the end. Does *not* - * check for duplicate names. - */ -CURLcode Curl_dynhds_add(struct dynhds *dynhds, - const char *name, size_t namelen, - const char *value, size_t valuelen); - -/** - * Add a header, c-string name + value, to `dynhds` at the end. - */ -CURLcode Curl_dynhds_cadd(struct dynhds *dynhds, - const char *name, const char *value); - /** * Remove all entries with the given name. * Returns number of entries removed. @@ -146,19 +135,34 @@ size_t Curl_dynhds_cremove(struct dynhds *dynhds, const char *name); CURLcode Curl_dynhds_set(struct dynhds *dynhds, const char *name, size_t namelen, const char *value, size_t valuelen); +#endif CURLcode Curl_dynhds_cset(struct dynhds *dynhds, const char *name, const char *value); /** - * Add a single header from a HTTP/1.1 formatted line at the end. Line + * Add a header, name + value, to `dynhds` at the end. Does *not* + * check for duplicate names. + */ +CURLcode Curl_dynhds_add(struct dynhds *dynhds, + const char *name, size_t namelen, + const char *value, size_t valuelen); + +/** + * Add a header, c-string name + value, to `dynhds` at the end. + */ +CURLcode Curl_dynhds_cadd(struct dynhds *dynhds, + const char *name, const char *value); + +/** + * Add a single header from an HTTP/1.1 formatted line at the end. Line * may contain a delimiting \r\n or just \n. Any characters after * that will be ignored. */ CURLcode Curl_dynhds_h1_cadd_line(struct dynhds *dynhds, const char *line); /** - * Add a single header from a HTTP/1.1 formatted line at the end. Line + * Add a single header from an HTTP/1.1 formatted line at the end. Line * may contain a delimiting \r\n or just \n. Any characters after * that will be ignored. */ diff --git a/deps/curl/lib/easy.c b/deps/curl/lib/easy.c index d41ca32d..d16fa8c0 100644 --- a/deps/curl/lib/easy.c +++ b/deps/curl/lib/easy.c @@ -58,7 +58,6 @@ #include "multiif.h" #include "select.h" #include "cfilters.h" -#include "cw-out.h" #include "sendf.h" /* for failf function prototype */ #include "connect.h" /* for Curl_getconnectinfo */ #include "slist.h" @@ -114,6 +113,7 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT; #endif #if defined(_MSC_VER) && defined(_DLL) +# pragma warning(push) # pragma warning(disable:4232) /* MSVC extension, dllimport identity */ #endif @@ -131,7 +131,7 @@ curl_wcsdup_callback Curl_cwcsdup = Curl_wcsdup; #endif #if defined(_MSC_VER) && defined(_DLL) -# pragma warning(default:4232) /* MSVC extension, dllimport identity */ +# pragma warning(pop) #endif #ifdef DEBUGBUILD @@ -243,7 +243,7 @@ CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, global_init_lock(); if(initialized) { - /* Already initialized, don't do it again, but bump the variable anyway to + /* Already initialized, do not do it again, but bump the variable anyway to work like curl_global_init() and require the same amount of cleanup calls. */ initialized++; @@ -269,7 +269,8 @@ CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, /** * curl_global_cleanup() globally cleanups curl, uses the value of - * "easy_init_flags" to determine what needs to be cleaned up and what doesn't. + * "easy_init_flags" to determine what needs to be cleaned up and what does + * not. */ void curl_global_cleanup(void) { @@ -346,7 +347,7 @@ CURLsslset curl_global_sslset(curl_sslbackend id, const char *name, * curl_easy_init() is the external interface to alloc, setup and init an * easy handle that is returned. If anything goes wrong, NULL is returned. */ -struct Curl_easy *curl_easy_init(void) +CURL *curl_easy_init(void) { CURLcode result; struct Curl_easy *data; @@ -375,7 +376,7 @@ struct Curl_easy *curl_easy_init(void) return data; } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD struct socketmonitor { struct socketmonitor *next; /* the next node in the list or NULL */ @@ -390,25 +391,22 @@ struct events { int running_handles; /* store the returned number */ }; +#define DEBUG_EV_POLL 0 + /* events_timer * * Callback that gets called with a new value when the timeout should be * updated. */ - -static int events_timer(struct Curl_multi *multi, /* multi handle */ +static int events_timer(CURLM *multi, /* multi handle */ long timeout_ms, /* see above */ - void *userp) /* private callback pointer */ + void *userp) /* private callback pointer */ { struct events *ev = userp; (void)multi; - if(timeout_ms == -1) - /* timeout removed */ - timeout_ms = 0; - else if(timeout_ms == 0) - /* timeout is already reached! */ - timeout_ms = 1; /* trigger asap */ - +#if DEBUG_EV_POLL + fprintf(stderr, "events_timer: set timeout %ldms\n", timeout_ms); +#endif ev->ms = timeout_ms; ev->msbump = TRUE; return 0; @@ -451,7 +449,7 @@ static short socketcb2poll(int pollmask) * Callback that gets called with information about socket activity to * monitor. */ -static int events_socket(struct Curl_easy *easy, /* easy handle */ +static int events_socket(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ void *userp, /* private callback @@ -462,6 +460,8 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */ struct events *ev = userp; struct socketmonitor *m; struct socketmonitor *prev = NULL; + bool found = FALSE; + struct Curl_easy *data = easy; #if defined(CURL_DISABLE_VERBOSE_STRINGS) (void) easy; @@ -471,7 +471,7 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */ m = ev->list; while(m) { if(m->socket.fd == s) { - + found = TRUE; if(what == CURL_POLL_REMOVE) { struct socketmonitor *nxt = m->next; /* remove this node from the list of monitored sockets */ @@ -480,30 +480,29 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */ else ev->list = nxt; free(m); - m = nxt; - infof(easy, "socket cb: socket %" CURL_FORMAT_SOCKET_T - " REMOVED", s); + infof(data, "socket cb: socket %" FMT_SOCKET_T " REMOVED", s); } else { /* 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(easy, "socket cb: socket %" CURL_FORMAT_SOCKET_T + infof(data, "socket cb: socket %" FMT_SOCKET_T " UPDATED as %s%s", s, - (what&CURL_POLL_IN)?"IN":"", - (what&CURL_POLL_OUT)?"OUT":""); + (what&CURL_POLL_IN) ? "IN" : "", + (what&CURL_POLL_OUT) ? "OUT" : ""); } break; } prev = m; m = m->next; /* move to next node */ } - if(!m) { + + if(!found) { if(what == CURL_POLL_REMOVE) { - /* this happens a bit too often, libcurl fix perhaps? */ - /* fprintf(stderr, - "%s: socket %d asked to be REMOVED but not present!\n", - __func__, s); */ + /* should not happen if our logic is correct, but is no drama. */ + DEBUGF(infof(data, "socket cb: asked to REMOVE socket %" + FMT_SOCKET_T "but not present!", s)); + DEBUGASSERT(0); } else { m = malloc(sizeof(struct socketmonitor)); @@ -513,10 +512,9 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */ m->socket.events = socketcb2poll(what); m->socket.revents = 0; ev->list = m; - infof(easy, "socket cb: socket %" CURL_FORMAT_SOCKET_T - " ADDED as %s%s", s, - (what&CURL_POLL_IN)?"IN":"", - (what&CURL_POLL_OUT)?"OUT":""); + infof(data, "socket cb: socket %" FMT_SOCKET_T " ADDED as %s%s", s, + (what&CURL_POLL_IN) ? "IN" : "", + (what&CURL_POLL_OUT) ? "OUT" : ""); } else return CURLE_OUT_OF_MEMORY; @@ -564,14 +562,15 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) int pollrc; int i; struct curltime before; - struct curltime after; /* populate the fds[] array */ for(m = ev->list, f = &fds[0]; m; m = m->next) { f->fd = m->socket.fd; f->events = m->socket.events; f->revents = 0; - /* fprintf(stderr, "poll() %d check socket %d\n", numfds, f->fd); */ +#if DEBUG_EV_POLL + fprintf(stderr, "poll() %d check socket %d\n", numfds, f->fd); +#endif f++; numfds++; } @@ -579,12 +578,27 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) /* get the time stamp to use to figure out how long poll takes */ before = Curl_now(); - /* wait for activity or timeout */ - pollrc = Curl_poll(fds, numfds, ev->ms); - if(pollrc < 0) - return CURLE_UNRECOVERABLE_POLL; - - after = Curl_now(); + if(numfds) { + /* wait for activity or timeout */ +#if DEBUG_EV_POLL + fprintf(stderr, "poll(numfds=%d, timeout=%ldms)\n", numfds, ev->ms); +#endif + pollrc = Curl_poll(fds, (unsigned int)numfds, ev->ms); +#if DEBUG_EV_POLL + fprintf(stderr, "poll(numfds=%d, timeout=%ldms) -> %d\n", + numfds, ev->ms, pollrc); +#endif + if(pollrc < 0) + return CURLE_UNRECOVERABLE_POLL; + } + else { +#if DEBUG_EV_POLL + fprintf(stderr, "poll, but no fds, wait timeout=%ldms\n", ev->ms); +#endif + pollrc = 0; + if(ev->ms > 0) + Curl_wait_ms(ev->ms); + } ev->msbump = FALSE; /* reset here */ @@ -597,26 +611,37 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) } else { /* here pollrc is > 0 */ + struct Curl_llist_node *e = Curl_llist_head(&multi->process); + struct Curl_easy *data; + DEBUGASSERT(e); + data = Curl_node_elem(e); + DEBUGASSERT(data); /* loop over the monitored sockets to see which ones had activity */ - for(i = 0; i< numfds; i++) { + for(i = 0; i < numfds; i++) { if(fds[i].revents) { /* socket activity, tell libcurl */ int act = poll2cselect(fds[i].revents); /* convert */ - infof(multi->easyp, - "call curl_multi_socket_action(socket " - "%" CURL_FORMAT_SOCKET_T ")", fds[i].fd); + + /* sending infof "randomly" to the first easy handle */ + infof(data, "call curl_multi_socket_action(socket " + "%" FMT_SOCKET_T ")", (curl_socket_t)fds[i].fd); mcode = curl_multi_socket_action(multi, fds[i].fd, act, &ev->running_handles); } } - if(!ev->msbump) { + + if(!ev->msbump && ev->ms >= 0) { /* 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 = Curl_timediff(after, before); + timediff_t timediff = Curl_timediff(Curl_now(), before); if(timediff > 0) { +#if DEBUG_EV_POLL + fprintf(stderr, "poll timeout %ldms not updated, decrease by " + "time spent %ldms\n", ev->ms, (long)timediff); +#endif if(timediff > ev->ms) ev->ms = 0; else @@ -628,7 +653,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) if(mcode) return CURLE_URL_MALFORMAT; - /* we don't really care about the "msgs_in_queue" value returned in the + /* we do not really care about the "msgs_in_queue" value returned in the second argument */ msg = curl_multi_info_read(multi, &pollrc); if(msg) { @@ -649,15 +674,15 @@ 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 = {2, 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); return wait_or_timeout(multi, &evs); } -#else /* CURLDEBUG */ -/* when not built with debug, this function doesn't exist */ +#else /* DEBUGBUILD */ +/* when not built with debug, this function does not exist */ #define easy_events(x) CURLE_NOT_BUILT_IN #endif @@ -707,7 +732,7 @@ static CURLcode easy_transfer(struct Curl_multi *multi) * easy handle, destroys the multi handle and returns the easy handle's return * code. * - * REALITY: it can't just create and destroy the multi handle that easily. It + * REALITY: it cannot just create and destroy the multi handle that easily. It * needs to keep it around since if this easy handle is used again by this * function, the same multi handle must be reused so that the same pools and * caches can be used. @@ -729,6 +754,8 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events) /* clear this as early as possible */ data->set.errorbuffer[0] = 0; + data->state.os_errno = 0; + if(data->multi) { failf(data, "easy handle already used in multi handle"); return CURLE_FAILED_INIT; @@ -762,12 +789,13 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events) /* assign this after curl_multi_add_handle() */ data->multi_easy = multi; - sigpipe_ignore(data, &pipe_st); + sigpipe_init(&pipe_st); + sigpipe_apply(data, &pipe_st); /* run the transfer */ result = events ? easy_events(multi) : easy_transfer(multi); - /* ignoring the return code isn't nice, but atm we can't really handle + /* ignoring the return code is not nice, but atm we cannot really handle a failure here, room for future improvement! */ (void)curl_multi_remove_handle(multi, data); @@ -782,12 +810,12 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events) * curl_easy_perform() is the external interface that performs a blocking * transfer as previously setup. */ -CURLcode curl_easy_perform(struct Curl_easy *data) +CURLcode curl_easy_perform(CURL *data) { return easy_perform(data, FALSE); } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD /* * curl_easy_perform_ev() is the external interface that performs a blocking * transfer using the event-based API internally. @@ -803,8 +831,9 @@ CURLcode curl_easy_perform_ev(struct Curl_easy *data) * curl_easy_cleanup() is the external interface to cleaning/freeing the given * easy handle. */ -void curl_easy_cleanup(struct Curl_easy *data) +void curl_easy_cleanup(CURL *ptr) { + struct Curl_easy *data = ptr; if(GOOD_EASY_HANDLE(data)) { SIGPIPE_VARIABLE(pipe_st); sigpipe_ignore(data, &pipe_st); @@ -818,7 +847,7 @@ void curl_easy_cleanup(struct Curl_easy *data) * information from a performed transfer and similar. */ #undef curl_easy_getinfo -CURLcode curl_easy_getinfo(struct Curl_easy *data, CURLINFO info, ...) +CURLcode curl_easy_getinfo(CURL *data, CURLINFO info, ...) { va_list arg; void *paramp; @@ -850,7 +879,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src) memset(dst->set.blobs, 0, BLOB_LAST * sizeof(struct curl_blob *)); /* duplicate all strings */ - for(i = (enum dupstring)0; i< STRING_LASTZEROTERMINATED; i++) { + for(i = (enum dupstring)0; i < STRING_LASTZEROTERMINATED; i++) { result = Curl_setstropt(&dst->set.str[i], src->set.str[i]); if(result) return result; @@ -892,8 +921,9 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src) * given input easy handle. The returned handle will be a new working handle * with all options set exactly as the input source handle. */ -struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) +CURL *curl_easy_duphandle(CURL *d) { + struct Curl_easy *data = d; struct Curl_easy *outcurl = calloc(1, sizeof(struct Curl_easy)); if(!outcurl) goto fail; @@ -911,8 +941,7 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) Curl_dyn_init(&outcurl->state.headerb, CURL_MAX_HTTP_HEADER); - /* the connection cache is setup on demand */ - outcurl->state.conn_cache = NULL; + /* the connection pool is setup on demand */ outcurl->state.lastconnect_id = -1; outcurl->state.recent_conn_id = -1; outcurl->id = -1; @@ -1009,7 +1038,9 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) goto fail; } #endif /* USE_ARES */ - +#ifndef CURL_DISABLE_HTTP + Curl_llist_init(&outcurl->state.httphdrs, NULL); +#endif Curl_initinfo(outcurl); outcurl->magic = CURLEASY_MAGIC_NUMBER; @@ -1038,9 +1069,10 @@ fail: * curl_easy_reset() is an external interface that allows an app to re- * initialize a session handle to the default values. */ -void curl_easy_reset(struct Curl_easy *data) +void curl_easy_reset(CURL *d) { - Curl_req_reset(&data->req, data); + struct Curl_easy *data = d; + Curl_req_hard_reset(&data->req, data); /* zero out UserDefined data: */ Curl_freeset(data); @@ -1079,16 +1111,18 @@ void curl_easy_reset(struct Curl_easy *data) * NOTE: This is one of few API functions that are allowed to be called from * within a callback. */ -CURLcode curl_easy_pause(struct Curl_easy *data, int action) +CURLcode curl_easy_pause(CURL *d, int action) { struct SingleRequest *k; CURLcode result = CURLE_OK; int oldstate; int newstate; bool recursive = FALSE; + bool keep_changed, unpause_read, not_all_paused; + struct Curl_easy *data = d; if(!GOOD_EASY_HANDLE(data) || !data->conn) - /* crazy input, don't continue */ + /* crazy input, do not continue */ return CURLE_BAD_FUNCTION_ARGUMENT; if(Curl_is_in_callback(data)) @@ -1098,54 +1132,55 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action) /* first switch off both pause bits then set the new pause bits */ newstate = (k->keepon &~ (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) | - ((action & CURLPAUSE_RECV)?KEEP_RECV_PAUSE:0) | - ((action & CURLPAUSE_SEND)?KEEP_SEND_PAUSE:0); + ((action & CURLPAUSE_RECV) ? KEEP_RECV_PAUSE : 0) | + ((action & CURLPAUSE_SEND) ? KEEP_SEND_PAUSE : 0); - if((newstate & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) == oldstate) { - /* Not changing any pause state, return */ - DEBUGF(infof(data, "pause: no change, early return")); - return CURLE_OK; - } + keep_changed = ((newstate & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) != oldstate); + not_all_paused = (newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) != + (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE); + unpause_read = ((k->keepon & ~newstate & KEEP_SEND_PAUSE) && + (data->mstate == MSTATE_PERFORMING || + data->mstate == MSTATE_RATELIMITING)); + /* Unpausing writes is detected on the next run in + * transfer.c:Curl_sendrecv(). This is because this may result + * in a transfer error if the application's callbacks fail */ - /* Unpause parts in active mime tree. */ - if((k->keepon & ~newstate & KEEP_SEND_PAUSE) && - (data->mstate == MSTATE_PERFORMING || - data->mstate == MSTATE_RATELIMITING)) { - result = Curl_creader_unpause(data); - if(result) - return result; - } - - /* put it back in the keepon */ + /* Set the new keepon state, so it takes effect no matter what error + * may happen afterwards. */ k->keepon = newstate; - if(!(newstate & KEEP_RECV_PAUSE)) { - Curl_conn_ev_data_pause(data, FALSE); - result = Curl_cw_out_flush(data); - if(result) - return result; - } - - /* if there's no error and we're not pausing both directions, we want - to have this handle checked soon */ - if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) != - (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) { - Curl_expire(data, 0, EXPIRE_RUN_NOW); /* get this handle going again */ - + /* If not completely pausing both directions now, run again in any case. */ + if(not_all_paused) { + Curl_expire(data, 0, EXPIRE_RUN_NOW); /* reset the too-slow time keeper */ data->state.keeps_speed.tv_sec = 0; - - if(!Curl_cw_out_is_paused(data)) - /* if not pausing again, force a recv/send check of this connection as - the data might've been read off the socket already */ - data->state.select_bits = CURL_CSELECT_IN | CURL_CSELECT_OUT; - if(data->multi) { - if(Curl_update_timer(data->multi)) - return CURLE_ABORTED_BY_CALLBACK; + /* Simulate socket events on next run for unpaused directions */ + if(!(newstate & KEEP_SEND_PAUSE)) + data->state.select_bits |= CURL_CSELECT_OUT; + if(!(newstate & KEEP_RECV_PAUSE)) + data->state.select_bits |= CURL_CSELECT_IN; + /* On changes, tell application to update its timers. */ + if(keep_changed && data->multi) { + if(Curl_update_timer(data->multi)) { + result = CURLE_ABORTED_BY_CALLBACK; + goto out; + } } } - if(!data->state.done) + if(unpause_read) { + result = Curl_creader_unpause(data); + if(result) + goto out; + } + + if(!(k->keepon & KEEP_RECV_PAUSE) && Curl_cwriter_is_paused(data)) { + Curl_conn_ev_data_pause(data, FALSE); + result = Curl_cwriter_unpause(data); + } + +out: + if(!result && !data->state.done && keep_changed) /* This transfer may have been moved in or out of the bundle, update the corresponding socket callback, if used */ result = Curl_updatesocket(data); @@ -1188,12 +1223,12 @@ static CURLcode easy_connection(struct Curl_easy *data, * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. * Returns CURLE_OK on success, error code on error. */ -CURLcode curl_easy_recv(struct Curl_easy *data, void *buffer, size_t buflen, - size_t *n) +CURLcode curl_easy_recv(CURL *d, void *buffer, size_t buflen, size_t *n) { CURLcode result; ssize_t n1; struct connectdata *c; + struct Curl_easy *data = d; if(Curl_is_in_callback(data)) return CURLE_RECURSIVE_API_CALL; @@ -1217,7 +1252,7 @@ CURLcode curl_easy_recv(struct Curl_easy *data, void *buffer, size_t buflen, return CURLE_OK; } -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS CURLcode Curl_connect_only_attach(struct Curl_easy *data) { CURLcode result; @@ -1234,7 +1269,7 @@ CURLcode Curl_connect_only_attach(struct Curl_easy *data) return CURLE_OK; } -#endif /* USE_WEBSOCKETS */ +#endif /* !CURL_DISABLE_WEBSOCKETS */ /* * Sends data over the connected socket. @@ -1259,7 +1294,7 @@ CURLcode Curl_senddata(struct Curl_easy *data, const void *buffer, Curl_attach_connection(data, c); sigpipe_ignore(data, &pipe_st); - result = Curl_conn_send(data, FIRSTSOCKET, buffer, buflen, n); + result = Curl_conn_send(data, FIRSTSOCKET, buffer, buflen, FALSE, n); sigpipe_restore(&pipe_st); if(result && result != CURLE_AGAIN) @@ -1271,11 +1306,11 @@ CURLcode Curl_senddata(struct Curl_easy *data, const void *buffer, * Sends data over the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. */ -CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer, - size_t buflen, size_t *n) +CURLcode curl_easy_send(CURL *d, const void *buffer, size_t buflen, size_t *n) { size_t written = 0; CURLcode result; + struct Curl_easy *data = d; if(Curl_is_in_callback(data)) return CURLE_RECURSIVE_API_CALL; @@ -1284,62 +1319,19 @@ CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer, return result; } -/* - * Wrapper to call functions in Curl_conncache_foreach() - * - * Returns always 0. - */ -static int conn_upkeep(struct Curl_easy *data, - struct connectdata *conn, - void *param) -{ - struct curltime *now = param; - - if(Curl_timediff(*now, conn->keepalive) <= data->set.upkeep_interval_ms) - return 0; - - /* briefly attach for action */ - Curl_attach_connection(data, conn); - if(conn->handler->connection_check) { - /* Do a protocol-specific keepalive check on the connection. */ - conn->handler->connection_check(data, conn, CONNCHECK_KEEPALIVE); - } - else { - /* Do the generic action on the FIRSTSOCKE filter chain */ - Curl_conn_keep_alive(data, conn, FIRSTSOCKET); - } - Curl_detach_connection(data); - - conn->keepalive = *now; - return 0; /* continue iteration */ -} - -static CURLcode upkeep(struct conncache *conn_cache, void *data) -{ - struct curltime now = Curl_now(); - /* Loop over every connection and make connection alive. */ - Curl_conncache_foreach(data, - conn_cache, - &now, - conn_upkeep); - return CURLE_OK; -} - /* * Performs connection upkeep for the given session handle. */ -CURLcode curl_easy_upkeep(struct Curl_easy *data) +CURLcode curl_easy_upkeep(CURL *d) { + struct Curl_easy *data = d; /* Verify that we got an easy handle we can work with. */ if(!GOOD_EASY_HANDLE(data)) return CURLE_BAD_FUNCTION_ARGUMENT; - if(data->multi_easy) { - /* Use the common function to keep connections alive. */ - return upkeep(&data->multi_easy->conn_cache, data); - } - else { - /* No connections, so just return success */ - return CURLE_OK; - } + if(Curl_is_in_callback(data)) + return CURLE_RECURSIVE_API_CALL; + + /* Use the common function to keep connections alive. */ + return Curl_cpool_upkeep(data); } diff --git a/deps/curl/lib/easygetopt.c b/deps/curl/lib/easygetopt.c index a0239a89..86833bf6 100644 --- a/deps/curl/lib/easygetopt.c +++ b/deps/curl/lib/easygetopt.c @@ -42,7 +42,7 @@ static struct curl_easyoption *lookup(const char *name, CURLoption id) } else { if((o->id == id) && !(o->flags & CURLOT_FLAG_ALIAS)) - /* don't match alias options */ + /* do not match alias options */ return o; } o++; diff --git a/deps/curl/lib/easyif.h b/deps/curl/lib/easyif.h index 6ce3483c..181ce38f 100644 --- a/deps/curl/lib/easyif.h +++ b/deps/curl/lib/easyif.h @@ -30,11 +30,11 @@ CURLcode Curl_senddata(struct Curl_easy *data, const void *buffer, size_t buflen, size_t *n); -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS CURLcode Curl_connect_only_attach(struct Curl_easy *data); #endif -#ifdef CURLDEBUG +#ifdef DEBUGBUILD CURL_EXTERN CURLcode curl_easy_perform_ev(struct Curl_easy *easy); #endif diff --git a/deps/curl/lib/easyoptions.c b/deps/curl/lib/easyoptions.c index 9c4438a1..81091c40 100644 --- a/deps/curl/lib/easyoptions.c +++ b/deps/curl/lib/easyoptions.c @@ -86,6 +86,7 @@ struct curl_easyoption Curl_easyopts[] = { {"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}, @@ -327,6 +328,7 @@ struct curl_easyoption Curl_easyopts[] = { 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}, @@ -375,6 +377,6 @@ struct curl_easyoption Curl_easyopts[] = { */ int Curl_easyopts_check(void) { - return ((CURLOPT_LASTENTRY%10000) != (324 + 1)); + return ((CURLOPT_LASTENTRY%10000) != (326 + 1)); } #endif diff --git a/deps/curl/lib/escape.c b/deps/curl/lib/escape.c index 5af00c35..eaad6d33 100644 --- a/deps/curl/lib/escape.c +++ b/deps/curl/lib/escape.c @@ -29,6 +29,8 @@ #include +struct Curl_easy; + #include "urldata.h" #include "warnless.h" #include "escape.h" @@ -53,24 +55,25 @@ 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(struct Curl_easy *data, const char *string, +char *curl_easy_escape(CURL *data, const char *string, int inlength) { size_t length; struct dynbuf d; (void)data; - if(inlength < 0) + if(!string || (inlength < 0)) return NULL; - Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH * 3); - - length = (inlength?(size_t)inlength:strlen(string)); + length = (inlength ? (size_t)inlength : strlen(string)); if(!length) return strdup(""); + Curl_dyn_init(&d, length * 3 + 1); + while(length--) { - unsigned char in = *string++; /* treat the characters unsigned */ + /* treat the characters unsigned */ + unsigned char in = (unsigned char)*string++; if(ISUNRESERVED(in)) { /* append this */ @@ -81,7 +84,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string, /* encode it */ const char hex[] = "0123456789ABCDEF"; char out[3]={'%'}; - out[1] = hex[in>>4]; + out[1] = hex[in >> 4]; out[2] = hex[in & 0xf]; if(Curl_dyn_addn(&d, out, 3)) return NULL; @@ -127,7 +130,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, DEBUGASSERT(string); DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */ - alloc = (length?length:strlen(string)); + alloc = (length ? length : strlen(string)); ns = malloc(alloc + 1); if(!ns) @@ -137,7 +140,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, *ostring = ns; while(alloc) { - unsigned char in = *string; + unsigned char in = (unsigned char)*string; if(('%' == in) && (alloc > 2) && ISXDIGIT(string[1]) && ISXDIGIT(string[2])) { /* this is two hexadecimal digits following a '%' */ @@ -157,7 +160,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, return CURLE_URL_MALFORMAT; } - *ns++ = in; + *ns++ = (char)in; } *ns = 0; /* terminate it */ @@ -175,12 +178,12 @@ 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(struct Curl_easy *data, const char *string, +char *curl_easy_unescape(CURL *data, const char *string, int length, int *olen) { char *str = NULL; (void)data; - if(length >= 0) { + if(string && (length >= 0)) { size_t inputlen = (size_t)length; size_t outputlen; CURLcode res = Curl_urldecode(string, inputlen, &str, &outputlen, @@ -222,8 +225,8 @@ void Curl_hexencode(const unsigned char *src, size_t len, /* input length */ while(len-- && (olen >= 3)) { /* clang-tidy warns on this line without this comment: */ /* NOLINTNEXTLINE(clang-analyzer-core.UndefinedBinaryOperatorResult) */ - *out++ = hex[(*src & 0xF0)>>4]; - *out++ = hex[*src & 0x0F]; + *out++ = (unsigned char)hex[(*src & 0xF0) >> 4]; + *out++ = (unsigned char)hex[*src & 0x0F]; ++src; olen -= 2; } diff --git a/deps/curl/lib/file.c b/deps/curl/lib/file.c index bee9e92e..4cd8d0ff 100644 --- a/deps/curl/lib/file.c +++ b/deps/curl/lib/file.c @@ -50,6 +50,14 @@ #include #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_DIRENT_H +#include +#endif + #include "strtoofft.h" #include "urldata.h" #include @@ -101,7 +109,7 @@ static CURLcode file_setup_connection(struct Curl_easy *data, */ const struct Curl_handler Curl_handler_file = { - "FILE", /* scheme */ + "file", /* scheme */ file_setup_connection, /* setup_connection */ file_do, /* do_it */ file_done, /* done */ @@ -115,6 +123,7 @@ const struct Curl_handler Curl_handler_file = { ZERO_NULL, /* perform_getsock */ file_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ 0, /* defport */ @@ -138,7 +147,7 @@ static CURLcode file_setup_connection(struct Curl_easy *data, /* * file_connect() gets called from Curl_protocol_connect() to allow us to - * do protocol-specific actions at connect-time. We emulate a + * do protocol-specific actions at connect-time. We emulate a * connect-then-transfer protocol and "connect" to the file here */ static CURLcode file_connect(struct Curl_easy *data, bool *done) @@ -168,18 +177,18 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done) return result; #ifdef DOS_FILESYSTEM - /* If the first character is a slash, and there's + /* If the first character is a slash, and there is something that looks like a drive at the beginning of - the path, skip the slash. If we remove the initial + the path, skip the slash. If we remove the initial slash in all cases, paths without drive letters end up - relative to the current directory which isn't how + relative to the current directory which is not how browsers work. Some browsers accept | instead of : as the drive letter separator, so we do too. On other platforms, we need the slash to indicate an - absolute pathname. On Windows, absolute paths start + absolute pathname. On Windows, absolute paths start with a drive letter. */ actual_path = real_path; @@ -214,7 +223,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done) * A leading slash in an AmigaDOS path denotes the parent * directory, and hence we block this as it is relative. * Absolute paths start with 'volumename:', so we check for - * this first. Failing that, we treat the path as a real unix + * this first. Failing that, we treat the path as a real Unix * path, but only if the application was compiled with -lunix. */ fd = -1; @@ -299,7 +308,7 @@ static CURLcode file_upload(struct Curl_easy *data) bool eos = FALSE; /* - * Since FILE: doesn't do the full init, we need to provide some extra + * Since FILE: does not do the full init, we need to provide some extra * assignments here. */ @@ -322,7 +331,7 @@ static CURLcode file_upload(struct Curl_easy *data) fd = open(file->path, mode, data->set.new_file_perms); if(fd < 0) { - failf(data, "Can't open %s for writing", file->path); + failf(data, "cannot open %s for writing", file->path); return CURLE_WRITE_ERROR; } @@ -334,7 +343,7 @@ static CURLcode file_upload(struct Curl_easy *data) if(data->state.resume_from < 0) { if(fstat(fd, &file_stat)) { close(fd); - failf(data, "Can't get the size of %s", file->path); + failf(data, "cannot get the size of %s", file->path); return CURLE_WRITE_ERROR; } data->state.resume_from = (curl_off_t)file_stat.st_size; @@ -404,13 +413,13 @@ out: * file_do() is the protocol-specific function for the do-phase, separated * from the connect-phase above. Other protocols merely setup the transfer in * the do-phase, to have it done in the main transfer loop but since some - * platforms we support don't allow select()ing etc on file handles (as + * platforms we support do not allow select()ing etc on file handles (as * opposed to sockets) we instead perform the whole do-operation in this * function. */ static CURLcode file_do(struct Curl_easy *data, bool *done) { - /* This implementation ignores the host name in conformance with + /* This implementation ignores the hostname in conformance with RFC 1738. Only local files (reachable via the standard file system) are supported. This means that files on remotely mounted directories (via NFS, Samba, NT sharing) can be accessed through a file:// URL @@ -446,12 +455,9 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) fstated = TRUE; } - if(fstated && !data->state.range && data->set.timecondition) { - if(!Curl_meets_timecondition(data, data->info.filetime)) { - *done = TRUE; - return CURLE_OK; - } - } + if(fstated && !data->state.range && data->set.timecondition && + !Curl_meets_timecondition(data, data->info.filetime)) + return CURLE_OK; if(fstated) { time_t filetime; @@ -459,17 +465,17 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) const struct tm *tm = &buffer; char header[80]; int headerlen; - char accept_ranges[24]= { "Accept-ranges: bytes\r\n" }; + static const char accept_ranges[]= { "Accept-ranges: bytes\r\n" }; if(expected_size >= 0) { - headerlen = msnprintf(header, sizeof(header), - "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", - expected_size); + headerlen = + msnprintf(header, sizeof(header), "Content-Length: %" FMT_OFF_T "\r\n", + expected_size); result = Curl_client_write(data, CLIENTWRITE_HEADER, header, headerlen); if(result) return result; result = Curl_client_write(data, CLIENTWRITE_HEADER, - accept_ranges, strlen(accept_ranges)); + accept_ranges, sizeof(accept_ranges) - 1); if(result != CURLE_OK) return result; } @@ -480,23 +486,26 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) return result; /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */ - headerlen = msnprintf(header, sizeof(header), - "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n%s", - 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, - data->req.no_body ? "": "\r\n"); + headerlen = + 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], + tm->tm_mday, + Curl_month[tm->tm_mon], + tm->tm_year + 1900, + tm->tm_hour, + tm->tm_min, + tm->tm_sec); result = Curl_client_write(data, CLIENTWRITE_HEADER, header, headerlen); + if(!result) + /* end of headers */ + result = Curl_client_write(data, CLIENTWRITE_HEADER, "\r\n", 2); if(result) return result; /* set the file size to make it available post transfer */ Curl_pgrsSetDownloadSize(data, expected_size); if(data->req.no_body) - return result; + return CURLE_OK; } /* Check whether file range has been specified */ @@ -508,7 +517,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) * of the stream if the filesize could be determined */ if(data->state.resume_from < 0) { if(!fstated) { - failf(data, "Can't get the size of file."); + failf(data, "cannot get the size of file."); return CURLE_READ_ERROR; } data->state.resume_from += (curl_off_t)statbuf.st_size; @@ -516,7 +525,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) if(data->state.resume_from > 0) { /* We check explicitly if we have a start offset, because - * expected_size may be -1 if we don't know how large the file is, + * expected_size may be -1 if we do not know how large the file is, * in which case we should not adjust it. */ if(data->state.resume_from <= expected_size) expected_size -= data->state.resume_from; @@ -543,49 +552,85 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) Curl_pgrsSetDownloadSize(data, expected_size); if(data->state.resume_from) { - if(data->state.resume_from != - lseek(fd, data->state.resume_from, SEEK_SET)) + if(!S_ISDIR(statbuf.st_mode)) { + if(data->state.resume_from != + lseek(fd, data->state.resume_from, SEEK_SET)) + return CURLE_BAD_DOWNLOAD_RESUME; + } + else { return CURLE_BAD_DOWNLOAD_RESUME; + } } result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen); if(result) goto out; - while(!result) { - ssize_t nread; - /* Don't fill a whole buffer if we want less than all data */ - size_t bytestoread; + if(!S_ISDIR(statbuf.st_mode)) { + while(!result) { + ssize_t nread; + /* Do not fill a whole buffer if we want less than all data */ + size_t bytestoread; - if(size_known) { - bytestoread = (expected_size < (curl_off_t)(xfer_blen-1)) ? - curlx_sotouz(expected_size) : (xfer_blen-1); + if(size_known) { + bytestoread = (expected_size < (curl_off_t)(xfer_blen-1)) ? + curlx_sotouz(expected_size) : (xfer_blen-1); + } + else + bytestoread = xfer_blen-1; + + nread = read(fd, xfer_buf, bytestoread); + + if(nread > 0) + xfer_buf[nread] = 0; + + if(nread <= 0 || (size_known && (expected_size == 0))) + break; + + if(size_known) + expected_size -= nread; + + result = Curl_client_write(data, CLIENTWRITE_BODY, xfer_buf, nread); + if(result) + goto out; + + if(Curl_pgrsUpdate(data)) + result = CURLE_ABORTED_BY_CALLBACK; + else + result = Curl_speedcheck(data, Curl_now()); + if(result) + goto out; } - else - bytestoread = xfer_blen-1; - - nread = read(fd, xfer_buf, bytestoread); - - if(nread > 0) - xfer_buf[nread] = 0; - - if(nread <= 0 || (size_known && (expected_size == 0))) - break; - - if(size_known) - expected_size -= nread; - - result = Curl_client_write(data, CLIENTWRITE_BODY, xfer_buf, nread); - if(result) - goto out; - - if(Curl_pgrsUpdate(data)) - result = CURLE_ABORTED_BY_CALLBACK; - else - result = Curl_speedcheck(data, Curl_now()); - if(result) - goto out; } + else { +#ifdef HAVE_OPENDIR + DIR *dir = opendir(file->path); + struct dirent *entry; + + if(!dir) { + result = CURLE_READ_ERROR; + goto out; + } + else { + while((entry = readdir(dir))) { + if(entry->d_name[0] != '.') { + result = Curl_client_write(data, CLIENTWRITE_BODY, + entry->d_name, strlen(entry->d_name)); + if(result) + break; + result = Curl_client_write(data, CLIENTWRITE_BODY, "\n", 1); + if(result) + break; + } + } + closedir(dir); + } +#else + failf(data, "Directory listing not yet implemented on this platform."); + result = CURLE_READ_ERROR; +#endif + } + if(Curl_pgrsUpdate(data)) result = CURLE_ABORTED_BY_CALLBACK; diff --git a/deps/curl/lib/fileinfo.h b/deps/curl/lib/fileinfo.h index ce009da0..0b3f56d9 100644 --- a/deps/curl/lib/fileinfo.h +++ b/deps/curl/lib/fileinfo.h @@ -30,7 +30,7 @@ struct fileinfo { struct curl_fileinfo info; - struct Curl_llist_element list; + struct Curl_llist_node list; struct dynbuf buf; }; diff --git a/deps/curl/lib/fopen.c b/deps/curl/lib/fopen.c index 0bdf2e11..7373e088 100644 --- a/deps/curl/lib/fopen.c +++ b/deps/curl/lib/fopen.c @@ -42,12 +42,12 @@ /* The dirslash() function breaks a null-terminated pathname string into directory and filename components then returns the directory component up - to, *AND INCLUDING*, a final '/'. If there is no directory in the path, + to, *AND INCLUDING*, a final '/'. If there is no directory in the path, this instead returns a "" string. This function returns a pointer to malloc'ed memory. - The input path to this function is expected to have a file name part. + The input path to this function is expected to have a filename part. */ #ifdef _WIN32 @@ -88,7 +88,7 @@ static char *dirslash(const char *path) * Curl_fopen() opens a file for writing with a temp name, to be renamed * to the final name when completed. If there is an existing file using this * name at the time of the open, this function will clone the mode from that - * file. if 'tempname' is non-NULL, it needs a rename after the file is + * file. if 'tempname' is non-NULL, it needs a rename after the file is * written. */ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, @@ -117,7 +117,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, dir = dirslash(filename); if(dir) { - /* The temp file name should not end up too long for the target file + /* The temp filename should not end up too long for the target file system */ tempstore = aprintf("%s%s.tmp", dir, randbuf); free(dir); diff --git a/deps/curl/lib/formdata.c b/deps/curl/lib/formdata.c index d6a1697a..cea61b22 100644 --- a/deps/curl/lib/formdata.c +++ b/deps/curl/lib/formdata.c @@ -26,6 +26,8 @@ #include +struct Curl_easy; + #include "formdata.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API) @@ -216,8 +218,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, struct curl_forms *forms = NULL; char *array_value = NULL; /* value read from an array */ - /* This is a state variable, that if TRUE means that we're parsing an - array that we got passed to us. If FALSE we're parsing the input + /* 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; @@ -260,7 +262,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, switch(option) { case CURLFORM_ARRAY: if(array_state) - /* we don't support an array from within an array */ + /* we do not support an array from within an array */ return_value = CURL_FORMADD_ILLEGAL_ARRAY; else { forms = va_arg(params, struct curl_forms *); @@ -282,8 +284,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, if(current_form->name) return_value = CURL_FORMADD_OPTION_TWICE; else { - char *name = array_state? - array_value:va_arg(params, char *); + char *name = array_state ? + array_value : va_arg(params, char *); if(name) current_form->name = name; /* store for the moment */ else @@ -295,7 +297,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, return_value = CURL_FORMADD_OPTION_TWICE; else current_form->namelength = - array_state?(size_t)array_value:(size_t)va_arg(params, long); + array_state ? (size_t)array_value : (size_t)va_arg(params, long); break; /* @@ -309,7 +311,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, return_value = CURL_FORMADD_OPTION_TWICE; else { char *value = - array_state?array_value:va_arg(params, char *); + array_state ? array_value : va_arg(params, char *); if(value) current_form->value = value; /* store for the moment */ else @@ -318,22 +320,23 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, break; case CURLFORM_CONTENTSLENGTH: current_form->contentslength = - array_state?(size_t)array_value:(size_t)va_arg(params, long); + array_state ? (size_t)array_value : (size_t)va_arg(params, long); break; case CURLFORM_CONTENTLEN: current_form->flags |= CURL_HTTPPOST_LARGE; current_form->contentslength = - array_state?(curl_off_t)(size_t)array_value:va_arg(params, curl_off_t); + array_state ? (curl_off_t)(size_t)array_value : + va_arg(params, curl_off_t); break; - /* Get contents from a given file name */ + /* Get contents from a given filename */ case CURLFORM_FILECONTENT: if(current_form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE)) return_value = CURL_FORMADD_OPTION_TWICE; else { - const char *filename = array_state? - array_value:va_arg(params, char *); + const char *filename = array_state ? + array_value : va_arg(params, char *); if(filename) { current_form->value = strdup(filename); if(!current_form->value) @@ -351,7 +354,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, /* We upload a file */ case CURLFORM_FILE: { - const char *filename = array_state?array_value: + const char *filename = array_state ? array_value : va_arg(params, char *); if(current_form->value) { @@ -401,7 +404,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, return_value = CURL_FORMADD_OPTION_TWICE; else { char *buffer = - array_state?array_value:va_arg(params, char *); + array_state ? array_value : va_arg(params, char *); if(buffer) { current_form->buffer = buffer; /* store for the moment */ current_form->value = buffer; /* make it non-NULL to be accepted @@ -417,7 +420,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, return_value = CURL_FORMADD_OPTION_TWICE; else current_form->bufferlength = - array_state?(size_t)array_value:(size_t)va_arg(params, long); + array_state ? (size_t)array_value : (size_t)va_arg(params, long); break; case CURLFORM_STREAM: @@ -426,10 +429,10 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, return_value = CURL_FORMADD_OPTION_TWICE; else { char *userp = - array_state?array_value:va_arg(params, char *); + array_state ? array_value : va_arg(params, char *); if(userp) { current_form->userp = userp; - current_form->value = userp; /* this isn't strictly true but we + current_form->value = userp; /* 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 */ @@ -442,7 +445,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, case CURLFORM_CONTENTTYPE: { const char *contenttype = - array_state?array_value:va_arg(params, char *); + array_state ? array_value : va_arg(params, char *); if(current_form->contenttype) { if(current_form->flags & HTTPPOST_FILENAME) { if(contenttype) { @@ -485,8 +488,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, { /* this "cast increases required alignment of target type" but we consider it OK anyway */ - struct curl_slist *list = array_state? - (struct curl_slist *)(void *)array_value: + struct curl_slist *list = array_state ? + (struct curl_slist *)(void *)array_value : va_arg(params, struct curl_slist *); if(current_form->contentheader) @@ -499,7 +502,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, case CURLFORM_FILENAME: case CURLFORM_BUFFER: { - const char *filename = array_state?array_value: + const char *filename = array_state ? array_value : va_arg(params, char *); if(current_form->showfilename) return_value = CURL_FORMADD_OPTION_TWICE; @@ -569,7 +572,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, if(((form->flags & HTTPPOST_FILENAME) || (form->flags & HTTPPOST_BUFFER)) && !form->contenttype) { - char *f = (form->flags & HTTPPOST_BUFFER)? + char *f = (form->flags & HTTPPOST_BUFFER) ? form->showfilename : form->value; char const *type; type = Curl_mime_contenttype(f); @@ -599,12 +602,12 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, } if(!(form->flags & HTTPPOST_PTRNAME) && (form == first_form) ) { - /* Note that there's small risk that form->name is NULL here if the + /* Note that there is small risk that form->name is NULL here if the app passed in a bad combo, so we better check for that first. */ if(form->name) { /* copy name (without strdup; possibly not null-terminated) */ - form->name = Curl_memdup0(form->name, form->namelength? - form->namelength: + form->name = Curl_memdup0(form->name, form->namelength ? + form->namelength : strlen(form->name)); } if(!form->name) { @@ -764,7 +767,7 @@ void curl_formfree(struct curl_httppost *form) ) free(form->contents); /* free the contents */ free(form->contenttype); /* free the content type */ - free(form->showfilename); /* free the faked file name */ + free(form->showfilename); /* free the faked filename */ free(form); /* free the struct */ form = next; } while(form); /* continue */ @@ -790,10 +793,10 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) /* 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(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) - return fseeko(stream, (off_t)offset, whence); -#elif defined(HAVE__FSEEKI64) +#if defined(HAVE__FSEEKI64) 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; @@ -811,7 +814,7 @@ static int fseeko_wrapper(void *stream, curl_off_t offset, int whence) * a NULL pointer in the 'data' argument. */ -CURLcode Curl_getformdata(struct Curl_easy *data, +CURLcode Curl_getformdata(CURL *data, curl_mimepart *finalform, struct curl_httppost *post, curl_read_callback fread_func) @@ -880,10 +883,10 @@ CURLcode Curl_getformdata(struct Curl_easy *data, if(post->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE)) { if(!strcmp(file->contents, "-")) { - /* There are a few cases where the code below won't work; in + /* There are a few cases where the code below will not work; in particular, freopen(stdin) by the caller is not guaranteed to result as expected. This feature has been kept for backward - compatibility: use of "-" pseudo file name should be avoided. */ + compatibility: use of "-" pseudo filename should be avoided. */ result = curl_mime_data_cb(part, (curl_off_t) -1, (curl_read_callback) fread, fseeko_wrapper, @@ -896,7 +899,8 @@ CURLcode Curl_getformdata(struct Curl_easy *data, } else if(post->flags & HTTPPOST_BUFFER) result = curl_mime_data(part, post->buffer, - post->bufferlength? post->bufferlength: -1); + post->bufferlength ? + post->bufferlength : -1); else if(post->flags & HTTPPOST_CALLBACK) { /* the contents should be read with the callback and the size is set with the contentslength */ @@ -915,7 +919,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data, } } - /* Set fake file name. */ + /* Set fake filename. */ if(!result && post->showfilename) if(post->more || (post->flags & (HTTPPOST_FILENAME | HTTPPOST_BUFFER | HTTPPOST_CALLBACK))) diff --git a/deps/curl/lib/formdata.h b/deps/curl/lib/formdata.h index af466249..0e35e189 100644 --- a/deps/curl/lib/formdata.h +++ b/deps/curl/lib/formdata.h @@ -38,8 +38,8 @@ struct FormInfo { long flags; char *buffer; /* pointer to existing buffer used for file upload */ size_t bufferlength; - char *showfilename; /* The file name to show. If not set, the actual - file name will be used */ + 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; @@ -49,7 +49,7 @@ struct FormInfo { bool showfilename_alloc; }; -CURLcode Curl_getformdata(struct Curl_easy *data, +CURLcode Curl_getformdata(CURL *data, curl_mimepart *, struct curl_httppost *post, curl_read_callback fread_func); diff --git a/deps/curl/lib/ftp.c b/deps/curl/lib/ftp.c index 2511bd4b..16ab0af0 100644 --- a/deps/curl/lib/ftp.c +++ b/deps/curl/lib/ftp.c @@ -95,19 +95,89 @@ #ifdef CURL_DISABLE_VERBOSE_STRINGS #define ftp_pasv_verbose(a,b,c,d) Curl_nop_stmt +#define FTP_CSTATE(c) "" +#define FTP_DSTATE(d) "" +#else /* CURL_DISABLE_VERBOSE_STRINGS */ + /* for tracing purposes */ +static const char * const ftp_state_names[]={ + "STOP", + "WAIT220", + "AUTH", + "USER", + "PASS", + "ACCT", + "PBSZ", + "PROT", + "CCC", + "PWD", + "SYST", + "NAMEFMT", + "QUOTE", + "RETR_PREQUOTE", + "STOR_PREQUOTE", + "POSTQUOTE", + "CWD", + "MKD", + "MDTM", + "TYPE", + "LIST_TYPE", + "RETR_TYPE", + "STOR_TYPE", + "SIZE", + "RETR_SIZE", + "STOR_SIZE", + "REST", + "RETR_REST", + "PORT", + "PRET", + "PASV", + "LIST", + "RETR", + "STOR", + "QUIT" +}; +#define FTP_CSTATE(c) ((c)? ftp_state_names[(c)->proto.ftpc.state] : "???") +#define FTP_DSTATE(d) (((d) && (d)->conn)? \ + ftp_state_names[(d)->conn->proto.ftpc.state] : "???") + +#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ + +/* This is the ONLY way to change FTP state! */ +static void _ftp_state(struct Curl_easy *data, + ftpstate newstate +#ifdef DEBUGBUILD + , int lineno #endif + ) +{ + struct connectdata *conn = data->conn; + struct ftp_conn *ftpc = &conn->proto.ftpc; + +#if defined(CURL_DISABLE_VERBOSE_STRINGS) +#ifdef DEBUGBUILD + (void)lineno; +#endif +#else /* CURL_DISABLE_VERBOSE_STRINGS */ + if(ftpc->state != newstate) +#ifdef DEBUGBUILD + CURL_TRC_FTP(data, "[%s] -> [%s] (line %d)", FTP_DSTATE(data), + ftp_state_names[newstate], lineno); +#else + CURL_TRC_FTP(data, "[%s] -> [%s]", FTP_DSTATE(data), + ftp_state_names[newstate]); +#endif +#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ + + ftpc->state = newstate; +} + /* Local API functions */ #ifndef DEBUGBUILD -static void _ftp_state(struct Curl_easy *data, - ftpstate newstate); #define ftp_state(x,y) _ftp_state(x,y) -#else -static void _ftp_state(struct Curl_easy *data, - ftpstate newstate, - int lineno); +#else /* !DEBUGBUILD */ #define ftp_state(x,y) _ftp_state(x,y,__LINE__) -#endif +#endif /* DEBUGBUILD */ static CURLcode ftp_sendquote(struct Curl_easy *data, struct connectdata *conn, @@ -118,7 +188,7 @@ static CURLcode ftp_regular_transfer(struct Curl_easy *data, bool *done); #ifndef CURL_DISABLE_VERBOSE_STRINGS static void ftp_pasv_verbose(struct Curl_easy *data, struct Curl_addrinfo *ai, - char *newhost, /* ascii version */ + char *newhost, /* ASCII version */ int port); #endif static CURLcode ftp_state_prepare_transfer(struct Curl_easy *data); @@ -163,7 +233,7 @@ static CURLcode ftp_dophase_done(struct Curl_easy *data, */ const struct Curl_handler Curl_handler_ftp = { - "FTP", /* scheme */ + "ftp", /* scheme */ ftp_setup_connection, /* setup_connection */ ftp_do, /* do_it */ ftp_done, /* done */ @@ -177,6 +247,7 @@ const struct Curl_handler Curl_handler_ftp = { ZERO_NULL, /* perform_getsock */ ftp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_FTP, /* defport */ @@ -194,7 +265,7 @@ const struct Curl_handler Curl_handler_ftp = { */ const struct Curl_handler Curl_handler_ftps = { - "FTPS", /* scheme */ + "ftps", /* scheme */ ftp_setup_connection, /* setup_connection */ ftp_do, /* do_it */ ftp_done, /* done */ @@ -208,6 +279,7 @@ const struct Curl_handler Curl_handler_ftps = { ZERO_NULL, /* perform_getsock */ ftp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_FTPS, /* defport */ @@ -218,11 +290,11 @@ const struct Curl_handler Curl_handler_ftps = { }; #endif -static void close_secondarysocket(struct Curl_easy *data, - struct connectdata *conn) +static void close_secondarysocket(struct Curl_easy *data) { + CURL_TRC_FTP(data, "[%s] closing DATA connection", FTP_DSTATE(data)); Curl_conn_close(data, SECONDARYSOCKET); - Curl_conn_cf_discard_all(data, conn, SECONDARYSOCKET); + Curl_conn_cf_discard_all(data, data->conn, SECONDARYSOCKET); } /* @@ -230,10 +302,10 @@ static void close_secondarysocket(struct Curl_easy *data, * requests on files respond with headers passed to the client/stdout that * looked like HTTP ones. * - * This approach is not very 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. + * 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 @@ -255,7 +327,7 @@ static void freedirs(struct ftp_conn *ftpc) Curl_safefree(ftpc->newhost); } -#ifdef CURL_DO_LINEEND_CONV +#ifdef CURL_PREFER_LF_LINEENDS /*********************************************************************** * * Lineend Conversions @@ -297,7 +369,6 @@ static CURLcode ftp_cw_lc_write(struct Curl_easy *data, } /* either we just wrote the newline or it is part of the next * chunk of bytes we write. */ - data->state.crlf_conversions++; ctx->newline_pending = FALSE; } @@ -328,7 +399,6 @@ static CURLcode ftp_cw_lc_write(struct Curl_easy *data, /* EndOfStream, if we have a trailing cr, now is the time to write it */ if(ctx->newline_pending) { ctx->newline_pending = FALSE; - data->state.crlf_conversions++; return Curl_cwriter_write(data, writer->next, type, &nl, 1); } /* Always pass on the EOS type indicator */ @@ -346,139 +416,22 @@ static const struct Curl_cwtype ftp_cw_lc = { sizeof(struct ftp_cw_lc_ctx) }; -#endif /* CURL_DO_LINEEND_CONV */ +#endif /* CURL_PREFER_LF_LINEENDS */ /*********************************************************************** * - * AcceptServerConnect() - * - * After connection request is received from the server this function is - * called to accept the connection and close the listening socket + * ftp_check_ctrl_on_data_wait() * */ -static CURLcode AcceptServerConnect(struct Curl_easy *data) -{ - struct connectdata *conn = data->conn; - curl_socket_t sock = conn->sock[SECONDARYSOCKET]; - curl_socket_t s = CURL_SOCKET_BAD; -#ifdef ENABLE_IPV6 - struct Curl_sockaddr_storage add; -#else - struct sockaddr_in add; -#endif - curl_socklen_t size = (curl_socklen_t) sizeof(add); - CURLcode result; - - if(0 == getsockname(sock, (struct sockaddr *) &add, &size)) { - size = sizeof(add); - - s = accept(sock, (struct sockaddr *) &add, &size); - } - - if(CURL_SOCKET_BAD == s) { - failf(data, "Error accept()ing server connect"); - return CURLE_FTP_PORT_FAILED; - } - infof(data, "Connection accepted from server"); - /* when this happens within the DO state it is important that we mark us as - not needing DO_MORE anymore */ - conn->bits.do_more = FALSE; - - (void)curlx_nonblock(s, TRUE); /* enable non-blocking */ - /* Replace any filter on SECONDARY with one listening on this socket */ - result = Curl_conn_tcp_accepted_set(data, conn, SECONDARYSOCKET, &s); - if(result) - return result; - - if(data->set.fsockopt) { - int error = 0; - - /* activate callback for setting socket options */ - Curl_set_in_callback(data, true); - error = data->set.fsockopt(data->set.sockopt_client, - s, - CURLSOCKTYPE_ACCEPT); - Curl_set_in_callback(data, false); - - if(error) { - close_secondarysocket(data, conn); - return CURLE_ABORTED_BY_CALLBACK; - } - } - - return CURLE_OK; - -} - -/* - * ftp_timeleft_accept() returns the amount of milliseconds left allowed for - * waiting server to connect. If the value is negative, the timeout time has - * already elapsed. - * - * The start time is stored in progress.t_acceptdata - as set with - * Curl_pgrsTime(..., TIMER_STARTACCEPT); - * - */ -static timediff_t ftp_timeleft_accept(struct Curl_easy *data) -{ - timediff_t timeout_ms = DEFAULT_ACCEPT_TIMEOUT; - timediff_t other; - struct curltime now; - - if(data->set.accepttimeout > 0) - timeout_ms = data->set.accepttimeout; - - now = Curl_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 - due to it already having elapsed */ - timeout_ms = other; - else { - /* subtract elapsed time */ - timeout_ms -= Curl_timediff(now, data->progress.t_acceptdata); - if(!timeout_ms) - /* avoid returning 0 as that means no timeout! */ - return -1; - } - - return timeout_ms; -} - - -/*********************************************************************** - * - * ReceivedServerConnect() - * - * After allowing server to connect to us from data port, this function - * checks both data connection for connection establishment and ctrl - * connection for a negative response regarding a failure in connecting - * - */ -static CURLcode ReceivedServerConnect(struct Curl_easy *data, bool *received) +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]; - curl_socket_t data_sock = conn->sock[SECONDARYSOCKET]; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; - int socketstate = 0; - timediff_t timeout_ms; ssize_t nread; int ftpcode; bool response = FALSE; - *received = FALSE; - - timeout_ms = ftp_timeleft_accept(data); - infof(data, "Checking for server connect"); - if(timeout_ms < 0) { - /* if a timeout was already reached, bail out */ - failf(data, "Accept timeout occurred while waiting server connect"); - return CURLE_FTP_ACCEPT_TIMEOUT; - } - /* First check whether there is a cached response from server */ if(Curl_dyn_len(&pp->recvbuf) && (*Curl_dyn_ptr(&pp->recvbuf) > '3')) { /* Data connection could not be established, let's return */ @@ -490,26 +443,22 @@ static CURLcode ReceivedServerConnect(struct Curl_easy *data, bool *received) if(pp->overflow) /* there is pending control data still in the buffer to read */ response = TRUE; - else - socketstate = Curl_socket_check(ctrl_sock, data_sock, CURL_SOCKET_BAD, 0); - - /* see if the connection request is already here */ - switch(socketstate) { - case -1: /* error */ - /* let's die here */ - failf(data, "Error while waiting for server connect"); - return CURLE_FTP_ACCEPT_FAILED; - case 0: /* Server connect is not received yet */ - break; /* loop */ - default: - if(socketstate & CURL_CSELECT_IN2) { - infof(data, "Ready to accept data connection from server"); - *received = TRUE; + else { + int socketstate = Curl_socket_check(ctrl_sock, CURL_SOCKET_BAD, + CURL_SOCKET_BAD, 0); + /* see if the connection request is already here */ + switch(socketstate) { + case -1: /* error */ + /* let's die here */ + failf(data, "Error while waiting for server connect"); + return CURLE_FTP_ACCEPT_FAILED; + default: + if(socketstate & CURL_CSELECT_IN) + response = TRUE; + break; } - else if(socketstate & CURL_CSELECT_IN) - response = TRUE; - break; } + if(response) { infof(data, "Ctrl conn has data while waiting for data conn"); if(pp->overflow > 3) { @@ -528,7 +477,6 @@ static CURLcode ReceivedServerConnect(struct Curl_easy *data, bool *received) noticed. Leave the 226 in there and use this as a trigger to read the data socket. */ infof(data, "Got 226 before data activity"); - *received = TRUE; return CURLE_OK; } } @@ -547,7 +495,6 @@ static CURLcode ReceivedServerConnect(struct Curl_easy *data, bool *received) return CURLE_OK; } - /*********************************************************************** * * InitiateTransfer() @@ -562,31 +509,27 @@ static CURLcode InitiateTransfer(struct Curl_easy *data) struct connectdata *conn = data->conn; bool connected; - DEBUGF(infof(data, "ftp InitiateTransfer()")); - if(conn->bits.ftp_use_data_ssl && data->set.ftp_use_port && - !Curl_conn_is_ssl(conn, SECONDARYSOCKET)) { - result = Curl_ssl_cfilter_add(data, conn, SECONDARYSOCKET); - if(result) - return result; - } + CURL_TRC_FTP(data, "InitiateTransfer()"); result = Curl_conn_connect(data, SECONDARYSOCKET, TRUE, &connected); if(result || !connected) return result; if(conn->proto.ftpc.state_saved == FTP_STOR) { - /* When we know we're uploading a specified file, we can get the file + /* 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); /* set the SO_SNDBUF for the secondary socket for those who need it */ - Curl_sndbufset(conn->sock[SECONDARYSOCKET]); + Curl_sndbuf_init(conn->sock[SECONDARYSOCKET]); - Curl_xfer_setup(data, -1, -1, FALSE, SECONDARYSOCKET); + /* FTP upload, shutdown DATA, ignore shutdown errors, as we rely + * on the server response on the CONTROL connection. */ + Curl_xfer_setup2(data, CURL_XFER_SEND, -1, TRUE, TRUE); } else { - /* FTP download: */ - Curl_xfer_setup(data, SECONDARYSOCKET, - conn->proto.ftpc.retr_size_saved, FALSE, -1); + /* FTP download, shutdown, do not ignore errors */ + Curl_xfer_setup2(data, CURL_XFER_RECV, + conn->proto.ftpc.retr_size_saved, TRUE, FALSE); } conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */ @@ -595,60 +538,6 @@ static CURLcode InitiateTransfer(struct Curl_easy *data) return CURLE_OK; } -/*********************************************************************** - * - * AllowServerConnect() - * - * When we've issue the PORT command, we have told the server to connect to - * us. This function checks whether data connection is established if so it is - * accepted. - * - */ -static CURLcode AllowServerConnect(struct Curl_easy *data, bool *connected) -{ - timediff_t timeout_ms; - CURLcode result = CURLE_OK; - - *connected = FALSE; - infof(data, "Preparing for accepting server on data port"); - - /* Save the time we start accepting server connect */ - Curl_pgrsTime(data, TIMER_STARTACCEPT); - - timeout_ms = ftp_timeleft_accept(data); - if(timeout_ms < 0) { - /* if a timeout was already reached, bail out */ - failf(data, "Accept timeout occurred while waiting server connect"); - result = CURLE_FTP_ACCEPT_TIMEOUT; - goto out; - } - - /* see if the connection request is already here */ - result = ReceivedServerConnect(data, connected); - if(result) - goto out; - - if(*connected) { - result = AcceptServerConnect(data); - if(result) - goto out; - - result = InitiateTransfer(data); - if(result) - goto out; - } - else { - /* Add timeout to multi handle and break out of the loop */ - Curl_expire(data, data->set.accepttimeout ? - data->set.accepttimeout: DEFAULT_ACCEPT_TIMEOUT, - EXPIRE_FTP_ACCEPT); - } - -out: - DEBUGF(infof(data, "ftp AllowServerConnect() -> %d", result)); - return result; -} - static bool ftp_endofresp(struct Curl_easy *data, struct connectdata *conn, char *line, size_t len, int *code) { @@ -731,7 +620,7 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data, { /* * We cannot read just one byte per read() and then go back to select() as - * the OpenSSL read() doesn't grok that properly. + * the OpenSSL read() does not grok that properly. * * Alas, read as much as possible, split up into lines, use the ending * line in a response or continue reading. */ @@ -745,6 +634,8 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data, int cache_skip = 0; int value_to_be_ignored = 0; + CURL_TRC_FTP(data, "getFTPResponse start"); + if(ftpcode) *ftpcode = 0; /* 0 for errors */ else @@ -774,37 +665,43 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data, * * A caution here is that the ftp_readresp() function has a cache that may * contain pieces of a response from the previous invoke and we need to - * make sure we don't just wait for input while there is unhandled data in + * make sure we do not just wait for input while there is unhandled data in * that cache. But also, if the cache is there, we call ftp_readresp() and - * the cache wasn't good enough to continue we must not just busy-loop + * the cache was not good enough to continue we must not just busy-loop * around this function. * */ if(Curl_dyn_len(&pp->recvbuf) && (cache_skip < 2)) { /* - * There's a cache left since before. We then skipping the wait for + * There is a cache left since before. We then skipping the wait for * socket action, unless this is the same cache like the previous round * as then the cache was deemed not enough to act on and we then need to * wait for more data anyway. */ } else if(!Curl_conn_data_pending(data, FIRSTSOCKET)) { - switch(SOCKET_READABLE(sockfd, interval_ms)) { - case -1: /* select() error, stop reading */ + curl_socket_t wsock = Curl_pp_needs_flush(data, pp) ? + sockfd : CURL_SOCKET_BAD; + int ev = Curl_socket_check(sockfd, CURL_SOCKET_BAD, wsock, interval_ms); + if(ev < 0) { failf(data, "FTP response aborted due to select/poll error: %d", SOCKERRNO); return CURLE_RECV_ERROR; - - case 0: /* timeout */ + } + else if(ev == 0) { if(Curl_pgrsUpdate(data)) return CURLE_ABORTED_BY_CALLBACK; continue; /* just continue in our loop for the timeout duration */ - - default: /* for clarity */ - break; } } + + if(Curl_pp_needs_flush(data, pp)) { + result = Curl_pp_flushsend(data, pp); + if(result) + break; + } + result = ftp_readresp(data, FIRSTSOCKET, pp, ftpcode, &nread); if(result) break; @@ -820,86 +717,21 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data, *nreadp += nread; - } /* while there's buffer left and loop is requested */ + } /* while there is buffer left and loop is requested */ pp->pending_resp = FALSE; + CURL_TRC_FTP(data, "getFTPResponse -> result=%d, nread=%zd, ftpcode=%d", + result, *nreadp, *ftpcode); return result; } -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - /* for debug purposes */ -static const char * const ftp_state_names[]={ - "STOP", - "WAIT220", - "AUTH", - "USER", - "PASS", - "ACCT", - "PBSZ", - "PROT", - "CCC", - "PWD", - "SYST", - "NAMEFMT", - "QUOTE", - "RETR_PREQUOTE", - "STOR_PREQUOTE", - "POSTQUOTE", - "CWD", - "MKD", - "MDTM", - "TYPE", - "LIST_TYPE", - "RETR_TYPE", - "STOR_TYPE", - "SIZE", - "RETR_SIZE", - "STOR_SIZE", - "REST", - "RETR_REST", - "PORT", - "PRET", - "PASV", - "LIST", - "RETR", - "STOR", - "QUIT" -}; -#endif - -/* This is the ONLY way to change FTP state! */ -static void _ftp_state(struct Curl_easy *data, - ftpstate newstate -#ifdef DEBUGBUILD - , int lineno -#endif - ) -{ - struct connectdata *conn = data->conn; - struct ftp_conn *ftpc = &conn->proto.ftpc; - -#if defined(DEBUGBUILD) - -#if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) lineno; -#else - if(ftpc->state != newstate) - infof(data, "FTP %p (line %d) state change from %s to %s", - (void *)ftpc, lineno, ftp_state_names[ftpc->state], - ftp_state_names[newstate]); -#endif -#endif - - ftpc->state = newstate; -} - static CURLcode ftp_state_user(struct Curl_easy *data, struct connectdata *conn) { CURLcode result = Curl_pp_sendf(data, &conn->proto.ftpc.pp, "USER %s", - conn->user?conn->user:""); + conn->user ? conn->user : ""); if(!result) { struct ftp_conn *ftpc = &conn->proto.ftpc; ftpc->ftp_trying_alternative = FALSE; @@ -937,10 +769,10 @@ static int ftp_domore_getsock(struct Curl_easy *data, * remote site, or we could wait for that site to connect to us. Or just * handle ordinary commands. */ - DEBUGF(infof(data, "ftp_domore_getsock()")); + CURL_TRC_FTP(data, "[%s] ftp_domore_getsock()", FTP_DSTATE(data)); if(FTP_STOP == ftpc->state) { - /* if stopped and still in this state, then we're also waiting for a + /* if stopped and still in this state, then we are also waiting for a connect on the secondary connection */ DEBUGASSERT(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD || (conn->cfilter[SECONDARYSOCKET] && @@ -1027,7 +859,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, char hbuf[NI_MAXHOST]; struct sockaddr *sa = (struct sockaddr *)&ss; struct sockaddr_in * const sa4 = (void *)sa; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 * const sa6 = (void *)sa; #endif static const char mode[][5] = { "EPRT", "PORT" }; @@ -1035,7 +867,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, int error; char *host = NULL; char *string_ftpport = data->set.str[STRING_FTPPORT]; - struct Curl_dns_entry *h = NULL; + struct Curl_dns_entry *dns_entry = NULL; unsigned short port_min = 0; unsigned short port_max = 0; unsigned short port; @@ -1054,7 +886,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, (strlen(data->set.str[STRING_FTPPORT]) > 1)) { char *ip_end = NULL; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(*string_ftpport == '[') { /* [ipv6]:port(-range) */ char *ip_start = string_ftpport + 1; @@ -1076,7 +908,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, if(ip_end) { /* either ipv6 or (ipv4|domain|interface):port(-range) */ addrlen = ip_end - string_ftpport; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(Curl_inet_pton(AF_INET6, string_ftpport, &sa6->sin6_addr) == 1) { /* ipv6 */ port_min = port_max = 0; @@ -1122,19 +954,19 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, /* attempt to get the address of the given interface name */ switch(Curl_if2ip(conn->remote_addr->family, -#ifdef ENABLE_IPV6 - Curl_ipv6_scope(&conn->remote_addr->sa_addr), +#ifdef USE_IPV6 + Curl_ipv6_scope(&conn->remote_addr->curl_sa_addr), conn->scope_id, #endif ipstr, hbuf, sizeof(hbuf))) { case IF2IP_NOT_FOUND: - /* not an interface, use the given string as host name instead */ + /* 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 host name */ + host = hbuf; /* use the hbuf for hostname */ break; } } @@ -1145,7 +977,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, if(!host) { const char *r; - /* not an interface and not a host name, get default by extracting + /* not an interface and not a hostname, get default by extracting the IP from the control connection */ sslen = sizeof(ss); if(getsockname(conn->sock[FIRSTSOCKET], sa, &sslen)) { @@ -1154,7 +986,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, goto out; } switch(sa->sa_family) { -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: r = Curl_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf)); break; @@ -1166,20 +998,17 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, if(!r) { goto out; } - host = hbuf; /* use this host name */ + host = hbuf; /* use this hostname */ possibly_non_local = FALSE; /* we know it is local now */ } /* resolv ip/host to ip */ - rc = Curl_resolv(data, host, 0, FALSE, &h); + rc = Curl_resolv(data, host, 0, FALSE, &dns_entry); if(rc == CURLRESOLV_PENDING) - (void)Curl_resolver_wait_resolv(data, &h); - if(h) { - res = h->addr; - /* when we return from this function, we can forget about this entry - to we can unlock it now already */ - Curl_resolv_unlock(data, h); - } /* (h) */ + (void)Curl_resolver_wait_resolv(data, &dns_entry); + if(dns_entry) { + res = dns_entry->addr; + } else res = NULL; /* failure! */ @@ -1204,7 +1033,8 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, Curl_strerror(error, buffer, sizeof(buffer))); goto out; } - DEBUGF(infof(data, "ftp_state_use_port(), opened socket")); + CURL_TRC_FTP(data, "[%s] ftp_state_use_port(), opened socket", + FTP_DSTATE(data)); /* step 3, bind to a suitable local address */ @@ -1214,7 +1044,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, for(port = port_min; port <= port_max;) { if(sa->sa_family == AF_INET) sa4->sin_port = htons(port); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else sa6->sin6_port = htons(port); #endif @@ -1223,7 +1053,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, /* It failed. */ error = SOCKERRNO; if(possibly_non_local && (error == EADDRNOTAVAIL)) { - /* The requested bind address is not local. Use the address used for + /* The requested bind address is not local. Use the address used for * the control connection instead and restart the port loop */ infof(data, "bind(port=%hu) on non-local address failed: %s", port, @@ -1236,7 +1066,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, goto out; } port = port_min; - possibly_non_local = FALSE; /* don't try this again */ + possibly_non_local = FALSE; /* do not try this again */ continue; } if(error != EADDRINUSE && error != EACCES) { @@ -1265,7 +1095,8 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); goto out; } - DEBUGF(infof(data, "ftp_state_use_port(), socket bound to port %d", port)); + CURL_TRC_FTP(data, "[%s] ftp_state_use_port(), socket bound to port %d", + FTP_DSTATE(data), port); /* step 4, listen on the socket */ @@ -1274,7 +1105,8 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); goto out; } - DEBUGF(infof(data, "ftp_state_use_port(), listening on %d", port)); + CURL_TRC_FTP(data, "[%s] ftp_state_use_port(), listening on %d", + FTP_DSTATE(data), port); /* step 5, send the proper FTP command */ @@ -1282,19 +1114,13 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, below */ Curl_printable_address(ai, myhost, sizeof(myhost)); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(!conn->bits.ftp_use_eprt && conn->bits.ipv6) /* EPRT is disabled but we are connected to a IPv6 host, so we ignore the request and enable EPRT again! */ conn->bits.ftp_use_eprt = TRUE; #endif - /* Replace any filter on SECONDARY with one listening on this socket */ - result = Curl_conn_tcp_listen_set(data, conn, SECONDARYSOCKET, &portsock); - if(result) - goto out; - portsock = CURL_SOCKET_BAD; /* now held in filter */ - for(; fcmd != DONE; fcmd++) { if(!conn->bits.ftp_use_eprt && (EPRT == fcmd)) @@ -1309,7 +1135,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, case AF_INET: port = ntohs(sa4->sin_port); break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: port = ntohs(sa6->sin6_port); break; @@ -1328,7 +1154,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, */ result = Curl_pp_sendf(data, &ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd], - sa->sa_family == AF_INET?1:2, + sa->sa_family == AF_INET ? 1 : 2, myhost, port); if(result) { failf(data, "Failure sending EPRT command: %s", @@ -1344,7 +1170,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, char *dest = target; /* translate x.x.x.x to x,x,x,x */ - while(source && *source) { + while(*source) { if(*source == '.') *dest = ','; else @@ -1353,7 +1179,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, source++; } *dest = 0; - msnprintf(dest, 20, ",%d,%d", (int)(port>>8), (int)(port&0xff)); + msnprintf(dest, 20, ",%d,%d", (int)(port >> 8), (int)(port & 0xff)); result = Curl_pp_sendf(data, &ftpc->pp, "%s %s", mode[fcmd], target); if(result) { @@ -1367,13 +1193,32 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, /* store which command was sent */ ftpc->count1 = fcmd; - ftp_state(data, FTP_PORT); + /* Replace any filter on SECONDARY with one listening on this socket */ + result = Curl_conn_tcp_listen_set(data, conn, SECONDARYSOCKET, &portsock); + if(!result) + portsock = CURL_SOCKET_BAD; /* now held in filter */ + out: + /* If we looked up a dns_entry, now is the time to safely release it */ + if(dns_entry) + Curl_resolv_unlink(data, &dns_entry); if(result) { ftp_state(data, FTP_STOP); } + else { + /* successfully setup the list socket filter. Do we need more? */ + if(conn->bits.ftp_use_data_ssl && data->set.ftp_use_port && + !Curl_conn_is_ssl(conn, SECONDARYSOCKET)) { + result = Curl_ssl_cfilter_add(data, conn, SECONDARYSOCKET); + } + data->conn->bits.do_more = FALSE; + Curl_pgrsTime(data, TIMER_STARTACCEPT); + Curl_expire(data, data->set.accepttimeout ? + data->set.accepttimeout: DEFAULT_ACCEPT_TIMEOUT, + EXPIRE_FTP_ACCEPT); + } if(portsock != CURL_SOCKET_BAD) Curl_socket_close(data, conn, portsock); return result; @@ -1408,7 +1253,7 @@ static CURLcode ftp_state_use_pasv(struct Curl_easy *data, conn->bits.ftp_use_epsv = TRUE; #endif - modeoff = conn->bits.ftp_use_epsv?0:1; + modeoff = conn->bits.ftp_use_epsv ? 0 : 1; result = Curl_pp_sendf(data, &ftpc->pp, "%s", mode[modeoff]); if(!result) { @@ -1433,7 +1278,7 @@ static CURLcode ftp_state_prepare_transfer(struct Curl_easy *data) struct connectdata *conn = data->conn; if(ftp->transfer != PPTRANSFER_BODY) { - /* doesn't transfer any data */ + /* does not transfer any data */ /* still possibly do PRE QUOTE jobs */ ftp_state(data, FTP_RETR_PREQUOTE); @@ -1451,9 +1296,9 @@ static CURLcode ftp_state_prepare_transfer(struct Curl_easy *data) struct ftp_conn *ftpc = &conn->proto.ftpc; if(!conn->proto.ftpc.file) result = Curl_pp_sendf(data, &ftpc->pp, "PRET %s", - data->set.str[STRING_CUSTOMREQUEST]? - data->set.str[STRING_CUSTOMREQUEST]: - (data->state.list_only?"NLST":"LIST")); + data->set.str[STRING_CUSTOMREQUEST] ? + data->set.str[STRING_CUSTOMREQUEST] : + (data->state.list_only ? "NLST" : "LIST")); else if(data->state.upload) result = Curl_pp_sendf(data, &ftpc->pp, "PRET STOR %s", conn->proto.ftpc.file); @@ -1501,7 +1346,7 @@ static CURLcode ftp_state_size(struct Curl_easy *data, if((ftp->transfer == PPTRANSFER_INFO) && ftpc->file) { /* if a "head"-like request is being made (on a file) */ - /* we know ftpc->file is a valid pointer to a file name */ + /* we know ftpc->file is a valid pointer to a filename */ result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file); if(!result) ftp_state(data, FTP_SIZE); @@ -1558,11 +1403,11 @@ static CURLcode ftp_state_list(struct Curl_easy *data) } cmd = aprintf("%s%s%s", - data->set.str[STRING_CUSTOMREQUEST]? - data->set.str[STRING_CUSTOMREQUEST]: - (data->state.list_only?"NLST":"LIST"), - lstArg? " ": "", - lstArg? lstArg: ""); + data->set.str[STRING_CUSTOMREQUEST] ? + data->set.str[STRING_CUSTOMREQUEST] : + (data->state.list_only ? "NLST" : "LIST"), + lstArg ? " " : "", + lstArg ? lstArg : ""); free(lstArg); if(!cmd) @@ -1579,13 +1424,13 @@ static CURLcode ftp_state_list(struct Curl_easy *data) static CURLcode ftp_state_retr_prequote(struct Curl_easy *data) { - /* We've sent the TYPE, now we must send the list of prequote strings */ + /* We have sent the TYPE, now we must send the list of prequote strings */ return ftp_state_quote(data, TRUE, FTP_RETR_PREQUOTE); } static CURLcode ftp_state_stor_prequote(struct Curl_easy *data) { - /* We've sent the TYPE, now we must send the list of prequote strings */ + /* We have sent the TYPE, now we must send the list of prequote strings */ return ftp_state_quote(data, TRUE, FTP_STOR_PREQUOTE); } @@ -1597,7 +1442,7 @@ static CURLcode ftp_state_type(struct Curl_easy *data) struct ftp_conn *ftpc = &conn->proto.ftpc; /* If we have selected NOBODY and HEADER, it means that we only want file - information. Which in FTP can't be much more than the file size and + information. Which in FTP cannot be much more than the file size and date. */ if(data->req.no_body && ftpc->file && ftp_need_type(conn, data->state.prefer_ascii)) { @@ -1657,13 +1502,13 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, if((data->state.resume_from && !sizechecked) || ((data->state.resume_from > 0) && sizechecked)) { - /* we're about to continue the uploading of a file */ + /* we are about to continue the uploading of a file */ /* 1. get already existing file's size. We use the SIZE command for this which may not exist in the server! The SIZE command is not in RFC959. */ /* 2. This used to set REST. But since we can do append, we - don't another ftp command. We just skip the source file + do not another ftp command. We just skip the source file offset and then we APPEND the rest on the file instead */ /* 3. pass file-size number of bytes in the source file */ @@ -1683,11 +1528,11 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, append = TRUE; /* Let's read off the proper amount of bytes from the input. */ - if(conn->seek_func) { - Curl_set_in_callback(data, true); - seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, - SEEK_SET); - Curl_set_in_callback(data, false); + if(data->set.seek_func) { + Curl_set_in_callback(data, TRUE); + seekerr = data->set.seek_func(data->set.seek_client, + data->state.resume_from, SEEK_SET); + Curl_set_in_callback(data, FALSE); } if(seekerr != CURL_SEEKFUNC_OK) { @@ -1696,7 +1541,7 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, failf(data, "Could not seek stream"); return CURLE_FTP_COULDNT_USE_REST; } - /* seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ + /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { char scratch[4*1024]; size_t readthisamountnow = @@ -1718,27 +1563,27 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, } while(passed < data->state.resume_from); } /* now, decrease the size of the read */ - if(data->state.infilesize>0) { + if(data->state.infilesize > 0) { data->state.infilesize -= data->state.resume_from; if(data->state.infilesize <= 0) { infof(data, "File already completely uploaded"); /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); - /* Set ->transfer so that we won't get any error in - * ftp_done() because we didn't transfer anything! */ + /* Set ->transfer so that we will not get any error in + * ftp_done() because we did not transfer anything! */ ftp->transfer = PPTRANSFER_NONE; ftp_state(data, FTP_STOP); return CURLE_OK; } } - /* we've passed, proceed as normal */ + /* we have passed, proceed as normal */ } /* resume_from */ - result = Curl_pp_sendf(data, &ftpc->pp, append?"APPE %s":"STOR %s", + result = Curl_pp_sendf(data, &ftpc->pp, append ? "APPE %s" : "STOR %s", ftpc->file); if(!result) ftp_state(data, FTP_STOR); @@ -1786,7 +1631,7 @@ static CURLcode ftp_state_quote(struct Curl_easy *data, int i = 0; /* Skip count1 items in the linked list */ - while((i< ftpc->count1) && item) { + while((i < ftpc->count1) && item) { item = item->next; i++; } @@ -1824,16 +1669,16 @@ static CURLcode ftp_state_quote(struct Curl_easy *data, } else { if(data->set.ignorecl || data->state.prefer_ascii) { - /* 'ignorecl' is used to support download of growing files. It + /* 'ignorecl' is used to support download of growing files. It prevents the state machine from requesting the file size from - the server. With an unknown file size the download continues + the server. With an unknown file size the download continues until the server terminates it, otherwise the client stops if - the received byte count exceeds the reported file size. Set + the received byte count exceeds the reported file size. Set option CURLOPT_IGNORE_CONTENT_LENGTH to 1 to enable this behavior. In addition: asking for the size for 'TYPE A' transfers is not - constructive since servers don't report the converted size. So + constructive since servers do not report the converted size. So skip it. */ result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file); @@ -1871,7 +1716,7 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data, && !(conn->bits.tunnel_proxy || conn->bits.socksproxy) #endif ) { - /* We can't disable EPSV when doing IPv6, so this is instead a fail */ + /* We cannot disable EPSV when doing IPv6, so this is instead a fail */ failf(data, "Failed EPSV attempt, exiting"); return CURLE_WEIRD_SERVER_REPLY; } @@ -1896,14 +1741,14 @@ static CURLcode ftp_epsv_disable(struct Curl_easy *data, static char *control_address(struct connectdata *conn) { /* Returns the control connection IP address. - If a proxy tunnel is used, returns the original host name instead, because + 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. */ #ifndef CURL_DISABLE_PROXY if(conn->bits.tunnel_proxy || conn->bits.socksproxy) return conn->host.name; #endif - return conn->primary_ip; + return conn->primary.remote_ip; } static bool match_pasv_6nums(const char *p, @@ -2020,7 +1865,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, if(!ftpc->newhost) return CURLE_OUT_OF_MEMORY; - ftpc->newport = (unsigned short)(((ip[4]<<8) + ip[5]) & 0xffff); + ftpc->newport = (unsigned short)(((ip[4] << 8) + ip[5]) & 0xffff); } else if(ftpc->count1 == 0) { /* EPSV failed, move on to PASV */ @@ -2035,22 +1880,22 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, if(conn->bits.proxy) { /* * This connection uses a proxy and we need to connect to the proxy again - * here. We don't 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've * expired now, instead we remake the lookup here and now! */ const char * const host_name = conn->bits.socksproxy ? conn->socks_proxy.host.name : conn->http_proxy.host.name; - rc = Curl_resolv(data, host_name, conn->port, FALSE, &addr); + rc = Curl_resolv(data, host_name, conn->primary.remote_port, FALSE, &addr); if(rc == CURLRESOLV_PENDING) /* BLOCKING, ignores the return code but 'addr' will be NULL in case of failure */ (void)Curl_resolver_wait_resolv(data, &addr); - connectport = - (unsigned short)conn->port; /* we connect to the proxy's port */ + /* we connect to the proxy's port */ + connectport = (unsigned short)conn->primary.remote_port; if(!addr) { - failf(data, "Can't resolve proxy host %s:%hu", host_name, connectport); + failf(data, "cannot resolve proxy host %s:%hu", host_name, connectport); return CURLE_COULDNT_RESOLVE_PROXY; } } @@ -2062,7 +1907,6 @@ 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]) { - Curl_conn_ev_update_info(data, conn); Curl_safefree(ftpc->newhost); ftpc->newhost = strdup(control_address(conn)); if(!ftpc->newhost) @@ -2077,17 +1921,18 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, connectport = ftpc->newport; /* we connect to the remote port */ if(!addr) { - failf(data, "Can't resolve new host %s:%hu", ftpc->newhost, connectport); + failf(data, "cannot resolve new host %s:%hu", + ftpc->newhost, connectport); return CURLE_FTP_CANT_GET_HOST; } } result = Curl_conn_setup(data, conn, SECONDARYSOCKET, addr, - conn->bits.ftp_use_data_ssl? + conn->bits.ftp_use_data_ssl ? CURL_CF_SSL_ENABLE : CURL_CF_SSL_DISABLE); if(result) { - Curl_resolv_unlock(data, addr); /* we're done using this address */ + Curl_resolv_unlink(data, &addr); /* we are done using this address */ if(ftpc->count1 == 0 && ftpcode == 229) return ftp_epsv_disable(data, conn); @@ -2105,7 +1950,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, /* this just dumps information about this second connection */ ftp_pasv_verbose(data, addr->addr, ftpc->newhost, connectport); - Curl_resolv_unlock(data, addr); /* we're done using this address */ + Curl_resolv_unlink(data, &addr); /* we are done using this address */ Curl_safefree(conn->secondaryhostname); conn->secondary_port = ftpc->newport; @@ -2193,14 +2038,14 @@ static CURLcode client_write_header(struct Curl_easy *data, * call to Curl_client_write() so it does the right thing. * * Notice that we cannot enable this flag for FTP in general, - * as an FTP transfer might involve a HTTP proxy connection and + * as an FTP transfer might involve an HTTP proxy connection and * headers from CONNECT should not automatically be part of the * output. */ CURLcode result; - int save = data->set.include_header; + bool save = data->set.include_header; data->set.include_header = TRUE; result = Curl_client_write(data, CLIENTWRITE_HEADER, buf, blen); - data->set.include_header = save? TRUE:FALSE; + data->set.include_header = save; return result; } @@ -2249,15 +2094,16 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data, return result; /* format: "Tue, 15 Nov 1994 12:45:26" */ - headerbuflen = 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); + headerbuflen = + 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; @@ -2349,7 +2195,7 @@ static CURLcode ftp_state_retr(struct Curl_easy *data, struct connectdata *conn = data->conn; struct ftp_conn *ftpc = &conn->proto.ftpc; - DEBUGF(infof(data, "ftp_state_retr()")); + CURL_TRC_FTP(data, "[%s] ftp_state_retr()", FTP_DSTATE(data)); if(data->set.max_filesize && (filesize > data->set.max_filesize)) { failf(data, "Maximum file size exceeded"); return CURLE_FILESIZE_EXCEEDED; @@ -2360,20 +2206,20 @@ static CURLcode ftp_state_retr(struct Curl_easy *data, /* We always (attempt to) get the size of downloads, so it is done before this even when not doing resumes. */ if(filesize == -1) { - infof(data, "ftp server doesn't support SIZE"); - /* We couldn't get the size and therefore we can't know if there really + infof(data, "ftp server does not support SIZE"); + /* We could not get the size and therefore we cannot know if there really is a part of the file left to get, although the server will just - close the connection when we start the connection so it won't cause + close the connection when we start the connection so it will not cause us any harm, just not make us exit as nicely. */ } else { /* We got a file size report, so we check that there actually is a part of the file left to get, or else we go home. */ - if(data->state.resume_from< 0) { - /* We're supposed to download the last abs(from) bytes */ + if(data->state.resume_from < 0) { + /* We are supposed to download the last abs(from) bytes */ if(filesize < -data->state.resume_from) { - failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T - ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", + failf(data, "Offset (%" FMT_OFF_T + ") was beyond file size (%" FMT_OFF_T ")", data->state.resume_from, filesize); return CURLE_BAD_DOWNLOAD_RESUME; } @@ -2384,8 +2230,8 @@ static CURLcode ftp_state_retr(struct Curl_easy *data, } else { if(filesize < data->state.resume_from) { - failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T - ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", + failf(data, "Offset (%" FMT_OFF_T + ") was beyond file size (%" FMT_OFF_T ")", data->state.resume_from, filesize); return CURLE_BAD_DOWNLOAD_RESUME; } @@ -2396,21 +2242,21 @@ static CURLcode ftp_state_retr(struct Curl_easy *data, if(ftp->downloadsize == 0) { /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); infof(data, "File already completely downloaded"); - /* Set ->transfer so that we won't get any error in ftp_done() - * because we didn't transfer the any file */ + /* Set ->transfer so that we will not get any error in ftp_done() + * because we did not transfer the any file */ ftp->transfer = PPTRANSFER_NONE; ftp_state(data, FTP_STOP); return CURLE_OK; } /* Set resume file transfer offset */ - infof(data, "Instructs server to resume from offset %" - CURL_FORMAT_CURL_OFF_T, data->state.resume_from); + infof(data, "Instructs server to resume from offset %" FMT_OFF_T, + data->state.resume_from); - result = Curl_pp_sendf(data, &ftpc->pp, "REST %" CURL_FORMAT_CURL_OFF_T, + result = Curl_pp_sendf(data, &ftpc->pp, "REST %" FMT_OFF_T, data->state.resume_from); if(!result) ftp_state(data, FTP_RETR_REST); @@ -2468,7 +2314,7 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data, if(-1 != filesize) { char clbuf[128]; int clbuflen = msnprintf(clbuf, sizeof(clbuf), - "Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", filesize); + "Content-Length: %" FMT_OFF_T "\r\n", filesize); result = client_write_header(data, clbuf, clbuflen); if(result) return result; @@ -2544,21 +2390,21 @@ static CURLcode ftp_state_stor_resp(struct Curl_easy *data, /* PORT means we are now awaiting the server to connect to us. */ if(data->set.ftp_use_port) { + struct ftp_conn *ftpc = &conn->proto.ftpc; bool connected; ftp_state(data, FTP_STOP); /* no longer in STOR state */ - result = AllowServerConnect(data, &connected); + result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected); if(result) return result; if(!connected) { - struct ftp_conn *ftpc = &conn->proto.ftpc; infof(data, "Data conn was not available immediately"); ftpc->wait_data_conn = TRUE; + return ftp_check_ctrl_on_data_wait(data); } - - return CURLE_OK; + ftpc->wait_data_conn = FALSE; } return InitiateTransfer(data); } @@ -2608,10 +2454,10 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, !data->set.ignorecl && (ftp->downloadsize < 1)) { /* - * It seems directory listings either don't show the size or very - * often uses size 0 anyway. ASCII transfers may very well turn out - * that the transferred amount of data is not the same as this line - * tells, why using this number in those cases only confuses us. + * It seems directory listings either do not show the size or often uses + * size 0 anyway. ASCII transfers may cause that the transferred amount + * of data is not the same as this line tells, why using this number in + * those cases only confuses us. * * Example D above makes this parsing a little tricky */ char *bytes; @@ -2648,44 +2494,43 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, else if((instate != FTP_LIST) && (data->state.prefer_ascii)) size = -1; /* kludge for servers that understate ASCII mode file size */ - infof(data, "Maxdownload = %" CURL_FORMAT_CURL_OFF_T, - data->req.maxdownload); + infof(data, "Maxdownload = %" FMT_OFF_T, data->req.maxdownload); if(instate != FTP_LIST) - infof(data, "Getting file with size: %" CURL_FORMAT_CURL_OFF_T, - size); + infof(data, "Getting file with size: %" FMT_OFF_T, size); /* FTP download: */ conn->proto.ftpc.state_saved = instate; conn->proto.ftpc.retr_size_saved = size; if(data->set.ftp_use_port) { + struct ftp_conn *ftpc = &conn->proto.ftpc; bool connected; - result = AllowServerConnect(data, &connected); + result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected); if(result) return result; if(!connected) { - struct ftp_conn *ftpc = &conn->proto.ftpc; infof(data, "Data conn was not available immediately"); ftp_state(data, FTP_STOP); ftpc->wait_data_conn = TRUE; + return ftp_check_ctrl_on_data_wait(data); } + ftpc->wait_data_conn = FALSE; } - else - return InitiateTransfer(data); + return InitiateTransfer(data); } else { if((instate == FTP_LIST) && (ftpcode == 450)) { /* simply no matching files in the dir listing */ - ftp->transfer = PPTRANSFER_NONE; /* don't download anything */ + ftp->transfer = PPTRANSFER_NONE; /* do not download anything */ ftp_state(data, FTP_STOP); /* this phase is over */ } else { failf(data, "RETR response: %03d", ftpcode); - return instate == FTP_RETR && ftpcode == 550? - CURLE_REMOTE_FILE_NOT_FOUND: + return instate == FTP_RETR && ftpcode == 550 ? + CURLE_REMOTE_FILE_NOT_FOUND : CURLE_FTP_COULDNT_RETR_FILE; } } @@ -2737,7 +2582,7 @@ static CURLcode ftp_state_user_resp(struct Curl_easy *data, /* 331 Password required for ... (the server requires to send the user's password too) */ result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s", - conn->passwd?conn->passwd:""); + conn->passwd ? conn->passwd : ""); if(!result) ftp_state(data, FTP_PASS); } @@ -2766,7 +2611,7 @@ 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. */ + /* 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]); @@ -2852,7 +2697,7 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, #endif if(data->set.use_ssl && !conn->bits.ftp_use_control_ssl) { - /* We don't have a SSL/TLS control connection yet, but FTPS is + /* We do not have a SSL/TLS control connection yet, but FTPS is requested. Try a FTPS connection now */ ftpc->count3 = 0; @@ -2869,7 +2714,7 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, default: failf(data, "unsupported parameter to CURLOPT_FTPSSLAUTH: %d", (int)data->set.ftpsslauth); - return CURLE_UNKNOWN_OPTION; /* we don't know what to do */ + return CURLE_UNKNOWN_OPTION; /* we do not know what to do */ } result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]); @@ -2948,7 +2793,7 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, if(ftpcode/100 == 2) /* We have enabled SSL for the data connection! */ conn->bits.ftp_use_data_ssl = - (data->set.use_ssl != CURLUSESSL_CONTROL) ? TRUE : FALSE; + (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) @@ -2969,7 +2814,13 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, case FTP_CCC: if(ftpcode < 500) { /* First shut down the SSL layer (note: this call will block) */ - result = Curl_ssl_cfilter_remove(data, FIRSTSOCKET); + /* This has only been tested on the proftpd server, and the mod_tls + * code sends a close notify alert without waiting for a close notify + * alert in response. Thus we wait for a close notify alert from the + * server, but we do not send one. Let's hope other servers do + * the same... */ + result = Curl_ssl_cfilter_remove(data, FIRSTSOCKET, + (data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE)); if(result) failf(data, "Failed to clear the command channel (CCC)"); @@ -3058,13 +2909,13 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, data->state.most_recent_ftp_entrypath = ftpc->entrypath; } else { - /* couldn't get the path */ + /* could not get the path */ Curl_dyn_free(&out); infof(data, "Failed to figure out path"); } } ftp_state(data, FTP_STOP); /* we are done with the CONNECT phase! */ - DEBUGF(infof(data, "protocol connect phase DONE")); + CURL_TRC_FTP(data, "[%s] protocol connect phase DONE", FTP_DSTATE(data)); break; case FTP_SYST: @@ -3109,7 +2960,7 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, } ftp_state(data, FTP_STOP); /* we are done with the CONNECT phase! */ - DEBUGF(infof(data, "protocol connect phase DONE")); + CURL_TRC_FTP(data, "[%s] protocol connect phase DONE", FTP_DSTATE(data)); break; case FTP_NAMEFMT: @@ -3120,7 +2971,7 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, } ftp_state(data, FTP_STOP); /* we are done with the CONNECT phase! */ - DEBUGF(infof(data, "protocol connect phase DONE")); + CURL_TRC_FTP(data, "[%s] protocol connect phase DONE", FTP_DSTATE(data)); break; case FTP_QUOTE: @@ -3157,7 +3008,7 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, else { /* return failure */ failf(data, "Server denied you to change to the given directory"); - ftpc->cwdfail = TRUE; /* don't remember this path as we failed + ftpc->cwdfail = TRUE; /* do not remember this path as we failed to enter it */ result = CURLE_REMOTE_ACCESS_DENIED; } @@ -3259,7 +3110,7 @@ static CURLcode ftp_multi_statemach(struct Curl_easy *data, /* Check for the state outside of the Curl_socket_check() return code checks since at times we are in fact already in this state when this function gets called. */ - *done = (ftpc->state == FTP_STOP) ? TRUE : FALSE; + *done = (ftpc->state == FTP_STOP); return result; } @@ -3362,7 +3213,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, case CURLE_REMOTE_FILE_NOT_FOUND: case CURLE_WRITE_ERROR: /* the connection stays alive fine even though this happened */ - case CURLE_OK: /* doesn't affect the control connection's status */ + case CURLE_OK: /* does not affect the control connection's status */ if(!premature) break; @@ -3381,9 +3232,9 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, if(data->state.wildcardmatch) { if(data->set.chunk_end && ftpc->file) { - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); data->set.chunk_end(data->set.wildcardptr); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); } ftpc->known_filesize = -1; } @@ -3410,7 +3261,8 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, if(data->set.ftp_filemethod == FTPFILE_NOCWD) pathLen = 0; /* relative path => working directory is FTP home */ else - pathLen -= ftpc->file?strlen(ftpc->file):0; /* file is url-decoded */ + /* file is url-decoded */ + pathLen -= ftpc->file ? strlen(ftpc->file) : 0; rawPath[pathLen] = '\0'; ftpc->prevpath = rawPath; @@ -3428,7 +3280,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, /* free the dir tree and file parts */ freedirs(ftpc); - /* shut down the socket to inform the server we're done */ + /* shut down the socket to inform the server we are done */ #ifdef _WIN32_WCE shutdown(conn->sock[SECONDARYSOCKET], 2); /* SD_BOTH */ @@ -3446,7 +3298,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, } } - close_secondarysocket(data, conn); + close_secondarysocket(data); } if(!result && (ftp->transfer == PPTRANSFER_BODY) && ftpc->ctl_valid && @@ -3512,8 +3364,8 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, (data->state.infilesize != data->req.writebytecount) && !data->set.crlf && (ftp->transfer == PPTRANSFER_BODY)) { - failf(data, "Uploaded unaligned file size (%" CURL_FORMAT_CURL_OFF_T - " out of %" CURL_FORMAT_CURL_OFF_T " bytes)", + failf(data, "Uploaded unaligned file size (%" FMT_OFF_T + " out of %" FMT_OFF_T " bytes)", data->req.writebytecount, data->state.infilesize); result = CURLE_PARTIAL_FILE; } @@ -3521,22 +3373,14 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, else { if((-1 != data->req.size) && (data->req.size != data->req.bytecount) && -#ifdef CURL_DO_LINEEND_CONV - /* Most FTP servers don't adjust their file SIZE response for CRLFs, so - * we'll check to see if the discrepancy can be explained by the number - * of CRLFs we've changed to LFs. - */ - ((data->req.size + data->state.crlf_conversions) != - data->req.bytecount) && -#endif /* CURL_DO_LINEEND_CONV */ (data->req.maxdownload != data->req.bytecount)) { - failf(data, "Received only partial file: %" CURL_FORMAT_CURL_OFF_T - " bytes", data->req.bytecount); + failf(data, "Received only partial file: %" FMT_OFF_T " bytes", + data->req.bytecount); result = CURLE_PARTIAL_FILE; } else if(!ftpc->dont_check && !data->req.bytecount && - (data->req.size>0)) { + (data->req.size > 0)) { failf(data, "No data was received"); result = CURLE_FTP_COULDNT_RETR_FILE; } @@ -3549,6 +3393,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, /* Send any post-transfer QUOTE strings? */ if(!status && !result && !premature && data->set.postquote) result = ftp_sendquote(data, conn, data->set.postquote); + CURL_TRC_FTP(data, "[%s] done, result=%d", FTP_DSTATE(data), result); Curl_safefree(ftp->pathalloc); return result; } @@ -3619,7 +3464,7 @@ CURLcode ftp_sendquote(struct Curl_easy *data, static int ftp_need_type(struct connectdata *conn, bool ascii_wanted) { - return conn->proto.ftpc.transfertype != (ascii_wanted?'A':'I'); + return conn->proto.ftpc.transfertype != (ascii_wanted ? 'A' : 'I'); } /*********************************************************************** @@ -3636,7 +3481,7 @@ static CURLcode ftp_nb_type(struct Curl_easy *data, { struct ftp_conn *ftpc = &conn->proto.ftpc; CURLcode result; - char want = (char)(ascii?'A':'I'); + char want = (char)(ascii ? 'A' : 'I'); if(ftpc->transfertype == want) { ftp_state(data, newstate); @@ -3658,7 +3503,7 @@ static CURLcode ftp_nb_type(struct Curl_easy *data, * ftp_pasv_verbose() * * This function only outputs some informationals about this second connection - * when we've issued a PASV command before and thus we have connected to a + * when we have issued a PASV command before and thus we have connected to a * possibly new IP address. * */ @@ -3666,7 +3511,7 @@ static CURLcode ftp_nb_type(struct Curl_easy *data, static void ftp_pasv_verbose(struct Curl_easy *data, struct Curl_addrinfo *ai, - char *newhost, /* ascii version */ + char *newhost, /* ASCII version */ int port) { char buf[256]; @@ -3699,20 +3544,25 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) * complete */ struct FTP *ftp = NULL; - /* if the second connection isn't done yet, wait for it to have - * connected to the remote host. When using proxy tunneling, this - * means the tunnel needs to have been establish. However, we - * can not expect the remote host to talk to us in any way yet. - * So, when using ftps: the SSL handshake will not start until we - * tell the remote server that we are there. */ + /* if the second connection has been set up, try to connect it fully + * to the remote host. This may not complete at this time, for several + * reasons: + * - we do EPTR and the server will not connect to our listen socket + * until we send more FTP commands + * - an SSL filter is in place and the server will not start the TLS + * handshake until we send more FTP commands + */ if(conn->cfilter[SECONDARYSOCKET]) { + bool is_eptr = Curl_conn_is_tcp_listen(data, SECONDARYSOCKET); result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected); - if(result || !Curl_conn_is_ip_connected(data, SECONDARYSOCKET)) { - if(result && (ftpc->count1 == 0)) { + if(result || (!connected && !is_eptr && + !Curl_conn_is_ip_connected(data, SECONDARYSOCKET))) { + if(result && !is_eptr && (ftpc->count1 == 0)) { *completep = -1; /* go back to DOING please */ /* this is a EPSV connect failing, try PASV instead */ return ftp_epsv_disable(data, conn); } + *completep = (int)complete; return result; } } @@ -3727,34 +3577,32 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) *completep = (int)complete; - /* if we got an error or if we don't wait for a data connection return + /* if we got an error or if we do not wait for a data connection return immediately */ if(result || !ftpc->wait_data_conn) return result; /* if we reach the end of the FTP state machine here, *complete will be TRUE but so is ftpc->wait_data_conn, which says we need to wait for the - data connection and therefore we're not actually complete */ + data connection and therefore we are not actually complete */ *completep = 0; } if(ftp->transfer <= PPTRANSFER_INFO) { - /* a transfer is about to take place, or if not a file name was given - so we'll do a SIZE on it later and then we need the right TYPE first */ + /* a transfer is about to take place, or if not a filename was given so we + will do a SIZE on it later and then we need the right TYPE first */ if(ftpc->wait_data_conn) { bool serv_conned; - result = ReceivedServerConnect(data, &serv_conned); + result = Curl_conn_connect(data, SECONDARYSOCKET, TRUE, &serv_conned); if(result) return result; /* Failed to accept data connection */ if(serv_conned) { /* It looks data connection is established */ - result = AcceptServerConnect(data); ftpc->wait_data_conn = FALSE; - if(!result) - result = InitiateTransfer(data); + result = InitiateTransfer(data); if(result) return result; @@ -3762,6 +3610,11 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) *completep = 1; /* this state is now complete when the server has connected back to us */ } + else { + result = ftp_check_ctrl_on_data_wait(data); + if(result) + return result; + } } else if(data->state.upload) { result = ftp_nb_type(data, conn, data->state.prefer_ascii, @@ -3779,7 +3632,7 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) result = Curl_range(data); if(result == CURLE_OK && data->req.maxdownload >= 0) { - /* Don't check for successful transfer */ + /* Do not check for successful transfer */ ftpc->dont_check = TRUE; } @@ -3812,12 +3665,13 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) } /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); if(!ftpc->wait_data_conn) { /* no waiting for the data connection so this is now complete */ *completep = 1; - DEBUGF(infof(data, "DO-MORE phase ends with %d", (int)result)); + CURL_TRC_FTP(data, "[%s] DO-MORE phase ends with %d", FTP_DSTATE(data), + (int)result); } return result; @@ -3841,7 +3695,7 @@ CURLcode ftp_perform(struct Curl_easy *data, /* this is FTP and no proxy */ CURLcode result = CURLE_OK; - DEBUGF(infof(data, "DO phase starts")); + CURL_TRC_FTP(data, "[%s] DO phase starts", FTP_DSTATE(data)); if(data->req.no_body) { /* requested no body means no transfer... */ @@ -3861,10 +3715,15 @@ CURLcode ftp_perform(struct Curl_easy *data, *connected = Curl_conn_is_connected(data->conn, SECONDARYSOCKET); - infof(data, "ftp_perform ends with SECONDARY: %d", *connected); + if(*connected) + infof(data, "[FTP] [%s] perform, DATA connection established", + FTP_DSTATE(data)); + else + CURL_TRC_FTP(data, "[%s] perform, awaiting DATA connect", + FTP_DSTATE(data)); if(*dophase_done) - DEBUGF(infof(data, "DO phase is complete1")); + CURL_TRC_FTP(data, "[%s] DO phase is complete1", FTP_DSTATE(data)); return result; } @@ -3891,8 +3750,7 @@ static CURLcode init_wc_data(struct Curl_easy *data) last_slash++; if(last_slash[0] == '\0') { wildcard->state = CURLWC_CLEAN; - result = ftp_parse_url_path(data); - return result; + return ftp_parse_url_path(data); } wildcard->pattern = strdup(last_slash); if(!wildcard->pattern) @@ -3908,8 +3766,7 @@ static CURLcode init_wc_data(struct Curl_easy *data) } else { /* only list */ wildcard->state = CURLWC_CLEAN; - result = ftp_parse_url_path(data); - return result; + return ftp_parse_url_path(data); } } @@ -3937,7 +3794,7 @@ static CURLcode init_wc_data(struct Curl_easy *data) if(data->set.ftp_filemethod == FTPFILE_NOCWD) data->set.ftp_filemethod = FTPFILE_MULTICWD; - /* try to parse ftp url */ + /* try to parse ftp URL */ result = ftp_parse_url_path(data); if(result) { goto fail; @@ -4003,7 +3860,7 @@ static CURLcode wc_statemach(struct Curl_easy *data) wildcard->state = CURLWC_CLEAN; continue; } - if(wildcard->filelist.size == 0) { + if(Curl_llist_count(&wildcard->filelist) == 0) { /* no corresponding file */ wildcard->state = CURLWC_CLEAN; return CURLE_REMOTE_FILE_NOT_FOUND; @@ -4014,7 +3871,8 @@ static CURLcode wc_statemach(struct Curl_easy *data) case CURLWC_DOWNLOADING: { /* filelist has at least one file, lets get first one */ struct ftp_conn *ftpc = &conn->proto.ftpc; - struct curl_fileinfo *finfo = wildcard->filelist.head->ptr; + struct Curl_llist_node *head = Curl_llist_head(&wildcard->filelist); + struct curl_fileinfo *finfo = Curl_node_elem(head); struct FTP *ftp = data->req.p.ftp; char *tmp_path = aprintf("%s%s", wildcard->path, finfo->filename); @@ -4028,10 +3886,11 @@ static CURLcode wc_statemach(struct Curl_easy *data) infof(data, "Wildcard - START of \"%s\"", finfo->filename); if(data->set.chunk_bgn) { long userresponse; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); userresponse = data->set.chunk_bgn( - finfo, data->set.wildcardptr, (int)wildcard->filelist.size); - Curl_set_in_callback(data, false); + finfo, data->set.wildcardptr, + (int)Curl_llist_count(&wildcard->filelist)); + Curl_set_in_callback(data, FALSE); switch(userresponse) { case CURL_CHUNK_BGN_FUNC_SKIP: infof(data, "Wildcard - \"%s\" skipped by user", @@ -4055,10 +3914,11 @@ static CURLcode wc_statemach(struct Curl_easy *data) if(result) return result; - /* we don't need the Curl_fileinfo of first file anymore */ - Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); + /* we do not need the Curl_fileinfo of first file anymore */ + Curl_node_remove(Curl_llist_head(&wildcard->filelist)); - if(wildcard->filelist.size == 0) { /* remains only one file to down. */ + if(Curl_llist_count(&wildcard->filelist) == 0) { + /* remains only one file to down. */ wildcard->state = CURLWC_CLEAN; /* after that will be ftp_do called once again and no transfer will be done because of CURLWC_CLEAN state */ @@ -4069,12 +3929,12 @@ static CURLcode wc_statemach(struct Curl_easy *data) case CURLWC_SKIP: { if(data->set.chunk_end) { - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); data->set.chunk_end(data->set.wildcardptr); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); } - Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); - wildcard->state = (wildcard->filelist.size == 0) ? + Curl_node_remove(Curl_llist_head(&wildcard->filelist)); + wildcard->state = (Curl_llist_count(&wildcard->filelist) == 0) ? CURLWC_CLEAN : CURLWC_DOWNLOADING; continue; } @@ -4120,7 +3980,7 @@ static CURLcode ftp_do(struct Curl_easy *data, bool *done) *done = FALSE; /* default to false */ ftpc->wait_data_conn = FALSE; /* default to no such wait */ -#ifdef CURL_DO_LINEEND_CONV +#ifdef CURL_PREFER_LF_LINEENDS { /* FTP data may need conversion. */ struct Curl_cwriter *ftp_lc_writer; @@ -4136,7 +3996,7 @@ static CURLcode ftp_do(struct Curl_easy *data, bool *done) return result; } } -#endif /* CURL_DO_LINEEND_CONV */ +#endif /* CURL_PREFER_LF_LINEENDS */ if(data->state.wildcardmatch) { result = wc_statemach(data); @@ -4210,7 +4070,7 @@ static CURLcode ftp_disconnect(struct Curl_easy *data, bad in any way, sending quit and waiting around here will make the disconnect wait in vain and cause more problems than we need to. - ftp_quit() will check the state of ftp->ctl_valid. If it's ok it + ftp_quit() will check the state of ftp->ctl_valid. If it is ok it will try to send the QUIT command, otherwise it will just return. */ if(dead_connection) @@ -4305,10 +4165,10 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data) } ftpc->dirdepth = 1; /* we consider it to be a single dir */ - fileName = slashPos + 1; /* rest is file name */ + fileName = slashPos + 1; /* rest is filename */ } else - fileName = rawPath; /* file name only (or empty) */ + fileName = rawPath; /* filename only (or empty) */ break; default: /* allow pretty much anything */ @@ -4339,7 +4199,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data) ++compLen; /* we skip empty path components, like "x//y" since the FTP command - CWD requires a parameter and a non-existent parameter a) doesn't + 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(compLen > 0) { char *comp = Curl_memdup0(curPos, compLen); @@ -4353,7 +4213,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data) } } DEBUGASSERT((size_t)ftpc->dirdepth <= dirAlloc); - fileName = curPos; /* the rest is the file name (or empty) */ + fileName = curPos; /* the rest is the filename (or empty) */ } break; } /* switch */ @@ -4365,8 +4225,8 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data) we make it a NULL pointer */ if(data->state.upload && !ftpc->file && (ftp->transfer == PPTRANSFER_BODY)) { - /* We need a file name when uploading. Return error! */ - failf(data, "Uploading to a URL without a file name"); + /* We need a filename when uploading. Return error! */ + failf(data, "Uploading to a URL without a filename"); free(rawPath); return CURLE_URL_MALFORMAT; } @@ -4382,7 +4242,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data) if(data->set.ftp_filemethod == FTPFILE_NOCWD) n = 0; /* CWD to entry for relative paths */ else - n -= ftpc->file?strlen(ftpc->file):0; + n -= ftpc->file ? strlen(ftpc->file) : 0; if((strlen(oldPath) == n) && !strncmp(rawPath, oldPath, n)) { infof(data, "Request has same path as previous transfer"); @@ -4407,16 +4267,16 @@ static CURLcode ftp_dophase_done(struct Curl_easy *data, bool connected) CURLcode result = ftp_do_more(data, &completed); if(result) { - close_secondarysocket(data, conn); + close_secondarysocket(data); return result; } } if(ftp->transfer != PPTRANSFER_BODY) /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); else if(!connected) - /* since we didn't connect now, we want do_more to get called */ + /* since we did not connect now, we want do_more to get called */ conn->bits.do_more = TRUE; ftpc->ctl_valid = TRUE; /* seems good */ @@ -4431,11 +4291,11 @@ static CURLcode ftp_doing(struct Curl_easy *data, CURLcode result = ftp_multi_statemach(data, dophase_done); if(result) - DEBUGF(infof(data, "DO phase failed")); + CURL_TRC_FTP(data, "[%s] DO phase failed", FTP_DSTATE(data)); else if(*dophase_done) { result = ftp_dophase_done(data, FALSE /* not connected */); - DEBUGF(infof(data, "DO phase is complete2")); + CURL_TRC_FTP(data, "[%s] DO phase is complete2", FTP_DSTATE(data)); } return result; } @@ -4521,10 +4381,10 @@ static CURLcode ftp_setup_connection(struct Curl_easy *data, } data->req.p.ftp = ftp; - ftp->path = &data->state.up.path[1]; /* don't include the initial slash */ + ftp->path = &data->state.up.path[1]; /* do not include the initial slash */ /* FTP URLs support an extension like ";type=" that - * we'll try to get now! */ + * we will try to get now! */ type = strstr(ftp->path, ";type="); if(!type) @@ -4559,6 +4419,7 @@ static CURLcode ftp_setup_connection(struct Curl_easy *data, ftpc->use_ssl = data->set.use_ssl; ftpc->ccc = data->set.ftp_ccc; + CURL_TRC_FTP(data, "[%s] setup connection -> %d", FTP_CSTATE(conn), result); return result; } diff --git a/deps/curl/lib/ftp.h b/deps/curl/lib/ftp.h index 977fc883..3d0af015 100644 --- a/deps/curl/lib/ftp.h +++ b/deps/curl/lib/ftp.h @@ -61,7 +61,7 @@ enum { FTP_STOR_PREQUOTE, FTP_POSTQUOTE, FTP_CWD, /* change dir */ - FTP_MKD, /* if the dir didn't exist */ + FTP_MKD, /* if the dir 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 */ @@ -123,7 +123,7 @@ struct ftp_conn { char *account; char *alternative_to_user; char *entrypath; /* the PWD reply when we logged on */ - char *file; /* url-decoded file name (or path) */ + char *file; /* url-decoded filename (or path) */ char **dirs; /* realloc()ed array for path components */ char *newhost; char *prevpath; /* url-decoded conn->path from the previous transfer */ @@ -139,7 +139,7 @@ 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 */ - /* newhost is the (allocated) IP addr or host name to connect the data + /* newhost is the (allocated) IP addr or hostname to connect the data connection to */ unsigned short newport; ftpstate state; /* always use ftp.c:state() to change state! */ diff --git a/deps/curl/lib/ftplistparser.c b/deps/curl/lib/ftplistparser.c index 82f1ea00..3088470a 100644 --- a/deps/curl/lib/ftplistparser.c +++ b/deps/curl/lib/ftplistparser.c @@ -334,7 +334,7 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data, compare = Curl_fnmatch; /* filter pattern-corresponding filenames */ - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); if(compare(data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) { /* discard symlink which is containing multiple " -> " */ @@ -346,10 +346,10 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data, else { add = FALSE; } - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(add) { - Curl_llist_insert_next(llist, llist->tail, finfo, &infop->list); + Curl_llist_append(llist, finfo, &infop->list); } else { Curl_fileinfo_cleanup(infop); diff --git a/deps/curl/lib/getenv.c b/deps/curl/lib/getenv.c index 48ee9722..63eaeda0 100644 --- a/deps/curl/lib/getenv.c +++ b/deps/curl/lib/getenv.c @@ -31,13 +31,13 @@ static char *GetEnv(const char *variable) { -#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) || \ +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) || \ defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */ (void)variable; return NULL; #elif defined(_WIN32) /* This uses Windows API instead of C runtime getenv() to get the environment - variable since some changes aren't always visible to the latter. #4774 */ + variable since some changes are not always visible to the latter. #4774 */ char *buf = NULL; char *tmp; DWORD bufsize; @@ -54,8 +54,8 @@ static char *GetEnv(const char *variable) buf = tmp; bufsize = rc; - /* It's possible for rc to be 0 if the variable was found but empty. - Since getenv doesn't make that distinction we ignore it as well. */ + /* it is possible for rc to be 0 if the variable was found but empty. + 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); @@ -70,7 +70,7 @@ static char *GetEnv(const char *variable) } #else char *env = getenv(variable); - return (env && env[0])?strdup(env):NULL; + return (env && env[0]) ? strdup(env) : NULL; #endif } diff --git a/deps/curl/lib/getinfo.c b/deps/curl/lib/getinfo.c index aaf17713..9144ad71 100644 --- a/deps/curl/lib/getinfo.c +++ b/deps/curl/lib/getinfo.c @@ -53,10 +53,11 @@ CURLcode Curl_initinfo(struct Curl_easy *data) pro->t_connect = 0; pro->t_appconnect = 0; pro->t_pretransfer = 0; + pro->t_posttransfer = 0; pro->t_starttransfer = 0; pro->timespent = 0; pro->t_redirect = 0; - pro->is_t_startransfer_set = false; + pro->is_t_startransfer_set = FALSE; info->httpcode = 0; info->httpproxycode = 0; @@ -76,10 +77,9 @@ CURLcode Curl_initinfo(struct Curl_easy *data) free(info->wouldredirect); info->wouldredirect = NULL; - info->conn_primary_ip[0] = '\0'; - info->conn_local_ip[0] = '\0'; - info->conn_primary_port = 0; - info->conn_local_port = 0; + 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; @@ -96,7 +96,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, { switch(info) { case CURLINFO_EFFECTIVE_URL: - *param_charp = data->state.url?data->state.url:(char *)""; + *param_charp = data->state.url ? data->state.url : (char *)""; break; case CURLINFO_EFFECTIVE_METHOD: { const char *m = data->set.str[STRING_CUSTOMREQUEST]; @@ -153,15 +153,19 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, break; case CURLINFO_PRIMARY_IP: /* Return the ip address of the most recent (primary) connection */ - *param_charp = data->info.conn_primary_ip; + *param_charp = data->info.primary.remote_ip; break; case CURLINFO_LOCAL_IP: /* Return the source/local ip address of the most recent (primary) connection */ - *param_charp = data->info.conn_local_ip; + *param_charp = data->info.primary.local_ip; break; case CURLINFO_RTSP_SESSION_ID: +#ifndef CURL_DISABLE_RTSP *param_charp = data->set.str[STRING_RTSP_SESSION_ID]; +#else + *param_charp = NULL; +#endif break; case CURLINFO_SCHEME: *param_charp = data->info.conn_scheme; @@ -200,7 +204,7 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, #ifdef DEBUGBUILD char *timestr = getenv("CURL_TIME"); if(timestr) { - unsigned long val = strtol(timestr, NULL, 10); + unsigned long val = strtoul(timestr, NULL, 10); switch(info) { case CURLINFO_LOCAL_PORT: *param_longp = (long)val; @@ -212,7 +216,7 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, /* use another variable for this to allow different values */ timestr = getenv("CURL_DEBUG_SIZE"); if(timestr) { - unsigned long val = strtol(timestr, NULL, 10); + unsigned long val = strtoul(timestr, NULL, 10); switch(info) { case CURLINFO_HEADER_SIZE: case CURLINFO_REQUEST_SIZE: @@ -248,11 +252,13 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, case CURLINFO_SSL_VERIFYRESULT: *param_longp = data->set.ssl.certverifyresult; break; -#ifndef CURL_DISABLE_PROXY case CURLINFO_PROXY_SSL_VERIFYRESULT: +#ifndef CURL_DISABLE_PROXY *param_longp = data->set.proxy_ssl.certverifyresult; - break; +#else + *param_longp = 0; #endif + break; case CURLINFO_REDIRECT_COUNT: *param_longp = data->state.followlocation; break; @@ -273,8 +279,8 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, case CURLINFO_LASTSOCKET: sockfd = Curl_getconnectinfo(data, NULL); - /* note: this is not a good conversion for systems with 64 bit sockets and - 32 bit longs */ + /* note: this is not a good conversion for systems with 64-bit sockets and + 32-bit longs */ if(sockfd != CURL_SOCKET_BAD) *param_longp = (long)sockfd; else @@ -284,11 +290,11 @@ 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.conn_primary_port; + *param_longp = data->info.primary.remote_port; break; case CURLINFO_LOCAL_PORT: /* Return the local port of the most recent (primary) connection */ - *param_longp = data->info.conn_local_port; + *param_longp = data->info.primary.local_port; break; case CURLINFO_PROXY_ERROR: *param_longp = (long)data->info.pxcode; @@ -310,6 +316,12 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, case CURLINFO_RTSP_CSEQ_RECV: *param_longp = data->state.rtsp_CSeq_recv; break; +#else + case CURLINFO_RTSP_CLIENT_CSEQ: + case CURLINFO_RTSP_SERVER_CSEQ: + case CURLINFO_RTSP_CSEQ_RECV: + *param_longp = 0; + break; #endif case CURLINFO_HTTP_VERSION: switch(data->info.httpversion) { @@ -331,7 +343,7 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, } break; case CURLINFO_PROTOCOL: - *param_longp = data->info.conn_protocol; + *param_longp = (long)data->info.conn_protocol; break; case CURLINFO_USED_PROXY: *param_longp = @@ -357,13 +369,14 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, #ifdef DEBUGBUILD char *timestr = getenv("CURL_TIME"); if(timestr) { - unsigned long val = strtol(timestr, NULL, 10); + unsigned long val = strtoul(timestr, NULL, 10); 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_STARTTRANSFER_TIME_T: case CURLINFO_REDIRECT_TIME_T: case CURLINFO_SPEED_DOWNLOAD_T: @@ -380,24 +393,24 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, *param_offt = (curl_off_t)data->info.filetime; break; case CURLINFO_SIZE_UPLOAD_T: - *param_offt = data->progress.uploaded; + *param_offt = data->progress.ul.cur_size; break; case CURLINFO_SIZE_DOWNLOAD_T: - *param_offt = data->progress.downloaded; + *param_offt = data->progress.dl.cur_size; break; case CURLINFO_SPEED_DOWNLOAD_T: - *param_offt = data->progress.dlspeed; + *param_offt = data->progress.dl.speed; break; case CURLINFO_SPEED_UPLOAD_T: - *param_offt = data->progress.ulspeed; + *param_offt = data->progress.ul.speed; break; case CURLINFO_CONTENT_LENGTH_DOWNLOAD_T: - *param_offt = (data->progress.flags & PGRS_DL_SIZE_KNOWN)? - data->progress.size_dl:-1; + *param_offt = (data->progress.flags & PGRS_DL_SIZE_KNOWN) ? + data->progress.dl.total_size : -1; break; case CURLINFO_CONTENT_LENGTH_UPLOAD_T: - *param_offt = (data->progress.flags & PGRS_UL_SIZE_KNOWN)? - data->progress.size_ul:-1; + *param_offt = (data->progress.flags & PGRS_UL_SIZE_KNOWN) ? + data->progress.ul.total_size : -1; break; case CURLINFO_TOTAL_TIME_T: *param_offt = data->progress.timespent; @@ -414,6 +427,9 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, case CURLINFO_PRETRANSFER_TIME_T: *param_offt = data->progress.t_pretransfer; break; + case CURLINFO_POSTTRANSFER_TIME_T: + *param_offt = data->progress.t_posttransfer; + break; case CURLINFO_STARTTRANSFER_TIME_T: *param_offt = data->progress.t_starttransfer; break; @@ -430,9 +446,12 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, *param_offt = data->id; break; case CURLINFO_CONN_ID: - *param_offt = data->conn? + *param_offt = data->conn ? data->conn->connection_id : data->state.recent_conn_id; break; + case CURLINFO_EARLYDATA_SENT_T: + *param_offt = data->progress.earlydata_sent; + break; default: return CURLE_UNKNOWN_OPTION; } @@ -446,7 +465,7 @@ static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info, #ifdef DEBUGBUILD char *timestr = getenv("CURL_TIME"); if(timestr) { - unsigned long val = strtol(timestr, NULL, 10); + unsigned long val = strtoul(timestr, NULL, 10); switch(info) { case CURLINFO_TOTAL_TIME: case CURLINFO_NAMELOOKUP_TIME: @@ -484,24 +503,24 @@ static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info, *param_doublep = DOUBLE_SECS(data->progress.t_starttransfer); break; case CURLINFO_SIZE_UPLOAD: - *param_doublep = (double)data->progress.uploaded; + *param_doublep = (double)data->progress.ul.cur_size; break; case CURLINFO_SIZE_DOWNLOAD: - *param_doublep = (double)data->progress.downloaded; + *param_doublep = (double)data->progress.dl.cur_size; break; case CURLINFO_SPEED_DOWNLOAD: - *param_doublep = (double)data->progress.dlspeed; + *param_doublep = (double)data->progress.dl.speed; break; case CURLINFO_SPEED_UPLOAD: - *param_doublep = (double)data->progress.ulspeed; + *param_doublep = (double)data->progress.ul.speed; break; case CURLINFO_CONTENT_LENGTH_DOWNLOAD: - *param_doublep = (data->progress.flags & PGRS_DL_SIZE_KNOWN)? - (double)data->progress.size_dl:-1; + *param_doublep = (data->progress.flags & PGRS_DL_SIZE_KNOWN) ? + (double)data->progress.dl.total_size : -1; break; case CURLINFO_CONTENT_LENGTH_UPLOAD: - *param_doublep = (data->progress.flags & PGRS_UL_SIZE_KNOWN)? - (double)data->progress.size_ul:-1; + *param_doublep = (data->progress.flags & PGRS_UL_SIZE_KNOWN) ? + (double)data->progress.ul.total_size : -1; break; case CURLINFO_REDIRECT_TIME: *param_doublep = DOUBLE_SECS(data->progress.t_redirect); diff --git a/deps/curl/lib/gopher.c b/deps/curl/lib/gopher.c index e1a1ba64..051e6e7a 100644 --- a/deps/curl/lib/gopher.c +++ b/deps/curl/lib/gopher.c @@ -62,7 +62,7 @@ static CURLcode gopher_connecting(struct Curl_easy *data, bool *done); */ const struct Curl_handler Curl_handler_gopher = { - "GOPHER", /* scheme */ + "gopher", /* scheme */ ZERO_NULL, /* setup_connection */ gopher_do, /* do_it */ ZERO_NULL, /* done */ @@ -76,6 +76,7 @@ const struct Curl_handler Curl_handler_gopher = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_GOPHER, /* defport */ @@ -86,7 +87,7 @@ const struct Curl_handler Curl_handler_gopher = { #ifdef USE_SSL const struct Curl_handler Curl_handler_gophers = { - "GOPHERS", /* scheme */ + "gophers", /* scheme */ ZERO_NULL, /* setup_connection */ gopher_do, /* do_it */ ZERO_NULL, /* done */ @@ -100,6 +101,7 @@ const struct Curl_handler Curl_handler_gophers = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_GOPHER, /* defport */ @@ -185,7 +187,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) if(strlen(sel) < 1) break; - result = Curl_xfer_send(data, sel, k, &amount); + result = Curl_xfer_send(data, sel, k, FALSE, &amount); if(!result) { /* Which may not have written it all! */ result = Curl_client_write(data, CLIENTWRITE_HEADER, sel, amount); if(result) @@ -207,9 +209,9 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) if(!timeout_ms) timeout_ms = TIMEDIFF_T_MAX; - /* Don't busyloop. The entire loop thing is a work-around as it causes a + /* Do not busyloop. The entire loop thing is a work-around as it causes a BLOCKING behavior which is a NO-NO. This function should rather be - split up in a do and a doing piece where the pieces that aren't + split up in a do and a doing piece where the pieces that are not possible to send now will be sent in the doing function repeatedly until the entire request is sent. */ @@ -227,7 +229,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) free(sel_org); if(!result) - result = Curl_xfer_send(data, "\r\n", 2, &amount); + result = Curl_xfer_send(data, "\r\n", 2, FALSE, &amount); if(result) { failf(data, "Failed sending Gopher request"); return result; @@ -236,7 +238,7 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done) if(result) return result; - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); return CURLE_OK; } #endif /* CURL_DISABLE_GOPHER */ diff --git a/deps/curl/lib/hash.c b/deps/curl/lib/hash.c index 30f28e23..1910ac5d 100644 --- a/deps/curl/lib/hash.c +++ b/deps/curl/lib/hash.c @@ -33,6 +33,10 @@ /* The last #include file should be: */ #include "memdebug.h" +/* random patterns for API verification */ +#define HASHINIT 0x7017e781 +#define ITERINIT 0x5FEDCBA9 + static void hash_element_dtor(void *user, void *element) { @@ -40,7 +44,10 @@ hash_element_dtor(void *user, void *element) struct Curl_hash_element *e = (struct Curl_hash_element *) element; if(e->ptr) { - h->dtor(e->ptr); + if(e->dtor) + e->dtor(e->key, e->key_len, e->ptr); + else + h->dtor(e->ptr); e->ptr = NULL; } @@ -57,7 +64,7 @@ hash_element_dtor(void *user, void *element) */ void Curl_hash_init(struct Curl_hash *h, - int slots, + size_t slots, hash_function hfunc, comp_function comparator, Curl_hash_dtor dtor) @@ -74,10 +81,14 @@ Curl_hash_init(struct Curl_hash *h, h->dtor = dtor; h->size = 0; h->slots = slots; +#ifdef DEBUGBUILD + h->init = HASHINIT; +#endif } static struct Curl_hash_element * -mk_hash_element(const void *key, size_t key_len, const void *p) +mk_hash_element(const void *key, size_t key_len, const void *p, + Curl_hash_elem_dtor dtor) { /* allocate the struct plus memory after it to store the key */ struct Curl_hash_element *he = malloc(sizeof(struct Curl_hash_element) + @@ -87,31 +98,25 @@ mk_hash_element(const void *key, size_t key_len, const void *p) memcpy(he->key, key, key_len); he->key_len = key_len; he->ptr = (void *) p; + he->dtor = dtor; } return he; } #define FETCH_LIST(x,y,z) &x->table[x->hash_func(y, z, x->slots)] -/* Insert the data in the hash. If there already was a match in the hash, that - * data is replaced. This function also "lazily" allocates the table if - * needed, as it isn't done in the _init function (anymore). - * - * @unittest: 1305 - * @unittest: 1602 - * @unittest: 1603 - */ -void * -Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) +void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, + Curl_hash_elem_dtor dtor) { struct Curl_hash_element *he; - struct Curl_llist_element *le; + struct Curl_llist_node *le; struct Curl_llist *l; DEBUGASSERT(h); DEBUGASSERT(h->slots); + DEBUGASSERT(h->init == HASHINIT); if(!h->table) { - int i; + size_t i; h->table = malloc(h->slots * sizeof(struct Curl_llist)); if(!h->table) return NULL; /* OOM */ @@ -121,18 +126,18 @@ Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) l = FETCH_LIST(h, key, key_len); - for(le = l->head; le; le = le->next) { - he = (struct Curl_hash_element *) le->ptr; + for(le = Curl_llist_head(l); le; le = Curl_node_next(le)) { + he = (struct Curl_hash_element *) Curl_node_elem(le); if(h->comp_func(he->key, he->key_len, key, key_len)) { - Curl_llist_remove(l, le, (void *)h); + Curl_node_uremove(le, (void *)h); --h->size; break; } } - he = mk_hash_element(key, key_len, p); + he = mk_hash_element(key, key_len, p, dtor); if(he) { - Curl_llist_insert_next(l, l->tail, he, &he->list); + Curl_llist_append(l, he, &he->list); ++h->size; return p; /* return the new entry */ } @@ -140,6 +145,20 @@ Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) return NULL; /* failure */ } +/* Insert the data in the hash. If there already was a match in the hash, that + * data is replaced. This function also "lazily" allocates the table if + * needed, as it is not done in the _init function (anymore). + * + * @unittest: 1305 + * @unittest: 1602 + * @unittest: 1603 + */ +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); +} + /* Remove the identified hash entry. * Returns non-zero on failure. * @@ -147,18 +166,17 @@ Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) */ int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len) { - struct Curl_llist_element *le; - struct Curl_llist *l; - DEBUGASSERT(h); DEBUGASSERT(h->slots); + DEBUGASSERT(h->init == HASHINIT); if(h->table) { - l = FETCH_LIST(h, key, key_len); + struct Curl_llist_node *le; + struct Curl_llist *l = FETCH_LIST(h, key, key_len); - for(le = l->head; le; le = le->next) { - struct Curl_hash_element *he = le->ptr; + for(le = Curl_llist_head(l); le; le = Curl_node_next(le)) { + struct Curl_hash_element *he = Curl_node_elem(le); if(h->comp_func(he->key, he->key_len, key, key_len)) { - Curl_llist_remove(l, le, (void *) h); + Curl_node_uremove(le, (void *) h); --h->size; return 0; } @@ -174,15 +192,15 @@ int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len) void * Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len) { - struct Curl_llist_element *le; - struct Curl_llist *l; - DEBUGASSERT(h); + DEBUGASSERT(h->init == HASHINIT); if(h->table) { + struct Curl_llist_node *le; + struct Curl_llist *l; DEBUGASSERT(h->slots); l = FETCH_LIST(h, key, key_len); - for(le = l->head; le; le = le->next) { - struct Curl_hash_element *he = le->ptr; + for(le = Curl_llist_head(l); le; le = Curl_node_next(le)) { + struct Curl_hash_element *he = Curl_node_elem(le); if(h->comp_func(he->key, he->key_len, key, key_len)) { return he->ptr; } @@ -192,25 +210,6 @@ Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len) return NULL; } -#if defined(DEBUGBUILD) && defined(AGGRESSIVE_TEST) -void -Curl_hash_apply(Curl_hash *h, void *user, - void (*cb)(void *user, void *ptr)) -{ - struct Curl_llist_element *le; - int i; - - for(i = 0; i < h->slots; ++i) { - for(le = (h->table[i])->head; - le; - le = le->next) { - Curl_hash_element *el = le->ptr; - cb(user, el->ptr); - } - } -} -#endif - /* Destroys all the entries in the given hash and resets its attributes, * prepping the given hash for [static|dynamic] deallocation. * @@ -221,8 +220,9 @@ Curl_hash_apply(Curl_hash *h, void *user, void Curl_hash_destroy(struct Curl_hash *h) { + DEBUGASSERT(h->init == HASHINIT); if(h->table) { - int i; + size_t i; for(i = 0; i < h->slots; ++i) { Curl_llist_destroy(&h->table[i], (void *) h); } @@ -242,28 +242,33 @@ Curl_hash_clean(struct Curl_hash *h) Curl_hash_clean_with_criterium(h, NULL, NULL); } +size_t Curl_hash_count(struct Curl_hash *h) +{ + DEBUGASSERT(h->init == HASHINIT); + return h->size; +} + /* 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 *)) { - struct Curl_llist_element *le; - struct Curl_llist_element *lnext; - struct Curl_llist *list; - int i; + size_t i; if(!h || !h->table) return; + DEBUGASSERT(h->init == HASHINIT); for(i = 0; i < h->slots; ++i) { - list = &h->table[i]; - le = list->head; /* get first list entry */ + struct Curl_llist *list = &h->table[i]; + struct Curl_llist_node *le = + Curl_llist_head(list); /* get first list entry */ while(le) { - struct Curl_hash_element *he = le->ptr; - lnext = le->next; + struct Curl_hash_element *he = Curl_node_elem(le); + struct Curl_llist_node *lnext = Curl_node_next(le); /* ask the callback function if we shall remove this entry or not */ if(!comp || comp(user, he->ptr)) { - Curl_llist_remove(list, le, (void *) h); + Curl_node_uremove(le, (void *) h); --h->size; /* one less entry in the hash now */ } le = lnext; @@ -278,8 +283,9 @@ size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num) size_t h = 5381; while(key_str < end) { + size_t j = (size_t)*key_str++; h += h << 5; - h ^= *key_str++; + h ^= j; } return (h % slots_num); @@ -297,29 +303,34 @@ size_t Curl_str_key_compare(void *k1, size_t key1_len, void Curl_hash_start_iterate(struct Curl_hash *hash, struct Curl_hash_iterator *iter) { + DEBUGASSERT(hash->init == HASHINIT); iter->hash = hash; iter->slot_index = 0; iter->current_element = NULL; +#ifdef DEBUGBUILD + iter->init = ITERINIT; +#endif } struct Curl_hash_element * Curl_hash_next_element(struct Curl_hash_iterator *iter) { - struct Curl_hash *h = iter->hash; - + struct Curl_hash *h; + DEBUGASSERT(iter->init == ITERINIT); + h = iter->hash; if(!h->table) return NULL; /* empty hash, nothing to return */ /* Get the next element in the current list, if any */ if(iter->current_element) - iter->current_element = iter->current_element->next; + iter->current_element = Curl_node_next(iter->current_element); /* If we have reached the end of the list, find the next one */ if(!iter->current_element) { - int i; + size_t i; for(i = iter->slot_index; i < h->slots; i++) { - if(h->table[i].head) { - iter->current_element = h->table[i].head; + if(Curl_llist_head(&h->table[i])) { + iter->current_element = Curl_llist_head(&h->table[i]); iter->slot_index = i + 1; break; } @@ -327,7 +338,7 @@ Curl_hash_next_element(struct Curl_hash_iterator *iter) } if(iter->current_element) { - struct Curl_hash_element *he = iter->current_element->ptr; + struct Curl_hash_element *he = Curl_node_elem(iter->current_element); return he; } return NULL; @@ -339,7 +350,7 @@ void Curl_hash_print(struct Curl_hash *h, { struct Curl_hash_iterator iter; struct Curl_hash_element *he; - int last_index = -1; + size_t last_index = ~0; if(!h) return; @@ -352,7 +363,7 @@ void Curl_hash_print(struct Curl_hash *h, while(he) { if(iter.slot_index != last_index) { fprintf(stderr, "index %d:", iter.slot_index); - if(last_index >= 0) { + if(last_index != ~0) { fprintf(stderr, "\n"); } last_index = iter.slot_index; @@ -368,3 +379,25 @@ void Curl_hash_print(struct Curl_hash *h, fprintf(stderr, "\n"); } #endif + +void Curl_hash_offt_init(struct Curl_hash *h, + size_t slots, + Curl_hash_dtor dtor) +{ + Curl_hash_init(h, slots, Curl_hash_str, Curl_str_key_compare, dtor); +} + +void *Curl_hash_offt_set(struct Curl_hash *h, curl_off_t id, void *elem) +{ + return Curl_hash_add(h, &id, sizeof(id), elem); +} + +int Curl_hash_offt_remove(struct Curl_hash *h, curl_off_t id) +{ + return Curl_hash_delete(h, &id, sizeof(id)); +} + +void *Curl_hash_offt_get(struct Curl_hash *h, curl_off_t id) +{ + return Curl_hash_pick(h, &id, sizeof(id)); +} diff --git a/deps/curl/lib/hash.h b/deps/curl/lib/hash.h index 9cfffc25..b1603950 100644 --- a/deps/curl/lib/hash.h +++ b/deps/curl/lib/hash.h @@ -54,36 +54,49 @@ struct Curl_hash { /* Comparator function to compare keys */ comp_function comp_func; Curl_hash_dtor dtor; - int slots; + size_t slots; size_t size; +#ifdef DEBUGBUILD + int init; +#endif }; +typedef void (*Curl_hash_elem_dtor)(void *key, size_t key_len, void *p); + struct Curl_hash_element { - struct Curl_llist_element list; + struct Curl_llist_node list; void *ptr; + Curl_hash_elem_dtor dtor; size_t key_len; +#ifdef DEBUGBUILD + int init; +#endif char key[1]; /* allocated memory following the struct */ }; struct Curl_hash_iterator { struct Curl_hash *hash; - int slot_index; - struct Curl_llist_element *current_element; + size_t slot_index; + struct Curl_llist_node *current_element; +#ifdef DEBUGBUILD + int init; +#endif }; void Curl_hash_init(struct Curl_hash *h, - int slots, + size_t slots, hash_function hfunc, comp_function comparator, Curl_hash_dtor dtor); void *Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p); +void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, + Curl_hash_elem_dtor dtor); int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len); void *Curl_hash_pick(struct Curl_hash *, void *key, size_t key_len); -void Curl_hash_apply(struct Curl_hash *h, void *user, - void (*cb)(void *user, void *ptr)); -#define Curl_hash_count(h) ((h)->size) + void Curl_hash_destroy(struct Curl_hash *h); +size_t Curl_hash_count(struct Curl_hash *h); void Curl_hash_clean(struct Curl_hash *h); void Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, int (*comp)(void *, void *)); @@ -98,5 +111,13 @@ Curl_hash_next_element(struct Curl_hash_iterator *iter); void Curl_hash_print(struct Curl_hash *h, void (*func)(void *)); +/* Hash for `curl_off_t` as key */ +void Curl_hash_offt_init(struct Curl_hash *h, size_t slots, + Curl_hash_dtor dtor); + +void *Curl_hash_offt_set(struct Curl_hash *h, curl_off_t id, void *elem); +int Curl_hash_offt_remove(struct Curl_hash *h, curl_off_t id); +void *Curl_hash_offt_get(struct Curl_hash *h, curl_off_t id); + #endif /* HEADER_CURL_HASH_H */ diff --git a/deps/curl/lib/headers.c b/deps/curl/lib/headers.c index 0c53dec6..2985e1e1 100644 --- a/deps/curl/lib/headers.c +++ b/deps/curl/lib/headers.c @@ -42,7 +42,7 @@ static void copy_header_external(struct Curl_header_store *hs, size_t index, size_t amount, - struct Curl_llist_element *e, + struct Curl_llist_node *e, struct curl_header *hout) { struct curl_header *h = hout; @@ -54,7 +54,7 @@ static void copy_header_external(struct Curl_header_store *hs, impossible for applications to do == comparisons, as that would otherwise be very tempting and then lead to the reserved bits not being reserved anymore. */ - h->origin = hs->type | (1<<27); + h->origin = (unsigned int)(hs->type | (1 << 27)); h->anchor = e; } @@ -66,8 +66,8 @@ CURLHcode curl_easy_header(CURL *easy, int request, struct curl_header **hout) { - struct Curl_llist_element *e; - struct Curl_llist_element *e_pick = NULL; + struct Curl_llist_node *e; + struct Curl_llist_node *e_pick = NULL; struct Curl_easy *data = easy; size_t match = 0; size_t amount = 0; @@ -85,8 +85,8 @@ CURLHcode curl_easy_header(CURL *easy, request = data->state.requests; /* we need a first round to count amount of this header */ - for(e = data->state.httphdrs.head; e; e = e->next) { - hs = e->ptr; + for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) { + hs = Curl_node_elem(e); if(strcasecompare(hs->name, name) && (hs->type & type) && (hs->request == request)) { @@ -104,8 +104,8 @@ CURLHcode curl_easy_header(CURL *easy, /* if the last or only occurrence is what's asked for, then we know it */ hs = pick; else { - for(e = data->state.httphdrs.head; e; e = e->next) { - hs = e->ptr; + for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) { + hs = Curl_node_elem(e); if(strcasecompare(hs->name, name) && (hs->type & type) && (hs->request == request) && @@ -114,7 +114,7 @@ CURLHcode curl_easy_header(CURL *easy, break; } } - if(!e) /* this shouldn't happen */ + if(!e) /* this should not happen */ return CURLHE_MISSING; } /* this is the name we want */ @@ -131,8 +131,8 @@ struct curl_header *curl_easy_nextheader(CURL *easy, struct curl_header *prev) { struct Curl_easy *data = easy; - struct Curl_llist_element *pick; - struct Curl_llist_element *e; + struct Curl_llist_node *pick; + struct Curl_llist_node *e; struct Curl_header_store *hs; size_t amount = 0; size_t index = 0; @@ -147,18 +147,18 @@ struct curl_header *curl_easy_nextheader(CURL *easy, if(!pick) /* something is wrong */ return NULL; - pick = pick->next; + pick = Curl_node_next(pick); } else - pick = data->state.httphdrs.head; + pick = Curl_llist_head(&data->state.httphdrs); if(pick) { /* make sure it is the next header of the desired type */ do { - hs = pick->ptr; + hs = Curl_node_elem(pick); if((hs->type & type) && (hs->request == request)) break; - pick = pick->next; + pick = Curl_node_next(pick); } while(pick); } @@ -166,12 +166,12 @@ struct curl_header *curl_easy_nextheader(CURL *easy, /* no more headers available */ return NULL; - hs = pick->ptr; + hs = Curl_node_elem(pick); /* count number of occurrences of this name within the mask and figure out the index for the currently selected entry */ - for(e = data->state.httphdrs.head; e; e = e->next) { - struct Curl_header_store *check = e->ptr; + for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) { + struct Curl_header_store *check = Curl_node_elem(e); if(strcasecompare(hs->name, check->name) && (check->request == request) && (check->type & type)) @@ -247,13 +247,13 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value, /* since this header block might move in the realloc below, it needs to first be unlinked from the list and then re-added again after the realloc */ - Curl_llist_remove(&data->state.httphdrs, &hs->node, NULL); + Curl_node_remove(&hs->node); /* new size = struct + new value length + old name+value length */ newhs = Curl_saferealloc(hs, sizeof(*hs) + vlen + oalloc + 1); if(!newhs) return CURLE_OUT_OF_MEMORY; - /* ->name' and ->value point into ->buffer (to keep the header allocation + /* ->name and ->value point into ->buffer (to keep the header allocation in a single memory block), which now potentially have moved. Adjust them. */ newhs->name = newhs->buffer; @@ -264,8 +264,7 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value, newhs->value[olen + vlen] = 0; /* null-terminate at newline */ /* insert this node into the list of headers */ - Curl_llist_insert_next(&data->state.httphdrs, data->state.httphdrs.tail, - newhs, &newhs->node); + Curl_llist_append(&data->state.httphdrs, newhs, &newhs->node); data->state.prevhead = newhs; return CURLE_OK; } @@ -303,7 +302,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, /* line folding, append value to the previous header's value */ return unfold_value(data, header, hlen); else { - /* Can't unfold without a previous header. Instead of erroring, just + /* cannot unfold without a previous header. Instead of erroring, just pass the leading blanks. */ while(hlen && ISBLANK(*header)) { header++; @@ -328,8 +327,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, hs->request = data->state.requests; /* insert this node into the list of headers */ - Curl_llist_insert_next(&data->state.httphdrs, data->state.httphdrs.tail, - hs, &hs->node); + Curl_llist_append(&data->state.httphdrs, hs, &hs->node); data->state.prevhead = hs; } else @@ -361,6 +359,8 @@ static CURLcode hds_cw_collect_write(struct Curl_easy *data, (type & CLIENTWRITE_TRAILER ? CURLH_TRAILER : CURLH_HEADER))); CURLcode result = Curl_headers_push(data, buf, htype); + CURL_TRC_WRITE(data, "header_collect pushed(type=%x, len=%zu) -> %d", + htype, blen, result); if(result) return result; } @@ -405,12 +405,12 @@ CURLcode Curl_headers_init(struct Curl_easy *data) */ CURLcode Curl_headers_cleanup(struct Curl_easy *data) { - struct Curl_llist_element *e; - struct Curl_llist_element *n; + struct Curl_llist_node *e; + struct Curl_llist_node *n; - for(e = data->state.httphdrs.head; e; e = n) { - struct Curl_header_store *hs = e->ptr; - n = e->next; + 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); } headers_reset(data); diff --git a/deps/curl/lib/headers.h b/deps/curl/lib/headers.h index d9813388..e11fe980 100644 --- a/deps/curl/lib/headers.h +++ b/deps/curl/lib/headers.h @@ -28,7 +28,7 @@ #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HEADERS_API) struct Curl_header_store { - struct Curl_llist_element node; + struct Curl_llist_node node; char *name; /* points into 'buffer' */ char *value; /* points into 'buffer */ int request; /* 0 is the first request, then 1.. 2.. */ diff --git a/deps/curl/lib/hmac.c b/deps/curl/lib/hmac.c index 4019b67f..088c9bdc 100644 --- a/deps/curl/lib/hmac.c +++ b/deps/curl/lib/hmac.c @@ -42,15 +42,13 @@ * Generic HMAC algorithm. * * This module computes HMAC digests based on any hash function. Parameters - * and computing procedures are set-up dynamically at HMAC computation context + * and computing procedures are setup dynamically at HMAC computation context * initialization. */ 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, @@ -62,42 +60,40 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, unsigned char b; /* Create HMAC context. */ - i = sizeof(*ctxt) + 2 * hashparams->hmac_ctxtsize + - hashparams->hmac_resultlen; + i = sizeof(*ctxt) + 2 * hashparams->ctxtsize + hashparams->resultlen; ctxt = malloc(i); if(!ctxt) return ctxt; - ctxt->hmac_hash = hashparams; - ctxt->hmac_hashctxt1 = (void *) (ctxt + 1); - ctxt->hmac_hashctxt2 = (void *) ((char *) ctxt->hmac_hashctxt1 + - hashparams->hmac_ctxtsize); + ctxt->hash = hashparams; + 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->hmac_maxkeylen) { - (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1); - (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, key, keylen); - hkey = (unsigned char *) ctxt->hmac_hashctxt2 + hashparams->hmac_ctxtsize; - (*hashparams->hmac_hfinal)(hkey, ctxt->hmac_hashctxt1); + if(keylen > hashparams->maxkeylen) { + hashparams->hinit(ctxt->hashctxt1); + hashparams->hupdate(ctxt->hashctxt1, key, keylen); + hkey = (unsigned char *) ctxt->hashctxt2 + hashparams->ctxtsize; + hashparams->hfinal(hkey, ctxt->hashctxt1); key = hkey; - keylen = hashparams->hmac_resultlen; + keylen = hashparams->resultlen; } /* Prime the two hash contexts with the modified key. */ - (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1); - (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2); + hashparams->hinit(ctxt->hashctxt1); + hashparams->hinit(ctxt->hashctxt2); for(i = 0; i < keylen; i++) { b = (unsigned char)(*key ^ hmac_ipad); - (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1); + hashparams->hupdate(ctxt->hashctxt1, &b, 1); b = (unsigned char)(*key++ ^ hmac_opad); - (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1); + hashparams->hupdate(ctxt->hashctxt2, &b, 1); } - for(; i < hashparams->hmac_maxkeylen; i++) { - (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &hmac_ipad, 1); - (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &hmac_opad, 1); + for(; i < hashparams->maxkeylen; i++) { + hashparams->hupdate(ctxt->hashctxt1, &hmac_ipad, 1); + hashparams->hupdate(ctxt->hashctxt2, &hmac_opad, 1); } /* Done, return pointer to HMAC context. */ @@ -105,31 +101,29 @@ Curl_HMAC_init(const struct HMAC_params *hashparams, } int Curl_HMAC_update(struct HMAC_context *ctxt, - const unsigned char *data, + const unsigned char *ptr, unsigned int len) { /* Update first hash calculation. */ - (*ctxt->hmac_hash->hmac_hupdate)(ctxt->hmac_hashctxt1, data, len); + ctxt->hash->hupdate(ctxt->hashctxt1, ptr, len); return 0; } -int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *result) +int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output) { - const struct HMAC_params *hashparams = ctxt->hmac_hash; + const struct HMAC_params *hashparams = ctxt->hash; - /* Do not get result if called with a null parameter: only release + /* Do not get output if called with a null parameter: only release storage. */ - if(!result) - result = (unsigned char *) ctxt->hmac_hashctxt2 + - ctxt->hmac_hash->hmac_ctxtsize; + if(!output) + output = (unsigned char *) ctxt->hashctxt2 + ctxt->hash->ctxtsize; - (*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt1); - (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, - result, hashparams->hmac_resultlen); - (*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt2); - free((char *) ctxt); + hashparams->hfinal(output, ctxt->hashctxt1); + hashparams->hupdate(ctxt->hashctxt2, output, hashparams->resultlen); + hashparams->hfinal(output, ctxt->hashctxt2); + free(ctxt); return 0; } @@ -144,15 +138,15 @@ int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *result) * hashparams [in] - The hash function (Curl_HMAC_MD5). * key [in] - The key to use. * keylen [in] - The length of the key. - * data [in] - The data to encrypt. - * datalen [in] - The length of the data. + * buf [in] - The data to encrypt. + * buflen [in] - The length of the data. * output [in/out] - The output buffer. * * Returns CURLE_OK on success. */ CURLcode Curl_hmacit(const struct HMAC_params *hashparams, const unsigned char *key, const size_t keylen, - const unsigned char *data, const size_t datalen, + const unsigned char *buf, const size_t buflen, unsigned char *output) { struct HMAC_context *ctxt = @@ -162,7 +156,7 @@ CURLcode Curl_hmacit(const struct HMAC_params *hashparams, return CURLE_OUT_OF_MEMORY; /* Update the digest with the given challenge */ - Curl_HMAC_update(ctxt, data, curlx_uztoui(datalen)); + Curl_HMAC_update(ctxt, buf, curlx_uztoui(buflen)); /* Finalise the digest */ Curl_HMAC_final(ctxt, output); diff --git a/deps/curl/lib/hostasyn.c b/deps/curl/lib/hostasyn.c index 2f6762ca..4d6a8e85 100644 --- a/deps/curl/lib/hostasyn.c +++ b/deps/curl/lib/hostasyn.c @@ -79,7 +79,7 @@ CURLcode Curl_addrinfo_callback(struct Curl_easy *data, dns = Curl_cache_addr(data, ai, data->state.async.hostname, 0, - data->state.async.port); + data->state.async.port, FALSE); if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); diff --git a/deps/curl/lib/hostip.c b/deps/curl/lib/hostip.c index 442817d1..fe8cc5cb 100644 --- a/deps/curl/lib/hostip.c +++ b/deps/curl/lib/hostip.c @@ -84,8 +84,8 @@ * source file are these: * * CURLRES_IPV6 - this host has getaddrinfo() and family, and thus we use - * that. The host may not be able to resolve IPv6, but we don't really have to - * take that into account. Hosts that aren't IPv6-enabled have CURLRES_IPV4 + * that. The host may not be able to resolve IPv6, but we do not really have to + * take that into account. Hosts that are not IPv6-enabled have CURLRES_IPV4 * defined. * * CURLRES_ARES - is defined if libcurl is built to use c-ares for @@ -115,7 +115,7 @@ * CURLRES_* defines based on the config*.h and curl_setup.h defines. */ -static void freednsentry(void *freethis); +static void hostcache_unlink_entry(void *entry); #ifndef CURL_DISABLE_VERBOSE_STRINGS static void show_resolve_info(struct Curl_easy *data, @@ -144,7 +144,7 @@ void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf, (void)Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize); break; } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: { const struct sockaddr_in6 *sa6 = (const void *)ai->ai_addr; const struct in6_addr *ipaddr6 = &sa6->sin6_addr; @@ -167,23 +167,18 @@ create_hostcache_id(const char *name, int port, char *ptr, size_t buflen) { size_t len = nlen ? nlen : strlen(name); - size_t olen = 0; DEBUGASSERT(buflen >= MAX_HOSTCACHE_LEN); if(len > (buflen - 7)) len = buflen - 7; /* store and lower case the name */ - while(len--) { - *ptr++ = Curl_raw_tolower(*name++); - olen++; - } - olen += msnprintf(ptr, 7, ":%u", port); - return olen; + Curl_strntolower(ptr, name, len); + return msnprintf(&ptr[len], 7, ":%u", port) + len; } struct hostcache_prune_data { time_t now; time_t oldest; /* oldest time in cache not pruned. */ - int cache_timeout; + int max_age_sec; }; /* @@ -194,16 +189,16 @@ struct hostcache_prune_data { * cache. */ static int -hostcache_timestamp_remove(void *datap, void *hc) +hostcache_entry_is_stale(void *datap, void *hc) { struct hostcache_prune_data *prune = (struct hostcache_prune_data *) datap; - struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc; + struct Curl_dns_entry *dns = (struct Curl_dns_entry *) hc; - if(c->timestamp) { + if(dns->timestamp) { /* age in seconds */ - time_t age = prune->now - c->timestamp; - if(age >= prune->cache_timeout) + time_t age = prune->now - dns->timestamp; + if(age >= prune->max_age_sec) return TRUE; if(age > prune->oldest) prune->oldest = age; @@ -221,13 +216,13 @@ hostcache_prune(struct Curl_hash *hostcache, int cache_timeout, { struct hostcache_prune_data user; - user.cache_timeout = cache_timeout; + user.max_age_sec = cache_timeout; user.now = now; user.oldest = 0; Curl_hash_clean_with_criterium(hostcache, (void *) &user, - hostcache_timestamp_remove); + hostcache_entry_is_stale); return user.oldest; } @@ -243,13 +238,13 @@ void Curl_hostcache_prune(struct Curl_easy *data) int timeout = data->set.dns_cache_timeout; if(!data->dns.hostcache) - /* NULL hostcache means we can't do it */ + /* NULL hostcache means we cannot do it */ return; if(data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - time(&now); + now = time(NULL); do { /* Remove outdated and unused entries from the hostcache */ @@ -262,7 +257,8 @@ void Curl_hostcache_prune(struct Curl_easy *data) /* if the cache size is still too big, use the oldest age as new prune limit */ - } while(timeout && (data->dns.hostcache->size > MAX_DNS_CACHE_SIZE)); + } while(timeout && + (Curl_hash_count(data->dns.hostcache) > MAX_DNS_CACHE_SIZE)); if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); @@ -288,14 +284,14 @@ static struct Curl_dns_entry *fetch_addr(struct Curl_easy *data, size_t entry_len = create_hostcache_id(hostname, 0, port, entry_id, sizeof(entry_id)); - /* See if it's already in our dns cache */ + /* See if it is already in our dns cache */ dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1); /* No entry found in cache, check if we might have a wildcard entry */ if(!dns && data->state.wildcard_resolve) { entry_len = create_hostcache_id("*", 1, port, entry_id, sizeof(entry_id)); - /* See if it's already in our dns cache */ + /* See if it is already in our dns cache */ dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1); } @@ -303,11 +299,11 @@ static struct Curl_dns_entry *fetch_addr(struct Curl_easy *data, /* See whether the returned entry is stale. Done before we release lock */ struct hostcache_prune_data user; - time(&user.now); - user.cache_timeout = data->set.dns_cache_timeout; + user.now = time(NULL); + user.max_age_sec = data->set.dns_cache_timeout; user.oldest = 0; - if(hostcache_timestamp_remove(&user, dns)) { + if(hostcache_entry_is_stale(&user, dns)) { infof(data, "Hostname in DNS cache was stale, zapped"); dns = NULL; /* the memory deallocation is being handled by the hash */ Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1); @@ -317,7 +313,7 @@ static struct Curl_dns_entry *fetch_addr(struct Curl_easy *data, /* See if the returned entry matches the required resolve mode */ if(dns && data->conn->ip_version != CURL_IPRESOLVE_WHATEVER) { int pf = PF_INET; - bool found = false; + bool found = FALSE; struct Curl_addrinfo *addr = dns->addr; #ifdef PF_INET6 @@ -327,14 +323,14 @@ static struct Curl_dns_entry *fetch_addr(struct Curl_easy *data, while(addr) { if(addr->ai_family == pf) { - found = true; + found = TRUE; break; } addr = addr->ai_next; } if(!found) { - infof(data, "Hostname in DNS cache doesn't have needed family, zapped"); + infof(data, "Hostname in DNS cache does not have needed family, zapped"); dns = NULL; /* the memory deallocation is being handled by the hash */ Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1); } @@ -353,8 +349,8 @@ static struct Curl_dns_entry *fetch_addr(struct Curl_easy *data, * * Returns the Curl_dns_entry entry pointer or NULL if not in the cache. * - * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after - * use, or we'll leak memory! + * The returned data *MUST* be "released" with Curl_resolv_unlink() after + * use, or we will leak memory! */ struct Curl_dns_entry * Curl_fetch_addr(struct Curl_easy *data, @@ -369,7 +365,7 @@ Curl_fetch_addr(struct Curl_easy *data, dns = fetch_addr(data, hostname, port); if(dns) - dns->inuse++; /* we use it! */ + dns->refcount++; /* we use it! */ if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); @@ -433,8 +429,8 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data, if(Curl_rand(data, (unsigned char *)rnd, rnd_size) == CURLE_OK) { struct Curl_addrinfo *swap_tmp; for(i = num_addrs - 1; i > 0; i--) { - swap_tmp = nodes[rnd[i] % (i + 1)]; - nodes[rnd[i] % (i + 1)] = nodes[i]; + swap_tmp = nodes[rnd[i] % (unsigned int)(i + 1)]; + nodes[rnd[i] % (unsigned int)(i + 1)] = nodes[i]; nodes[i] = swap_tmp; } @@ -473,7 +469,8 @@ Curl_cache_addr(struct Curl_easy *data, struct Curl_addrinfo *addr, const char *hostname, size_t hostlen, /* length or zero */ - int port) + int port, + bool permanent) { char entry_id[MAX_HOSTCACHE_LEN]; size_t entry_len; @@ -501,11 +498,15 @@ Curl_cache_addr(struct Curl_easy *data, entry_len = create_hostcache_id(hostname, hostlen, port, entry_id, sizeof(entry_id)); - dns->inuse = 1; /* the cache has the first reference */ + dns->refcount = 1; /* the cache has the first reference */ dns->addr = addr; /* this is the address(es) */ - time(&dns->timestamp); - if(dns->timestamp == 0) - dns->timestamp = 1; /* zero indicates permanent CURLOPT_RESOLVE entry */ + if(permanent) + dns->timestamp = 0; /* an entry that never goes stale */ + else { + dns->timestamp = time(NULL); + if(dns->timestamp == 0) + dns->timestamp = 1; + } dns->hostport = port; if(hostlen) memcpy(dns->hostname, hostname, hostlen); @@ -519,11 +520,11 @@ Curl_cache_addr(struct Curl_easy *data, } dns = dns2; - dns->inuse++; /* mark entry as in-use */ + dns->refcount++; /* mark entry as in-use */ return dns; } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 /* return a static IPv6 ::1 for the name */ static struct Curl_addrinfo *get_localhost6(int port, const char *name) { @@ -541,8 +542,8 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name) sa6.sin6_port = htons(port16); sa6.sin6_flowinfo = 0; sa6.sin6_scope_id = 0; - if(Curl_inet_pton(AF_INET6, "::1", ipv6) < 1) - return NULL; + + (void)Curl_inet_pton(AF_INET6, "::1", ipv6); memcpy(&sa6.sin6_addr, ipv6, sizeof(ipv6)); ca->ai_flags = 0; @@ -600,14 +601,14 @@ static struct Curl_addrinfo *get_localhost(int port, const char *name) return ca6; } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 /* * Curl_ipv6works() returns TRUE if IPv6 seems to work. */ bool Curl_ipv6works(struct Curl_easy *data) { if(data) { - /* the nature of most system is that IPv6 status doesn't come and go + /* the nature of most system is that IPv6 status does not come and go during a program's lifetime so we only probe the first time and then we have the info kept for fast reuse */ DEBUGASSERT(data); @@ -623,16 +624,16 @@ bool Curl_ipv6works(struct Curl_easy *data) /* probe to see if we have a working IPv6 stack */ curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0); if(s == CURL_SOCKET_BAD) - /* an IPv6 address was requested but we can't get/use one */ + /* an IPv6 address was requested but we cannot get/use one */ ipv6_works = 0; else { ipv6_works = 1; sclose(s); } - return (ipv6_works>0)?TRUE:FALSE; + return (ipv6_works > 0); } } -#endif /* ENABLE_IPV6 */ +#endif /* USE_IPV6 */ /* * Curl_host_is_ipnum() returns TRUE if the given string is a numerical IPv4 @@ -641,11 +642,11 @@ bool Curl_ipv6works(struct Curl_easy *data) bool Curl_host_is_ipnum(const char *hostname) { struct in_addr in; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct in6_addr in6; #endif if(Curl_inet_pton(AF_INET, hostname, &in) > 0 -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 || Curl_inet_pton(AF_INET6, hostname, &in6) > 0 #endif ) @@ -667,12 +668,12 @@ static bool tailmatch(const char *full, const char *part) /* * Curl_resolv() is the main name resolve function within libcurl. It resolves * a name and returns a pointer to the entry in the 'entry' argument (if one - * is provided). This function might return immediately if we're using asynch + * is provided). This function might return immediately if we are using asynch * resolves. See the return codes. * * The cache entry we return will get its 'inuse' counter increased when this - * function is used. You MUST call Curl_resolv_unlock() later (when you're - * done using this struct) to decrease the counter again. + * function is used. You MUST call Curl_resolv_unlink() later (when you are + * done using this struct) to decrease the reference counter again. * * Return codes: * @@ -713,7 +714,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, if(dns) { infof(data, "Hostname %s was found in DNS cache", hostname); - dns->inuse++; /* we use it! */ + dns->refcount++; /* we use it! */ rc = CURLRESOLV_RESOLVED; } @@ -738,7 +739,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, /* notify the resolver start callback */ if(data->set.resolver_start) { int st; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); st = data->set.resolver_start( #ifdef USE_CURL_ASYNC data->state.async.resolver, @@ -747,7 +748,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, #endif NULL, data->set.resolver_start_client); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(st) return CURLRESOLV_ERROR; } @@ -760,7 +761,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, if(!addr) return CURLRESOLV_ERROR; } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else { struct in6_addr in6; /* check if this is an IPv6 address string */ @@ -771,7 +772,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, return CURLRESOLV_ERROR; } } -#endif /* ENABLE_IPV6 */ +#endif /* USE_IPV6 */ #else /* if USE_RESOLVE_ON_IPS */ #ifndef CURL_DISABLE_DOH @@ -779,7 +780,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, if(Curl_inet_pton(AF_INET, hostname, &in) > 0) /* This is a dotted IP address 123.123.123.123-style */ ipnum = TRUE; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else { struct in6_addr in6; /* check if this is an IPv6 address string */ @@ -787,7 +788,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, /* This is an IPv6 address literal */ ipnum = TRUE; } -#endif /* ENABLE_IPV6 */ +#endif /* USE_IPV6 */ #endif /* CURL_DISABLE_DOH */ #endif /* !USE_RESOLVE_ON_IPS */ @@ -818,7 +819,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, if(respwait) { /* the response to our resolve call will come asynchronously at a later time, good or bad */ - /* First, check that we haven't received the info by now */ + /* First, check that we have not received the info by now */ result = Curl_resolv_check(data, &dns); if(result) /* error detected */ return CURLRESOLV_ERROR; @@ -833,7 +834,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); /* we got a response, store it in the cache */ - dns = Curl_cache_addr(data, addr, hostname, 0, port); + dns = Curl_cache_addr(data, addr, hostname, 0, port, FALSE); if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); @@ -856,7 +857,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, #ifdef USE_ALARM_TIMEOUT /* * This signal handler jumps back into the main libcurl code and continues - * execution. This effectively causes the remainder of the application to run + * 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 @@ -869,12 +870,12 @@ void alarmfunc(int sig) /* * Curl_resolv_timeout() is the same as Curl_resolv() but specifies a - * timeout. This function might return immediately if we're using asynch + * timeout. This function might return immediately if we are using asynch * resolves. See the return codes. * * The cache entry we return will get its 'inuse' counter increased when this - * function is used. You MUST call Curl_resolv_unlock() later (when you're - * done using this struct) to decrease the counter again. + * function is used. You MUST call Curl_resolv_unlink() later (when you are + * done using this struct) to decrease the reference counter again. * * If built with a synchronous resolver and use of signals is not * disabled by the application, then a nonzero timeout will cause a @@ -939,7 +940,7 @@ enum resolve_t Curl_resolv_timeout(struct Curl_easy *data, will generate a signal and we will siglongjmp() from that here. This technique has problems (see alarmfunc). This should be the last thing we do before calling Curl_resolv(), - as otherwise we'd have to worry about variables that get modified + as otherwise we would have to worry about variables that get modified before we invoke Curl_resolv() (and thus use "volatile"). */ curl_simple_lock_lock(&curl_jmpenv_lock); @@ -960,7 +961,7 @@ enum resolve_t Curl_resolv_timeout(struct Curl_easy *data, keep_copysig = TRUE; /* yes, we have a copy */ sigact.sa_handler = alarmfunc; #ifdef SA_RESTART - /* HPUX doesn't have SA_RESTART but defaults to that behavior! */ + /* HP-UX does not have SA_RESTART but defaults to that behavior! */ sigact.sa_flags &= ~SA_RESTART; #endif /* now set the new struct */ @@ -1027,7 +1028,7 @@ clean_up: ((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 - won't, and zero would be to switch it off so we never set it to + will not, and zero would be to switch it off so we never set it to less than 1! */ alarm(1); rc = CURLRESOLV_TIMEDOUT; @@ -1042,18 +1043,20 @@ clean_up: } /* - * Curl_resolv_unlock() unlocks the given cached DNS entry. When this has been - * made, the struct may be destroyed due to pruning. It is important that only - * one unlock is made for each Curl_resolv() call. + * Curl_resolv_unlink() releases a reference to the given cached DNS entry. + * When the reference count reaches 0, the entry is destroyed. It is important + * that only one unlink is made for each Curl_resolv() call. * * May be called with 'data' == NULL for global cache. */ -void Curl_resolv_unlock(struct Curl_easy *data, struct Curl_dns_entry *dns) +void Curl_resolv_unlink(struct Curl_easy *data, struct Curl_dns_entry **pdns) { + struct Curl_dns_entry *dns = *pdns; + *pdns = NULL; if(data && data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - freednsentry(dns); + hostcache_unlink_entry(dns); if(data && data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); @@ -1062,14 +1065,31 @@ void Curl_resolv_unlock(struct Curl_easy *data, struct Curl_dns_entry *dns) /* * File-internal: release cache dns entry reference, free if inuse drops to 0 */ -static void freednsentry(void *freethis) +static void hostcache_unlink_entry(void *entry) { - struct Curl_dns_entry *dns = (struct Curl_dns_entry *) freethis; - DEBUGASSERT(dns && (dns->inuse>0)); + struct Curl_dns_entry *dns = (struct Curl_dns_entry *) entry; + DEBUGASSERT(dns && (dns->refcount > 0)); - dns->inuse--; - if(dns->inuse == 0) { + dns->refcount--; + if(dns->refcount == 0) { Curl_freeaddrinfo(dns->addr); +#ifdef USE_HTTPSRR + if(dns->hinfo) { + if(dns->hinfo->target) + free(dns->hinfo->target); + if(dns->hinfo->alpns) + free(dns->hinfo->alpns); + if(dns->hinfo->ipv4hints) + free(dns->hinfo->ipv4hints); + if(dns->hinfo->echconfiglist) + free(dns->hinfo->echconfiglist); + if(dns->hinfo->ipv6hints) + free(dns->hinfo->ipv6hints); + if(dns->hinfo->val) + free(dns->hinfo->val); + free(dns->hinfo); + } +#endif free(dns); } } @@ -1077,10 +1097,10 @@ static void freednsentry(void *freethis) /* * Curl_init_dnscache() inits a new DNS cache. */ -void Curl_init_dnscache(struct Curl_hash *hash, int size) +void Curl_init_dnscache(struct Curl_hash *hash, size_t size) { Curl_hash_init(hash, size, Curl_hash_str, Curl_str_key_compare, - freednsentry); + hostcache_unlink_entry); } /* @@ -1109,7 +1129,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) char *host_end; /* Default is no wildcard found */ - data->state.wildcard_resolve = false; + data->state.wildcard_resolve = FALSE; for(hostp = data->state.resolve; hostp; hostp = hostp->next) { char entry_id[MAX_HOSTCACHE_LEN]; @@ -1138,7 +1158,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) if(data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - /* delete entry, ignore if it didn't exist */ + /* delete entry, ignore if it did not exist */ Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1); if(data->share) @@ -1159,7 +1179,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) char *end_ptr; bool permanent = TRUE; unsigned long tmp_port; - bool error = true; + bool error = TRUE; char *host_begin = hostp->data; size_t hlen = 0; @@ -1210,7 +1230,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) memcpy(address, addr_begin, alen); address[alen] = '\0'; -#ifndef ENABLE_IPV6 +#ifndef USE_IPV6 if(strchr(address, ':')) { infof(data, "Ignoring resolve address '%s', missing IPv6 support.", address); @@ -1236,7 +1256,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) if(!head) goto err; - error = false; + error = FALSE; err: if(error) { failf(data, "Couldn't parse CURLOPT_RESOLVE entry '%s'", @@ -1252,7 +1272,7 @@ err: if(data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); - /* See if it's already in our dns cache */ + /* See if it is already in our dns cache */ dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1); if(dns) { @@ -1273,13 +1293,11 @@ err: } /* put this new host in the cache */ - dns = Curl_cache_addr(data, head, host_begin, hlen, port); + dns = Curl_cache_addr(data, head, host_begin, hlen, port, permanent); if(dns) { - if(permanent) - dns->timestamp = 0; /* mark as permanent */ /* release the returned reference; the cache itself will keep the * entry alive: */ - dns->inuse--; + dns->refcount--; } if(data->share) @@ -1298,7 +1316,7 @@ err: /* Wildcard hostname */ if((hlen == 1) && (host_begin[0] == '*')) { infof(data, "RESOLVE *:%d using wildcard", port); - data->state.wildcard_resolve = true; + data->state.wildcard_resolve = TRUE; } } } @@ -1350,7 +1368,7 @@ static void show_resolve_info(struct Curl_easy *data, if(!result) result = Curl_dyn_add(d, buf); if(result) { - infof(data, "too many IP, can't show"); + infof(data, "too many IP, cannot show"); goto fail; } } @@ -1431,8 +1449,7 @@ CURLcode Curl_once_resolved(struct Curl_easy *data, bool *protocol_done) if(result) { Curl_detach_connection(data); - Curl_conncache_remove_conn(data, conn, TRUE); - Curl_disconnect(data, conn, TRUE); + Curl_cpool_disconnect(data, conn, TRUE); } return result; } diff --git a/deps/curl/lib/hostip.h b/deps/curl/lib/hostip.h index fb53a577..b1c5ecb2 100644 --- a/deps/curl/lib/hostip.h +++ b/deps/curl/lib/hostip.h @@ -32,6 +32,10 @@ #include +#ifdef USE_HTTPSRR +# include +#endif + /* Allocate enough memory to hold the full name information structs and * everything. OSF1 is known to require at least 8872 bytes. The buffer * required for storing all possible aliases and IP numbers is according to @@ -58,15 +62,48 @@ struct connectdata; */ struct Curl_hash *Curl_global_host_cache_init(void); +#ifdef USE_HTTPSRR + +#define CURL_MAXLEN_host_name 253 + +struct Curl_https_rrinfo { + size_t len; /* raw encoded length */ + unsigned char *val; /* raw encoded octets */ + /* + * fields from HTTPS RR, with the mandatory fields + * first (priority, target), then the others in the + * order of the keytag numbers defined at + * https://datatracker.ietf.org/doc/html/rfc9460#section-14.3.2 + */ + uint16_t priority; + char *target; + char *alpns; /* keytag = 1 */ + bool no_def_alpn; /* keytag = 2 */ + /* + * we do not support ports (keytag = 3) as we do not support + * port-switching yet + */ + unsigned char *ipv4hints; /* keytag = 4 */ + size_t ipv4hints_len; + unsigned char *echconfiglist; /* keytag = 5 */ + size_t echconfiglist_len; + unsigned char *ipv6hints; /* keytag = 6 */ + size_t ipv6hints_len; +}; +#endif + struct Curl_dns_entry { struct Curl_addrinfo *addr; - /* timestamp == 0 -- permanent CURLOPT_RESOLVE entry (doesn't time out) */ +#ifdef USE_HTTPSRR + struct Curl_https_rrinfo *hinfo; +#endif + /* timestamp == 0 -- permanent CURLOPT_RESOLVE entry (does not time out) */ time_t timestamp; - /* use-counter, use Curl_resolv_unlock to release reference */ - long inuse; + /* reference counter, entry is freed on reaching 0 */ + size_t refcount; /* hostname port number that resolved to addr. */ int hostport; - /* hostname that resolved to addr. may be NULL (unix domain sockets). */ + /* hostname that resolved to addr. may be NULL (Unix domain sockets). */ char hostname[1]; }; @@ -76,8 +113,8 @@ bool Curl_host_is_ipnum(const char *hostname); * Curl_resolv() returns an entry with the info for the specified host * and port. * - * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after - * use, or we'll leak memory! + * The returned data *MUST* be "released" with Curl_resolv_unlink() after + * use, or we will leak memory! */ /* return codes */ enum resolve_t { @@ -96,7 +133,7 @@ enum resolve_t Curl_resolv_timeout(struct Curl_easy *data, struct Curl_dns_entry **dnsentry, timediff_t timeoutms); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 /* * Curl_ipv6works() returns TRUE if IPv6 seems to work. */ @@ -124,12 +161,12 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data, int *waitp); -/* unlock a previously resolved dns entry */ -void Curl_resolv_unlock(struct Curl_easy *data, - struct Curl_dns_entry *dns); +/* unlink a dns entry, potentially shared with a cache */ +void Curl_resolv_unlink(struct Curl_easy *data, + struct Curl_dns_entry **pdns); /* init a new dns cache */ -void Curl_init_dnscache(struct Curl_hash *hash, int hashsize); +void Curl_init_dnscache(struct Curl_hash *hash, size_t hashsize); /* prune old entries from the DNS cache */ void Curl_hostcache_prune(struct Curl_easy *data); @@ -162,8 +199,8 @@ void Curl_printable_address(const struct Curl_addrinfo *ip, * * Returns the Curl_dns_entry entry pointer or NULL if not in the cache. * - * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after - * use, or we'll leak memory! + * The returned data *MUST* be "released" with Curl_resolv_unlink() after + * use, or we will leak memory! */ struct Curl_dns_entry * Curl_fetch_addr(struct Curl_easy *data, @@ -172,12 +209,13 @@ Curl_fetch_addr(struct Curl_easy *data, /* * Curl_cache_addr() stores a 'Curl_addrinfo' struct in the DNS cache. - * + * @param permanent iff TRUE, entry will never become stale * Returns the Curl_dns_entry entry pointer or NULL if the storage failed. */ struct Curl_dns_entry * Curl_cache_addr(struct Curl_easy *data, struct Curl_addrinfo *addr, - const char *hostname, size_t hostlen, int port); + const char *hostname, size_t hostlen, int port, + bool permanent); #ifndef INADDR_NONE #define CURL_INADDR_NONE (in_addr_t) ~0 diff --git a/deps/curl/lib/hostip4.c b/deps/curl/lib/hostip4.c index 9140180f..3bfea48d 100644 --- a/deps/curl/lib/hostip4.c +++ b/deps/curl/lib/hostip4.c @@ -62,7 +62,7 @@ bool Curl_ipvalid(struct Curl_easy *data, struct connectdata *conn) { (void)data; if(conn->ip_version == CURL_IPRESOLVE_V6) - /* An IPv6 address was requested and we can't get/use one */ + /* An IPv6 address was requested and we cannot get/use one */ return FALSE; return TRUE; /* OK, proceed */ @@ -82,7 +82,7 @@ bool Curl_ipvalid(struct Curl_easy *data, struct connectdata *conn) * detect which one this platform supports in the configure script and set up * the HAVE_GETHOSTBYNAME_R_3, HAVE_GETHOSTBYNAME_R_5 or * HAVE_GETHOSTBYNAME_R_6 defines accordingly. Note that HAVE_GETADDRBYNAME - * has the corresponding rules. This is primarily on *nix. Note that some unix + * has the corresponding rules. This is primarily on *nix. Note that some Unix * flavours have thread-safe versions of the plain gethostbyname() etc. * */ @@ -193,8 +193,8 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, * small. Previous versions are known to return ERANGE for the same * problem. * - * This wouldn't be such a big problem if older versions wouldn't - * sometimes return EAGAIN on a common failure case. Alas, we can't + * This would not be such a big problem if older versions would not + * sometimes return EAGAIN on a common failure case. Alas, we cannot * assume that EAGAIN *or* ERANGE means ERANGE for any given version of * glibc. * @@ -210,9 +210,9 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, * gethostbyname_r() in glibc: * * In glibc 2.2.5 the interface is different (this has also been - * discovered in glibc 2.1.1-6 as shipped by Redhat 6). What I can't + * discovered in glibc 2.1.1-6 as shipped by Redhat 6). What I cannot * explain, is that tests performed on glibc 2.2.4-34 and 2.2.4-32 - * (shipped/upgraded by Redhat 7.2) don't show this behavior! + * (shipped/upgraded by Redhat 7.2) do not show this behavior! * * In this "buggy" version, the return code is -1 on error and 'errno' * is set to the ERANGE or EAGAIN code. Note that 'errno' is not a @@ -221,9 +221,9 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, if(!h) /* failure */ #elif defined(HAVE_GETHOSTBYNAME_R_3) - /* AIX, Digital Unix/Tru64, HPUX 10, more? */ + /* AIX, Digital UNIX/Tru64, HP-UX 10, more? */ - /* For AIX 4.3 or later, we don't use gethostbyname_r() at all, because of + /* For AIX 4.3 or later, we do not use gethostbyname_r() at all, because of * the plain fact that it does not return unique full buffers on each * call, but instead several of the pointers in the hostent structs will * point to the same actual data! This have the unfortunate down-side that @@ -237,7 +237,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, * * Troels Walsted Hansen helped us work this out on March 3rd, 2003. * - * [*] = much later we've found out that it isn't at all "completely + * [*] = much later we have found out that it is not at all "completely * thread-safe", but at least the gethostbyname() function is. */ @@ -253,7 +253,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, (struct hostent *)buf, (struct hostent_data *)((char *)buf + sizeof(struct hostent))); - h_errnop = SOCKERRNO; /* we don't deal with this, but set it anyway */ + h_errnop = SOCKERRNO; /* we do not deal with this, but set it anyway */ } else res = -1; /* failure, too smallish buffer size */ @@ -263,8 +263,8 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, h = buf; /* result expected in h */ /* This is the worst kind of the different gethostbyname_r() interfaces. - * Since we don't know how big buffer this particular lookup required, - * we can't realloc down the huge alloc without doing closer analysis of + * 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 @@ -280,7 +280,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, #else /* (HAVE_GETADDRINFO && HAVE_GETADDRINFO_THREADSAFE) || HAVE_GETHOSTBYNAME_R */ /* - * Here is code for platforms that don't have a thread safe + * Here is code for platforms that do not have a thread safe * getaddrinfo() nor gethostbyname_r() function or for which * gethostbyname() is the preferred one. */ diff --git a/deps/curl/lib/hostip6.c b/deps/curl/lib/hostip6.c index 18969a7a..c16ddfe5 100644 --- a/deps/curl/lib/hostip6.c +++ b/deps/curl/lib/hostip6.c @@ -124,7 +124,7 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data, #ifndef USE_RESOLVE_ON_IPS /* * The AI_NUMERICHOST must not be set to get synthesized IPv6 address from - * an IPv4 address on iOS and Mac OS X. + * an IPv4 address on iOS and macOS. */ if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) || (1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) { diff --git a/deps/curl/lib/hsts.c b/deps/curl/lib/hsts.c index 607755e6..5b013726 100644 --- a/deps/curl/lib/hsts.c +++ b/deps/curl/lib/hsts.c @@ -54,7 +54,7 @@ #define MAX_HSTS_DATELENSTR "64" #define UNLIMITED "unlimited" -#ifdef DEBUGBUILD +#if defined(DEBUGBUILD) || defined(UNITTESTS) /* to play well with debug builds, we can *set* a fixed time this will return */ time_t deltatime; /* allow for "adjustments" for unit test purposes */ @@ -94,11 +94,11 @@ void Curl_hsts_cleanup(struct hsts **hp) { struct hsts *h = *hp; if(h) { - struct Curl_llist_element *e; - struct Curl_llist_element *n; - for(e = h->list.head; e; e = n) { - struct stsentry *sts = e->ptr; - n = e->next; + struct Curl_llist_node *e; + struct Curl_llist_node *n; + for(e = Curl_llist_head(&h->list); e; e = n) { + struct stsentry *sts = Curl_node_elem(e); + n = Curl_node_next(e); hsts_free(sts); } free(h->filename); @@ -107,11 +107,6 @@ void Curl_hsts_cleanup(struct hsts **hp) } } -static struct stsentry *hsts_entry(void) -{ - return calloc(1, sizeof(struct stsentry)); -} - static CURLcode hsts_create(struct hsts *h, const char *hostname, bool subdomains, @@ -127,7 +122,7 @@ static CURLcode hsts_create(struct hsts *h, --hlen; if(hlen) { char *duphost; - struct stsentry *sts = hsts_entry(); + struct stsentry *sts = calloc(1, sizeof(struct stsentry)); if(!sts) return CURLE_OUT_OF_MEMORY; @@ -140,7 +135,7 @@ static CURLcode hsts_create(struct hsts *h, sts->host = duphost; sts->expires = expires; sts->includeSubDomains = subdomains; - Curl_llist_insert_next(&h->list, h->list.tail, sts, &sts->node); + Curl_llist_append(&h->list, sts, &sts->node); } return CURLE_OK; } @@ -164,7 +159,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, do { while(*p && ISBLANK(*p)) p++; - if(strncasecompare("max-age=", p, 8)) { + if(strncasecompare("max-age", p, 7)) { bool quoted = FALSE; CURLofft offt; char *endp; @@ -172,9 +167,14 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, if(gotma) return CURLE_BAD_FUNCTION_ARGUMENT; - p += 8; + p += 7; while(*p && ISBLANK(*p)) p++; + if(*p++ != '=') + return CURLE_BAD_FUNCTION_ARGUMENT; + while(*p && ISBLANK(*p)) + p++; + if(*p == '\"') { p++; quoted = TRUE; @@ -220,7 +220,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, /* remove the entry if present verbatim (without subdomain match) */ sts = Curl_hsts(h, hostname, FALSE); if(sts) { - Curl_llist_remove(&h->list, &sts->node, NULL); + Curl_node_remove(&sts->node); hsts_free(sts); } return CURLE_OK; @@ -246,7 +246,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, } /* - * Return TRUE if the given host name is currently an HSTS one. + * Return TRUE if the given hostname is currently an HSTS one. * * The 'subdomain' argument tells the function if subdomain matching should be * attempted. @@ -254,45 +254,47 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, bool subdomain) { + struct stsentry *bestsub = NULL; if(h) { - char buffer[MAX_HSTS_HOSTLEN + 1]; time_t now = time(NULL); size_t hlen = strlen(hostname); - struct Curl_llist_element *e; - struct Curl_llist_element *n; + struct Curl_llist_node *e; + struct Curl_llist_node *n; + size_t blen = 0; if((hlen > MAX_HSTS_HOSTLEN) || !hlen) return NULL; - memcpy(buffer, hostname, hlen); if(hostname[hlen-1] == '.') /* remove the trailing dot */ --hlen; - buffer[hlen] = 0; - hostname = buffer; - for(e = h->list.head; e; e = n) { - struct stsentry *sts = e->ptr; - n = e->next; + for(e = Curl_llist_head(&h->list); e; e = n) { + struct stsentry *sts = Curl_node_elem(e); + size_t ntail; + n = Curl_node_next(e); if(sts->expires <= now) { /* remove expired entries */ - Curl_llist_remove(&h->list, &sts->node, NULL); + Curl_node_remove(&sts->node); hsts_free(sts); continue; } - if(subdomain && sts->includeSubDomains) { - size_t ntail = strlen(sts->host); - if(ntail < hlen) { - size_t offs = hlen - ntail; - if((hostname[offs-1] == '.') && - strncasecompare(&hostname[offs], sts->host, ntail)) - return sts; + ntail = strlen(sts->host); + if((subdomain && sts->includeSubDomains) && (ntail < hlen)) { + size_t offs = hlen - ntail; + if((hostname[offs-1] == '.') && + strncasecompare(&hostname[offs], sts->host, ntail) && + (ntail > blen)) { + /* save the tail match with the longest tail */ + bestsub = sts; + blen = ntail; } } - if(strcasecompare(hostname, sts->host)) + /* avoid strcasecompare because the host name is not null terminated */ + if((hlen == ntail) && strncasecompare(hostname, sts->host, hlen)) return sts; } } - return NULL; /* no match */ + return bestsub; } /* @@ -358,8 +360,8 @@ static CURLcode hsts_out(struct stsentry *sts, FILE *fp) CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, const char *file) { - struct Curl_llist_element *e; - struct Curl_llist_element *n; + struct Curl_llist_node *e; + struct Curl_llist_node *n; CURLcode result = CURLE_OK; FILE *out; char *tempstore = NULL; @@ -373,7 +375,7 @@ CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, file = h->filename; if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0]) - /* marked as read-only, no file or zero length file name */ + /* marked as read-only, no file or zero length filename */ goto skipsave; result = Curl_fopen(data, file, &out, &tempstore); @@ -381,9 +383,9 @@ CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n" "# This file was generated by libcurl! Edit at your own risk.\n", out); - for(e = h->list.head; e; e = n) { - struct stsentry *sts = e->ptr; - n = e->next; + for(e = Curl_llist_head(&h->list); e; e = n) { + struct stsentry *sts = Curl_node_elem(e); + n = Curl_node_next(e); result = hsts_out(sts, out); if(result) break; @@ -398,14 +400,14 @@ CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, free(tempstore); skipsave: if(data->set.hsts_write) { - /* if there's a write callback */ + /* if there is a write callback */ struct curl_index i; /* count */ - i.total = h->list.size; + i.total = Curl_llist_count(&h->list); i.index = 0; - for(e = h->list.head; e; e = n) { - struct stsentry *sts = e->ptr; + for(e = Curl_llist_head(&h->list); e; e = n) { + struct stsentry *sts = Curl_node_elem(e); bool stop; - n = e->next; + n = Curl_node_next(e); result = hsts_push(data, &i, sts, &stop); if(result || stop) break; @@ -444,8 +446,8 @@ static CURLcode hsts_add(struct hsts *h, char *line) e = Curl_hsts(h, p, subdomain); if(!e) result = hsts_create(h, p, subdomain, expires); - else { - /* the same host name, use the largest expire time */ + else if(strcasecompare(p, e->host)) { + /* the same hostname, use the largest expire time */ if(expires > e->expires) e->expires = expires; } @@ -513,7 +515,7 @@ static CURLcode hsts_load(struct hsts *h, const char *file) CURLcode result = CURLE_OK; FILE *fp; - /* we need a private copy of the file name so that the hsts cache 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); @@ -528,8 +530,11 @@ static CURLcode hsts_load(struct hsts *h, const char *file) char *lineptr = Curl_dyn_ptr(&buf); while(*lineptr && ISBLANK(*lineptr)) lineptr++; - if(*lineptr == '#') - /* skip commented lines */ + /* + * 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); diff --git a/deps/curl/lib/hsts.h b/deps/curl/lib/hsts.h index d3431a5d..1c544f97 100644 --- a/deps/curl/lib/hsts.h +++ b/deps/curl/lib/hsts.h @@ -29,18 +29,18 @@ #include #include "llist.h" -#ifdef DEBUGBUILD +#if defined(DEBUGBUILD) || defined(UNITTESTS) extern time_t deltatime; #endif struct stsentry { - struct Curl_llist_element node; + struct Curl_llist_node node; const char *host; bool includeSubDomains; curl_off_t expires; /* the timestamp of this entry's expiry */ }; -/* The HSTS cache. Needs to be able to tailmatch host names. */ +/* The HSTS cache. Needs to be able to tailmatch hostnames. */ struct hsts { struct Curl_llist list; char *filename; diff --git a/deps/curl/lib/http.c b/deps/curl/lib/http.c index d50b099c..a94edd61 100644 --- a/deps/curl/lib/http.c +++ b/deps/curl/lib/http.c @@ -65,7 +65,6 @@ #include "vquic/vquic.h" #include "http_digest.h" #include "http_ntlm.h" -#include "curl_ntlm_wb.h" #include "http_negotiate.h" #include "http_aws_sigv4.h" #include "url.h" @@ -101,13 +100,16 @@ * Forward declarations. */ -static bool http_should_fail(struct Curl_easy *data); +static bool http_should_fail(struct Curl_easy *data, int httpcode); +static bool http_exp100_is_waiting(struct Curl_easy *data); +static CURLcode http_exp100_add_reader(struct Curl_easy *data); +static void http_exp100_send_anyway(struct Curl_easy *data); /* * HTTP handler interface. */ const struct Curl_handler Curl_handler_http = { - "HTTP", /* scheme */ + "http", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ @@ -121,6 +123,7 @@ const struct Curl_handler Curl_handler_http = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ Curl_http_write_resp, /* write_resp */ + Curl_http_write_resp_hd, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_HTTP, /* defport */ @@ -135,7 +138,7 @@ const struct Curl_handler Curl_handler_http = { * HTTPS handler interface. */ const struct Curl_handler Curl_handler_https = { - "HTTPS", /* scheme */ + "https", /* scheme */ Curl_http_setup_conn, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ @@ -149,6 +152,7 @@ const struct Curl_handler Curl_handler_https = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ Curl_http_write_resp, /* write_resp */ + Curl_http_write_resp_hd, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_HTTPS, /* defport */ @@ -165,14 +169,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 */ - struct HTTP *http; - DEBUGASSERT(data->req.p.http == NULL); - - http = calloc(1, sizeof(struct HTTP)); - if(!http) - return CURLE_OUT_OF_MEMORY; - - data->req.p.http = http; connkeep(conn, "HTTP default"); if(data->state.httpwant == CURL_HTTP_VERSION_3ONLY) { @@ -241,8 +237,6 @@ char *Curl_copy_header_value(const char *header) while(*start && ISSPACE(*start)) start++; - /* data is in the host encoding so - use '\r' and '\n' instead of 0x0d and 0x0a */ end = strchr(start, '\r'); if(!end) end = strchr(start, '\n'); @@ -383,8 +377,6 @@ static bool pickoneauth(struct auth *pick, unsigned long mask) #endif else if(avail & CURLAUTH_NTLM) pick->picked = CURLAUTH_NTLM; - else if(avail & CURLAUTH_NTLM_WB) - pick->picked = CURLAUTH_NTLM_WB; #ifndef CURL_DISABLE_BASIC_AUTH else if(avail & CURLAUTH_BASIC) pick->picked = CURLAUTH_BASIC; @@ -405,123 +397,85 @@ static bool pickoneauth(struct auth *pick, unsigned long mask) /* * http_perhapsrewind() * - * If we are doing POST or PUT { - * If we have more data to send { - * If we are doing NTLM { - * Keep sending since we must not disconnect - * } - * else { - * If there is more than just a little data left to send, close - * the current connection by force. - * } - * } - * If we have sent any data { - * If we don't have track of all the data { - * call app to tell it to rewind - * } - * else { - * rewind internally so that the operation can restart fine - * } - * } - * } + * The current request needs to be done again - maybe due to a follow + * or authentication negotiation. Check if: + * 1) a rewind of the data sent to the server is necessary + * 2) the current transfer should continue or be stopped early */ static CURLcode http_perhapsrewind(struct Curl_easy *data, struct connectdata *conn) { - struct HTTP *http = data->req.p.http; - curl_off_t bytessent; + curl_off_t bytessent = data->req.writebytecount; curl_off_t expectsend = Curl_creader_total_length(data); + curl_off_t upload_remain = (expectsend >= 0) ? (expectsend - bytessent) : -1; + bool little_upload_remains = (upload_remain >= 0 && upload_remain < 2000); + bool needs_rewind = Curl_creader_needs_rewind(data); + /* By default, we would like to abort the transfer when little or unknown + * amount remains. This may be overridden by authentications further + * below! */ + bool abort_upload = (!data->req.upload_done && !little_upload_remains); + const char *ongoing_auth = NULL; - if(!http) - /* If this is still NULL, we have not reach very far and we can safely - skip this rewinding stuff */ + /* We need a rewind before uploading client read data again. The + * checks below just influence of the upload is to be continued + * or aborted early. + * This depends on how much remains to be sent and in what state + * the authentication is. Some auth schemes such as NTLM do not work + * for a new connection. */ + if(needs_rewind) { + infof(data, "Need to rewind upload for next request"); + Curl_creader_set_rewind(data, TRUE); + } + + if(conn->bits.close) + /* If we already decided to close this connection, we cannot veto. */ return CURLE_OK; - if(!expectsend) - /* not sending any body */ - return CURLE_OK; - - if(!conn->bits.protoconnstart) - /* HTTP CONNECT in progress: there is no body */ - expectsend = 0; - - bytessent = data->req.writebytecount; - Curl_creader_set_rewind(data, FALSE); - - if((expectsend == -1) || (expectsend > bytessent)) { + if(abort_upload) { + /* We'd like to abort the upload - but should we? */ #if defined(USE_NTLM) - /* There is still data left to send */ if((data->state.authproxy.picked == CURLAUTH_NTLM) || - (data->state.authhost.picked == CURLAUTH_NTLM) || - (data->state.authproxy.picked == CURLAUTH_NTLM_WB) || - (data->state.authhost.picked == CURLAUTH_NTLM_WB)) { - if(((expectsend - bytessent) < 2000) || - (conn->http_ntlm_state != NTLMSTATE_NONE) || + (data->state.authhost.picked == CURLAUTH_NTLM)) { + ongoing_auth = "NTML"; + if((conn->http_ntlm_state != NTLMSTATE_NONE) || (conn->proxy_ntlm_state != NTLMSTATE_NONE)) { - /* The NTLM-negotiation has started *OR* there is just a little (<2K) - data left to send, keep on sending. */ - - /* rewind data when completely done sending! */ - if(!data->req.authneg && (conn->writesockfd != CURL_SOCKET_BAD)) { - Curl_creader_set_rewind(data, TRUE); - infof(data, "Rewind stream before next send"); - } - - return CURLE_OK; + /* The NTLM-negotiation has started, keep on sending. + * Need to do further work on same connection */ + abort_upload = FALSE; } - - if(conn->bits.close) - /* this is already marked to get closed */ - return CURLE_OK; - - infof(data, "NTLM send, close instead of sending %" - CURL_FORMAT_CURL_OFF_T " bytes", - (curl_off_t)(expectsend - bytessent)); } #endif #if defined(USE_SPNEGO) /* There is still data left to send */ if((data->state.authproxy.picked == CURLAUTH_NEGOTIATE) || (data->state.authhost.picked == CURLAUTH_NEGOTIATE)) { - if(((expectsend - bytessent) < 2000) || - (conn->http_negotiate_state != GSS_AUTHNONE) || + ongoing_auth = "NEGOTIATE"; + if((conn->http_negotiate_state != GSS_AUTHNONE) || (conn->proxy_negotiate_state != GSS_AUTHNONE)) { - /* The NEGOTIATE-negotiation has started *OR* - there is just a little (<2K) data left to send, keep on sending. */ - - /* rewind data when completely done sending! */ - if(!data->req.authneg && (conn->writesockfd != CURL_SOCKET_BAD)) { - Curl_creader_set_rewind(data, TRUE); - infof(data, "Rewind stream before next send"); - } - - return CURLE_OK; + /* The NEGOTIATE-negotiation has started, keep on sending. + * Need to do further work on same connection */ + abort_upload = FALSE; } - - if(conn->bits.close) - /* this is already marked to get closed */ - return CURLE_OK; - - infof(data, "NEGOTIATE send, close instead of sending %" - CURL_FORMAT_CURL_OFF_T " bytes", - (curl_off_t)(expectsend - bytessent)); } #endif + } - /* This is not NEGOTIATE/NTLM or many bytes left to send: close */ + if(abort_upload) { + if(upload_remain >= 0) + infof(data, "%s%sclose instead of sending %" FMT_OFF_T " more bytes", + ongoing_auth ? ongoing_auth : "", + ongoing_auth ? " send, " : "", + upload_remain); + else + infof(data, "%s%sclose instead of sending unknown amount " + "of more bytes", + ongoing_auth ? ongoing_auth : "", + ongoing_auth ? " send, " : ""); + /* We decided to abort the ongoing transfer */ streamclose(conn, "Mid-auth HTTP and much data left to send"); - data->req.size = 0; /* don't download any more than 0 bytes */ - - /* There still is data left to send, but this connection is marked for - closure so we can safely do the rewind right now */ + /* FIXME: questionable manipulation here, can we do this differently? */ + data->req.size = 0; /* do not download any more than 0 bytes */ } - - if(Curl_creader_needs_rewind(data)) { - /* mark for rewind since if we already sent something */ - Curl_creader_set_rewind(data, TRUE); - infof(data, "Please rewind output before next send"); - } - return CURLE_OK; } @@ -548,7 +502,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) return CURLE_OK; if(data->state.authproblem) - return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK; + return data->set.http_fail_on_error ? CURLE_HTTP_RETURNED_ERROR : CURLE_OK; if((data->state.aptr.user || data->set.str[STRING_BEARER]) && ((data->req.httpcode == 401) || @@ -575,13 +529,10 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) #endif if(pickhost || pickproxy) { - if((data->state.httpreq != HTTPREQ_GET) && - (data->state.httpreq != HTTPREQ_HEAD) && - !Curl_creader_will_rewind(data)) { - result = http_perhapsrewind(data, conn); - if(result) - return result; - } + result = http_perhapsrewind(data, conn); + if(result) + return result; + /* 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 */ @@ -596,7 +547,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) /* no (known) authentication available, authentication is not "done" yet and no authentication seems to be required and - we didn't try HEAD or GET */ + 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 */ @@ -605,7 +556,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data) data->state.authhost.done = TRUE; } } - if(http_should_fail(data)) { + if(http_should_fail(data, data->req.httpcode)) { failf(data, "The requested URL returned error: %d", data->req.httpcode); result = CURLE_HTTP_RETURNED_ERROR; @@ -662,15 +613,6 @@ output_auth_headers(struct Curl_easy *data, } else #endif -#if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) - if(authstatus->picked == CURLAUTH_NTLM_WB) { - auth = "NTLM_WB"; - result = Curl_output_ntlm_wb(data, conn, proxy); - if(result) - return result; - } - else -#endif #ifndef CURL_DISABLE_DIGEST_AUTH if(authstatus->picked == CURLAUTH_DIGEST) { auth = "Digest"; @@ -735,7 +677,7 @@ output_auth_headers(struct Curl_easy *data, auth, data->state.aptr.user ? data->state.aptr.user : ""); #endif - authstatus->multipass = (!authstatus->done) ? TRUE : FALSE; + authstatus->multipass = !authstatus->done; } else authstatus->multipass = FALSE; @@ -795,13 +737,13 @@ Curl_http_output_auth(struct Curl_easy *data, if(authhost->want && !authhost->picked) /* The app has selected one or more methods, but none has been picked so far by a server round-trip. Then we set the picked one to the - want one, and if this is one single bit it'll be used instantly. */ + want one, and if this is one single bit it will be used instantly. */ authhost->picked = authhost->want; if(authproxy->want && !authproxy->picked) /* The app has selected one or more methods, but none has been picked so far by a proxy round-trip. Then we set the picked one to the want one, - and if this is one single bit it'll be used instantly. */ + and if this is one single bit it will be used instantly. */ authproxy->picked = authproxy->want; #ifndef CURL_DISABLE_PROXY @@ -816,7 +758,7 @@ Curl_http_output_auth(struct Curl_easy *data, #else (void)proxytunnel; #endif /* CURL_DISABLE_PROXY */ - /* we have no proxy so let's pretend we're done authenticating + /* we have no proxy so let's pretend we are done authenticating with it */ authproxy->done = TRUE; @@ -960,31 +902,15 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, /* NTLM support requires the SSL crypto libs */ if(checkprefix("NTLM", auth) && is_valid_auth_separator(auth[4])) { if((authp->avail & CURLAUTH_NTLM) || - (authp->avail & CURLAUTH_NTLM_WB) || Curl_auth_is_ntlm_supported()) { *availp |= CURLAUTH_NTLM; authp->avail |= CURLAUTH_NTLM; - if(authp->picked == CURLAUTH_NTLM || - authp->picked == CURLAUTH_NTLM_WB) { + if(authp->picked == CURLAUTH_NTLM) { /* NTLM authentication is picked and activated */ CURLcode result = Curl_input_ntlm(data, proxy, auth); if(!result) { data->state.authproblem = FALSE; -#ifdef NTLM_WB_ENABLED - if(authp->picked == CURLAUTH_NTLM_WB) { - *availp &= ~CURLAUTH_NTLM; - authp->avail &= ~CURLAUTH_NTLM; - *availp |= CURLAUTH_NTLM_WB; - authp->avail |= CURLAUTH_NTLM_WB; - - result = Curl_input_ntlm_wb(data, conn, proxy, auth); - if(result) { - infof(data, "Authentication problem. Ignoring this."); - data->state.authproblem = TRUE; - } - } -#endif } else { infof(data, "Authentication problem. Ignoring this."); @@ -1006,7 +932,7 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, authp->avail |= CURLAUTH_DIGEST; /* We call this function on input Digest headers even if Digest - * authentication isn't activated yet, as we need to store the + * authentication is not activated yet, as we need to store the * incoming data from this header in case we are going to use * Digest */ result = Curl_input_digest(data, proxy, auth); @@ -1025,7 +951,7 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, authp->avail |= CURLAUTH_BASIC; if(authp->picked == CURLAUTH_BASIC) { /* We asked for Basic authentication but got a 40X back - anyway, which basically means our name+password isn't + anyway, which basically means our name+password is not valid. */ authp->avail = CURLAUTH_NONE; infof(data, "Authentication problem. Ignoring this."); @@ -1041,7 +967,7 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, authp->avail |= CURLAUTH_BEARER; if(authp->picked == CURLAUTH_BEARER) { /* We asked for Bearer authentication but got a 40X back - anyway, which basically means our token isn't valid. */ + anyway, which basically means our token is not valid. */ authp->avail = CURLAUTH_NONE; infof(data, "Authentication problem. Ignoring this."); data->state.authproblem = TRUE; @@ -1061,7 +987,7 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, /* there may be multiple methods on one line, so keep reading */ while(*auth && *auth != ',') /* read up to the next comma */ auth++; - if(*auth == ',') /* if we're on a comma, skip it */ + if(*auth == ',') /* if we are on a comma, skip it */ auth++; while(*auth && ISSPACE(*auth)) auth++; @@ -1071,24 +997,21 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, } /** - * http_should_fail() determines whether an HTTP response has gotten us + * http_should_fail() determines whether an HTTP response code has gotten us * into an error state or not. * * @retval FALSE communications should continue * * @retval TRUE communications should not continue */ -static bool http_should_fail(struct Curl_easy *data) +static bool http_should_fail(struct Curl_easy *data, int httpcode) { - int httpcode; DEBUGASSERT(data); DEBUGASSERT(data->conn); - httpcode = data->req.httpcode; - /* - ** If we haven't been asked to fail on error, - ** don't fail. + ** If we have not been asked to fail on error, + ** do not fail. */ if(!data->set.http_fail_on_error) return FALSE; @@ -1108,7 +1031,7 @@ static bool http_should_fail(struct Curl_easy *data) return FALSE; /* - ** Any code >= 400 that's not 401 or 407 is always + ** Any code >= 400 that is not 401 or 407 is always ** a terminal error */ if((httpcode != 401) && (httpcode != 407)) @@ -1120,22 +1043,19 @@ static bool http_should_fail(struct Curl_easy *data) DEBUGASSERT((httpcode == 401) || (httpcode == 407)); /* - ** Examine the current authentication state to see if this - ** is an error. The idea is for this function to get - ** called after processing all the headers in a response - ** message. So, if we've been to asked to authenticate a - ** particular stage, and we've done it, we're OK. But, if - ** we're already completely authenticated, it's not OK to - ** get another 401 or 407. + ** Examine the current authentication state to see if this is an error. The + ** idea is for this function to get called after processing all the headers + ** in a response message. So, if we have been to asked to authenticate a + ** particular stage, and we have done it, we are OK. If we are already + ** completely authenticated, it is not OK to get another 401 or 407. ** - ** It is possible for authentication to go stale such that - ** the client needs to reauthenticate. Once that info is - ** available, use it here. + ** It is possible for authentication to go stale such that the client needs + ** to reauthenticate. Once that info is available, use it here. */ /* - ** Either we're not authenticating, or we're supposed to - ** be authenticating something else. This is an error. + ** Either we are not authenticating, or we are supposed to be authenticating + ** something else. This is an error. */ if((httpcode == 401) && !data->state.aptr.user) return TRUE; @@ -1174,7 +1094,7 @@ Curl_compareheader(const char *headerline, /* line to check */ DEBUGASSERT(content); if(!strncasecompare(headerline, header, hlen)) - return FALSE; /* doesn't start with header */ + return FALSE; /* does not start with header */ /* pass the header */ start = &headerline[hlen]; @@ -1186,11 +1106,11 @@ Curl_compareheader(const char *headerline, /* line to check */ /* find the end of the header line */ end = strchr(start, '\r'); /* lines end with CRLF */ if(!end) { - /* in case there's a non-standard compliant line here */ + /* in case there is a non-standard compliant line here */ end = strchr(start, '\n'); if(!end) - /* hm, there's no line ending here, use the zero byte! */ + /* hm, there is no line ending here, use the zero byte! */ end = strchr(start, '\0'); } @@ -1221,7 +1141,7 @@ 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're always _sending_ a request and thus we wait for + interface and then we are always _sending_ a request and thus we wait for the single socket to become writable only */ int Curl_http_getsock_do(struct Curl_easy *data, struct connectdata *conn, @@ -1242,23 +1162,14 @@ CURLcode Curl_http_done(struct Curl_easy *data, CURLcode status, bool premature) { struct connectdata *conn = data->conn; - struct HTTP *http = data->req.p.http; - /* Clear multipass flag. If authentication isn't done yet, then it will get + /* Clear multipass flag. If authentication is not done yet, then it will get * a chance to be set back to true when we output the next auth header */ data->state.authhost.multipass = FALSE; data->state.authproxy.multipass = FALSE; - /* set the proper values (possibly modified on POST) */ - conn->seek_func = data->set.seek_func; /* restore */ - conn->seek_client = data->set.seek_client; /* restore */ - - if(!http) - return CURLE_OK; - Curl_dyn_reset(&data->state.headerb); Curl_hyper_done(data); - Curl_ws_done(data); if(status) return status; @@ -1270,8 +1181,8 @@ CURLcode Curl_http_done(struct Curl_easy *data, (data->req.bytecount + data->req.headerbytecount - data->req.deductheadercount) <= 0) { - /* If this connection isn't simply closed to be retried, AND nothing was - read from the HTTP server (that counts), this can't be right so we + /* If this connection is not simply closed to be retried, AND nothing was + read from the HTTP server (that counts), this cannot be right so we return an error here */ failf(data, "Empty reply from server"); /* Mark it as closed to avoid the "left intact" message */ @@ -1318,31 +1229,6 @@ static const char *get_http_string(const struct Curl_easy *data, } #endif -/* check and possibly add an Expect: header */ -static CURLcode expect100(struct Curl_easy *data, struct dynbuf *req) -{ - CURLcode result = CURLE_OK; - if(!data->state.disableexpect && - Curl_use_http_1_1plus(data, data->conn) && - (data->conn->httpversion < 20)) { - /* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an - Expect: 100-continue to the headers which actually speeds up post - operations (as there is one packet coming back from the web server) */ - const char *ptr = Curl_checkheaders(data, STRCONST("Expect")); - if(ptr) { - data->state.expect100header = - Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue")); - } - else { - result = Curl_dyn_addn(req, STRCONST("Expect: 100-continue\r\n")); - if(!result) - data->state.expect100header = TRUE; - } - } - - return result; -} - enum proxy_use { HEADER_SERVER, /* direct to server */ HEADER_PROXY, /* regular request to proxy */ @@ -1375,8 +1261,8 @@ CURLcode Curl_dynhds_add_custom(struct Curl_easy *data, if(is_connect) proxy = HEADER_CONNECT; else - proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy? - HEADER_PROXY:HEADER_SERVER; + proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy ? + HEADER_PROXY : HEADER_SERVER; switch(proxy) { case HEADER_SERVER: @@ -1455,7 +1341,7 @@ CURLcode Curl_dynhds_add_custom(struct Curl_easy *data, DEBUGASSERT(name && value); if(data->state.aptr.host && - /* a Host: header was sent already, don't pass on any custom 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:"))) ; @@ -1468,18 +1354,18 @@ CURLcode Curl_dynhds_add_custom(struct Curl_easy *data, hd_name_eq(name, namelen, STRCONST("Content-Type:"))) ; else if(data->req.authneg && - /* while doing auth neg, don't allow the custom length since + /* 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:"))) ; else if(data->state.aptr.te && - /* when asking for Transfer-Encoding, don't pass on a custom + /* when asking for Transfer-Encoding, do not pass on a custom Connection: */ hd_name_eq(name, namelen, STRCONST("Connection:"))) ; else if((conn->httpversion >= 20) && hd_name_eq(name, namelen, STRCONST("Transfer-Encoding:"))) - /* HTTP/2 doesn't support chunked requests */ + /* HTTP/2 does not support chunked requests */ ; else if((hd_name_eq(name, namelen, STRCONST("Authorization:")) || hd_name_eq(name, namelen, STRCONST("Cookie:"))) && @@ -1522,8 +1408,8 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data, if(is_connect) proxy = HEADER_CONNECT; else - proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy? - HEADER_PROXY:HEADER_SERVER; + proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy ? + HEADER_PROXY : HEADER_SERVER; switch(proxy) { case HEADER_SERVER: @@ -1601,8 +1487,9 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data, char *compare = semicolonp ? semicolonp : headers->data; if(data->state.aptr.host && - /* a Host: header was sent already, don't pass on any custom Host: - header as that will produce *two* in the same request! */ + /* a Host: header was sent already, do not pass on any custom + Host: header as that will produce *two* in the same + request! */ checkprefix("Host:", compare)) ; else if(data->state.httpreq == HTTPREQ_POST_FORM && @@ -1614,18 +1501,18 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data, checkprefix("Content-Type:", compare)) ; else if(data->req.authneg && - /* while doing auth neg, don't allow the custom length since + /* while doing auth neg, do not allow the custom length since we will force length zero then */ checkprefix("Content-Length:", compare)) ; else if(data->state.aptr.te && - /* when asking for Transfer-Encoding, don't pass on a custom + /* when asking for Transfer-Encoding, do not pass on a custom Connection: */ checkprefix("Connection:", compare)) ; else if((conn->httpversion >= 20) && checkprefix("Transfer-Encoding:", compare)) - /* HTTP/2 doesn't support chunked requests */ + /* HTTP/2 does not support chunked requests */ ; else if((checkprefix("Authorization:", compare) || checkprefix("Cookie:", compare)) && @@ -1715,7 +1602,7 @@ CURLcode Curl_add_timecondition(struct Curl_easy *data, 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, @@ -1817,10 +1704,10 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn) if(ptr && (!data->state.this_is_a_follow || strcasecompare(data->state.first_host, conn->host.name))) { #if !defined(CURL_DISABLE_COOKIES) - /* If we have a given custom Host: header, we extract the host name in + /* If we have a given custom Host: header, we extract the hostname in order to possibly use it for cookie reasons later on. We only allow the 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 host name + 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) @@ -1858,25 +1745,26 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn) } } else { - /* When building Host: headers, we must put the host name within - [brackets] if the host name is a plain IPv6-address. RFC2732-style. */ + /* When building Host: headers, we must put the hostname within + [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)) && (conn->remote_port == PORT_HTTPS)) || ((conn->given->protocol&(CURLPROTO_HTTP|CURLPROTO_WS)) && (conn->remote_port == PORT_HTTP)) ) - /* if(HTTPS on port 443) OR (HTTP on port 80) then don't include + /* if(HTTPS on port 443) OR (HTTP on port 80) then do not include the port number in the host string */ - aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip?"[":"", - host, conn->bits.ipv6_ip?"]":""); + aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip ? "[" : "", + host, conn->bits.ipv6_ip ? "]" : ""); else - aptr->host = aprintf("Host: %s%s%s:%d\r\n", conn->bits.ipv6_ip?"[":"", - host, conn->bits.ipv6_ip?"]":"", + aptr->host = aprintf("Host: %s%s%s:%d\r\n", + conn->bits.ipv6_ip ? "[" : "", + host, conn->bits.ipv6_ip ? "]" : "", conn->remote_port); if(!aptr->host) - /* without Host: we can't make a nice request */ + /* without Host: we cannot make a nice request */ return CURLE_OUT_OF_MEMORY; } return CURLE_OK; @@ -1904,7 +1792,7 @@ CURLcode Curl_http_target(struct Curl_easy *data, /* The path sent to the proxy is in fact the entire URL. But if the remote host is a IDN-name, we must make sure that the request we produce only - uses the encoded host name! */ + uses the encoded hostname! */ /* and no fragment part */ CURLUcode uc; @@ -1927,7 +1815,7 @@ CURLcode Curl_http_target(struct Curl_easy *data, } if(strcasecompare("http", data->state.up.scheme)) { - /* when getting HTTP, we don't want the userinfo the URL */ + /* when getting HTTP, we do not want the userinfo the URL */ uc = curl_url_set(h, CURLUPART_USER, NULL, 0); if(uc) { curl_url_cleanup(h); @@ -1948,9 +1836,9 @@ CURLcode Curl_http_target(struct Curl_easy *data, curl_url_cleanup(h); - /* target or url */ - result = Curl_dyn_add(r, data->set.str[STRING_TARGET]? - data->set.str[STRING_TARGET]:url); + /* target or URL */ + result = Curl_dyn_add(r, data->set.str[STRING_TARGET] ? + data->set.str[STRING_TARGET] : url); free(url); if(result) return (result); @@ -2086,11 +1974,8 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq) switch(httpreq) { case HTTPREQ_PUT: /* Let's PUT the data to the server! */ - if(!postsize) - result = Curl_creader_set_null(data); - else - result = Curl_creader_set_fread(data, postsize); - return result; + return postsize ? Curl_creader_set_fread(data, postsize) : + Curl_creader_set_null(data); #if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API) case HTTPREQ_POST_FORM: @@ -2111,8 +1996,19 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq) else result = Curl_creader_set_null(data); } - else { /* we read the bytes from the callback */ - result = Curl_creader_set_fread(data, postsize); + else { + /* we read the bytes from the callback. In case "chunked" encoding + * is forced by the application, we disregard `postsize`. This is + * a backward compatibility decision to earlier versions where + * chunking disregarded this. See issue #13229. */ + bool chunked = FALSE; + char *ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding")); + if(ptr) { + /* Some kind of TE is requested, check if 'chunked' is chosen */ + chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"), + STRCONST("chunked")); + } + result = Curl_creader_set_fread(data, chunked ? -1 : postsize); } return result; @@ -2140,7 +2036,7 @@ static CURLcode http_resume(struct Curl_easy *data, Curl_HttpReq httpreq) if(data->state.resume_from < 0) { /* * This is meant to get the size of the present remote-file by itself. - * We don't support this now. Bail out! + * We do not support this now. Bail out! */ data->state.resume_from = 0; } @@ -2150,7 +2046,7 @@ static CURLcode http_resume(struct Curl_easy *data, Curl_HttpReq httpreq) CURLcode result; result = Curl_creader_resume_from(data, data->state.resume_from); if(result) { - failf(data, "Unable to resume from offset %" CURL_FORMAT_CURL_OFF_T, + failf(data, "Unable to resume from offset %" FMT_OFF_T, data->state.resume_from); return result; } @@ -2180,6 +2076,13 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data, data->req.upload_chunky = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"), STRCONST("chunked")); + if(data->req.upload_chunky && + Curl_use_http_1_1plus(data, data->conn) && + (data->conn->httpversion >= 20)) { + infof(data, "suppressing chunked transfer encoding on connection " + "using HTTP version 2 or higher"); + data->req.upload_chunky = FALSE; + } } else { curl_off_t req_clen = Curl_creader_total_length(data); @@ -2207,26 +2110,39 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data, return result; } -static CURLcode addexpect(struct Curl_easy *data, struct dynbuf *r) +static CURLcode addexpect(struct Curl_easy *data, struct dynbuf *r, + bool *announced_exp100) { - data->state.expect100header = FALSE; + CURLcode result; + char *ptr; + + *announced_exp100 = FALSE; /* Avoid Expect: 100-continue if Upgrade: is used */ - if(data->req.upgr101 == UPGR101_INIT) { - /* For really small puts we don't use Expect: headers at all, and for - the somewhat bigger ones we allow the app to disable it. Just make - sure that the expect100header is always set to the preferred value - here. */ - char *ptr = Curl_checkheaders(data, STRCONST("Expect")); - if(ptr) { - data->state.expect100header = - Curl_compareheader(ptr, STRCONST("Expect:"), - STRCONST("100-continue")); + if(data->req.upgr101 != UPGR101_INIT) + return CURLE_OK; + + /* For really small puts we do not use Expect: headers at all, and for + the somewhat bigger ones we allow the app to disable it. Just make + sure that the expect100header is always set to the preferred value + here. */ + ptr = Curl_checkheaders(data, STRCONST("Expect")); + if(ptr) { + *announced_exp100 = + Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue")); + } + else if(!data->state.disableexpect && + Curl_use_http_1_1plus(data, data->conn) && + (data->conn->httpversion < 20)) { + /* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an + Expect: 100-continue to the headers which actually speeds up post + operations (as there is one packet coming back from the web server) */ + curl_off_t client_len = Curl_creader_client_length(data); + if(client_len > EXPECT_100_THRESHOLD || client_len < 0) { + result = Curl_dyn_addn(r, STRCONST("Expect: 100-continue\r\n")); + if(result) + return result; + *announced_exp100 = TRUE; } - else { - curl_off_t client_len = Curl_creader_client_length(data); - if(client_len > EXPECT_100_THRESHOLD || client_len < 0) - return expect100(data, r); - } } return CURLE_OK; } @@ -2236,6 +2152,7 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, { CURLcode result = CURLE_OK; curl_off_t req_clen; + bool announced_exp100 = FALSE; DEBUGASSERT(data->conn); #ifndef USE_HYPER @@ -2256,7 +2173,7 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, case HTTPREQ_POST_MIME: #endif /* We only set Content-Length and allow a custom Content-Length if - we don't upload data chunked, as RFC2616 forbids us to set both + we do not upload data chunked, as RFC2616 forbids us to set both kinds of headers (Transfer-Encoding: chunked and Content-Length). We do not override a custom "Content-Length" header, but during authentication negotiation that header is suppressed. @@ -2265,10 +2182,9 @@ CURLcode Curl_http_req_complete(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 isn't very wise to actually set your own */ - result = Curl_dyn_addf(r, - "Content-Length: %" CURL_FORMAT_CURL_OFF_T - "\r\n", req_clen); + although it is not very wise to actually set your own */ + result = Curl_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n", + req_clen); } if(result) goto out; @@ -2294,7 +2210,7 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, goto out; } } - result = addexpect(data, r); + result = addexpect(data, r, &announced_exp100); if(result) goto out; break; @@ -2304,12 +2220,16 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, /* end of headers */ result = Curl_dyn_addn(r, STRCONST("\r\n")); - Curl_pgrsSetUploadSize(data, req_clen); + if(!result) { + Curl_pgrsSetUploadSize(data, req_clen); + if(announced_exp100) + result = http_exp100_add_reader(data); + } out: if(!result) { /* setup variables for the upcoming transfer */ - Curl_xfer_setup(data, FIRSTSOCKET, -1, TRUE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SENDRECV, -1, TRUE); } return result; } @@ -2328,8 +2248,9 @@ CURLcode Curl_http_cookies(struct Curl_easy *data, addcookies = data->set.str[STRING_COOKIE]; if(data->cookies || addcookies) { - struct Cookie *co = NULL; /* no cookies from start */ + struct Curl_llist list; int count = 0; + int rc = 1; if(data->cookies && data->state.cookie_engine) { const char *host = data->state.aptr.cookiehost ? @@ -2338,17 +2259,19 @@ CURLcode Curl_http_cookies(struct Curl_easy *data, conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) || strcasecompare("localhost", host) || !strcmp(host, "127.0.0.1") || - !strcmp(host, "::1") ? TRUE : FALSE; + !strcmp(host, "::1"); Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - co = Curl_cookie_getlist(data, data->cookies, host, data->state.up.path, - secure_context); + rc = Curl_cookie_getlist(data, data->cookies, host, data->state.up.path, + secure_context, &list); Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); } - if(co) { - struct Cookie *store = co; + if(!rc) { + struct Curl_llist_node *n; size_t clen = 8; /* hold the size of the generated Cookie: header */ - /* now loop through all cookies that matched */ - while(co) { + + /* loop through all cookies that matched */ + for(n = Curl_llist_head(&list); n; n = Curl_node_next(n)) { + struct Cookie *co = Curl_node_elem(n); if(co->value) { size_t add; if(!count) { @@ -2363,22 +2286,21 @@ CURLcode Curl_http_cookies(struct Curl_easy *data, linecap = TRUE; break; } - result = Curl_dyn_addf(r, "%s%s=%s", count?"; ":"", + result = Curl_dyn_addf(r, "%s%s=%s", count ? "; " : "", co->name, co->value); if(result) break; clen += add + (count ? 2 : 0); count++; } - co = co->next; /* next cookie please */ } - Curl_cookie_freelist(store); + Curl_llist_destroy(&list, NULL); } if(addcookies && !result && !linecap) { if(!count) result = Curl_dyn_addn(r, STRCONST("Cookie: ")); if(!result) { - result = Curl_dyn_addf(r, "%s%s", count?"; ":"", addcookies); + result = Curl_dyn_addf(r, "%s%s", count ? "; " : "", addcookies); count++; } } @@ -2397,7 +2319,7 @@ CURLcode Curl_http_range(struct Curl_easy *data, { if(data->state.use_range) { /* - * A range is selected. We use different headers whether we're downloading + * A range is selected. We use different headers whether we are downloading * or uploading and we always let customized headers override our internal * ones if any such are specified. */ @@ -2415,12 +2337,11 @@ CURLcode Curl_http_range(struct Curl_easy *data, free(data->state.aptr.rangeline); if(data->set.set_resume_from < 0) { - /* Upload resume was asked for, but we don't know the size of the + /* Upload resume was asked for, but we do not know the size of the remote part so we tell the server (and act accordingly) that we upload the whole file (again) */ data->state.aptr.rangeline = - aprintf("Content-Range: bytes 0-%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T "\r\n", + aprintf("Content-Range: bytes 0-%" FMT_OFF_T "/%" FMT_OFF_T "\r\n", req_clen - 1, req_clen); } @@ -2429,19 +2350,18 @@ CURLcode Curl_http_range(struct Curl_easy *data, /* TODO: not sure if we want to send this header during authentication * negotiation, but test1084 checks for it. In which case we have a * "null" client reader installed that gives an unexpected length. */ - curl_off_t total_len = data->req.authneg? + curl_off_t total_len = data->req.authneg ? data->state.infilesize : (data->state.resume_from + req_clen); data->state.aptr.rangeline = - aprintf("Content-Range: bytes %s%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T "\r\n", + aprintf("Content-Range: bytes %s%" FMT_OFF_T "/%" FMT_OFF_T "\r\n", data->state.range, total_len-1, total_len); } else { /* Range was selected and then we just pass the incoming range and append total size */ data->state.aptr.rangeline = - aprintf("Content-Range: bytes %s/%" CURL_FORMAT_CURL_OFF_T "\r\n", + aprintf("Content-Range: bytes %s/%" FMT_OFF_T "\r\n", data->state.range, req_clen); } if(!data->state.aptr.rangeline) @@ -2451,22 +2371,20 @@ CURLcode Curl_http_range(struct Curl_easy *data, return CURLE_OK; } -CURLcode Curl_http_firstwrite(struct Curl_easy *data, - struct connectdata *conn, - bool *done) +CURLcode Curl_http_firstwrite(struct Curl_easy *data) { + struct connectdata *conn = data->conn; struct SingleRequest *k = &data->req; - *done = FALSE; if(data->req.newurl) { if(conn->bits.close) { /* Abort after the headers if "follow Location" is set - and we're set to close anyway. */ + and we are set to close anyway. */ k->keepon &= ~KEEP_RECV; - *done = TRUE; + k->done = TRUE; return CURLE_OK; } - /* We have a new url to load, but since we want to be able to reuse this + /* We have a new URL to load, but since we want to be able to reuse this connection properly, we read the full response in "ignore more" */ k->ignorebody = TRUE; infof(data, "Ignoring the response-body"); @@ -2477,19 +2395,19 @@ CURLcode Curl_http_firstwrite(struct Curl_easy *data, if(k->size == data->state.resume_from) { /* The resume point is at the end of file, consider this fine even if it - doesn't allow resume from here. */ + does not allow resume from here. */ infof(data, "The entire document is already downloaded"); streamclose(conn, "already downloaded"); /* Abort download */ k->keepon &= ~KEEP_RECV; - *done = TRUE; + k->done = TRUE; return CURLE_OK; } - /* we wanted to resume a download, although the server doesn't seem to - * support this and we did this with a GET (if it wasn't a GET we did a + /* we wanted to resume a download, although the server does not seem to + * support this and we did this with a GET (if it was not a GET we did a * POST or PUT resume) */ - failf(data, "HTTP server doesn't seem to support " + failf(data, "HTTP server does not seem to support " "byte ranges. Cannot resume."); return CURLE_RANGE_ERROR; } @@ -2500,8 +2418,8 @@ CURLcode Curl_http_firstwrite(struct Curl_easy *data, action for an HTTP/1.1 client */ if(!Curl_meets_timecondition(data, k->timeofdoc)) { - *done = TRUE; - /* We're simulating an HTTP 304 from server so we return + k->done = TRUE; + /* We are simulating an HTTP 304 from server so we return what should have been returned from the server */ data->info.httpcode = 304; infof(data, "Simulate an HTTP 304 response"); @@ -2523,7 +2441,7 @@ CURLcode Curl_transferencode(struct Curl_easy *data) /* When we are to insert a TE: header in the request, we must also insert TE in a Connection: header, so we need to merge the custom provided Connection: header and prevent the original to get sent. Note that if - the user has inserted his/her own TE: header we don't do this magic + the user has inserted his/her own TE: header we do not do this magic but then assume that the user will handle it all! */ char *cptr = Curl_checkheaders(data, STRCONST("Connection")); #define TE_HEADER "TE: gzip\r\n" @@ -2664,7 +2582,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) goto fail; p_accept = Curl_checkheaders(data, - STRCONST("Accept"))?NULL:"Accept: */*\r\n"; + STRCONST("Accept")) ? NULL : "Accept: */*\r\n"; result = Curl_http_range(data, httpreq); if(result) @@ -2716,31 +2634,34 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) "%s",/* Alt-Used */ httpstring, - (data->state.aptr.host?data->state.aptr.host:""), - data->state.aptr.proxyuserpwd? - data->state.aptr.proxyuserpwd:"", - data->state.aptr.userpwd?data->state.aptr.userpwd:"", - (data->state.use_range && data->state.aptr.rangeline)? - data->state.aptr.rangeline:"", + (data->state.aptr.host ? data->state.aptr.host : ""), +#ifndef CURL_DISABLE_PROXY + data->state.aptr.proxyuserpwd ? + data->state.aptr.proxyuserpwd : "", +#else + "", +#endif + data->state.aptr.userpwd ? data->state.aptr.userpwd : "", + (data->state.use_range && data->state.aptr.rangeline) ? + data->state.aptr.rangeline : "", (data->set.str[STRING_USERAGENT] && *data->set.str[STRING_USERAGENT] && - data->state.aptr.uagent)? - data->state.aptr.uagent:"", - p_accept?p_accept:"", - data->state.aptr.te?data->state.aptr.te:"", + data->state.aptr.uagent) ? + data->state.aptr.uagent : "", + p_accept ? p_accept : "", + data->state.aptr.te ? data->state.aptr.te : "", (data->set.str[STRING_ENCODING] && *data->set.str[STRING_ENCODING] && - data->state.aptr.accept_encoding)? - data->state.aptr.accept_encoding:"", - (data->state.referer && data->state.aptr.ref)? - data->state.aptr.ref:"" /* Referer: */, + data->state.aptr.accept_encoding) ? + data->state.aptr.accept_encoding : "", + (data->state.referer && data->state.aptr.ref) ? + data->state.aptr.ref : "" /* Referer: */, #ifndef CURL_DISABLE_PROXY (conn->bits.httpproxy && !conn->bits.tunnel_proxy && !Curl_checkheaders(data, STRCONST("Proxy-Connection")) && - !Curl_checkProxyheaders(data, - conn, - STRCONST("Proxy-Connection")))? + !Curl_checkProxyheaders(data, conn, + STRCONST("Proxy-Connection"))) ? "Proxy-Connection: Keep-Alive\r\n":"", #else "", @@ -2752,7 +2673,9 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) /* clear userpwd and proxyuserpwd to avoid reusing old credentials * from reused connections */ Curl_safefree(data->state.aptr.userpwd); +#ifndef CURL_DISABLE_PROXY Curl_safefree(data->state.aptr.proxyuserpwd); +#endif free(altused); if(result) { @@ -2763,7 +2686,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) if(!(conn->handler->flags&PROTOPT_SSL) && conn->httpversion < 20 && (data->state.httpwant == CURL_HTTP_VERSION_2)) { - /* append HTTP2 upgrade magic stuff to the HTTP request if it isn't done + /* append HTTP2 upgrade magic stuff to the HTTP request if it is not done over SSL */ result = Curl_http2_request_upgrade(&req, data); if(result) { @@ -2773,7 +2696,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) } result = Curl_http_cookies(data, conn, &req); -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS)) result = Curl_ws_request(data, &req); #endif @@ -2830,7 +2753,7 @@ checkhttpprefix(struct Curl_easy *data, { struct curl_slist *head = data->set.http200aliases; statusline rc = STATUS_BAD; - statusline onmatch = len >= 5? STATUS_DONE : STATUS_UNKNOWN; + statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN; while(head) { if(checkprefixmax(head->data, s, len)) { @@ -2852,7 +2775,7 @@ checkrtspprefix(struct Curl_easy *data, const char *s, size_t len) { statusline result = STATUS_BAD; - statusline onmatch = len >= 5? STATUS_DONE : STATUS_UNKNOWN; + statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN; (void)data; /* unused */ if(checkprefixmax("RTSP/", s, len)) result = onmatch; @@ -2875,325 +2798,377 @@ checkprotoprefix(struct Curl_easy *data, struct connectdata *conn, return checkhttpprefix(data, s, len); } +/* 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))) + +#define HD_VAL(hd, hdlen, n) \ + ((((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))) && \ + Curl_compareheader(hd, STRCONST(n), STRCONST(v))) + /* * Curl_http_header() parses a single response header. */ -CURLcode Curl_http_header(struct Curl_easy *data, struct connectdata *conn, - char *headp) +CURLcode Curl_http_header(struct Curl_easy *data, + const char *hd, size_t hdlen) { + struct connectdata *conn = data->conn; CURLcode result; struct SingleRequest *k = &data->req; - /* Check for Content-Length: header lines to get size */ - if(!k->http_bodyless && - !data->set.ignorecl && checkprefix("Content-Length:", headp)) { - curl_off_t contentlength; - CURLofft offt = curlx_strtoofft(headp + strlen("Content-Length:"), - NULL, 10, &contentlength); + const char *v; - if(offt == CURL_OFFT_OK) { - k->size = contentlength; - k->maxdownload = k->size; - } - else if(offt == CURL_OFFT_FLOW) { - /* out of range */ - if(data->set.max_filesize) { - failf(data, "Maximum file size exceeded"); - return CURLE_FILESIZE_EXCEEDED; - } - streamclose(conn, "overflow content-length"); - infof(data, "Overflow Content-Length: value"); - } - else { - /* negative or just rubbish - bad HTTP */ - failf(data, "Invalid Content-Length: value"); - return CURLE_WEIRD_SERVER_REPLY; - } - } - /* check for Content-Type: header lines to get the MIME-type */ - else if(checkprefix("Content-Type:", headp)) { - char *contenttype = Curl_copy_header_value(headp); - if(!contenttype) - return CURLE_OUT_OF_MEMORY; - if(!*contenttype) - /* ignore empty data */ - free(contenttype); - else { - Curl_safefree(data->info.contenttype); - data->info.contenttype = contenttype; - } - } -#ifndef CURL_DISABLE_PROXY - else if((conn->httpversion == 10) && - conn->bits.httpproxy && - Curl_compareheader(headp, - STRCONST("Proxy-Connection:"), - STRCONST("keep-alive"))) { - /* - * When an HTTP/1.0 reply comes when using a proxy, the - * 'Proxy-Connection: keep-alive' line tells us the - * connection will be kept alive for our pleasure. - * Default action for 1.0 is to close. - */ - connkeep(conn, "Proxy-Connection keep-alive"); /* don't close */ - infof(data, "HTTP/1.0 proxy connection set to keep alive"); - } - else if((conn->httpversion == 11) && - conn->bits.httpproxy && - Curl_compareheader(headp, - STRCONST("Proxy-Connection:"), - STRCONST("close"))) { - /* - * We get an HTTP/1.1 response from a proxy and it says it'll - * close down after this transfer. - */ - connclose(conn, "Proxy-Connection: asked to close after done"); - infof(data, "HTTP/1.1 proxy connection set close"); - } + switch(hd[0]) { + case 'a': + case 'A': +#ifndef CURL_DISABLE_ALTSVC + v = (data->asi && + ((data->conn->handler->flags & PROTOPT_SSL) || +#ifdef DEBUGBUILD + /* allow debug builds to circumvent the HTTPS restriction */ + getenv("CURL_ALTSVC_HTTP") +#else + 0 #endif - else if((conn->httpversion == 10) && - Curl_compareheader(headp, - STRCONST("Connection:"), - STRCONST("keep-alive"))) { - /* - * An HTTP/1.0 reply with the 'Connection: keep-alive' line - * tells us the connection will be kept alive for our - * pleasure. Default action for 1.0 is to close. - * - * [RFC2068, section 19.7.1] */ - connkeep(conn, "Connection keep-alive"); - infof(data, "HTTP/1.0 connection set to keep alive"); - } - else if(Curl_compareheader(headp, - STRCONST("Connection:"), STRCONST("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"); - } - else if(!k->http_bodyless && checkprefix("Transfer-Encoding:", headp)) { - /* One or more encodings. We check for chunked and/or a compression - algorithm. */ - /* - * [RFC 2616, section 3.6.1] A 'chunked' transfer encoding - * means that the server will send a series of "chunks". Each - * chunk starts with line with info (including size of the - * coming block) (terminated with CRLF), then a block of data - * with the previously mentioned size. There can be any amount - * of chunks, and a chunk-data set to zero signals the - * end-of-chunks. */ - - result = Curl_build_unencoding_stack(data, - headp + strlen("Transfer-Encoding:"), - TRUE); - if(result) - return result; - if(!k->chunk && data->set.http_transfer_encoding) { - /* if this isn't chunked, only close can signal the end of this transfer - as Content-Length is said not to be trusted for transfer-encoding! */ - connclose(conn, "HTTP/1.1 transfer-encoding without chunks"); - k->ignore_cl = TRUE; + )) ? HD_VAL(hd, hdlen, "Alt-Svc:") : NULL; + if(v) { + /* the ALPN of the current request */ + enum alpnid id = (conn->httpversion == 30) ? ALPN_h3 : + (conn->httpversion == 20) ? ALPN_h2 : ALPN_h1; + return Curl_altsvc_parse(data, data->asi, v, id, conn->host.name, + curlx_uitous((unsigned int)conn->remote_port)); } - } - else if(!k->http_bodyless && checkprefix("Content-Encoding:", headp) && - data->set.str[STRING_ENCODING]) { - /* - * Process Content-Encoding. Look for the values: identity, - * gzip, deflate, compress, x-gzip and x-compress. x-gzip and - * x-compress are the same as gzip and compress. (Sec 3.5 RFC - * 2616). zlib cannot handle compress. However, errors are - * handled further down when the response body is processed - */ - result = Curl_build_unencoding_stack(data, - headp + strlen("Content-Encoding:"), - FALSE); - if(result) - return result; - } - else if(checkprefix("Retry-After:", headp)) { - /* Retry-After = HTTP-date / delay-seconds */ - curl_off_t retry_after = 0; /* zero for unknown or "now" */ - /* Try it as a decimal number, if it works it is not a date */ - (void)curlx_strtoofft(headp + strlen("Retry-After:"), - NULL, 10, &retry_after); - if(!retry_after) { - time_t date = Curl_getdate_capped(headp + strlen("Retry-After:")); - if(-1 != date) - /* convert date to number of seconds into the future */ - retry_after = date - time(NULL); - } - data->info.retry_after = retry_after; /* store it */ - } - else if(!k->http_bodyless && checkprefix("Content-Range:", headp)) { - /* Content-Range: bytes [num]- - Content-Range: bytes: [num]- - Content-Range: [num]- - Content-Range: [asterisk]/[total] - - The second format was added since Sun's webserver - JavaWebServer/1.1.1 obviously sends the header this way! - The third added since some servers use that! - The fourth means the requested range was unsatisfied. - */ - - char *ptr = headp + strlen("Content-Range:"); - - /* Move forward until first digit or asterisk */ - while(*ptr && !ISDIGIT(*ptr) && *ptr != '*') - ptr++; - - /* if it truly stopped on a digit */ - if(ISDIGIT(*ptr)) { - if(!curlx_strtoofft(ptr, NULL, 10, &k->offset)) { - if(data->state.resume_from == k->offset) - /* we asked for a resume and we got it */ - k->content_range = TRUE; - } - } - else if(k->httpcode < 300) - data->state.resume_from = 0; /* get everything */ - } -#if !defined(CURL_DISABLE_COOKIES) - else if(data->cookies && data->state.cookie_engine && - checkprefix("Set-Cookie:", headp)) { - /* If there is a custom-set Host: name, use it here, or else use real peer - host name. */ - const char *host = data->state.aptr.cookiehost? - data->state.aptr.cookiehost:conn->host.name; - const bool secure_context = - conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) || - strcasecompare("localhost", host) || - !strcmp(host, "127.0.0.1") || - !strcmp(host, "::1") ? TRUE : FALSE; - - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, - CURL_LOCK_ACCESS_SINGLE); - Curl_cookie_add(data, data->cookies, TRUE, FALSE, - headp + strlen("Set-Cookie:"), host, - data->state.up.path, secure_context); - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - } #endif - else if(!k->http_bodyless && checkprefix("Last-Modified:", headp) && - (data->set.timecondition || data->set.get_filetime) ) { - k->timeofdoc = Curl_getdate_capped(headp + strlen("Last-Modified:")); - if(data->set.get_filetime) - data->info.filetime = k->timeofdoc; - } - else if((checkprefix("WWW-Authenticate:", headp) && - (401 == k->httpcode)) || - (checkprefix("Proxy-authenticate:", headp) && - (407 == k->httpcode))) { + break; + case 'c': + case 'C': + /* Check for Content-Length: header lines to get size */ + v = (!k->http_bodyless && !data->set.ignorecl) ? + HD_VAL(hd, hdlen, "Content-Length:") : NULL; + if(v) { + curl_off_t contentlength; + CURLofft offt = curlx_strtoofft(v, NULL, 10, &contentlength); - bool proxy = (k->httpcode == 407) ? TRUE : FALSE; - char *auth = Curl_copy_header_value(headp); - if(!auth) - return CURLE_OUT_OF_MEMORY; - - result = Curl_http_input_auth(data, proxy, auth); - - free(auth); - - if(result) - return result; - } -#ifdef USE_SPNEGO - else if(checkprefix("Persistent-Auth:", headp)) { - struct negotiatedata *negdata = &conn->negotiate; - struct auth *authp = &data->state.authhost; - if(authp->picked == CURLAUTH_NEGOTIATE) { - char *persistentauth = Curl_copy_header_value(headp); - if(!persistentauth) + if(offt == CURL_OFFT_OK) { + k->size = contentlength; + k->maxdownload = k->size; + } + else if(offt == CURL_OFFT_FLOW) { + /* out of range */ + if(data->set.max_filesize) { + failf(data, "Maximum file size exceeded"); + return CURLE_FILESIZE_EXCEEDED; + } + streamclose(conn, "overflow content-length"); + infof(data, "Overflow Content-Length: value"); + } + else { + /* negative or just rubbish - bad HTTP */ + failf(data, "Invalid Content-Length: value"); + return CURLE_WEIRD_SERVER_REPLY; + } + return CURLE_OK; + } + v = (!k->http_bodyless && data->set.str[STRING_ENCODING]) ? + HD_VAL(hd, hdlen, "Content-Encoding:") : NULL; + if(v) { + /* + * Process Content-Encoding. Look for the values: identity, + * gzip, deflate, compress, x-gzip and x-compress. x-gzip and + * x-compress are the same as gzip and compress. (Sec 3.5 RFC + * 2616). zlib cannot handle compress. However, errors are + * handled further down when the response body is processed + */ + return Curl_build_unencoding_stack(data, v, FALSE); + } + /* check for Content-Type: header lines to get the MIME-type */ + v = HD_VAL(hd, hdlen, "Content-Type:"); + if(v) { + char *contenttype = Curl_copy_header_value(hd); + if(!contenttype) return CURLE_OUT_OF_MEMORY; - negdata->noauthpersist = checkprefix("false", persistentauth)? - TRUE:FALSE; - negdata->havenoauthpersist = TRUE; - infof(data, "Negotiate: noauthpersist -> %d, header part: %s", - negdata->noauthpersist, persistentauth); - free(persistentauth); + if(!*contenttype) + /* ignore empty data */ + free(contenttype); + else { + Curl_safefree(data->info.contenttype); + data->info.contenttype = contenttype; + } + return CURLE_OK; } - } -#endif - else if((k->httpcode >= 300 && k->httpcode < 400) && - checkprefix("Location:", headp) && - !data->req.location) { - /* this is the URL that the server advises us to use instead */ - char *location = Curl_copy_header_value(headp); - if(!location) - return CURLE_OUT_OF_MEMORY; - if(!*location) - /* ignore empty data */ - free(location); - else { - data->req.location = location; + if(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"); + return CURLE_OK; + } + if((conn->httpversion == 10) && + HD_IS_AND_SAYS(hd, hdlen, "Connection:", "keep-alive")) { + /* + * An HTTP/1.0 reply with the 'Connection: keep-alive' line + * tells us the connection will be kept alive for our + * pleasure. Default action for 1.0 is to close. + * + * [RFC2068, section 19.7.1] */ + connkeep(conn, "Connection keep-alive"); + infof(data, "HTTP/1.0 connection set to keep alive"); + return CURLE_OK; + } + v = !k->http_bodyless ? HD_VAL(hd, hdlen, "Content-Range:") : NULL; + if(v) { + /* Content-Range: bytes [num]- + Content-Range: bytes: [num]- + Content-Range: [num]- + Content-Range: [asterisk]/[total] - if(data->set.http_follow_location) { - DEBUGASSERT(!data->req.newurl); - data->req.newurl = strdup(data->req.location); /* clone */ - if(!data->req.newurl) - return CURLE_OUT_OF_MEMORY; + The second format was added since Sun's webserver + JavaWebServer/1.1.1 obviously sends the header this way! + The third added since some servers use that! + The fourth means the requested range was unsatisfied. + */ - /* 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; + const char *ptr = v; - /* mark the next request as a followed location: */ - data->state.this_is_a_follow = TRUE; + /* Move forward until first digit or asterisk */ + while(*ptr && !ISDIGIT(*ptr) && *ptr != '*') + ptr++; + + /* if it truly stopped on a digit */ + if(ISDIGIT(*ptr)) { + if(!curlx_strtoofft(ptr, NULL, 10, &k->offset)) { + if(data->state.resume_from == k->offset) + /* we asked for a resume and we got it */ + k->content_range = TRUE; + } + } + else if(k->httpcode < 300) + data->state.resume_from = 0; /* get everything */ + } + break; + case 'l': + case 'L': + v = (!k->http_bodyless && + (data->set.timecondition || data->set.get_filetime)) ? + HD_VAL(hd, hdlen, "Last-Modified:") : NULL; + if(v) { + k->timeofdoc = Curl_getdate_capped(v); + if(data->set.get_filetime) + data->info.filetime = k->timeofdoc; + return CURLE_OK; + } + if((k->httpcode >= 300 && k->httpcode < 400) && + HD_IS(hd, hdlen, "Location:") && + !data->req.location) { + /* this is the URL that the server advises us to use instead */ + char *location = Curl_copy_header_value(hd); + if(!location) + return CURLE_OUT_OF_MEMORY; + if(!*location) + /* ignore empty data */ + free(location); + else { + data->req.location = location; + + if(data->set.http_follow_location) { + 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; + } } } - } + break; + case 'p': + case 'P': +#ifndef CURL_DISABLE_PROXY + v = HD_VAL(hd, hdlen, "Proxy-Connection:"); + if(v) { + if((conn->httpversion == 10) && conn->bits.httpproxy && + HD_IS_AND_SAYS(hd, hdlen, "Proxy-Connection:", "keep-alive")) { + /* + * When an HTTP/1.0 reply comes when using a proxy, the + * 'Proxy-Connection: keep-alive' line tells us the + * connection will be kept alive for our pleasure. + * Default action for 1.0 is to close. + */ + connkeep(conn, "Proxy-Connection keep-alive"); /* do not close */ + infof(data, "HTTP/1.0 proxy connection set to keep alive"); + } + else if((conn->httpversion == 11) && conn->bits.httpproxy && + HD_IS_AND_SAYS(hd, hdlen, "Proxy-Connection:", "close")) { + /* + * We get an HTTP/1.1 response from a proxy and it says it will + * close down after this transfer. + */ + connclose(conn, "Proxy-Connection: asked to close after done"); + infof(data, "HTTP/1.1 proxy connection set close"); + } + return CURLE_OK; + } +#endif + if((407 == k->httpcode) && HD_IS(hd, hdlen, "Proxy-authenticate:")) { + char *auth = Curl_copy_header_value(hd); + if(!auth) + return CURLE_OUT_OF_MEMORY; + result = Curl_http_input_auth(data, TRUE, auth); + free(auth); + return result; + } +#ifdef USE_SPNEGO + if(HD_IS(hd, hdlen, "Persistent-Auth:")) { + struct negotiatedata *negdata = &conn->negotiate; + struct auth *authp = &data->state.authhost; + if(authp->picked == CURLAUTH_NEGOTIATE) { + char *persistentauth = Curl_copy_header_value(hd); + if(!persistentauth) + return CURLE_OUT_OF_MEMORY; + negdata->noauthpersist = !!checkprefix("false", persistentauth); + negdata->havenoauthpersist = TRUE; + infof(data, "Negotiate: noauthpersist -> %d, header part: %s", + negdata->noauthpersist, persistentauth); + free(persistentauth); + } + } +#endif + break; + case 'r': + case 'R': + v = HD_VAL(hd, hdlen, "Retry-After:"); + if(v) { + /* Retry-After = HTTP-date / delay-seconds */ + curl_off_t retry_after = 0; /* zero for unknown or "now" */ + /* Try it as a decimal number, if it works it is not a date */ + (void)curlx_strtoofft(v, NULL, 10, &retry_after); + if(!retry_after) { + time_t date = Curl_getdate_capped(v); + if(-1 != date) + /* convert date to number of seconds into the future */ + retry_after = date - time(NULL); + } + data->info.retry_after = retry_after; /* store it */ + return CURLE_OK; + } + break; + case 's': + case 'S': +#if !defined(CURL_DISABLE_COOKIES) + v = (data->cookies && data->state.cookie_engine) ? + HD_VAL(hd, hdlen, "Set-Cookie:") : NULL; + if(v) { + /* If there is a custom-set Host: name, use it here, or else use + * real peer hostname. */ + const char *host = data->state.aptr.cookiehost ? + data->state.aptr.cookiehost : conn->host.name; + const bool secure_context = + conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) || + strcasecompare("localhost", host) || + !strcmp(host, "127.0.0.1") || + !strcmp(host, "::1"); + 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); + Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); + return CURLE_OK; + } +#endif #ifndef CURL_DISABLE_HSTS - /* If enabled, the header is incoming and this is over HTTPS */ - else if(data->hsts && checkprefix("Strict-Transport-Security:", headp) && - ((conn->handler->flags & PROTOPT_SSL) || -#ifdef CURLDEBUG + /* If enabled, the header is incoming and this is over HTTPS */ + v = (data->hsts && + ((conn->handler->flags & PROTOPT_SSL) || +#ifdef DEBUGBUILD /* allow debug builds to circumvent the HTTPS restriction */ getenv("CURL_HSTS_HTTP") #else 0 #endif - )) { - CURLcode check = - Curl_hsts_parse(data->hsts, conn->host.name, - headp + strlen("Strict-Transport-Security:")); - if(check) - infof(data, "Illegal STS header skipped"); + ) + ) ? HD_VAL(hd, hdlen, "Strict-Transport-Security:") : NULL; + if(v) { + CURLcode check = + Curl_hsts_parse(data->hsts, conn->host.name, v); + if(check) + infof(data, "Illegal STS header skipped"); #ifdef DEBUGBUILD - else - infof(data, "Parsed STS header fine (%zu entries)", - data->hsts->list.size); + else + infof(data, "Parsed STS header fine (%zu entries)", + Curl_llist_count(&data->hsts->list)); #endif - } + } #endif -#ifndef CURL_DISABLE_ALTSVC - /* If enabled, the header is incoming and this is over HTTPS */ - else if(data->asi && checkprefix("Alt-Svc:", headp) && - ((conn->handler->flags & PROTOPT_SSL) || -#ifdef CURLDEBUG - /* allow debug builds to circumvent the HTTPS restriction */ - getenv("CURL_ALTSVC_HTTP") -#else - 0 -#endif - )) { - /* the ALPN of the current request */ - enum alpnid id = (conn->httpversion == 30)? ALPN_h3 : - (conn->httpversion == 20) ? ALPN_h2 : ALPN_h1; - result = Curl_altsvc_parse(data, data->asi, - headp + strlen("Alt-Svc:"), - id, conn->host.name, - curlx_uitous((unsigned int)conn->remote_port)); - if(result) + break; + case 't': + case 'T': + /* RFC 9112, ch. 6.1 + * "Transfer-Encoding MAY be sent in a response to a HEAD request or + * in a 304 (Not Modified) response (Section 15.4.5 of [HTTP]) to a + * GET request, neither of which includes a message body, to indicate + * that the origin server would have applied a transfer coding to the + * message body if the request had been an unconditional GET." + * + * Read: in these cases the 'Transfer-Encoding' does not apply + * to any data following the response headers. Do not add any decoders. + */ + v = (!k->http_bodyless && + (data->state.httpreq != HTTPREQ_HEAD) && + (k->httpcode != 304)) ? + HD_VAL(hd, hdlen, "Transfer-Encoding:") : NULL; + if(v) { + /* One or more encodings. We check for chunked and/or a compression + algorithm. */ + result = Curl_build_unencoding_stack(data, v, TRUE); + if(result) + return result; + if(!k->chunk && data->set.http_transfer_encoding) { + /* if this is not chunked, only close can signal the end of this + * transfer as Content-Length is said not to be trusted for + * transfer-encoding! */ + connclose(conn, "HTTP/1.1 transfer-encoding without chunks"); + k->ignore_cl = TRUE; + } + return CURLE_OK; + } + v = HD_VAL(hd, hdlen, "Trailer:"); + if(v) { + data->req.resp_trailer = TRUE; + return CURLE_OK; + } + break; + case 'w': + case 'W': + 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); return result; + } + break; } -#endif - else if(conn->handler->protocol & CURLPROTO_RTSP) { - result = Curl_rtsp_parseheader(data, headp); + + if(conn->handler->protocol & CURLPROTO_RTSP) { + result = Curl_rtsp_parseheader(data, hd); if(result) return result; } @@ -3204,25 +3179,48 @@ CURLcode Curl_http_header(struct Curl_easy *data, struct connectdata *conn, * Called after the first HTTP response line (the status line) has been * received and parsed. */ - CURLcode Curl_http_statusline(struct Curl_easy *data, struct connectdata *conn) { struct SingleRequest *k = &data->req; - data->info.httpcode = k->httpcode; - data->info.httpversion = conn->httpversion; - if(!data->state.httpversion || - data->state.httpversion > conn->httpversion) + switch(k->httpversion) { + case 10: + case 11: +#ifdef USE_HTTP2 + case 20: +#endif +#ifdef USE_HTTP3 + case 30: +#endif + /* no major version switch mid-connection */ + if(conn->httpversion && + (k->httpversion/10 != conn->httpversion/10)) { + failf(data, "Version mismatch (from HTTP/%u to HTTP/%u)", + conn->httpversion/10, k->httpversion/10); + return CURLE_UNSUPPORTED_PROTOCOL; + } + break; + default: + failf(data, "Unsupported HTTP version (%u.%d) in response", + k->httpversion/10, k->httpversion%10); + return CURLE_UNSUPPORTED_PROTOCOL; + } + + data->info.httpcode = k->httpcode; + data->info.httpversion = k->httpversion; + conn->httpversion = (unsigned char)k->httpversion; + + if(!data->state.httpversion || data->state.httpversion > k->httpversion) /* store the lowest server version we encounter */ - data->state.httpversion = conn->httpversion; + data->state.httpversion = (unsigned char)k->httpversion; /* - * This code executes as part of processing the header. As a - * result, it's not totally clear how to interpret the + * This code executes as part of processing the header. As a + * result, it is not totally clear how to interpret the * response code yet as that depends on what other headers may - * be present. 401 and 407 may be errors, but may be OK - * depending on how authentication is working. Other codes + * be present. 401 and 407 may be errors, but may be OK + * depending on how authentication is working. Other codes * are definitely errors, so give up here. */ if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET && @@ -3232,25 +3230,16 @@ CURLcode Curl_http_statusline(struct Curl_easy *data, k->ignorebody = TRUE; /* Avoid appending error msg to good data. */ } - if(conn->httpversion == 10) { + if(k->httpversion == 10) { /* Default action for HTTP/1.0 must be to close, unless we get one of those fancy headers that tell us the server keeps it open for us! */ infof(data, "HTTP 1.0, assume close after body"); connclose(conn, "HTTP/1.0 close after body"); } - else if(conn->httpversion == 20 || + else if(k->httpversion == 20 || (k->upgr101 == UPGR101_H2 && k->httpcode == 101)) { DEBUGF(infof(data, "HTTP/2 found, allow multiplexing")); - /* HTTP/2 cannot avoid multiplexing since it is a core functionality - of the protocol */ - conn->bundle->multiuse = BUNDLE_MULTIPLEX; - } - else if(conn->httpversion >= 11 && - !conn->bits.close) { - /* If HTTP version is >= 1.1 and connection is persistent */ - DEBUGF(infof(data, - "HTTP 1.1 or later with persistent connection")); } k->http_bodyless = k->httpcode >= 100 && k->httpcode < 200; @@ -3280,7 +3269,7 @@ CURLcode Curl_http_statusline(struct Curl_easy *data, } /* Content-Length must be ignored if any Transfer-Encoding is present in the - response. Refer to RFC 7230 section 3.3.3 and RFC2616 section 4.4. This is + response. Refer to RFC 7230 section 3.3.3 and RFC2616 section 4.4. This is figured out here after all headers have been received but before the final call to the user's header callback, so that a valid content length can be retrieved by the user in the final call. */ @@ -3292,22 +3281,24 @@ CURLcode Curl_http_size(struct Curl_easy *data) } else if(k->size != -1) { if(data->set.max_filesize && - k->size > data->set.max_filesize) { + !k->ignorebody && + (k->size > data->set.max_filesize)) { failf(data, "Maximum file size exceeded"); return CURLE_FILESIZE_EXCEEDED; } + if(k->ignorebody) + infof(data, "setting size while ignoring"); Curl_pgrsSetDownloadSize(data, k->size); k->maxdownload = k->size; } return CURLE_OK; } -static CURLcode verify_header(struct Curl_easy *data) +static CURLcode verify_header(struct Curl_easy *data, + const char *hd, size_t hdlen) { struct SingleRequest *k = &data->req; - const char *header = Curl_dyn_ptr(&data->state.headerb); - size_t hlen = Curl_dyn_len(&data->state.headerb); - char *ptr = memchr(header, 0x00, hlen); + char *ptr = memchr(hd, 0x00, hdlen); if(ptr) { /* this is bad, bail out */ failf(data, "Nul byte in header"); @@ -3316,11 +3307,11 @@ static CURLcode verify_header(struct Curl_easy *data) if(k->headerline < 2) /* the first "header" is the status-line and it has no colon */ return CURLE_OK; - if(((header[0] == ' ') || (header[0] == '\t')) && k->headerline > 2) - /* line folding, can't happen on line 2 */ + if(((hd[0] == ' ') || (hd[0] == '\t')) && k->headerline > 2) + /* line folding, cannot happen on line 2 */ ; else { - ptr = memchr(header, ':', hlen); + ptr = memchr(hd, ':', hdlen); if(!ptr) { /* this is bad, bail out */ failf(data, "Header without colon"); @@ -3357,30 +3348,516 @@ CURLcode Curl_bump_headersize(struct Curl_easy *data, return CURLE_OK; } +static CURLcode http_write_header(struct Curl_easy *data, + const char *hd, size_t hdlen) +{ + CURLcode result; + int writetype; -/* - * Read any HTTP header lines from the server and pass them to the client app. - */ -static CURLcode http_rw_headers(struct Curl_easy *data, - const char *buf, size_t blen, - size_t *pconsumed) + /* now, only output this if the header AND body are requested: + */ + Curl_debug(data, CURLINFO_HEADER_IN, (char *)hd, hdlen); + + writetype = CLIENTWRITE_HEADER | + ((data->req.httpcode/100 == 1) ? CLIENTWRITE_1XX : 0); + + result = Curl_client_write(data, writetype, hd, hdlen); + if(result) + return result; + + result = Curl_bump_headersize(data, hdlen, FALSE); + if(result) + return result; + + data->req.deductheadercount = (100 <= data->req.httpcode && + 199 >= data->req.httpcode) ? + data->req.headerbytecount : 0; + return result; +} + +static CURLcode http_on_response(struct Curl_easy *data, + const char *last_hd, size_t last_hd_len, + const char *buf, size_t blen, + size_t *pconsumed) +{ + struct connectdata *conn = data->conn; + CURLcode result = CURLE_OK; + struct SingleRequest *k = &data->req; + + (void)buf; /* not used without HTTP2 enabled */ + *pconsumed = 0; + + if(k->upgr101 == UPGR101_RECEIVED) { + /* supposedly upgraded to http2 now */ + if(conn->httpversion != 20) + infof(data, "Lying server, not serving HTTP/2"); + } + + if(k->httpcode < 200 && last_hd) { + /* Intermediate responses might trigger processing of more + * responses, write the last header to the client before + * proceeding. */ + result = http_write_header(data, last_hd, last_hd_len); + last_hd = NULL; /* handled it */ + if(result) + goto out; + } + + if(k->httpcode < 100) { + failf(data, "Unsupported response code in HTTP response"); + result = CURLE_UNSUPPORTED_PROTOCOL; + goto out; + } + else if(k->httpcode < 200) { + /* "A user agent MAY ignore unexpected 1xx status responses." + * By default, we expect to get more responses after this one. */ + k->header = TRUE; + k->headerline = 0; /* restart the header line counter */ + + switch(k->httpcode) { + case 100: + /* + * We have made an HTTP PUT or POST and this is 1.1-lingo + * that tells us that the server is OK with this and ready + * to receive the data. + */ + Curl_http_exp100_got100(data); + break; + case 101: + /* Switching Protocols only allowed from HTTP/1.1 */ + + if(conn->httpversion != 11) { + /* invalid for other HTTP versions */ + failf(data, "unexpected 101 response code"); + result = CURLE_WEIRD_SERVER_REPLY; + goto out; + } + if(k->upgr101 == UPGR101_H2) { + /* Switching to HTTP/2, where we will get more responses */ + infof(data, "Received 101, Switching to HTTP/2"); + k->upgr101 = UPGR101_RECEIVED; + data->conn->bits.asks_multiplex = FALSE; + /* We expect more response from HTTP/2 later */ + k->header = TRUE; + k->headerline = 0; /* restart the header line counter */ + /* Any remaining `buf` bytes are already HTTP/2 and passed to + * be processed. */ + result = Curl_http2_upgrade(data, conn, FIRSTSOCKET, buf, blen); + if(result) + goto out; + *pconsumed += blen; + } +#ifndef CURL_DISABLE_WEBSOCKETS + else if(k->upgr101 == UPGR101_WS) { + /* verify the response. Any passed `buf` bytes are already in + * WebSockets format and taken in by the protocol handler. */ + result = Curl_ws_accept(data, buf, blen); + if(result) + goto out; + *pconsumed += blen; /* ws accept handled the data */ + k->header = FALSE; /* we will not get more responses */ + if(data->set.connect_only) + k->keepon &= ~KEEP_RECV; /* read no more content */ + } +#endif + else { + /* We silently accept this as the final response. + * TODO: this looks, uhm, wrong. What are we switching to if we + * did not ask for an Upgrade? Maybe the application provided an + * `Upgrade: xxx` header? */ + k->header = FALSE; + } + break; + default: + /* The server may send us other 1xx responses, like informative + * 103. This have no influence on request processing and we expect + * to receive a final response eventually. */ + break; + } + goto out; + } + + /* k->httpcode >= 200, final response */ + k->header = FALSE; + + if(k->upgr101 == UPGR101_H2) { + /* A requested upgrade was denied, poke the multi handle to possibly + allow a pending pipewait to continue */ + data->conn->bits.asks_multiplex = FALSE; + Curl_multi_connchanged(data->multi); + } + + if((k->size == -1) && !k->chunk && !conn->bits.close && + (conn->httpversion == 11) && + !(conn->handler->protocol & CURLPROTO_RTSP) && + data->state.httpreq != HTTPREQ_HEAD) { + /* On HTTP 1.1, when connection is not to get closed, but no + Content-Length nor Transfer-Encoding chunked have been + received, according to RFC2616 section 4.4 point 5, we + assume that the server will close the connection to + signal the end of the document. */ + infof(data, "no chunk, no close, no size. Assume close to " + "signal end"); + streamclose(conn, "HTTP: No end-of-message indicator"); + } + + /* At this point we have some idea about the fate of the connection. + If we are closing the connection it may result auth failure. */ +#if defined(USE_NTLM) + if(conn->bits.close && + (((data->req.httpcode == 401) && + (conn->http_ntlm_state == NTLMSTATE_TYPE2)) || + ((data->req.httpcode == 407) && + (conn->proxy_ntlm_state == NTLMSTATE_TYPE2)))) { + infof(data, "Connection closure while negotiating auth (HTTP 1.0?)"); + data->state.authproblem = TRUE; + } +#endif +#if defined(USE_SPNEGO) + if(conn->bits.close && + (((data->req.httpcode == 401) && + (conn->http_negotiate_state == GSS_AUTHRECV)) || + ((data->req.httpcode == 407) && + (conn->proxy_negotiate_state == GSS_AUTHRECV)))) { + infof(data, "Connection closure while negotiating auth (HTTP 1.0?)"); + data->state.authproblem = TRUE; + } + if((conn->http_negotiate_state == GSS_AUTHDONE) && + (data->req.httpcode != 401)) { + conn->http_negotiate_state = GSS_AUTHSUCC; + } + if((conn->proxy_negotiate_state == GSS_AUTHDONE) && + (data->req.httpcode != 407)) { + conn->proxy_negotiate_state = GSS_AUTHSUCC; + } +#endif + +#ifndef CURL_DISABLE_WEBSOCKETS + /* All >=200 HTTP status codes are errors when wanting WebSockets */ + if(data->req.upgr101 == UPGR101_WS) { + failf(data, "Refused WebSockets upgrade: %d", k->httpcode); + result = CURLE_HTTP_RETURNED_ERROR; + goto out; + } +#endif + + /* 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); + result = CURLE_HTTP_RETURNED_ERROR; + goto out; + } + + /* Curl_http_auth_act() checks what authentication methods + * that are available and decides which one (if any) to + * use. It will set 'newurl' if an auth method was picked. */ + result = Curl_http_auth_act(data); + if(result) + goto out; + + if(k->httpcode >= 300) { + if((!data->req.authneg) && !conn->bits.close && + !Curl_creader_will_rewind(data)) { + /* + * General treatment of errors when about to send data. Including : + * "417 Expectation Failed", while waiting for 100-continue. + * + * 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 + * avoid this check. + * + */ + + switch(data->state.httpreq) { + case HTTPREQ_PUT: + case HTTPREQ_POST: + case HTTPREQ_POST_FORM: + case HTTPREQ_POST_MIME: + /* We got an error response. If this happened before the whole + * request body has been sent we stop sending and mark the + * connection for closure after we have read the entire response. + */ + if(!Curl_req_done_sending(data)) { + if((k->httpcode == 417) && Curl_http_exp100_is_selected(data)) { + /* 417 Expectation Failed - try again without the Expect + header */ + if(!k->writebytecount && http_exp100_is_waiting(data)) { + infof(data, "Got HTTP failure 417 while waiting for a 100"); + } + else { + infof(data, "Got HTTP failure 417 while sending data"); + streamclose(conn, + "Stop sending data before everything sent"); + result = http_perhapsrewind(data, conn); + if(result) + goto out; + } + data->state.disableexpect = TRUE; + DEBUGASSERT(!data->req.newurl); + data->req.newurl = strdup(data->state.url); + Curl_req_abort_sending(data); + } + else if(data->set.http_keep_sending_on_error) { + infof(data, "HTTP error before end of send, keep sending"); + http_exp100_send_anyway(data); + } + else { + infof(data, "HTTP error before end of send, stop sending"); + streamclose(conn, "Stop sending data before everything sent"); + result = Curl_req_abort_sending(data); + if(result) + goto out; + } + } + break; + + default: /* default label present to avoid compiler warnings */ + break; + } + } + + if(Curl_creader_will_rewind(data) && !Curl_req_done_sending(data)) { + /* We rewind before next send, continue sending now */ + 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 + * out and return home. + */ + if(data->req.no_body) + 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 + 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. */ + if(0 == k->maxdownload + && !Curl_conn_is_http2(data, conn, FIRSTSOCKET) + && !Curl_conn_is_http3(data, conn, FIRSTSOCKET)) + k->download_done = TRUE; + + /* final response without error, prepare to receive the body */ + result = Curl_http_firstwrite(data); + + if(!result) + /* This is the last response that we get for the current request. + * Check on the body size and determine if the response is complete. + */ + result = Curl_http_size(data); + +out: + if(last_hd) { + /* if not written yet, write it now */ + CURLcode r2 = http_write_header(data, last_hd, last_hd_len); + if(!result) + result = r2; + } + return result; +} + +static CURLcode http_rw_hd(struct Curl_easy *data, + const char *hd, size_t hdlen, + const char *buf_remain, size_t blen, + size_t *pconsumed) +{ + CURLcode result = CURLE_OK; + struct SingleRequest *k = &data->req; + int writetype; + + *pconsumed = 0; + if((0x0a == *hd) || (0x0d == *hd)) { + /* Empty header line means end of headers! */ + struct dynbuf last_header; + size_t consumed; + + Curl_dyn_init(&last_header, hdlen + 1); + result = Curl_dyn_addn(&last_header, hd, hdlen); + if(result) + return result; + + /* analyze the response to find out what to do. */ + /* Caveat: we clear anything in the header brigade, because a + * response might switch HTTP version which may call use recursively. + * Not nice, but that is currently the way of things. */ + Curl_dyn_reset(&data->state.headerb); + result = http_on_response(data, Curl_dyn_ptr(&last_header), + Curl_dyn_len(&last_header), + buf_remain, blen, &consumed); + *pconsumed += consumed; + Curl_dyn_free(&last_header); + return result; + } + + /* + * Checks for special headers coming up. + */ + + writetype = CLIENTWRITE_HEADER; + if(!k->headerline++) { + /* This is the first header, it MUST be the error code line + or else we consider this to be the body right away! */ + bool fine_statusline = FALSE; + + k->httpversion = 0; /* Do not know yet */ + if(data->conn->handler->protocol & PROTO_FAMILY_HTTP) { + /* + * https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2 + * + * The response code is always a three-digit number in HTTP as the spec + * says. We allow any three-digit number here, but we cannot make + * guarantees on future behaviors since it is not within the protocol. + */ + const char *p = hd; + + while(*p && ISBLANK(*p)) + p++; + if(!strncmp(p, "HTTP/", 5)) { + p += 5; + switch(*p) { + case '1': + p++; + if((p[0] == '.') && (p[1] == '0' || p[1] == '1')) { + if(ISBLANK(p[2])) { + k->httpversion = 10 + (p[1] - '0'); + p += 3; + if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { + k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + + (p[2] - '0'); + p += 3; + if(ISSPACE(*p)) + fine_statusline = TRUE; + } + } + } + if(!fine_statusline) { + failf(data, "Unsupported HTTP/1 subversion in response"); + return CURLE_UNSUPPORTED_PROTOCOL; + } + break; + case '2': + case '3': + if(!ISBLANK(p[1])) + break; + k->httpversion = (*p - '0') * 10; + p += 2; + if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { + k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + + (p[2] - '0'); + p += 3; + if(!ISSPACE(*p)) + break; + fine_statusline = TRUE; + } + break; + default: /* unsupported */ + failf(data, "Unsupported HTTP version in response"); + return CURLE_UNSUPPORTED_PROTOCOL; + } + } + + if(!fine_statusline) { + /* If user has set option HTTP200ALIASES, + compare header line against list of aliases + */ + statusline check = checkhttpprefix(data, hd, hdlen); + if(check == STATUS_DONE) { + fine_statusline = TRUE; + k->httpcode = 200; + k->httpversion = 10; + } + } + } + else if(data->conn->handler->protocol & CURLPROTO_RTSP) { + const char *p = hd; + while(*p && ISBLANK(*p)) + p++; + if(!strncmp(p, "RTSP/", 5)) { + p += 5; + if(ISDIGIT(*p)) { + p++; + if((p[0] == '.') && ISDIGIT(p[1])) { + if(ISBLANK(p[2])) { + p += 3; + if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { + k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + + (p[2] - '0'); + p += 3; + if(ISSPACE(*p)) { + fine_statusline = TRUE; + k->httpversion = 11; /* RTSP acts like HTTP 1.1 */ + } + } + } + } + } + if(!fine_statusline) + return CURLE_WEIRD_SERVER_REPLY; + } + } + + if(fine_statusline) { + result = Curl_http_statusline(data, data->conn); + if(result) + return result; + writetype |= CLIENTWRITE_STATUS; + } + else { + k->header = FALSE; /* this is not a header line */ + return CURLE_WEIRD_SERVER_REPLY; + } + } + + result = verify_header(data, hd, hdlen); + if(result) + return result; + + result = Curl_http_header(data, hd, hdlen); + if(result) + return result; + + /* + * Taken in one (more) header. Write it to the client. + */ + Curl_debug(data, CURLINFO_HEADER_IN, (char *)hd, hdlen); + + if(k->httpcode/100 == 1) + writetype |= CLIENTWRITE_1XX; + result = Curl_client_write(data, writetype, hd, hdlen); + if(result) + return result; + + result = Curl_bump_headersize(data, hdlen, FALSE); + if(result) + return result; + + return CURLE_OK; +} + +/* + * Read any HTTP header lines from the server and pass them to the client app. + */ +static CURLcode http_parse_headers(struct Curl_easy *data, + const char *buf, size_t blen, + size_t *pconsumed) { struct connectdata *conn = data->conn; CURLcode result = CURLE_OK; struct SingleRequest *k = &data->req; - char *headp; char *end_ptr; bool leftover_body = FALSE; /* header line within buffer loop */ *pconsumed = 0; - do { - size_t line_length; - int writetype; - - /* data is in network encoding so use 0x0a instead of '\n' */ - end_ptr = memchr(buf, 0x0a, blen); + while(blen && k->header) { + size_t consumed; + end_ptr = memchr(buf, '\n', blen); if(!end_ptr) { /* Not a complete header line within buffer, append the data to the end of the headerbuff. */ @@ -3416,14 +3893,13 @@ static CURLcode http_rw_headers(struct Curl_easy *data, } /* decrease the size of the remaining (supposed) header line */ - line_length = (end_ptr - buf) + 1; - result = Curl_dyn_addn(&data->state.headerb, buf, line_length); + consumed = (end_ptr - buf) + 1; + result = Curl_dyn_addn(&data->state.headerb, buf, consumed); if(result) return result; - - blen -= line_length; - buf += line_length; - *pconsumed += line_length; + blen -= consumed; + buf += consumed; + *pconsumed += consumed; /**** * We now have a FULL header line in 'headerb'. @@ -3451,494 +3927,21 @@ static CURLcode http_rw_headers(struct Curl_easy *data, } } - /* headers are in network encoding so use 0x0a and 0x0d instead of '\n' - and '\r' */ - headp = Curl_dyn_ptr(&data->state.headerb); - if((0x0a == *headp) || (0x0d == *headp)) { - size_t headerlen; - bool switch_to_h2 = FALSE; - /* Zero-length header line means end of headers! */ - - if('\r' == *headp) - headp++; /* pass the \r byte */ - if('\n' == *headp) - headp++; /* pass the \n byte */ - - if(100 <= k->httpcode && 199 >= k->httpcode) { - /* "A user agent MAY ignore unexpected 1xx status responses." */ - switch(k->httpcode) { - case 100: - /* - * We have made an HTTP PUT or POST and this is 1.1-lingo - * that tells us that the server is OK with this and ready - * to receive the data. - * However, we'll get more headers now so we must get - * back into the header-parsing state! - */ - k->header = TRUE; - k->headerline = 0; /* restart the header line counter */ - - /* if we did wait for this do enable write now! */ - if(k->exp100 > EXP100_SEND_DATA) { - k->exp100 = EXP100_SEND_DATA; - k->keepon |= KEEP_SEND; - Curl_expire_done(data, EXPIRE_100_TIMEOUT); - } - break; - case 101: - if(conn->httpversion == 11) { - /* Switching Protocols only allowed from HTTP/1.1 */ - if(k->upgr101 == UPGR101_H2) { - /* Switching to HTTP/2 */ - infof(data, "Received 101, Switching to HTTP/2"); - k->upgr101 = UPGR101_RECEIVED; - - /* we'll get more headers (HTTP/2 response) */ - k->header = TRUE; - k->headerline = 0; /* restart the header line counter */ - switch_to_h2 = TRUE; - } -#ifdef USE_WEBSOCKETS - else if(k->upgr101 == UPGR101_WS) { - /* verify the response */ - result = Curl_ws_accept(data, buf, blen); - if(result) - return result; - k->header = FALSE; /* no more header to parse! */ - *pconsumed += blen; /* ws accept handled the data */ - blen = 0; - if(data->set.connect_only) - k->keepon &= ~KEEP_RECV; /* read no more content */ - } -#endif - else { - /* Not switching to another protocol */ - k->header = FALSE; /* no more header to parse! */ - } - } - else { - /* invalid for other HTTP versions */ - failf(data, "unexpected 101 response code"); - return CURLE_WEIRD_SERVER_REPLY; - } - break; - default: - /* the status code 1xx indicates a provisional response, so - we'll get another set of headers */ - k->header = TRUE; - k->headerline = 0; /* restart the header line counter */ - break; - } - } - else { - if(k->upgr101 == UPGR101_H2) { - /* A requested upgrade was denied, poke the multi handle to possibly - allow a pending pipewait to continue */ - Curl_multi_connchanged(data->multi); - } - k->header = FALSE; /* no more header to parse! */ - - if((k->size == -1) && !k->chunk && !conn->bits.close && - (conn->httpversion == 11) && - !(conn->handler->protocol & CURLPROTO_RTSP) && - data->state.httpreq != HTTPREQ_HEAD) { - /* On HTTP 1.1, when connection is not to get closed, but no - Content-Length nor Transfer-Encoding chunked have been - received, according to RFC2616 section 4.4 point 5, we - assume that the server will close the connection to - signal the end of the document. */ - infof(data, "no chunk, no close, no size. Assume close to " - "signal end"); - streamclose(conn, "HTTP: No end-of-message indicator"); - } - } - - if(!k->header) { - result = Curl_http_size(data); - if(result) - return result; - } - - /* At this point we have some idea about the fate of the connection. - If we are closing the connection it may result auth failure. */ -#if defined(USE_NTLM) - if(conn->bits.close && - (((data->req.httpcode == 401) && - (conn->http_ntlm_state == NTLMSTATE_TYPE2)) || - ((data->req.httpcode == 407) && - (conn->proxy_ntlm_state == NTLMSTATE_TYPE2)))) { - infof(data, "Connection closure while negotiating auth (HTTP 1.0?)"); - data->state.authproblem = TRUE; - } -#endif -#if defined(USE_SPNEGO) - if(conn->bits.close && - (((data->req.httpcode == 401) && - (conn->http_negotiate_state == GSS_AUTHRECV)) || - ((data->req.httpcode == 407) && - (conn->proxy_negotiate_state == GSS_AUTHRECV)))) { - infof(data, "Connection closure while negotiating auth (HTTP 1.0?)"); - data->state.authproblem = TRUE; - } - if((conn->http_negotiate_state == GSS_AUTHDONE) && - (data->req.httpcode != 401)) { - conn->http_negotiate_state = GSS_AUTHSUCC; - } - if((conn->proxy_negotiate_state == GSS_AUTHDONE) && - (data->req.httpcode != 407)) { - conn->proxy_negotiate_state = GSS_AUTHSUCC; - } -#endif - - /* now, only output this if the header AND body are requested: - */ - writetype = CLIENTWRITE_HEADER | - ((k->httpcode/100 == 1) ? CLIENTWRITE_1XX : 0); - - headerlen = Curl_dyn_len(&data->state.headerb); - result = Curl_client_write(data, writetype, - Curl_dyn_ptr(&data->state.headerb), - headerlen); - if(result) - return result; - - result = Curl_bump_headersize(data, headerlen, FALSE); - if(result) - return result; - - /* - * When all the headers have been parsed, see if we should give - * up and return an error. - */ - if(http_should_fail(data)) { - failf(data, "The requested URL returned error: %d", - k->httpcode); - return CURLE_HTTP_RETURNED_ERROR; - } - -#ifdef USE_WEBSOCKETS - /* All non-101 HTTP status codes are bad when wanting to upgrade to - websockets */ - if(data->req.upgr101 == UPGR101_WS) { - failf(data, "Refused WebSockets upgrade: %d", k->httpcode); - return CURLE_HTTP_RETURNED_ERROR; - } -#endif - - - data->req.deductheadercount = - (100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0; - - /* Curl_http_auth_act() checks what authentication methods - * that are available and decides which one (if any) to - * use. It will set 'newurl' if an auth method was picked. */ - result = Curl_http_auth_act(data); - - if(result) - return result; - - if(k->httpcode >= 300) { - if((!data->req.authneg) && !conn->bits.close && - !Curl_creader_will_rewind(data)) { - /* - * General treatment of errors when about to send data. Including : - * "417 Expectation Failed", while waiting for 100-continue. - * - * 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 - * avoid this check. - * - * rewindbeforesend indicates that something has told libcurl to - * continue sending even if it gets discarded - */ - - switch(data->state.httpreq) { - case HTTPREQ_PUT: - case HTTPREQ_POST: - case HTTPREQ_POST_FORM: - case HTTPREQ_POST_MIME: - /* We got an error response. If this happened before the whole - * request body has been sent we stop sending and mark the - * connection for closure after we've read the entire response. - */ - Curl_expire_done(data, EXPIRE_100_TIMEOUT); - if(!Curl_req_done_sending(data)) { - if((k->httpcode == 417) && data->state.expect100header) { - /* 417 Expectation Failed - try again without the Expect - header */ - if(!k->writebytecount && - k->exp100 == EXP100_AWAITING_CONTINUE) { - infof(data, "Got HTTP failure 417 while waiting for a 100"); - } - else { - infof(data, "Got HTTP failure 417 while sending data"); - streamclose(conn, - "Stop sending data before everything sent"); - result = http_perhapsrewind(data, conn); - if(result) - return result; - } - data->state.disableexpect = TRUE; - DEBUGASSERT(!data->req.newurl); - data->req.newurl = strdup(data->state.url); - Curl_req_abort_sending(data); - } - else if(data->set.http_keep_sending_on_error) { - infof(data, "HTTP error before end of send, keep sending"); - if(k->exp100 > EXP100_SEND_DATA) { - k->exp100 = EXP100_SEND_DATA; - k->keepon |= KEEP_SEND; - } - } - else { - infof(data, "HTTP error before end of send, stop sending"); - streamclose(conn, "Stop sending data before everything sent"); - result = Curl_req_abort_sending(data); - if(result) - return result; - if(data->state.expect100header) - k->exp100 = EXP100_FAILED; - } - } - break; - - default: /* default label present to avoid compiler warnings */ - break; - } - } - - if(Curl_creader_will_rewind(data) && !Curl_req_done_sending(data)) { - /* We rewind before next send, continue sending now */ - infof(data, "Keep sending data to get tossed away"); - k->keepon |= KEEP_SEND; - } - } - - if(!k->header) { - /* - * really end-of-headers. - * - * If we requested a "no body", this is a good time to get - * out and return home. - */ - if(data->req.no_body) - 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'd - 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. */ - if(0 == k->maxdownload - && !Curl_conn_is_http2(data, conn, FIRSTSOCKET) - && !Curl_conn_is_http3(data, conn, FIRSTSOCKET)) - k->download_done = TRUE; - - Curl_debug(data, CURLINFO_HEADER_IN, - Curl_dyn_ptr(&data->state.headerb), - Curl_dyn_len(&data->state.headerb)); - goto out; /* exit header line loop */ - } - - /* We continue reading headers, reset the line-based header */ - Curl_dyn_reset(&data->state.headerb); - if(switch_to_h2) { - /* Having handled the headers, we can do the HTTP/2 switch. - * Any remaining `buf` bytes are already HTTP/2 and passed to - * be processed. */ - result = Curl_http2_upgrade(data, conn, FIRSTSOCKET, buf, blen); - if(result) - return result; - *pconsumed += blen; - blen = 0; - } - - continue; - } - - /* - * Checks for special headers coming up. - */ - - writetype = CLIENTWRITE_HEADER; - if(!k->headerline++) { - /* This is the first header, it MUST be the error code line - or else we consider this to be the body right away! */ - bool fine_statusline = FALSE; - if(conn->handler->protocol & PROTO_FAMILY_HTTP) { - /* - * https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2 - * - * The response code is always a three-digit number in HTTP as the spec - * says. We allow any three-digit number here, but we cannot make - * guarantees on future behaviors since it isn't within the protocol. - */ - int httpversion = 0; - char *p = headp; - - while(*p && ISBLANK(*p)) - p++; - if(!strncmp(p, "HTTP/", 5)) { - p += 5; - switch(*p) { - case '1': - p++; - if((p[0] == '.') && (p[1] == '0' || p[1] == '1')) { - if(ISBLANK(p[2])) { - httpversion = 10 + (p[1] - '0'); - p += 3; - if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { - k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + - (p[2] - '0'); - p += 3; - if(ISSPACE(*p)) - fine_statusline = TRUE; - } - } - } - if(!fine_statusline) { - failf(data, "Unsupported HTTP/1 subversion in response"); - return CURLE_UNSUPPORTED_PROTOCOL; - } - break; - case '2': - case '3': - if(!ISBLANK(p[1])) - break; - httpversion = (*p - '0') * 10; - p += 2; - if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { - k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + - (p[2] - '0'); - p += 3; - if(!ISSPACE(*p)) - break; - fine_statusline = TRUE; - } - break; - default: /* unsupported */ - failf(data, "Unsupported HTTP version in response"); - return CURLE_UNSUPPORTED_PROTOCOL; - } - } - - if(fine_statusline) { - if(k->httpcode < 100) { - failf(data, "Unsupported response code in HTTP response"); - return CURLE_UNSUPPORTED_PROTOCOL; - } - switch(httpversion) { - case 10: - case 11: -#ifdef USE_HTTP2 - case 20: -#endif -#ifdef ENABLE_QUIC - case 30: -#endif - conn->httpversion = (unsigned char)httpversion; - break; - default: - failf(data, "Unsupported HTTP version (%u.%d) in response", - httpversion/10, httpversion%10); - return CURLE_UNSUPPORTED_PROTOCOL; - } - - if(k->upgr101 == UPGR101_RECEIVED) { - /* supposedly upgraded to http2 now */ - if(conn->httpversion != 20) - infof(data, "Lying server, not serving HTTP/2"); - } - if(conn->httpversion < 20) { - conn->bundle->multiuse = BUNDLE_NO_MULTIUSE; - } - } - else { - /* If user has set option HTTP200ALIASES, - compare header line against list of aliases - */ - statusline check = - checkhttpprefix(data, - Curl_dyn_ptr(&data->state.headerb), - Curl_dyn_len(&data->state.headerb)); - if(check == STATUS_DONE) { - fine_statusline = TRUE; - k->httpcode = 200; - conn->httpversion = 10; - } - } - } - else if(conn->handler->protocol & CURLPROTO_RTSP) { - char *p = headp; - while(*p && ISBLANK(*p)) - p++; - if(!strncmp(p, "RTSP/", 5)) { - p += 5; - if(ISDIGIT(*p)) { - p++; - if((p[0] == '.') && ISDIGIT(p[1])) { - if(ISBLANK(p[2])) { - p += 3; - if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) { - k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 + - (p[2] - '0'); - p += 3; - if(ISSPACE(*p)) { - fine_statusline = TRUE; - conn->httpversion = 11; /* RTSP acts like HTTP 1.1 */ - } - } - } - } - } - if(!fine_statusline) - return CURLE_WEIRD_SERVER_REPLY; - } - } - - if(fine_statusline) { - result = Curl_http_statusline(data, conn); - if(result) - return result; - writetype |= CLIENTWRITE_STATUS; - } - else { - k->header = FALSE; /* this is not a header line */ - break; - } - } - - result = verify_header(data); - if(result) - return result; - - result = Curl_http_header(data, conn, headp); - if(result) - return result; - - /* - * End of header-checks. Write them to the client. - */ - if(k->httpcode/100 == 1) - writetype |= CLIENTWRITE_1XX; - - Curl_debug(data, CURLINFO_HEADER_IN, headp, - Curl_dyn_len(&data->state.headerb)); - - result = Curl_client_write(data, writetype, headp, - Curl_dyn_len(&data->state.headerb)); - if(result) - return result; - - result = Curl_bump_headersize(data, Curl_dyn_len(&data->state.headerb), - FALSE); - if(result) - return result; - + result = http_rw_hd(data, Curl_dyn_ptr(&data->state.headerb), + Curl_dyn_len(&data->state.headerb), + buf, blen, &consumed); + /* We are done with this line. We reset because response + * processing might switch to HTTP/2 and that might call us + * directly again. */ Curl_dyn_reset(&data->state.headerb); + if(consumed) { + blen -= consumed; + buf += consumed; + *pconsumed += consumed; + } + if(result) + return result; } - while(blen); /* We might have reached the end of the header part here, but there might be a non-header part left in the end of the read @@ -3950,16 +3953,30 @@ out: return CURLE_OK; } +CURLcode Curl_http_write_resp_hd(struct Curl_easy *data, + const char *hd, size_t hdlen, + bool is_eos) +{ + CURLcode result; + size_t consumed; + char tmp = 0; + + result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed); + if(!result && is_eos) { + result = Curl_client_write(data, (CLIENTWRITE_BODY|CLIENTWRITE_EOS), + &tmp, 0); + } + return result; +} + /* * HTTP protocol `write_resp` implementation. Will parse headers * when not done yet and otherwise return without consuming data. */ CURLcode Curl_http_write_resp_hds(struct Curl_easy *data, const char *buf, size_t blen, - size_t *pconsumed, - bool *done) + size_t *pconsumed) { - *done = FALSE; if(!data->req.header) { *pconsumed = 0; return CURLE_OK; @@ -3967,11 +3984,8 @@ CURLcode Curl_http_write_resp_hds(struct Curl_easy *data, else { CURLcode result; - result = http_rw_headers(data, buf, blen, pconsumed); + result = http_parse_headers(data, buf, blen, pconsumed); if(!result && !data->req.header) { - /* we have successfully finished parsing the HEADERs */ - result = Curl_http_firstwrite(data, data->conn, done); - if(!data->req.no_body && Curl_dyn_len(&data->state.headerb)) { /* leftover from parsing something that turned out not * to be a header, only happens if we allow for @@ -3988,16 +4002,14 @@ CURLcode Curl_http_write_resp_hds(struct Curl_easy *data, CURLcode Curl_http_write_resp(struct Curl_easy *data, const char *buf, size_t blen, - bool is_eos, - bool *done) + bool is_eos) { CURLcode result; size_t consumed; int flags; - *done = FALSE; - result = Curl_http_write_resp_hds(data, buf, blen, &consumed, done); - if(result || *done) + result = Curl_http_write_resp_hds(data, buf, blen, &consumed); + if(result || data->req.done) goto out; DEBUGASSERT(consumed <= blen); @@ -4038,7 +4050,7 @@ CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len) } result = CURLE_OK; out: - *pstatus = result? -1 : status; + *pstatus = result ? -1 : status; return result; } @@ -4081,7 +4093,7 @@ CURLcode Curl_http_req_make(struct httpreq **preq, out: if(result && req) Curl_http_req_free(req); - *preq = result? NULL : req; + *preq = result ? NULL : req; return result; } @@ -4239,7 +4251,7 @@ CURLcode Curl_http_req_make2(struct httpreq **preq, out: if(result && req) Curl_http_req_free(req); - *preq = result? NULL : req; + *preq = result ? NULL : req; return result; } @@ -4305,8 +4317,8 @@ CURLcode Curl_http_req_to_h2(struct dynhds *h2_headers, infof(data, "set pseudo header %s to %s", HTTP_PSEUDO_SCHEME, scheme); } else { - scheme = (data->conn && data->conn->handler->flags & PROTOPT_SSL)? - "https" : "http"; + scheme = (data->conn && data->conn->handler->flags & PROTOPT_SSL) ? + "https" : "http"; } } @@ -4370,7 +4382,7 @@ CURLcode Curl_http_resp_make(struct http_resp **presp, out: if(result && resp) Curl_http_resp_free(resp); - *presp = result? NULL : resp; + *presp = result ? NULL : resp; return result; } @@ -4386,4 +4398,152 @@ void Curl_http_resp_free(struct http_resp *resp) } } +struct cr_exp100_ctx { + struct Curl_creader super; + struct curltime start; /* time started waiting */ + enum expect100 state; +}; + +/* Expect: 100-continue client reader, blocking uploads */ + +static void http_exp100_continue(struct Curl_easy *data, + struct Curl_creader *reader) +{ + 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); + } +} + +static CURLcode cr_exp100_read(struct Curl_easy *data, + struct Curl_creader *reader, + char *buf, size_t blen, + size_t *nread, bool *eos) +{ + struct cr_exp100_ctx *ctx = reader->ctx; + timediff_t ms; + + switch(ctx->state) { + case EXP100_SENDING_REQUEST: + if(!Curl_req_sendbuf_empty(data)) { + /* The initial request data has not been fully sent yet. Do + * not start the timer yet. */ + DEBUGF(infof(data, "cr_exp100_read, request not full sent yet")); + *nread = 0; + *eos = FALSE; + return CURLE_OK; + } + /* We are now waiting for a reply from the server or + * a timeout on our side IFF the request has been fully sent. */ + DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, " + "timeout %ldms", data->set.expect_100_timeout)); + ctx->state = EXP100_AWAITING_CONTINUE; + ctx->start = Curl_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; + case EXP100_FAILED: + DEBUGF(infof(data, "cr_exp100_read, expectation failed, error")); + *nread = 0; + *eos = FALSE; + return CURLE_READ_ERROR; + case EXP100_AWAITING_CONTINUE: + ms = Curl_timediff(Curl_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; + } + /* we have waited long enough, continue anyway */ + http_exp100_continue(data, reader); + infof(data, "Done waiting for 100-continue"); + FALLTHROUGH(); + default: + DEBUGF(infof(data, "cr_exp100_read, pass through")); + return Curl_creader_read(data, reader->next, buf, blen, nread, eos); + } +} + +static void cr_exp100_done(struct Curl_easy *data, + struct Curl_creader *reader, int premature) +{ + 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); +} + +static const struct Curl_crtype cr_exp100 = { + "cr-exp100", + Curl_creader_def_init, + cr_exp100_read, + Curl_creader_def_close, + Curl_creader_def_needs_rewind, + Curl_creader_def_total_length, + Curl_creader_def_resume_from, + Curl_creader_def_rewind, + Curl_creader_def_unpause, + Curl_creader_def_is_paused, + cr_exp100_done, + sizeof(struct cr_exp100_ctx) +}; + +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); + if(!result) + result = Curl_creader_add(data, reader); + if(!result) { + struct cr_exp100_ctx *ctx = reader->ctx; + ctx->state = EXP100_SENDING_REQUEST; + } + + if(result && reader) + Curl_creader_free(data, reader); + return result; +} + +void Curl_http_exp100_got100(struct Curl_easy *data) +{ + struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100); + if(r) + http_exp100_continue(data, r); +} + +static bool http_exp100_is_waiting(struct Curl_easy *data) +{ + struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100); + if(r) { + struct cr_exp100_ctx *ctx = r->ctx; + return (ctx->state == EXP100_AWAITING_CONTINUE); + } + return FALSE; +} + +static void http_exp100_send_anyway(struct Curl_easy *data) +{ + struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100); + if(r) + http_exp100_continue(data, r); +} + +bool Curl_http_exp100_is_selected(struct Curl_easy *data) +{ + struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100); + return !!r; +} + #endif /* CURL_DISABLE_HTTP */ diff --git a/deps/curl/lib/http.h b/deps/curl/lib/http.h index c77d9c6b..bb5974d9 100644 --- a/deps/curl/lib/http.h +++ b/deps/curl/lib/http.h @@ -44,7 +44,7 @@ typedef enum { #ifndef CURL_DISABLE_HTTP -#if defined(ENABLE_QUIC) +#if defined(USE_HTTP3) #include #endif @@ -73,7 +73,6 @@ char *Curl_checkProxyheaders(struct Curl_easy *data, const struct connectdata *conn, const char *thisheader, const size_t thislen); -struct HTTP; /* see below */ CURLcode Curl_add_timecondition(struct Curl_easy *data, #ifndef USE_HYPER @@ -102,8 +101,8 @@ CURLcode Curl_http_target(struct Curl_easy *data, struct connectdata *conn, struct dynbuf *req); CURLcode Curl_http_statusline(struct Curl_easy *data, struct connectdata *conn); -CURLcode Curl_http_header(struct Curl_easy *data, struct connectdata *conn, - char *headp); +CURLcode Curl_http_header(struct Curl_easy *data, + const char *hd, size_t hdlen); CURLcode Curl_transferencode(struct Curl_easy *data); CURLcode Curl_http_req_set_reader(struct Curl_easy *data, Curl_HttpReq httpreq, @@ -121,9 +120,7 @@ CURLcode Curl_http_cookies(struct Curl_easy *data, #endif CURLcode Curl_http_range(struct Curl_easy *data, Curl_HttpReq httpreq); -CURLcode Curl_http_firstwrite(struct Curl_easy *data, - struct connectdata *conn, - bool *done); +CURLcode Curl_http_firstwrite(struct Curl_easy *data); /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http_setup_conn(struct Curl_easy *data, @@ -135,8 +132,10 @@ int Curl_http_getsock_do(struct Curl_easy *data, struct connectdata *conn, curl_socket_t *socks); CURLcode Curl_http_write_resp(struct Curl_easy *data, const char *buf, size_t blen, - bool is_eos, - bool *done); + bool is_eos); +CURLcode Curl_http_write_resp_hd(struct Curl_easy *data, + const char *hd, size_t hdlen, + bool is_eos); /* These functions are in http.c */ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, @@ -147,7 +146,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data); 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) /* don't 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 @@ -179,26 +178,20 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data); version. This count includes CONNECT response headers. */ #define MAX_HTTP_RESP_HEADER_SIZE (300*1024) +bool Curl_http_exp100_is_selected(struct Curl_easy *data); +void Curl_http_exp100_got100(struct Curl_easy *data); + #endif /* CURL_DISABLE_HTTP */ /**************************************************************************** * HTTP unique setup ***************************************************************************/ -struct HTTP { -#ifndef CURL_DISABLE_HTTP - void *h2_ctx; /* HTTP/2 implementation context */ - void *h3_ctx; /* HTTP/3 implementation context */ -#else - char unused; -#endif -}; CURLcode Curl_http_size(struct Curl_easy *data); CURLcode Curl_http_write_resp_hds(struct Curl_easy *data, const char *buf, size_t blen, - size_t *pconsumed, - bool *done); + size_t *pconsumed); /** * Curl_http_output_auth() setups the authentication headers for the @@ -242,7 +235,7 @@ struct httpreq { }; /** - * Create a HTTP request struct. + * Create an HTTP request struct. */ CURLcode Curl_http_req_make(struct httpreq **preq, const char *method, size_t m_len, @@ -292,7 +285,7 @@ struct http_resp { }; /** - * Create a HTTP response struct. + * Create an HTTP response struct. */ CURLcode Curl_http_resp_make(struct http_resp **presp, int status, diff --git a/deps/curl/lib/http1.c b/deps/curl/lib/http1.c index 182234ca..f135b207 100644 --- a/deps/curl/lib/http1.c +++ b/deps/curl/lib/http1.c @@ -128,7 +128,7 @@ static ssize_t next_line(struct h1_req_parser *parser, else if(*err == CURLE_AGAIN) { /* no line end in `buf`, add it to our scratch */ *err = Curl_dyn_addn(&parser->scratch, (const unsigned char *)buf, buflen); - nread = (*err)? -1 : (ssize_t)buflen; + nread = (*err) ? -1 : (ssize_t)buflen; } return nread; } @@ -217,7 +217,7 @@ static CURLcode start_req(struct h1_req_parser *parser, tmp[target_len] = '\0'; /* See if treating TARGET as an absolute URL makes sense */ if(Curl_is_absolute_url(tmp, NULL, 0, FALSE)) { - int url_options; + unsigned int url_options; url = curl_url(); if(!url) { @@ -325,10 +325,10 @@ CURLcode Curl_h1_req_write_head(struct httpreq *req, int http_minor, result = Curl_dyn_addf(dbuf, "%s %s%s%s%s HTTP/1.%d\r\n", req->method, - req->scheme? req->scheme : "", - req->scheme? "://" : "", - req->authority? req->authority : "", - req->path? req->path : "", + req->scheme ? req->scheme : "", + req->scheme ? "://" : "", + req->authority ? req->authority : "", + req->path ? req->path : "", http_minor); if(result) goto out; diff --git a/deps/curl/lib/http2.c b/deps/curl/lib/http2.c index 60b924de..f1ee0cf9 100644 --- a/deps/curl/lib/http2.c +++ b/deps/curl/lib/http2.c @@ -29,6 +29,7 @@ #include #include "urldata.h" #include "bufq.h" +#include "hash.h" #include "http1.h" #include "http2.h" #include "http.h" @@ -68,38 +69,44 @@ /* buffer dimensioning: * use 16K as chunk size, as that fits H2 DATA frames well */ #define H2_CHUNK_SIZE (16 * 1024) -/* this is how much we want "in flight" for a stream */ -#define H2_STREAM_WINDOW_SIZE (10 * 1024 * 1024) +/* connection window size */ +#define H2_CONN_WINDOW_SIZE (10 * 1024 * 1024) /* on receiving from TLS, we prep for holding a full stream window */ -#define H2_NW_RECV_CHUNKS (H2_STREAM_WINDOW_SIZE / H2_CHUNK_SIZE) +#define H2_NW_RECV_CHUNKS (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE) /* on send into TLS, we just want to accumulate small frames */ #define H2_NW_SEND_CHUNKS 1 -/* stream recv/send chunks are a result of window / chunk sizes */ -#define H2_STREAM_RECV_CHUNKS (H2_STREAM_WINDOW_SIZE / H2_CHUNK_SIZE) +/* this is how much we want "in flight" for a stream, unthrottled */ +#define H2_STREAM_WINDOW_SIZE_MAX (10 * 1024 * 1024) +/* this is how much we want "in flight" for a stream, initially, IFF + * nghttp2 allows us to tweak the local window size. */ +#if NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE +#define H2_STREAM_WINDOW_SIZE_INITIAL (64 * 1024) +#else +#define H2_STREAM_WINDOW_SIZE_INITIAL H2_STREAM_WINDOW_SIZE_MAX +#endif /* keep smaller stream upload buffer (default h2 window size) to have * our progress bars and "upload done" reporting closer to reality */ #define H2_STREAM_SEND_CHUNKS ((64 * 1024) / H2_CHUNK_SIZE) /* spare chunks we keep for a full window */ -#define H2_STREAM_POOL_SPARES (H2_STREAM_WINDOW_SIZE / H2_CHUNK_SIZE) +#define H2_STREAM_POOL_SPARES (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE) -/* We need to accommodate the max number of streams with their window - * sizes on the overall connection. Streams might become PAUSED which - * will block their received QUOTA in the connection window. And if we - * run out of space, the server is blocked from sending us any data. - * See #10988 for an issue with this. */ -#define HTTP2_HUGE_WINDOW_SIZE (100 * H2_STREAM_WINDOW_SIZE) +/* We need to accommodate the max number of streams with their window sizes on + * the overall connection. Streams might become PAUSED which will block their + * received QUOTA in the connection window. If we run out of space, the server + * 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_BINSETTINGS_LEN 80 -static int populate_settings(nghttp2_settings_entry *iv, - struct Curl_easy *data) +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; + iv[1].value = H2_STREAM_WINDOW_SIZE_INITIAL; iv[2].settings_id = NGHTTP2_SETTINGS_ENABLE_PUSH; iv[2].value = data->multi->push_cb != NULL; @@ -111,7 +118,7 @@ static ssize_t populate_binsettings(uint8_t *binsettings, struct Curl_easy *data) { nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN]; - int ivlen; + size_t ivlen; ivlen = populate_settings(iv, data); /* this returns number of bytes it wrote or a negative number on error. */ @@ -127,13 +134,19 @@ struct cf_h2_ctx { struct bufq inbufq; /* network input */ struct bufq outbufq; /* network output */ struct bufc_pool stream_bufcp; /* spares for stream buffers */ + struct dynbuf scratch; /* scratch buffer for temp use */ + struct Curl_hash streams; /* hash of `data->mid` to `h2_stream_ctx` */ size_t drain_total; /* sum of all stream's UrlState drain */ uint32_t max_concurrent_streams; - int32_t goaway_error; - int32_t last_stream_id; + 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 */ + BIT(initialized); + BIT(via_h1_upgrade); BIT(conn_closed); - BIT(goaway); + BIT(rcvd_goaway); + BIT(sent_goaway); BIT(enable_push); BIT(nw_out_blocked); }; @@ -143,25 +156,38 @@ struct cf_h2_ctx { #define CF_CTX_CALL_DATA(cf) \ ((struct cf_h2_ctx *)(cf)->ctx)->call_data -static void cf_h2_ctx_clear(struct cf_h2_ctx *ctx) -{ - struct cf_call_data save = ctx->call_data; +static void h2_stream_hash_free(void *stream); - if(ctx->h2) { - nghttp2_session_del(ctx->h2); - } - Curl_bufq_free(&ctx->inbufq); - Curl_bufq_free(&ctx->outbufq); - Curl_bufcp_free(&ctx->stream_bufcp); - memset(ctx, 0, sizeof(*ctx)); - ctx->call_data = save; +static void cf_h2_ctx_init(struct cf_h2_ctx *ctx, bool via_h1_upgrade) +{ + Curl_bufcp_init(&ctx->stream_bufcp, H2_CHUNK_SIZE, H2_STREAM_POOL_SPARES); + 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); + Curl_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); + Curl_hash_offt_init(&ctx->streams, 63, h2_stream_hash_free); + ctx->remote_max_sid = 2147483647; + ctx->via_h1_upgrade = via_h1_upgrade; + ctx->initialized = TRUE; } static void cf_h2_ctx_free(struct cf_h2_ctx *ctx) { - if(ctx) { - cf_h2_ctx_clear(ctx); - free(ctx); + if(ctx && ctx->initialized) { + Curl_bufq_free(&ctx->inbufq); + Curl_bufq_free(&ctx->outbufq); + Curl_bufcp_free(&ctx->stream_bufcp); + Curl_dyn_free(&ctx->scratch); + Curl_hash_clean(&ctx->streams); + Curl_hash_destroy(&ctx->streams); + memset(ctx, 0, sizeof(*ctx)); + } + free(ctx); +} + +static void cf_h2_ctx_close(struct cf_h2_ctx *ctx) +{ + if(ctx->h2) { + nghttp2_session_del(ctx->h2); } } @@ -177,8 +203,6 @@ struct h2_stream_ctx { struct h1_req_parser h1; /* parsing the request */ struct dynhds resp_trailers; /* response trailer fields */ size_t resp_hds_len; /* amount of response header bytes in recvbuf */ - size_t upload_blocked_len; - curl_off_t upload_left; /* number of request bytes left to upload */ curl_off_t nrcvd_data; /* number of DATA bytes received */ char **push_headers; /* allocated array */ @@ -187,24 +211,140 @@ struct h2_stream_ctx { int status_code; /* HTTP response status code */ uint32_t error; /* stream error code */ - uint32_t local_window_size; /* the local recv window size */ + CURLcode xfer_result; /* Result of writing out response */ + int32_t local_window_size; /* the local recv window size */ int32_t id; /* HTTP/2 protocol identifier for stream */ BIT(resp_hds_complete); /* we have a complete, final response */ BIT(closed); /* TRUE on stream close */ BIT(reset); /* TRUE on stream reset */ BIT(close_handled); /* TRUE if stream closure is handled by libcurl */ BIT(bodystarted); - BIT(send_closed); /* transfer is done sending, we might have still - buffered data in stream->sendbuf to upload. */ + BIT(body_eos); /* the complete body has been added to `sendbuf` and + * is being/has been processed from there. */ }; -#define H2_STREAM_CTX(d) ((struct h2_stream_ctx *)(((d) && \ - (d)->req.p.http)? \ - ((struct HTTP *)(d)->req.p.http)->h2_ctx \ - : NULL)) -#define H2_STREAM_LCTX(d) ((struct HTTP *)(d)->req.p.http)->h2_ctx -#define H2_STREAM_ID(d) (H2_STREAM_CTX(d)? \ - H2_STREAM_CTX(d)->id : -2) +#define H2_STREAM_CTX(ctx,data) ((struct h2_stream_ctx *)(\ + data? Curl_hash_offt_get(&(ctx)->streams, (data)->mid) : NULL)) + +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)); + if(!stream) + return NULL; + + stream->id = -1; + Curl_bufq_initp(&stream->sendbuf, &ctx->stream_bufcp, + H2_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE); + Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); + Curl_dynhds_init(&stream->resp_trailers, 0, DYN_HTTP_REQUEST); + stream->resp_hds_len = 0; + stream->bodystarted = FALSE; + stream->status_code = -1; + stream->closed = FALSE; + stream->close_handled = FALSE; + stream->error = NGHTTP2_NO_ERROR; + stream->local_window_size = H2_STREAM_WINDOW_SIZE_INITIAL; + stream->nrcvd_data = 0; + return stream; +} + +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]); + Curl_safefree(stream->push_headers); + stream->push_headers_used = 0; +} + +static void h2_stream_ctx_free(struct h2_stream_ctx *stream) +{ + Curl_bufq_free(&stream->sendbuf); + Curl_h1_req_parse_free(&stream->h1); + Curl_dynhds_free(&stream->resp_trailers); + free_push_headers(stream); + free(stream); +} + +static void h2_stream_hash_free(void *stream) +{ + DEBUGASSERT(stream); + h2_stream_ctx_free((struct h2_stream_ctx *)stream); +} + +#ifdef NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE +static int32_t cf_h2_get_desired_local_win(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + (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; + } + return H2_STREAM_WINDOW_SIZE_MAX; +} + +static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h2_stream_ctx *stream, + bool paused) +{ + struct cf_h2_ctx *ctx = cf->ctx; + int32_t dwsize; + int rv; + + dwsize = paused ? 0 : cf_h2_get_desired_local_win(cf, data); + if(dwsize != stream->local_window_size) { + int32_t wsize = nghttp2_session_get_stream_effective_local_window_size( + ctx->h2, stream->id); + if(dwsize > wsize) { + rv = nghttp2_submit_window_update(ctx->h2, NGHTTP2_FLAG_NONE, + stream->id, dwsize - wsize); + if(rv) { + failf(data, "[%d] nghttp2_submit_window_update() failed: " + "%s(%d)", stream->id, nghttp2_strerror(rv), rv); + return CURLE_HTTP2; + } + stream->local_window_size = dwsize; + CURL_TRC_CF(data, cf, "[%d] local window update by %d", + stream->id, dwsize - wsize); + } + else { + rv = nghttp2_session_set_local_window_size(ctx->h2, NGHTTP2_FLAG_NONE, + stream->id, dwsize); + if(rv) { + failf(data, "[%d] nghttp2_session_set_local_window_size() failed: " + "%s(%d)", stream->id, nghttp2_strerror(rv), rv); + return CURLE_HTTP2; + } + stream->local_window_size = dwsize; + CURL_TRC_CF(data, cf, "[%d] local window size now %d", + stream->id, dwsize); + } + } + return CURLE_OK; +} + +#else /* NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE */ + +static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h2_stream_ctx *stream, + bool paused) +{ + (void)cf; + (void)data; + (void)stream; + (void)paused; + return CURLE_OK; +} +#endif /* !NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE */ /* * Mark this transfer to get "drained". @@ -217,10 +357,10 @@ static void drain_stream(struct Curl_cfilter *cf, (void)cf; bits = CURL_CSELECT_IN; - if(!stream->send_closed && - (stream->upload_left || stream->upload_blocked_len)) + if(!stream->closed && + (!stream->body_eos || !Curl_bufq_is_empty(&stream->sendbuf))) bits |= CURL_CSELECT_OUT; - if(data->state.select_bits != bits) { + if(stream->closed || (data->state.select_bits != bits)) { CURL_TRC_CF(data, cf, "[%d] DRAIN select_bits=%x", stream->id, bits); data->state.select_bits = bits; @@ -237,58 +377,32 @@ static CURLcode http2_data_setup(struct Curl_cfilter *cf, (void)cf; DEBUGASSERT(data); - if(!data->req.p.http) { - failf(data, "initialization failure, transfer not http initialized"); - return CURLE_FAILED_INIT; - } - stream = H2_STREAM_CTX(data); + stream = H2_STREAM_CTX(ctx, data); if(stream) { *pstream = stream; return CURLE_OK; } - stream = calloc(1, sizeof(*stream)); + stream = h2_stream_ctx_create(ctx); if(!stream) return CURLE_OUT_OF_MEMORY; - stream->id = -1; - Curl_bufq_initp(&stream->sendbuf, &ctx->stream_bufcp, - H2_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE); - Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); - Curl_dynhds_init(&stream->resp_trailers, 0, DYN_HTTP_REQUEST); - stream->resp_hds_len = 0; - stream->bodystarted = FALSE; - stream->status_code = -1; - stream->closed = FALSE; - stream->close_handled = FALSE; - stream->error = NGHTTP2_NO_ERROR; - stream->local_window_size = H2_STREAM_WINDOW_SIZE; - stream->upload_left = 0; - stream->nrcvd_data = 0; + if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { + h2_stream_ctx_free(stream); + return CURLE_OUT_OF_MEMORY; + } - H2_STREAM_LCTX(data) = stream; *pstream = stream; return CURLE_OK; } -static void free_push_headers(struct h2_stream_ctx *stream) -{ - size_t i; - for(i = 0; ipush_headers_used; i++) - free(stream->push_headers[i]); - Curl_safefree(stream->push_headers); - stream->push_headers_used = 0; -} - -static void http2_data_done(struct Curl_cfilter *cf, - struct Curl_easy *data, bool premature) +static void http2_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); DEBUGASSERT(ctx); - (void)premature; - if(!stream) + if(!stream || !ctx->initialized) return; if(ctx->h2) { @@ -302,7 +416,6 @@ static void http2_data_done(struct Curl_cfilter *cf, stream->id); stream->closed = TRUE; stream->reset = TRUE; - stream->send_closed = TRUE; nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE, stream->id, NGHTTP2_STREAM_CLOSED); flush_egress = TRUE; @@ -312,12 +425,7 @@ static void http2_data_done(struct Curl_cfilter *cf, nghttp2_session_send(ctx->h2); } - Curl_bufq_free(&stream->sendbuf); - Curl_h1_req_parse_free(&stream->h1); - Curl_dynhds_free(&stream->resp_trailers); - free_push_headers(stream); - free(stream); - H2_STREAM_LCTX(data) = NULL; + Curl_hash_offt_remove(&ctx->streams, data->mid); } static int h2_client_new(struct Curl_cfilter *cf, @@ -360,8 +468,8 @@ static ssize_t nw_out_writer(void *writer_ctx, struct Curl_easy *data = CF_DATA_CURRENT(cf); if(data) { - ssize_t nwritten = Curl_conn_cf_send(cf->next, data, - (const char *)buf, buflen, err); + ssize_t nwritten = Curl_conn_cf_send(cf->next, data, (const char *)buf, + buflen, FALSE, err); if(nwritten > 0) CURL_TRC_CF(data, cf, "[0] egress: wrote %zd bytes", nwritten); return nwritten; @@ -390,15 +498,12 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *value, size_t valuelen, uint8_t flags, void *userp); +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) static int error_callback(nghttp2_session *session, const char *msg, size_t len, void *userp); - -/* - * Initialize the cfilter context - */ -static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, - struct Curl_easy *data, - bool via_h1_upgrade) +#endif +static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream; @@ -407,10 +512,7 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, nghttp2_session_callbacks *cbs = NULL; DEBUGASSERT(!ctx->h2); - Curl_bufcp_init(&ctx->stream_bufcp, H2_CHUNK_SIZE, H2_STREAM_POOL_SPARES); - 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); - ctx->last_stream_id = 2147483647; + DEBUGASSERT(ctx->initialized); rc = nghttp2_session_callbacks_new(&cbs); if(rc) { @@ -429,7 +531,9 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, nghttp2_session_callbacks_set_on_begin_headers_callback( cbs, on_begin_headers); nghttp2_session_callbacks_set_on_header_callback(cbs, on_header); +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) nghttp2_session_callbacks_set_error_callback(cbs, error_callback); +#endif /* The nghttp2 session is not yet setup, do it */ rc = h2_client_new(cf, cbs); @@ -439,7 +543,7 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, } ctx->max_concurrent_streams = DEFAULT_MAX_CONCURRENT_STREAMS; - if(via_h1_upgrade) { + if(ctx->via_h1_upgrade) { /* HTTP/1.1 Upgrade issued. H2 Settings have already been submitted * in the H1 request and we upgrade from there. This stream * is opened implicitly as #1. */ @@ -459,7 +563,7 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, DEBUGASSERT(stream); stream->id = 1; /* queue SETTINGS frame (again) */ - rc = nghttp2_session_upgrade2(ctx->h2, binsettings, binlen, + rc = nghttp2_session_upgrade2(ctx->h2, binsettings, (size_t)binlen, data->state.httpreq == HTTPREQ_HEAD, NULL); if(rc) { @@ -480,7 +584,7 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, } else { nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN]; - int ivlen; + size_t ivlen; ivlen = populate_settings(iv, data); rc = nghttp2_submit_settings(ctx->h2, NGHTTP2_FLAG_NONE, @@ -505,7 +609,7 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, /* all set, traffic will be send on connect */ result = CURLE_OK; CURL_TRC_CF(data, cf, "[0] created h2 session%s", - via_h1_upgrade? " (via h1 upgrade)" : ""); + ctx->via_h1_upgrade ? " (via h1 upgrade)" : ""); out: if(cbs) @@ -585,8 +689,8 @@ static bool http2_connisalive(struct Curl_cfilter *cf, struct Curl_easy *data, return FALSE; if(*input_pending) { - /* This happens before we've sent off a request and the connection is - not in use by any other transfer, there shouldn't be any data here, + /* This happens before we have sent off a request and the connection is + not in use by any other transfer, there should not be any data here, only "protocol frames" */ CURLcode result; ssize_t nread = -1; @@ -663,7 +767,7 @@ static CURLcode nw_out_flush(struct Curl_cfilter *cf, } return result; } - return Curl_bufq_is_empty(&ctx->outbufq)? CURLE_OK: CURLE_AGAIN; + return Curl_bufq_is_empty(&ctx->outbufq) ? CURLE_OK : CURLE_AGAIN; } /* @@ -685,8 +789,11 @@ static ssize_t send_callback(nghttp2_session *h2, (void)flags; DEBUGASSERT(data); - nwritten = Curl_bufq_write_pass(&ctx->outbufq, buf, blen, - nw_out_writer, cf, &result); + if(!cf->connected) + nwritten = Curl_bufq_write(&ctx->outbufq, buf, blen, &result); + else + nwritten = Curl_bufq_write_pass(&ctx->outbufq, buf, blen, + nw_out_writer, cf, &result); if(nwritten < 0) { if(result == CURLE_AGAIN) { ctx->nw_out_blocked = 1; @@ -708,6 +815,7 @@ static ssize_t send_callback(nghttp2_session *h2, the struct are hidden from the user. */ struct curl_pushheaders { struct Curl_easy *data; + struct h2_stream_ctx *stream; const nghttp2_push_promise *frame; }; @@ -721,9 +829,8 @@ char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num) if(!h || !GOOD_EASY_HANDLE(h->data)) return NULL; else { - struct h2_stream_ctx *stream = H2_STREAM_CTX(h->data); - if(stream && num < stream->push_headers_used) - return stream->push_headers[num]; + if(h->stream && num < h->stream->push_headers_used) + return h->stream->push_headers[num]; } return NULL; } @@ -746,12 +853,12 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) !strcmp(header, ":") || strchr(header + 1, ':')) return NULL; - stream = H2_STREAM_CTX(h->data); + stream = h->stream; if(!stream) return NULL; len = strlen(header); - for(i = 0; ipush_headers_used; i++) { + for(i = 0; i < stream->push_headers_used; i++) { if(!strncmp(header, stream->push_headers[i], len)) { /* sub-match, make sure that it is followed by a colon */ if(stream->push_headers[i][len] != ':') @@ -767,18 +874,9 @@ static struct Curl_easy *h2_duphandle(struct Curl_cfilter *cf, { struct Curl_easy *second = curl_easy_duphandle(data); if(second) { - /* setup the request struct */ - struct HTTP *http = calloc(1, sizeof(struct HTTP)); - if(!http) { - (void)Curl_close(&second); - } - else { - struct h2_stream_ctx *second_stream; - - second->req.p.http = http; - http2_data_setup(cf, second, &second_stream); - second->state.priority.weight = data->state.priority.weight; - } + struct h2_stream_ctx *second_stream; + http2_data_setup(cf, second, &second_stream); + second->state.priority.weight = data->state.priority.weight; } return second; } @@ -806,7 +904,7 @@ static int set_transfer_url(struct Curl_easy *data, v = curl_pushheader_byname(hp, HTTP_PSEUDO_AUTHORITY); if(v) { - uc = Curl_url_set_authority(u, v, CURLU_DISALLOW_USER); + uc = Curl_url_set_authority(u, v); if(uc) { rc = 2; goto fail; @@ -840,9 +938,7 @@ fail: static void discard_newhandle(struct Curl_cfilter *cf, struct Curl_easy *newhandle) { - if(newhandle->req.p.http) { - http2_data_done(cf, newhandle, TRUE); - } + http2_data_done(cf, newhandle); (void)Curl_close(&newhandle); } @@ -869,12 +965,10 @@ static int push_promise(struct Curl_cfilter *cf, goto fail; } - heads.data = data; - heads.frame = frame; /* ask the application */ CURL_TRC_CF(data, cf, "Got PUSH_PROMISE, ask application"); - stream = H2_STREAM_CTX(data); + stream = H2_STREAM_CTX(ctx, data); if(!stream) { failf(data, "Internal NULL stream"); discard_newhandle(cf, newhandle); @@ -882,6 +976,10 @@ static int push_promise(struct Curl_cfilter *cf, goto fail; } + heads.data = data; + heads.stream = stream; + heads.frame = frame; + rv = set_transfer_url(newhandle, &heads); if(rv) { discard_newhandle(cf, newhandle); @@ -898,11 +996,11 @@ static int push_promise(struct Curl_cfilter *cf, } DEBUGASSERT(stream); - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); rv = data->multi->push_cb(data, newhandle, stream->push_headers_used, &heads, data->multi->push_userp); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); /* free the headers again */ free_push_headers(stream); @@ -938,6 +1036,10 @@ static int push_promise(struct Curl_cfilter *cf, rv = CURL_PUSH_DENY; goto fail; } + + /* success, remember max stream id processed */ + if(newstream->id > ctx->local_max_sid) + ctx->local_max_sid = newstream->id; } else { CURL_TRC_CF(data, cf, "Got PUSH_PROMISE, ignore it"); @@ -947,14 +1049,43 @@ fail: return rv; } -static CURLcode recvbuf_write_hds(struct Curl_cfilter *cf, +static void h2_xfer_write_resp_hd(struct Curl_cfilter *cf, struct Curl_easy *data, - const char *buf, size_t blen) + struct h2_stream_ctx *stream, + const char *buf, size_t blen, bool eos) { - bool done; - (void)cf; - return Curl_xfer_write_resp(data, (char *)buf, blen, FALSE, &done); + /* If we already encountered an error, skip further writes */ + if(!stream->xfer_result) { + stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos); + if(!stream->xfer_result && !eos) + stream->xfer_result = cf_h2_update_local_win(cf, data, stream, FALSE); + if(stream->xfer_result) + CURL_TRC_CF(data, cf, "[%d] error %d writing %zu bytes of headers", + stream->id, stream->xfer_result, blen); + } +} + +static void h2_xfer_write_resp(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h2_stream_ctx *stream, + const char *buf, size_t blen, bool eos) +{ + + /* If we already encountered an error, skip further writes */ + if(!stream->xfer_result) + stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos); + if(!stream->xfer_result && !eos) + stream->xfer_result = cf_h2_update_local_win(cf, data, stream, FALSE); + /* If the transfer write is errored, we do not want any more data */ + if(stream->xfer_result) { + struct cf_h2_ctx *ctx = cf->ctx; + CURL_TRC_CF(data, cf, "[%d] error %d writing %zu bytes of data, " + "RST-ing stream", + stream->id, stream->xfer_result, blen); + nghttp2_submit_rst_stream(ctx->h2, 0, stream->id, + (uint32_t)NGHTTP2_ERR_CALLBACK_FAILURE); + } } static CURLcode on_stream_frame(struct Curl_cfilter *cf, @@ -962,9 +1093,8 @@ static CURLcode on_stream_frame(struct Curl_cfilter *cf, const nghttp2_frame *frame) { struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); int32_t stream_id = frame->hd.stream_id; - CURLcode result; int rv; if(!stream) { @@ -989,13 +1119,10 @@ static CURLcode on_stream_frame(struct Curl_cfilter *cf, return CURLE_RECV_ERROR; } } - if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) { - drain_stream(cf, data, stream); - } break; case NGHTTP2_HEADERS: if(stream->bodystarted) { - /* Only valid HEADERS after body started is trailer HEADERS. We + /* Only valid HEADERS after body started is trailer HEADERS. We buffer them in on_header callback. */ break; } @@ -1007,14 +1134,12 @@ static CURLcode on_stream_frame(struct Curl_cfilter *cf, return CURLE_RECV_ERROR; /* Only final status code signals the end of header */ - if(stream->status_code / 100 != 1) { + if(stream->status_code / 100 != 1) stream->bodystarted = TRUE; + else stream->status_code = -1; - } - result = recvbuf_write_hds(cf, data, STRCONST("\r\n")); - if(result) - return result; + h2_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), stream->closed); if(stream->status_code / 100 != 1) { stream->resp_hds_complete = TRUE; @@ -1042,17 +1167,39 @@ static CURLcode on_stream_frame(struct Curl_cfilter *cf, if(frame->rst_stream.error_code) { stream->reset = TRUE; } - stream->send_closed = TRUE; drain_stream(cf, data, stream); break; case NGHTTP2_WINDOW_UPDATE: - if(CURL_WANT_SEND(data)) { + if(CURL_WANT_SEND(data) && Curl_bufq_is_empty(&stream->sendbuf)) { + /* need more data, force processing of transfer */ drain_stream(cf, data, stream); } + else if(!Curl_bufq_is_empty(&stream->sendbuf)) { + /* resume the potentially suspended stream */ + rv = nghttp2_session_resume_data(ctx->h2, stream->id); + if(nghttp2_is_fatal(rv)) + return CURLE_SEND_ERROR; + } break; default: break; } + + if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) { + if(!stream->closed && !stream->body_eos && + ((stream->status_code >= 400) || (stream->status_code < 200))) { + /* The server did not give us a positive response and we are not + * done uploading the request body. We need to stop doing that and + * also inform the server that we aborted our side. */ + CURL_TRC_CF(data, cf, "[%d] EOS frame with unfinished upload and " + "HTTP status %d, abort upload by RST", + stream_id, stream->status_code); + nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE, + stream->id, NGHTTP2_STREAM_CLOSED); + stream->closed = TRUE; + } + drain_stream(cf, data, stream); + } return CURLE_OK; } @@ -1107,14 +1254,14 @@ static int fr_print(const nghttp2_frame *frame, char *buffer, size_t blen) case NGHTTP2_GOAWAY: { char scratch[128]; size_t s_len = sizeof(scratch)/sizeof(scratch[0]); - 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 msnprintf(buffer, blen, "FRAME[GOAWAY, error=%d, reason='%s', " - "last_stream=%d]", frame->goaway.error_code, - scratch, frame->goaway.last_stream_id); + 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 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 msnprintf(buffer, blen, @@ -1193,7 +1340,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, * servers send an explicit WINDOW_UPDATE, but not all seem to do that. * To be safe, we UNHOLD a stream in order not to stall. */ if(CURL_WANT_SEND(data)) { - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); if(stream) drain_stream(cf, data, stream); } @@ -1201,12 +1348,12 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, break; } case NGHTTP2_GOAWAY: - ctx->goaway = TRUE; + ctx->rcvd_goaway = TRUE; ctx->goaway_error = frame->goaway.error_code; - ctx->last_stream_id = frame->goaway.last_stream_id; + ctx->remote_max_sid = frame->goaway.last_stream_id; if(data) { - infof(data, "received GOAWAY, error=%d, last_stream=%u", - ctx->goaway_error, ctx->last_stream_id); + infof(data, "received GOAWAY, error=%u, last_stream=%u", + ctx->goaway_error, ctx->remote_max_sid); Curl_multi_connchanged(data->multi); } break; @@ -1222,7 +1369,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, return 0; } - return on_stream_frame(cf, data_s, frame)? NGHTTP2_ERR_CALLBACK_FAILURE : 0; + return on_stream_frame(cf, data_s, frame) ? NGHTTP2_ERR_CALLBACK_FAILURE : 0; } static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags, @@ -1233,8 +1380,6 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags, struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream; struct Curl_easy *data_s; - CURLcode result; - bool done; (void)flags; DEBUGASSERT(stream_id); /* should never be a zero stream ID here */ @@ -1253,19 +1398,14 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags, return 0; } - stream = H2_STREAM_CTX(data_s); + stream = H2_STREAM_CTX(ctx, data_s); if(!stream) return NGHTTP2_ERR_CALLBACK_FAILURE; - result = Curl_xfer_write_resp(data_s, (char *)mem, len, FALSE, &done); - if(result && result != CURLE_AGAIN) - return NGHTTP2_ERR_CALLBACK_FAILURE; + h2_xfer_write_resp(cf, data_s, stream, (char *)mem, len, FALSE); nghttp2_session_consume(ctx->h2, stream_id, len); stream->nrcvd_data += (curl_off_t)len; - - /* if we receive data for another handle, wake that up */ - drain_stream(cf, data_s, stream); return 0; } @@ -1273,16 +1413,16 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id, uint32_t error_code, void *userp) { struct Curl_cfilter *cf = userp; + struct cf_h2_ctx *ctx = cf->ctx; struct Curl_easy *data_s, *call_data = CF_DATA_CURRENT(cf); struct h2_stream_ctx *stream; int rv; (void)session; DEBUGASSERT(call_data); - /* get the stream from the hash based on Stream ID, stream ID zero is for - connection-oriented stuff */ - data_s = stream_id? - nghttp2_session_get_stream_user_data(session, stream_id) : NULL; + /* stream id 0 is the connection, do not look there for streams. */ + data_s = stream_id ? + nghttp2_session_get_stream_user_data(session, stream_id) : NULL; if(!data_s) { CURL_TRC_CF(call_data, cf, "[%d] on_stream_close, no easy set on stream", stream_id); @@ -1297,7 +1437,7 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id, (void)nghttp2_session_set_stream_user_data(session, stream_id, 0); return NGHTTP2_ERR_CALLBACK_FAILURE; } - stream = H2_STREAM_CTX(data_s); + stream = H2_STREAM_CTX(ctx, data_s); if(!stream) { CURL_TRC_CF(data_s, cf, "[%d] on_stream_close, GOOD easy but no stream", stream_id); @@ -1308,7 +1448,6 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id, stream->error = error_code; if(stream->error) { stream->reset = TRUE; - stream->send_closed = TRUE; } if(stream->error) @@ -1332,6 +1471,7 @@ static int on_begin_headers(nghttp2_session *session, const nghttp2_frame *frame, void *userp) { struct Curl_cfilter *cf = userp; + struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream; struct Curl_easy *data_s = NULL; @@ -1345,7 +1485,7 @@ static int on_begin_headers(nghttp2_session *session, return 0; } - stream = H2_STREAM_CTX(data_s); + stream = H2_STREAM_CTX(ctx, data_s); if(!stream || !stream->bodystarted) { return 0; } @@ -1361,6 +1501,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, void *userp) { struct Curl_cfilter *cf = userp; + struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream; struct Curl_easy *data_s; int32_t stream_id = frame->hd.stream_id; @@ -1376,7 +1517,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, internal error more than anything else! */ return NGHTTP2_ERR_CALLBACK_FAILURE; - stream = H2_STREAM_CTX(data_s); + stream = H2_STREAM_CTX(ctx, data_s); if(!stream) { failf(data_s, "Internal NULL stream"); return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -1470,14 +1611,15 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, result = Curl_headers_push(data_s, buffer, CURLH_PSEUDO); if(result) return NGHTTP2_ERR_CALLBACK_FAILURE; - result = recvbuf_write_hds(cf, data_s, STRCONST("HTTP/2 ")); - if(result) - return NGHTTP2_ERR_CALLBACK_FAILURE; - result = recvbuf_write_hds(cf, data_s, (const char *)value, valuelen); - if(result) - return NGHTTP2_ERR_CALLBACK_FAILURE; - /* the space character after the status code is mandatory */ - result = recvbuf_write_hds(cf, data_s, STRCONST(" \r\n")); + Curl_dyn_reset(&ctx->scratch); + result = Curl_dyn_addn(&ctx->scratch, STRCONST("HTTP/2 ")); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, value, valuelen); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); + if(!result) + h2_xfer_write_resp_hd(cf, data_s, stream, Curl_dyn_ptr(&ctx->scratch), + Curl_dyn_len(&ctx->scratch), FALSE); if(result) return NGHTTP2_ERR_CALLBACK_FAILURE; /* if we receive data for another handle, wake that up */ @@ -1492,16 +1634,17 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, /* nghttp2 guarantees that namelen > 0, and :status was already received, and this is not pseudo-header field . */ /* convert to an HTTP1-style header */ - result = recvbuf_write_hds(cf, data_s, (const char *)name, namelen); - if(result) - return NGHTTP2_ERR_CALLBACK_FAILURE; - result = recvbuf_write_hds(cf, data_s, STRCONST(": ")); - if(result) - return NGHTTP2_ERR_CALLBACK_FAILURE; - result = recvbuf_write_hds(cf, data_s, (const char *)value, valuelen); - if(result) - return NGHTTP2_ERR_CALLBACK_FAILURE; - result = recvbuf_write_hds(cf, data_s, STRCONST("\r\n")); + Curl_dyn_reset(&ctx->scratch); + result = Curl_dyn_addn(&ctx->scratch, (const char *)name, namelen); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, STRCONST(": ")); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, (const char *)value, valuelen); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, STRCONST("\r\n")); + if(!result) + h2_xfer_write_resp_hd(cf, data_s, stream, Curl_dyn_ptr(&ctx->scratch), + Curl_dyn_len(&ctx->scratch), FALSE); if(result) return NGHTTP2_ERR_CALLBACK_FAILURE; /* if we receive data for another handle, wake that up */ @@ -1522,6 +1665,7 @@ static ssize_t req_body_read_callback(nghttp2_session *session, void *userp) { struct Curl_cfilter *cf = userp; + struct cf_h2_ctx *ctx = cf->ctx; struct Curl_easy *data_s; struct h2_stream_ctx *stream = NULL; CURLcode result; @@ -1529,22 +1673,21 @@ static ssize_t req_body_read_callback(nghttp2_session *session, (void)source; (void)cf; - if(stream_id) { - /* get the stream from the hash based on Stream ID, stream ID zero is for - connection-oriented stuff */ - data_s = nghttp2_session_get_stream_user_data(session, stream_id); - if(!data_s) - /* Receiving a Stream ID not in the hash should not happen, this is an - internal error more than anything else! */ - return NGHTTP2_ERR_CALLBACK_FAILURE; - - stream = H2_STREAM_CTX(data_s); - if(!stream) - return NGHTTP2_ERR_CALLBACK_FAILURE; - } - else + if(!stream_id) return NGHTTP2_ERR_INVALID_ARGUMENT; + /* get the stream from the hash based on Stream ID, stream ID zero is for + connection-oriented stuff */ + data_s = nghttp2_session_get_stream_user_data(session, stream_id); + if(!data_s) + /* Receiving a Stream ID not in the hash should not happen, this is an + internal error more than anything else! */ + return NGHTTP2_ERR_CALLBACK_FAILURE; + + stream = H2_STREAM_CTX(ctx, data_s); + if(!stream) + return NGHTTP2_ERR_CALLBACK_FAILURE; + nread = Curl_bufq_read(&stream->sendbuf, buf, length, &result); if(nread < 0) { if(result != CURLE_AGAIN) @@ -1552,19 +1695,14 @@ static ssize_t req_body_read_callback(nghttp2_session *session, nread = 0; } - if(nread > 0 && stream->upload_left != -1) - stream->upload_left -= nread; + CURL_TRC_CF(data_s, cf, "[%d] req_body_read(len=%zu) eos=%d -> %zd, %d", + stream_id, length, stream->body_eos, nread, result); - CURL_TRC_CF(data_s, cf, "[%d] req_body_read(len=%zu) left=%" - CURL_FORMAT_CURL_OFF_T " -> %zd, %d", - stream_id, length, stream->upload_left, nread, result); - - if(stream->upload_left == 0) + if(stream->body_eos && Curl_bufq_is_empty(&stream->sendbuf)) { *data_flags = NGHTTP2_DATA_FLAG_EOF; - else if(nread == 0) - return NGHTTP2_ERR_DEFERRED; - - return nread; + return nread; + } + return (nread == 0) ? NGHTTP2_ERR_DEFERRED : nread; } #if !defined(CURL_DISABLE_VERBOSE_STRINGS) @@ -1601,7 +1739,7 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req, return CURLE_FAILED_INIT; } - result = Curl_base64url_encode((const char *)binsettings, binlen, + result = Curl_base64url_encode((const char *)binsettings, (size_t)binlen, &base64, &blen); if(result) { Curl_dyn_free(req); @@ -1616,37 +1754,11 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req, free(base64); k->upgr101 = UPGR101_H2; + data->conn->bits.asks_multiplex = TRUE; return result; } -static CURLcode http2_data_done_send(struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - struct cf_h2_ctx *ctx = cf->ctx; - CURLcode result = CURLE_OK; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); - - if(!ctx || !ctx->h2 || !stream) - goto out; - - CURL_TRC_CF(data, cf, "[%d] data done send", stream->id); - if(!stream->send_closed) { - stream->send_closed = TRUE; - if(stream->upload_left) { - /* we now know that everything that is buffered is all there is. */ - stream->upload_left = Curl_bufq_len(&stream->sendbuf); - /* resume sending here to trigger the callback to get called again so - that it can signal EOF to nghttp2 */ - (void)nghttp2_session_resume_data(ctx->h2, stream->id); - drain_stream(cf, data, stream); - } - } - -out: - return result; -} - static ssize_t http2_handle_stream_close(struct Curl_cfilter *cf, struct Curl_easy *data, struct h2_stream_ctx *stream, @@ -1657,12 +1769,21 @@ static ssize_t http2_handle_stream_close(struct Curl_cfilter *cf, if(stream->error == NGHTTP2_REFUSED_STREAM) { CURL_TRC_CF(data, cf, "[%d] REFUSED_STREAM, try again on a new " "connection", stream->id); - connclose(cf->conn, "REFUSED_STREAM"); /* don't use this anymore */ + connclose(cf->conn, "REFUSED_STREAM"); /* do not use this anymore */ data->state.refused_stream = TRUE; *err = CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */ return -1; } else if(stream->error != NGHTTP2_NO_ERROR) { + if(stream->resp_hds_complete && data->req.no_body) { + CURL_TRC_CF(data, cf, "[%d] error after response headers, but we did " + "not want a body anyway, ignore: %s (err %u)", + stream->id, nghttp2_http2_strerror(stream->error), + stream->error); + stream->close_handled = TRUE; + *err = CURLE_OK; + goto out; + } failf(data, "HTTP/2 stream %u was not closed cleanly: %s (err %u)", stream->id, nghttp2_http2_strerror(stream->error), stream->error); @@ -1671,7 +1792,7 @@ static ssize_t http2_handle_stream_close(struct Curl_cfilter *cf, } else if(stream->reset) { failf(data, "HTTP/2 stream %u was reset", stream->id); - *err = stream->bodystarted? CURLE_PARTIAL_FILE : CURLE_RECV_ERROR; + *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP2; return -1; } @@ -1724,14 +1845,14 @@ out: static int sweight_wanted(const struct Curl_easy *data) { /* 0 weight is not set by user and we take the nghttp2 default one */ - return data->set.priority.weight? + return data->set.priority.weight ? data->set.priority.weight : NGHTTP2_DEFAULT_WEIGHT; } static int sweight_in_effect(const struct Curl_easy *data) { /* 0 weight is not set by user and we take the nghttp2 default one */ - return data->state.priority.weight? + return data->state.priority.weight ? data->state.priority.weight : NGHTTP2_DEFAULT_WEIGHT; } @@ -1741,12 +1862,13 @@ static int sweight_in_effect(const struct Curl_easy *data) * struct. */ -static void h2_pri_spec(struct Curl_easy *data, +static void h2_pri_spec(struct cf_h2_ctx *ctx, + struct Curl_easy *data, nghttp2_priority_spec *pri_spec) { struct Curl_data_priority *prio = &data->set.priority; - struct h2_stream_ctx *depstream = H2_STREAM_CTX(prio->parent); - int32_t depstream_id = depstream? depstream->id:0; + struct h2_stream_ctx *depstream = H2_STREAM_CTX(ctx, prio->parent); + int32_t depstream_id = depstream ? depstream->id : 0; nghttp2_priority_spec_init(pri_spec, depstream_id, sweight_wanted(data), data->set.priority.exclusive); @@ -1754,7 +1876,7 @@ static void h2_pri_spec(struct Curl_easy *data, } /* - * Check if there's been an update in the priority / + * Check if there is been an update in the priority / * dependency settings and if so it submits a PRIORITY frame with the updated * info. * Flush any out data pending in the network buffer. @@ -1763,7 +1885,7 @@ static CURLcode h2_progress_egress(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); int rv = 0; if(stream && stream->id > 0 && @@ -1773,7 +1895,7 @@ static CURLcode h2_progress_egress(struct Curl_cfilter *cf, /* send new weight and/or dependency */ nghttp2_priority_spec pri_spec; - h2_pri_spec(data, &pri_spec); + h2_pri_spec(ctx, data, &pri_spec); CURL_TRC_CF(data, cf, "[%d] Queuing PRIORITY", stream->id); DEBUGASSERT(stream->id != -1); rv = nghttp2_submit_priority(ctx->h2, NGHTTP2_FLAG_NONE, @@ -1792,6 +1914,11 @@ out: nghttp2_strerror(rv), rv); return CURLE_SEND_ERROR; } + /* Defer flushing during the connect phase so that the SETTINGS and + * other initial frames are sent together with the first request. + * Unless we are 'connect_only' where the request will never come. */ + if(!cf->connected && !cf->conn->connect_only) + return CURLE_OK; return nw_out_flush(cf, data); } @@ -1804,15 +1931,20 @@ static ssize_t stream_recv(struct Curl_cfilter *cf, struct Curl_easy *data, (void)buf; *err = CURLE_AGAIN; - if(stream->closed) { + if(stream->xfer_result) { + CURL_TRC_CF(data, cf, "[%d] xfer write failed", stream->id); + *err = stream->xfer_result; + nread = -1; + } + else if(stream->closed) { CURL_TRC_CF(data, cf, "[%d] returning CLOSE", stream->id); nread = http2_handle_stream_close(cf, data, stream, err); } else if(stream->reset || (ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) || - (ctx->goaway && ctx->last_stream_id < stream->id)) { + (ctx->rcvd_goaway && ctx->remote_max_sid < stream->id)) { CURL_TRC_CF(data, cf, "[%d] returning ERR", stream->id); - *err = stream->bodystarted? CURLE_PARTIAL_FILE : CURLE_RECV_ERROR; + *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP2; nread = -1; } @@ -1843,7 +1975,7 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf, * it is time to stop due to connection close or us not processing * all network input */ while(!ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) { - stream = H2_STREAM_CTX(data); + stream = H2_STREAM_CTX(ctx, data); if(stream && (stream->closed || !data_max_bytes)) { /* We would like to abort here and stop processing, so that * the transfer loop can handle the data/close here. However, @@ -1870,18 +2002,21 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf, } else { CURL_TRC_CF(data, cf, "[0] ingress: read %zd bytes", nread); - data_max_bytes = (data_max_bytes > (size_t)nread)? - (data_max_bytes - (size_t)nread) : 0; + data_max_bytes = (data_max_bytes > (size_t)nread) ? + (data_max_bytes - (size_t)nread) : 0; } if(h2_process_pending_input(cf, data, &result)) return result; + CURL_TRC_CF(data, cf, "[0] progress ingress: inbufg=%zu", + Curl_bufq_len(&ctx->inbufq)); } if(ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) { connclose(cf->conn, "GOAWAY received"); } + CURL_TRC_CF(data, cf, "[0] progress ingress: done"); return CURLE_OK; } @@ -1889,7 +2024,7 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err) { struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); ssize_t nread = -1; CURLcode result; struct cf_call_data save; @@ -1899,9 +2034,8 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, * (unlikely) or the transfer has been done, cleaned up its resources, but * a read() is called anyway. It is not clear what the calling sequence * is for such a case. */ - failf(data, "[%zd-%zd], http/2 recv on a transfer never opened " - "or already cleared", (ssize_t)data->id, - (ssize_t)cf->conn->connection_id); + failf(data, "http/2 recv on a transfer never opened " + "or already cleared, mid=%" FMT_OFF_T, data->mid); *err = CURLE_HTTP2; return -1; } @@ -1947,11 +2081,11 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, out: result = h2_progress_egress(cf, data); if(result == CURLE_AGAIN) { - /* pending data to send, need to be called again. Ideally, we'd - * monitor the socket for POLLOUT, but we might not be in SENDING - * transfer state any longer and are unable to make this happen. - */ - drain_stream(cf, data, stream); + /* pending data to send, need to be called again. Ideally, we + * monitor the socket for POLLOUT, but when not SENDING + * any more, we force processing of the transfer. */ + if(!CURL_WANT_SEND(data)) + drain_stream(cf, data, stream); } else if(result) { *err = result; @@ -1971,9 +2105,57 @@ out: return nread; } +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) +{ + struct cf_h2_ctx *ctx = cf->ctx; + ssize_t nwritten; + + if(stream->closed) { + if(stream->resp_hds_complete) { + /* Server decided to close the stream after having sent us a final + * response. This is valid if it is not interested in the request + * 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, "[%d] discarding data" + "on closed stream with response", stream->id); + if(eos) + stream->body_eos = TRUE; + *err = CURLE_OK; + return (ssize_t)blen; + } + /* Server closed before we got a response, this is an error */ + infof(data, "stream %u closed", stream->id); + *err = CURLE_SEND_ERROR; + return -1; + } + + nwritten = Curl_bufq_write(&stream->sendbuf, buf, blen, err); + if(nwritten < 0) + return -1; + + if(eos && (blen == (size_t)nwritten)) + 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; + } + } + return nwritten; +} + static ssize_t h2_submit(struct h2_stream_ctx **pstream, struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, + bool eos, CURLcode *err) { struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream = NULL; @@ -2018,7 +2200,7 @@ static ssize_t h2_submit(struct h2_stream_ctx **pstream, goto out; } - h2_pri_spec(data, &pri_spec); + h2_pri_spec(ctx, data, &pri_spec); if(!nghttp2_session_check_request_allowed(ctx->h2)) CURL_TRC_CF(data, cf, "send request NOT allowed (via nghttp2)"); @@ -2027,19 +2209,12 @@ static ssize_t h2_submit(struct h2_stream_ctx **pstream, case HTTPREQ_POST_FORM: case HTTPREQ_POST_MIME: case HTTPREQ_PUT: - if(data->state.infilesize != -1) - stream->upload_left = data->state.infilesize; - else - /* data sending without specifying the data amount up front */ - stream->upload_left = -1; /* unknown */ - data_prd.read_callback = req_body_read_callback; data_prd.source.ptr = NULL; stream_id = nghttp2_submit_request(ctx->h2, &pri_spec, nva, nheader, &data_prd, data); break; default: - stream->upload_left = 0; /* no request body */ stream_id = nghttp2_submit_request(ctx->h2, &pri_spec, nva, nheader, NULL, data); } @@ -2074,37 +2249,26 @@ static ssize_t h2_submit(struct h2_stream_ctx **pstream, } stream->id = stream_id; - stream->local_window_size = H2_STREAM_WINDOW_SIZE; - if(data->set.max_recv_speed) { - /* We are asked to only receive `max_recv_speed` bytes per second. - * Let's limit our stream window size around that, otherwise the server - * will send in large bursts only. We make the window 50% larger to - * allow for data in flight and avoid stalling. */ - curl_off_t n = (((data->set.max_recv_speed - 1) / H2_CHUNK_SIZE) + 1); - n += CURLMAX((n/2), 1); - if(n < (H2_STREAM_WINDOW_SIZE / H2_CHUNK_SIZE) && - n < (UINT_MAX / H2_CHUNK_SIZE)) { - stream->local_window_size = (uint32_t)n * H2_CHUNK_SIZE; - } - } body = (const char *)buf + nwritten; bodylen = len - nwritten; - if(bodylen) { - /* We have request body to send in DATA frame */ - ssize_t n = Curl_bufq_write(&stream->sendbuf, body, bodylen, err); - if(n < 0) { + if(bodylen || eos) { + ssize_t n = cf_h2_body_send(cf, data, stream, body, bodylen, eos, err); + if(n >= 0) + nwritten += n; + else if(*err == CURLE_AGAIN) + *err = CURLE_OK; + else if(*err != CURLE_AGAIN) { *err = CURLE_SEND_ERROR; nwritten = -1; goto out; } - nwritten += n; } out: CURL_TRC_CF(data, cf, "[%d] submit -> %zd, %d", - stream? stream->id : -1, nwritten, *err); + stream ? stream->id : -1, nwritten, *err); Curl_safefree(nva); *pstream = stream; Curl_dynhds_free(&h2_headers); @@ -2112,129 +2276,63 @@ out: } static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); struct cf_call_data save; - int rv; ssize_t nwritten; CURLcode result; - int blocked = 0, was_blocked = 0; CF_DATA_SAVE(save, cf, data); - if(stream && stream->id != -1) { - if(stream->upload_blocked_len) { - /* the data in `buf` has already been submitted or added to the - * buffers, but have been EAGAINed on the last invocation. */ - /* TODO: this assertion triggers in OSSFuzz runs and it is not - * clear why. Disable for now to let OSSFuzz continue its tests. */ - DEBUGASSERT(len >= stream->upload_blocked_len); - if(len < stream->upload_blocked_len) { - /* Did we get called again with a smaller `len`? This should not - * happen. We are not prepared to handle that. */ - failf(data, "HTTP/2 send again with decreased length (%zd vs %zd)", - len, stream->upload_blocked_len); - *err = CURLE_HTTP2; - nwritten = -1; - goto out; - } - nwritten = (ssize_t)stream->upload_blocked_len; - stream->upload_blocked_len = 0; - was_blocked = 1; - } - else if(stream->closed) { - if(stream->resp_hds_complete) { - /* Server decided to close the stream after having sent us a findl - * response. This is valid if it is not interested in the request - * 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, "[%d] discarding data" - "on closed stream with response", stream->id); - *err = CURLE_OK; - nwritten = (ssize_t)len; - goto out; - } - infof(data, "stream %u closed", stream->id); - *err = CURLE_SEND_ERROR; - nwritten = -1; - goto out; - } - else { - /* If stream_id != -1, we have dispatched request HEADERS and - * optionally request body, and now are going to send or sending - * more request body in DATA frame */ - nwritten = Curl_bufq_write(&stream->sendbuf, buf, len, err); - if(nwritten < 0 && *err != CURLE_AGAIN) - goto out; - } - - if(!Curl_bufq_is_empty(&stream->sendbuf)) { - /* req body data is buffered, resume the potentially suspended stream */ - rv = nghttp2_session_resume_data(ctx->h2, stream->id); - if(nghttp2_is_fatal(rv)) { - *err = CURLE_SEND_ERROR; - nwritten = -1; - goto out; - } - } - } - else { - nwritten = h2_submit(&stream, cf, data, buf, len, err); + if(!stream || stream->id == -1) { + nwritten = h2_submit(&stream, cf, data, buf, len, eos, err); if(nwritten < 0) { goto out; } DEBUGASSERT(stream); } + else if(stream->body_eos) { + /* We already wrote this, but CURLE_AGAINed the call due to not + * 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. */ + DEBUGASSERT(eos); + nwritten = cf_h2_body_send(cf, data, stream, buf, 0, eos, err); + CURL_TRC_CF(data, cf, "[%d] cf_body_send last CHUNK -> %zd, %d, eos=%d", + stream->id, nwritten, *err, eos); + if(nwritten < 0) { + goto out; + } + nwritten = len; + } + else { + nwritten = cf_h2_body_send(cf, data, stream, buf, len, eos, err); + CURL_TRC_CF(data, cf, "[%d] cf_body_send(len=%zu) -> %zd, %d, eos=%d", + stream->id, len, nwritten, *err, eos); + } /* Call the nghttp2 send loop and flush to write ALL buffered data, * headers and/or request body completely out to the network */ result = h2_progress_egress(cf, data); + /* if the stream has been closed in egress handling (nghttp2 does that * when it does not like the headers, for example */ - if(stream && stream->closed && !was_blocked) { + if(stream && stream->closed) { infof(data, "stream %u closed", stream->id); *err = CURLE_SEND_ERROR; nwritten = -1; goto out; } - else if(result == CURLE_AGAIN) { - blocked = 1; - } - else if(result) { + else if(result && (result != CURLE_AGAIN)) { *err = result; nwritten = -1; goto out; } - else if(stream && !Curl_bufq_is_empty(&stream->sendbuf)) { - /* although we wrote everything that nghttp2 wants to send now, - * there is data left in our stream send buffer unwritten. This may - * be due to the stream's HTTP/2 flow window being exhausted. */ - blocked = 1; - } - if(stream && blocked && nwritten > 0) { - /* Unable to send all data, due to connection blocked or H2 window - * exhaustion. Data is left in our stream buffer, or nghttp2's internal - * frame buffer or our network out buffer. */ - size_t rwin = nghttp2_session_get_stream_remote_window_size(ctx->h2, - stream->id); - /* Whatever the cause, we need to return CURL_EAGAIN for this call. - * We have unwritten state that needs us being invoked again and EAGAIN - * is the only way to ensure that. */ - stream->upload_blocked_len = nwritten; - CURL_TRC_CF(data, cf, "[%d] cf_send(len=%zu) BLOCK: win %u/%zu " - "blocked_len=%zu", - stream->id, len, - nghttp2_session_get_remote_window_size(ctx->h2), rwin, - nwritten); - *err = CURLE_AGAIN; - nwritten = -1; - goto out; - } - else if(should_close_session(ctx)) { + if(should_close_session(ctx)) { /* nghttp2 thinks this session is done. If the stream has not been * closed, this is an error state for out transfer */ if(stream->closed) { @@ -2250,11 +2348,10 @@ static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, out: if(stream) { CURL_TRC_CF(data, cf, "[%d] cf_send(len=%zu) -> %zd, %d, " - "upload_left=%" CURL_FORMAT_CURL_OFF_T ", " - "h2 windows %d-%d (stream-conn), " + "eos=%d, h2 windows %d-%d (stream-conn), " "buffers %zu-%zu (stream-conn)", stream->id, len, nwritten, *err, - stream->upload_left, + stream->body_eos, nghttp2_session_get_stream_remote_window_size( ctx->h2, stream->id), nghttp2_session_get_remote_window_size(ctx->h2), @@ -2272,11 +2369,54 @@ out: return nwritten; } +static CURLcode cf_h2_flush(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; + CURLcode result = CURLE_OK; + + CF_DATA_SAVE(save, cf, data); + if(stream && !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)) { + result = CURLE_SEND_ERROR; + goto out; + } + } + + result = h2_progress_egress(cf, data); + +out: + if(stream) { + CURL_TRC_CF(data, cf, "[%d] flush -> %d, " + "h2 windows %d-%d (stream-conn), " + "buffers %zu-%zu (stream-conn)", + stream->id, result, + nghttp2_session_get_stream_remote_window_size( + ctx->h2, stream->id), + nghttp2_session_get_remote_window_size(ctx->h2), + Curl_bufq_len(&stream->sendbuf), + Curl_bufq_len(&ctx->outbufq)); + } + else { + CURL_TRC_CF(data, cf, "flush -> %d, " + "connection-window=%d, nw_send_buffer(%zu)", + result, nghttp2_session_get_remote_window_size(ctx->h2), + Curl_bufq_len(&ctx->outbufq)); + } + CF_DATA_RESTORE(cf, save); + return result; +} + static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, struct easy_pollset *ps) { struct cf_h2_ctx *ctx = cf->ctx; + struct cf_call_data save; curl_socket_t sock; bool want_recv, want_send; @@ -2286,8 +2426,7 @@ static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, sock = Curl_conn_cf_get_socket(cf, data); Curl_pollset_check(data, ps, sock, &want_recv, &want_send); if(want_recv || want_send) { - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); - struct cf_call_data save; + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); bool c_exhaust, s_exhaust; CF_DATA_SAVE(save, cf, data); @@ -2297,11 +2436,21 @@ static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, stream->id); want_recv = (want_recv || c_exhaust || s_exhaust); want_send = (!s_exhaust && want_send) || - (!c_exhaust && nghttp2_session_want_write(ctx->h2)); + (!c_exhaust && nghttp2_session_want_write(ctx->h2)) || + !Curl_bufq_is_empty(&ctx->outbufq); Curl_pollset_set(data, ps, sock, want_recv, want_send); CF_DATA_RESTORE(cf, save); } + else if(ctx->sent_goaway && !cf->shutdown) { + /* shutdown in progress */ + CF_DATA_SAVE(save, cf, data); + want_send = nghttp2_session_want_write(ctx->h2) || + !Curl_bufq_is_empty(&ctx->outbufq); + want_recv = nghttp2_session_want_read(ctx->h2); + Curl_pollset_set(data, ps, sock, want_recv, want_send); + CF_DATA_RESTORE(cf, save); + } } static CURLcode cf_h2_connect(struct Curl_cfilter *cf, @@ -2311,6 +2460,7 @@ static CURLcode cf_h2_connect(struct Curl_cfilter *cf, struct cf_h2_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; struct cf_call_data save; + bool first_time = FALSE; if(cf->connected) { *done = TRUE; @@ -2327,16 +2477,20 @@ static CURLcode cf_h2_connect(struct Curl_cfilter *cf, *done = FALSE; CF_DATA_SAVE(save, cf, data); + DEBUGASSERT(ctx->initialized); if(!ctx->h2) { - result = cf_h2_ctx_init(cf, data, FALSE); + result = cf_h2_ctx_open(cf, data); + if(result) + goto out; + first_time = TRUE; + } + + if(!first_time) { + result = h2_progress_ingress(cf, data, H2_CHUNK_SIZE); if(result) goto out; } - result = h2_progress_ingress(cf, data, H2_CHUNK_SIZE); - if(result) - goto out; - /* Send out our SETTINGS and ACKs and such. If that blocks, we * have it buffered and can count this filter as being connected */ result = h2_progress_egress(cf, data); @@ -2363,8 +2517,9 @@ static void cf_h2_close(struct Curl_cfilter *cf, struct Curl_easy *data) struct cf_call_data save; CF_DATA_SAVE(save, cf, data); - cf_h2_ctx_clear(ctx); + cf_h2_ctx_close(ctx); CF_DATA_RESTORE(cf, save); + cf->connected = FALSE; } if(cf->next) cf->next->cft->do_close(cf->next, data); @@ -2381,30 +2536,68 @@ static void cf_h2_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) } } +static CURLcode cf_h2_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + struct cf_h2_ctx *ctx = cf->ctx; + struct cf_call_data save; + CURLcode result; + int rv; + + if(!cf->connected || !ctx->h2 || cf->shutdown || ctx->conn_closed) { + *done = TRUE; + return CURLE_OK; + } + + CF_DATA_SAVE(save, cf, data); + + if(!ctx->sent_goaway) { + rv = nghttp2_submit_goaway(ctx->h2, NGHTTP2_FLAG_NONE, + ctx->local_max_sid, 0, + (const uint8_t *)"shutdown", + sizeof("shutdown")); + if(rv) { + failf(data, "nghttp2_submit_goaway() failed: %s(%d)", + nghttp2_strerror(rv), rv); + result = CURLE_SEND_ERROR; + goto out; + } + ctx->sent_goaway = TRUE; + } + /* GOAWAY submitted, process egress and ingress until nghttp2 is done. */ + result = CURLE_OK; + if(nghttp2_session_want_write(ctx->h2) || + !Curl_bufq_is_empty(&ctx->outbufq)) + result = h2_progress_egress(cf, data); + if(!result && nghttp2_session_want_read(ctx->h2)) + result = h2_progress_ingress(cf, data, 0); + + if(result == CURLE_AGAIN) + result = CURLE_OK; + + *done = (ctx->conn_closed || + (!result && !nghttp2_session_want_write(ctx->h2) && + !nghttp2_session_want_read(ctx->h2) && + Curl_bufq_is_empty(&ctx->outbufq))); + +out: + CF_DATA_RESTORE(cf, save); + cf->shutdown = (result || *done); + return result; +} + static CURLcode http2_data_pause(struct Curl_cfilter *cf, struct Curl_easy *data, bool pause) { -#ifdef NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); DEBUGASSERT(data); if(ctx && ctx->h2 && stream) { - uint32_t window = pause? 0 : stream->local_window_size; - - int rv = nghttp2_session_set_local_window_size(ctx->h2, - NGHTTP2_FLAG_NONE, - stream->id, - window); - if(rv) { - failf(data, "nghttp2_session_set_local_window_size() failed: %s(%d)", - nghttp2_strerror(rv), rv); - return CURLE_HTTP2; - } - - if(!pause) - drain_stream(cf, data, stream); + CURLcode result = cf_h2_update_local_win(cf, data, stream, pause); + if(result) + return result; /* attempt to send the window update */ (void)h2_progress_egress(cf, data); @@ -2418,21 +2611,9 @@ static CURLcode http2_data_pause(struct Curl_cfilter *cf, drain_stream(cf, data, stream); Curl_expire(data, 0, EXPIRE_RUN_NOW); } - DEBUGF(infof(data, "Set HTTP/2 window size to %u for stream %u", - window, stream->id)); - -#ifdef DEBUGBUILD - { - /* read out the stream local window again */ - uint32_t window2 = - nghttp2_session_get_stream_local_window_size(ctx->h2, - stream->id); - DEBUGF(infof(data, "HTTP/2 window size is now %u for stream %u", - window2, stream->id)); - } -#endif + CURL_TRC_CF(data, cf, "[%d] stream now %spaused", stream->id, + pause ? "" : "un"); } -#endif return CURLE_OK; } @@ -2452,14 +2633,14 @@ static CURLcode cf_h2_cntrl(struct Curl_cfilter *cf, case CF_CTRL_DATA_PAUSE: result = http2_data_pause(cf, data, (arg1 != 0)); break; - case CF_CTRL_DATA_DONE_SEND: - result = http2_data_done_send(cf, data); + case CF_CTRL_FLUSH: + result = cf_h2_flush(cf, data); break; case CF_CTRL_DATA_DETACH: - http2_data_done(cf, data, TRUE); + http2_data_done(cf, data); break; case CF_CTRL_DATA_DONE: - http2_data_done(cf, data, arg1 != 0); + http2_data_done(cf, data); break; default: break; @@ -2472,12 +2653,12 @@ static bool cf_h2_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { struct cf_h2_ctx *ctx = cf->ctx; - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); if(ctx && (!Curl_bufq_is_empty(&ctx->inbufq) || (stream && !Curl_bufq_is_empty(&stream->sendbuf)))) return TRUE; - return cf->next? cf->next->cft->has_data_pending(cf->next, data) : FALSE; + return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE; } static bool cf_h2_is_alive(struct Curl_cfilter *cf, @@ -2528,13 +2709,27 @@ static CURLcode cf_h2_query(struct Curl_cfilter *cf, else { effective_max = ctx->max_concurrent_streams; } - *pres1 = (effective_max > INT_MAX)? INT_MAX : (int)effective_max; + *pres1 = (effective_max > INT_MAX) ? INT_MAX : (int)effective_max; CF_DATA_RESTORE(cf, save); return CURLE_OK; + case CF_QUERY_STREAM_ERROR: { + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); + *pres1 = stream ? (int)stream->error : 0; + return CURLE_OK; + } + case CF_QUERY_NEED_FLUSH: { + struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); + if(!Curl_bufq_is_empty(&ctx->outbufq) || + (stream && !Curl_bufq_is_empty(&stream->sendbuf))) { + *pres1 = TRUE; + return CURLE_OK; + } + break; + } default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -2546,6 +2741,7 @@ struct Curl_cftype Curl_cft_nghttp2 = { cf_h2_destroy, cf_h2_connect, cf_h2_close, + cf_h2_shutdown, Curl_cf_def_get_host, cf_h2_adjust_pollset, cf_h2_data_pending, @@ -2571,6 +2767,7 @@ static CURLcode http2_cfilter_add(struct Curl_cfilter **pcf, ctx = calloc(1, sizeof(*ctx)); if(!ctx) goto out; + cf_h2_ctx_init(ctx, via_h1_upgrade); result = Curl_cf_create(&cf, &Curl_cft_nghttp2, ctx); if(result) @@ -2578,12 +2775,11 @@ static CURLcode http2_cfilter_add(struct Curl_cfilter **pcf, ctx = NULL; Curl_conn_cf_add(data, conn, sockindex, cf); - result = cf_h2_ctx_init(cf, data, via_h1_upgrade); out: if(result) cf_h2_ctx_free(ctx); - *pcf = result? NULL : cf; + *pcf = result ? NULL : cf; return result; } @@ -2599,6 +2795,7 @@ static CURLcode http2_cfilter_insert_after(struct Curl_cfilter *cf, ctx = calloc(1, sizeof(*ctx)); if(!ctx) goto out; + cf_h2_ctx_init(ctx, via_h1_upgrade); result = Curl_cf_create(&cf_h2, &Curl_cft_nghttp2, ctx); if(result) @@ -2606,7 +2803,6 @@ static CURLcode http2_cfilter_insert_after(struct Curl_cfilter *cf, ctx = NULL; Curl_conn_cf_insert_after(cf, cf_h2); - result = cf_h2_ctx_init(cf_h2, data, via_h1_upgrade); out: if(result) @@ -2614,8 +2810,8 @@ out: return result; } -static bool Curl_cf_is_http2(struct Curl_cfilter *cf, - const struct Curl_easy *data) +static bool cf_is_http2(struct Curl_cfilter *cf, + const struct Curl_easy *data) { (void)data; for(; cf; cf = cf->next) { @@ -2631,7 +2827,7 @@ bool Curl_conn_is_http2(const struct Curl_easy *data, const struct connectdata *conn, int sockindex) { - return conn? Curl_cf_is_http2(conn->cfilter[sockindex], data) : FALSE; + return conn ? cf_is_http2(conn->cfilter[sockindex], data) : FALSE; } bool Curl_http2_may_switch(struct Curl_easy *data, @@ -2643,7 +2839,7 @@ bool Curl_http2_may_switch(struct Curl_easy *data, data->state.httpwant == CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE) { #ifndef CURL_DISABLE_PROXY if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) { - /* We don't support HTTP/2 proxies yet. Also it's debatable + /* We do not support HTTP/2 proxies yet. Also it is debatable whether or not this setting should apply to HTTP/2 proxies. */ infof(data, "Ignoring HTTP/2 prior knowledge due to proxy"); return FALSE; @@ -2661,15 +2857,14 @@ CURLcode Curl_http2_switch(struct Curl_easy *data, CURLcode result; DEBUGASSERT(!Curl_conn_is_http2(data, conn, sockindex)); - DEBUGF(infof(data, "switching to HTTP/2")); result = http2_cfilter_add(&cf, data, conn, sockindex, FALSE); if(result) return result; + CURL_TRC_CF(data, cf, "switching connection to HTTP/2"); - conn->httpversion = 20; /* we know we're on HTTP/2 now */ + conn->httpversion = 20; /* we know we are on HTTP/2 now */ conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ - conn->bundle->multiuse = BUNDLE_MULTIPLEX; Curl_multi_connchanged(data->multi); if(cf->next) { @@ -2684,16 +2879,15 @@ CURLcode Curl_http2_switch_at(struct Curl_cfilter *cf, struct Curl_easy *data) struct Curl_cfilter *cf_h2; CURLcode result; - DEBUGASSERT(!Curl_cf_is_http2(cf, data)); + DEBUGASSERT(!cf_is_http2(cf, data)); result = http2_cfilter_insert_after(cf, data, FALSE); if(result) return result; cf_h2 = cf->next; - cf->conn->httpversion = 20; /* we know we're on HTTP/2 now */ + cf->conn->httpversion = 20; /* we know we are on HTTP/2 now */ cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ - cf->conn->bundle->multiuse = BUNDLE_MULTIPLEX; Curl_multi_connchanged(data->multi); if(cf_h2->next) { @@ -2712,12 +2906,12 @@ CURLcode Curl_http2_upgrade(struct Curl_easy *data, CURLcode result; DEBUGASSERT(!Curl_conn_is_http2(data, conn, sockindex)); - DEBUGF(infof(data, "upgrading to HTTP/2")); DEBUGASSERT(data->req.upgr101 == UPGR101_RECEIVED); result = http2_cfilter_add(&cf, data, conn, sockindex, TRUE); if(result) return result; + CURL_TRC_CF(data, cf, "upgrading connection to HTTP/2"); DEBUGASSERT(cf->cft == &Curl_cft_nghttp2); ctx = cf->ctx; @@ -2744,9 +2938,8 @@ CURLcode Curl_http2_upgrade(struct Curl_easy *data, " after upgrade: len=%zu", nread); } - conn->httpversion = 20; /* we know we're on HTTP/2 now */ + conn->httpversion = 20; /* we know we are on HTTP/2 now */ conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ - conn->bundle->multiuse = BUNDLE_MULTIPLEX; Curl_multi_connchanged(data->multi); if(cf->next) { @@ -2760,8 +2953,11 @@ CURLcode Curl_http2_upgrade(struct Curl_easy *data, CURLE_HTTP2_STREAM error! */ bool Curl_h2_http_1_1_error(struct Curl_easy *data) { - struct h2_stream_ctx *stream = H2_STREAM_CTX(data); - return (stream && stream->error == NGHTTP2_HTTP_1_1_REQUIRED); + if(Curl_conn_is_http2(data, data->conn, FIRSTSOCKET)) { + int err = Curl_conn_get_stream_error(data, data->conn, FIRSTSOCKET); + return (err == NGHTTP2_HTTP_1_1_REQUIRED); + } + return FALSE; } #else /* !USE_NGHTTP2 */ diff --git a/deps/curl/lib/http_aws_sigv4.c b/deps/curl/lib/http_aws_sigv4.c index c9382918..5d4848fe 100644 --- a/deps/curl/lib/http_aws_sigv4.c +++ b/deps/curl/lib/http_aws_sigv4.c @@ -47,7 +47,7 @@ #define HMAC_SHA256(k, kl, d, dl, o) \ do { \ - result = Curl_hmacit(Curl_HMAC_SHA256, \ + result = Curl_hmacit(&Curl_HMAC_SHA256, \ (unsigned char *)k, \ kl, \ (unsigned char *)d, \ @@ -60,11 +60,11 @@ #define TIMESTAMP_SIZE 17 /* hex-encoded with trailing null */ -#define SHA256_HEX_LENGTH (2 * SHA256_DIGEST_LENGTH + 1) +#define SHA256_HEX_LENGTH (2 * CURL_SHA256_DIGEST_LENGTH + 1) static void sha256_to_hex(char *dst, unsigned char *sha) { - Curl_hexencode(sha, SHA256_DIGEST_LENGTH, + Curl_hexencode(sha, CURL_SHA256_DIGEST_LENGTH, (unsigned char *)dst, SHA256_HEX_LENGTH); } @@ -122,13 +122,40 @@ static void trim_headers(struct curl_slist *head) #define DATE_HDR_KEY_LEN (MAX_SIGV4_LEN + sizeof("X--Date")) -#define MAX_HOST_LEN 255 -/* FQDN + host: */ -#define FULL_HOST_LEN (MAX_HOST_LEN + sizeof("host:")) - /* string been x-PROVIDER-date:TIMESTAMP, I need +1 for ':' */ #define DATE_FULL_HDR_LEN (DATE_HDR_KEY_LEN + TIMESTAMP_SIZE + 1) +/* alphabetically compare two headers by their name, expecting + headers to use ':' at this point */ +static int compare_header_names(const char *a, const char *b) +{ + const char *colon_a; + const char *colon_b; + size_t len_a; + size_t len_b; + size_t min_len; + int cmp; + + colon_a = strchr(a, ':'); + colon_b = strchr(b, ':'); + + DEBUGASSERT(colon_a); + DEBUGASSERT(colon_b); + + len_a = colon_a ? (size_t)(colon_a - a) : strlen(a); + len_b = colon_b ? (size_t)(colon_b - b) : strlen(b); + + min_len = (len_a < len_b) ? len_a : len_b; + + cmp = strncmp(a, b, min_len); + + /* return the shorter of the two if one is shorter */ + if(!cmp) + return (int)(len_a - len_b); + + return cmp; +} + /* timestamp should point to a buffer of at last TIMESTAMP_SIZE bytes */ static CURLcode make_headers(struct Curl_easy *data, const char *hostname, @@ -145,7 +172,7 @@ static CURLcode make_headers(struct Curl_easy *data, struct curl_slist *tmp_head = NULL; CURLcode ret = CURLE_OUT_OF_MEMORY; struct curl_slist *l; - int again = 1; + bool again = TRUE; /* provider1 mid */ Curl_strntolower(provider1, provider1, strlen(provider1)); @@ -158,35 +185,23 @@ static CURLcode make_headers(struct Curl_easy *data, msnprintf(date_full_hdr, DATE_FULL_HDR_LEN, "x-%s-date:%s", provider1, timestamp); - if(Curl_checkheaders(data, STRCONST("Host"))) { - head = NULL; - } - else { - char full_host[FULL_HOST_LEN + 1]; + if(!Curl_checkheaders(data, STRCONST("Host"))) { + char *fullhost; if(data->state.aptr.host) { - size_t pos; - - if(strlen(data->state.aptr.host) > FULL_HOST_LEN) { - ret = CURLE_URL_MALFORMAT; - goto fail; - } - strcpy(full_host, data->state.aptr.host); /* remove /r/n as the separator for canonical request must be '\n' */ - pos = strcspn(full_host, "\n\r"); - full_host[pos] = 0; - } - else { - if(strlen(hostname) > MAX_HOST_LEN) { - ret = CURLE_URL_MALFORMAT; - goto fail; - } - msnprintf(full_host, FULL_HOST_LEN, "host:%s", hostname); + size_t pos = strcspn(data->state.aptr.host, "\n\r"); + fullhost = Curl_memdup0(data->state.aptr.host, pos); } + else + fullhost = aprintf("host:%s", hostname); - head = curl_slist_append(NULL, full_host); - if(!head) + if(fullhost) + head = Curl_slist_append_nodup(NULL, fullhost); + if(!head) { + free(fullhost); goto fail; + } } @@ -243,7 +258,7 @@ static CURLcode make_headers(struct Curl_easy *data, if(!tmp_head) goto fail; head = tmp_head; - *date_header = curl_maprintf("%s: %s\r\n", date_hdr_key, timestamp); + *date_header = aprintf("%s: %s\r\n", date_hdr_key, timestamp); } else { char *value; @@ -270,18 +285,18 @@ static CURLcode make_headers(struct Curl_easy *data, *date_header = NULL; } - /* alpha-sort in a case sensitive manner */ + /* alpha-sort by header name in a case sensitive manner */ do { - again = 0; + again = FALSE; for(l = head; l; l = l->next) { struct curl_slist *next = l->next; - if(next && strcmp(l->data, next->data) > 0) { + if(next && compare_header_names(l->data, next->data) > 0) { char *tmp = l->data; l->data = next->data; next->data = tmp; - again = 1; + again = TRUE; } } } while(again); @@ -426,6 +441,76 @@ static int compare_func(const void *a, const void *b) #define MAX_QUERYPAIRS 64 +/** + * found_equals have a double meaning, + * detect if an equal have been found when called from canon_query, + * and mark that this function is called to compute the path, + * if found_equals is NULL. + */ +static CURLcode canon_string(const char *q, size_t len, + struct dynbuf *dq, bool *found_equals) +{ + CURLcode result = CURLE_OK; + + for(; len && !result; q++, len--) { + if(ISALNUM(*q)) + result = Curl_dyn_addn(dq, q, 1); + else { + switch(*q) { + case '-': + case '.': + case '_': + case '~': + /* allowed as-is */ + result = Curl_dyn_addn(dq, q, 1); + break; + case '%': + /* uppercase the following if hexadecimal */ + if(ISXDIGIT(q[1]) && ISXDIGIT(q[2])) { + char tmp[3]="%"; + tmp[1] = Curl_raw_toupper(q[1]); + tmp[2] = Curl_raw_toupper(q[2]); + result = Curl_dyn_addn(dq, tmp, 3); + q += 2; + len -= 2; + } + else + /* '%' without a following two-digit hex, encode it */ + result = Curl_dyn_addn(dq, "%25", 3); + break; + default: { + const char hex[] = "0123456789ABCDEF"; + char out[3]={'%'}; + + if(!found_equals) { + /* if found_equals is NULL assuming, been in path */ + if(*q == '/') { + /* allowed as if */ + result = Curl_dyn_addn(dq, q, 1); + break; + } + } + else { + /* allowed as-is */ + if(*q == '=') { + result = Curl_dyn_addn(dq, q, 1); + *found_equals = TRUE; + break; + } + } + /* URL encode */ + out[1] = hex[((unsigned char)*q) >> 4]; + out[2] = hex[*q & 0xf]; + result = Curl_dyn_addn(dq, out, 3); + break; + } + } + } + } + return result; +} + + static CURLcode canon_query(struct Curl_easy *data, const char *query, struct dynbuf *dq) { @@ -463,54 +548,11 @@ static CURLcode canon_query(struct Curl_easy *data, ap = &array[0]; for(i = 0; !result && (i < entry); i++, ap++) { - size_t len; const char *q = ap->p; - bool found_equals = false; + bool found_equals = FALSE; if(!ap->len) continue; - for(len = ap->len; len && !result; q++, len--) { - if(ISALNUM(*q)) - result = Curl_dyn_addn(dq, q, 1); - else { - switch(*q) { - case '-': - case '.': - case '_': - case '~': - /* allowed as-is */ - result = Curl_dyn_addn(dq, q, 1); - break; - case '=': - /* allowed as-is */ - result = Curl_dyn_addn(dq, q, 1); - found_equals = true; - break; - case '%': - /* uppercase the following if hexadecimal */ - if(ISXDIGIT(q[1]) && ISXDIGIT(q[2])) { - char tmp[3]="%"; - tmp[1] = Curl_raw_toupper(q[1]); - tmp[2] = Curl_raw_toupper(q[2]); - result = Curl_dyn_addn(dq, tmp, 3); - q += 2; - len -= 2; - } - else - /* '%' without a following two-digit hex, encode it */ - result = Curl_dyn_addn(dq, "%25", 3); - break; - default: { - /* URL encode */ - const char hex[] = "0123456789ABCDEF"; - char out[3]={'%'}; - out[1] = hex[((unsigned char)*q)>>4]; - out[2] = hex[*q & 0xf]; - result = Curl_dyn_addn(dq, out, 3); - break; - } - } - } - } + result = canon_string(q, ap->len, dq, &found_equals); if(!result && !found_equals) { /* queries without value still need an equals */ result = Curl_dyn_addn(dq, "=", 1); @@ -534,7 +576,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) char provider1[MAX_SIGV4_LEN + 1]=""; char region[MAX_SIGV4_LEN + 1]=""; char service[MAX_SIGV4_LEN + 1]=""; - bool sign_as_s3 = false; + bool sign_as_s3 = FALSE; const char *hostname = conn->host.name; time_t clock; struct tm tm; @@ -543,12 +585,13 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) struct dynbuf canonical_headers; struct dynbuf signed_headers; struct dynbuf canonical_query; + struct dynbuf canonical_path; char *date_header = NULL; Curl_HttpReq httpreq; const char *method = NULL; char *payload_hash = NULL; size_t payload_hash_len = 0; - unsigned char sha_hash[SHA256_DIGEST_LENGTH]; + unsigned char sha_hash[CURL_SHA256_DIGEST_LENGTH]; char sha_hex[SHA256_HEX_LENGTH]; char content_sha256_hdr[CONTENT_SHA256_HDR_LEN + 2] = ""; /* add \r\n */ char *canonical_request = NULL; @@ -557,8 +600,8 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) char *str_to_sign = NULL; const char *user = data->state.aptr.user ? data->state.aptr.user : ""; char *secret = NULL; - unsigned char sign0[SHA256_DIGEST_LENGTH] = {0}; - unsigned char sign1[SHA256_DIGEST_LENGTH] = {0}; + unsigned char sign0[CURL_SHA256_DIGEST_LENGTH] = {0}; + unsigned char sign1[CURL_SHA256_DIGEST_LENGTH] = {0}; char *auth_headers = NULL; DEBUGASSERT(!proxy); @@ -573,6 +616,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) Curl_dyn_init(&canonical_headers, CURL_MAX_HTTP_HEADER); Curl_dyn_init(&canonical_query, CURL_MAX_HTTP_HEADER); Curl_dyn_init(&signed_headers, CURL_MAX_HTTP_HEADER); + Curl_dyn_init(&canonical_path, CURL_MAX_HTTP_HEADER); /* * Parameters parsing @@ -594,7 +638,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) ":%" MAX_SIGV4_LEN_TXT "s", provider0, provider1, region, service); if(!provider0[0]) { - failf(data, "first aws-sigv4 provider can't be empty"); + failf(data, "first aws-sigv4 provider cannot be empty"); result = CURLE_BAD_FUNCTION_ARGUMENT; goto fail; } @@ -668,10 +712,10 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) if(force_timestamp) clock = 0; else - time(&clock); + clock = time(NULL); } #else - time(&clock); + clock = time(NULL); #endif result = Curl_gmtime(clock, &tm); if(result) { @@ -701,22 +745,27 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) result = canon_query(data, data->state.up.query, &canonical_query); if(result) goto fail; + + result = canon_string(data->state.up.path, strlen(data->state.up.path), + &canonical_path, NULL); + if(result) + goto fail; result = CURLE_OUT_OF_MEMORY; canonical_request = - curl_maprintf("%s\n" /* HTTPRequestMethod */ - "%s\n" /* CanonicalURI */ - "%s\n" /* CanonicalQueryString */ - "%s\n" /* CanonicalHeaders */ - "%s\n" /* SignedHeaders */ - "%.*s", /* HashedRequestPayload in hex */ - method, - data->state.up.path, - Curl_dyn_ptr(&canonical_query) ? - Curl_dyn_ptr(&canonical_query) : "", - Curl_dyn_ptr(&canonical_headers), - Curl_dyn_ptr(&signed_headers), - (int)payload_hash_len, payload_hash); + aprintf("%s\n" /* HTTPRequestMethod */ + "%s\n" /* CanonicalURI */ + "%s\n" /* CanonicalQueryString */ + "%s\n" /* CanonicalHeaders */ + "%s\n" /* SignedHeaders */ + "%.*s", /* HashedRequestPayload in hex */ + method, + Curl_dyn_ptr(&canonical_path), + Curl_dyn_ptr(&canonical_query) ? + Curl_dyn_ptr(&canonical_query) : "", + Curl_dyn_ptr(&canonical_headers), + Curl_dyn_ptr(&signed_headers), + (int)payload_hash_len, payload_hash); if(!canonical_request) goto fail; @@ -724,12 +773,12 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) /* provider 0 lowercase */ Curl_strntolower(provider0, provider0, strlen(provider0)); - request_type = curl_maprintf("%s4_request", provider0); + request_type = aprintf("%s4_request", provider0); if(!request_type) goto fail; - credential_scope = curl_maprintf("%s/%s/%s/%s", - date, region, service, request_type); + credential_scope = aprintf("%s/%s/%s/%s", + date, region, service, request_type); if(!credential_scope) goto fail; @@ -746,22 +795,22 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) * Google allows using RSA key instead of HMAC, so this code might change * in the future. For now we only support HMAC. */ - str_to_sign = curl_maprintf("%s4-HMAC-SHA256\n" /* Algorithm */ - "%s\n" /* RequestDateTime */ - "%s\n" /* CredentialScope */ - "%s", /* HashedCanonicalRequest in hex */ - provider0, - timestamp, - credential_scope, - sha_hex); + str_to_sign = aprintf("%s4-HMAC-SHA256\n" /* Algorithm */ + "%s\n" /* RequestDateTime */ + "%s\n" /* CredentialScope */ + "%s", /* HashedCanonicalRequest in hex */ + provider0, + timestamp, + credential_scope, + sha_hex); if(!str_to_sign) { goto fail; } /* provider 0 uppercase */ - secret = curl_maprintf("%s4%s", provider0, - data->state.aptr.passwd ? - data->state.aptr.passwd : ""); + secret = aprintf("%s4%s", provider0, + data->state.aptr.passwd ? + data->state.aptr.passwd : ""); if(!secret) goto fail; @@ -774,24 +823,24 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) sha256_to_hex(sha_hex, sign0); /* provider 0 uppercase */ - auth_headers = curl_maprintf("Authorization: %s4-HMAC-SHA256 " - "Credential=%s/%s, " - "SignedHeaders=%s, " - "Signature=%s\r\n" - /* - * date_header is added here, only if it wasn't - * user-specified (using CURLOPT_HTTPHEADER). - * date_header includes \r\n - */ - "%s" - "%s", /* optional sha256 header includes \r\n */ - provider0, - user, - credential_scope, - Curl_dyn_ptr(&signed_headers), - sha_hex, - date_header ? date_header : "", - content_sha256_hdr); + auth_headers = aprintf("Authorization: %s4-HMAC-SHA256 " + "Credential=%s/%s, " + "SignedHeaders=%s, " + "Signature=%s\r\n" + /* + * date_header is added here, only if it was not + * user-specified (using CURLOPT_HTTPHEADER). + * date_header includes \r\n + */ + "%s" + "%s", /* optional sha256 header includes \r\n */ + provider0, + user, + credential_scope, + Curl_dyn_ptr(&signed_headers), + sha_hex, + date_header ? date_header : "", + content_sha256_hdr); if(!auth_headers) { goto fail; } @@ -803,6 +852,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy) fail: Curl_dyn_free(&canonical_query); + Curl_dyn_free(&canonical_path); Curl_dyn_free(&canonical_headers); Curl_dyn_free(&signed_headers); free(canonical_request); diff --git a/deps/curl/lib/http_chunks.c b/deps/curl/lib/http_chunks.c index cfbd40bc..aea84be9 100644 --- a/deps/curl/lib/http_chunks.c +++ b/deps/curl/lib/http_chunks.c @@ -28,6 +28,7 @@ #include "urldata.h" /* it includes http_chunks.h */ #include "curl_printf.h" +#include "curl_trc.h" #include "sendf.h" /* for the client write stuff */ #include "dynbuf.h" #include "content_encoding.h" @@ -181,12 +182,15 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, case CHUNK_LF: /* waiting for the LF after a chunk size */ if(*buf == 0x0a) { - /* we're now expecting data to come, unless size was zero! */ + /* we are now expecting data to come, unless size was zero! */ if(0 == ch->datasize) { ch->state = CHUNK_TRAILER; /* now check for trailers */ } - else + else { ch->state = CHUNK_DATA; + CURL_TRC_WRITE(data, "http_chunked, chunk start of %" + FMT_OFF_T " bytes", ch->datasize); + } } buf++; @@ -221,6 +225,9 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, ch->datasize -= piece; /* decrease amount left to expect */ buf += piece; /* move read pointer forward */ blen -= piece; /* decrease space left in this round */ + CURL_TRC_WRITE(data, "http_chunked, write %zu body bytes, %" + FMT_OFF_T " bytes in chunk remain", + piece, ch->datasize); if(0 == ch->datasize) /* end of data this round, we now expect a trailing CRLF */ @@ -282,9 +289,9 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, break; } else { - /* no trailer, we're on the final CRLF pair */ + /* no trailer, we are on the final CRLF pair */ ch->state = CHUNK_TRAILER_POSTCR; - break; /* don't advance the pointer */ + break; /* do not advance the pointer */ } } else { @@ -337,14 +344,17 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, blen--; (*pconsumed)++; /* Record the length of any data left in the end of the buffer - even if there's no more chunks to read */ + even if there is no more chunks to read */ ch->datasize = blen; ch->state = CHUNK_DONE; + CURL_TRC_WRITE(data, "http_chunk, response complete"); return CURLE_OK; } else { ch->state = CHUNK_FAILED; ch->last_code = CHUNKE_BAD_CHUNK; + CURL_TRC_WRITE(data, "http_chunk error, expected 0x0a, seeing 0x%ux", + (unsigned int)*buf); return CURLE_RECV_ERROR; } case CHUNK_DONE: @@ -460,7 +470,7 @@ const struct Curl_cwtype Curl_httpchunk_unencoder = { sizeof(struct chunked_writer) }; -/* max length of a HTTP chunk that we want to generate */ +/* max length of an HTTP chunk that we want to generate */ #define CURL_CHUNKED_MINLEN (1024) #define CURL_CHUNKED_MAXLEN (64 * 1024) @@ -498,6 +508,7 @@ static CURLcode add_last_chunk(struct Curl_easy *data, int rc; if(!data->set.trailer_callback) { + CURL_TRC_READ(data, "http_chunk, added last, empty chunk"); return Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("0\r\n\r\n"), &n); } @@ -505,9 +516,9 @@ static CURLcode add_last_chunk(struct Curl_easy *data, if(result) goto out; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); rc = data->set.trailer_callback(&trailers, data->set.trailer_data); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(rc != CURL_TRAILERFUNC_OK) { failf(data, "operation aborted by trailing headers callback"); @@ -535,6 +546,8 @@ static CURLcode add_last_chunk(struct Curl_easy *data, out: curl_slist_free_all(trailers); + CURL_TRC_READ(data, "http_chunk, added last chunk with trailers " + "from client -> %d", result); return result; } @@ -581,6 +594,8 @@ static CURLcode add_chunk(struct Curl_easy *data, result = Curl_bufq_cwrite(&ctx->chunkbuf, buf, nread, &n); if(!result) result = Curl_bufq_cwrite(&ctx->chunkbuf, "\r\n", 2, &n); + CURL_TRC_READ(data, "http_chunk, made chunk of %zu bytes -> %d", + nread, result); if(result) return result; } @@ -644,6 +659,8 @@ const struct Curl_crtype Curl_httpchunk_encoder = { Curl_creader_def_resume_from, Curl_creader_def_rewind, Curl_creader_def_unpause, + Curl_creader_def_is_paused, + Curl_creader_def_done, sizeof(struct chunked_reader) }; diff --git a/deps/curl/lib/http_chunks.h b/deps/curl/lib/http_chunks.h index d3ecc36c..34951ea0 100644 --- a/deps/curl/lib/http_chunks.h +++ b/deps/curl/lib/http_chunks.h @@ -33,12 +33,12 @@ struct connectdata; /* * The longest possible hexadecimal number we support in a chunked transfer. * Neither RFC2616 nor the later HTTP specs define a maximum chunk size. - * For 64 bit curl_off_t we support 16 digits. For 32 bit, 8 digits. + * For 64-bit curl_off_t we support 16 digits. For 32-bit, 8 digits. */ #define CHUNK_MAXNUM_LEN (SIZEOF_CURL_OFF_T * 2) typedef enum { - /* await and buffer all hexadecimal digits until we get one that isn't a + /* await and buffer all hexadecimal digits until we get one that is not a hexadecimal digit. When done, we go CHUNK_LF */ CHUNK_HEX, @@ -54,9 +54,9 @@ typedef enum { big deal. */ CHUNK_POSTLF, - /* Used to mark that we're out of the game. NOTE: that there's a 'datasize' - field in the struct that will tell how many bytes that were not passed to - the client in the end of the last buffer! */ + /* Used to mark that we are out of the game. NOTE: that there is a + 'datasize' field in the struct that will tell how many bytes that were + not passed to the client in the end of the last buffer! */ CHUNK_STOP, /* At this point optional trailer headers can be found, unless the next line diff --git a/deps/curl/lib/http_digest.c b/deps/curl/lib/http_digest.c index 2db3125a..a3ba17a5 100644 --- a/deps/curl/lib/http_digest.c +++ b/deps/curl/lib/http_digest.c @@ -121,9 +121,9 @@ CURLcode Curl_output_digest(struct Curl_easy *data, passwdp = ""; #if defined(USE_WINDOWS_SSPI) - have_chlg = digest->input_token ? TRUE : FALSE; + have_chlg = !!digest->input_token; #else - have_chlg = digest->nonce ? TRUE : FALSE; + have_chlg = !!digest->nonce; #endif if(!have_chlg) { diff --git a/deps/curl/lib/http_negotiate.c b/deps/curl/lib/http_negotiate.c index 153e3d4a..5dda4750 100644 --- a/deps/curl/lib/http_negotiate.c +++ b/deps/curl/lib/http_negotiate.c @@ -30,6 +30,7 @@ #include "sendf.h" #include "http_negotiate.h" #include "vauth/vauth.h" +#include "vtls/vtls.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -95,7 +96,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, Curl_http_auth_cleanup_negotiate(conn); } else if(state != GSS_AUTHNONE) { - /* The server rejected our authentication and hasn't supplied any more + /* The server rejected our authentication and has not supplied any more negotiation mechanisms */ Curl_http_auth_cleanup_negotiate(conn); return CURLE_LOGIN_DENIED; @@ -106,11 +107,27 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, #if defined(USE_WINDOWS_SSPI) && defined(SECPKG_ATTR_ENDPOINT_BINDINGS) neg_ctx->sslContext = conn->sslContext; #endif + /* Check if the connection is using SSL and get the channel binding data */ +#if defined(USE_SSL) && defined(HAVE_GSSAPI) + if(conn->handler->flags & PROTOPT_SSL) { + Curl_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE); + result = Curl_ssl_get_channel_binding( + data, FIRSTSOCKET, &neg_ctx->channel_binding_data); + if(result) { + Curl_http_auth_cleanup_negotiate(conn); + return result; + } + } +#endif /* Initialize the security context and decode our challenge */ result = Curl_auth_decode_spnego_message(data, userp, passwdp, service, host, header, neg_ctx); +#if defined(USE_SSL) && defined(HAVE_GSSAPI) + Curl_dyn_free(&neg_ctx->channel_binding_data); +#endif + if(result) Curl_http_auth_cleanup_negotiate(conn); @@ -120,16 +137,29 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, CURLcode Curl_output_negotiate(struct Curl_easy *data, struct connectdata *conn, bool proxy) { - struct negotiatedata *neg_ctx = proxy ? &conn->proxyneg : - &conn->negotiate; - struct auth *authp = proxy ? &data->state.authproxy : &data->state.authhost; - curlnegotiate *state = proxy ? &conn->proxy_negotiate_state : - &conn->http_negotiate_state; + struct negotiatedata *neg_ctx; + struct auth *authp; + curlnegotiate *state; char *base64 = NULL; size_t len = 0; char *userp; CURLcode result; + if(proxy) { +#ifndef CURL_DISABLE_PROXY + neg_ctx = &conn->proxyneg; + authp = &data->state.authproxy; + state = &conn->proxy_negotiate_state; +#else + return CURLE_NOT_BUILT_IN; +#endif + } + else { + neg_ctx = &conn->negotiate; + authp = &data->state.authhost; + state = &conn->http_negotiate_state; + } + authp->done = FALSE; if(*state == GSS_AUTHRECV) { @@ -171,8 +201,10 @@ CURLcode Curl_output_negotiate(struct Curl_easy *data, base64); if(proxy) { +#ifndef CURL_DISABLE_PROXY Curl_safefree(data->state.aptr.proxyuserpwd); data->state.aptr.proxyuserpwd = userp; +#endif } else { Curl_safefree(data->state.aptr.userpwd); @@ -203,7 +235,7 @@ CURLcode Curl_output_negotiate(struct Curl_easy *data, if(*state == GSS_AUTHDONE || *state == GSS_AUTHSUCC) { /* connection is already authenticated, - * don't send a header in future requests */ + * do not send a header in future requests */ authp->done = TRUE; } diff --git a/deps/curl/lib/http_ntlm.c b/deps/curl/lib/http_ntlm.c index b845ddf3..49230bc1 100644 --- a/deps/curl/lib/http_ntlm.c +++ b/deps/curl/lib/http_ntlm.c @@ -40,7 +40,6 @@ #include "strcase.h" #include "http_ntlm.h" #include "curl_ntlm_core.h" -#include "curl_ntlm_wb.h" #include "curl_base64.h" #include "vauth/vauth.h" #include "url.h" @@ -124,7 +123,7 @@ CURLcode Curl_input_ntlm(struct Curl_easy *data, } /* - * This is for creating ntlm header output + * This is for creating NTLM header output */ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) { @@ -188,10 +187,10 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) passwdp = ""; #ifdef USE_WINDOWS_SSPI - if(!s_hSecDll) { + if(!Curl_hSecDll) { /* not thread safe and leaks - use curl_global_init() to avoid */ CURLcode err = Curl_sspi_global_init(); - if(!s_hSecDll) + if(!Curl_hSecDll) return err; } #ifdef SECPKG_ATTR_ENDPOINT_BINDINGS @@ -201,7 +200,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) Curl_bufref_init(&ntlmmsg); - /* connection is already authenticated, don't send a header in future + /* connection is already authenticated, do not send a header in future * requests so go directly to NTLMSTATE_LAST */ if(*state == NTLMSTATE_TYPE3) *state = NTLMSTATE_LAST; @@ -266,10 +265,6 @@ void Curl_http_auth_cleanup_ntlm(struct connectdata *conn) { Curl_auth_cleanup_ntlm(&conn->ntlm); Curl_auth_cleanup_ntlm(&conn->proxyntlm); - -#if defined(NTLM_WB_ENABLED) - Curl_http_auth_cleanup_ntlm_wb(conn); -#endif } #endif /* !CURL_DISABLE_HTTP && USE_NTLM */ diff --git a/deps/curl/lib/http_ntlm.h b/deps/curl/lib/http_ntlm.h index f37572ba..c1cf0570 100644 --- a/deps/curl/lib/http_ntlm.h +++ b/deps/curl/lib/http_ntlm.h @@ -28,11 +28,11 @@ #if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) -/* this is for ntlm header input */ +/* this is for NTLM header input */ CURLcode Curl_input_ntlm(struct Curl_easy *data, bool proxy, const char *header); -/* this is for creating ntlm header output */ +/* this is for creating NTLM header output */ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy); void Curl_http_auth_cleanup_ntlm(struct connectdata *conn); diff --git a/deps/curl/lib/http_proxy.c b/deps/curl/lib/http_proxy.c index 113c43a4..1ec08d0d 100644 --- a/deps/curl/lib/http_proxy.c +++ b/deps/curl/lib/http_proxy.c @@ -97,8 +97,8 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq, if(result) goto out; - authority = aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, - ipv6_ip?"]":"", port); + authority = aprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname, + ipv6_ip ?"]" : "", port); if(!authority) { result = CURLE_OUT_OF_MEMORY; goto out; @@ -185,7 +185,7 @@ connect_sub: *done = FALSE; if(!ctx->cf_protocol) { struct Curl_cfilter *cf_protocol = NULL; - int alpn = Curl_conn_cf_is_ssl(cf->next)? + int alpn = Curl_conn_cf_is_ssl(cf->next) ? cf->conn->proxy_alpn : CURL_HTTP_VERSION_1_1; /* First time call after the subchain connected */ @@ -195,7 +195,7 @@ connect_sub: case CURL_HTTP_VERSION_1_1: CURL_TRC_CF(data, cf, "installing subfilter for HTTP/1.1"); infof(data, "CONNECT tunnel: HTTP/1.%d negotiated", - (alpn == CURL_HTTP_VERSION_1_0)? 0 : 1); + (alpn == CURL_HTTP_VERSION_1_0) ? 0 : 1); result = Curl_cf_h1_proxy_insert_after(cf, data); if(result) goto out; @@ -293,11 +293,12 @@ static void http_proxy_cf_close(struct Curl_cfilter *cf, struct Curl_cftype Curl_cft_http_proxy = { "HTTP-PROXY", - CF_TYPE_IP_CONNECT, + CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, 0, http_proxy_cf_destroy, http_proxy_cf_connect, http_proxy_cf_close, + Curl_cf_def_shutdown, Curl_cf_http_proxy_get_host, Curl_cf_def_adjust_pollset, Curl_cf_def_data_pending, diff --git a/deps/curl/lib/idn.c b/deps/curl/lib/idn.c index 81a177f8..ed20cdc1 100644 --- a/deps/curl/lib/idn.c +++ b/deps/curl/lib/idn.c @@ -50,10 +50,108 @@ #include "curl_memory.h" #include "memdebug.h" +/* for macOS and iOS targets */ +#if defined(USE_APPLE_IDN) +#include +#include +#include + +#define MAX_HOST_LENGTH 512 + +static CURLcode iconv_to_utf8(const char *in, size_t inlen, + char **out, size_t *outlen) +{ + iconv_t cd = iconv_open("UTF-8", nl_langinfo(CODESET)); + if(cd != (iconv_t)-1) { + size_t iconv_outlen = *outlen; + char *iconv_in = (char *)in; + size_t iconv_inlen = inlen; + size_t iconv_result = iconv(cd, &iconv_in, &iconv_inlen, + out, &iconv_outlen); + *outlen -= iconv_outlen; + iconv_close(cd); + if(iconv_result == (size_t)-1) { + if(errno == ENOMEM) + return CURLE_OUT_OF_MEMORY; + else + return CURLE_URL_MALFORMAT; + } + + return CURLE_OK; + } + else { + if(errno == ENOMEM) + return CURLE_OUT_OF_MEMORY; + else + return CURLE_FAILED_INIT; + } +} + +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_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); + if(!U_FAILURE(err)) { + UIDNAInfo info = UIDNA_INFO_INITIALIZER; + 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); + if(!U_FAILURE(err) && !info.errors) { + *out = strdup(buffer); + if(*out) + return CURLE_OK; + else + return CURLE_OUT_OF_MEMORY; + } + } + } + else + return iconv_result; + } + return CURLE_URL_MALFORMAT; +} + +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); + if(!U_FAILURE(err)) { + UIDNAInfo info = UIDNA_INFO_INITIALIZER; + char buffer[MAX_HOST_LENGTH] = {0}; + (void)uidna_nameToUnicodeUTF8(idna, in, -1, buffer, + sizeof(buffer) - 1, &info, &err); + uidna_close(idna); + if(!U_FAILURE(err)) { + *out = strdup(buffer); + if(*out) + return CURLE_OK; + else + return CURLE_OUT_OF_MEMORY; + } + } + } + return CURLE_URL_MALFORMAT; +} +#endif + #ifdef USE_WIN32_IDN /* using Windows kernel32 and normaliz libraries. */ -#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600 +#if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \ + (!defined(WINVER) || WINVER < 0x600) WINBASEAPI int WINAPI IdnToAscii(DWORD dwFlags, const WCHAR *lpUnicodeCharStr, int cchUnicodeChar, @@ -150,7 +248,7 @@ bool Curl_is_ASCII_name(const char *hostname) * Curl_idn_decode() returns an allocated IDN decoded string if it was * possible. NULL on error. * - * CURLE_URL_MALFORMAT - the host name could not be converted + * CURLE_URL_MALFORMAT - the hostname could not be converted * CURLE_OUT_OF_MEMORY - memory problem * */ @@ -181,6 +279,8 @@ static CURLcode idn_decode(const char *input, char **output) result = CURLE_NOT_BUILT_IN; #elif defined(USE_WIN32_IDN) result = win32_idn_to_ascii(input, &decoded); +#elif defined(USE_APPLE_IDN) + result = mac_idn_to_ascii(input, &decoded); #endif if(!result) *output = decoded; @@ -198,6 +298,10 @@ static CURLcode idn_encode(const char *puny, char **output) CURLcode result = win32_ascii_to_idn(puny, &enc); if(result) return result; +#elif defined(USE_APPLE_IDN) + CURLcode result = mac_ascii_to_idn(puny, &enc); + if(result) + return result; #endif *output = enc; return CURLE_OK; @@ -246,11 +350,7 @@ CURLcode Curl_idn_encode(const char *puny, char **output) */ void Curl_free_idnconverted_hostname(struct hostname *host) { - if(host->encalloc) { - /* must be freed with idn2_free() if allocated by libidn */ - Curl_idn_free(host->encalloc); - host->encalloc = NULL; - } + Curl_safefree(host->encalloc); } #endif /* USE_IDN */ @@ -260,27 +360,18 @@ void Curl_free_idnconverted_hostname(struct hostname *host) */ CURLcode Curl_idnconvert_hostname(struct hostname *host) { - /* set the name we use to display the host name */ + /* set the name we use to display the hostname */ host->dispname = host->name; #ifdef USE_IDN /* Check name for non-ASCII and convert hostname if we can */ if(!Curl_is_ASCII_name(host->name)) { char *decoded; - CURLcode result = idn_decode(host->name, &decoded); - if(!result) { - if(!*decoded) { - /* zero length is a bad host name */ - Curl_idn_free(decoded); - return CURLE_URL_MALFORMAT; - } - /* successful */ - host->encalloc = decoded; - /* change the name pointer to point to the encoded hostname */ - host->name = host->encalloc; - } - else + CURLcode result = Curl_idn_decode(host->name, &decoded); + if(result) return result; + /* successful */ + host->name = host->encalloc = decoded; } #endif return CURLE_OK; diff --git a/deps/curl/lib/idn.h b/deps/curl/lib/idn.h index 74bbcaf4..2bdce892 100644 --- a/deps/curl/lib/idn.h +++ b/deps/curl/lib/idn.h @@ -26,16 +26,11 @@ bool Curl_is_ASCII_name(const char *hostname); CURLcode Curl_idnconvert_hostname(struct hostname *host); -#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) +#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN) #define USE_IDN void Curl_free_idnconverted_hostname(struct hostname *host); CURLcode Curl_idn_decode(const char *input, char **output); CURLcode Curl_idn_encode(const char *input, char **output); -#ifdef USE_LIBIDN2 -#define Curl_idn_free(x) idn2_free(x) -#else -#define Curl_idn_free(x) free(x) -#endif #else #define Curl_free_idnconverted_hostname(x) diff --git a/deps/curl/lib/if2ip.c b/deps/curl/lib/if2ip.c index 5249f6cc..55afd553 100644 --- a/deps/curl/lib/if2ip.c +++ b/deps/curl/lib/if2ip.c @@ -62,7 +62,7 @@ /* ------------------------------------------------------------------ */ -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 /* Return the scope of the given address. */ unsigned int Curl_ipv6_scope(const struct sockaddr *sa) { @@ -97,17 +97,17 @@ unsigned int Curl_ipv6_scope(const struct sockaddr *sa) #if defined(HAVE_GETIFADDRS) if2ip_result_t Curl_if2ip(int af, -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int remote_scope, unsigned int local_scope_id, #endif const char *interf, - char *buf, int buf_size) + char *buf, size_t buf_size) { struct ifaddrs *iface, *head; if2ip_result_t res = IF2IP_NOT_FOUND; -#if defined(ENABLE_IPV6) && \ +#if defined(USE_IPV6) && \ !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) (void) local_scope_id; #endif @@ -121,7 +121,7 @@ if2ip_result_t Curl_if2ip(int af, const char *ip; char scope[12] = ""; char ipstr[64]; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(af == AF_INET6) { #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID unsigned int scopeid = 0; @@ -182,12 +182,12 @@ if2ip_result_t Curl_if2ip(int af, #elif defined(HAVE_IOCTL_SIOCGIFADDR) if2ip_result_t Curl_if2ip(int af, -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int remote_scope, unsigned int local_scope_id, #endif const char *interf, - char *buf, int buf_size) + char *buf, size_t buf_size) { struct ifreq req; struct in_addr in; @@ -196,7 +196,7 @@ if2ip_result_t Curl_if2ip(int af, size_t len; const char *r; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 (void)remote_scope; (void)local_scope_id; #endif @@ -216,7 +216,15 @@ if2ip_result_t Curl_if2ip(int af, memcpy(req.ifr_name, interf, len + 1); req.ifr_addr.sa_family = AF_INET; +#if defined(__GNUC__) && defined(_AIX) +/* Suppress warning inside system headers */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshift-sign-overflow" +#endif if(ioctl(dummy, SIOCGIFADDR, &req) < 0) { +#if defined(__GNUC__) && defined(_AIX) +#pragma GCC diagnostic pop +#endif sclose(dummy); /* With SIOCGIFADDR, we cannot tell the difference between an interface that does not exist and an interface that has no address of the @@ -237,15 +245,15 @@ if2ip_result_t Curl_if2ip(int af, #else if2ip_result_t Curl_if2ip(int af, -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int remote_scope, unsigned int local_scope_id, #endif const char *interf, - char *buf, int buf_size) + char *buf, size_t buf_size) { (void) af; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 (void) remote_scope; (void) local_scope_id; #endif diff --git a/deps/curl/lib/if2ip.h b/deps/curl/lib/if2ip.h index 1f973505..f4b2f4c1 100644 --- a/deps/curl/lib/if2ip.h +++ b/deps/curl/lib/if2ip.h @@ -32,7 +32,7 @@ #define IPV6_SCOPE_UNIQUELOCAL 3 /* Unique local */ #define IPV6_SCOPE_NODELOCAL 4 /* Loopback. */ -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int Curl_ipv6_scope(const struct sockaddr *sa); #else #define Curl_ipv6_scope(x) 0 @@ -45,12 +45,12 @@ typedef enum { } if2ip_result_t; if2ip_result_t Curl_if2ip(int af, -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int remote_scope, unsigned int local_scope_id, #endif const char *interf, - char *buf, int buf_size); + char *buf, size_t buf_size); #ifdef __INTERIX diff --git a/deps/curl/lib/imap.c b/deps/curl/lib/imap.c index 0e013e74..e424cdb0 100644 --- a/deps/curl/lib/imap.c +++ b/deps/curl/lib/imap.c @@ -117,7 +117,7 @@ static CURLcode imap_get_message(struct Curl_easy *data, struct bufref *out); */ const struct Curl_handler Curl_handler_imap = { - "IMAP", /* scheme */ + "imap", /* scheme */ imap_setup_connection, /* setup_connection */ imap_do, /* do_it */ imap_done, /* done */ @@ -131,6 +131,7 @@ const struct Curl_handler Curl_handler_imap = { ZERO_NULL, /* perform_getsock */ imap_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_IMAP, /* defport */ @@ -146,7 +147,7 @@ const struct Curl_handler Curl_handler_imap = { */ const struct Curl_handler Curl_handler_imaps = { - "IMAPS", /* scheme */ + "imaps", /* scheme */ imap_setup_connection, /* setup_connection */ imap_do, /* do_it */ imap_done, /* done */ @@ -160,6 +161,7 @@ const struct Curl_handler Curl_handler_imaps = { ZERO_NULL, /* perform_getsock */ imap_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_IMAPS, /* defport */ @@ -510,7 +512,7 @@ static CURLcode imap_perform_login(struct Curl_easy *data, char *passwd; /* Check we have a username and password to authenticate with and end the - connect phase if we don't */ + connect phase if we do not */ if(!data->state.aptr.user) { imap_state(data, IMAP_STOP); @@ -518,8 +520,8 @@ static CURLcode imap_perform_login(struct Curl_easy *data, } /* Make sure the username and password are in the correct atom format */ - user = imap_atom(conn->user, false); - passwd = imap_atom(conn->passwd, false); + user = imap_atom(conn->user, FALSE); + passwd = imap_atom(conn->passwd, FALSE); /* Send the LOGIN command */ result = imap_sendf(data, "LOGIN %s %s", user ? user : "", @@ -610,7 +612,7 @@ static CURLcode imap_perform_authentication(struct Curl_easy *data, saslprogress progress; /* Check if already authenticated OR if there is enough data to authenticate - with and end the connect phase if we don't */ + with and end the connect phase if we do not */ if(imapc->preauth || !Curl_sasl_can_authenticate(&imapc->sasl, data)) { imap_state(data, IMAP_STOP); @@ -653,7 +655,7 @@ static CURLcode imap_perform_list(struct Curl_easy *data) imap->custom_params ? imap->custom_params : ""); else { /* Make sure the mailbox is in the correct atom format if necessary */ - char *mailbox = imap->mailbox ? imap_atom(imap->mailbox, true) + char *mailbox = imap->mailbox ? imap_atom(imap->mailbox, TRUE) : strdup(""); if(!mailbox) return CURLE_OUT_OF_MEMORY; @@ -695,7 +697,7 @@ static CURLcode imap_perform_select(struct Curl_easy *data) } /* Make sure the mailbox is in the correct atom format */ - mailbox = imap_atom(imap->mailbox, false); + mailbox = imap_atom(imap->mailbox, FALSE); if(!mailbox) return CURLE_OUT_OF_MEMORY; @@ -774,7 +776,7 @@ static CURLcode imap_perform_append(struct Curl_easy *data) /* Prepare the mime data if some. */ if(data->set.mimepost.kind != MIMEKIND_NONE) { /* Use the whole structure as data. */ - data->set.mimepost.flags &= ~MIME_BODY_ONLY; + data->set.mimepost.flags &= ~(unsigned int)MIME_BODY_ONLY; /* Add external headers and mime version. */ curl_mime_headers(&data->set.mimepost, data->set.headers, 0); @@ -807,13 +809,12 @@ static CURLcode imap_perform_append(struct Curl_easy *data) } /* Make sure the mailbox is in the correct atom format */ - mailbox = imap_atom(imap->mailbox, false); + mailbox = imap_atom(imap->mailbox, FALSE); if(!mailbox) return CURLE_OUT_OF_MEMORY; /* Send the APPEND command */ - result = imap_sendf(data, - "APPEND %s (\\Seen) {%" CURL_FORMAT_CURL_OFF_T "}", + result = imap_sendf(data, "APPEND %s (\\Seen) {%" FMT_OFF_T "}", mailbox, data->state.infilesize); free(mailbox); @@ -1166,8 +1167,7 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, } if(parsed) { - infof(data, "Found %" CURL_FORMAT_CURL_OFF_T " bytes to download", - size); + infof(data, "Found %" FMT_OFF_T " bytes to download", size); Curl_pgrsSetDownloadSize(data, size); if(pp->overflow) { @@ -1185,7 +1185,7 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, chunk = (size_t)size; if(!chunk) { - /* no size, we're done with the data */ + /* no size, we are done with the data */ imap_state(data, IMAP_STOP); return CURLE_OK; } @@ -1194,7 +1194,7 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, if(result) return result; - infof(data, "Written %zu bytes, %" CURL_FORMAT_CURL_OFF_TU + infof(data, "Written %zu bytes, %" FMT_OFF_TU " bytes are left for transfer", chunk, size - chunk); /* Have we used the entire overflow or just part of it?*/ @@ -1212,18 +1212,18 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, if(data->req.bytecount == size) /* The entire data is already transferred! */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); else { /* IMAP download */ data->req.maxdownload = size; /* force a recv/send check of this connection, as the data might've been read off the socket already */ data->state.select_bits = CURL_CSELECT_IN; - Curl_xfer_setup(data, FIRSTSOCKET, size, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, size, FALSE); } } else { - /* We don't know how to parse this line */ + /* We do not know how to parse this line */ failf(data, "Failed to parse FETCH response."); result = CURLE_WEIRD_SERVER_REPLY; } @@ -1267,7 +1267,7 @@ static CURLcode imap_state_append_resp(struct Curl_easy *data, int imapcode, Curl_pgrsSetUploadSize(data, data->state.infilesize); /* IMAP upload */ - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); /* End of DO phase */ imap_state(data, IMAP_STOP); @@ -1399,7 +1399,7 @@ static CURLcode imap_multi_statemach(struct Curl_easy *data, bool *done) } result = Curl_pp_statemach(data, &imapc->pp, FALSE, FALSE); - *done = (imapc->state == IMAP_STOP) ? TRUE : FALSE; + *done = (imapc->state == IMAP_STOP); return result; } @@ -1692,7 +1692,7 @@ static CURLcode imap_dophase_done(struct Curl_easy *data, bool connected) if(imap->transfer != PPTRANSFER_BODY) /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); return CURLE_OK; } @@ -1859,7 +1859,7 @@ static bool imap_is_bchar(char ch) /* Performing the alnum check with this macro is faster because of ASCII arithmetic */ if(ISALNUM(ch)) - return true; + return TRUE; switch(ch) { /* bchar */ @@ -1873,10 +1873,10 @@ static bool imap_is_bchar(char ch) case '+': case ',': /* bchar -> achar -> uchar -> pct-encoded */ case '%': /* HEXDIG chars are already included above */ - return true; + return TRUE; default: - return false; + return FALSE; } } @@ -1891,7 +1891,7 @@ static CURLcode imap_parse_url_options(struct connectdata *conn) CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; const char *ptr = conn->options; - bool prefer_login = false; + bool prefer_login = FALSE; while(!result && ptr && *ptr) { const char *key = ptr; @@ -1907,16 +1907,16 @@ static CURLcode imap_parse_url_options(struct connectdata *conn) if(strncasecompare(key, "AUTH=+LOGIN", 11)) { /* User prefers plaintext LOGIN over any SASL, including SASL LOGIN */ - prefer_login = true; + prefer_login = TRUE; imapc->sasl.prefmech = SASL_AUTH_NONE; } else if(strncasecompare(key, "AUTH=", 5)) { - prefer_login = false; + prefer_login = FALSE; result = Curl_sasl_parse_url_auth_option(&imapc->sasl, value, ptr - value); } else { - prefer_login = false; + prefer_login = FALSE; result = CURLE_URL_MALFORMAT; } diff --git a/deps/curl/lib/inet_ntop.c b/deps/curl/lib/inet_ntop.c index c9cee0c5..a2812cf8 100644 --- a/deps/curl/lib/inet_ntop.c +++ b/deps/curl/lib/inet_ntop.c @@ -42,11 +42,11 @@ #define INT16SZ 2 /* - * If ENABLE_IPV6 is disabled, we still want to parse IPv6 addresses, so make + * If USE_IPV6 is disabled, we still want to parse IPv6 addresses, so make * sure we have _some_ value for AF_INET6 without polluting our fake value * everywhere. */ -#if !defined(ENABLE_IPV6) && !defined(AF_INET6) +#if !defined(USE_IPV6) && !defined(AF_INET6) #define AF_INET6 (AF_INET + 1) #endif @@ -58,7 +58,7 @@ * - uses no statics * - takes a unsigned char* not an in_addr as input */ -static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size) +static char *inet_ntop4(const unsigned char *src, char *dst, size_t size) { char tmp[sizeof("255.255.255.255")]; size_t len; @@ -84,14 +84,14 @@ static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size) /* * Convert IPv6 binary address into presentation (printable) format. */ -static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) +static char *inet_ntop6(const unsigned char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like + * to contain a value of the specified size. On some systems, like * Crays, there is no such thing as an integer variable with 16 bits. * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. + * to use pointer overlays. All the world's not a VAX. */ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; char *tp; @@ -168,7 +168,7 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) *tp++ = ':'; *tp++ = '\0'; - /* Check for overflow, copy, and we're done. + /* Check for overflow, copy, and we are done. */ if((size_t)(tp - tmp) > size) { errno = ENOSPC; @@ -185,10 +185,9 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) * Returns NULL on error and errno set with the specific * error, EAFNOSUPPORT or ENOSPC. * - * On Windows we store the error in the thread errno, not - * in the winsock error code. This is to avoid losing the - * actual last winsock error. So when this function returns - * NULL, check errno not SOCKERRNO. + * On Windows we store the error in the thread errno, not in the Winsock error + * code. This is to avoid losing the actual last Winsock error. When this + * function returns NULL, check errno not SOCKERRNO. */ char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size) { diff --git a/deps/curl/lib/inet_ntop.h b/deps/curl/lib/inet_ntop.h index 7c3ead43..f592f252 100644 --- a/deps/curl/lib/inet_ntop.h +++ b/deps/curl/lib/inet_ntop.h @@ -32,8 +32,13 @@ char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size); #ifdef HAVE_ARPA_INET_H #include #endif +#ifdef _WIN32 #define Curl_inet_ntop(af,addr,buf,size) \ - inet_ntop(af, addr, buf, (curl_socklen_t)size) + inet_ntop(af, addr, buf, size) +#else +#define Curl_inet_ntop(af,addr,buf,size) \ + inet_ntop(af, addr, buf, (curl_socklen_t)(size)) +#endif #endif #endif /* HEADER_CURL_INET_NTOP_H */ diff --git a/deps/curl/lib/inet_pton.c b/deps/curl/lib/inet_pton.c index 176cc956..97e6f80d 100644 --- a/deps/curl/lib/inet_pton.c +++ b/deps/curl/lib/inet_pton.c @@ -39,17 +39,17 @@ #define INT16SZ 2 /* - * If ENABLE_IPV6 is disabled, we still want to parse IPv6 addresses, so make + * If USE_IPV6 is disabled, we still want to parse IPv6 addresses, so make * sure we have _some_ value for AF_INET6 without polluting our fake value * everywhere. */ -#if !defined(ENABLE_IPV6) && !defined(AF_INET6) +#if !defined(USE_IPV6) && !defined(AF_INET6) #define AF_INET6 (AF_INET + 1) #endif /* - * WARNING: Don't even consider trying to compile this on a system where - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + * WARNING: Do not even consider trying to compile this on a system where + * 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); @@ -61,12 +61,12 @@ static int inet_pton6(const char *src, unsigned char *dst); * to network format (which is usually some kind of binary format). * return: * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) + * 0 if the address was not valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * notice: * On Windows we store the error in the thread errno, not - * in the winsock error code. This is to avoid losing the - * actual last winsock error. So when this function returns + * in the Winsock error code. This is to avoid losing the + * actual last Winsock error. When this function returns * -1, check errno not SOCKERRNO. * author: * Paul Vixie, 1996. @@ -92,7 +92,7 @@ Curl_inet_pton(int af, const char *src, void *dst) * return: * 1 if `src' is a valid dotted quad, else 0. * notice: - * does not touch `dst' unless it's returning 1. + * does not touch `dst' unless it is returning 1. * author: * Paul Vixie, 1996. */ @@ -147,7 +147,7 @@ inet_pton4(const char *src, unsigned char *dst) * return: * 1 if `src' is a valid [RFC1884 2.2] address, else 0. * notice: - * (1) does not touch `dst' unless it's returning 1. + * (1) does not touch `dst' unless it is returning 1. * (2) :: in a full address is silently ignored. * credit: * inspired by Mark Andrews. @@ -221,7 +221,7 @@ inet_pton6(const char *src, unsigned char *dst) if(colonp) { /* * Since some memmove()'s erroneously fail to handle - * overlapping regions, we'll do the shift by hand. + * overlapping regions, we will do the shift by hand. */ const ssize_t n = tp - colonp; ssize_t i; diff --git a/deps/curl/lib/krb5.c b/deps/curl/lib/krb5.c index 309e12a5..c953da60 100644 --- a/deps/curl/lib/krb5.c +++ b/deps/curl/lib/krb5.c @@ -25,7 +25,7 @@ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -91,7 +91,7 @@ static CURLcode ftpsend(struct Curl_easy *data, struct connectdata *conn, #ifdef HAVE_GSSAPI conn->data_prot = PROT_CMD; #endif - result = Curl_xfer_send(data, sptr, write_len, &bytes_written); + result = Curl_xfer_send(data, sptr, write_len, FALSE, &bytes_written); #ifdef HAVE_GSSAPI DEBUGASSERT(data_sec > PROT_NONE && data_sec < PROT_LAST); conn->data_prot = data_sec; @@ -169,7 +169,7 @@ krb5_encode(void *app_data, const void *from, int length, int level, void **to) * libraries modify the input buffer in gss_wrap() */ dec.value = (void *)from; - dec.length = length; + dec.length = (size_t)length; maj = gss_wrap(&min, *context, level == PROT_PRIVATE, GSS_C_QOP_DEFAULT, @@ -178,7 +178,7 @@ krb5_encode(void *app_data, const void *from, int length, int level, void **to) if(maj != GSS_S_COMPLETE) return -1; - /* malloc a new buffer, in case gss_release_buffer doesn't work as + /* malloc a new buffer, in case gss_release_buffer does not work as expected */ *to = malloc(enc.length); if(!*to) @@ -209,7 +209,7 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) struct gss_channel_bindings_struct chan; size_t base64_sz = 0; struct sockaddr_in *remote_addr = - (struct sockaddr_in *)(void *)&conn->remote_addr->sa_addr; + (struct sockaddr_in *)(void *)&conn->remote_addr->curl_sa_addr; char *stringp; if(getsockname(conn->sock[FIRSTSOCKET], @@ -227,7 +227,7 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) /* this loop will execute twice (once for service, once for host) */ for(;;) { - /* this really shouldn't be repeated here, but can't help it */ + /* this really should not be repeated here, but cannot help it */ if(service == srv_host) { result = ftpsend(data, conn, "AUTH GSSAPI"); if(result) @@ -329,24 +329,27 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) size_t len = Curl_dyn_len(&pp->recvbuf); p = Curl_dyn_ptr(&pp->recvbuf); if((len < 4) || (p[0] != '2' && p[0] != '3')) { - infof(data, "Server didn't accept auth data"); + infof(data, "Server did not accept auth data"); ret = AUTH_ERROR; break; } } _gssresp.value = NULL; /* make sure it is initialized */ + _gssresp.length = 0; p += 4; /* over '789 ' */ p = strstr(p, "ADAT="); if(p) { - result = Curl_base64_decode(p + 5, - (unsigned char **)&_gssresp.value, - &_gssresp.length); + unsigned char *outptr; + size_t outlen; + result = Curl_base64_decode(p + 5, &outptr, &outlen); if(result) { failf(data, "base64-decoding: %s", curl_easy_strerror(result)); ret = AUTH_CONTINUE; break; } + _gssresp.value = outptr; + _gssresp.length = outlen; } gssresp = &_gssresp; @@ -497,7 +500,7 @@ socket_write(struct Curl_easy *data, int sockindex, const void *to, size_t written; while(len > 0) { - result = Curl_conn_send(data, sockindex, to_p, len, &written); + result = Curl_conn_send(data, sockindex, to_p, len, FALSE, &written); if(!result && written > 0) { len -= written; to_p += written; @@ -524,24 +527,33 @@ static CURLcode read_data(struct Curl_easy *data, int sockindex, return result; if(len) { - /* only realloc if there was a length */ - len = ntohl(len); + len = (int)ntohl((uint32_t)len); if(len > CURL_MAX_INPUT_LENGTH) - len = 0; - else - buf->data = Curl_saferealloc(buf->data, len); - } - if(!len || !buf->data) - return CURLE_OUT_OF_MEMORY; + return CURLE_TOO_LARGE; - result = socket_read(data, sockindex, buf->data, len); - if(result) - return result; - nread = conn->mech->decode(conn->app_data, buf->data, len, - conn->data_prot, conn); + Curl_dyn_reset(&buf->buf); + } + else + return CURLE_RECV_ERROR; + + do { + char buffer[1024]; + nread = CURLMIN(len, (int)sizeof(buffer)); + result = socket_read(data, sockindex, buffer, (size_t)nread); + if(result) + return result; + result = Curl_dyn_addn(&buf->buf, buffer, nread); + if(result) + return result; + len -= nread; + } while(len); + /* this decodes the dynbuf *in place* */ + nread = conn->mech->decode(conn->app_data, + Curl_dyn_ptr(&buf->buf), + len, conn->data_prot, conn); if(nread < 0) return CURLE_RECV_ERROR; - buf->size = (size_t)nread; + Curl_dyn_setlen(&buf->buf, nread); buf->index = 0; return CURLE_OK; } @@ -549,9 +561,10 @@ static CURLcode read_data(struct Curl_easy *data, int sockindex, static size_t buffer_read(struct krb5buffer *buf, void *data, size_t len) { - if(buf->size - buf->index < len) - len = buf->size - buf->index; - memcpy(data, (char *)buf->data + buf->index, len); + size_t size = Curl_dyn_len(&buf->buf); + if(size - buf->index < len) + len = size - buf->index; + memcpy(data, Curl_dyn_ptr(&buf->buf) + buf->index, len); buf->index += len; return len; } @@ -586,7 +599,7 @@ static ssize_t sec_recv(struct Curl_easy *data, int sockindex, while(len > 0) { if(read_data(data, sockindex, &conn->in_buffer)) return -1; - if(conn->in_buffer.size == 0) { + if(Curl_dyn_len(&conn->in_buffer.buf) == 0) { if(bytes_read > 0) conn->in_buffer.eof_flag = 1; return bytes_read; @@ -610,7 +623,7 @@ static void do_sec_send(struct Curl_easy *data, struct connectdata *conn, size_t cmd_size = 0; CURLcode error; enum protection_level prot_level = conn->data_prot; - bool iscmd = (prot_level == PROT_CMD)?TRUE:FALSE; + bool iscmd = (prot_level == PROT_CMD); DEBUGASSERT(prot_level > PROT_NONE && prot_level < PROT_LAST); @@ -620,7 +633,7 @@ static void do_sec_send(struct Curl_easy *data, struct connectdata *conn, else prot_level = conn->command_prot; } - bytes = conn->mech->encode(conn->app_data, from, length, prot_level, + bytes = conn->mech->encode(conn->app_data, from, length, (int)prot_level, (void **)&buffer); if(!buffer || bytes <= 0) return; /* error */ @@ -642,13 +655,13 @@ static void do_sec_send(struct Curl_easy *data, struct connectdata *conn, socket_write(data, fd, cmd_buffer, cmd_size); socket_write(data, fd, "\r\n", 2); - infof(data, "Send: %s%s", prot_level == PROT_PRIVATE?enc:mic, + infof(data, "Send: %s%s", prot_level == PROT_PRIVATE ? enc : mic, cmd_buffer); free(cmd_buffer); } } else { - htonl_bytes = htonl(bytes); + htonl_bytes = (int)htonl((OM_uint32)bytes); socket_write(data, fd, &htonl_bytes, sizeof(htonl_bytes)); socket_write(data, fd, buffer, curlx_sitouz(bytes)); } @@ -676,10 +689,12 @@ static ssize_t sec_write(struct Curl_easy *data, struct connectdata *conn, /* Matches Curl_send signature */ static ssize_t sec_send(struct Curl_easy *data, int sockindex, - const void *buffer, size_t len, CURLcode *err) + const void *buffer, size_t len, bool eos, + CURLcode *err) { struct connectdata *conn = data->conn; curl_socket_t fd = conn->sock[sockindex]; + (void)eos; /* unused */ *err = CURLE_OK; return sec_write(data, conn, fd, buffer, len); } @@ -714,7 +729,7 @@ int Curl_sec_read_msg(struct Curl_easy *data, struct connectdata *conn, decoded_len = curlx_uztosi(decoded_sz); decoded_len = conn->mech->decode(conn->app_data, buf, decoded_len, - level, conn); + (int)level, conn); if(decoded_len <= 0) { free(buf); return -1; @@ -779,7 +794,7 @@ static int sec_set_protection_level(struct Curl_easy *data) if(pbsz) { /* stick to default value if the check fails */ if(ISDIGIT(pbsz[5])) - buffer_size = atoi(&pbsz[5]); + buffer_size = (unsigned int)atoi(&pbsz[5]); if(buffer_size < conn->buffer_size) conn->buffer_size = buffer_size; } @@ -835,6 +850,7 @@ static CURLcode choose_mech(struct Curl_easy *data, struct connectdata *conn) mech->name); return CURLE_FAILED_INIT; } + Curl_dyn_init(&conn->in_buffer.buf, CURL_MAX_INPUT_LENGTH); } infof(data, "Trying mechanism %s...", mech->name); @@ -867,7 +883,7 @@ static CURLcode choose_mech(struct Curl_easy *data, struct connectdata *conn) if(ret != AUTH_CONTINUE) { if(ret != AUTH_OK) { - /* Mechanism has dumped the error to stderr, don't error here. */ + /* Mechanism has dumped the error to stderr, do not error here. */ return CURLE_USE_SSL_FAILED; } DEBUGASSERT(ret == AUTH_OK); @@ -899,15 +915,10 @@ Curl_sec_end(struct connectdata *conn) { if(conn->mech && conn->mech->end) conn->mech->end(conn->app_data); - free(conn->app_data); - conn->app_data = NULL; - if(conn->in_buffer.data) { - free(conn->in_buffer.data); - conn->in_buffer.data = NULL; - conn->in_buffer.size = 0; - conn->in_buffer.index = 0; - conn->in_buffer.eof_flag = 0; - } + Curl_safefree(conn->app_data); + Curl_dyn_free(&conn->in_buffer.buf); + conn->in_buffer.index = 0; + conn->in_buffer.eof_flag = 0; conn->sec_complete = 0; conn->data_prot = PROT_CLEAR; conn->mech = NULL; diff --git a/deps/curl/lib/ldap.c b/deps/curl/lib/ldap.c index 53497a5c..01429ba7 100644 --- a/deps/curl/lib/ldap.c +++ b/deps/curl/lib/ldap.c @@ -143,7 +143,7 @@ static void _ldap_free_urldesc(LDAPURLDesc *ludp); #endif #if defined(USE_WIN32_LDAP) && defined(ldap_err2string) -/* Use ansi error strings in UNICODE builds */ +/* Use ANSI error strings in Unicode builds */ #undef ldap_err2string #define ldap_err2string ldap_err2stringA #endif @@ -164,7 +164,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done); */ const struct Curl_handler Curl_handler_ldap = { - "LDAP", /* scheme */ + "ldap", /* scheme */ ZERO_NULL, /* setup_connection */ ldap_do, /* do_it */ ZERO_NULL, /* done */ @@ -178,6 +178,7 @@ const struct Curl_handler Curl_handler_ldap = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_LDAP, /* defport */ @@ -192,7 +193,7 @@ const struct Curl_handler Curl_handler_ldap = { */ const struct Curl_handler Curl_handler_ldaps = { - "LDAPS", /* scheme */ + "ldaps", /* scheme */ ZERO_NULL, /* setup_connection */ ldap_do, /* do_it */ ZERO_NULL, /* done */ @@ -206,6 +207,7 @@ const struct Curl_handler Curl_handler_ldaps = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_LDAPS, /* defport */ @@ -250,16 +252,17 @@ static int ldap_win_bind_auth(LDAP *server, const char *user, } if(method && user && passwd) { - rc = Curl_create_sspi_identity(user, passwd, &cred); + CURLcode res = Curl_create_sspi_identity(user, passwd, &cred); + rc = (int)res; if(!rc) { - rc = ldap_bind_s(server, NULL, (TCHAR *)&cred, method); + rc = (int)ldap_bind_s(server, NULL, (TCHAR *)&cred, method); Curl_sspi_free_identity(&cred); } } else { /* proceed with current user credentials */ method = LDAP_AUTH_NEGOTIATE; - rc = ldap_bind_s(server, NULL, NULL, method); + rc = (int)ldap_bind_s(server, NULL, NULL, method); } return rc; } @@ -277,14 +280,14 @@ static int ldap_win_bind(struct Curl_easy *data, LDAP *server, inuser = curlx_convert_UTF8_to_tchar((char *) user); inpass = curlx_convert_UTF8_to_tchar((char *) passwd); - rc = ldap_simple_bind_s(server, inuser, inpass); + rc = (int)ldap_simple_bind_s(server, inuser, inpass); curlx_unicodefree(inuser); curlx_unicodefree(inpass); } #if defined(USE_WINDOWS_SSPI) else { - rc = ldap_win_bind_auth(server, user, passwd, data->set.httpauth); + rc = (int)ldap_win_bind_auth(server, user, passwd, data->set.httpauth); } #endif @@ -294,8 +297,10 @@ static int ldap_win_bind(struct Curl_easy *data, LDAP *server, #if defined(USE_WIN32_LDAP) #define FREE_ON_WINLDAP(x) curlx_unicodefree(x) +#define curl_ldap_num_t ULONG #else #define FREE_ON_WINLDAP(x) +#define curl_ldap_num_t int #endif @@ -335,7 +340,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) rc = _ldap_url_parse(data, conn, &ludp); #endif if(rc) { - failf(data, "Bad LDAP URL: %s", ldap_err2string(rc)); + failf(data, "Bad LDAP URL: %s", ldap_err2string((curl_ldap_num_t)rc)); result = CURLE_URL_MALFORMAT; goto quit; } @@ -370,8 +375,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) if(ldap_ssl) { #ifdef HAVE_LDAP_SSL #ifdef USE_WIN32_LDAP - /* Win32 LDAP SDK doesn't support insecure mode without CA! */ - server = ldap_sslinit(host, conn->port, 1); + /* Win32 LDAP SDK does not support insecure mode without CA! */ + server = ldap_sslinit(host, (curl_ldap_num_t)conn->primary.remote_port, 1); ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON); #else int ldap_option; @@ -417,10 +422,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) result = CURLE_SSL_CERTPROBLEM; goto quit; } - server = ldapssl_init(host, conn->port, 1); + server = ldapssl_init(host, conn->primary.remote_port, 1); if(!server) { failf(data, "LDAP local: Cannot connect to %s:%u", - conn->host.dispname, conn->port); + conn->host.dispname, conn->primary.remote_port); result = CURLE_COULDNT_CONNECT; goto quit; } @@ -458,10 +463,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) result = CURLE_SSL_CERTPROBLEM; goto quit; } - server = ldap_init(host, conn->port); + server = ldap_init(host, conn->primary.remote_port); if(!server) { failf(data, "LDAP local: Cannot connect to %s:%u", - conn->host.dispname, conn->port); + conn->host.dispname, conn->primary.remote_port); result = CURLE_COULDNT_CONNECT; goto quit; } @@ -483,6 +488,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) } */ #else + (void)ldap_option; + (void)ldap_ca; /* 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 " @@ -499,10 +506,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) goto quit; } else { - server = ldap_init(host, conn->port); + server = ldap_init(host, (curl_ldap_num_t)conn->primary.remote_port); if(!server) { failf(data, "LDAP local: Cannot connect to %s:%u", - conn->host.dispname, conn->port); + conn->host.dispname, conn->primary.remote_port); result = CURLE_COULDNT_CONNECT; goto quit; } @@ -525,7 +532,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) if(rc) { #ifdef USE_WIN32_LDAP failf(data, "LDAP local: bind via ldap_win_bind %s", - ldap_err2string(rc)); + ldap_err2string((ULONG)rc)); #else failf(data, "LDAP local: bind via ldap_simple_bind_s %s", ldap_err2string(rc)); @@ -535,16 +542,18 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) } Curl_pgrsSetDownloadCounter(data, 0); - rc = ldap_search_s(server, ludp->lud_dn, ludp->lud_scope, - ludp->lud_filter, ludp->lud_attrs, 0, &ldapmsg); + rc = (int)ldap_search_s(server, ludp->lud_dn, + (curl_ldap_num_t)ludp->lud_scope, + ludp->lud_filter, ludp->lud_attrs, 0, &ldapmsg); if(rc && rc != LDAP_SIZELIMIT_EXCEEDED) { - failf(data, "LDAP remote: %s", ldap_err2string(rc)); + failf(data, "LDAP remote: %s", ldap_err2string((curl_ldap_num_t)rc)); result = CURLE_LDAP_SEARCH_FAILED; goto quit; } - for(num = 0, entryIterator = ldap_first_entry(server, ldapmsg); + num = 0; + for(entryIterator = ldap_first_entry(server, ldapmsg); entryIterator; entryIterator = ldap_next_entry(server, entryIterator), num++) { BerElement *ber = NULL; @@ -749,7 +758,7 @@ quit: FREE_ON_WINLDAP(host); /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); connclose(conn, "LDAP connection always disable reuse"); return result; diff --git a/deps/curl/libcurl.def b/deps/curl/lib/libcurl.def similarity index 98% rename from deps/curl/libcurl.def rename to deps/curl/lib/libcurl.def index c6c96063..9bf9fcc9 100644 --- a/deps/curl/libcurl.def +++ b/deps/curl/lib/libcurl.def @@ -64,6 +64,7 @@ curl_multi_socket_all curl_multi_strerror curl_multi_timeout curl_multi_wait +curl_multi_waitfds curl_multi_wakeup curl_mvaprintf curl_mvfprintf diff --git a/deps/curl/lib/libcurl.plist.in b/deps/curl/lib/libcurl.plist.in deleted file mode 100644 index d2e6492f..00000000 --- a/deps/curl/lib/libcurl.plist.in +++ /dev/null @@ -1,35 +0,0 @@ - - - - - CFBundleInfoDictionaryVersion - 6.0 - - CFBundleDevelopmentRegion - English - - CFBundleExecutable - curl - - CFBundleIdentifier - se.curl.libcurl - - CFBundleVersion - @CURL_PLIST_VERSION@ - - CFBundleName - libcurl - - CFBundlePackageType - FMWK - - CFBundleSignature - ???? - - CFBundleShortVersionString - libcurl @CURL_PLIST_VERSION@ - - CFBundleGetInfoString - libcurl.plist @CURL_PLIST_VERSION@ - - diff --git a/deps/curl/lib/libcurl.rc b/deps/curl/lib/libcurl.rc index daa2d62d..1ceb4691 100644 --- a/deps/curl/lib/libcurl.rc +++ b/deps/curl/lib/libcurl.rc @@ -32,7 +32,7 @@ VS_VERSION_INFO VERSIONINFO FILEVERSION RC_VERSION PRODUCTVERSION RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#if defined(DEBUGBUILD) || defined(_DEBUG) +#if defined(DEBUGBUILD) || defined(UNITTESTS) || defined(CURLDEBUG) || defined(_DEBUG) FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0L diff --git a/deps/curl/lib/libcurl.vers.in b/deps/curl/lib/libcurl.vers.in index ae978a48..82196699 100644 --- a/deps/curl/lib/libcurl.vers.in +++ b/deps/curl/lib/libcurl.vers.in @@ -1,12 +1,4 @@ -HIDDEN -{ - local: - __*; - _rest*; - _save*; -}; - -CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@4 +CURL_@CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX@@CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME@ { global: curl_*; local: *; diff --git a/deps/curl/lib/llist.c b/deps/curl/lib/llist.c index 5b6b0336..e5c65fb9 100644 --- a/deps/curl/lib/llist.c +++ b/deps/curl/lib/llist.c @@ -32,16 +32,34 @@ /* this must be the last include file */ #include "memdebug.h" +#define LLISTINIT 0x100cc001 /* random pattern */ +#define NODEINIT 0x12344321 /* random pattern */ +#define NODEREM 0x54321012 /* random pattern */ + + +#ifdef DEBUGBUILD +#define VERIFYNODE(x) verifynode(x) +static struct Curl_llist_node *verifynode(struct Curl_llist_node *n) +{ + DEBUGASSERT(!n || (n->_init == NODEINIT)); + return n; +} +#else +#define VERIFYNODE(x) x +#endif /* * @unittest: 1300 */ void Curl_llist_init(struct Curl_llist *l, Curl_llist_dtor dtor) { - l->size = 0; - l->dtor = dtor; - l->head = NULL; - l->tail = NULL; + l->_size = 0; + l->_dtor = dtor; + l->_head = NULL; + l->_tail = NULL; +#ifdef DEBUGBUILD + l->_init = LLISTINIT; +#endif } /* @@ -56,91 +74,193 @@ 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_element *e, +Curl_llist_insert_next(struct Curl_llist *list, + struct Curl_llist_node *e, /* may be NULL */ const void *p, - struct Curl_llist_element *ne) + struct Curl_llist_node *ne) { - ne->ptr = (void *) p; - if(list->size == 0) { - list->head = ne; - list->head->prev = NULL; - list->head->next = NULL; - list->tail = ne; + DEBUGASSERT(list); + DEBUGASSERT(list->_init == LLISTINIT); + DEBUGASSERT(ne); + +#ifdef DEBUGBUILD + ne->_init = NODEINIT; +#endif + ne->_ptr = (void *) p; + ne->_list = list; + if(list->_size == 0) { + list->_head = ne; + list->_head->_prev = NULL; + list->_head->_next = NULL; + list->_tail = ne; } else { /* if 'e' is NULL here, we insert the new element first in the list */ - ne->next = e?e->next:list->head; - ne->prev = e; + ne->_next = e ? e->_next : list->_head; + ne->_prev = e; if(!e) { - list->head->prev = ne; - list->head = ne; + list->_head->_prev = ne; + list->_head = ne; } - else if(e->next) { - e->next->prev = ne; + else if(e->_next) { + e->_next->_prev = ne; } else { - list->tail = ne; + list->_tail = ne; } if(e) - e->next = ne; + e->_next = ne; } - ++list->size; + ++list->_size; +} + +/* + * Curl_llist_append() + * + * Adds a new list element to the end of the list. + * + * The 'ne' argument should be a pointer into the object to store. + * + * @unittest: 1300 + */ +void +Curl_llist_append(struct Curl_llist *list, const void *p, + struct Curl_llist_node *ne) +{ + DEBUGASSERT(list); + DEBUGASSERT(list->_init == LLISTINIT); + DEBUGASSERT(ne); + Curl_llist_insert_next(list, list->_tail, p, ne); } /* * @unittest: 1300 */ void -Curl_llist_remove(struct Curl_llist *list, struct Curl_llist_element *e, - void *user) +Curl_node_uremove(struct Curl_llist_node *e, void *user) { void *ptr; - if(!e || list->size == 0) + struct Curl_llist *list; + if(!e) return; - if(e == list->head) { - list->head = e->next; + list = e->_list; + DEBUGASSERT(list); + DEBUGASSERT(list->_init == LLISTINIT); + DEBUGASSERT(list->_size); + DEBUGASSERT(e->_init == NODEINIT); + if(e == list->_head) { + list->_head = e->_next; - if(!list->head) - list->tail = NULL; + if(!list->_head) + list->_tail = NULL; else - e->next->prev = NULL; + e->_next->_prev = NULL; } else { - if(e->prev) - e->prev->next = e->next; + if(e->_prev) + e->_prev->_next = e->_next; - if(!e->next) - list->tail = e->prev; + if(!e->_next) + list->_tail = e->_prev; else - e->next->prev = e->prev; + e->_next->_prev = e->_prev; } - ptr = e->ptr; + ptr = e->_ptr; - e->ptr = NULL; - e->prev = NULL; - e->next = NULL; + e->_list = NULL; + e->_ptr = NULL; + e->_prev = NULL; + e->_next = NULL; +#ifdef DEBUGBUILD + e->_init = NODEREM; /* specific pattern on remove - not zero */ +#endif - --list->size; + --list->_size; /* call the dtor() last for when it actually frees the 'e' memory itself */ - if(list->dtor) - list->dtor(user, ptr); + if(list->_dtor) + list->_dtor(user, ptr); +} + +void Curl_node_remove(struct Curl_llist_node *e) +{ + Curl_node_uremove(e, NULL); } void Curl_llist_destroy(struct Curl_llist *list, void *user) { if(list) { - while(list->size > 0) - Curl_llist_remove(list, list->tail, user); + DEBUGASSERT(list->_init == LLISTINIT); + while(list->_size > 0) + Curl_node_uremove(list->_tail, user); } } -size_t -Curl_llist_count(struct Curl_llist *list) +/* Curl_llist_head() returns the first 'struct Curl_llist_node *', which + might be NULL */ +struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list) { - return list->size; + DEBUGASSERT(list); + DEBUGASSERT(list->_init == LLISTINIT); + return VERIFYNODE(list->_head); +} + +#ifdef UNITTESTS +/* Curl_llist_tail() returns the last 'struct Curl_llist_node *', which + might be NULL */ +struct Curl_llist_node *Curl_llist_tail(struct Curl_llist *list) +{ + DEBUGASSERT(list); + DEBUGASSERT(list->_init == LLISTINIT); + return VERIFYNODE(list->_tail); +} +#endif + +/* Curl_llist_count() returns a size_t the number of nodes in the list */ +size_t Curl_llist_count(struct Curl_llist *list) +{ + DEBUGASSERT(list); + DEBUGASSERT(list->_init == LLISTINIT); + return list->_size; +} + +/* Curl_node_elem() returns the custom data from a Curl_llist_node */ +void *Curl_node_elem(struct Curl_llist_node *n) +{ + DEBUGASSERT(n); + DEBUGASSERT(n->_init == NODEINIT); + return n->_ptr; +} + +/* Curl_node_next() returns the next element in a list from a given + Curl_llist_node */ +struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *n) +{ + DEBUGASSERT(n); + DEBUGASSERT(n->_init == NODEINIT); + return VERIFYNODE(n->_next); +} + +#ifdef UNITTESTS + +/* Curl_node_prev() returns the previous element in a list from a given + Curl_llist_node */ +struct Curl_llist_node *Curl_node_prev(struct Curl_llist_node *n) +{ + DEBUGASSERT(n); + DEBUGASSERT(n->_init == NODEINIT); + return VERIFYNODE(n->_prev); +} + +#endif + +struct Curl_llist *Curl_node_llist(struct Curl_llist_node *n) +{ + DEBUGASSERT(n); + DEBUGASSERT(!n->_list || n->_init == NODEINIT); + return n->_list; } diff --git a/deps/curl/lib/llist.h b/deps/curl/lib/llist.h index 320580e3..26581869 100644 --- a/deps/curl/lib/llist.h +++ b/deps/curl/lib/llist.h @@ -27,26 +27,63 @@ #include "curl_setup.h" #include -typedef void (*Curl_llist_dtor)(void *, void *); +typedef void (*Curl_llist_dtor)(void *user, void *elem); -struct Curl_llist_element { - void *ptr; - struct Curl_llist_element *prev; - struct Curl_llist_element *next; -}; +/* none of these struct members should be referenced directly, use the + dedicated functions */ struct Curl_llist { - struct Curl_llist_element *head; - struct Curl_llist_element *tail; - Curl_llist_dtor dtor; - size_t size; + struct Curl_llist_node *_head; + struct Curl_llist_node *_tail; + Curl_llist_dtor _dtor; + size_t _size; +#ifdef DEBUGBUILD + int _init; /* detect API usage mistakes */ +#endif +}; + +struct Curl_llist_node { + struct Curl_llist *_list; /* the list where this belongs */ + void *_ptr; + struct Curl_llist_node *_prev; + struct Curl_llist_node *_next; +#ifdef DEBUGBUILD + int _init; /* detect API usage mistakes */ +#endif }; void Curl_llist_init(struct Curl_llist *, Curl_llist_dtor); -void Curl_llist_insert_next(struct Curl_llist *, struct Curl_llist_element *, - const void *, struct Curl_llist_element *node); -void Curl_llist_remove(struct Curl_llist *, struct Curl_llist_element *, - void *); -size_t Curl_llist_count(struct Curl_llist *); +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_node_uremove(struct Curl_llist_node *, void *); +void Curl_node_remove(struct Curl_llist_node *); void Curl_llist_destroy(struct Curl_llist *, void *); + +/* Curl_llist_head() returns the first 'struct Curl_llist_node *', which + might be NULL */ +struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list); + +/* Curl_llist_tail() returns the last 'struct Curl_llist_node *', which + might be NULL */ +struct Curl_llist_node *Curl_llist_tail(struct Curl_llist *list); + +/* Curl_llist_count() returns a size_t the number of nodes in the list */ +size_t Curl_llist_count(struct Curl_llist *list); + +/* Curl_node_elem() returns the custom data from a Curl_llist_node */ +void *Curl_node_elem(struct Curl_llist_node *n); + +/* Curl_node_next() returns the next element in a list from a given + Curl_llist_node */ +struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *n); + +/* Curl_node_prev() returns the previous element in a list from a given + Curl_llist_node */ +struct Curl_llist_node *Curl_node_prev(struct Curl_llist_node *n); + +/* Curl_node_llist() return the list the node is in or NULL. */ +struct Curl_llist *Curl_node_llist(struct Curl_llist_node *n); + #endif /* HEADER_CURL_LLIST_H */ diff --git a/deps/curl/lib/macos.c b/deps/curl/lib/macos.c index 9e8e76e8..e4662be1 100644 --- a/deps/curl/lib/macos.c +++ b/deps/curl/lib/macos.c @@ -34,21 +34,19 @@ CURLcode Curl_macos_init(void) { - { - /* - * The automagic conversion from IPv4 literals to IPv6 literals only - * works if the SCDynamicStoreCopyProxies system function gets called - * first. As Curl currently doesn't support system-wide HTTP proxies, we - * therefore don't use any value this function might return. - * - * This function is only available on macOS and is not needed for - * IPv4-only builds, hence the conditions for defining - * CURL_MACOS_CALL_COPYPROXIES in curl_setup.h. - */ - CFDictionaryRef dict = SCDynamicStoreCopyProxies(NULL); - if(dict) - CFRelease(dict); - } + /* + * The automagic conversion from IPv4 literals to IPv6 literals only + * works if the SCDynamicStoreCopyProxies system function gets called + * first. As Curl currently does not support system-wide HTTP proxies, we + * therefore do not use any value this function might return. + * + * This function is only available on macOS and is not needed for + * IPv4-only builds, hence the conditions for defining + * CURL_MACOS_CALL_COPYPROXIES in curl_setup.h. + */ + CFDictionaryRef dict = SCDynamicStoreCopyProxies(NULL); + if(dict) + CFRelease(dict); return CURLE_OK; } diff --git a/deps/curl/lib/md4.c b/deps/curl/lib/md4.c index 58dd1166..f006bdcf 100644 --- a/deps/curl/lib/md4.c +++ b/deps/curl/lib/md4.c @@ -37,6 +37,9 @@ #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) && !defined(USE_AMISSL) /* OpenSSL 3.0.0 marks the MD4 functions as deprecated */ #define OPENSSL_NO_MD4 +#else +/* Cover also OPENSSL_NO_MD4 configured in openssl */ +#include #endif #endif /* USE_OPENSSL */ @@ -55,7 +58,8 @@ #else #include #endif -#if(MBEDTLS_VERSION_NUMBER >= 0x02070000) +#if(MBEDTLS_VERSION_NUMBER >= 0x02070000) && \ + (MBEDTLS_VERSION_NUMBER < 0x03000000) #define HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS #endif #endif /* USE_MBEDTLS */ @@ -216,7 +220,7 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) } #else -/* When no other crypto library is available, or the crypto library doesn't +/* When no other crypto library is available, or the crypto library does not * support MD4, we use this code segment this implementation of it * * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. @@ -228,8 +232,8 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) * Author: * Alexander Peslyak, better known as Solar Designer * - * This software was written by Alexander Peslyak in 2001. No copyright is - * claimed, and the software is hereby placed in the public domain. In case + * This software was written by Alexander Peslyak in 2001. No copyright is + * claimed, and the software is hereby placed in the public domain. In case * this attempt to disclaim copyright and place the software in the public * domain is deemed null and void, then the software is Copyright (c) 2001 * Alexander Peslyak and it is hereby released to the general public under the @@ -238,19 +242,19 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) * Redistribution and use in source and binary forms, with or without * modification, are permitted. * - * There's ABSOLUTELY NO WARRANTY, express or implied. + * There is ABSOLUTELY NO WARRANTY, express or implied. * * (This is a heavily cut-down "BSD license".) * * This differs from Colin Plumb's older public domain implementation in that * no exactly 32-bit integer data type is required (any 32-bit or wider - * unsigned integer data type will do), there's no compile-time endianness - * configuration, and the function prototypes match OpenSSL's. No code from + * unsigned integer data type will do), there is no compile-time endianness + * configuration, and the function prototypes match OpenSSL's. No code from * Colin Plumb's implementation has been reused; this comment merely compares * the properties of the two independent implementations. * * The primary goals of this implementation are portability and ease of use. - * It is meant to be fast, but not as fast as possible. Some known + * It is meant to be fast, but not as fast as possible. Some known * optimizations are not included to reduce source code size and avoid * compile-time configuration. */ @@ -276,14 +280,14 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx); * F and G are optimized compared to their RFC 1320 definitions, with the * optimization for F borrowed from Colin Plumb's MD5 implementation. */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define MD4_F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define MD4_G(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) +#define MD4_H(x, y, z) ((x) ^ (y) ^ (z)) /* * The MD4 transformation for all three rounds. */ -#define STEP(f, a, b, c, d, x, s) \ +#define MD4_STEP(f, a, b, c, d, x, s) \ (a) += f((b), (c), (d)) + (x); \ (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); @@ -292,30 +296,31 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx); * in a properly aligned word in host byte order. * * The check for little-endian architectures that tolerate unaligned - * memory accesses is just an optimization. Nothing will break if it - * doesn't work. + * memory accesses is just an optimization. Nothing will break if it + * does not work. */ #if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define SET(n) \ +#define MD4_SET(n) \ (*(MD4_u32plus *)(void *)&ptr[(n) * 4]) -#define GET(n) \ - SET(n) +#define MD4_GET(n) \ + MD4_SET(n) #else -#define SET(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 GET(n) \ +#define MD4_GET(n) \ (ctx->block[(n)]) #endif /* * This processes one or more 64-byte data blocks, but does NOT update - * the bit counters. There are no alignment requirements. + * the bit counters. There are no alignment requirements. */ -static const void *body(MD4_CTX *ctx, const void *data, unsigned long size) +static const void *my_md4_body(MD4_CTX *ctx, + const void *data, unsigned long size) { const unsigned char *ptr; MD4_u32plus a, b, c, d; @@ -336,58 +341,58 @@ static const void *body(MD4_CTX *ctx, const void *data, unsigned long size) saved_d = d; /* Round 1 */ - STEP(F, a, b, c, d, SET(0), 3) - STEP(F, d, a, b, c, SET(1), 7) - STEP(F, c, d, a, b, SET(2), 11) - STEP(F, b, c, d, a, SET(3), 19) - STEP(F, a, b, c, d, SET(4), 3) - STEP(F, d, a, b, c, SET(5), 7) - STEP(F, c, d, a, b, SET(6), 11) - STEP(F, b, c, d, a, SET(7), 19) - STEP(F, a, b, c, d, SET(8), 3) - STEP(F, d, a, b, c, SET(9), 7) - STEP(F, c, d, a, b, SET(10), 11) - STEP(F, b, c, d, a, SET(11), 19) - STEP(F, a, b, c, d, SET(12), 3) - STEP(F, d, a, b, c, SET(13), 7) - STEP(F, c, d, a, b, SET(14), 11) - STEP(F, b, c, d, a, SET(15), 19) + MD4_STEP(MD4_F, a, b, c, d, MD4_SET(0), 3) + MD4_STEP(MD4_F, d, a, b, c, MD4_SET(1), 7) + MD4_STEP(MD4_F, c, d, a, b, MD4_SET(2), 11) + MD4_STEP(MD4_F, b, c, d, a, MD4_SET(3), 19) + MD4_STEP(MD4_F, a, b, c, d, MD4_SET(4), 3) + MD4_STEP(MD4_F, d, a, b, c, MD4_SET(5), 7) + MD4_STEP(MD4_F, c, d, a, b, MD4_SET(6), 11) + MD4_STEP(MD4_F, b, c, d, a, MD4_SET(7), 19) + MD4_STEP(MD4_F, a, b, c, d, MD4_SET(8), 3) + MD4_STEP(MD4_F, d, a, b, c, MD4_SET(9), 7) + MD4_STEP(MD4_F, c, d, a, b, MD4_SET(10), 11) + MD4_STEP(MD4_F, b, c, d, a, MD4_SET(11), 19) + MD4_STEP(MD4_F, a, b, c, d, MD4_SET(12), 3) + MD4_STEP(MD4_F, d, a, b, c, MD4_SET(13), 7) + MD4_STEP(MD4_F, c, d, a, b, MD4_SET(14), 11) + MD4_STEP(MD4_F, b, c, d, a, MD4_SET(15), 19) /* Round 2 */ - STEP(G, a, b, c, d, GET(0) + 0x5a827999, 3) - STEP(G, d, a, b, c, GET(4) + 0x5a827999, 5) - STEP(G, c, d, a, b, GET(8) + 0x5a827999, 9) - STEP(G, b, c, d, a, GET(12) + 0x5a827999, 13) - STEP(G, a, b, c, d, GET(1) + 0x5a827999, 3) - STEP(G, d, a, b, c, GET(5) + 0x5a827999, 5) - STEP(G, c, d, a, b, GET(9) + 0x5a827999, 9) - STEP(G, b, c, d, a, GET(13) + 0x5a827999, 13) - STEP(G, a, b, c, d, GET(2) + 0x5a827999, 3) - STEP(G, d, a, b, c, GET(6) + 0x5a827999, 5) - STEP(G, c, d, a, b, GET(10) + 0x5a827999, 9) - STEP(G, b, c, d, a, GET(14) + 0x5a827999, 13) - STEP(G, a, b, c, d, GET(3) + 0x5a827999, 3) - STEP(G, d, a, b, c, GET(7) + 0x5a827999, 5) - STEP(G, c, d, a, b, GET(11) + 0x5a827999, 9) - STEP(G, b, c, d, a, GET(15) + 0x5a827999, 13) + MD4_STEP(MD4_G, a, b, c, d, MD4_GET(0) + 0x5a827999, 3) + MD4_STEP(MD4_G, d, a, b, c, MD4_GET(4) + 0x5a827999, 5) + MD4_STEP(MD4_G, c, d, a, b, MD4_GET(8) + 0x5a827999, 9) + MD4_STEP(MD4_G, b, c, d, a, MD4_GET(12) + 0x5a827999, 13) + MD4_STEP(MD4_G, a, b, c, d, MD4_GET(1) + 0x5a827999, 3) + MD4_STEP(MD4_G, d, a, b, c, MD4_GET(5) + 0x5a827999, 5) + MD4_STEP(MD4_G, c, d, a, b, MD4_GET(9) + 0x5a827999, 9) + MD4_STEP(MD4_G, b, c, d, a, MD4_GET(13) + 0x5a827999, 13) + MD4_STEP(MD4_G, a, b, c, d, MD4_GET(2) + 0x5a827999, 3) + MD4_STEP(MD4_G, d, a, b, c, MD4_GET(6) + 0x5a827999, 5) + MD4_STEP(MD4_G, c, d, a, b, MD4_GET(10) + 0x5a827999, 9) + MD4_STEP(MD4_G, b, c, d, a, MD4_GET(14) + 0x5a827999, 13) + MD4_STEP(MD4_G, a, b, c, d, MD4_GET(3) + 0x5a827999, 3) + MD4_STEP(MD4_G, d, a, b, c, MD4_GET(7) + 0x5a827999, 5) + MD4_STEP(MD4_G, c, d, a, b, MD4_GET(11) + 0x5a827999, 9) + MD4_STEP(MD4_G, b, c, d, a, MD4_GET(15) + 0x5a827999, 13) /* Round 3 */ - STEP(H, a, b, c, d, GET(0) + 0x6ed9eba1, 3) - STEP(H, d, a, b, c, GET(8) + 0x6ed9eba1, 9) - STEP(H, c, d, a, b, GET(4) + 0x6ed9eba1, 11) - STEP(H, b, c, d, a, GET(12) + 0x6ed9eba1, 15) - STEP(H, a, b, c, d, GET(2) + 0x6ed9eba1, 3) - STEP(H, d, a, b, c, GET(10) + 0x6ed9eba1, 9) - STEP(H, c, d, a, b, GET(6) + 0x6ed9eba1, 11) - STEP(H, b, c, d, a, GET(14) + 0x6ed9eba1, 15) - STEP(H, a, b, c, d, GET(1) + 0x6ed9eba1, 3) - STEP(H, d, a, b, c, GET(9) + 0x6ed9eba1, 9) - STEP(H, c, d, a, b, GET(5) + 0x6ed9eba1, 11) - STEP(H, b, c, d, a, GET(13) + 0x6ed9eba1, 15) - STEP(H, a, b, c, d, GET(3) + 0x6ed9eba1, 3) - STEP(H, d, a, b, c, GET(11) + 0x6ed9eba1, 9) - STEP(H, c, d, a, b, GET(7) + 0x6ed9eba1, 11) - STEP(H, b, c, d, a, GET(15) + 0x6ed9eba1, 15) + MD4_STEP(MD4_H, a, b, c, d, MD4_GET(0) + 0x6ed9eba1, 3) + MD4_STEP(MD4_H, d, a, b, c, MD4_GET(8) + 0x6ed9eba1, 9) + MD4_STEP(MD4_H, c, d, a, b, MD4_GET(4) + 0x6ed9eba1, 11) + MD4_STEP(MD4_H, b, c, d, a, MD4_GET(12) + 0x6ed9eba1, 15) + MD4_STEP(MD4_H, a, b, c, d, MD4_GET(2) + 0x6ed9eba1, 3) + MD4_STEP(MD4_H, d, a, b, c, MD4_GET(10) + 0x6ed9eba1, 9) + MD4_STEP(MD4_H, c, d, a, b, MD4_GET(6) + 0x6ed9eba1, 11) + MD4_STEP(MD4_H, b, c, d, a, MD4_GET(14) + 0x6ed9eba1, 15) + MD4_STEP(MD4_H, a, b, c, d, MD4_GET(1) + 0x6ed9eba1, 3) + MD4_STEP(MD4_H, d, a, b, c, MD4_GET(9) + 0x6ed9eba1, 9) + MD4_STEP(MD4_H, c, d, a, b, MD4_GET(5) + 0x6ed9eba1, 11) + MD4_STEP(MD4_H, b, c, d, a, MD4_GET(13) + 0x6ed9eba1, 15) + MD4_STEP(MD4_H, a, b, c, d, MD4_GET(3) + 0x6ed9eba1, 3) + MD4_STEP(MD4_H, d, a, b, c, MD4_GET(11) + 0x6ed9eba1, 9) + MD4_STEP(MD4_H, c, d, a, b, MD4_GET(7) + 0x6ed9eba1, 11) + MD4_STEP(MD4_H, b, c, d, a, MD4_GET(15) + 0x6ed9eba1, 15) a += saved_a; b += saved_b; @@ -441,11 +446,11 @@ static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size) memcpy(&ctx->buffer[used], data, available); data = (const unsigned char *)data + available; size -= available; - body(ctx, ctx->buffer, 64); + my_md4_body(ctx, ctx->buffer, 64); } if(size >= 64) { - data = body(ctx, data, size & ~(unsigned long)0x3f); + data = my_md4_body(ctx, data, size & ~(unsigned long)0x3f); size &= 0x3f; } @@ -464,7 +469,7 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) if(available < 8) { memset(&ctx->buffer[used], 0, available); - body(ctx, ctx->buffer, 64); + my_md4_body(ctx, ctx->buffer, 64); used = 0; available = 64; } @@ -481,7 +486,7 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff); ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24); - body(ctx, ctx->buffer, 64); + my_md4_body(ctx, ctx->buffer, 64); result[0] = curlx_ultouc((ctx->a)&0xff); result[1] = curlx_ultouc((ctx->a >> 8)&0xff); diff --git a/deps/curl/lib/md5.c b/deps/curl/lib/md5.c index 01415af9..73e04e37 100644 --- a/deps/curl/lib/md5.c +++ b/deps/curl/lib/md5.c @@ -88,20 +88,20 @@ typedef struct md5_ctx my_md5_ctx; -static CURLcode my_md5_init(my_md5_ctx *ctx) +static CURLcode my_md5_init(void *ctx) { md5_init(ctx); return CURLE_OK; } -static void my_md5_update(my_md5_ctx *ctx, +static void my_md5_update(void *ctx, const unsigned char *input, unsigned int inputLen) { md5_update(ctx, inputLen, input); } -static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) +static void my_md5_final(unsigned char *digest, void *ctx) { md5_digest(ctx, 16, digest); } @@ -110,7 +110,7 @@ static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) typedef MD5_CTX my_md5_ctx; -static CURLcode my_md5_init(my_md5_ctx *ctx) +static CURLcode my_md5_init(void *ctx) { if(!MD5_Init(ctx)) return CURLE_OUT_OF_MEMORY; @@ -118,14 +118,14 @@ static CURLcode my_md5_init(my_md5_ctx *ctx) return CURLE_OK; } -static void my_md5_update(my_md5_ctx *ctx, +static void my_md5_update(void *ctx, const unsigned char *input, unsigned int len) { (void)MD5_Update(ctx, input, len); } -static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) +static void my_md5_final(unsigned char *digest, void *ctx) { (void)MD5_Final(digest, ctx); } @@ -134,7 +134,7 @@ static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) typedef mbedtls_md5_context my_md5_ctx; -static CURLcode my_md5_init(my_md5_ctx *ctx) +static CURLcode my_md5_init(void *ctx) { #if (MBEDTLS_VERSION_NUMBER >= 0x03000000) if(mbedtls_md5_starts(ctx)) @@ -148,7 +148,7 @@ static CURLcode my_md5_init(my_md5_ctx *ctx) return CURLE_OK; } -static void my_md5_update(my_md5_ctx *ctx, +static void my_md5_update(void *ctx, const unsigned char *data, unsigned int length) { @@ -159,7 +159,7 @@ static void my_md5_update(my_md5_ctx *ctx, #endif } -static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) +static void my_md5_final(unsigned char *digest, void *ctx) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) (void) mbedtls_md5_finish(ctx, digest); @@ -172,13 +172,13 @@ static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) /* For Apple operating systems: CommonCrypto has the functions we need. These functions are available on Tiger and later, as well as iOS 2.0 - and later. If you're building for an older cat, well, sorry. + and later. If you are building for an older cat, well, sorry. Declaring the functions as static like this seems to be a bit more reliable than defining COMMON_DIGEST_FOR_OPENSSL on older cats. */ # define my_md5_ctx CC_MD5_CTX -static CURLcode my_md5_init(my_md5_ctx *ctx) +static CURLcode my_md5_init(void *ctx) { if(!CC_MD5_Init(ctx)) return CURLE_OUT_OF_MEMORY; @@ -186,14 +186,14 @@ static CURLcode my_md5_init(my_md5_ctx *ctx) return CURLE_OK; } -static void my_md5_update(my_md5_ctx *ctx, +static void my_md5_update(void *ctx, const unsigned char *input, unsigned int inputLen) { CC_MD5_Update(ctx, input, inputLen); } -static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) +static void my_md5_final(unsigned char *digest, void *ctx) { CC_MD5_Final(digest, ctx); } @@ -206,8 +206,9 @@ struct md5_ctx { }; typedef struct md5_ctx my_md5_ctx; -static CURLcode my_md5_init(my_md5_ctx *ctx) +static CURLcode my_md5_init(void *in) { + my_md5_ctx *ctx = (my_md5_ctx *)in; if(!CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) return CURLE_OUT_OF_MEMORY; @@ -221,15 +222,17 @@ static CURLcode my_md5_init(my_md5_ctx *ctx) return CURLE_OK; } -static void my_md5_update(my_md5_ctx *ctx, +static void my_md5_update(void *in, const unsigned char *input, unsigned int inputLen) { + my_md5_ctx *ctx = in; CryptHashData(ctx->hHash, (unsigned char *)input, inputLen, 0); } -static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) +static void my_md5_final(unsigned char *digest, void *in) { + my_md5_ctx *ctx = (my_md5_ctx *)in; unsigned long length = 0; CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0); if(length == 16) @@ -254,7 +257,7 @@ static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) * Author: * Alexander Peslyak, better known as Solar Designer * - * This software was written by Alexander Peslyak in 2001. No copyright is + * This software was written by Alexander Peslyak in 2001. No copyright is * claimed, and the software is hereby placed in the public domain. * In case this attempt to disclaim copyright and place the software in the * public domain is deemed null and void, then the software is @@ -264,19 +267,19 @@ static void my_md5_final(unsigned char *digest, my_md5_ctx *ctx) * Redistribution and use in source and binary forms, with or without * modification, are permitted. * - * There's ABSOLUTELY NO WARRANTY, express or implied. + * There is ABSOLUTELY NO WARRANTY, express or implied. * * (This is a heavily cut-down "BSD license".) * * This differs from Colin Plumb's older public domain implementation in that * no exactly 32-bit integer data type is required (any 32-bit or wider - * unsigned integer data type will do), there's no compile-time endianness - * configuration, and the function prototypes match OpenSSL's. No code from + * unsigned integer data type will do), there is no compile-time endianness + * configuration, and the function prototypes match OpenSSL's. No code from * Colin Plumb's implementation has been reused; this comment merely compares * the properties of the two independent implementations. * * The primary goals of this implementation are portability and ease of use. - * It is meant to be fast, but not as fast as possible. Some known + * It is meant to be fast, but not as fast as possible. Some known * optimizations are not included to reduce source code size and avoid * compile-time configuration. */ @@ -292,10 +295,10 @@ struct md5_ctx { }; typedef struct md5_ctx my_md5_ctx; -static CURLcode my_md5_init(my_md5_ctx *ctx); -static void my_md5_update(my_md5_ctx *ctx, const void *data, - unsigned long size); -static void my_md5_final(unsigned char *result, my_md5_ctx *ctx); +static CURLcode my_md5_init(void *ctx); +static void my_md5_update(void *ctx, const unsigned char *data, + unsigned int size); +static void my_md5_final(unsigned char *result, void *ctx); /* * The basic MD5 functions. @@ -304,16 +307,16 @@ static void my_md5_final(unsigned char *result, my_md5_ctx *ctx); * architectures that lack an AND-NOT instruction, just like in Colin Plumb's * implementation. */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) -#define H(x, y, z) (((x) ^ (y)) ^ (z)) -#define H2(x, y, z) ((x) ^ ((y) ^ (z))) -#define I(x, y, z) ((y) ^ ((x) | ~(z))) +#define MD5_F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define MD5_G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) +#define MD5_H(x, y, z) (((x) ^ (y)) ^ (z)) +#define MD5_H2(x, y, z) ((x) ^ ((y) ^ (z))) +#define MD5_I(x, y, z) ((y) ^ ((x) | ~(z))) /* * The MD5 transformation for all four rounds. */ -#define STEP(f, a, b, c, d, x, t, s) \ +#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); @@ -323,30 +326,31 @@ static void my_md5_final(unsigned char *result, my_md5_ctx *ctx); * in a properly aligned word in host byte order. * * The check for little-endian architectures that tolerate unaligned - * memory accesses is just an optimization. Nothing will break if it - * doesn't work. + * memory accesses is just an optimization. Nothing will break if it + * does not work. */ #if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define SET(n) \ +#define MD5_SET(n) \ (*(MD5_u32plus *)(void *)&ptr[(n) * 4]) -#define GET(n) \ - SET(n) +#define MD5_GET(n) \ + MD5_SET(n) #else -#define SET(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 GET(n) \ +#define MD5_GET(n) \ (ctx->block[(n)]) #endif /* * This processes one or more 64-byte data blocks, but does NOT update - * the bit counters. There are no alignment requirements. + * the bit counters. There are no alignment requirements. */ -static const void *body(my_md5_ctx *ctx, const void *data, unsigned long size) +static const void *my_md5_body(my_md5_ctx *ctx, + const void *data, unsigned long size) { const unsigned char *ptr; MD5_u32plus a, b, c, d; @@ -367,76 +371,76 @@ static const void *body(my_md5_ctx *ctx, const void *data, unsigned long size) saved_d = d; /* Round 1 */ - STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) - STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) - STEP(F, c, d, a, b, SET(2), 0x242070db, 17) - STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) - STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) - STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) - STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) - STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) - STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) - STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) - STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) - STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) - STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) - STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) - STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) - STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) + MD5_STEP(MD5_F, a, b, c, d, MD5_SET(0), 0xd76aa478, 7) + MD5_STEP(MD5_F, d, a, b, c, MD5_SET(1), 0xe8c7b756, 12) + MD5_STEP(MD5_F, c, d, a, b, MD5_SET(2), 0x242070db, 17) + MD5_STEP(MD5_F, b, c, d, a, MD5_SET(3), 0xc1bdceee, 22) + MD5_STEP(MD5_F, a, b, c, d, MD5_SET(4), 0xf57c0faf, 7) + MD5_STEP(MD5_F, d, a, b, c, MD5_SET(5), 0x4787c62a, 12) + MD5_STEP(MD5_F, c, d, a, b, MD5_SET(6), 0xa8304613, 17) + MD5_STEP(MD5_F, b, c, d, a, MD5_SET(7), 0xfd469501, 22) + MD5_STEP(MD5_F, a, b, c, d, MD5_SET(8), 0x698098d8, 7) + MD5_STEP(MD5_F, d, a, b, c, MD5_SET(9), 0x8b44f7af, 12) + MD5_STEP(MD5_F, c, d, a, b, MD5_SET(10), 0xffff5bb1, 17) + MD5_STEP(MD5_F, b, c, d, a, MD5_SET(11), 0x895cd7be, 22) + MD5_STEP(MD5_F, a, b, c, d, MD5_SET(12), 0x6b901122, 7) + MD5_STEP(MD5_F, d, a, b, c, MD5_SET(13), 0xfd987193, 12) + MD5_STEP(MD5_F, c, d, a, b, MD5_SET(14), 0xa679438e, 17) + MD5_STEP(MD5_F, b, c, d, a, MD5_SET(15), 0x49b40821, 22) /* Round 2 */ - STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) - STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) - STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) - STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) - STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) - STEP(G, d, a, b, c, GET(10), 0x02441453, 9) - STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) - STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) - STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) - STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) - STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) - STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) - STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) - STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) - STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) - STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) + MD5_STEP(MD5_G, a, b, c, d, MD5_GET(1), 0xf61e2562, 5) + MD5_STEP(MD5_G, d, a, b, c, MD5_GET(6), 0xc040b340, 9) + MD5_STEP(MD5_G, c, d, a, b, MD5_GET(11), 0x265e5a51, 14) + MD5_STEP(MD5_G, b, c, d, a, MD5_GET(0), 0xe9b6c7aa, 20) + MD5_STEP(MD5_G, a, b, c, d, MD5_GET(5), 0xd62f105d, 5) + MD5_STEP(MD5_G, d, a, b, c, MD5_GET(10), 0x02441453, 9) + MD5_STEP(MD5_G, c, d, a, b, MD5_GET(15), 0xd8a1e681, 14) + MD5_STEP(MD5_G, b, c, d, a, MD5_GET(4), 0xe7d3fbc8, 20) + MD5_STEP(MD5_G, a, b, c, d, MD5_GET(9), 0x21e1cde6, 5) + MD5_STEP(MD5_G, d, a, b, c, MD5_GET(14), 0xc33707d6, 9) + MD5_STEP(MD5_G, c, d, a, b, MD5_GET(3), 0xf4d50d87, 14) + MD5_STEP(MD5_G, b, c, d, a, MD5_GET(8), 0x455a14ed, 20) + MD5_STEP(MD5_G, a, b, c, d, MD5_GET(13), 0xa9e3e905, 5) + MD5_STEP(MD5_G, d, a, b, c, MD5_GET(2), 0xfcefa3f8, 9) + MD5_STEP(MD5_G, c, d, a, b, MD5_GET(7), 0x676f02d9, 14) + MD5_STEP(MD5_G, b, c, d, a, MD5_GET(12), 0x8d2a4c8a, 20) /* Round 3 */ - STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) - STEP(H2, d, a, b, c, GET(8), 0x8771f681, 11) - STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) - STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23) - STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) - STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11) - STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) - STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23) - STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) - STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11) - STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) - STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23) - STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) - STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11) - STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) - STEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23) + MD5_STEP(MD5_H, a, b, c, d, MD5_GET(5), 0xfffa3942, 4) + MD5_STEP(MD5_H2, d, a, b, c, MD5_GET(8), 0x8771f681, 11) + MD5_STEP(MD5_H, c, d, a, b, MD5_GET(11), 0x6d9d6122, 16) + MD5_STEP(MD5_H2, b, c, d, a, MD5_GET(14), 0xfde5380c, 23) + MD5_STEP(MD5_H, a, b, c, d, MD5_GET(1), 0xa4beea44, 4) + MD5_STEP(MD5_H2, d, a, b, c, MD5_GET(4), 0x4bdecfa9, 11) + MD5_STEP(MD5_H, c, d, a, b, MD5_GET(7), 0xf6bb4b60, 16) + MD5_STEP(MD5_H2, b, c, d, a, MD5_GET(10), 0xbebfbc70, 23) + MD5_STEP(MD5_H, a, b, c, d, MD5_GET(13), 0x289b7ec6, 4) + MD5_STEP(MD5_H2, d, a, b, c, MD5_GET(0), 0xeaa127fa, 11) + MD5_STEP(MD5_H, c, d, a, b, MD5_GET(3), 0xd4ef3085, 16) + MD5_STEP(MD5_H2, b, c, d, a, MD5_GET(6), 0x04881d05, 23) + MD5_STEP(MD5_H, a, b, c, d, MD5_GET(9), 0xd9d4d039, 4) + MD5_STEP(MD5_H2, d, a, b, c, MD5_GET(12), 0xe6db99e5, 11) + MD5_STEP(MD5_H, c, d, a, b, MD5_GET(15), 0x1fa27cf8, 16) + MD5_STEP(MD5_H2, b, c, d, a, MD5_GET(2), 0xc4ac5665, 23) /* Round 4 */ - STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) - STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) - STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) - STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) - STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) - STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) - STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) - STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) - STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) - STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) - STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) - STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) - STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) - STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) - STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) - STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) + MD5_STEP(MD5_I, a, b, c, d, MD5_GET(0), 0xf4292244, 6) + MD5_STEP(MD5_I, d, a, b, c, MD5_GET(7), 0x432aff97, 10) + MD5_STEP(MD5_I, c, d, a, b, MD5_GET(14), 0xab9423a7, 15) + MD5_STEP(MD5_I, b, c, d, a, MD5_GET(5), 0xfc93a039, 21) + MD5_STEP(MD5_I, a, b, c, d, MD5_GET(12), 0x655b59c3, 6) + MD5_STEP(MD5_I, d, a, b, c, MD5_GET(3), 0x8f0ccc92, 10) + MD5_STEP(MD5_I, c, d, a, b, MD5_GET(10), 0xffeff47d, 15) + MD5_STEP(MD5_I, b, c, d, a, MD5_GET(1), 0x85845dd1, 21) + MD5_STEP(MD5_I, a, b, c, d, MD5_GET(8), 0x6fa87e4f, 6) + MD5_STEP(MD5_I, d, a, b, c, MD5_GET(15), 0xfe2ce6e0, 10) + MD5_STEP(MD5_I, c, d, a, b, MD5_GET(6), 0xa3014314, 15) + MD5_STEP(MD5_I, b, c, d, a, MD5_GET(13), 0x4e0811a1, 21) + MD5_STEP(MD5_I, a, b, c, d, MD5_GET(4), 0xf7537e82, 6) + MD5_STEP(MD5_I, d, a, b, c, MD5_GET(11), 0xbd3af235, 10) + MD5_STEP(MD5_I, c, d, a, b, MD5_GET(2), 0x2ad7d2bb, 15) + MD5_STEP(MD5_I, b, c, d, a, MD5_GET(9), 0xeb86d391, 21) a += saved_a; b += saved_b; @@ -454,8 +458,9 @@ static const void *body(my_md5_ctx *ctx, const void *data, unsigned long size) return ptr; } -static CURLcode my_md5_init(my_md5_ctx *ctx) +static CURLcode my_md5_init(void *in) { + my_md5_ctx *ctx = (my_md5_ctx *)in; ctx->a = 0x67452301; ctx->b = 0xefcdab89; ctx->c = 0x98badcfe; @@ -467,11 +472,12 @@ static CURLcode my_md5_init(my_md5_ctx *ctx) return CURLE_OK; } -static void my_md5_update(my_md5_ctx *ctx, const void *data, - unsigned long size) +static void my_md5_update(void *in, const unsigned char *data, + unsigned int size) { MD5_u32plus saved_lo; - unsigned long used; + unsigned int used; + my_md5_ctx *ctx = (my_md5_ctx *)in; saved_lo = ctx->lo; ctx->lo = (saved_lo + size) & 0x1fffffff; @@ -482,7 +488,7 @@ static void my_md5_update(my_md5_ctx *ctx, const void *data, used = saved_lo & 0x3f; if(used) { - unsigned long available = 64 - used; + unsigned int available = 64 - used; if(size < available) { memcpy(&ctx->buffer[used], data, size); @@ -492,20 +498,21 @@ static void my_md5_update(my_md5_ctx *ctx, const void *data, memcpy(&ctx->buffer[used], data, available); data = (const unsigned char *)data + available; size -= available; - body(ctx, ctx->buffer, 64); + my_md5_body(ctx, ctx->buffer, 64); } if(size >= 64) { - data = body(ctx, data, size & ~(unsigned long)0x3f); + data = my_md5_body(ctx, data, size & ~(unsigned long)0x3f); size &= 0x3f; } memcpy(ctx->buffer, data, size); } -static void my_md5_final(unsigned char *result, my_md5_ctx *ctx) +static void my_md5_final(unsigned char *result, void *in) { - unsigned long used, available; + unsigned int used, available; + my_md5_ctx *ctx = (my_md5_ctx *)in; used = ctx->lo & 0x3f; @@ -515,7 +522,7 @@ static void my_md5_final(unsigned char *result, my_md5_ctx *ctx) if(available < 8) { memset(&ctx->buffer[used], 0, available); - body(ctx, ctx->buffer, 64); + my_md5_body(ctx, ctx->buffer, 64); used = 0; available = 64; } @@ -532,7 +539,7 @@ static void my_md5_final(unsigned char *result, my_md5_ctx *ctx) ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff); ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24); - body(ctx, ctx->buffer, 64); + my_md5_body(ctx, ctx->buffer, 64); result[0] = curlx_ultouc((ctx->a)&0xff); result[1] = curlx_ultouc((ctx->a >> 8)&0xff); @@ -556,36 +563,21 @@ static void my_md5_final(unsigned char *result, my_md5_ctx *ctx) #endif /* CRYPTO LIBS */ -const struct HMAC_params Curl_HMAC_MD5[] = { - { - /* Hash initialization function. */ - CURLX_FUNCTION_CAST(HMAC_hinit_func, my_md5_init), - /* Hash update function. */ - CURLX_FUNCTION_CAST(HMAC_hupdate_func, my_md5_update), - /* Hash computation end function. */ - CURLX_FUNCTION_CAST(HMAC_hfinal_func, my_md5_final), - /* Size of hash context structure. */ - sizeof(my_md5_ctx), - /* Maximum key length. */ - 64, - /* Result size. */ - 16 - } +const struct HMAC_params Curl_HMAC_MD5 = { + my_md5_init, /* Hash initialization function. */ + my_md5_update, /* Hash update function. */ + my_md5_final, /* Hash computation end function. */ + sizeof(my_md5_ctx), /* Size of hash context structure. */ + 64, /* Maximum key length. */ + 16 /* Result size. */ }; -const struct MD5_params Curl_DIGEST_MD5[] = { - { - /* Digest initialization function */ - CURLX_FUNCTION_CAST(Curl_MD5_init_func, my_md5_init), - /* Digest update function */ - CURLX_FUNCTION_CAST(Curl_MD5_update_func, my_md5_update), - /* Digest computation end function */ - CURLX_FUNCTION_CAST(Curl_MD5_final_func, my_md5_final), - /* Size of digest context struct */ - sizeof(my_md5_ctx), - /* Result size */ - 16 - } +const struct MD5_params Curl_DIGEST_MD5 = { + my_md5_init, /* Digest initialization function */ + my_md5_update, /* Digest update function */ + my_md5_final, /* Digest computation end function */ + sizeof(my_md5_ctx), /* Size of digest context struct */ + 16 /* Result size */ }; /* diff --git a/deps/curl/lib/memdebug.c b/deps/curl/lib/memdebug.c index fce933a3..02612c2a 100644 --- a/deps/curl/lib/memdebug.c +++ b/deps/curl/lib/memdebug.c @@ -30,7 +30,7 @@ #include "urldata.h" -#define MEMDEBUG_NODEFINES /* don't redefine the standard functions */ +#define MEMDEBUG_NODEFINES /* do not redefine the standard functions */ /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -44,16 +44,16 @@ struct memdebug { double d; void *p; } mem[1]; - /* I'm hoping this is the thing with the strictest alignment - * requirements. That also means we waste some space :-( */ + /* I am hoping this is the thing with the strictest alignment + * requirements. That also means we waste some space :-( */ }; /* - * Note that these debug functions are very simple and they are meant to - * remain so. For advanced analysis, record a log file and write perl scripts - * to analyze them! + * Note that these debug functions are simple and they are meant to remain so. + * For advanced analysis, record a log file and write perl scripts to analyze + * them! * - * Don't use these with multithreaded test programs! + * Do not use these with multithreaded test programs! */ FILE *curl_dbg_logfile = NULL; @@ -75,7 +75,7 @@ static void curl_dbg_cleanup(void) curl_dbg_logfile = NULL; } -/* this sets the log file name */ +/* this sets the log filename */ void curl_dbg_memdebug(const char *logname) { if(!curl_dbg_logfile) { @@ -84,7 +84,7 @@ void curl_dbg_memdebug(const char *logname) else curl_dbg_logfile = stderr; #ifdef MEMDEBUG_LOG_SYNC - /* Flush the log file after every line so the log isn't lost in a crash */ + /* Flush the log file after every line so the log is not lost in a crash */ if(curl_dbg_logfile) setbuf(curl_dbg_logfile, (char *)NULL); #endif @@ -103,7 +103,7 @@ void curl_dbg_memlimit(long limit) } } -/* returns TRUE if this isn't allowed! */ +/* returns TRUE if this is not allowed! */ static bool countcheck(const char *func, int line, const char *source) { /* if source is NULL, then the call is made internally and this check @@ -312,7 +312,7 @@ curl_socket_t curl_dbg_socket(int domain, int type, int protocol, sockfd = socket(domain, type, protocol); if(source && (sockfd != CURL_SOCKET_BAD)) - curl_dbg_log("FD %s:%d socket() = %" CURL_FORMAT_SOCKET_T "\n", + curl_dbg_log("FD %s:%d socket() = %" FMT_SOCKET_T "\n", source, line, sockfd); return sockfd; @@ -356,8 +356,8 @@ int curl_dbg_socketpair(int domain, int type, int protocol, if(source && (0 == res)) curl_dbg_log("FD %s:%d socketpair() = " - "%" CURL_FORMAT_SOCKET_T " %" CURL_FORMAT_SOCKET_T "\n", - source, line, socket_vector[0], socket_vector[1]); + "%" FMT_SOCKET_T " %" FMT_SOCKET_T "\n", + source, line, socket_vector[0], socket_vector[1]); return res; } @@ -372,7 +372,7 @@ curl_socket_t curl_dbg_accept(curl_socket_t s, void *saddr, void *saddrlen, curl_socket_t sockfd = accept(s, addr, addrlen); if(source && (sockfd != CURL_SOCKET_BAD)) - curl_dbg_log("FD %s:%d accept() = %" CURL_FORMAT_SOCKET_T "\n", + curl_dbg_log("FD %s:%d accept() = %" FMT_SOCKET_T "\n", source, line, sockfd); return sockfd; @@ -382,7 +382,7 @@ curl_socket_t curl_dbg_accept(curl_socket_t s, void *saddr, void *saddrlen, void curl_dbg_mark_sclose(curl_socket_t sockfd, int line, const char *source) { if(source) - curl_dbg_log("FD %s:%d sclose(%" CURL_FORMAT_SOCKET_T ")\n", + curl_dbg_log("FD %s:%d sclose(%" FMT_SOCKET_T ")\n", source, line, sockfd); } diff --git a/deps/curl/lib/memdebug.h b/deps/curl/lib/memdebug.h index 51147cdc..80f3374e 100644 --- a/deps/curl/lib/memdebug.h +++ b/deps/curl/lib/memdebug.h @@ -34,9 +34,9 @@ #include "functypes.h" #if defined(__GNUC__) && __GNUC__ >= 3 -# define ALLOC_FUNC __attribute__((malloc)) -# define ALLOC_SIZE(s) __attribute__((alloc_size(s))) -# define ALLOC_SIZE2(n, s) __attribute__((alloc_size(n, s))) +# define ALLOC_FUNC __attribute__((__malloc__)) +# define ALLOC_SIZE(s) __attribute__((__alloc_size__(s))) +# define ALLOC_SIZE2(n, s) __attribute__((__alloc_size__(n, s))) #elif defined(_MSC_VER) # define ALLOC_FUNC __declspec(restrict) # define ALLOC_SIZE(s) @@ -114,11 +114,17 @@ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); /* 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__) +#undef send #define send(a,b,c,d) curl_dbg_send(a,b,c,d, __LINE__, __FILE__) +#undef recv #define recv(a,b,c,d) curl_dbg_recv(a,b,c,d, __LINE__, __FILE__) #ifdef _WIN32 @@ -137,15 +143,17 @@ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); #undef socket #define socket(domain,type,protocol)\ - curl_dbg_socket(domain, type, protocol, __LINE__, __FILE__) + curl_dbg_socket((int)domain, type, protocol, __LINE__, __FILE__) #undef accept /* for those with accept as a macro */ #define accept(sock,addr,len)\ curl_dbg_accept(sock, addr, len, __LINE__, __FILE__) #ifdef HAVE_SOCKETPAIR #define socketpair(domain,type,protocol,socket_vector)\ - curl_dbg_socketpair(domain, type, protocol, socket_vector, __LINE__, __FILE__) + curl_dbg_socketpair((int)domain, type, protocol, socket_vector, \ + __LINE__, __FILE__) #endif +#ifndef CURL_NO_GETADDRINFO_OVERRIDE #ifdef HAVE_GETADDRINFO #if defined(getaddrinfo) && defined(__osf__) /* OSF/1 and Tru64 have getaddrinfo as a define already, so we cannot define @@ -165,6 +173,7 @@ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); #define freeaddrinfo(data) \ curl_dbg_freeaddrinfo(data, __LINE__, __FILE__) #endif /* HAVE_FREEADDRINFO */ +#endif /* !CURL_NO_GETADDRINFO_OVERRIDE */ /* sclose is probably already defined, redefine it! */ #undef sclose diff --git a/deps/curl/lib/mime.c b/deps/curl/lib/mime.c index 48a1ad87..70286069 100644 --- a/deps/curl/lib/mime.c +++ b/deps/curl/lib/mime.c @@ -26,6 +26,8 @@ #include +struct Curl_easy; + #include "mime.h" #include "warnless.h" #include "urldata.h" @@ -92,7 +94,7 @@ static const char base64enc[] = /* Quoted-printable character class table. * * We cannot rely on ctype functions since quoted-printable input data - * is assumed to be ascii-compatible, even on non-ascii platforms. */ + * is assumed to be ASCII-compatible, even on non-ASCII platforms. */ #define QP_OK 1 /* Can be represented by itself. */ #define QP_SP 2 /* Space or tab. */ #define QP_CR 3 /* Carriage return. */ @@ -259,7 +261,7 @@ static char *Curl_basename(char *path) s2 = strrchr(path, '\\'); if(s1 && s2) { - path = (s1 > s2? s1 : s2) + 1; + path = (s1 > s2 ? s1 : s2) + 1; } else if(s1) path = s1 + 1; @@ -424,7 +426,7 @@ static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof, for(cursize = 0; cursize < size; cursize++) { *buffer = st->buf[st->bufbeg]; if(*buffer++ & 0x80) - return cursize? cursize: READ_ERROR; + return cursize ? cursize : READ_ERROR; st->bufbeg++; } @@ -538,7 +540,7 @@ static int qp_lookahead_eol(struct mime_encoder_state *st, int ateof, size_t n) if(n >= st->bufend && ateof) return 1; if(n + 2 > st->bufend) - return ateof? 0: -1; + return ateof ? 0 : -1; if(qp_class[st->buf[n] & 0xFF] == QP_CR && qp_class[st->buf[n + 1] & 0xFF] == QP_LF) return 1; @@ -557,7 +559,7 @@ static size_t encoder_qp_read(char *buffer, size_t size, bool ateof, /* On all platforms, input is supposed to be ASCII compatible: for this reason, we use hexadecimal ASCII codes in this function rather than - character constants that can be interpreted as non-ascii on some + character constants that can be interpreted as non-ASCII on some platforms. Preserve ASCII encoding on output too. */ while(st->bufbeg < st->bufend) { size_t len = 1; @@ -651,7 +653,7 @@ static curl_off_t encoder_qp_size(curl_mimepart *part) { /* Determining the size can only be done by reading the data: unless the data size is 0, we return it as unknown (-1). */ - return part->datasize? -1: 0; + return part->datasize ? -1 : 0; } @@ -711,7 +713,7 @@ static int mime_open_file(curl_mimepart *part) if(part->fp) return 0; part->fp = fopen_read(part->data, "rb"); - return part->fp? 0: -1; + return part->fp ? 0 : -1; } static size_t mime_file_read(char *buffer, size_t size, size_t nitems, @@ -738,8 +740,8 @@ 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)? - CURL_SEEKFUNC_CANTSEEK: CURL_SEEKFUNC_OK; + return fseek(part->fp, (long) offset, whence) ? + CURL_SEEKFUNC_CANTSEEK : CURL_SEEKFUNC_OK; } static void mime_file_free(void *ptr) @@ -871,7 +873,7 @@ static size_t read_encoded_part_content(curl_mimepart *part, char *buffer, break; case READ_ERROR: case STOP_FILLING: - return cursize? cursize: sz; + return cursize ? cursize : sz; default: cursize += sz; buffer += sz; @@ -890,7 +892,7 @@ static size_t read_encoded_part_content(curl_mimepart *part, char *buffer, st->bufend = len; } if(st->bufend >= sizeof(st->buf)) - return cursize? cursize: READ_ERROR; /* Buffer full. */ + return cursize ? cursize : READ_ERROR; /* Buffer full. */ sz = read_part_content(part, st->buf + st->bufend, sizeof(st->buf) - st->bufend, hasread); switch(sz) { @@ -901,7 +903,7 @@ static size_t read_encoded_part_content(curl_mimepart *part, char *buffer, case CURL_READFUNC_PAUSE: case READ_ERROR: case STOP_FILLING: - return cursize? cursize: sz; + return cursize ? cursize : sz; default: st->bufend += sz; break; @@ -925,8 +927,8 @@ static size_t readback_part(curl_mimepart *part, switch(part->state.state) { case MIMESTATE_BEGIN: mimesetstate(&part->state, - (part->flags & MIME_BODY_ONLY)? - MIMESTATE_BODY: MIMESTATE_CURLHEADERS, + (part->flags & MIME_BODY_ONLY) ? + MIMESTATE_BODY : MIMESTATE_CURLHEADERS, part->curlheaders); break; case MIMESTATE_USERHEADERS: @@ -977,7 +979,7 @@ static size_t readback_part(curl_mimepart *part, case CURL_READFUNC_PAUSE: case READ_ERROR: case STOP_FILLING: - return cursize? cursize: sz; + return cursize ? cursize : sz; } break; case MIMESTATE_END: @@ -1043,7 +1045,7 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, case CURL_READFUNC_PAUSE: case READ_ERROR: case STOP_FILLING: - return cursize? cursize: sz; + return cursize ? cursize : sz; case 0: mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart); break; @@ -1137,7 +1139,7 @@ static void cleanup_part_content(curl_mimepart *part) part->datasize = (curl_off_t) 0; /* No size yet. */ cleanup_encoder_state(&part->encstate); part->kind = MIMEKIND_NONE; - part->flags &= ~MIME_FAST_READ; + part->flags &= ~(unsigned int)MIME_FAST_READ; part->lastreadstatus = 1; /* Successful read status. */ part->state.state = MIMESTATE_BEGIN; } @@ -1147,7 +1149,7 @@ static void mime_subparts_free(void *ptr) curl_mime *mime = (curl_mime *) ptr; if(mime && mime->parent) { - mime->parent->freefunc = NULL; /* Be sure we won't be called again. */ + mime->parent->freefunc = NULL; /* Be sure we will not be called again. */ cleanup_part_content(mime->parent); /* Avoid dangling pointer in part. */ } curl_mime_free(mime); @@ -1159,7 +1161,7 @@ static void mime_subparts_unbind(void *ptr) curl_mime *mime = (curl_mime *) ptr; if(mime && mime->parent) { - mime->parent->freefunc = NULL; /* Be sure we won't be called again. */ + mime->parent->freefunc = NULL; /* Be sure we will not be called again. */ cleanup_part_content(mime->parent); /* Avoid dangling pointer in part. */ mime->parent = NULL; } @@ -1186,7 +1188,7 @@ void curl_mime_free(curl_mime *mime) curl_mimepart *part; if(mime) { - mime_subparts_unbind(mime); /* Be sure it's not referenced anymore. */ + mime_subparts_unbind(mime); /* Be sure it is not referenced anymore. */ while(mime->firstpart) { part = mime->firstpart; mime->firstpart = part->nextpart; @@ -1228,12 +1230,12 @@ CURLcode Curl_mime_duppart(struct Curl_easy *data, /* No one knows about the cloned subparts, thus always attach ownership to the part. */ mime = curl_mime_init(data); - res = mime? curl_mime_subparts(dst, mime): CURLE_OUT_OF_MEMORY; + 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) { d = curl_mime_addpart(mime); - res = d? Curl_mime_duppart(data, d, s): CURLE_OUT_OF_MEMORY; + res = d ? Curl_mime_duppart(data, d, s) : CURLE_OUT_OF_MEMORY; } break; default: /* Invalid kind: should not occur. */ @@ -1279,7 +1281,7 @@ CURLcode Curl_mime_duppart(struct Curl_easy *data, */ /* Create a mime handle. */ -curl_mime *curl_mime_init(struct Curl_easy *easy) +curl_mime *curl_mime_init(void *easy) { curl_mime *mime; @@ -1354,7 +1356,7 @@ CURLcode curl_mime_name(curl_mimepart *part, const char *name) return CURLE_OK; } -/* Set mime part remote file name. */ +/* Set mime part remote filename. */ CURLcode curl_mime_filename(curl_mimepart *part, const char *filename) { if(!part) @@ -1413,36 +1415,35 @@ CURLcode curl_mime_filedata(curl_mimepart *part, const char *filename) char *base; struct_stat sbuf; - if(stat(filename, &sbuf) || access(filename, R_OK)) + if(stat(filename, &sbuf)) result = CURLE_READ_ERROR; - - part->data = strdup(filename); - if(!part->data) - result = CURLE_OUT_OF_MEMORY; - - part->datasize = -1; - if(!result && S_ISREG(sbuf.st_mode)) { - part->datasize = filesize(filename, sbuf); - part->seekfunc = mime_file_seek; - } - - part->readfunc = mime_file_read; - part->freefunc = mime_file_free; - part->kind = MIMEKIND_FILE; - - /* As a side effect, set the filename to the current file's base name. - It is possible to withdraw this by explicitly calling - curl_mime_filename() with a NULL filename argument after the current - call. */ - base = strippath(filename); - if(!base) - result = CURLE_OUT_OF_MEMORY; else { - CURLcode res = curl_mime_filename(part, base); + part->data = strdup(filename); + if(!part->data) + result = CURLE_OUT_OF_MEMORY; + else { + part->datasize = -1; + if(S_ISREG(sbuf.st_mode)) { + part->datasize = filesize(filename, sbuf); + part->seekfunc = mime_file_seek; + } - if(res) - result = res; - free(base); + part->readfunc = mime_file_read; + part->freefunc = mime_file_free; + part->kind = MIMEKIND_FILE; + + /* As a side effect, set the filename to the current file's base name. + It is possible to withdraw this by explicitly calling + curl_mime_filename() with a NULL filename argument after the current + call. */ + base = strippath(filename); + if(!base) + result = CURLE_OUT_OF_MEMORY; + else { + result = curl_mime_filename(part, base); + free(base); + } + } } } return result; @@ -1498,7 +1499,7 @@ CURLcode curl_mime_headers(curl_mimepart *part, if(part->flags & MIME_USERHEADERS_OWNER) { if(part->userheaders != headers) /* Allow setting twice the same list. */ curl_slist_free_all(part->userheaders); - part->flags &= ~MIME_USERHEADERS_OWNER; + part->flags &= ~(unsigned int)MIME_USERHEADERS_OWNER; } part->userheaders = headers; if(headers && take_ownership) @@ -1555,7 +1556,7 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part, while(root->parent && root->parent->parent) root = root->parent->parent; if(subparts == root) { - /* Can't add as a subpart of itself. */ + /* cannot add as a subpart of itself. */ return CURLE_BAD_FUNCTION_ARGUMENT; } } @@ -1563,7 +1564,8 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part, subparts->parent = part; /* Subparts are processed internally: no read callback. */ part->seekfunc = mime_subparts_seek; - part->freefunc = take_ownership? mime_subparts_free: mime_subparts_unbind; + part->freefunc = take_ownership ? mime_subparts_free : + mime_subparts_unbind; part->arg = subparts; part->datasize = -1; part->kind = MIMEKIND_MULTIPART; @@ -1588,6 +1590,8 @@ size_t Curl_mime_read(char *buffer, size_t size, size_t nitems, void *instream) (void) size; /* Always 1. */ + /* TODO: this loop is broken. If `nitems` is <= 4, some encoders will + * return STOP_FILLING without adding any data and this loops infinitely. */ do { hasread = FALSE; ret = readback_part(part, buffer, nitems, &hasread); @@ -1605,8 +1609,8 @@ size_t Curl_mime_read(char *buffer, size_t size, size_t nitems, void *instream) /* Rewind mime stream. */ static CURLcode mime_rewind(curl_mimepart *part) { - return mime_part_rewind(part) == CURL_SEEKFUNC_OK? - CURLE_OK: CURLE_SEND_FAIL_REWIND; + return mime_part_rewind(part) == CURL_SEEKFUNC_OK ? + CURLE_OK : CURLE_SEND_FAIL_REWIND; } /* Compute header list size. */ @@ -1663,7 +1667,8 @@ 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; @@ -1678,7 +1683,7 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) va_list ap; va_start(ap, fmt); - s = curl_mvaprintf(fmt, ap); + s = vaprintf(fmt, ap); va_end(ap); if(s) { @@ -1689,7 +1694,7 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) free(s); } - return hdr? CURLE_OK: CURLE_OUT_OF_MEMORY; + return hdr ? CURLE_OK : CURLE_OUT_OF_MEMORY; } /* Add a content type header. */ @@ -1697,8 +1702,8 @@ static CURLcode add_content_type(struct curl_slist **slp, const char *type, const char *boundary) { return Curl_mime_add_header(slp, "Content-Type: %s%s%s", type, - boundary? "; boundary=": "", - boundary? boundary: ""); + boundary ? "; boundary=" : "", + boundary ? boundary : ""); } const char *Curl_mime_contenttype(const char *filename) @@ -1771,7 +1776,7 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data, curl_slist_free_all(part->curlheaders); part->curlheaders = NULL; - /* Be sure we won't access old headers later. */ + /* Be sure we will not access old headers later. */ if(part->state.state == MIMESTATE_CURLHEADERS) mimesetstate(&part->state, MIMESTATE_CURLHEADERS, NULL); @@ -1838,12 +1843,12 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data, ret = Curl_mime_add_header(&part->curlheaders, "Content-Disposition: %s%s%s%s%s%s%s", disposition, - name? "; name=\"": "", - name? name: "", - name? "\"": "", - filename? "; filename=\"": "", - filename? filename: "", - filename? "\"": ""); + name ? "; name=\"" : "", + name ? name : "", + name ? "\"" : "", + filename ? "; filename=\"" : "", + filename ? filename : "", + filename ? "\"" : ""); Curl_safefree(name); Curl_safefree(filename); if(ret) @@ -1944,13 +1949,17 @@ static CURLcode cr_mime_read(struct Curl_easy *data, struct cr_mime_ctx *ctx = reader->ctx; size_t nread; + /* 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", + blen, ctx->error_result); *pnread = 0; *peos = FALSE; return ctx->error_result; } if(ctx->seen_eos) { + CURL_TRC_READ(data, "cr_mime_read(len=%zu) seen eos -> 0, eos=1", blen); *pnread = 0; *peos = TRUE; return CURLE_OK; @@ -1963,16 +1972,27 @@ static CURLcode cr_mime_read(struct Curl_easy *data, else if(remain < (curl_off_t)blen) blen = (size_t)remain; } - nread = 0; - if(blen) { - nread = Curl_mime_read(buf, 1, blen, ctx->part); + + if(blen <= 4) { + /* TODO: Curl_mime_read() may go into an infinite loop when reading + * such small lengths. Returning 0 bytes read is a fix that only works + * as request upload buffers will get flushed eventually and larger + * reads will happen again. */ + CURL_TRC_READ(data, "cr_mime_read(len=%zu), too small, return", blen); + *pnread = 0; + *peos = FALSE; + goto out; } + nread = Curl_mime_read(buf, 1, blen, ctx->part); + CURL_TRC_READ(data, "cr_mime_read(len=%zu), mime_read() -> %zd", + blen, nread); + switch(nread) { case 0: if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) { - failf(data, "client mime read EOF fail, only " - "only %"CURL_FORMAT_CURL_OFF_T"/%"CURL_FORMAT_CURL_OFF_T + failf(data, "client mime read EOF fail, " + "only %"FMT_OFF_T"/%"FMT_OFF_T " of needed bytes read", ctx->read_len, ctx->total_len); return CURLE_READ_ERROR; } @@ -1991,11 +2011,21 @@ static CURLcode cr_mime_read(struct Curl_easy *data, case CURL_READFUNC_PAUSE: /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */ + CURL_TRC_READ(data, "cr_mime_read(len=%zu), paused by callback", blen); data->req.keepon |= KEEP_SEND_PAUSE; /* mark socket send as paused */ *pnread = 0; *peos = FALSE; break; /* nothing was read */ + case STOP_FILLING: + case READ_ERROR: + failf(data, "read error getting mime data"); + *pnread = 0; + *peos = FALSE; + ctx->errored = TRUE; + ctx->error_result = CURLE_READ_ERROR; + return CURLE_READ_ERROR; + default: if(nread > blen) { /* the read function returned a too large value */ @@ -2013,9 +2043,11 @@ static CURLcode cr_mime_read(struct Curl_easy *data, *peos = ctx->seen_eos; break; } - DEBUGF(infof(data, "cr_mime_read(len=%zu, total=%"CURL_FORMAT_CURL_OFF_T - ", read=%"CURL_FORMAT_CURL_OFF_T") -> %d, %zu, %d", - blen, ctx->total_len, ctx->read_len, CURLE_OK, *pnread, *peos)); + +out: + CURL_TRC_READ(data, "cr_mime_read(len=%zu, total=%" FMT_OFF_T + ", read=%"FMT_OFF_T") -> %d, %zu, %d", + blen, ctx->total_len, ctx->read_len, CURLE_OK, *pnread, *peos); return CURLE_OK; } @@ -2057,7 +2089,7 @@ static CURLcode cr_mime_resume_from(struct Curl_easy *data, if((nread == 0) || (nread > readthisamountnow)) { /* this checks for greater-than only to make sure that the CURL_READFUNC_ABORT return code still aborts */ - failf(data, "Could only read %" CURL_FORMAT_CURL_OFF_T + failf(data, "Could only read %" FMT_OFF_T " bytes from the mime post", passed); return CURLE_READ_ERROR; } @@ -2072,7 +2104,7 @@ static CURLcode cr_mime_resume_from(struct Curl_easy *data, return CURLE_PARTIAL_FILE; } } - /* we've passed, proceed as normal */ + /* we have passed, proceed as normal */ } return CURLE_OK; } @@ -2096,6 +2128,14 @@ static CURLcode cr_mime_unpause(struct Curl_easy *data, return CURLE_OK; } +static bool cr_mime_is_paused(struct Curl_easy *data, + struct Curl_creader *reader) +{ + struct cr_mime_ctx *ctx = reader->ctx; + (void)data; + return (ctx->part && ctx->part->lastreadstatus == CURL_READFUNC_PAUSE); +} + static const struct Curl_crtype cr_mime = { "cr-mime", cr_mime_init, @@ -2106,6 +2146,8 @@ static const struct Curl_crtype cr_mime = { cr_mime_resume_from, cr_mime_rewind, cr_mime_unpause, + cr_mime_is_paused, + Curl_creader_def_done, sizeof(struct cr_mime_ctx) }; diff --git a/deps/curl/lib/mime.h b/deps/curl/lib/mime.h index 954b3ccf..5073a38f 100644 --- a/deps/curl/lib/mime.h +++ b/deps/curl/lib/mime.h @@ -112,7 +112,7 @@ struct curl_mimepart { curl_mimepart *nextpart; /* Forward linked list. */ enum mimekind kind; /* The part kind. */ unsigned int flags; /* Flags. */ - char *data; /* Memory data or file name. */ + char *data; /* Memory data or filename. */ curl_read_callback readfunc; /* Read function. */ curl_seek_callback seekfunc; /* Seek function. */ curl_free_callback freefunc; /* Argument free function. */ @@ -121,7 +121,7 @@ struct curl_mimepart { struct curl_slist *curlheaders; /* Part headers. */ struct curl_slist *userheaders; /* Part headers. */ char *mimetype; /* Part mime type. */ - char *filename; /* Remote file name. */ + char *filename; /* Remote filename. */ char *name; /* Data name. */ curl_off_t datasize; /* Expected data size. */ struct mime_state state; /* Current readback state. */ diff --git a/deps/curl/lib/mprintf.c b/deps/curl/lib/mprintf.c index 4c60d133..6576f3eb 100644 --- a/deps/curl/lib/mprintf.c +++ b/deps/curl/lib/mprintf.c @@ -25,7 +25,6 @@ #include "curl_setup.h" #include "dynbuf.h" #include "curl_printf.h" -#include #include "curl_memory.h" /* The last #include file should be: */ @@ -77,7 +76,7 @@ static const char upper_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; #define OUTCHAR(x) \ do { \ - if(!stream(x, userp)) \ + if(!stream((unsigned char)x, userp)) \ done++; \ else \ return done; /* return on failure */ \ @@ -102,27 +101,27 @@ typedef enum { /* conversion and display flags */ enum { - FLAGS_SPACE = 1<<0, - FLAGS_SHOWSIGN = 1<<1, - FLAGS_LEFT = 1<<2, - FLAGS_ALT = 1<<3, - FLAGS_SHORT = 1<<4, - FLAGS_LONG = 1<<5, - FLAGS_LONGLONG = 1<<6, - FLAGS_LONGDOUBLE = 1<<7, - FLAGS_PAD_NIL = 1<<8, - FLAGS_UNSIGNED = 1<<9, - FLAGS_OCTAL = 1<<10, - FLAGS_HEX = 1<<11, - FLAGS_UPPER = 1<<12, - FLAGS_WIDTH = 1<<13, /* '*' or '*$' used */ - FLAGS_WIDTHPARAM = 1<<14, /* width PARAMETER was specified */ - FLAGS_PREC = 1<<15, /* precision was specified */ - FLAGS_PRECPARAM = 1<<16, /* precision PARAMETER was specified */ - FLAGS_CHAR = 1<<17, /* %c story */ - FLAGS_FLOATE = 1<<18, /* %e or %E */ - FLAGS_FLOATG = 1<<19, /* %g or %G */ - FLAGS_SUBSTR = 1<<20 /* no input, only substring */ + FLAGS_SPACE = 1 << 0, + FLAGS_SHOWSIGN = 1 << 1, + FLAGS_LEFT = 1 << 2, + FLAGS_ALT = 1 << 3, + FLAGS_SHORT = 1 << 4, + FLAGS_LONG = 1 << 5, + FLAGS_LONGLONG = 1 << 6, + FLAGS_LONGDOUBLE = 1 << 7, + FLAGS_PAD_NIL = 1 << 8, + FLAGS_UNSIGNED = 1 << 9, + FLAGS_OCTAL = 1 << 10, + FLAGS_HEX = 1 << 11, + FLAGS_UPPER = 1 << 12, + FLAGS_WIDTH = 1 << 13, /* '*' or '*$' used */ + FLAGS_WIDTHPARAM = 1 << 14, /* width PARAMETER was specified */ + FLAGS_PREC = 1 << 15, /* precision was specified */ + FLAGS_PRECPARAM = 1 << 16, /* precision PARAMETER was specified */ + FLAGS_CHAR = 1 << 17, /* %c story */ + FLAGS_FLOATE = 1 << 18, /* %e or %E */ + FLAGS_FLOATG = 1 << 19, /* %g or %G */ + FLAGS_SUBSTR = 1 << 20 /* no input, only substring */ }; enum { @@ -243,7 +242,7 @@ static int parsefmt(const char *format, struct va_input *iptr; bool loopit = TRUE; fmt++; - outlen = fmt - start - 1; + outlen = (size_t)(fmt - start - 1); if(*fmt == '%') { /* this means a %% that should be output only as %. Create an output segment. */ @@ -261,7 +260,8 @@ static int parsefmt(const char *format, continue; /* while */ } - flags = width = precision = 0; + flags = 0; + width = precision = 0; if(use_dollar != DOLLAR_NOPE) { param = dollarstring(fmt, &fmt); @@ -291,7 +291,7 @@ static int parsefmt(const char *format, break; case '-': flags |= FLAGS_LEFT; - flags &= ~FLAGS_PAD_NIL; + flags &= ~(unsigned int)FLAGS_PAD_NIL; break; case '#': flags |= FLAGS_ALT; @@ -455,15 +455,30 @@ static int parsefmt(const char *format, flags |= FLAGS_UNSIGNED; break; case 'o': - type = FORMAT_INT; - flags |= FLAGS_OCTAL; + if(flags & FLAGS_LONGLONG) + type = FORMAT_LONGLONGU; + else if(flags & FLAGS_LONG) + type = FORMAT_LONGU; + else + type = FORMAT_INTU; + flags |= FLAGS_OCTAL|FLAGS_UNSIGNED; break; case 'x': - type = FORMAT_INTU; + if(flags & FLAGS_LONGLONG) + type = FORMAT_LONGLONGU; + else if(flags & FLAGS_LONG) + type = FORMAT_LONGU; + else + type = FORMAT_INTU; flags |= FLAGS_HEX|FLAGS_UNSIGNED; break; case 'X': - type = FORMAT_INTU; + if(flags & FLAGS_LONGLONG) + type = FORMAT_LONGLONGU; + else if(flags & FLAGS_LONG) + type = FORMAT_LONGU; + else + type = FORMAT_INTU; flags |= FLAGS_HEX|FLAGS_UPPER|FLAGS_UNSIGNED; break; case 'c': @@ -549,7 +564,7 @@ static int parsefmt(const char *format, optr = &out[ocount++]; if(ocount > MAX_SEGMENTS) return PFMT_MANYSEGS; - optr->input = param; + optr->input = (unsigned int)param; optr->flags = flags; optr->width = width; optr->precision = precision; @@ -562,7 +577,7 @@ static int parsefmt(const char *format, } /* is there a trailing piece */ - outlen = fmt - start; + outlen = (size_t)(fmt - start); if(outlen) { optr = &out[ocount++]; if(ocount > MAX_SEGMENTS) @@ -668,7 +683,7 @@ static int formatf( char work[BUFFSIZE]; /* 'workend' points to the final buffer byte position, but with an extra - byte as margin to avoid the (false?) warning Coverity gives us + byte as margin to avoid the (FALSE?) warning Coverity gives us otherwise */ char *workend = &work[sizeof(work) - 2]; @@ -688,7 +703,7 @@ static int formatf( mp_intmax_t signed_num; /* Used to convert negative in positive. */ char *w; size_t outlen = optr->outlen; - int flags = optr->flags; + unsigned int flags = optr->flags; if(outlen) { char *str = optr->start; @@ -710,7 +725,7 @@ static int formatf( else width = -width; flags |= FLAGS_LEFT; - flags &= ~FLAGS_PAD_NIL; + flags &= ~(unsigned int)FLAGS_PAD_NIL; } } else @@ -760,7 +775,7 @@ static int formatf( } else if(flags & FLAGS_HEX) { /* Hexadecimal unsigned integer */ - digits = (flags & FLAGS_UPPER)? upper_digits : lower_digits; + digits = (flags & FLAGS_UPPER) ? upper_digits : lower_digits; base = 16; is_neg = FALSE; } @@ -862,12 +877,12 @@ number: str = (char *)iptr->val.str; if(!str) { - /* Write null string if there's space. */ + /* Write null string if there is space. */ if(prec == -1 || prec >= (int) sizeof(nilstr) - 1) { str = nilstr; len = sizeof(nilstr) - 1; /* Disable quotes around (nil) */ - flags &= (~FLAGS_ALT); + flags &= ~(unsigned int)FLAGS_ALT; } else { str = ""; @@ -886,13 +901,13 @@ number: if(flags & FLAGS_ALT) OUTCHAR('"'); - if(!(flags&FLAGS_LEFT)) + if(!(flags & FLAGS_LEFT)) while(width-- > 0) OUTCHAR(' '); for(; len && *str; len--) OUTCHAR(*str++); - if(flags&FLAGS_LEFT) + if(flags & FLAGS_LEFT) while(width-- > 0) OUTCHAR(' '); @@ -906,7 +921,7 @@ number: if(iptr->val.ptr) { /* If the pointer is not NULL, write it as a %#x spec. */ base = 16; - digits = (flags & FLAGS_UPPER)? upper_digits : lower_digits; + digits = (flags & FLAGS_UPPER) ? upper_digits : lower_digits; is_alt = TRUE; num = (size_t) iptr->val.ptr; is_neg = FALSE; @@ -952,12 +967,13 @@ number: *fptr = 0; if(width >= 0) { + size_t dlen; if(width >= (int)sizeof(work)) width = sizeof(work)-1; /* RECURSIVE USAGE */ - len = curl_msnprintf(fptr, left, "%d", width); - fptr += len; - left -= len; + dlen = (size_t)curl_msnprintf(fptr, left, "%d", width); + fptr += dlen; + left -= dlen; } if(prec >= 0) { /* for each digit in the integer part, we can have one less @@ -965,7 +981,7 @@ number: size_t maxprec = sizeof(work) - 2; double val = iptr->val.dnum; if(width > 0 && prec <= width) - maxprec -= width; + maxprec -= (size_t)width; while(val >= 10.0) { val /= 10; maxprec--; @@ -983,7 +999,7 @@ number: *fptr++ = 'l'; if(flags & FLAGS_FLOATE) - *fptr++ = (char)((flags & FLAGS_UPPER) ? 'E':'e'); + *fptr++ = (char)((flags & FLAGS_UPPER) ? 'E' : 'e'); else if(flags & FLAGS_FLOATG) *fptr++ = (char)((flags & FLAGS_UPPER) ? 'G' : 'g'); else @@ -1038,8 +1054,8 @@ static int addbyter(unsigned char outc, void *f) { struct nsprintf *infop = f; if(infop->length < infop->max) { - /* only do this if we haven't reached max length yet */ - *infop->buffer++ = outc; /* store */ + /* only do this if we have not reached max length yet */ + *infop->buffer++ = (char)outc; /* store */ infop->length++; /* we are now one byte larger */ return 0; /* fputc() returns like this on success */ } @@ -1060,10 +1076,10 @@ int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, if(info.max) { /* we terminate this with a zero byte */ if(info.max == info.length) { - /* we're at maximum, scrap the last letter */ + /* we are at maximum, scrap the last letter */ info.buffer[-1] = 0; DEBUGASSERT(retcode); - retcode--; /* don't count the nul byte */ + retcode--; /* do not count the nul byte */ } else info.buffer[0] = 0; @@ -1139,7 +1155,7 @@ char *curl_maprintf(const char *format, ...) static int storebuffer(unsigned char outc, void *f) { char **buffer = f; - **buffer = outc; + **buffer = (char)outc; (*buffer)++; return 0; } @@ -1160,9 +1176,7 @@ static int fputc_wrapper(unsigned char outc, void *f) int out = outc; FILE *s = f; int rc = fputc(out, s); - if(rc == out) - return 0; - return 1; + return rc == EOF; } int curl_mprintf(const char *format, ...) diff --git a/deps/curl/lib/mqtt.c b/deps/curl/lib/mqtt.c index 9290da03..69eaf344 100644 --- a/deps/curl/lib/mqtt.c +++ b/deps/curl/lib/mqtt.c @@ -75,7 +75,7 @@ static CURLcode mqtt_setup_conn(struct Curl_easy *data, */ const struct Curl_handler Curl_handler_mqtt = { - "MQTT", /* scheme */ + "mqtt", /* scheme */ mqtt_setup_conn, /* setup_connection */ mqtt_do, /* do_it */ mqtt_done, /* done */ @@ -89,6 +89,7 @@ const struct Curl_handler Curl_handler_mqtt = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_MQTT, /* defport */ @@ -120,7 +121,7 @@ static CURLcode mqtt_send(struct Curl_easy *data, CURLcode result = CURLE_OK; struct MQTT *mq = data->req.p.mqtt; size_t n; - result = Curl_xfer_send(data, buf, len, &n); + result = Curl_xfer_send(data, buf, len, FALSE, &n); if(result) return result; Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)n); @@ -153,15 +154,15 @@ static int mqtt_getsock(struct Curl_easy *data, static int mqtt_encode_len(char *buf, size_t len) { - unsigned char encoded; int i; - for(i = 0; (len > 0) && (i<4); i++) { + for(i = 0; (len > 0) && (i < 4); i++) { + unsigned char encoded; encoded = len % 0x80; len /= 0x80; if(len) encoded |= 0x80; - buf[i] = encoded; + buf[i] = (char)encoded; } return i; @@ -311,7 +312,7 @@ static CURLcode mqtt_connect(struct Curl_easy *data) start_user = pos + 3 + MQTT_CLIENTID_LEN; /* position where starts the password payload */ start_pwd = start_user + ulen; - /* if user name was provided, add it to the packet */ + /* if username was provided, add it to the packet */ if(ulen) { start_pwd += 2; @@ -374,7 +375,7 @@ static CURLcode mqtt_recv_atleast(struct Curl_easy *data, size_t nbytes) return CURLE_OUT_OF_MEMORY; rlen = Curl_dyn_len(&mq->recvbuf); } - return (rlen >= nbytes)? CURLE_OK : CURLE_AGAIN; + return (rlen >= nbytes) ? CURLE_OK : CURLE_AGAIN; } static void mqtt_recv_consume(struct Curl_easy *data, size_t nbytes) @@ -584,7 +585,7 @@ static size_t mqtt_decode_len(unsigned char *buf, return len; } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD static const char *statenames[]={ "MQTT_FIRST", "MQTT_REMAINING_LENGTH", @@ -605,11 +606,11 @@ static void mqstate(struct Curl_easy *data, { struct connectdata *conn = data->conn; struct mqtt_conn *mqtt = &conn->proto.mqtt; -#ifdef CURLDEBUG +#ifdef DEBUGBUILD infof(data, "%s (from %s) (next is %s)", statenames[state], statenames[mqtt->state], - (state == MQTT_FIRST)? statenames[nextstate] : ""); + (state == MQTT_FIRST) ? statenames[nextstate] : ""); #endif mqtt->state = state; if(state == MQTT_FIRST) @@ -742,7 +743,7 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done) struct mqtt_conn *mqtt = &conn->proto.mqtt; struct MQTT *mq = data->req.p.mqtt; ssize_t nread; - unsigned char byte; + unsigned char recvbyte; *done = FALSE; @@ -775,13 +776,13 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done) FALLTHROUGH(); case MQTT_REMAINING_LENGTH: do { - result = Curl_xfer_recv(data, (char *)&byte, 1, &nread); - if(!nread) + result = Curl_xfer_recv(data, (char *)&recvbyte, 1, &nread); + if(result || !nread) break; - Curl_debug(data, CURLINFO_HEADER_IN, (char *)&byte, 1); - mq->pkt_hd[mq->npacket++] = byte; - } while((byte & 0x80) && (mq->npacket < 4)); - if(nread && (byte & 0x80)) + Curl_debug(data, CURLINFO_HEADER_IN, (char *)&recvbyte, 1); + mq->pkt_hd[mq->npacket++] = recvbyte; + } while((recvbyte & 0x80) && (mq->npacket < 4)); + if(!result && nread && (recvbyte & 0x80)) /* MQTT supports up to 127 * 128^0 + 127 * 128^1 + 127 * 128^2 + 127 * 128^3 bytes. server tried to send more */ result = CURLE_WEIRD_SERVER_REPLY; diff --git a/deps/curl/lib/multi.c b/deps/curl/lib/multi.c index 0cf47234..c2f7806e 100644 --- a/deps/curl/lib/multi.c +++ b/deps/curl/lib/multi.c @@ -50,6 +50,7 @@ #include "http2.h" #include "socketpair.h" #include "socks.h" +#include "urlapi-int.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" #include "curl_memory.h" @@ -57,7 +58,7 @@ /* CURL_SOCKET_HASH_TABLE_SIZE should be a prime number. Increasing it from 97 - to 911 takes on a 32-bit machine 4 x 804 = 3211 more bytes. Still, every + to 911 takes on a 32-bit machine 4 x 804 = 3211 more bytes. Still, every CURL handle takes 45-50 K memory, therefore this 3K are not significant. */ #ifndef CURL_SOCKET_HASH_TABLE_SIZE @@ -79,27 +80,33 @@ * are not NULL, but no longer have the MAGIC touch. This gives * us early warning on things only discovered by valgrind otherwise. */ #define GOOD_MULTI_HANDLE(x) \ - (((x) && (x)->magic == CURL_MULTI_HANDLE)? TRUE: \ + (((x) && (x)->magic == CURL_MULTI_HANDLE)? TRUE: \ (DEBUGASSERT(!(x)), FALSE)) #else #define GOOD_MULTI_HANDLE(x) \ ((x) && (x)->magic == CURL_MULTI_HANDLE) #endif +static void move_pending_to_connect(struct Curl_multi *multi, + struct Curl_easy *data); static CURLMcode singlesocket(struct Curl_multi *multi, struct Curl_easy *data); 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 process_pending_handles(struct Curl_multi *multi); static void multi_xfer_bufs_free(struct Curl_multi *multi); +static void expire_ex(struct Curl_easy *data, const struct curltime *nowp, + timediff_t milli, expire_id id); -#ifdef DEBUGBUILD +#if defined( DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) static const char * const multi_statename[]={ "INIT", "PENDING", + "SETUP", "CONNECT", "RESOLVING", "CONNECTING", @@ -132,7 +139,7 @@ static void init_completed(struct Curl_easy *data) { /* this is a completed transfer */ - /* Important: reset the conn pointer so that we don't point to memory + /* Important: reset the conn pointer so that we do not point to memory that could be freed anytime */ Curl_detach_connection(data); Curl_expire_clear(data); /* stop all timers */ @@ -149,6 +156,7 @@ static void mstate(struct Curl_easy *data, CURLMstate state static const init_multistate_func finit[MSTATE_LAST] = { NULL, /* INIT */ NULL, /* PENDING */ + NULL, /* SETUP */ Curl_init_CONNECT, /* CONNECT */ NULL, /* RESOLVING */ NULL, /* CONNECTING */ @@ -171,7 +179,7 @@ static void mstate(struct Curl_easy *data, CURLMstate state #endif if(oldstate == state) - /* don't bother when the new state is the same as the old state */ + /* do not bother when the new state is the same as the old state */ return; data->mstate = state; @@ -187,7 +195,7 @@ static void mstate(struct Curl_easy *data, CURLMstate state #endif if(state == MSTATE_COMPLETED) { - /* changing to COMPLETED means there's one less easy handle 'alive' */ + /* changing to COMPLETED means there is one less easy handle 'alive' */ DEBUGASSERT(data->multi->num_alive > 0); data->multi->num_alive--; if(!data->multi->num_alive) { @@ -233,20 +241,19 @@ static struct Curl_sh_entry *sh_getentry(struct Curl_hash *sh, } #define TRHASH_SIZE 13 + +/* the given key here is a struct Curl_easy pointer */ static size_t trhash(void *key, size_t key_length, size_t slots_num) { - size_t keyval = (size_t)*(struct Curl_easy **)key; - (void) key_length; - - return (keyval % slots_num); + unsigned char bytes = ((unsigned char *)key)[key_length - 1] ^ + ((unsigned char *)key)[0]; + return (bytes % slots_num); } static size_t trhash_compare(void *k1, size_t k1_len, void *k2, size_t k2_len) { - (void)k1_len; (void)k2_len; - - return *(struct Curl_easy **)k1 == *(struct Curl_easy **)k2; + return !memcmp(k1, k2, k1_len); } static void trhash_dtor(void *nada) @@ -339,7 +346,7 @@ static size_t hash_fd(void *key, size_t key_length, size_t slots_num) curl_socket_t fd = *((curl_socket_t *) key); (void) key_length; - return (fd % slots_num); + return (fd % (curl_socket_t)slots_num); } /* @@ -350,22 +357,33 @@ static size_t hash_fd(void *key, size_t key_length, size_t slots_num) * "Some tests at 7000 and 9000 connections showed that the socket hash lookup * is somewhat of a bottle neck. Its current implementation may be a bit too * limiting. It simply has a fixed-size array, and on each entry in the array - * it has a linked list with entries. So the hash only checks which list to - * scan through. The code I had used so for used a list with merely 7 slots - * (as that is what the DNS hash uses) but with 7000 connections that would - * make an average of 1000 nodes in each list to run through. I upped that to - * 97 slots (I believe a prime is suitable) and noticed a significant speed - * increase. I need to reconsider the hash implementation or use a rather + * it has a linked list with entries. The hash only checks which list to scan + * through. The code I had used so for used a list with merely 7 slots (as + * that is what the DNS hash uses) but with 7000 connections that would make + * an average of 1000 nodes in each list to run through. I upped that to 97 + * slots (I believe a prime is suitable) and noticed a significant speed + * increase. I need to reconsider the hash implementation or use a rather * large default value like this. At 9000 connections I was still below 10us * per call." * */ -static void sh_init(struct Curl_hash *hash, int hashsize) +static void sh_init(struct Curl_hash *hash, size_t hashsize) { Curl_hash_init(hash, hashsize, hash_fd, fd_key_compare, sh_freeentry); } +/* multi->proto_hash destructor. Should never be called as elements + * MUST be added with their own destructor */ +static void ph_freeentry(void *p) +{ + (void)p; + /* Will always be FALSE. Cannot use a 0 assert here since compilers + * are not in agreement if they then want a NORETURN attribute or + * not. *sigh* */ + DEBUGASSERT(p == NULL); +} + /* * multi_addmsg() * @@ -374,13 +392,12 @@ static void sh_init(struct Curl_hash *hash, int hashsize) */ static void multi_addmsg(struct Curl_multi *multi, struct Curl_message *msg) { - Curl_llist_insert_next(&multi->msglist, multi->msglist.tail, msg, - &msg->list); + Curl_llist_append(&multi->msglist, msg, &msg->list); } -struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ - int chashsize, /* connection hash */ - int dnssize) /* dns hash */ +struct Curl_multi *Curl_multi_handle(size_t hashsize, /* socket hash */ + size_t chashsize, /* connection hash */ + size_t dnssize) /* dns hash */ { struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi)); @@ -393,15 +410,21 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ sh_init(&multi->sockhash, hashsize); - if(Curl_conncache_init(&multi->conn_cache, chashsize)) + Curl_hash_init(&multi->proto_hash, 23, + Curl_hash_str, Curl_str_key_compare, ph_freeentry); + + if(Curl_cpool_init(&multi->cpool, Curl_on_disconnect, + multi, NULL, chashsize)) goto error; Curl_llist_init(&multi->msglist, NULL); + Curl_llist_init(&multi->process, NULL); Curl_llist_init(&multi->pending, NULL); Curl_llist_init(&multi->msgsent, NULL); multi->multiplexing = TRUE; multi->max_concurrent_streams = 100; + multi->last_timeout_ms = -1; #ifdef USE_WINSOCK multi->wsa_event = WSACreateEvent(); @@ -409,14 +432,7 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ goto error; #else #ifdef ENABLE_WAKEUP - if(wakeup_create(multi->wakeup_pair) < 0) { - multi->wakeup_pair[0] = CURL_SOCKET_BAD; - multi->wakeup_pair[1] = CURL_SOCKET_BAD; - } - else if(curlx_nonblock(multi->wakeup_pair[0], TRUE) < 0 || - curlx_nonblock(multi->wakeup_pair[1], TRUE) < 0) { - wakeup_close(multi->wakeup_pair[0]); - wakeup_close(multi->wakeup_pair[1]); + if(wakeup_create(multi->wakeup_pair, TRUE) < 0) { multi->wakeup_pair[0] = CURL_SOCKET_BAD; multi->wakeup_pair[1] = CURL_SOCKET_BAD; } @@ -428,13 +444,14 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ error: sockhash_destroy(&multi->sockhash); + Curl_hash_destroy(&multi->proto_hash); Curl_hash_destroy(&multi->hostcache); - Curl_conncache_destroy(&multi->conn_cache); + Curl_cpool_destroy(&multi->cpool); free(multi); return NULL; } -struct Curl_multi *curl_multi_init(void) +CURLM *curl_multi_init(void) { return Curl_multi_handle(CURL_SOCKET_HASH_TABLE_SIZE, CURL_CONNECTION_HASH_SIZE, @@ -448,63 +465,18 @@ static void multi_warn_debug(struct Curl_multi *multi, struct Curl_easy *data) infof(data, "!!! WARNING !!!"); infof(data, "This is a debug build of libcurl, " "do not use in production."); - multi->warned = true; + multi->warned = TRUE; } } #else #define multi_warn_debug(x,y) Curl_nop_stmt #endif -/* returns TRUE if the easy handle is supposed to be present in the main link - list */ -static bool in_main_list(struct Curl_easy *data) -{ - return ((data->mstate != MSTATE_PENDING) && - (data->mstate != MSTATE_MSGSENT)); -} - -static void link_easy(struct Curl_multi *multi, - struct Curl_easy *data) -{ - /* We add the new easy entry last in the list. */ - data->next = NULL; /* end of the line */ - if(multi->easyp) { - struct Curl_easy *last = multi->easylp; - last->next = data; - data->prev = last; - multi->easylp = data; /* the new last node */ - } - else { - /* first node, make prev NULL! */ - data->prev = NULL; - multi->easylp = multi->easyp = data; /* both first and last */ - } -} - -/* unlink the given easy handle from the linked list of easy handles */ -static void unlink_easy(struct Curl_multi *multi, - struct Curl_easy *data) -{ - /* make the previous node point to our next */ - if(data->prev) - data->prev->next = data->next; - else - multi->easyp = data->next; /* point to first node */ - - /* make our next point to our previous node */ - if(data->next) - data->next->prev = data->prev; - else - multi->easylp = data->prev; /* point to last node */ - - data->prev = data->next = NULL; -} - - -CURLMcode curl_multi_add_handle(struct Curl_multi *multi, - struct Curl_easy *data) +CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) { CURLMcode rc; + struct Curl_multi *multi = m; + struct Curl_easy *data = d; /* First, make some basic checks that the CURLM handle is a good handle */ if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -541,14 +513,16 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, Curl_llist_init(&data->state.timeoutlist, NULL); /* - * No failure allowed in this function beyond this point. And no - * modification of easy nor multi handle allowed before this except for - * potential multi's connection cache growing which won't be undone in this - * function no matter what. + * No failure allowed in this function beyond this point. No modification of + * easy nor multi handle allowed before this except for potential multi's + * connection pool growing which will not be undone in this function no + * matter what. */ if(data->set.errorbuffer) data->set.errorbuffer[0] = 0; + data->state.os_errno = 0; + /* make the Curl_easy refer back to this multi handle - before Curl_expire() is called. */ data->multi = multi; @@ -561,21 +535,11 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, happen. */ Curl_expire(data, 0, EXPIRE_RUN_NOW); - /* A somewhat crude work-around for a little glitch in Curl_update_timer() - that happens if the lastcall time is set to the same time when the handle - is removed as when the next handle is added, as then the check in - Curl_update_timer() that prevents calling the application multiple times - with the same timer info will not trigger and then the new handle's - timeout will not be notified to the app. - - The work-around is thus simply to clear the 'lastcall' variable to force - Curl_update_timer() to always trigger a callback to the app when a new - easy handle is added */ - memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall)); - rc = Curl_update_timer(multi); - if(rc) + if(rc) { + data->multi = NULL; /* not anymore */ return rc; + } /* set the easy handle */ multistate(data, MSTATE_INIT); @@ -588,13 +552,6 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, data->dns.hostcachetype = HCACHE_MULTI; } - /* Point to the shared or multi handle connection cache */ - if(data->share && (data->share->specifier & (1<< CURL_LOCK_DATA_CONNECT))) - data->state.conn_cache = &data->share->conn_cache; - else - data->state.conn_cache = &multi->conn_cache; - data->state.lastconnect_id = -1; - #ifdef USE_LIBPSL /* Do the same for PSL. */ if(data->share && (data->share->specifier & (1 << CURL_LOCK_DATA_PSL))) @@ -603,7 +560,8 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, data->psl = &multi->psl; #endif - link_easy(multi, data); + /* add the easy handle to the process list */ + Curl_llist_append(&multi->process, data, &data->multi_queue); /* increase the node-counter */ multi->num_easy++; @@ -611,21 +569,12 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, /* increase the alive-counter */ multi->num_alive++; - CONNCACHE_LOCK(data); - /* The closure handle only ever has default timeouts set. To improve the - state somewhat we clone the timeouts from each added handle so that the - closure handle always has the same timeouts as the most recently added - easy handle. */ - data->state.conn_cache->closure_handle->set.timeout = data->set.timeout; - data->state.conn_cache->closure_handle->set.server_response_timeout = - data->set.server_response_timeout; - data->state.conn_cache->closure_handle->set.no_signal = - data->set.no_signal; - data->id = data->state.conn_cache->next_easy_id++; - if(data->state.conn_cache->next_easy_id <= 0) - data->state.conn_cache->next_easy_id = 0; - CONNCACHE_UNLOCK(data); + /* the identifier inside the multi instance */ + data->mid = multi->next_easy_mid++; + if(multi->next_easy_mid <= 0) + multi->next_easy_mid = 0; + Curl_cpool_xfer_init(data); multi_warn_debug(multi, data); return CURLM_OK; @@ -647,6 +596,91 @@ static void debug_print_sock_hash(void *p) } #endif +struct multi_done_ctx { + BIT(premature); +}; + +static void multi_done_locked(struct connectdata *conn, + struct Curl_easy *data, + void *userdata) +{ + struct multi_done_ctx *mdctx = userdata; + + Curl_detach_connection(data); + + if(CONN_INUSE(conn)) { + /* Stop if still used. */ + DEBUGF(infof(data, "Connection still in use %zu, " + "no more multi_done now!", + Curl_llist_count(&conn->easyq))); + return; + } + + data->state.done = TRUE; /* called just now! */ + data->state.recent_conn_id = conn->connection_id; + + if(conn->dns_entry) + Curl_resolv_unlink(data, &conn->dns_entry); /* done with this */ + Curl_hostcache_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 +#if defined(USE_NTLM) + && !(conn->http_ntlm_state == NTLMSTATE_TYPE2 || + conn->proxy_ntlm_state == NTLMSTATE_TYPE2) +#endif +#if defined(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))) { + DEBUGF(infof(data, "multi_done, not reusing connection=%" + FMT_OFF_T ", forbid=%d" + ", close=%d, premature=%d, conn_multiplex=%d", + conn->connection_id, data->set.reuse_forbid, + conn->bits.close, mdctx->premature, + Curl_conn_is_multiplex(conn, FIRSTSOCKET))); + connclose(conn, "disconnecting"); + Curl_cpool_disconnect(data, conn, mdctx->premature); + } + else { + /* the connection is no longer in use by any transfer */ + if(Curl_cpool_conn_now_idle(data, conn)) { + /* connection kept in the cpool */ + const char *host = +#ifndef CURL_DISABLE_PROXY + conn->bits.socksproxy ? + conn->socks_proxy.host.dispname : + conn->bits.httpproxy ? conn->http_proxy.host.dispname : +#endif + conn->bits.conn_to_host ? conn->conn_to_host.dispname : + conn->host.dispname; + data->state.lastconnect_id = conn->connection_id; + infof(data, "Connection #%" FMT_OFF_T " to host %s left intact", + conn->connection_id, host); + } + else { + /* connection was removed from the cpool and destroyed. */ + data->state.lastconnect_id = -1; + } + } +} + static CURLcode multi_done(struct Curl_easy *data, CURLcode status, /* an error if this is called after an error was detected */ @@ -654,6 +688,9 @@ static CURLcode multi_done(struct Curl_easy *data, { CURLcode result, r2; struct connectdata *conn = data->conn; + struct multi_done_ctx mdctx; + + memset(&mdctx, 0, sizeof(mdctx)); #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) DEBUGF(infof(data, "multi_done[%s]: status: %d prem: %d done: %d", @@ -679,8 +716,8 @@ static CURLcode multi_done(struct Curl_easy *data, case CURLE_ABORTED_BY_CALLBACK: case CURLE_READ_ERROR: case CURLE_WRITE_ERROR: - /* When we're aborted due to a callback return code it basically have to - be counted as premature as there is trouble ahead if we don't. We have + /* When we are aborted due to a callback return code it basically have to + be counted as premature as there is trouble ahead if we do not. We have many callbacks and protocols work differently, we could potentially do this more fine-grained in the future. */ premature = TRUE; @@ -716,122 +753,41 @@ static CURLcode multi_done(struct Curl_easy *data, if(!result) result = Curl_req_done(&data->req, data, premature); - CONNCACHE_LOCK(data); - Curl_detach_connection(data); - if(CONN_INUSE(conn)) { - /* Stop if still used. */ - CONNCACHE_UNLOCK(data); - DEBUGF(infof(data, "Connection still in use %zu, " - "no more multi_done now!", - conn->easyq.size)); - return CURLE_OK; - } - - data->state.done = TRUE; /* called just now! */ - - if(conn->dns_entry) { - Curl_resolv_unlock(data, conn->dns_entry); /* done with this */ - conn->dns_entry = NULL; - } - Curl_hostcache_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 can't know in what - state it is for reusing, so we're 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. - */ - - data->state.recent_conn_id = conn->connection_id; - if((data->set.reuse_forbid -#if defined(USE_NTLM) - && !(conn->http_ntlm_state == NTLMSTATE_TYPE2 || - conn->proxy_ntlm_state == NTLMSTATE_TYPE2) -#endif -#if defined(USE_SPNEGO) - && !(conn->http_negotiate_state == GSS_AUTHRECV || - conn->proxy_negotiate_state == GSS_AUTHRECV) -#endif - ) || conn->bits.close - || (premature && !Curl_conn_is_multiplex(conn, FIRSTSOCKET))) { - DEBUGF(infof(data, "multi_done, not reusing connection=%" - CURL_FORMAT_CURL_OFF_T ", forbid=%d" - ", close=%d, premature=%d, conn_multiplex=%d", - conn->connection_id, - data->set.reuse_forbid, conn->bits.close, premature, - Curl_conn_is_multiplex(conn, FIRSTSOCKET))); - connclose(conn, "disconnecting"); - Curl_conncache_remove_conn(data, conn, FALSE); - CONNCACHE_UNLOCK(data); - Curl_disconnect(data, conn, premature); - } - else { - char buffer[256]; - const char *host = -#ifndef CURL_DISABLE_PROXY - conn->bits.socksproxy ? - conn->socks_proxy.host.dispname : - conn->bits.httpproxy ? conn->http_proxy.host.dispname : -#endif - conn->bits.conn_to_host ? conn->conn_to_host.dispname : - conn->host.dispname; - /* create string before returning the connection */ - curl_off_t connection_id = conn->connection_id; - msnprintf(buffer, sizeof(buffer), - "Connection #%" CURL_FORMAT_CURL_OFF_T " to host %s left intact", - connection_id, host); - /* the connection is no longer in use by this transfer */ - CONNCACHE_UNLOCK(data); - if(Curl_conncache_return_conn(data, conn)) { - /* remember the most recently used connection */ - data->state.lastconnect_id = connection_id; - data->state.recent_conn_id = connection_id; - infof(data, "%s", buffer); - } - else - data->state.lastconnect_id = -1; - } + /* Under the potential connection pool's share lock, decide what to + * do with the transfer's connection. */ + mdctx.premature = premature; + Curl_cpool_do_locked(data, data->conn, multi_done_locked, &mdctx); + /* flush the netrc cache */ + Curl_netrc_cleanup(&data->state.netrc); return result; } -static int close_connect_only(struct Curl_easy *data, - struct connectdata *conn, void *param) +static void close_connect_only(struct connectdata *conn, + struct Curl_easy *data, + void *userdata) { - (void)param; - if(data->state.lastconnect_id != conn->connection_id) - return 0; - - if(!conn->connect_only) - return 1; - - connclose(conn, "Removing connect-only easy handle"); - - return 1; + (void)userdata; + (void)data; + if(conn->connect_only) + connclose(conn, "Removing connect-only easy handle"); } -CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, - struct Curl_easy *data) +CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) { - struct Curl_easy *easy = data; + struct Curl_multi *multi = m; + struct Curl_easy *data = d; bool premature; - struct Curl_llist_element *e; + struct Curl_llist_node *e; CURLMcode rc; + bool removed_timer = FALSE; /* First, make some basic checks that the CURLM handle is a good handle */ if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; /* Verify that we got a somewhat good easy handle too */ - if(!GOOD_EASY_HANDLE(data)) + if(!GOOD_EASY_HANDLE(data) || !multi->num_easy) return CURLM_BAD_EASY_HANDLE; /* Prevent users from trying to remove same easy handle more than once */ @@ -845,7 +801,7 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - premature = (data->mstate < MSTATE_COMPLETED) ? TRUE : FALSE; + premature = (data->mstate < MSTATE_COMPLETED); /* If the 'state' is not INIT or COMPLETED, we might need to do something nice to put the easy_handle in a good known state when this returns. */ @@ -858,7 +814,7 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, if(data->conn && data->mstate > MSTATE_DO && data->mstate < MSTATE_COMPLETED) { - /* Set connection owner so that the DONE function closes it. We can + /* Set connection owner so that the DONE function closes it. We can safely do this here since connection is killed. */ streamclose(data->conn, "Removed with partial response"); } @@ -867,7 +823,7 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, /* multi_done() clears the association between the easy handle and the connection. - Note that this ignores the return code simply because there's + Note that this ignores the return code simply because there is nothing really useful to do with it anyway! */ (void)multi_done(data, data->result, premature); } @@ -875,18 +831,10 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, /* The timer must be shut down before data->multi is set to NULL, else the timenode will remain in the splay tree after curl_easy_cleanup is called. Do it after multi_done() in case that sets another time! */ - Curl_expire_clear(data); + removed_timer = Curl_expire_clear(data); - if(data->connect_queue.ptr) { - /* the handle is in the pending or msgsent lists, so go ahead and remove - it */ - if(data->mstate == MSTATE_PENDING) - Curl_llist_remove(&multi->pending, &data->connect_queue, NULL); - else - Curl_llist_remove(&multi->msgsent, &data->connect_queue, NULL); - } - if(in_main_list(data)) - unlink_easy(multi, data); + /* the handle is in a list, remove it from whichever it is */ + Curl_node_remove(&data->multi_queue); if(data->dns.hostcachetype == HCACHE_MULTI) { /* stop using the multi handle's DNS cache, *after* the possible @@ -901,9 +849,9 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, what we want */ data->mstate = MSTATE_COMPLETED; - /* This ignores the return code even in case of problems because there's + /* This ignores the return code even in case of problems because there is nothing more to do about that, here */ - (void)singlesocket(multi, easy); /* to let the application know what sockets + (void)singlesocket(multi, data); /* to let the application know what sockets that vanish with this handle */ /* Remove the association between the connection and the handle */ @@ -913,7 +861,7 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, /* This removes a handle that was part the multi interface that used CONNECT_ONLY, that connection is now left alive but since this handle has bits.close set nothing can use that transfer anymore and it is - forbidden from reuse. And this easy handle cannot find the connection + forbidden from reuse. This easy handle cannot find the connection anymore once removed from the multi handle Better close the connection here, at once. @@ -922,15 +870,14 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, curl_socket_t s; s = Curl_getconnectinfo(data, &c); if((s != CURL_SOCKET_BAD) && c) { - Curl_conncache_remove_conn(data, c, TRUE); - Curl_disconnect(data, c, TRUE); + Curl_cpool_disconnect(data, c, TRUE); } } if(data->state.lastconnect_id != -1) { /* Mark any connect-only connection for closure */ - Curl_conncache_foreach(data, data->state.conn_cache, - NULL, close_connect_only); + Curl_cpool_do_by_id(data, data->state.lastconnect_id, + close_connect_only, NULL); } #ifdef USE_LIBPSL @@ -939,33 +886,31 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, data->psl = NULL; #endif - /* as this was using a shared connection cache we clear the pointer to that - since we're not part of that multi handle anymore */ - data->state.conn_cache = NULL; - - data->multi = NULL; /* clear the association to this multi handle */ - - /* make sure there's no pending message in the queue sent from this easy + /* make sure there is no pending message in the queue sent from this easy handle */ - for(e = multi->msglist.head; e; e = e->next) { - struct Curl_message *msg = e->ptr; + for(e = Curl_llist_head(&multi->msglist); e; e = Curl_node_next(e)) { + struct Curl_message *msg = Curl_node_elem(e); - if(msg->extmsg.easy_handle == easy) { - Curl_llist_remove(&multi->msglist, e, NULL); + if(msg->extmsg.easy_handle == data) { + Curl_node_remove(e); /* there can only be one from this specific handle */ break; } } + data->multi = NULL; /* clear the association to this multi handle */ + data->mid = -1; + /* NOTE NOTE NOTE We do not touch the easy handle here! */ multi->num_easy--; /* one less to care about now */ - process_pending_handles(multi); - rc = Curl_update_timer(multi); - if(rc) - return rc; + if(removed_timer) { + rc = Curl_update_timer(multi); + if(rc) + return rc; + } return CURLM_OK; } @@ -986,7 +931,7 @@ void Curl_detach_connection(struct Curl_easy *data) struct connectdata *conn = data->conn; if(conn) { Curl_conn_ev_data_detach(conn, data); - Curl_llist_remove(&conn->easyq, &data->conn_queue, NULL); + Curl_node_remove(&data->conn_queue); } data->conn = NULL; } @@ -997,13 +942,13 @@ void Curl_detach_connection(struct Curl_easy *data) * This is the only function that should assign data->conn */ void Curl_attach_connection(struct Curl_easy *data, - struct connectdata *conn) + struct connectdata *conn) { + DEBUGASSERT(data); DEBUGASSERT(!data->conn); DEBUGASSERT(conn); data->conn = conn; - Curl_llist_insert_next(&conn->easyq, conn->easyq.tail, data, - &data->conn_queue); + Curl_llist_append(&conn->easyq, data, &data->conn_queue); if(conn->handler && conn->handler->attach) conn->handler->attach(data, conn); Curl_conn_ev_data_attach(conn, data); @@ -1012,12 +957,14 @@ void Curl_attach_connection(struct Curl_easy *data, static int connecting_getsock(struct Curl_easy *data, curl_socket_t *socks) { struct connectdata *conn = data->conn; - (void)socks; - /* Not using `conn->sockfd` as `Curl_xfer_setup()` initializes - * that *after* the connect. */ - if(conn && conn->sock[FIRSTSOCKET] != CURL_SOCKET_BAD) { + curl_socket_t sockfd; + + if(!conn) + return GETSOCK_BLANK; + sockfd = Curl_conn_get_socket(data, FIRSTSOCKET); + if(sockfd != CURL_SOCKET_BAD) { /* Default is to wait to something from the server */ - socks[0] = conn->sock[FIRSTSOCKET]; + socks[0] = sockfd; return GETSOCK_READSOCK(0); } return GETSOCK_BLANK; @@ -1026,11 +973,16 @@ static int connecting_getsock(struct Curl_easy *data, curl_socket_t *socks) static int protocol_getsock(struct Curl_easy *data, curl_socket_t *socks) { struct connectdata *conn = data->conn; - if(conn && conn->handler->proto_getsock) + curl_socket_t sockfd; + + if(!conn) + return GETSOCK_BLANK; + if(conn->handler->proto_getsock) return conn->handler->proto_getsock(data, conn, socks); - else if(conn && conn->sockfd != CURL_SOCKET_BAD) { + sockfd = Curl_conn_get_socket(data, FIRSTSOCKET); + if(sockfd != CURL_SOCKET_BAD) { /* Default is to wait to something from the server */ - socks[0] = conn->sockfd; + socks[0] = sockfd; return GETSOCK_READSOCK(0); } return GETSOCK_BLANK; @@ -1039,9 +991,11 @@ static int protocol_getsock(struct Curl_easy *data, curl_socket_t *socks) static int domore_getsock(struct Curl_easy *data, curl_socket_t *socks) { struct connectdata *conn = data->conn; - if(conn && conn->handler->domore_getsock) + if(!conn) + return GETSOCK_BLANK; + if(conn->handler->domore_getsock) return conn->handler->domore_getsock(data, conn, socks); - else if(conn && conn->sockfd != CURL_SOCKET_BAD) { + else if(conn->sockfd != CURL_SOCKET_BAD) { /* Default is that we want to send something to the server */ socks[0] = conn->sockfd; return GETSOCK_WRITESOCK(0); @@ -1052,9 +1006,11 @@ static int domore_getsock(struct Curl_easy *data, curl_socket_t *socks) static int doing_getsock(struct Curl_easy *data, curl_socket_t *socks) { struct connectdata *conn = data->conn; - if(conn && conn->handler->doing_getsock) + if(!conn) + return GETSOCK_BLANK; + if(conn->handler->doing_getsock) return conn->handler->doing_getsock(data, conn, socks); - else if(conn && conn->sockfd != CURL_SOCKET_BAD) { + else if(conn->sockfd != CURL_SOCKET_BAD) { /* Default is that we want to send something to the server */ socks[0] = conn->sockfd; return GETSOCK_WRITESOCK(0); @@ -1065,7 +1021,6 @@ static int doing_getsock(struct Curl_easy *data, curl_socket_t *socks) static int perform_getsock(struct Curl_easy *data, curl_socket_t *sock) { struct connectdata *conn = data->conn; - if(!conn) return GETSOCK_BLANK; else if(conn->handler->perform_getsock) @@ -1080,7 +1035,7 @@ static int perform_getsock(struct Curl_easy *data, curl_socket_t *sock) sock[sockindex] = conn->sockfd; } - if(CURL_WANT_SEND(data)) { + if(Curl_req_want_send(data)) { if((conn->sockfd != conn->writesockfd) || bitmap == GETSOCK_BLANK) { /* only if they are not the same socket and we have a readable @@ -1102,6 +1057,7 @@ static int perform_getsock(struct Curl_easy *data, curl_socket_t *sock) static void multi_getsock(struct Curl_easy *data, struct easy_pollset *ps) { + bool expect_sockets = TRUE; /* The no connection case can happen when this is called from curl_multi_remove_handle() => singlesocket() => multi_getsock(). */ @@ -1112,13 +1068,17 @@ static void multi_getsock(struct Curl_easy *data, switch(data->mstate) { case MSTATE_INIT: case MSTATE_PENDING: + case MSTATE_SETUP: case MSTATE_CONNECT: /* nothing to poll for yet */ + expect_sockets = FALSE; break; case MSTATE_RESOLVING: Curl_pollset_add_socks(data, ps, Curl_resolv_getsock); - /* connection filters are not involved in this phase */ + /* connection filters are not involved in this phase. It's ok if we get no + * sockets to wait for. Resolving can wake up from other sources. */ + expect_sockets = FALSE; break; case MSTATE_CONNECTING: @@ -1152,32 +1112,46 @@ static void multi_getsock(struct Curl_easy *data, 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; } + + if(expect_sockets && !ps->num && + !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 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); + } } -CURLMcode curl_multi_fdset(struct Curl_multi *multi, +CURLMcode curl_multi_fdset(CURLM *m, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd_set, int *max_fd) { /* Scan through all the easy handles to get the file descriptors set. Some easy handles may not have connected to the remote host yet, and then we must make sure that is done. */ - struct Curl_easy *data; int this_max_fd = -1; - struct easy_pollset ps; - unsigned int i; + struct Curl_llist_node *e; + struct Curl_multi *multi = m; (void)exc_fd_set; /* not used */ if(!GOOD_MULTI_HANDLE(multi)) @@ -1186,20 +1160,22 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - memset(&ps, 0, sizeof(ps)); - for(data = multi->easyp; data; data = data->next) { - multi_getsock(data, &ps); + for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *data = Curl_node_elem(e); + unsigned int i; - for(i = 0; i < ps.num; i++) { - if(!FDSET_SOCK(ps.sockets[i])) - /* pretend it doesn't exist */ + multi_getsock(data, &data->last_poll); + + for(i = 0; i < data->last_poll.num; i++) { + if(!FDSET_SOCK(data->last_poll.sockets[i])) + /* pretend it does not exist */ continue; - if(ps.actions[i] & CURL_POLL_IN) - FD_SET(ps.sockets[i], read_fd_set); - if(ps.actions[i] & CURL_POLL_OUT) - FD_SET(ps.sockets[i], write_fd_set); - if((int)ps.sockets[i] > this_max_fd) - this_max_fd = (int)ps.sockets[i]; + if(data->last_poll.actions[i] & CURL_POLL_IN) + FD_SET(data->last_poll.sockets[i], read_fd_set); + if(data->last_poll.actions[i] & CURL_POLL_OUT) + FD_SET(data->last_poll.sockets[i], write_fd_set); + if((int)data->last_poll.sockets[i] > this_max_fd) + this_max_fd = (int)data->last_poll.sockets[i]; } } @@ -1208,8 +1184,48 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, return CURLM_OK; } +CURLMcode curl_multi_waitfds(CURLM *m, + struct curl_waitfd *ufds, + unsigned int size, + unsigned int *fd_count) +{ + struct curl_waitfds cwfds; + CURLMcode result = CURLM_OK; + struct Curl_llist_node *e; + struct Curl_multi *multi = m; + + if(!ufds) + return CURLM_BAD_FUNCTION_ARGUMENT; + + if(!GOOD_MULTI_HANDLE(multi)) + return CURLM_BAD_HANDLE; + + if(multi->in_callback) + return CURLM_RECURSIVE_API_CALL; + + Curl_waitfds_init(&cwfds, ufds, size); + for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *data = Curl_node_elem(e); + multi_getsock(data, &data->last_poll); + if(Curl_waitfds_add_ps(&cwfds, &data->last_poll)) { + result = CURLM_OUT_OF_MEMORY; + goto out; + } + } + + if(Curl_cpool_add_waitfds(&multi->cpool, &cwfds)) { + result = CURLM_OUT_OF_MEMORY; + goto out; + } + +out: + if(fd_count) + *fd_count = cwfds.n; + return result; +} + #ifdef USE_WINSOCK -/* Reset FD_WRITE for TCP sockets. Nothing is actually sent. UDP sockets can't +/* Reset FD_WRITE for TCP sockets. Nothing is actually sent. UDP sockets cannot * be reset this way because an empty datagram would be sent. #9203 * * "On Windows the internal state of FD_WRITE as returned from @@ -1234,16 +1250,16 @@ static CURLMcode multi_wait(struct Curl_multi *multi, bool extrawait, /* when no socket, wait */ bool use_wakeup) { - struct Curl_easy *data; - struct easy_pollset ps; size_t i; - unsigned int nfds = 0; - unsigned int curlfds; + struct curltime expire_time; long timeout_internal; int retcode = 0; struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK]; - struct pollfd *ufds = &a_few_on_stack[0]; - bool ufds_malloc = FALSE; + struct curl_pollfds cpfds; + unsigned int curl_nfds = 0; /* how many pfds are for curl transfers */ + CURLMcode result = CURLM_OK; + struct Curl_llist_node *e; + #ifdef USE_WINSOCK WSANETWORKEVENTS wsa_events; DEBUGASSERT(multi->wsa_event != WSA_INVALID_EVENT); @@ -1261,148 +1277,108 @@ static CURLMcode multi_wait(struct Curl_multi *multi, if(timeout_ms < 0) return CURLM_BAD_FUNCTION_ARGUMENT; - /* Count up how many fds we have from the multi handle */ - memset(&ps, 0, sizeof(ps)); - for(data = multi->easyp; data; data = data->next) { - multi_getsock(data, &ps); - nfds += ps.num; + Curl_pollfds_init(&cpfds, a_few_on_stack, NUM_POLLS_ON_STACK); + + /* Add the curl handles to our pollfds first */ + for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *data = Curl_node_elem(e); + + multi_getsock(data, &data->last_poll); + if(Curl_pollfds_add_ps(&cpfds, &data->last_poll)) { + result = CURLM_OUT_OF_MEMORY; + goto out; + } } - /* If the internally desired timeout is actually shorter than requested from - the outside, then use the shorter time! But only if the internal timer - is actually larger than -1! */ - (void)multi_timeout(multi, &timeout_internal); - if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms)) - timeout_ms = (int)timeout_internal; - - curlfds = nfds; /* number of internal file descriptors */ - nfds += extra_nfds; /* add the externally provided ones */ - -#ifdef ENABLE_WAKEUP -#ifdef USE_WINSOCK - if(use_wakeup) { -#else - if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) { -#endif - ++nfds; + if(Curl_cpool_add_pollfds(&multi->cpool, &cpfds)) { + result = CURLM_OUT_OF_MEMORY; + goto out; } -#endif - if(nfds > NUM_POLLS_ON_STACK) { - /* 'nfds' is a 32 bit value and 'struct pollfd' is typically 8 bytes - big, so at 2^29 sockets this value might wrap. When a process gets - the capability to actually handle over 500 million sockets this - calculation needs a integer overflow check. */ - ufds = malloc(nfds * sizeof(struct pollfd)); - if(!ufds) - return CURLM_OUT_OF_MEMORY; - ufds_malloc = TRUE; + curl_nfds = cpfds.n; /* what curl internally uses in cpfds */ + /* Add external file descriptions from poll-like struct curl_waitfd */ + for(i = 0; i < extra_nfds; i++) { + unsigned short events = 0; + if(extra_fds[i].events & CURL_WAIT_POLLIN) + events |= POLLIN; + if(extra_fds[i].events & CURL_WAIT_POLLPRI) + events |= POLLPRI; + if(extra_fds[i].events & CURL_WAIT_POLLOUT) + events |= POLLOUT; + if(Curl_pollfds_add_sock(&cpfds, extra_fds[i].fd, events)) { + result = CURLM_OUT_OF_MEMORY; + goto out; + } } - nfds = 0; - /* only do the second loop if we found descriptors in the first stage run - above */ - - if(curlfds) { - /* Add the curl handles to our pollfds first */ - for(data = multi->easyp; data; data = data->next) { - multi_getsock(data, &ps); - - for(i = 0; i < ps.num; i++) { - struct pollfd *ufd = &ufds[nfds++]; #ifdef USE_WINSOCK - long mask = 0; -#endif - ufd->fd = ps.sockets[i]; - ufd->events = 0; - if(ps.actions[i] & CURL_POLL_IN) { -#ifdef USE_WINSOCK - mask |= FD_READ|FD_ACCEPT|FD_CLOSE; -#endif - ufd->events |= POLLIN; - } - if(ps.actions[i] & CURL_POLL_OUT) { -#ifdef USE_WINSOCK - mask |= FD_WRITE|FD_CONNECT|FD_CLOSE; - reset_socket_fdwrite(ps.sockets[i]); -#endif - ufd->events |= POLLOUT; - } -#ifdef USE_WINSOCK - if(WSAEventSelect(ps.sockets[i], multi->wsa_event, mask) != 0) { - if(ufds_malloc) - free(ufds); - return CURLM_INTERNAL_ERROR; - } -#endif + /* Set the WSA events based on the collected pollds */ + for(i = 0; i < cpfds.n; i++) { + long mask = 0; + if(cpfds.pfds[i].events & POLLIN) + 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; + reset_socket_fdwrite(cpfds.pfds[i].fd); + } + if(mask) { + if(WSAEventSelect(cpfds.pfds[i].fd, multi->wsa_event, mask) != 0) { + result = CURLM_OUT_OF_MEMORY; + goto out; } } } - - /* Add external file descriptions from poll-like struct curl_waitfd */ - for(i = 0; i < extra_nfds; i++) { -#ifdef USE_WINSOCK - long mask = 0; - if(extra_fds[i].events & CURL_WAIT_POLLIN) - mask |= FD_READ|FD_ACCEPT|FD_CLOSE; - if(extra_fds[i].events & CURL_WAIT_POLLPRI) - mask |= FD_OOB; - if(extra_fds[i].events & CURL_WAIT_POLLOUT) { - mask |= FD_WRITE|FD_CONNECT|FD_CLOSE; - reset_socket_fdwrite(extra_fds[i].fd); - } - if(WSAEventSelect(extra_fds[i].fd, multi->wsa_event, mask) != 0) { - if(ufds_malloc) - free(ufds); - return CURLM_INTERNAL_ERROR; - } #endif - ufds[nfds].fd = extra_fds[i].fd; - ufds[nfds].events = 0; - if(extra_fds[i].events & CURL_WAIT_POLLIN) - ufds[nfds].events |= POLLIN; - if(extra_fds[i].events & CURL_WAIT_POLLPRI) - ufds[nfds].events |= POLLPRI; - if(extra_fds[i].events & CURL_WAIT_POLLOUT) - ufds[nfds].events |= POLLOUT; - ++nfds; - } #ifdef ENABLE_WAKEUP #ifndef USE_WINSOCK if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) { - ufds[nfds].fd = multi->wakeup_pair[0]; - ufds[nfds].events = POLLIN; - ++nfds; + if(Curl_pollfds_add_sock(&cpfds, multi->wakeup_pair[0], POLLIN)) { + result = CURLM_OUT_OF_MEMORY; + goto out; + } } #endif #endif + /* We check the internal timeout *AFTER* we collected all sockets to + * 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); + if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms)) + timeout_ms = (int)timeout_internal; + #if defined(ENABLE_WAKEUP) && defined(USE_WINSOCK) - if(nfds || use_wakeup) { + if(cpfds.n || use_wakeup) { #else - if(nfds) { + if(cpfds.n) { #endif int pollrc; #ifdef USE_WINSOCK - if(nfds) - pollrc = Curl_poll(ufds, nfds, 0); /* just pre-check with WinSock */ + if(cpfds.n) /* just pre-check with Winsock */ + pollrc = Curl_poll(cpfds.pfds, cpfds.n, 0); else pollrc = 0; #else - pollrc = Curl_poll(ufds, nfds, timeout_ms); /* wait... */ + pollrc = Curl_poll(cpfds.pfds, cpfds.n, timeout_ms); /* wait... */ #endif - if(pollrc < 0) - return CURLM_UNRECOVERABLE_POLL; + if(pollrc < 0) { + result = CURLM_UNRECOVERABLE_POLL; + goto out; + } if(pollrc > 0) { retcode = pollrc; #ifdef USE_WINSOCK } else { /* now wait... if not ready during the pre-check (pollrc == 0) */ - WSAWaitForMultipleEvents(1, &multi->wsa_event, FALSE, timeout_ms, FALSE); + WSAWaitForMultipleEvents(1, &multi->wsa_event, FALSE, (DWORD)timeout_ms, + FALSE); } - /* With WinSock, we have to run the following section unconditionally + /* With Winsock, we have to run the following section unconditionally to call WSAEventSelect(fd, event, 0) on all the sockets */ { #endif @@ -1410,7 +1386,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, struct, the bit values of the actual underlying poll() implementation may not be the same as the ones in the public libcurl API! */ for(i = 0; i < extra_nfds; i++) { - unsigned r = ufds[curlfds + i].revents; + unsigned r = (unsigned)cpfds.pfds[curl_nfds + i].revents; unsigned short mask = 0; #ifdef USE_WINSOCK curl_socket_t s = extra_fds[i].fd; @@ -1427,7 +1403,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, } WSAEventSelect(s, multi->wsa_event, 0); if(!pollrc) { - extra_fds[i].revents = mask; + extra_fds[i].revents = (short)mask; continue; } #endif @@ -1437,25 +1413,25 @@ static CURLMcode multi_wait(struct Curl_multi *multi, mask |= CURL_WAIT_POLLOUT; if(r & POLLPRI) mask |= CURL_WAIT_POLLPRI; - extra_fds[i].revents = mask; + extra_fds[i].revents = (short)mask; } #ifdef USE_WINSOCK /* Count up all our own sockets that had activity, and remove them from the event. */ - if(curlfds) { + if(curl_nfds) { + for(e = Curl_llist_head(&multi->process); e && !result; + e = Curl_node_next(e)) { + struct Curl_easy *data = Curl_node_elem(e); - for(data = multi->easyp; data; data = data->next) { - multi_getsock(data, &ps); - - for(i = 0; i < ps.num; i++) { + for(i = 0; i < data->last_poll.num; i++) { wsa_events.lNetworkEvents = 0; - if(WSAEnumNetworkEvents(ps.sockets[i], NULL, + if(WSAEnumNetworkEvents(data->last_poll.sockets[i], NULL, &wsa_events) == 0) { if(ret && !pollrc && wsa_events.lNetworkEvents) retcode++; } - WSAEventSelect(ps.sockets[i], multi->wsa_event, 0); + WSAEventSelect(data->last_poll.sockets[i], multi->wsa_event, 0); } } } @@ -1464,7 +1440,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, #else #ifdef ENABLE_WAKEUP if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) { - if(ufds[curlfds + extra_nfds].revents & POLLIN) { + if(cpfds.pfds[curl_nfds + extra_nfds].revents & POLLIN) { char buf[64]; ssize_t nread; while(1) { @@ -1488,18 +1464,16 @@ static CURLMcode multi_wait(struct Curl_multi *multi, } } - if(ufds_malloc) - free(ufds); if(ret) *ret = retcode; #if defined(ENABLE_WAKEUP) && defined(USE_WINSOCK) - if(extrawait && !nfds && !use_wakeup) { + if(extrawait && !cpfds.n && !use_wakeup) { #else - if(extrawait && !nfds) { + if(extrawait && !cpfds.n) { #endif long sleep_ms = 0; - /* Avoid busy-looping when there's nothing particular to wait for */ + /* Avoid busy-looping when there is nothing particular to wait for */ if(!curl_multi_timeout(multi, &sleep_ms) && sleep_ms) { if(sleep_ms > timeout_ms) sleep_ms = timeout_ms; @@ -1511,10 +1485,12 @@ static CURLMcode multi_wait(struct Curl_multi *multi, } } - return CURLM_OK; +out: + Curl_pollfds_cleanup(&cpfds); + return result; } -CURLMcode curl_multi_wait(struct Curl_multi *multi, +CURLMcode curl_multi_wait(CURLM *multi, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, @@ -1524,7 +1500,7 @@ CURLMcode curl_multi_wait(struct Curl_multi *multi, FALSE); } -CURLMcode curl_multi_poll(struct Curl_multi *multi, +CURLMcode curl_multi_poll(CURLM *multi, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, @@ -1534,11 +1510,21 @@ CURLMcode curl_multi_poll(struct Curl_multi *multi, TRUE); } -CURLMcode curl_multi_wakeup(struct Curl_multi *multi) +CURLMcode curl_multi_wakeup(CURLM *m) { /* this function is usually called from another thread, it has to be careful only to access parts of the Curl_multi struct that are constant */ + struct Curl_multi *multi = m; + +#if defined(ENABLE_WAKEUP) && !defined(USE_WINSOCK) +#ifdef USE_EVENTFD + const void *buf; + const uint64_t val = 1; +#else + char buf[1]; +#endif +#endif /* GOOD_MULTI_HANDLE can be safely called */ if(!GOOD_MULTI_HANDLE(multi)) @@ -1553,8 +1539,11 @@ CURLMcode curl_multi_wakeup(struct Curl_multi *multi) making it safe to access from another thread after the init part and before cleanup */ if(multi->wakeup_pair[1] != CURL_SOCKET_BAD) { - char buf[1]; +#ifdef USE_EVENTFD + buf = &val; +#else buf[0] = 1; +#endif while(1) { /* swrite() is not thread-safe in general, because concurrent calls can have their messages interleaved, but in this case the content @@ -1563,7 +1552,7 @@ CURLMcode curl_multi_wakeup(struct Curl_multi *multi) The write socket is set to non-blocking, this way this function cannot block, making it safe to call even from the same thread that will call curl_multi_wait(). If swrite() returns that it - would block, it's considered successful because it means that + would block, it is considered successful because it means that previous calls to this function will wake up the poll(). */ if(wakeup_write(multi->wakeup_pair[1], buf, sizeof(buf)) < 0) { int err = SOCKERRNO; @@ -1627,7 +1616,7 @@ CURLMcode Curl_multi_add_perform(struct Curl_multi *multi, if(!rc) { struct SingleRequest *k = &data->req; - /* pass in NULL for 'conn' here since we don't want to init the + /* pass in NULL for 'conn' here since we do not want to init the connection, only this transfer */ Curl_init_do(data, NULL); @@ -1659,7 +1648,7 @@ static CURLcode multi_do(struct Curl_easy *data, bool *done) * second connection. * * 'complete' can return 0 for incomplete, 1 for done and -1 for go back to - * DOING state there's more work to do! + * DOING state there is more work to do! */ static CURLcode multi_do_more(struct Curl_easy *data, int *complete) @@ -1681,50 +1670,50 @@ static CURLcode multi_do_more(struct Curl_easy *data, int *complete) static bool multi_handle_timeout(struct Curl_easy *data, struct curltime *now, bool *stream_error, - CURLcode *result, - bool connect_timeout) + CURLcode *result) { - timediff_t timeout_ms; - timeout_ms = Curl_timeleft(data, now, connect_timeout); - + bool connect_timeout = data->mstate < MSTATE_DO; + timediff_t timeout_ms = Curl_timeleft(data, now, connect_timeout); if(timeout_ms < 0) { /* Handle timed out */ + struct curltime since; + if(connect_timeout) + since = data->progress.t_startsingle; + else + since = data->progress.t_startop; if(data->mstate == MSTATE_RESOLVING) - failf(data, "Resolving timed out after %" CURL_FORMAT_TIMEDIFF_T - " milliseconds", - Curl_timediff(*now, data->progress.t_startsingle)); + failf(data, "Resolving timed out after %" FMT_TIMEDIFF_T + " milliseconds", Curl_timediff(*now, since)); else if(data->mstate == MSTATE_CONNECTING) - failf(data, "Connection timed out after %" CURL_FORMAT_TIMEDIFF_T - " milliseconds", - Curl_timediff(*now, data->progress.t_startsingle)); + failf(data, "Connection timed out after %" FMT_TIMEDIFF_T + " milliseconds", Curl_timediff(*now, since)); else { struct SingleRequest *k = &data->req; if(k->size != -1) { - failf(data, "Operation timed out after %" CURL_FORMAT_TIMEDIFF_T - " milliseconds with %" CURL_FORMAT_CURL_OFF_T " out of %" - CURL_FORMAT_CURL_OFF_T " bytes received", - Curl_timediff(*now, data->progress.t_startsingle), - k->bytecount, k->size); + failf(data, "Operation timed out after %" FMT_TIMEDIFF_T + " milliseconds with %" FMT_OFF_T " out of %" + FMT_OFF_T " bytes received", + Curl_timediff(*now, since), k->bytecount, k->size); } else { - failf(data, "Operation timed out after %" CURL_FORMAT_TIMEDIFF_T - " milliseconds with %" CURL_FORMAT_CURL_OFF_T - " bytes received", - Curl_timediff(*now, data->progress.t_startsingle), - k->bytecount); + failf(data, "Operation timed out after %" FMT_TIMEDIFF_T + " milliseconds with %" FMT_OFF_T " bytes received", + Curl_timediff(*now, since), k->bytecount); } } - - /* Force connection closed if the connection has indeed been used */ - if(data->mstate > MSTATE_DO) { - streamclose(data->conn, "Disconnected with pending data"); - *stream_error = TRUE; - } *result = CURLE_OPERATION_TIMEDOUT; - (void)multi_done(data, *result, TRUE); + if(data->conn) { + /* Force connection closed if the connection has indeed been used */ + if(data->mstate > MSTATE_DO) { + streamclose(data->conn, "Disconnect due to timeout"); + *stream_error = TRUE; + } + (void)multi_done(data, *result, TRUE); + } + return TRUE; } - return (timeout_ms < 0); + return FALSE; } /* @@ -1787,10 +1776,10 @@ static CURLcode protocol_connect(struct Curl_easy *data, && 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 don't know if the protocol is actually done. + or proxy. Note that we do not know if the protocol is actually done. - Unless this protocol doesn't have any protocol-connect callback, as - then we know we're 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; @@ -1807,7 +1796,7 @@ static CURLcode protocol_connect(struct Curl_easy *data, else *protocol_done = TRUE; - /* it has started, possibly even completed but that knowledge isn't stored + /* it has started, possibly even completed but that knowledge is not stored in this bit! */ if(!result) conn->bits.protoconnstart = TRUE; @@ -1816,38 +1805,800 @@ static CURLcode protocol_connect(struct Curl_easy *data, return result; /* pass back status */ } -/* - * Curl_preconnect() is called immediately before a connect starts. When a - * redirect is followed, this is then called multiple times during a single - * transfer. - */ -CURLcode Curl_preconnect(struct Curl_easy *data) -{ - /* this used to do data->state.buffer allocation, - maybe remove completely now? */ - (void)data; - return CURLE_OK; -} - static void set_in_callback(struct Curl_multi *multi, bool value) { multi->in_callback = value; } +/* + * posttransfer() is called immediately after a transfer ends + */ +static void multi_posttransfer(struct Curl_easy *data) +{ +#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL) + /* restore the signal handler for SIGPIPE before we get back */ + if(!data->set.no_signal) + signal(SIGPIPE, data->state.prev_signal); +#else + (void)data; /* unused parameter */ +#endif +} + +/* + * multi_follow() handles the URL redirect magic. Pass in the 'newurl' string + * as given by the remote server and set up the new URL to request. + * + * This function DOES NOT FREE the given url. + */ +static CURLcode multi_follow(struct Curl_easy *data, + char *newurl, /* the Location: string */ + followtype type) /* see transfer.h */ +{ +#ifdef CURL_DISABLE_HTTP + (void)data; + (void)newurl; + (void)type; + /* Location: following will not happen when HTTP is disabled */ + return CURLE_TOO_MANY_REDIRECTS; +#else + + /* Location: redirect */ + bool disallowport = FALSE; + bool reachedmax = FALSE; + CURLUcode uc; + + DEBUGASSERT(type != FOLLOW_NONE); + + if(type != FOLLOW_FAKE) + data->state.requests++; /* count all real follows */ + if(type == FOLLOW_REDIR) { + if((data->set.maxredirs != -1) && + (data->state.followlocation >= data->set.maxredirs)) { + reachedmax = TRUE; + type = FOLLOW_FAKE; /* switch to fake to store the would-be-redirected + to URL */ + } + else { + data->state.followlocation++; /* count redirect-followings, including + auth reloads */ + + if(data->set.http_auto_referer) { + CURLU *u; + char *referer = NULL; + + /* 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; + } + + /* Make a copy of the URL without credentials and fragment */ + u = curl_url(); + if(!u) + return CURLE_OUT_OF_MEMORY; + + uc = curl_url_set(u, CURLUPART_URL, data->state.url, 0); + if(!uc) + uc = curl_url_set(u, CURLUPART_FRAGMENT, NULL, 0); + if(!uc) + uc = curl_url_set(u, CURLUPART_USER, NULL, 0); + if(!uc) + uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0); + if(!uc) + uc = curl_url_get(u, CURLUPART_URL, &referer, 0); + + curl_url_cleanup(u); + + if(uc || !referer) + return CURLE_OUT_OF_MEMORY; + + data->state.referer = referer; + data->state.referer_alloc = TRUE; /* yes, free this later */ + } + } + } + + if((type != FOLLOW_RETRY) && + (data->req.httpcode != 401) && (data->req.httpcode != 407) && + Curl_is_absolute_url(newurl, NULL, 0, FALSE)) { + /* If this is not redirect due to a 401 or 407 response and an absolute + URL: do not allow a custom port number */ + disallowport = TRUE; + } + + DEBUGASSERT(data->state.uh); + uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, (unsigned int) + ((type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME : + ((type == FOLLOW_REDIR) ? CURLU_URLENCODE : 0) | + CURLU_ALLOW_SPACE | + (data->set.path_as_is ? CURLU_PATH_AS_IS : 0))); + if(uc) { + if(type != FOLLOW_FAKE) { + failf(data, "The redirect target URL could not be parsed: %s", + curl_url_strerror(uc)); + return Curl_uc_to_curlcode(uc); + } + + /* the URL could not be parsed for some reason, but since this is FAKE + mode, just duplicate the field as-is */ + newurl = strdup(newurl); + if(!newurl) + return CURLE_OUT_OF_MEMORY; + } + else { + uc = curl_url_get(data->state.uh, CURLUPART_URL, &newurl, 0); + if(uc) + return Curl_uc_to_curlcode(uc); + + /* Clear auth if this redirects to a different port number or protocol, + unless permitted */ + if(!data->set.allow_auth_to_other_hosts && (type != FOLLOW_FAKE)) { + char *portnum; + int port; + bool clear = FALSE; + + if(data->set.use_port && data->state.allow_port) + /* a custom port is used */ + port = (int)data->set.use_port; + else { + uc = curl_url_get(data->state.uh, CURLUPART_PORT, &portnum, + CURLU_DEFAULT_PORT); + if(uc) { + free(newurl); + return Curl_uc_to_curlcode(uc); + } + port = atoi(portnum); + free(portnum); + } + if(port != data->info.conn_remote_port) { + infof(data, "Clear auth, redirects to port from %u to %u", + data->info.conn_remote_port, port); + clear = TRUE; + } + else { + char *scheme; + const struct Curl_handler *p; + uc = curl_url_get(data->state.uh, CURLUPART_SCHEME, &scheme, 0); + if(uc) { + free(newurl); + return Curl_uc_to_curlcode(uc); + } + + p = Curl_get_scheme_handler(scheme); + if(p && (p->protocol != data->info.conn_protocol)) { + infof(data, "Clear auth, redirects scheme from %s to %s", + data->info.conn_scheme, scheme); + clear = TRUE; + } + free(scheme); + } + if(clear) { + Curl_safefree(data->state.aptr.user); + Curl_safefree(data->state.aptr.passwd); + } + } + } + + if(type == FOLLOW_FAKE) { + /* we are only figuring out the new URL if we would have followed locations + but now we are done so we can get out! */ + data->info.wouldredirect = newurl; + + if(reachedmax) { + failf(data, "Maximum (%ld) redirects followed", data->set.maxredirs); + return CURLE_TOO_MANY_REDIRECTS; + } + return CURLE_OK; + } + + if(disallowport) + data->state.allow_port = FALSE; + + if(data->state.url_alloc) + Curl_safefree(data->state.url); + + data->state.url = newurl; + data->state.url_alloc = TRUE; + Curl_req_soft_reset(&data->req, data); + infof(data, "Issue another request to this URL: '%s'", data->state.url); + + /* + * We get here when the HTTP code is 300-399 (and 401). We need to perform + * differently based on exactly what return code there was. + * + * News from 7.10.6: we can also get here on a 401 or 407, in case we act on + * an HTTP (proxy-) authentication scheme other than Basic. + */ + switch(data->info.httpcode) { + /* 401 - Act on a WWW-Authenticate, we keep on moving and do the + Authorization: XXXX header in the HTTP request code snippet */ + /* 407 - Act on a Proxy-Authenticate, we keep on moving and do the + Proxy-Authorization: XXXX header in the HTTP request code snippet */ + /* 300 - Multiple Choices */ + /* 306 - Not used */ + /* 307 - Temporary Redirect */ + 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. + */ + break; + case 301: /* Moved Permanently */ + /* (quote from RFC7231, section 6.4.2) + * + * Note: For historical reasons, a user agent MAY change the request + * method from POST to GET for the subsequent request. If this + * behavior is undesired, the 307 (Temporary Redirect) status code + * can be used instead. + * + * ---- + * + * Many webservers expect this, so these servers often answers to a POST + * request with an error page. To be sure that libcurl gets the page that + * most user agents would get, libcurl has to force GET. + * + * 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)) { + infof(data, "Switch from POST to GET"); + data->state.httpreq = HTTPREQ_GET; + Curl_creader_set_rewind(data, FALSE); + } + break; + case 302: /* Found */ + /* (quote from RFC7231, section 6.4.3) + * + * Note: For historical reasons, a user agent MAY change the request + * method from POST to GET for the subsequent request. If this + * behavior is undesired, the 307 (Temporary Redirect) status code + * can be used instead. + * + * ---- + * + * Many webservers expect this, so these servers often answers to a POST + * request with an error page. To be sure that libcurl gets the page that + * most user agents would get, libcurl has to force GET. + * + * 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)) { + infof(data, "Switch from POST to GET"); + data->state.httpreq = HTTPREQ_GET; + Curl_creader_set_rewind(data, FALSE); + } + break; + + case 303: /* See Other */ + /* 'See Other' location is not the resource but a substitute for the + * resource. In this case we switch the method to GET/HEAD, unless the + * method is POST and the user specified to keep it as POST. + * https://github.com/curl/curl/issues/5237#issuecomment-614641049 + */ + if(data->state.httpreq != HTTPREQ_GET && + ((data->state.httpreq != HTTPREQ_POST && + data->state.httpreq != HTTPREQ_POST_FORM && + data->state.httpreq != HTTPREQ_POST_MIME) || + !(data->set.keep_post & CURL_REDIR_POST_303))) { + data->state.httpreq = HTTPREQ_GET; + infof(data, "Switch to %s", + data->req.no_body ? "HEAD" : "GET"); + } + break; + case 304: /* Not Modified */ + /* 304 means we did a conditional request and it was "Not modified". + * We should not get any Location: header in this response! + */ + break; + case 305: /* Use Proxy */ + /* (quote from RFC2616, section 10.3.6): + * "The requested resource MUST be accessed through the proxy given + * by the Location field. The Location field gives the URI of the + * proxy. The recipient is expected to repeat this single request + * via the proxy. 305 responses MUST only be generated by origin + * servers." + */ + break; + } + Curl_pgrsTime(data, TIMER_REDIRECT); + Curl_pgrsResetTransferSizes(data); + + return CURLE_OK; +#endif /* CURL_DISABLE_HTTP */ +} + +static CURLMcode state_performing(struct Curl_easy *data, + struct curltime *nowp, + bool *stream_errorp, + CURLcode *resultp) +{ + char *newurl = NULL; + bool retry = FALSE; + timediff_t recv_timeout_ms = 0; + timediff_t send_timeout_ms = 0; + CURLMcode rc = CURLM_OK; + CURLcode result = *resultp = CURLE_OK; + *stream_errorp = FALSE; + + /* check if over send speed */ + if(data->set.max_send_speed) + send_timeout_ms = Curl_pgrsLimitWaitTime(&data->progress.ul, + data->set.max_send_speed, + *nowp); + + /* check if over recv speed */ + if(data->set.max_recv_speed) + recv_timeout_ms = Curl_pgrsLimitWaitTime(&data->progress.dl, + data->set.max_recv_speed, + *nowp); + + if(send_timeout_ms || recv_timeout_ms) { + Curl_ratelimit(data, *nowp); + multistate(data, MSTATE_RATELIMITING); + if(send_timeout_ms >= recv_timeout_ms) + Curl_expire(data, send_timeout_ms, EXPIRE_TOOFAST); + else + Curl_expire(data, recv_timeout_ms, EXPIRE_TOOFAST); + return CURLM_OK; + } + + /* read/write data if it is ready to do so */ + result = Curl_sendrecv(data, nowp); + + if(data->req.done || (result == CURLE_RECV_ERROR)) { + /* If CURLE_RECV_ERROR happens early enough, we assume it was a race + * condition and the server closed the reused connection exactly when we + * wanted to use it, so figure out if that is indeed the case. + */ + CURLcode ret = Curl_retry_request(data, &newurl); + if(!ret) + retry = !!newurl; + else if(!result) + result = ret; + + if(retry) { + /* if we are to retry, set the result to OK and consider the + request as done */ + result = CURLE_OK; + data->req.done = TRUE; + } + } + else if((CURLE_HTTP2_STREAM == result) && + Curl_h2_http_1_1_error(data)) { + CURLcode ret = Curl_retry_request(data, &newurl); + + if(!ret) { + infof(data, "Downgrades to HTTP/1.1"); + streamclose(data->conn, "Disconnect HTTP/2 for HTTP/1"); + data->state.httpwant = CURL_HTTP_VERSION_1_1; + /* clear the error message bit too as we ignore the one we got */ + data->state.errorbuf = FALSE; + 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; + } + else + result = ret; + } + + if(result) { + /* + * The transfer phase returned error, we mark the connection to get closed + * to prevent being reused. This is because we cannot possibly know if the + * connection is in a good shape or not now. Unless it is a protocol which + * uses two "channels" like FTP, as then the error happened in the data + * connection. + */ + + if(!(data->conn->handler->flags & PROTOPT_DUAL) && + result != CURLE_HTTP2_STREAM) + streamclose(data->conn, "Transfer returned error"); + + multi_posttransfer(data); + multi_done(data, result, TRUE); + } + else if(data->req.done && !Curl_cwriter_is_paused(data)) { + + /* call this even if the readwrite function returned error */ + multi_posttransfer(data); + + /* When we follow redirects or is set to retry the connection, we must to + go back to the CONNECT state */ + if(data->req.newurl || retry) { + followtype follow = FOLLOW_NONE; + if(!retry) { + /* if the URL is a follow-location and not just a retried request then + figure out the URL here */ + free(newurl); + newurl = data->req.newurl; + data->req.newurl = NULL; + follow = FOLLOW_REDIR; + } + else + follow = FOLLOW_RETRY; + (void)multi_done(data, CURLE_OK, FALSE); + /* multi_done() might return CURLE_GOT_NOTHING */ + result = multi_follow(data, newurl, follow); + if(!result) { + multistate(data, MSTATE_SETUP); + rc = CURLM_CALL_MULTI_PERFORM; + } + } + else { + /* after the transfer is done, go DONE */ + + /* but first check to see if we got a location info even though we are + not following redirects */ + if(data->req.location) { + free(newurl); + newurl = data->req.location; + data->req.location = NULL; + result = multi_follow(data, newurl, FOLLOW_FAKE); + if(result) { + *stream_errorp = TRUE; + result = multi_done(data, result, TRUE); + } + } + + if(!result) { + multistate(data, MSTATE_DONE); + rc = CURLM_CALL_MULTI_PERFORM; + } + } + } + else if(data->state.select_bits && !Curl_xfer_is_blocked(data)) { + /* This avoids CURLM_CALL_MULTI_PERFORM so that a very fast transfer does + not get stuck on this transfer at the expense of other concurrent + transfers */ + Curl_expire(data, 0, EXPIRE_RUN_NOW); + } + free(newurl); + *resultp = result; + return rc; +} + +static CURLMcode state_do(struct Curl_easy *data, + bool *stream_errorp, + CURLcode *resultp) +{ + CURLMcode rc = CURLM_OK; + CURLcode result = CURLE_OK; + if(data->set.fprereq) { + int prereq_rc; + + /* call the prerequest callback function */ + Curl_set_in_callback(data, TRUE); + prereq_rc = data->set.fprereq(data->set.prereq_userp, + data->info.primary.remote_ip, + data->info.primary.local_ip, + data->info.primary.remote_port, + data->info.primary.local_port); + Curl_set_in_callback(data, FALSE); + if(prereq_rc != CURL_PREREQFUNC_OK) { + failf(data, "operation aborted by pre-request callback"); + /* failure in pre-request callback - do not do any other processing */ + result = CURLE_ABORTED_BY_CALLBACK; + multi_posttransfer(data); + multi_done(data, result, FALSE); + *stream_errorp = TRUE; + goto end; + } + } + + if(data->set.connect_only == 1) { + /* keep connection open for application to use the socket */ + connkeep(data->conn, "CONNECT_ONLY"); + multistate(data, MSTATE_DONE); + rc = CURLM_CALL_MULTI_PERFORM; + } + else { + bool dophase_done = FALSE; + /* Perform the protocol's DO action */ + result = multi_do(data, &dophase_done); + + /* When multi_do() returns failure, data->conn might be NULL! */ + + if(!result) { + if(!dophase_done) { +#ifndef CURL_DISABLE_FTP + /* some steps needed for wildcard matching */ + if(data->state.wildcardmatch) { + struct WildcardData *wc = data->wildcard; + if(wc->state == CURLWC_DONE || wc->state == CURLWC_SKIP) { + /* skip some states if it is important */ + multi_done(data, CURLE_OK, FALSE); + + /* if there is no connection left, skip the DONE state */ + multistate(data, data->conn ? + MSTATE_DONE : MSTATE_COMPLETED); + rc = CURLM_CALL_MULTI_PERFORM; + goto end; + } + } +#endif + /* DO was not completed in one function call, we must continue + DOING... */ + multistate(data, MSTATE_DOING); + rc = CURLM_CALL_MULTI_PERFORM; + } + + /* after DO, go DO_DONE... or DO_MORE */ + else if(data->conn->bits.do_more) { + /* we are supposed to do more, but we need to sit down, relax and wait + a little while first */ + multistate(data, MSTATE_DOING_MORE); + rc = CURLM_CALL_MULTI_PERFORM; + } + else { + /* we are done with the DO, now DID */ + multistate(data, MSTATE_DID); + rc = CURLM_CALL_MULTI_PERFORM; + } + } + else if((CURLE_SEND_ERROR == result) && + data->conn->bits.reuse) { + /* + * In this situation, a connection that we were trying to use may have + * unexpectedly died. If possible, send the connection back to the + * CONNECT phase so we can try again. + */ + char *newurl = NULL; + followtype follow = FOLLOW_NONE; + CURLcode drc; + + drc = Curl_retry_request(data, &newurl); + if(drc) { + /* a failure here pretty much implies an out of memory */ + result = drc; + *stream_errorp = TRUE; + } + + multi_posttransfer(data); + drc = multi_done(data, result, FALSE); + + /* When set to retry the connection, we must go back to the CONNECT + * state */ + if(newurl) { + if(!drc || (drc == CURLE_SEND_ERROR)) { + follow = FOLLOW_RETRY; + drc = multi_follow(data, newurl, follow); + if(!drc) { + multistate(data, MSTATE_SETUP); + rc = CURLM_CALL_MULTI_PERFORM; + result = CURLE_OK; + } + else { + /* Follow failed */ + result = drc; + } + } + else { + /* done did not return OK or SEND_ERROR */ + result = drc; + } + } + else { + /* Have error handler disconnect conn if we cannot retry */ + *stream_errorp = TRUE; + } + free(newurl); + } + else { + /* failure detected */ + multi_posttransfer(data); + if(data->conn) + multi_done(data, result, FALSE); + *stream_errorp = TRUE; + } + } +end: + *resultp = result; + return rc; +} + +static CURLMcode state_ratelimiting(struct Curl_easy *data, + struct curltime *nowp, + CURLcode *resultp) +{ + CURLcode result = CURLE_OK; + 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); + + if(result) { + if(!(data->conn->handler->flags & PROTOPT_DUAL) && + result != CURLE_HTTP2_STREAM) + streamclose(data->conn, "Transfer returned error"); + + multi_posttransfer(data); + multi_done(data, result, TRUE); + } + else { + timediff_t recv_timeout_ms = 0; + timediff_t send_timeout_ms = 0; + if(data->set.max_send_speed) + send_timeout_ms = + Curl_pgrsLimitWaitTime(&data->progress.ul, + data->set.max_send_speed, + *nowp); + + if(data->set.max_recv_speed) + recv_timeout_ms = + Curl_pgrsLimitWaitTime(&data->progress.dl, + data->set.max_recv_speed, + *nowp); + + if(!send_timeout_ms && !recv_timeout_ms) { + multistate(data, MSTATE_PERFORMING); + Curl_ratelimit(data, *nowp); + /* start performing again right away */ + rc = CURLM_CALL_MULTI_PERFORM; + } + else if(send_timeout_ms >= recv_timeout_ms) + Curl_expire(data, send_timeout_ms, EXPIRE_TOOFAST); + else + Curl_expire(data, recv_timeout_ms, EXPIRE_TOOFAST); + } + *resultp = result; + return rc; +} + +static CURLMcode state_resolving(struct Curl_multi *multi, + struct Curl_easy *data, + bool *stream_errorp, + CURLcode *resultp) +{ + struct Curl_dns_entry *dns = NULL; + struct connectdata *conn = data->conn; + const char *hostname; + CURLcode result = CURLE_OK; + CURLMcode rc = CURLM_OK; + + DEBUGASSERT(conn); +#ifndef CURL_DISABLE_PROXY + if(conn->bits.httpproxy) + hostname = conn->http_proxy.host.name; + else +#endif + if(conn->bits.conn_to_host) + hostname = conn->conn_to_host.name; + else + hostname = conn->host.name; + + /* check if we have the name resolved by now */ + dns = Curl_fetch_addr(data, hostname, conn->primary.remote_port); + + if(dns) { +#ifdef CURLRES_ASYNCH + data->state.async.dns = dns; + data->state.async.done = TRUE; +#endif + result = CURLE_OK; + infof(data, "Hostname '%s' was found in DNS cache", hostname); + } + + if(!dns) + result = Curl_resolv_check(data, &dns); + + /* Update sockets here, because the socket(s) may have been closed and the + application thus needs to be told, even if it is likely that the same + socket(s) will again be used further down. If the name has not yet been + resolved, it is likely that new sockets have been opened in an attempt to + contact another resolver. */ + rc = singlesocket(multi, data); + if(rc) + return rc; + + if(dns) { + bool connected; + /* Perform the next step in the connection phase, and then move on to the + WAITCONNECT state */ + result = Curl_once_resolved(data, &connected); + + if(result) + /* if Curl_once_resolved() returns failure, the connection struct is + already freed and gone */ + data->conn = NULL; /* no more connection */ + else { + /* call again please so that we get the next socket setup */ + rc = CURLM_CALL_MULTI_PERFORM; + if(connected) + multistate(data, MSTATE_PROTOCONNECT); + else { + multistate(data, MSTATE_CONNECTING); + } + } + } + + if(result) + /* failure detected */ + *stream_errorp = TRUE; + + *resultp = result; + return rc; +} + +static CURLMcode state_connect(struct Curl_multi *multi, + struct Curl_easy *data, + struct curltime *nowp, + CURLcode *resultp) +{ + /* Connect. We want to get a connection identifier filled in. This state can + be entered from SETUP and from PENDING. */ + bool connected; + bool async; + CURLMcode rc = CURLM_OK; + CURLcode result = Curl_connect(data, &async, &connected); + if(CURLE_NO_CONNECTION_AVAILABLE == result) { + /* There was no connection available. We will go to the pending state and + wait for an available connection. */ + multistate(data, MSTATE_PENDING); + /* unlink from process list */ + Curl_node_remove(&data->multi_queue); + /* add handle to pending list */ + Curl_llist_append(&multi->pending, data, &data->multi_queue); + *resultp = CURLE_OK; + return rc; + } + else + process_pending_handles(data->multi); + + if(!result) { + *nowp = Curl_pgrsTime(data, TIMER_POSTQUEUE); + if(async) + /* We are now waiting for an asynchronous name lookup */ + multistate(data, MSTATE_RESOLVING); + else { + /* after the connect has been sent off, go WAITCONNECT unless the + protocol connect is already done and we can go directly to WAITDO or + DO! */ + rc = CURLM_CALL_MULTI_PERFORM; + + if(connected) { + if(!data->conn->bits.reuse && + Curl_conn_is_multiplex(data->conn, FIRSTSOCKET)) { + /* new connection, can multiplex, wake pending handles */ + process_pending_handles(data->multi); + } + multistate(data, MSTATE_PROTOCONNECT); + } + else { + multistate(data, MSTATE_CONNECTING); + } + } + } + *resultp = result; + return rc; +} + static CURLMcode multi_runsingle(struct Curl_multi *multi, struct curltime *nowp, struct Curl_easy *data) { struct Curl_message *msg = NULL; bool connected; - bool async; bool protocol_connected = FALSE; bool dophase_done = FALSE; - bool done = FALSE; CURLMcode rc; CURLcode result = CURLE_OK; - timediff_t recv_timeout_ms; - timediff_t send_timeout_ms; int control; if(!GOOD_EASY_HANDLE(data)) @@ -1857,7 +2608,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, /* a multi-level callback returned error before, meaning every individual transfer now has failed */ result = CURLE_ABORTED_BY_CALLBACK; - Curl_posttransfer(data); + multi_posttransfer(data); multi_done(data, result, FALSE); multistate(data, MSTATE_COMPLETED); } @@ -1883,183 +2634,61 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, return CURLM_INTERNAL_ERROR; } - if(data->conn && - (data->mstate >= MSTATE_CONNECT) && - (data->mstate < MSTATE_COMPLETED)) { - /* Check for overall operation timeout here but defer handling the - * connection timeout to later, to allow for a connection to be set up - * in the window since we last checked timeout. This prevents us - * tearing down a completed connection in the case where we were slow - * to check the timeout (e.g. process descheduled during this loop). - * We set connect_timeout=FALSE to do this. */ - - /* we need to wait for the connect state as only then is the start time - stored, but we must not check already completed handles */ - if(multi_handle_timeout(data, nowp, &stream_error, &result, FALSE)) { - /* Skip the statemachine and go directly to error handling section. */ - goto statemachine_end; - } - } + /* Wait for the connect state as only then is the start time stored, but + we must not check already completed handles */ + if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED) && + multi_handle_timeout(data, nowp, &stream_error, &result)) + /* Skip the statemachine and go directly to error handling section. */ + goto statemachine_end; switch(data->mstate) { case MSTATE_INIT: - /* init this transfer. */ + /* Transitional state. init this transfer. A handle never comes back to + this state. */ result = Curl_pretransfer(data); - - if(!result) { - /* after init, go CONNECT */ - multistate(data, MSTATE_CONNECT); - *nowp = Curl_pgrsTime(data, TIMER_STARTOP); - rc = CURLM_CALL_MULTI_PERFORM; - } - break; - - case MSTATE_CONNECT: - /* Connect. We want to get a connection identifier filled in. */ - /* init this transfer. */ - result = Curl_preconnect(data); if(result) break; + /* after init, go SETUP */ + multistate(data, MSTATE_SETUP); + (void)Curl_pgrsTime(data, TIMER_STARTOP); + FALLTHROUGH(); + + case MSTATE_SETUP: + /* Transitional state. Setup things for a new transfer. The handle + can come back to this state on a redirect. */ *nowp = Curl_pgrsTime(data, TIMER_STARTSINGLE); if(data->set.timeout) Curl_expire(data, data->set.timeout, EXPIRE_TIMEOUT); - if(data->set.connecttimeout) + /* Since a connection might go to pending and back to CONNECT several + times before it actually takes off, we need to set the timeout once + in SETUP before we enter CONNECT the first time. */ Curl_expire(data, data->set.connecttimeout, EXPIRE_CONNECTTIMEOUT); - result = Curl_connect(data, &async, &connected); - if(CURLE_NO_CONNECTION_AVAILABLE == result) { - /* There was no connection available. We will go to the pending - state and wait for an available connection. */ - multistate(data, MSTATE_PENDING); + multistate(data, MSTATE_CONNECT); + FALLTHROUGH(); - /* add this handle to the list of connect-pending handles */ - Curl_llist_insert_next(&multi->pending, multi->pending.tail, data, - &data->connect_queue); - /* unlink from the main list */ - unlink_easy(multi, data); - result = CURLE_OK; - break; - } - else if(data->state.previouslypending) { - /* this transfer comes from the pending queue so try move another */ - infof(data, "Transfer was pending, now try another"); - process_pending_handles(data->multi); - } - - if(!result) { - *nowp = Curl_pgrsTime(data, TIMER_POSTQUEUE); - if(async) - /* We're now waiting for an asynchronous name lookup */ - multistate(data, MSTATE_RESOLVING); - else { - /* after the connect has been sent off, go WAITCONNECT unless the - protocol connect is already done and we can go directly to - WAITDO or DO! */ - rc = CURLM_CALL_MULTI_PERFORM; - - if(connected) - multistate(data, MSTATE_PROTOCONNECT); - else { - multistate(data, MSTATE_CONNECTING); - } - } - } + case MSTATE_CONNECT: + rc = state_connect(multi, data, nowp, &result); break; case MSTATE_RESOLVING: /* awaiting an asynch name resolve to complete */ - { - struct Curl_dns_entry *dns = NULL; - struct connectdata *conn = data->conn; - const char *hostname; - - DEBUGASSERT(conn); -#ifndef CURL_DISABLE_PROXY - if(conn->bits.httpproxy) - hostname = conn->http_proxy.host.name; - else -#endif - if(conn->bits.conn_to_host) - hostname = conn->conn_to_host.name; - else - hostname = conn->host.name; - - /* check if we have the name resolved by now */ - dns = Curl_fetch_addr(data, hostname, (int)conn->port); - - if(dns) { -#ifdef CURLRES_ASYNCH - data->state.async.dns = dns; - data->state.async.done = TRUE; -#endif - result = CURLE_OK; - infof(data, "Hostname '%s' was found in DNS cache", hostname); - } - - if(!dns) - result = Curl_resolv_check(data, &dns); - - /* Update sockets here, because the socket(s) may have been - closed and the application thus needs to be told, even if it - is likely that the same socket(s) will again be used further - down. If the name has not yet been resolved, it is likely - that new sockets have been opened in an attempt to contact - another resolver. */ - rc = singlesocket(multi, data); - if(rc) - return rc; - - if(dns) { - /* Perform the next step in the connection phase, and then move on - to the WAITCONNECT state */ - result = Curl_once_resolved(data, &connected); - - if(result) - /* if Curl_once_resolved() returns failure, the connection struct - is already freed and gone */ - data->conn = NULL; /* no more connection */ - else { - /* call again please so that we get the next socket setup */ - rc = CURLM_CALL_MULTI_PERFORM; - if(connected) - multistate(data, MSTATE_PROTOCONNECT); - else { - multistate(data, MSTATE_CONNECTING); - } - } - } - - if(result) { - /* failure detected */ - stream_error = TRUE; - break; - } - } - break; + 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); -#ifndef CURL_DISABLE_PROXY - if(data->conn->bits.proxy_connect_closed) { + if(!result) { rc = CURLM_CALL_MULTI_PERFORM; - /* connect back to proxy again */ - result = CURLE_OK; - multi_done(data, CURLE_OK, FALSE); - multistate(data, MSTATE_CONNECT); + /* initiate protocol connect phase */ + multistate(data, MSTATE_PROTOCONNECT); } else -#endif - if(!result) { - rc = CURLM_CALL_MULTI_PERFORM; - /* initiate protocol connect phase */ - multistate(data, MSTATE_PROTOCONNECT); - } - else stream_error = TRUE; break; #endif @@ -2069,12 +2698,17 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, DEBUGASSERT(data->conn); result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &connected); if(connected && !result) { + if(!data->conn->bits.reuse && + Curl_conn_is_multiplex(data->conn, FIRSTSOCKET)) { + /* new connection, can multiplex, wake pending handles */ + process_pending_handles(data->multi); + } rc = CURLM_CALL_MULTI_PERFORM; multistate(data, MSTATE_PROTOCONNECT); } else if(result) { /* failure detected */ - Curl_posttransfer(data); + multi_posttransfer(data); multi_done(data, result, TRUE); stream_error = TRUE; break; @@ -2083,9 +2717,10 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, case MSTATE_PROTOCONNECT: if(!result && data->conn->bits.reuse) { - /* ftp seems to hang when protoconnect on reused connection - * since we handle PROTOCONNECT in general inside the filers, it - * seems wrong to restart this on a reused connection. */ + /* ftp seems to hang when protoconnect on reused connection since we + * handle PROTOCONNECT in general inside the filers, it seems wrong to + * restart this on a reused connection. + */ multistate(data, MSTATE_DO); rc = CURLM_CALL_MULTI_PERFORM; break; @@ -2104,7 +2739,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, } else { /* failure detected */ - Curl_posttransfer(data); + multi_posttransfer(data); multi_done(data, result, TRUE); stream_error = TRUE; } @@ -2120,141 +2755,14 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, } else if(result) { /* failure detected */ - Curl_posttransfer(data); + multi_posttransfer(data); multi_done(data, result, TRUE); stream_error = TRUE; } break; case MSTATE_DO: - if(data->set.fprereq) { - int prereq_rc; - - /* call the prerequest callback function */ - Curl_set_in_callback(data, true); - prereq_rc = data->set.fprereq(data->set.prereq_userp, - data->info.conn_primary_ip, - data->info.conn_local_ip, - data->info.conn_primary_port, - data->info.conn_local_port); - Curl_set_in_callback(data, false); - if(prereq_rc != CURL_PREREQFUNC_OK) { - failf(data, "operation aborted by pre-request callback"); - /* failure in pre-request callback - don't do any other processing */ - result = CURLE_ABORTED_BY_CALLBACK; - Curl_posttransfer(data); - multi_done(data, result, FALSE); - stream_error = TRUE; - break; - } - } - - if(data->set.connect_only == 1) { - /* keep connection open for application to use the socket */ - connkeep(data->conn, "CONNECT_ONLY"); - multistate(data, MSTATE_DONE); - result = CURLE_OK; - rc = CURLM_CALL_MULTI_PERFORM; - } - else { - /* Perform the protocol's DO action */ - result = multi_do(data, &dophase_done); - - /* When multi_do() returns failure, data->conn might be NULL! */ - - if(!result) { - if(!dophase_done) { -#ifndef CURL_DISABLE_FTP - /* some steps needed for wildcard matching */ - if(data->state.wildcardmatch) { - struct WildcardData *wc = data->wildcard; - if(wc->state == CURLWC_DONE || wc->state == CURLWC_SKIP) { - /* skip some states if it is important */ - multi_done(data, CURLE_OK, FALSE); - - /* if there's no connection left, skip the DONE state */ - multistate(data, data->conn ? - MSTATE_DONE : MSTATE_COMPLETED); - rc = CURLM_CALL_MULTI_PERFORM; - break; - } - } -#endif - /* DO was not completed in one function call, we must continue - DOING... */ - multistate(data, MSTATE_DOING); - rc = CURLM_CALL_MULTI_PERFORM; - } - - /* after DO, go DO_DONE... or DO_MORE */ - else if(data->conn->bits.do_more) { - /* we're supposed to do more, but we need to sit down, relax - and wait a little while first */ - multistate(data, MSTATE_DOING_MORE); - rc = CURLM_CALL_MULTI_PERFORM; - } - else { - /* we're done with the DO, now DID */ - multistate(data, MSTATE_DID); - rc = CURLM_CALL_MULTI_PERFORM; - } - } - else if((CURLE_SEND_ERROR == result) && - data->conn->bits.reuse) { - /* - * In this situation, a connection that we were trying to use - * may have unexpectedly died. If possible, send the connection - * back to the CONNECT phase so we can try again. - */ - char *newurl = NULL; - followtype follow = FOLLOW_NONE; - CURLcode drc; - - drc = Curl_retry_request(data, &newurl); - if(drc) { - /* a failure here pretty much implies an out of memory */ - result = drc; - stream_error = TRUE; - } - - Curl_posttransfer(data); - drc = multi_done(data, result, FALSE); - - /* When set to retry the connection, we must go back to the CONNECT - * state */ - if(newurl) { - if(!drc || (drc == CURLE_SEND_ERROR)) { - follow = FOLLOW_RETRY; - drc = Curl_follow(data, newurl, follow); - if(!drc) { - multistate(data, MSTATE_CONNECT); - rc = CURLM_CALL_MULTI_PERFORM; - result = CURLE_OK; - } - else { - /* Follow failed */ - result = drc; - } - } - else { - /* done didn't return OK or SEND_ERROR */ - result = drc; - } - } - else { - /* Have error handler disconnect conn if we can't retry */ - stream_error = TRUE; - } - free(newurl); - } - else { - /* failure detected */ - Curl_posttransfer(data); - if(data->conn) - multi_done(data, result, FALSE); - stream_error = TRUE; - } - } + rc = state_do(data, &stream_error, &result); break; case MSTATE_DOING: @@ -2264,14 +2772,14 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, if(!result) { if(dophase_done) { /* after DO, go DO_DONE or DO_MORE */ - multistate(data, data->conn->bits.do_more? + multistate(data, data->conn->bits.do_more ? MSTATE_DOING_MORE : MSTATE_DID); rc = CURLM_CALL_MULTI_PERFORM; } /* dophase_done */ } else { /* failure detected */ - Curl_posttransfer(data); + multi_posttransfer(data); multi_done(data, result, FALSE); stream_error = TRUE; } @@ -2288,7 +2796,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? + multistate(data, control == 1 ? MSTATE_DID : MSTATE_DOING); rc = CURLM_CALL_MULTI_PERFORM; } @@ -2297,7 +2805,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, } else { /* failure detected */ - Curl_posttransfer(data); + multi_posttransfer(data); multi_done(data, result, FALSE); stream_error = TRUE; } @@ -2309,7 +2817,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, /* Check if we can move pending requests to send pipe */ process_pending_handles(multi); /* multiplexed */ - /* Only perform the transfer if there's a good socket to work with. + /* Only perform the transfer if there is a good socket to work with. Having both BAD is a signal to skip immediately to DONE */ if((data->conn->sockfd != CURL_SOCKET_BAD) || (data->conn->writesockfd != CURL_SOCKET_BAD)) @@ -2327,202 +2835,12 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, break; case MSTATE_RATELIMITING: /* limit-rate exceeded in either direction */ - 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); - - if(result) { - if(!(data->conn->handler->flags & PROTOPT_DUAL) && - result != CURLE_HTTP2_STREAM) - streamclose(data->conn, "Transfer returned error"); - - Curl_posttransfer(data); - multi_done(data, result, TRUE); - } - else { - send_timeout_ms = 0; - if(data->set.max_send_speed) - send_timeout_ms = - Curl_pgrsLimitWaitTime(data->progress.uploaded, - data->progress.ul_limit_size, - data->set.max_send_speed, - data->progress.ul_limit_start, - *nowp); - - recv_timeout_ms = 0; - if(data->set.max_recv_speed) - recv_timeout_ms = - Curl_pgrsLimitWaitTime(data->progress.downloaded, - data->progress.dl_limit_size, - data->set.max_recv_speed, - data->progress.dl_limit_start, - *nowp); - - if(!send_timeout_ms && !recv_timeout_ms) { - multistate(data, MSTATE_PERFORMING); - Curl_ratelimit(data, *nowp); - } - else if(send_timeout_ms >= recv_timeout_ms) - Curl_expire(data, send_timeout_ms, EXPIRE_TOOFAST); - else - Curl_expire(data, recv_timeout_ms, EXPIRE_TOOFAST); - } + rc = state_ratelimiting(data, nowp, &result); break; case MSTATE_PERFORMING: - { - char *newurl = NULL; - bool retry = FALSE; - /* check if over send speed */ - send_timeout_ms = 0; - if(data->set.max_send_speed) - send_timeout_ms = Curl_pgrsLimitWaitTime(data->progress.uploaded, - data->progress.ul_limit_size, - data->set.max_send_speed, - data->progress.ul_limit_start, - *nowp); - - /* check if over recv speed */ - recv_timeout_ms = 0; - if(data->set.max_recv_speed) - recv_timeout_ms = Curl_pgrsLimitWaitTime(data->progress.downloaded, - data->progress.dl_limit_size, - data->set.max_recv_speed, - data->progress.dl_limit_start, - *nowp); - - if(send_timeout_ms || recv_timeout_ms) { - Curl_ratelimit(data, *nowp); - multistate(data, MSTATE_RATELIMITING); - if(send_timeout_ms >= recv_timeout_ms) - Curl_expire(data, send_timeout_ms, EXPIRE_TOOFAST); - else - Curl_expire(data, recv_timeout_ms, EXPIRE_TOOFAST); - break; - } - - /* read/write data if it is ready to do so */ - result = Curl_readwrite(data, &done); - - if(done || (result == CURLE_RECV_ERROR)) { - /* If CURLE_RECV_ERROR happens early enough, we assume it was a race - * condition and the server closed the reused connection exactly when - * we wanted to use it, so figure out if that is indeed the case. - */ - CURLcode ret = Curl_retry_request(data, &newurl); - if(!ret) - retry = (newurl)?TRUE:FALSE; - else if(!result) - result = ret; - - if(retry) { - /* if we are to retry, set the result to OK and consider the - request as done */ - result = CURLE_OK; - done = TRUE; - } - } - else if((CURLE_HTTP2_STREAM == result) && - Curl_h2_http_1_1_error(data)) { - CURLcode ret = Curl_retry_request(data, &newurl); - - if(!ret) { - infof(data, "Downgrades to HTTP/1.1"); - streamclose(data->conn, "Disconnect HTTP/2 for HTTP/1"); - data->state.httpwant = CURL_HTTP_VERSION_1_1; - /* clear the error message bit too as we ignore the one we got */ - data->state.errorbuf = FALSE; - 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; - done = TRUE; - } - else - result = ret; - } - - if(result) { - /* - * The transfer phase returned error, we mark the connection to get - * closed to prevent being reused. This is because we can't possibly - * know if the connection is in a good shape or not now. Unless it is - * a protocol which uses two "channels" like FTP, as then the error - * happened in the data connection. - */ - - if(!(data->conn->handler->flags & PROTOPT_DUAL) && - result != CURLE_HTTP2_STREAM) - streamclose(data->conn, "Transfer returned error"); - - Curl_posttransfer(data); - multi_done(data, result, TRUE); - } - else if(done) { - - /* call this even if the readwrite function returned error */ - Curl_posttransfer(data); - - /* When we follow redirects or is set to retry the connection, we must - to go back to the CONNECT state */ - if(data->req.newurl || retry) { - followtype follow = FOLLOW_NONE; - if(!retry) { - /* if the URL is a follow-location and not just a retried request - then figure out the URL here */ - free(newurl); - newurl = data->req.newurl; - data->req.newurl = NULL; - follow = FOLLOW_REDIR; - } - else - follow = FOLLOW_RETRY; - (void)multi_done(data, CURLE_OK, FALSE); - /* multi_done() might return CURLE_GOT_NOTHING */ - result = Curl_follow(data, newurl, follow); - if(!result) { - multistate(data, MSTATE_CONNECT); - rc = CURLM_CALL_MULTI_PERFORM; - } - free(newurl); - } - else { - /* after the transfer is done, go DONE */ - - /* but first check to see if we got a location info even though we're - not following redirects */ - if(data->req.location) { - free(newurl); - newurl = data->req.location; - data->req.location = NULL; - result = Curl_follow(data, newurl, FOLLOW_FAKE); - free(newurl); - if(result) { - stream_error = TRUE; - result = multi_done(data, result, TRUE); - } - } - - if(!result) { - multistate(data, MSTATE_DONE); - rc = CURLM_CALL_MULTI_PERFORM; - } - } - } - else if(data->state.select_bits) { - /* This avoids CURLM_CALL_MULTI_PERFORM so that a very fast transfer - won't get stuck on this transfer at the expense of other concurrent - transfers */ - Curl_expire(data, 0, EXPIRE_RUN_NOW); - } + rc = state_performing(data, nowp, &stream_error, &result); break; - } case MSTATE_DONE: /* this state is highly transient, so run another loop after this */ @@ -2531,10 +2849,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, if(data->conn) { CURLcode res; - if(data->conn->bits.multiplex) - /* Check if we can move pending requests to connection */ - process_pending_handles(multi); /* multiplexing */ - /* post-transfer command */ res = multi_done(data, result, FALSE); @@ -2553,8 +2867,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, } } #endif - /* after we have DONE what we're supposed to do, go COMPLETED, and - it doesn't matter what the multi_done() returned! */ + /* after we have DONE what we are supposed to do, go COMPLETED, and + it does not matter what the multi_done() returned! */ multistate(data, MSTATE_COMPLETED); break; @@ -2571,18 +2885,17 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, return CURLM_INTERNAL_ERROR; } - if(data->conn && - data->mstate >= MSTATE_CONNECT && + if(data->mstate >= MSTATE_CONNECT && data->mstate < MSTATE_DO && rc != CURLM_CALL_MULTI_PERFORM && - !multi_ischanged(multi, false)) { + !multi_ischanged(multi, FALSE)) { /* We now handle stream timeouts if and only if this will be the last * loop iteration. We only check this on the last iteration to ensure * that if we know we have additional work to do immediately * (i.e. CURLM_CALL_MULTI_PERFORM == TRUE) then we should do that before * declaring the connection timed out as we may almost have a completed * connection. */ - multi_handle_timeout(data, nowp, &stream_error, &result, TRUE); + multi_handle_timeout(data, nowp, &stream_error, &result); } statemachine_end: @@ -2590,7 +2903,7 @@ statemachine_end: if(data->mstate < MSTATE_COMPLETED) { if(result) { /* - * If an error was returned, and we aren't in completed state now, + * If an error was returned, and we are not in completed state now, * then we go to completed and consider this transfer aborted. */ @@ -2602,31 +2915,27 @@ statemachine_end: if(data->conn) { if(stream_error) { - /* Don't attempt to send data over a connection that timed out */ + /* Do not attempt to send data over a connection that timed out */ bool dead_connection = result == CURLE_OPERATION_TIMEDOUT; struct connectdata *conn = data->conn; /* This is where we make sure that the conn pointer is reset. - We don't have to do this in every case block above where a + We do not have to do this in every case block above where a failure is detected */ Curl_detach_connection(data); - - /* remove connection from cache */ - Curl_conncache_remove_conn(data, conn, TRUE); - - /* disconnect properly */ - Curl_disconnect(data, conn, dead_connection); + Curl_cpool_disconnect(data, conn, dead_connection); } } else if(data->mstate == MSTATE_CONNECT) { /* Curl_connect() failed */ - (void)Curl_posttransfer(data); + multi_posttransfer(data); + Curl_pgrsUpdate_nometer(data); } multistate(data, MSTATE_COMPLETED); rc = CURLM_CALL_MULTI_PERFORM; } - /* if there's still a connection to use, call the progress function */ + /* 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 */ @@ -2634,8 +2943,8 @@ statemachine_end: 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); + multistate(data, (data->mstate < MSTATE_DONE) ? + MSTATE_DONE : MSTATE_COMPLETED); rc = CURLM_CALL_MULTI_PERFORM; } } @@ -2658,11 +2967,10 @@ statemachine_end: } multistate(data, MSTATE_MSGSENT); - /* add this handle to the list of msgsent handles */ - Curl_llist_insert_next(&multi->msgsent, multi->msgsent.tail, data, - &data->connect_queue); - /* unlink from the main list */ - unlink_easy(multi, data); + /* unlink from the process list */ + Curl_node_remove(&data->multi_queue); + /* add this handle msgsent list */ + Curl_llist_append(&multi->msgsent, data, &data->multi_queue); return CURLM_OK; } } while((rc == CURLM_CALL_MULTI_PERFORM) || multi_ischanged(multi, FALSE)); @@ -2672,12 +2980,15 @@ statemachine_end: } -CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) +CURLMcode curl_multi_perform(CURLM *m, int *running_handles) { - struct Curl_easy *data; CURLMcode returncode = CURLM_OK; - struct Curl_tree *t; + struct Curl_tree *t = NULL; struct curltime now = Curl_now(); + struct Curl_llist_node *e; + struct Curl_llist_node *n = NULL; + struct Curl_multi *multi = m; + SIGPIPE_VARIABLE(pipe_st); if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -2685,31 +2996,31 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - data = multi->easyp; - if(data) { + sigpipe_init(&pipe_st); + for(e = Curl_llist_head(&multi->process); e; e = n) { + struct Curl_easy *data = Curl_node_elem(e); CURLMcode result; - bool nosig = data->set.no_signal; - SIGPIPE_VARIABLE(pipe_st); - sigpipe_ignore(data, &pipe_st); /* Do the loop and only alter the signal ignore state if the next handle has a different NO_SIGNAL state than the previous */ - do { - /* the current node might be unlinked in multi_runsingle(), get the next - pointer now */ - struct Curl_easy *datanext = data->next; - if(data->set.no_signal != nosig) { - sigpipe_restore(&pipe_st); - sigpipe_ignore(data, &pipe_st); - nosig = data->set.no_signal; - } + + /* the current node might be unlinked in multi_runsingle(), get the next + pointer now */ + n = Curl_node_next(e); + + if(data != multi->cpool.idata) { + /* connection pool handle is processed below */ + sigpipe_apply(data, &pipe_st); result = multi_runsingle(multi, &now, data); if(result) returncode = result; - data = datanext; /* operate on next handle */ - } while(data); - sigpipe_restore(&pipe_st); + } } + sigpipe_apply(multi->cpool.idata, &pipe_st); + Curl_cpool_multi_perform(multi); + + sigpipe_restore(&pipe_st); + /* * Simply remove all expired timers from the splay since handles are dealt * with unconditionally by this function and curl_multi_timeout() requires @@ -2722,13 +3033,23 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) */ do { multi->timetree = Curl_splaygetbest(now, multi->timetree, &t); - if(t) + if(t) { /* the removed may have another timeout in queue */ - (void)add_next_timeout(now, multi, t->payload); - + struct Curl_easy *data = Curl_splayget(t); + if(data->mstate == MSTATE_PENDING) { + bool stream_unused; + CURLcode result_unused; + if(multi_handle_timeout(data, &now, &stream_unused, &result_unused)) { + infof(data, "PENDING handle timeout"); + move_pending_to_connect(multi, data); + } + } + (void)add_next_timeout(now, multi, Curl_splayget(t)); + } } while(t); - *running_handles = multi->num_alive; + if(running_handles) + *running_handles = (int)multi->num_alive; if(CURLM_OK >= returncode) returncode = Curl_update_timer(multi); @@ -2736,35 +3057,44 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) return returncode; } -/* unlink_all_msgsent_handles() detaches all those easy handles from this - multi handle */ +/* unlink_all_msgsent_handles() moves all nodes back from the msgsent list to + the process list */ static void unlink_all_msgsent_handles(struct Curl_multi *multi) { - struct Curl_llist_element *e = multi->msgsent.head; - if(e) { - struct Curl_easy *data = e->ptr; - DEBUGASSERT(data->mstate == MSTATE_MSGSENT); - data->multi = NULL; + struct Curl_llist_node *e; + for(e = Curl_llist_head(&multi->msgsent); e; e = Curl_node_next(e)) { + struct Curl_easy *data = Curl_node_elem(e); + if(data) { + DEBUGASSERT(data->mstate == MSTATE_MSGSENT); + Curl_node_remove(&data->multi_queue); + /* put it into the process list */ + Curl_llist_append(&multi->process, data, &data->multi_queue); + } } } -CURLMcode curl_multi_cleanup(struct Curl_multi *multi) +CURLMcode curl_multi_cleanup(CURLM *m) { - struct Curl_easy *data; - struct Curl_easy *nextdata; - + struct Curl_multi *multi = m; if(GOOD_MULTI_HANDLE(multi)) { + struct Curl_llist_node *e; + struct Curl_llist_node *n; if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - multi->magic = 0; /* not good anymore */ - + /* move the pending and msgsent entries back to process + so that there is just one list to iterate over */ unlink_all_msgsent_handles(multi); process_pending_handles(multi); + /* First remove all remaining easy handles */ - data = multi->easyp; - while(data) { - nextdata = data->next; + for(e = Curl_llist_head(&multi->process); e; e = n) { + struct Curl_easy *data = Curl_node_elem(e); + + if(!GOOD_EASY_HANDLE(data)) + return CURLM_BAD_HANDLE; + + n = Curl_node_next(e); if(!data->state.done && data->conn) /* if DONE was never called for this handle */ (void)multi_done(data, CURLE_OK, TRUE); @@ -2775,23 +3105,20 @@ CURLMcode curl_multi_cleanup(struct Curl_multi *multi) data->dns.hostcachetype = HCACHE_NONE; } - /* Clear the pointer to the connection cache */ - data->state.conn_cache = NULL; data->multi = NULL; /* clear the association */ #ifdef USE_LIBPSL if(data->psl == &multi->psl) data->psl = NULL; #endif - - data = nextdata; } - /* Close all the connections in the connection cache */ - Curl_conncache_close_all_connections(&multi->conn_cache); + Curl_cpool_destroy(&multi->cpool); + + multi->magic = 0; /* not good anymore */ sockhash_destroy(&multi->sockhash); - Curl_conncache_destroy(&multi->conn_cache); + Curl_hash_destroy(&multi->proto_hash); Curl_hash_destroy(&multi->hostcache); Curl_psl_destroy(&multi->psl); @@ -2800,12 +3127,10 @@ CURLMcode curl_multi_cleanup(struct Curl_multi *multi) #else #ifdef ENABLE_WAKEUP wakeup_close(multi->wakeup_pair[0]); +#ifndef USE_EVENTFD wakeup_close(multi->wakeup_pair[1]); #endif #endif - -#ifdef USE_SSL - Curl_free_multi_ssl_backend_data(multi->ssl_backend_data); #endif multi_xfer_bufs_free(multi); @@ -2826,9 +3151,10 @@ CURLMcode curl_multi_cleanup(struct Curl_multi *multi) * beyond. The current design is fully O(1). */ -CURLMsg *curl_multi_info_read(struct Curl_multi *multi, int *msgs_in_queue) +CURLMsg *curl_multi_info_read(CURLM *m, int *msgs_in_queue) { struct Curl_message *msg; + struct Curl_multi *multi = m; *msgs_in_queue = 0; /* default to none */ @@ -2836,15 +3162,15 @@ CURLMsg *curl_multi_info_read(struct Curl_multi *multi, int *msgs_in_queue) !multi->in_callback && Curl_llist_count(&multi->msglist)) { /* there is one or more messages in the list */ - struct Curl_llist_element *e; + struct Curl_llist_node *e; /* extract the head of the list to return */ - e = multi->msglist.head; + e = Curl_llist_head(&multi->msglist); - msg = e->ptr; + msg = Curl_node_elem(e); /* remove the extracted entry */ - Curl_llist_remove(&multi->msglist, e, NULL); + Curl_node_remove(e); *msgs_in_queue = curlx_uztosi(Curl_llist_count(&multi->msglist)); @@ -2862,41 +3188,54 @@ static CURLMcode singlesocket(struct Curl_multi *multi, struct Curl_easy *data) { struct easy_pollset cur_poll; - unsigned int i; - struct Curl_sh_entry *entry; - curl_socket_t s; - int rc; + CURLMcode mresult; /* Fill in the 'current' struct with the state as it is now: what sockets to supervise and for what actions */ multi_getsock(data, &cur_poll); + mresult = Curl_multi_pollset_ev(multi, data, &cur_poll, &data->last_poll); + + if(!mresult) /* Remember for next time */ + memcpy(&data->last_poll, &cur_poll, sizeof(cur_poll)); + return mresult; +} + +CURLMcode Curl_multi_pollset_ev(struct Curl_multi *multi, + struct Curl_easy *data, + struct easy_pollset *ps, + struct easy_pollset *last_ps) +{ + unsigned int i; + struct Curl_sh_entry *entry; + curl_socket_t s; + int rc; /* We have 0 .. N sockets already and we get to know about the 0 .. M sockets we should have from now on. Detect the differences, remove no longer supervised ones and add new ones */ /* walk over the sockets we got right now */ - for(i = 0; i < cur_poll.num; i++) { - unsigned char cur_action = cur_poll.actions[i]; + for(i = 0; i < ps->num; i++) { + unsigned char cur_action = ps->actions[i]; unsigned char last_action = 0; int comboaction; - s = cur_poll.sockets[i]; + s = ps->sockets[i]; /* get it from the hash */ entry = sh_getentry(&multi->sockhash, s); if(entry) { /* check if new for this transfer */ unsigned int j; - for(j = 0; j< data->last_poll.num; j++) { - if(s == data->last_poll.sockets[j]) { - last_action = data->last_poll.actions[j]; + for(j = 0; j < last_ps->num; j++) { + if(s == last_ps->sockets[j]) { + last_action = last_ps->actions[j]; break; } } } else { - /* this is a socket we didn't have before, add it to the hash! */ + /* this is a socket we did not have before, add it to the hash! */ entry = sh_addentry(&multi->sockhash, s); if(!entry) /* fatal */ @@ -2904,23 +3243,30 @@ static CURLMcode singlesocket(struct Curl_multi *multi, } if(last_action && (last_action != cur_action)) { /* Socket was used already, but different action now */ - if(last_action & CURL_POLL_IN) + if(last_action & CURL_POLL_IN) { + DEBUGASSERT(entry->readers); entry->readers--; - if(last_action & CURL_POLL_OUT) + } + if(last_action & CURL_POLL_OUT) { + DEBUGASSERT(entry->writers); entry->writers--; - if(cur_action & CURL_POLL_IN) + } + if(cur_action & CURL_POLL_IN) { entry->readers++; + } if(cur_action & CURL_POLL_OUT) entry->writers++; } - else if(!last_action) { + else if(!last_action && + !Curl_hash_pick(&entry->transfers, (char *)&data, /* hash key */ + sizeof(struct Curl_easy *))) { + DEBUGASSERT(entry->users < 100000); /* detect weird values */ /* a new transfer using this socket */ entry->users++; if(cur_action & CURL_POLL_IN) entry->readers++; if(cur_action & CURL_POLL_OUT) entry->writers++; - /* add 'data' to the transfer hash on this socket! */ if(!Curl_hash_add(&entry->transfers, (char *)&data, /* hash key */ sizeof(struct Curl_easy *), data)) { @@ -2949,18 +3295,19 @@ static CURLMcode singlesocket(struct Curl_multi *multi, } } - entry->action = comboaction; /* store the current action state */ + /* store the current action state */ + entry->action = (unsigned int)comboaction; } - /* Check for last_poll.sockets that no longer appear in cur_poll.sockets. + /* Check for last_poll.sockets that no longer appear in ps->sockets. * Need to remove the easy handle from the multi->sockhash->transfers and * remove multi->sockhash entry when this was the last transfer */ - for(i = 0; i< data->last_poll.num; i++) { + for(i = 0; i < last_ps->num; i++) { unsigned int j; bool stillused = FALSE; - s = data->last_poll.sockets[i]; - for(j = 0; j < cur_poll.num; j++) { - if(s == cur_poll.sockets[j]) { + s = last_ps->sockets[i]; + for(j = 0; j < ps->num; j++) { + if(s == ps->sockets[j]) { /* this is still supervised */ stillused = TRUE; break; @@ -2973,25 +3320,29 @@ static CURLMcode singlesocket(struct Curl_multi *multi, /* if this is NULL here, the socket has been closed and notified so already by Curl_multi_closed() */ if(entry) { - unsigned char oldactions = data->last_poll.actions[i]; + unsigned char oldactions = last_ps->actions[i]; /* this socket has been removed. Decrease user count */ + DEBUGASSERT(entry->users); entry->users--; if(oldactions & CURL_POLL_OUT) entry->writers--; if(oldactions & CURL_POLL_IN) entry->readers--; if(!entry->users) { + bool dead = FALSE; if(multi->socket_cb) { set_in_callback(multi, TRUE); rc = multi->socket_cb(data, s, CURL_POLL_REMOVE, multi->socket_userp, entry->socketp); set_in_callback(multi, FALSE); - if(rc == -1) { - multi->dead = TRUE; - return CURLM_ABORTED_BY_CALLBACK; - } + if(rc == -1) + dead = TRUE; } sh_delentry(entry, &multi->sockhash, s); + if(dead) { + multi->dead = TRUE; + return CURLM_ABORTED_BY_CALLBACK; + } } else { /* still users, but remove this handle as a user of this socket */ @@ -3003,8 +3354,6 @@ static CURLMcode singlesocket(struct Curl_multi *multi, } } /* for loop over num */ - /* Remember for next time */ - memcpy(&data->last_poll, &cur_poll, sizeof(data->last_poll)); return CURLM_OK; } @@ -3020,7 +3369,7 @@ CURLcode Curl_updatesocket(struct Curl_easy *data) * Curl_multi_closed() * * Used by the connect code to tell the multi_socket code that one of the - * sockets we were using is about to be closed. This function will then + * sockets we were using is about to be closed. This function will then * remove it from the sockethash for this handle to make the multi_socket API * behave properly, especially for the case when libcurl will create another * socket again and it gets the same file descriptor number. @@ -3029,13 +3378,17 @@ CURLcode Curl_updatesocket(struct Curl_easy *data) void Curl_multi_closed(struct Curl_easy *data, curl_socket_t s) { if(data) { - /* if there's still an easy handle associated with this connection */ + /* if there is still an easy handle associated with this connection */ struct Curl_multi *multi = data->multi; + DEBUGF(infof(data, "Curl_multi_closed, fd=%" FMT_SOCKET_T + " multi is %p", s, (void *)multi)); if(multi) { /* this is set if this connection is part of a handle that is added to a multi handle, and only then this is necessary */ struct Curl_sh_entry *entry = sh_getentry(&multi->sockhash, s); + DEBUGF(infof(data, "Curl_multi_closed, fd=%" FMT_SOCKET_T + " entry is %p", s, (void *)entry)); if(entry) { int rc = 0; if(multi->socket_cb) { @@ -3075,26 +3428,24 @@ static CURLMcode add_next_timeout(struct curltime now, { struct curltime *tv = &d->state.expiretime; struct Curl_llist *list = &d->state.timeoutlist; - struct Curl_llist_element *e; - struct time_node *node = NULL; + struct Curl_llist_node *e; /* move over the timeout list for this specific handle and remove all timeouts that are now passed tense and store the next pending timeout in *tv */ - for(e = list->head; e;) { - struct Curl_llist_element *n = e->next; - timediff_t diff; - node = (struct time_node *)e->ptr; - diff = Curl_timediff_us(node->time, now); + for(e = Curl_llist_head(list); e;) { + struct Curl_llist_node *n = Curl_node_next(e); + struct time_node *node = Curl_node_elem(e); + timediff_t diff = Curl_timediff_us(node->time, now); if(diff <= 0) /* remove outdated entry */ - Curl_llist_remove(list, e, NULL); + Curl_node_remove(e); else /* the list is sorted so get out on the first mismatch */ break; e = n; } - e = list->head; + e = Curl_llist_head(list); if(!e) { /* clear the expire times within the handles that we remove from the splay tree */ @@ -3102,10 +3453,11 @@ static CURLMcode add_next_timeout(struct curltime now, tv->tv_usec = 0; } else { + struct time_node *node = Curl_node_elem(e); /* copy the first entry to 'tv' */ memcpy(tv, &node->time, sizeof(*tv)); - /* Insert this node again into the splay. Keep the timer in the list in + /* Insert this node again into the splay. Keep the timer in the list in case we need to recompute future timers. */ multi->timetree = Curl_splayinsert(*tv, multi->timetree, &d->state.timenode); @@ -3113,6 +3465,59 @@ static CURLMcode add_next_timeout(struct curltime now, return CURLM_OK; } +struct multi_run_ctx { + struct Curl_multi *multi; + struct curltime now; + size_t run_xfers; + SIGPIPE_MEMBER(pipe_st); + bool run_cpool; +}; + +static CURLMcode multi_run_expired(struct multi_run_ctx *mrc) +{ + struct Curl_multi *multi = mrc->multi; + struct Curl_easy *data = NULL; + struct Curl_tree *t = NULL; + CURLMcode result = CURLM_OK; + + /* + * The loop following here will go on as long as there are expire-times left + * to process (compared to mrc->now) in the splay and 'data' will be + * re-assigned for every expired handle we deal with. + */ + while(1) { + /* Check if there is one (more) expired timer to deal with! This function + extracts a matching node if there is one */ + multi->timetree = Curl_splaygetbest(mrc->now, multi->timetree, &t); + if(!t) + goto out; + + data = Curl_splayget(t); /* assign this for next loop */ + if(!data) + continue; + + (void)add_next_timeout(mrc->now, multi, data); + if(data == multi->cpool.idata) { + mrc->run_cpool = TRUE; + continue; + } + + mrc->run_xfers++; + sigpipe_apply(data, &mrc->pipe_st); + result = multi_runsingle(multi, &mrc->now, data); + + if(CURLM_OK >= result) { + /* get the socket(s) and check if the state has been changed since + last */ + result = singlesocket(multi, data); + if(result) + goto out; + } + } + +out: + return result; +} static CURLMcode multi_socket(struct Curl_multi *multi, bool checkall, curl_socket_t s, @@ -3121,39 +3526,44 @@ static CURLMcode multi_socket(struct Curl_multi *multi, { CURLMcode result = CURLM_OK; struct Curl_easy *data = NULL; - struct Curl_tree *t; - struct curltime now = Curl_now(); - bool first = FALSE; - bool nosig = FALSE; - SIGPIPE_VARIABLE(pipe_st); + struct multi_run_ctx mrc; + + (void)ev_bitmask; + memset(&mrc, 0, sizeof(mrc)); + mrc.multi = multi; + mrc.now = Curl_now(); + sigpipe_init(&mrc.pipe_st); if(checkall) { + struct Curl_llist_node *e; /* *perform() deals with running_handles on its own */ result = curl_multi_perform(multi, running_handles); /* walk through each easy handle and do the socket state change magic and callbacks */ if(result != CURLM_BAD_HANDLE) { - data = multi->easyp; - while(data && !result) { - result = singlesocket(multi, data); - data = data->next; + for(e = Curl_llist_head(&multi->process); e && !result; + e = Curl_node_next(e)) { + result = singlesocket(multi, Curl_node_elem(e)); } } - - /* or should we fall-through and do the timer-based stuff? */ - return result; + mrc.run_cpool = TRUE; + goto out; } + if(s != CURL_SOCKET_TIMEOUT) { struct Curl_sh_entry *entry = sh_getentry(&multi->sockhash, s); - if(!entry) - /* Unmatched socket, we can't act on it but we ignore this fact. In + if(!entry) { + /* Unmatched socket, we cannot act on it but we ignore this fact. In real-world tests it has been proved that libevent can in fact give the application actions even though the socket was just previously asked to get removed, so thus we better survive stray socket actions and just move on. */ - ; + /* The socket might come from a connection that is being shut down + * by the multi's connection pool. */ + Curl_cpool_multi_socket(multi, s, ev_bitmask); + } else { struct Curl_hash_iterator iter; struct Curl_hash_element *he; @@ -3166,85 +3576,54 @@ static CURLMcode multi_socket(struct Curl_multi *multi, DEBUGASSERT(data); DEBUGASSERT(data->magic == CURLEASY_MAGIC_NUMBER); - if(data->conn && !(data->conn->handler->flags & PROTOPT_DIRLOCK)) - /* set socket event bitmask if they're not locked */ - data->state.select_bits |= (unsigned char)ev_bitmask; - - Curl_expire(data, 0, EXPIRE_RUN_NOW); + if(data == multi->cpool.idata) + mrc.run_cpool = TRUE; + else { + /* Expire with out current now, so we will get it below when + * asking the splaytree for expired transfers. */ + expire_ex(data, &mrc.now, 0, EXPIRE_RUN_NOW); + } } - - /* Now we fall-through and do the timer-based stuff, since we don't want - to force the user to have to deal with timeouts as long as at least - one connection in fact has traffic. */ - - data = NULL; /* set data to NULL again to avoid calling - multi_runsingle() in case there's no need to */ - now = Curl_now(); /* get a newer time since the multi_runsingle() loop - may have taken some time */ } } - else { - /* Asked to run due to time-out. Clear the 'lastcall' variable to force - Curl_update_timer() to trigger a callback to the app again even if the - same timeout is still the one to run after this call. That handles the - case when the application asks libcurl to run the timeout - prematurely. */ - memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall)); + + result = multi_run_expired(&mrc); + if(result) + goto out; + + if(mrc.run_xfers) { + /* Running transfers takes time. With a new timestamp, we might catch + * other expires which are due now. Instead of telling the application + * to set a 0 timeout and call us again, we run them here. + * Do that only once or it might be unfair to transfers on other + * sockets. */ + mrc.now = Curl_now(); + result = multi_run_expired(&mrc); } - /* - * The loop following here will go on as long as there are expire-times left - * to process in the splay and 'data' will be re-assigned for every expired - * handle we deal with. - */ - do { - /* the first loop lap 'data' can be NULL */ - if(data) { - if(!first) { - first = TRUE; - nosig = data->set.no_signal; /* initial state */ - sigpipe_ignore(data, &pipe_st); - } - else if(data->set.no_signal != nosig) { - sigpipe_restore(&pipe_st); - sigpipe_ignore(data, &pipe_st); - nosig = data->set.no_signal; /* remember new state */ - } - result = multi_runsingle(multi, &now, data); +out: + if(mrc.run_cpool) { + sigpipe_apply(multi->cpool.idata, &mrc.pipe_st); + Curl_cpool_multi_perform(multi); + } + sigpipe_restore(&mrc.pipe_st); - if(CURLM_OK >= result) { - /* get the socket(s) and check if the state has been changed since - last */ - result = singlesocket(multi, data); - if(result) - break; - } - } + if(running_handles) + *running_handles = (int)multi->num_alive; - /* Check if there's one (more) expired timer to deal with! This function - extracts a matching node if there is one */ - - multi->timetree = Curl_splaygetbest(now, multi->timetree, &t); - if(t) { - data = t->payload; /* assign this for next loop */ - (void)add_next_timeout(now, multi, t->payload); - } - - } while(t); - if(first) - sigpipe_restore(&pipe_st); - - *running_handles = multi->num_alive; + if(CURLM_OK >= result) + result = Curl_update_timer(multi); return result; } #undef curl_multi_setopt -CURLMcode curl_multi_setopt(struct Curl_multi *multi, +CURLMcode curl_multi_setopt(CURLM *m, CURLMoption option, ...) { CURLMcode res = CURLM_OK; va_list param; unsigned long uarg; + struct Curl_multi *multi = m; if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -3286,6 +3665,9 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi, break; case CURLMOPT_MAX_TOTAL_CONNECTIONS: multi->max_total_connections = va_arg(param, long); + /* for now, let this also decide the max number of connections + * in shutdown handling */ + multi->max_shutdown_connections = va_arg(param, long); break; /* options formerly used for pipelining */ case CURLMOPT_MAX_PIPELINE_LENGTH: @@ -3317,42 +3699,33 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi, /* we define curl_multi_socket() in the public multi.h header */ #undef curl_multi_socket -CURLMcode curl_multi_socket(struct Curl_multi *multi, curl_socket_t s, - int *running_handles) +CURLMcode curl_multi_socket(CURLM *m, curl_socket_t s, int *running_handles) { - CURLMcode result; + struct Curl_multi *multi = m; if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - result = multi_socket(multi, FALSE, s, 0, running_handles); - if(CURLM_OK >= result) - result = Curl_update_timer(multi); - return result; + return multi_socket(multi, FALSE, s, 0, running_handles); } -CURLMcode curl_multi_socket_action(struct Curl_multi *multi, curl_socket_t s, +CURLMcode curl_multi_socket_action(CURLM *m, curl_socket_t s, int ev_bitmask, int *running_handles) { - CURLMcode result; + struct Curl_multi *multi = m; if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - result = multi_socket(multi, FALSE, s, ev_bitmask, running_handles); - if(CURLM_OK >= result) - result = Curl_update_timer(multi); - return result; + return multi_socket(multi, FALSE, s, ev_bitmask, running_handles); } -CURLMcode curl_multi_socket_all(struct Curl_multi *multi, int *running_handles) +CURLMcode curl_multi_socket_all(CURLM *m, int *running_handles) { - CURLMcode result; + struct Curl_multi *multi = m; if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - result = multi_socket(multi, TRUE, CURL_SOCKET_BAD, 0, running_handles); - if(CURLM_OK >= result) - result = Curl_update_timer(multi); - return result; + return multi_socket(multi, TRUE, CURL_SOCKET_BAD, 0, running_handles); } static CURLMcode multi_timeout(struct Curl_multi *multi, + struct curltime *expire_time, long *timeout_ms) { static const struct curltime tv_zero = {0, 0}; @@ -3368,27 +3741,39 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, /* splay the lowest to the bottom */ multi->timetree = Curl_splay(tv_zero, multi->timetree); + /* this will not return NULL from a non-emtpy tree, but some compilers + * are not convinced of that. Analyzers are hard. */ + *expire_time = multi->timetree ? multi->timetree->key : tv_zero; - if(Curl_splaycomparekeys(multi->timetree->key, now) > 0) { + /* 'multi->timetree' will be non-NULL here but the compilers sometimes + yell at us if we assume so */ + if(multi->timetree && + Curl_timediff_us(multi->timetree->key, now) > 0) { /* some time left before expiration */ timediff_t diff = Curl_timediff_ceil(multi->timetree->key, now); - /* this should be safe even on 32 bit archs, as we don't use that + /* this should be safe even on 32-bit archs, as we do not use that overly long timeouts */ *timeout_ms = (long)diff; } - else + else { /* 0 means immediately */ *timeout_ms = 0; + } } - else + else { + *expire_time = tv_zero; *timeout_ms = -1; + } return CURLM_OK; } -CURLMcode curl_multi_timeout(struct Curl_multi *multi, +CURLMcode curl_multi_timeout(CURLM *m, long *timeout_ms) { + struct curltime expire_time; + struct Curl_multi *multi = m; + /* First, make some basic checks that the CURLM handle is a good handle */ if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -3396,56 +3781,79 @@ CURLMcode curl_multi_timeout(struct Curl_multi *multi, if(multi->in_callback) return CURLM_RECURSIVE_API_CALL; - return multi_timeout(multi, timeout_ms); + return multi_timeout(multi, &expire_time, timeout_ms); } +#define DEBUG_UPDATE_TIMER 0 + /* * Tell the application it should update its timers, if it subscribes to the * update timer callback. */ CURLMcode Curl_update_timer(struct Curl_multi *multi) { + struct curltime expire_ts; long timeout_ms; int rc; + bool set_value = FALSE; if(!multi->timer_cb || multi->dead) return CURLM_OK; - if(multi_timeout(multi, &timeout_ms)) { + if(multi_timeout(multi, &expire_ts, &timeout_ms)) { return CURLM_OK; } - if(timeout_ms < 0) { - static const struct curltime none = {0, 0}; - if(Curl_splaycomparekeys(none, multi->timer_lastcall)) { - multi->timer_lastcall = none; - /* there's no timeout now but there was one previously, tell the app to - disable it */ - set_in_callback(multi, TRUE); - rc = multi->timer_cb(multi, -1, multi->timer_userp); - set_in_callback(multi, FALSE); - if(rc == -1) { - multi->dead = TRUE; - return CURLM_ABORTED_BY_CALLBACK; - } - return CURLM_OK; + + if(timeout_ms < 0 && multi->last_timeout_ms < 0) { +#if DEBUG_UPDATE_TIMER + fprintf(stderr, "Curl_update_timer(), still no timeout, no change\n"); +#endif + } + else if(timeout_ms < 0) { + /* there is no timeout now but there was one previously */ +#if DEBUG_UPDATE_TIMER + fprintf(stderr, "Curl_update_timer(), remove timeout, " + " last_timeout=%ldms\n", multi->last_timeout_ms); +#endif + timeout_ms = -1; /* normalize */ + set_value = TRUE; + } + else if(multi->last_timeout_ms < 0) { +#if DEBUG_UPDATE_TIMER + fprintf(stderr, "Curl_update_timer(), had no timeout, set now\n"); +#endif + set_value = TRUE; + } + else if(Curl_timediff_us(multi->last_expire_ts, expire_ts)) { + /* We had a timeout before and have one now, the absolute timestamp + * differs. The relative timeout_ms may be the same, but the starting + * point differs. Let the application restart its timer. */ +#if DEBUG_UPDATE_TIMER + fprintf(stderr, "Curl_update_timer(), expire timestamp changed\n"); +#endif + set_value = TRUE; + } + else { + /* We have same expire time as previously. Our relative 'timeout_ms' + * may be different now, but the application has the timer running + * and we do not to tell it to start this again. */ +#if DEBUG_UPDATE_TIMER + fprintf(stderr, "Curl_update_timer(), same expire timestamp, no change\n"); +#endif + } + + if(set_value) { +#if DEBUG_UPDATE_TIMER + fprintf(stderr, "Curl_update_timer(), set timeout %ldms\n", timeout_ms); +#endif + multi->last_expire_ts = expire_ts; + multi->last_timeout_ms = timeout_ms; + set_in_callback(multi, TRUE); + rc = multi->timer_cb(multi, timeout_ms, multi->timer_userp); + set_in_callback(multi, FALSE); + if(rc == -1) { + multi->dead = TRUE; + return CURLM_ABORTED_BY_CALLBACK; } - return CURLM_OK; - } - - /* When multi_timeout() is done, multi->timetree points to the node with the - * timeout we got the (relative) time-out time for. We can thus easily check - * if this is the same (fixed) time as we got in a previous call and then - * avoid calling the callback again. */ - if(Curl_splaycomparekeys(multi->timetree->key, multi->timer_lastcall) == 0) - return CURLM_OK; - - multi->timer_lastcall = multi->timetree->key; - - set_in_callback(multi, TRUE); - rc = multi->timer_cb(multi, timeout_ms, multi->timer_userp); - set_in_callback(multi, FALSE); - if(rc == -1) { - multi->dead = TRUE; - return CURLM_ABORTED_BY_CALLBACK; } return CURLM_OK; } @@ -3458,13 +3866,13 @@ CURLMcode Curl_update_timer(struct Curl_multi *multi) static void multi_deltimeout(struct Curl_easy *data, expire_id eid) { - struct Curl_llist_element *e; + struct Curl_llist_node *e; struct Curl_llist *timeoutlist = &data->state.timeoutlist; /* find and remove the specific node from the list */ - for(e = timeoutlist->head; e; e = e->next) { - struct time_node *n = (struct time_node *)e->ptr; + for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) { + struct time_node *n = Curl_node_elem(e); if(n->eid == eid) { - Curl_llist_remove(timeoutlist, e, NULL); + Curl_node_remove(e); return; } } @@ -3482,9 +3890,9 @@ multi_addtimeout(struct Curl_easy *data, struct curltime *stamp, expire_id eid) { - struct Curl_llist_element *e; + struct Curl_llist_node *e; struct time_node *node; - struct Curl_llist_element *prev = NULL; + struct Curl_llist_node *prev = NULL; size_t n; struct Curl_llist *timeoutlist = &data->state.timeoutlist; @@ -3497,8 +3905,8 @@ multi_addtimeout(struct Curl_easy *data, n = Curl_llist_count(timeoutlist); if(n) { /* find the correct spot in the list */ - for(e = timeoutlist->head; e; e = e->next) { - struct time_node *check = (struct time_node *)e->ptr; + for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) { + struct time_node *check = Curl_node_elem(e); timediff_t diff = Curl_timediff(check->time, node->time); if(diff > 0) break; @@ -3513,6 +3921,66 @@ multi_addtimeout(struct Curl_easy *data, return CURLM_OK; } +static void expire_ex(struct Curl_easy *data, + const struct curltime *nowp, + timediff_t milli, expire_id id) +{ + struct Curl_multi *multi = data->multi; + struct curltime *curr_expire = &data->state.expiretime; + struct curltime set; + + /* this is only interesting while there is still an associated multi struct + remaining! */ + if(!multi) + return; + + 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; + + if(set.tv_usec >= 1000000) { + set.tv_sec++; + set.tv_usec -= 1000000; + } + + /* Remove any timer with the same id just in case. */ + multi_deltimeout(data, id); + + /* Add it to the timer list. It must stay in the list until it has expired + in case we need to recompute the minimum timer later. */ + multi_addtimeout(data, &set, id); + + if(curr_expire->tv_sec || curr_expire->tv_usec) { + /* 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 = Curl_timediff(set, *curr_expire); + int rc; + + if(diff > 0) { + /* The current splay tree entry is sooner than this new expiry time. + We do not need to update our splay tree entry. */ + return; + } + + /* Since this is an updated time, we must remove the previous entry from + the splay tree first and then re-add the new value */ + rc = Curl_splayremove(multi->timetree, &data->state.timenode, + &multi->timetree); + if(rc) + infof(data, "Internal error removing splay node = %d", rc); + } + + /* Indicate that we are in the splay tree and insert the new timer expiry + value since it is our local minimum. */ + *curr_expire = set; + Curl_splayset(&data->state.timenode, data); + multi->timetree = Curl_splayinsert(*curr_expire, multi->timetree, + &data->state.timenode); +} + /* * Curl_expire() * @@ -3526,60 +3994,8 @@ multi_addtimeout(struct Curl_easy *data, */ void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id id) { - struct Curl_multi *multi = data->multi; - struct curltime *nowp = &data->state.expiretime; - struct curltime set; - - /* this is only interesting while there is still an associated multi struct - remaining! */ - if(!multi) - return; - - DEBUGASSERT(id < EXPIRE_LAST); - - set = Curl_now(); - set.tv_sec += (time_t)(milli/1000); /* might be a 64 to 32 bit conversion */ - set.tv_usec += (unsigned int)(milli%1000)*1000; - - if(set.tv_usec >= 1000000) { - set.tv_sec++; - set.tv_usec -= 1000000; - } - - /* Remove any timer with the same id just in case. */ - multi_deltimeout(data, id); - - /* Add it to the timer list. It must stay in the list until it has expired - in case we need to recompute the minimum timer later. */ - multi_addtimeout(data, &set, id); - - if(nowp->tv_sec || nowp->tv_usec) { - /* 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 = Curl_timediff(set, *nowp); - int rc; - - if(diff > 0) { - /* The current splay tree entry is sooner than this new expiry time. - We don't need to update our splay tree entry. */ - return; - } - - /* Since this is an updated time, we must remove the previous entry from - the splay tree first and then re-add the new value */ - rc = Curl_splayremove(multi->timetree, &data->state.timenode, - &multi->timetree); - if(rc) - infof(data, "Internal error removing splay node = %d", rc); - } - - /* Indicate that we are in the splay tree and insert the new timer expiry - value since it is our local minimum. */ - *nowp = set; - data->state.timenode.payload = data; - multi->timetree = Curl_splayinsert(*nowp, multi->timetree, - &data->state.timenode); + struct curltime now = Curl_now(); + expire_ex(data, &now, milli, id); } /* @@ -3599,7 +4015,7 @@ void Curl_expire_done(struct Curl_easy *data, expire_id id) * * Clear ALL timeout values for this handle. */ -void Curl_expire_clear(struct Curl_easy *data) +bool Curl_expire_clear(struct Curl_easy *data) { struct Curl_multi *multi = data->multi; struct curltime *nowp = &data->state.expiretime; @@ -3607,7 +4023,7 @@ void Curl_expire_clear(struct Curl_easy *data) /* this is only interesting while there is still an associated multi struct remaining! */ if(!multi) - return; + return FALSE; if(nowp->tv_sec || nowp->tv_usec) { /* Since this is an cleared time, we must remove the previous entry from @@ -3620,26 +4036,26 @@ void Curl_expire_clear(struct Curl_easy *data) if(rc) infof(data, "Internal error clearing splay node = %d", rc); - /* flush the timeout list too */ - while(list->size > 0) { - Curl_llist_remove(list, list->tail, NULL); - } + /* clear the timeout list too */ + Curl_llist_destroy(list, NULL); #ifdef DEBUGBUILD infof(data, "Expire cleared"); #endif nowp->tv_sec = 0; nowp->tv_usec = 0; + return TRUE; } + return FALSE; } - - - -CURLMcode curl_multi_assign(struct Curl_multi *multi, curl_socket_t s, +CURLMcode curl_multi_assign(CURLM *m, curl_socket_t s, void *hashp) { struct Curl_sh_entry *there = NULL; + struct Curl_multi *multi = m; + if(!GOOD_MULTI_HANDLE(multi)) + return CURLM_BAD_HANDLE; there = sh_getentry(&multi->sockhash, s); @@ -3651,75 +4067,55 @@ CURLMcode curl_multi_assign(struct Curl_multi *multi, curl_socket_t s, return CURLM_OK; } -size_t Curl_multi_max_host_connections(struct Curl_multi *multi) +static void move_pending_to_connect(struct Curl_multi *multi, + struct Curl_easy *data) { - return multi ? multi->max_host_connections : 0; + DEBUGASSERT(data->mstate == MSTATE_PENDING); + + /* Remove this node from the pending list */ + Curl_node_remove(&data->multi_queue); + + /* put it into the process list */ + Curl_llist_append(&multi->process, data, &data->multi_queue); + + multistate(data, MSTATE_CONNECT); + + /* Make sure that the handle will be processed soonish. */ + Curl_expire(data, 0, EXPIRE_RUN_NOW); } -size_t Curl_multi_max_total_connections(struct Curl_multi *multi) -{ - return multi ? multi->max_total_connections : 0; -} +/* process_pending_handles() moves a handle from PENDING back into the process + list and change state to CONNECT. -/* - * When information about a connection has appeared, call this! - */ + We do not move all transfers because that can be a significant amount. + Since this is tried every now and then doing too many too often becomes a + performance problem. -void Curl_multiuse_state(struct Curl_easy *data, - int bundlestate) /* use BUNDLE_* defines */ -{ - struct connectdata *conn; - DEBUGASSERT(data); - DEBUGASSERT(data->multi); - conn = data->conn; - DEBUGASSERT(conn); - DEBUGASSERT(conn->bundle); + When there is a change for connection limits like max host connections etc, + this likely only allows one new transfer. When there is a pipewait change, + it can potentially allow hundreds of new transfers. - conn->bundle->multiuse = bundlestate; - process_pending_handles(data->multi); -} - -/* process_pending_handles() moves all handles from PENDING - back into the main list and change state to CONNECT */ + We could consider an improvement where we store the queue reason and allow + more pipewait rechecks than others. +*/ static void process_pending_handles(struct Curl_multi *multi) { - struct Curl_llist_element *e = multi->pending.head; + struct Curl_llist_node *e = Curl_llist_head(&multi->pending); if(e) { - struct Curl_easy *data = e->ptr; - - DEBUGASSERT(data->mstate == MSTATE_PENDING); - - /* put it back into the main list */ - link_easy(multi, data); - - multistate(data, MSTATE_CONNECT); - - /* Remove this node from the list */ - Curl_llist_remove(&multi->pending, e, NULL); - - /* Make sure that the handle will be processed soonish. */ - Curl_expire(data, 0, EXPIRE_RUN_NOW); - - /* mark this as having been in the pending queue */ - data->state.previouslypending = TRUE; + struct Curl_easy *data = Curl_node_elem(e); + move_pending_to_connect(multi, data); } } void Curl_set_in_callback(struct Curl_easy *data, bool value) { - /* might get called when there is no data pointer! */ - if(data) { - if(data->multi_easy) - data->multi_easy->in_callback = value; - else if(data->multi) - data->multi->in_callback = value; - } + if(data && data->multi) + data->multi->in_callback = value; } -bool Curl_is_in_callback(struct Curl_easy *easy) +bool Curl_is_in_callback(struct Curl_easy *data) { - return ((easy->multi && easy->multi->in_callback) || - (easy->multi_easy && easy->multi_easy->in_callback)); + return (data && data->multi && data->multi->in_callback); } unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi) @@ -3728,18 +4124,18 @@ unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi) return multi->max_concurrent_streams; } -struct Curl_easy **curl_multi_get_handles(struct Curl_multi *multi) +CURL **curl_multi_get_handles(CURLM *m) { - struct Curl_easy **a = malloc(sizeof(struct Curl_easy *) * - (multi->num_easy + 1)); + struct Curl_multi *multi = m; + CURL **a = malloc(sizeof(struct Curl_easy *) * (multi->num_easy + 1)); if(a) { unsigned int i = 0; - struct Curl_easy *e = multi->easyp; - while(e) { + struct Curl_llist_node *e; + for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *data = Curl_node_elem(e); DEBUGASSERT(i < multi->num_easy); - if(!e->state.internal) - a[i++] = e; - e = e->next; + if(!data->state.internal) + a[i++] = data; } a[i] = NULL; /* last entry is a NULL */ } @@ -3862,3 +4258,32 @@ static void multi_xfer_bufs_free(struct Curl_multi *multi) multi->xfer_ulbuf_len = 0; multi->xfer_ulbuf_borrowed = FALSE; } + +struct Curl_easy *Curl_multi_get_handle(struct Curl_multi *multi, + curl_off_t mid) +{ + + if(mid >= 0) { + struct Curl_easy *data; + struct Curl_llist_node *e; + + for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { + data = Curl_node_elem(e); + if(data->mid == mid) + return data; + } + /* may be in msgsent queue */ + for(e = Curl_llist_head(&multi->msgsent); e; e = Curl_node_next(e)) { + data = Curl_node_elem(e); + if(data->mid == mid) + return data; + } + /* may be in pending queue */ + for(e = Curl_llist_head(&multi->pending); e; e = Curl_node_next(e)) { + data = Curl_node_elem(e); + if(data->mid == mid) + return data; + } + } + return NULL; +} diff --git a/deps/curl/lib/multihandle.h b/deps/curl/lib/multihandle.h index 3156c83a..fef117c0 100644 --- a/deps/curl/lib/multihandle.h +++ b/deps/curl/lib/multihandle.h @@ -33,7 +33,7 @@ struct connectdata; struct Curl_message { - struct Curl_llist_element list; + struct Curl_llist_node list; /* the 'CURLMsg' is the part that is visible to the external user */ struct CURLMsg extmsg; }; @@ -44,24 +44,25 @@ struct Curl_message { typedef enum { MSTATE_INIT, /* 0 - start in this state */ MSTATE_PENDING, /* 1 - no connections, waiting for one */ - MSTATE_CONNECT, /* 2 - resolve/connect has been sent off */ - MSTATE_RESOLVING, /* 3 - awaiting the resolve to finalize */ - MSTATE_CONNECTING, /* 4 - awaiting the TCP connect to finalize */ - MSTATE_TUNNELING, /* 5 - awaiting HTTPS proxy SSL initialization to + 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, /* 6 - initiate protocol connect procedure */ - MSTATE_PROTOCONNECTING, /* 7 - completing the protocol-specific connect + MSTATE_PROTOCONNECT, /* 7 - initiate protocol connect procedure */ + MSTATE_PROTOCONNECTING, /* 8 - completing the protocol-specific connect phase */ - MSTATE_DO, /* 8 - start send off the request (part 1) */ - MSTATE_DOING, /* 9 - sending off the request (part 1) */ - MSTATE_DOING_MORE, /* 10 - send off the request (part 2) */ - MSTATE_DID, /* 11 - done sending off request */ - MSTATE_PERFORMING, /* 12 - transfer data */ - MSTATE_RATELIMITING, /* 13 - wait because limit-rate exceeded */ - MSTATE_DONE, /* 14 - post data transfer operation */ - MSTATE_COMPLETED, /* 15 - operation complete */ - MSTATE_MSGSENT, /* 16 - the operation complete message is sent */ - MSTATE_LAST /* 17 - not a true state, never use this */ + 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 */ } CURLMstate; /* we support N sockets per easy handle. Set the corresponding bit to what @@ -79,30 +80,23 @@ typedef enum { /* value for MAXIMUM CONCURRENT STREAMS upper limit */ #define INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1) -/* Curl_multi SSL backend-specific data; declared differently by each SSL - backend */ -struct multi_ssl_backend_data; - /* This is the struct known as CURLM on the outside */ struct Curl_multi { /* First a simple identifier to easier detect if a user mix up this multi handle with an easy handle. Set this to CURL_MULTI_HANDLE. */ unsigned int magic; - /* We have a doubly-linked list with easy handles */ - struct Curl_easy *easyp; - struct Curl_easy *easylp; /* last node */ - unsigned int num_easy; /* amount of entries in the linked list above. */ unsigned int num_alive; /* amount of easy handles that are added but have not yet reached COMPLETE state */ struct Curl_llist msglist; /* a list of messages from completed transfers */ - struct Curl_llist pending; /* Curl_easys that are in the - MSTATE_PENDING state */ - struct Curl_llist msgsent; /* Curl_easys that are in the - MSTATE_MSGSENT state */ + /* Each added easy handle is added to ONE of these three lists */ + struct Curl_llist process; /* not in PENDING or MSGSENT */ + struct Curl_llist pending; /* in PENDING */ + struct Curl_llist msgsent; /* in MSGSENT */ + curl_off_t next_easy_mid; /* next multi-id for easy handle added */ /* callback function and user data pointer for the *socket() API */ curl_socket_callback socket_cb; @@ -131,40 +125,47 @@ struct Curl_multi { char *xfer_ulbuf; /* the actual buffer */ size_t xfer_ulbuf_len; /* the allocated length */ -#if defined(USE_SSL) - struct multi_ssl_backend_data *ssl_backend_data; -#endif - /* 'sockhash' is the lookup hash for socket descriptor => easy handles (note the pluralis form, there can be more than one easy handle waiting on the same actual socket) */ struct Curl_hash sockhash; + /* `proto_hash` is a general key-value store for protocol implementations + * with the lifetime of the multi handle. The number of elements kept here + * should be in the order of supported protocols (and sub-protocols like + * TLS), *not* in the order of connections or current transfers! + * Elements need to be added with their own destructor to be invoked when + * the multi handle is cleaned up (see Curl_hash_add2()).*/ + struct Curl_hash proto_hash; /* Shared connection cache (bundles)*/ - struct conncache conn_cache; + struct cpool cpool; 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 */ + long max_shutdown_connections; /* if >0, a fixed limit of the maximum number + of connections in shutdown handling */ /* timer callback and user data pointer for the *socket() API */ curl_multi_timer_callback timer_cb; void *timer_userp; - struct curltime timer_lastcall; /* the fixed time for the timeout for the - previous callback */ + long last_timeout_ms; /* the last timeout value set via timer_cb */ + struct curltime last_expire_ts; /* timestamp of last expiry */ + #ifdef USE_WINSOCK - WSAEVENT wsa_event; /* winsock event used for waits */ + WSAEVENT wsa_event; /* Winsock event used for waits */ #else #ifdef ENABLE_WAKEUP - curl_socket_t wakeup_pair[2]; /* socketpair() used for wakeup - 0 is used for read, 1 is used for write */ + curl_socket_t wakeup_pair[2]; /* eventfd()/pipe()/socketpair() used for + wakeup 0 is used for read, 1 is used + for write */ #endif #endif unsigned int max_concurrent_streams; unsigned int maxconnects; /* if >0, a fixed limit of the maximum number of - entries we're allowed to grow the connection + entries we are allowed to grow the connection cache to */ #define IPV6_UNKNOWN 0 #define IPV6_DEAD 1 @@ -179,7 +180,7 @@ struct Curl_multi { BIT(dead); /* a callback returned error, everything needs to crash and burn */ BIT(xfer_buf_borrowed); /* xfer_buf is currently being borrowed */ - BIT(xfer_ulbuf_borrowed); /* xfer_buf is currently being borrowed */ + BIT(xfer_ulbuf_borrowed); /* xfer_ulbuf is currently being borrowed */ #ifdef DEBUGBUILD BIT(warned); /* true after user warned of DEBUGBUILD */ #endif diff --git a/deps/curl/lib/multiif.h b/deps/curl/lib/multiif.h index 37f7a442..e5872cd6 100644 --- a/deps/curl/lib/multiif.h +++ b/deps/curl/lib/multiif.h @@ -30,7 +30,7 @@ CURLcode Curl_updatesocket(struct Curl_easy *data); void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id); -void Curl_expire_clear(struct Curl_easy *data); +bool Curl_expire_clear(struct Curl_easy *data); void Curl_expire_done(struct Curl_easy *data, expire_id id); CURLMcode Curl_update_timer(struct Curl_multi *multi) WARN_UNUSED_RESULT; void Curl_attach_connection(struct Curl_easy *data, @@ -38,15 +38,16 @@ void Curl_attach_connection(struct Curl_easy *data, void Curl_detach_connection(struct Curl_easy *data); bool Curl_multiplex_wanted(const struct Curl_multi *multi); void Curl_set_in_callback(struct Curl_easy *data, bool value); -bool Curl_is_in_callback(struct Curl_easy *easy); +bool Curl_is_in_callback(struct Curl_easy *data); CURLcode Curl_preconnect(struct Curl_easy *data); void Curl_multi_connchanged(struct Curl_multi *multi); /* Internal version of curl_multi_init() accepts size parameters for the socket, connection and dns hashes */ -struct Curl_multi *Curl_multi_handle(int hashsize, int chashsize, - int dnssize); +struct Curl_multi *Curl_multi_handle(size_t hashsize, + size_t chashsize, + size_t dnssize); /* the write bits start at bit 16 for the *getsock() bitmap */ #define GETSOCK_WRITEBITSTART 16 @@ -62,20 +63,11 @@ struct Curl_multi *Curl_multi_handle(int hashsize, int chashsize, /* mask for checking if read and/or write is set for index x */ #define GETSOCK_MASK_RW(x) (GETSOCK_READSOCK(x)|GETSOCK_WRITESOCK(x)) -/* Return the value of the CURLMOPT_MAX_HOST_CONNECTIONS option */ -size_t Curl_multi_max_host_connections(struct Curl_multi *multi); - -/* Return the value of the CURLMOPT_MAX_TOTAL_CONNECTIONS option */ -size_t Curl_multi_max_total_connections(struct Curl_multi *multi); - -void Curl_multiuse_state(struct Curl_easy *data, - int bundlestate); /* use BUNDLE_* defines */ - /* * Curl_multi_closed() * * Used by the connect code to tell the multi_socket code that one of the - * sockets we were using is about to be closed. This function will then + * sockets we were using is about to be closed. This function will then * remove it from the sockethash for this handle to make the multi_socket API * behave properly, especially for the case when libcurl will create another * socket again and it gets the same file descriptor number. @@ -83,6 +75,15 @@ void Curl_multiuse_state(struct Curl_easy *data, void Curl_multi_closed(struct Curl_easy *data, curl_socket_t s); +/* Compare the two pollsets to notify the multi_socket API of changes + * in socket polling, e.g calling multi->socket_cb() with the changes if + * differences are seen. + */ +CURLMcode Curl_multi_pollset_ev(struct Curl_multi *multi, + struct Curl_easy *data, + struct easy_pollset *ps, + struct easy_pollset *last_ps); + /* * Add a handle and move it into PERFORM state at once. For pushed streams. */ @@ -143,4 +144,10 @@ CURLcode Curl_multi_xfer_ulbuf_borrow(struct Curl_easy *data, */ void Curl_multi_xfer_ulbuf_release(struct Curl_easy *data, char *buf); +/** + * Get the transfer handle for the given id. Returns NULL if not found. + */ +struct Curl_easy *Curl_multi_get_handle(struct Curl_multi *multi, + curl_off_t id); + #endif /* HEADER_CURL_MULTIIF_H */ diff --git a/deps/curl/lib/netrc.c b/deps/curl/lib/netrc.c index cd2a2844..c23f927c 100644 --- a/deps/curl/lib/netrc.c +++ b/deps/curl/lib/netrc.c @@ -31,7 +31,6 @@ #include #include "netrc.h" -#include "strtok.h" #include "strcase.h" #include "curl_get_line.h" @@ -49,21 +48,56 @@ enum host_lookup_state { MACDEF }; +enum found_state { + NONE, + LOGIN, + PASSWORD +}; + #define NETRC_FILE_MISSING 1 #define NETRC_FAILED -1 #define NETRC_SUCCESS 0 #define MAX_NETRC_LINE 4096 +#define MAX_NETRC_FILE (64*1024) +#define MAX_NETRC_TOKEN 128 + +static CURLcode file2memory(const char *filename, struct dynbuf *filebuf) +{ + CURLcode result = CURLE_OK; + FILE *file = fopen(filename, FOPEN_READTEXT); + struct dynbuf linebuf; + Curl_dyn_init(&linebuf, MAX_NETRC_LINE); + + if(file) { + while(Curl_get_line(&linebuf, file)) { + const char *line = Curl_dyn_ptr(&linebuf); + /* skip comments on load */ + while(ISBLANK(*line)) + line++; + if(*line == '#') + continue; + result = Curl_dyn_add(filebuf, line); + if(result) + goto done; + } + } +done: + Curl_dyn_free(&linebuf); + if(file) + fclose(file); + return result; +} /* * Returns zero on success. */ -static int parsenetrc(const char *host, +static int parsenetrc(struct store_netrc *store, + const char *host, char **loginp, char **passwordp, - char *netrcfile) + const char *netrcfile) { - FILE *file; int retcode = NETRC_FILE_MISSING; char *login = *loginp; char *password = *passwordp; @@ -71,204 +105,212 @@ static int parsenetrc(const char *host, bool login_alloc = FALSE; bool password_alloc = FALSE; enum host_lookup_state state = NOTHING; + enum found_state found = NONE; + bool our_login = TRUE; /* With specific_login, found *our* login name (or + login-less line) */ + bool done = FALSE; + char *netrcbuffer; + struct dynbuf token; + struct dynbuf *filebuf = &store->filebuf; + Curl_dyn_init(&token, MAX_NETRC_TOKEN); - char state_login = 0; /* Found a login keyword */ - char state_password = 0; /* Found a password keyword */ - int state_our_login = TRUE; /* With specific_login, found *our* login - name (or login-less line) */ + if(!store->loaded) { + if(file2memory(netrcfile, filebuf)) + return NETRC_FAILED; + store->loaded = TRUE; + } - DEBUGASSERT(netrcfile); + netrcbuffer = Curl_dyn_ptr(filebuf); - file = fopen(netrcfile, FOPEN_READTEXT); - if(file) { - bool done = FALSE; - struct dynbuf buf; - Curl_dyn_init(&buf, MAX_NETRC_LINE); - - while(!done && Curl_get_line(&buf, file)) { - char *tok; + while(!done) { + char *tok = netrcbuffer; + while(tok) { char *tok_end; bool quoted; - char *netrcbuffer = Curl_dyn_ptr(&buf); + Curl_dyn_reset(&token); + while(ISBLANK(*tok)) + tok++; + /* tok is first non-space letter */ if(state == MACDEF) { - if((netrcbuffer[0] == '\n') || (netrcbuffer[0] == '\r')) - state = NOTHING; - else - continue; + if((*tok == '\n') || (*tok == '\r')) + state = NOTHING; /* end of macro definition */ } - tok = netrcbuffer; - while(tok) { - while(ISBLANK(*tok)) - tok++; - /* tok is first non-space letter */ - if(!*tok || (*tok == '#')) - /* end of line or the rest is a comment */ - break; - /* leading double-quote means quoted string */ - quoted = (*tok == '\"'); + if(!*tok || (*tok == '\n')) + /* end of line */ + break; - tok_end = tok; - if(!quoted) { - while(!ISSPACE(*tok_end)) - tok_end++; - *tok_end = 0; + /* leading double-quote means quoted string */ + quoted = (*tok == '\"'); + + tok_end = tok; + if(!quoted) { + size_t len = 0; + while(!ISSPACE(*tok_end)) { + tok_end++; + len++; } - else { - bool escape = FALSE; - bool endquote = FALSE; - char *store = tok; - tok_end++; /* pass the leading quote */ - while(*tok_end) { - char s = *tok_end; - if(escape) { - escape = FALSE; - switch(s) { - case 'n': - s = '\n'; - break; - case 'r': - s = '\r'; - break; - case 't': - s = '\t'; - break; - } - } - else if(s == '\\') { - escape = TRUE; - tok_end++; - continue; - } - else if(s == '\"') { - tok_end++; /* pass the ending quote */ - endquote = TRUE; + if(!len || Curl_dyn_addn(&token, tok, len)) { + retcode = NETRC_FAILED; + goto out; + } + } + else { + bool escape = FALSE; + bool endquote = FALSE; + tok_end++; /* pass the leading quote */ + while(*tok_end) { + char s = *tok_end; + if(escape) { + escape = FALSE; + switch(s) { + case 'n': + s = '\n'; + break; + case 'r': + s = '\r'; + break; + case 't': + s = '\t'; break; } - *store++ = s; - tok_end++; } - *store = 0; - if(escape || !endquote) { - /* bad syntax, get out */ + else if(s == '\\') { + escape = TRUE; + tok_end++; + continue; + } + else if(s == '\"') { + tok_end++; /* pass the ending quote */ + endquote = TRUE; + break; + } + if(Curl_dyn_addn(&token, &s, 1)) { retcode = NETRC_FAILED; goto out; } + tok_end++; } - - if((login && *login) && (password && *password)) { - done = TRUE; - break; + if(escape || !endquote) { + /* bad syntax, get out */ + retcode = NETRC_FAILED; + goto out; } - - switch(state) { - case NOTHING: - if(strcasecompare("macdef", tok)) { - /* Define a macro. A macro is defined with the specified name; its - contents begin with the next .netrc line and continue until a - null line (consecutive new-line characters) is encountered. */ - state = MACDEF; - } - else if(strcasecompare("machine", tok)) { - /* the next tok is the machine name, this is in itself the - delimiter that starts the stuff entered for this machine, - after this we need to search for 'login' and - 'password'. */ - state = HOSTFOUND; - } - else if(strcasecompare("default", tok)) { - state = HOSTVALID; - retcode = NETRC_SUCCESS; /* we did find our host */ - } - break; - case MACDEF: - if(!strlen(tok)) { - state = NOTHING; - } - break; - case HOSTFOUND: - if(strcasecompare(host, tok)) { - /* and yes, this is our host! */ - state = HOSTVALID; - retcode = NETRC_SUCCESS; /* we did find our host */ - } - else - /* not our host */ - state = NOTHING; - break; - case HOSTVALID: - /* we are now parsing sub-keywords concerning "our" host */ - if(state_login) { - if(specific_login) { - state_our_login = !Curl_timestrcmp(login, tok); - } - else if(!login || Curl_timestrcmp(login, tok)) { - if(login_alloc) { - free(login); - login_alloc = FALSE; - } - login = strdup(tok); - if(!login) { - retcode = NETRC_FAILED; /* allocation failed */ - goto out; - } - login_alloc = TRUE; - } - state_login = 0; - } - else if(state_password) { - if((state_our_login || !specific_login) - && (!password || Curl_timestrcmp(password, tok))) { - if(password_alloc) { - free(password); - password_alloc = FALSE; - } - password = strdup(tok); - if(!password) { - retcode = NETRC_FAILED; /* allocation failed */ - goto out; - } - password_alloc = TRUE; - } - state_password = 0; - } - else if(strcasecompare("login", tok)) - state_login = 1; - else if(strcasecompare("password", tok)) - state_password = 1; - else if(strcasecompare("machine", tok)) { - /* ok, there's machine here go => */ - state = HOSTFOUND; - state_our_login = FALSE; - } - break; - } /* switch (state) */ - tok = ++tok_end; } - } /* while Curl_get_line() */ + + if((login && *login) && (password && *password)) { + done = TRUE; + break; + } + + tok = Curl_dyn_ptr(&token); + + switch(state) { + case NOTHING: + if(strcasecompare("macdef", tok)) + /* Define a macro. A macro is defined with the specified name; its + contents begin with the next .netrc line and continue until a + null line (consecutive new-line characters) is encountered. */ + state = MACDEF; + else if(strcasecompare("machine", tok)) + /* the next tok is the machine name, this is in itself the delimiter + that starts the stuff entered for this machine, after this we + need to search for 'login' and 'password'. */ + state = HOSTFOUND; + else if(strcasecompare("default", tok)) { + state = HOSTVALID; + retcode = NETRC_SUCCESS; /* we did find our host */ + } + break; + case MACDEF: + if(!*tok) + state = NOTHING; + break; + case HOSTFOUND: + if(strcasecompare(host, tok)) { + /* and yes, this is our host! */ + state = HOSTVALID; + retcode = NETRC_SUCCESS; /* we did find our host */ + } + else + /* not our host */ + state = NOTHING; + break; + case HOSTVALID: + /* we are now parsing sub-keywords concerning "our" host */ + if(found == LOGIN) { + if(specific_login) { + our_login = !Curl_timestrcmp(login, tok); + } + else if(!login || Curl_timestrcmp(login, tok)) { + if(login_alloc) + free(login); + login = strdup(tok); + if(!login) { + retcode = NETRC_FAILED; /* allocation failed */ + goto out; + } + login_alloc = TRUE; + } + found = NONE; + } + else if(found == PASSWORD) { + if((our_login || !specific_login) && + (!password || Curl_timestrcmp(password, tok))) { + if(password_alloc) + free(password); + password = strdup(tok); + if(!password) { + retcode = NETRC_FAILED; /* allocation failed */ + goto out; + } + password_alloc = TRUE; + } + found = NONE; + } + else if(strcasecompare("login", tok)) + found = LOGIN; + else if(strcasecompare("password", tok)) + found = PASSWORD; + else if(strcasecompare("machine", tok)) { + /* ok, there is machine here go => */ + state = HOSTFOUND; + found = NONE; + } + break; + } /* switch (state) */ + tok = ++tok_end; + } + if(!done) { + char *nl = NULL; + if(tok) + nl = strchr(tok, '\n'); + if(!nl) + break; + /* point to next line */ + netrcbuffer = &nl[1]; + } + } /* while !done */ out: - Curl_dyn_free(&buf); - if(!retcode) { - /* success */ - if(login_alloc) { - if(*loginp) - free(*loginp); - *loginp = login; - } - if(password_alloc) { - if(*passwordp) - free(*passwordp); - *passwordp = password; - } + Curl_dyn_free(&token); + if(!retcode) { + /* success */ + if(login_alloc) { + free(*loginp); + *loginp = login; } - else { - if(login_alloc) - free(login); - if(password_alloc) - free(password); + if(password_alloc) { + free(*passwordp); + *passwordp = password; } - fclose(file); + } + else { + Curl_dyn_free(filebuf); + if(login_alloc) + free(login); + if(password_alloc) + free(password); } return retcode; @@ -277,10 +319,11 @@ out: /* * @unittest: 1304 * - * *loginp and *passwordp MUST be allocated if they aren't NULL when passed + * *loginp and *passwordp MUST be allocated if they are not NULL when passed * in. */ -int Curl_parsenetrc(const char *host, char **loginp, char **passwordp, +int Curl_parsenetrc(struct store_netrc *store, const char *host, + char **loginp, char **passwordp, char *netrcfile) { int retcode = 1; @@ -324,30 +367,40 @@ int Curl_parsenetrc(const char *host, char **loginp, char **passwordp, return retcode; /* no home directory found (or possibly out of memory) */ - filealloc = curl_maprintf("%s%s.netrc", home, DIR_CHAR); + filealloc = aprintf("%s%s.netrc", home, DIR_CHAR); if(!filealloc) { free(homea); return -1; } - retcode = parsenetrc(host, loginp, passwordp, filealloc); + retcode = parsenetrc(store, host, loginp, passwordp, filealloc); 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); + filealloc = aprintf("%s%s_netrc", home, DIR_CHAR); if(!filealloc) { free(homea); return -1; } - retcode = parsenetrc(host, loginp, passwordp, filealloc); + retcode = parsenetrc(store, host, loginp, passwordp, filealloc); free(filealloc); } #endif free(homea); } else - retcode = parsenetrc(host, loginp, passwordp, netrcfile); + retcode = parsenetrc(store, host, loginp, passwordp, netrcfile); return retcode; } +void Curl_netrc_init(struct store_netrc *s) +{ + Curl_dyn_init(&s->filebuf, MAX_NETRC_FILE); + s->loaded = FALSE; +} +void Curl_netrc_cleanup(struct store_netrc *s) +{ + Curl_dyn_free(&s->filebuf); + s->loaded = FALSE; +} #endif diff --git a/deps/curl/lib/netrc.h b/deps/curl/lib/netrc.h index 9f2815f3..0ef9ff78 100644 --- a/deps/curl/lib/netrc.h +++ b/deps/curl/lib/netrc.h @@ -26,9 +26,19 @@ #include "curl_setup.h" #ifndef CURL_DISABLE_NETRC +#include "dynbuf.h" -/* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ -int Curl_parsenetrc(const char *host, char **loginp, +struct store_netrc { + struct dynbuf filebuf; + char *filename; + BIT(loaded); +}; + +void Curl_netrc_init(struct store_netrc *s); +void Curl_netrc_cleanup(struct store_netrc *s); + +/* returns -1 on failure, 0 if the host is found, 1 is the host is not found */ +int Curl_parsenetrc(struct store_netrc *s, const char *host, char **loginp, char **passwordp, char *filename); /* Assume: (*passwordp)[0]=0, host[0] != 0. * If (*loginp)[0] = 0, search for login and password within a machine @@ -38,6 +48,8 @@ int Curl_parsenetrc(const char *host, char **loginp, #else /* disabled */ #define Curl_parsenetrc(a,b,c,d,e,f) 1 +#define Curl_netrc_init(x) +#define Curl_netrc_cleanup(x) #endif #endif /* HEADER_CURL_NETRC_H */ diff --git a/deps/curl/lib/nonblock.c b/deps/curl/lib/nonblock.c index f4eb6561..6dcf42a7 100644 --- a/deps/curl/lib/nonblock.c +++ b/deps/curl/lib/nonblock.c @@ -47,16 +47,25 @@ int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ int nonblock /* TRUE or FALSE */) { #if defined(HAVE_FCNTL_O_NONBLOCK) - /* most recent unix versions */ + /* most recent Unix versions */ int flags; flags = sfcntl(sockfd, F_GETFL, 0); + if(flags < 0) + return -1; + /* Check if the current file status flags have already satisfied + * the request, if so, it is no need to call fcntl() to replicate it. + */ + if(!!(flags & O_NONBLOCK) == !!nonblock) + return 0; if(nonblock) - return sfcntl(sockfd, F_SETFL, flags | O_NONBLOCK); - return sfcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); + flags |= O_NONBLOCK; + else + flags &= ~O_NONBLOCK; + return sfcntl(sockfd, F_SETFL, flags); #elif defined(HAVE_IOCTL_FIONBIO) - /* older unix versions */ + /* older Unix versions */ int flags = nonblock ? 1 : 0; return ioctl(sockfd, FIONBIO, &flags); @@ -64,7 +73,7 @@ int curlx_nonblock(curl_socket_t sockfd, /* operate on this */ /* Windows */ unsigned long flags = nonblock ? 1UL : 0UL; - return ioctlsocket(sockfd, FIONBIO, &flags); + return ioctlsocket(sockfd, (long)FIONBIO, &flags); #elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) diff --git a/deps/curl/lib/noproxy.c b/deps/curl/lib/noproxy.c index 5241640a..dbfafc93 100644 --- a/deps/curl/lib/noproxy.c +++ b/deps/curl/lib/noproxy.c @@ -78,23 +78,23 @@ UNITTEST bool Curl_cidr6_match(const char *ipv6, const char *network, unsigned int bits) { -#ifdef ENABLE_IPV6 - int bytes; - int rest; +#ifdef USE_IPV6 + unsigned int bytes; + unsigned int rest; unsigned char address[16]; unsigned char check[16]; if(!bits) bits = 128; - bytes = bits/8; + bytes = bits / 8; rest = bits & 0x07; + if((bytes > 16) || ((bytes == 16) && rest)) + return FALSE; if(1 != Curl_inet_pton(AF_INET6, ipv6, address)) return FALSE; if(1 != Curl_inet_pton(AF_INET6, network, check)) return FALSE; - if((bytes > 16) || ((bytes == 16) && rest)) - return FALSE; if(bytes && memcmp(address, check, bytes)) return FALSE; if(rest && !((address[bytes] ^ check[bytes]) & (0xff << (8 - rest)))) @@ -119,13 +119,12 @@ enum nametype { * 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, - bool *spacesep) +bool Curl_check_noproxy(const char *name, const char *no_proxy) { char hostip[128]; - *spacesep = FALSE; + /* - * If we don't have a hostname at all, like for example with a FILE + * 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. */ if(!name || name[0] == '\0') @@ -143,7 +142,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy, if(!strcmp("*", no_proxy)) return TRUE; - /* NO_PROXY was specified and it wasn't just an asterisk */ + /* NO_PROXY was specified and it was not just an asterisk */ if(name[0] == '[') { char *endptr; @@ -166,7 +165,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy, if(1 == Curl_inet_pton(AF_INET, name, &address)) type = TYPE_IPV4; else { - /* ignore trailing dots in the host name */ + /* ignore trailing dots in the hostname */ if(name[namelen - 1] == '.') namelen--; } @@ -232,7 +231,9 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy, slash = strchr(check, '/'); /* if the slash is part of this token, use it */ if(slash) { - bits = atoi(slash + 1); + /* 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) @@ -248,16 +249,14 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy, /* pass blanks after pattern */ while(ISBLANK(*p)) p++; - /* if not a comma! */ - if(*p && (*p != ',')) { - *spacesep = TRUE; - continue; - } + /* if not a comma, this ends the loop */ + if(*p != ',') + break; /* pass any number of commas */ while(*p == ',') p++; } /* while(*p) */ - } /* NO_PROXY was specified and it wasn't just an asterisk */ + } /* NO_PROXY was specified and it was not just an asterisk */ return FALSE; } diff --git a/deps/curl/lib/noproxy.h b/deps/curl/lib/noproxy.h index a3a68077..71ae7eaa 100644 --- a/deps/curl/lib/noproxy.h +++ b/deps/curl/lib/noproxy.h @@ -27,7 +27,7 @@ #ifndef CURL_DISABLE_PROXY -#ifdef DEBUGBUILD +#ifdef UNITTESTS UNITTEST bool Curl_cidr4_match(const char *ipv4, /* 1.2.3.4 address */ const char *network, /* 1.2.3.4 address */ @@ -37,9 +37,7 @@ UNITTEST bool Curl_cidr6_match(const char *ipv6, unsigned int bits); #endif -bool Curl_check_noproxy(const char *name, const char *no_proxy, - bool *spacesep); - +bool Curl_check_noproxy(const char *name, const char *no_proxy); #endif #endif /* HEADER_CURL_NOPROXY_H */ diff --git a/deps/curl/lib/openldap.c b/deps/curl/lib/openldap.c index 47266f64..8c4af22b 100644 --- a/deps/curl/lib/openldap.c +++ b/deps/curl/lib/openldap.c @@ -117,7 +117,7 @@ static Curl_recv oldap_recv; */ const struct Curl_handler Curl_handler_ldap = { - "LDAP", /* scheme */ + "ldap", /* scheme */ oldap_setup_connection, /* setup_connection */ oldap_do, /* do_it */ oldap_done, /* done */ @@ -131,6 +131,7 @@ const struct Curl_handler Curl_handler_ldap = { ZERO_NULL, /* perform_getsock */ oldap_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_LDAP, /* defport */ @@ -145,7 +146,7 @@ const struct Curl_handler Curl_handler_ldap = { */ const struct Curl_handler Curl_handler_ldaps = { - "LDAPS", /* scheme */ + "ldaps", /* scheme */ oldap_setup_connection, /* setup_connection */ oldap_do, /* do_it */ oldap_done, /* done */ @@ -159,6 +160,7 @@ const struct Curl_handler Curl_handler_ldaps = { ZERO_NULL, /* perform_getsock */ oldap_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_LDAPS, /* defport */ @@ -234,17 +236,13 @@ static CURLcode oldap_map_error(int rc, CURLcode result) { switch(rc) { case LDAP_NO_MEMORY: - result = CURLE_OUT_OF_MEMORY; - break; + return CURLE_OUT_OF_MEMORY; case LDAP_INVALID_CREDENTIALS: - result = CURLE_LOGIN_DENIED; - break; + return CURLE_LOGIN_DENIED; case LDAP_PROTOCOL_ERROR: - result = CURLE_UNSUPPORTED_PROTOCOL; - break; + return CURLE_UNSUPPORTED_PROTOCOL; case LDAP_INSUFFICIENT_ACCESS: - result = CURLE_REMOTE_ACCESS_DENIED; - break; + return CURLE_REMOTE_ACCESS_DENIED; } return result; } @@ -274,7 +272,8 @@ static CURLcode oldap_url_parse(struct Curl_easy *data, LDAPURLDesc **ludp) if(rc != LDAP_URL_SUCCESS) { const char *msg = "url parsing problem"; - result = rc == LDAP_URL_ERR_MEM? CURLE_OUT_OF_MEMORY: CURLE_URL_MALFORMAT; + result = rc == LDAP_URL_ERR_MEM ? CURLE_OUT_OF_MEMORY : + CURLE_URL_MALFORMAT; rc -= LDAP_URL_SUCCESS; if((size_t) rc < sizeof(url_errs) / sizeof(url_errs[0])) msg = url_errs[rc]; @@ -311,7 +310,7 @@ static CURLcode oldap_parse_login_options(struct connectdata *conn) ptr++; } - return result == CURLE_URL_MALFORMAT? CURLE_SETOPT_OPTION_SYNTAX: result; + return result == CURLE_URL_MALFORMAT ? CURLE_SETOPT_OPTION_SYNTAX : result; } static CURLcode oldap_setup_connection(struct Curl_easy *data, @@ -349,7 +348,6 @@ static CURLcode oldap_perform_auth(struct Curl_easy *data, const char *mech, { struct connectdata *conn = data->conn; struct ldapconninfo *li = conn->proto.ldapc; - CURLcode result = CURLE_OK; struct berval cred; struct berval *pcred = &cred; int rc; @@ -360,8 +358,8 @@ static CURLcode oldap_perform_auth(struct Curl_easy *data, const char *mech, pcred = NULL; rc = ldap_sasl_bind(li->ld, NULL, mech, pcred, NULL, NULL, &li->msgid); if(rc != LDAP_SUCCESS) - result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); - return result; + return oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); + return CURLE_OK; } /* @@ -372,7 +370,6 @@ static CURLcode oldap_continue_auth(struct Curl_easy *data, const char *mech, { struct connectdata *conn = data->conn; struct ldapconninfo *li = conn->proto.ldapc; - CURLcode result = CURLE_OK; struct berval cred; struct berval *pcred = &cred; int rc; @@ -383,8 +380,8 @@ static CURLcode oldap_continue_auth(struct Curl_easy *data, const char *mech, pcred = NULL; rc = ldap_sasl_bind(li->ld, NULL, mech, pcred, NULL, NULL, &li->msgid); if(rc != LDAP_SUCCESS) - result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); - return result; + return oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); + return CURLE_OK; } /* @@ -393,20 +390,18 @@ static CURLcode oldap_continue_auth(struct Curl_easy *data, const char *mech, static CURLcode oldap_cancel_auth(struct Curl_easy *data, const char *mech) { struct ldapconninfo *li = data->conn->proto.ldapc; - CURLcode result = CURLE_OK; int rc = ldap_sasl_bind(li->ld, NULL, LDAP_SASL_NULL, NULL, NULL, NULL, &li->msgid); (void)mech; if(rc != LDAP_SUCCESS) - result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); - return result; + return oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); + return CURLE_OK; } /* Starts LDAP simple bind. */ static CURLcode oldap_perform_bind(struct Curl_easy *data, ldapstate newstate) { - CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; struct ldapconninfo *li = conn->proto.ldapc; char *binddn = NULL; @@ -424,19 +419,17 @@ static CURLcode oldap_perform_bind(struct Curl_easy *data, ldapstate newstate) rc = ldap_sasl_bind(li->ld, binddn, LDAP_SASL_SIMPLE, &passwd, NULL, NULL, &li->msgid); - if(rc == LDAP_SUCCESS) - oldap_state(data, newstate); - else - result = oldap_map_error(rc, - data->state.aptr.user? - CURLE_LOGIN_DENIED: CURLE_LDAP_CANNOT_BIND); - return result; + if(rc != LDAP_SUCCESS) + return oldap_map_error(rc, + data->state.aptr.user ? + CURLE_LOGIN_DENIED : CURLE_LDAP_CANNOT_BIND); + oldap_state(data, newstate); + return CURLE_OK; } /* Query the supported SASL authentication mechanisms. */ static CURLcode oldap_perform_mechs(struct Curl_easy *data) { - CURLcode result = CURLE_OK; struct ldapconninfo *li = data->conn->proto.ldapc; int rc; static const char * const supportedSASLMechanisms[] = { @@ -447,11 +440,10 @@ static CURLcode oldap_perform_mechs(struct Curl_easy *data) rc = ldap_search_ext(li->ld, "", LDAP_SCOPE_BASE, "(objectclass=*)", (char **) supportedSASLMechanisms, 0, NULL, NULL, NULL, 0, &li->msgid); - if(rc == LDAP_SUCCESS) - oldap_state(data, OLDAP_MECHS); - else - result = oldap_map_error(rc, CURLE_LOGIN_DENIED); - return result; + if(rc != LDAP_SUCCESS) + return oldap_map_error(rc, CURLE_LOGIN_DENIED); + oldap_state(data, OLDAP_MECHS); + return CURLE_OK; } /* Starts SASL bind. */ @@ -477,12 +469,10 @@ static bool ssl_installed(struct connectdata *conn) static CURLcode oldap_ssl_connect(struct Curl_easy *data, ldapstate newstate) { - CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; struct ldapconninfo *li = conn->proto.ldapc; - bool ssldone = 0; - - result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &ssldone); + bool ssldone = FALSE; + CURLcode result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &ssldone); if(!result) { oldap_state(data, newstate); @@ -503,15 +493,13 @@ static CURLcode oldap_ssl_connect(struct Curl_easy *data, ldapstate newstate) /* Send the STARTTLS request */ static CURLcode oldap_perform_starttls(struct Curl_easy *data) { - CURLcode result = CURLE_OK; struct ldapconninfo *li = data->conn->proto.ldapc; int rc = ldap_start_tls(li->ld, NULL, NULL, &li->msgid); - if(rc == LDAP_SUCCESS) - oldap_state(data, OLDAP_STARTTLS); - else - result = oldap_map_error(rc, CURLE_USE_SSL_FAILED); - return result; + if(rc != LDAP_SUCCESS) + return oldap_map_error(rc, CURLE_USE_SSL_FAILED); + oldap_state(data, OLDAP_STARTTLS); + return CURLE_OK; } #endif @@ -548,9 +536,12 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done) return result; } - hosturl = aprintf("ldap%s://%s:%d", - conn->handler->flags & PROTOPT_SSL? "s": "", - conn->host.name, conn->remote_port); + hosturl = aprintf("%s://%s%s%s:%d", + conn->handler->scheme, + conn->bits.ipv6_ip ? "[" : "", + conn->host.name, + conn->bits.ipv6_ip ? "]" : "", + conn->remote_port); if(!hosturl) return CURLE_OUT_OF_MEMORY; @@ -916,7 +907,7 @@ static CURLcode oldap_do(struct Curl_easy *data, bool *done) else { lr->msgid = msgid; data->req.p.ldap = lr; - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); *done = TRUE; } } @@ -981,7 +972,7 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf, BerElement *ber = NULL; struct timeval tv = {0, 0}; struct berval bv, *bvals; - int binary = 0; + bool binary = FALSE; CURLcode result = CURLE_AGAIN; int code; char *info = NULL; @@ -1064,10 +1055,10 @@ static ssize_t 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); + !strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7); for(i = 0; bvals[i].bv_val != NULL; i++) { - int binval = 0; + bool binval = FALSE; result = client_write(data, STRCONST("\t"), bv.bv_val, bv.bv_len, STRCONST(":")); @@ -1078,13 +1069,13 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf, /* check for leading or trailing whitespace */ if(ISBLANK(bvals[i].bv_val[0]) || ISBLANK(bvals[i].bv_val[bvals[i].bv_len - 1])) - binval = 1; + binval = TRUE; else { /* check for unprintable characters */ unsigned int j; for(j = 0; j < bvals[i].bv_len; j++) if(!ISPRINT(bvals[i].bv_val[j])) { - binval = 1; + binval = TRUE; break; } } @@ -1129,7 +1120,7 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf, ldap_msgfree(msg); *err = result; - return result? -1: 0; + return result ? -1 : 0; } #ifdef USE_SSL @@ -1147,7 +1138,7 @@ ldapsb_tls_remove(Sockbuf_IO_Desc *sbiod) return 0; } -/* We don't need to do anything because libcurl does it already */ +/* We do not need to do anything because libcurl does it already */ static int ldapsb_tls_close(Sockbuf_IO_Desc *sbiod) { @@ -1196,7 +1187,7 @@ ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) if(conn) { struct ldapconninfo *li = conn->proto.ldapc; CURLcode err = CURLE_SEND_ERROR; - ret = (li->send)(data, FIRSTSOCKET, buf, len, &err); + ret = (li->send)(data, FIRSTSOCKET, buf, len, FALSE, &err); if(ret < 0 && err == CURLE_AGAIN) { SET_SOCKERRNO(EWOULDBLOCK); } diff --git a/deps/curl/lib/optiontable.pl b/deps/curl/lib/optiontable.pl index 511322a3..2727784e 100644 --- a/deps/curl/lib/optiontable.pl +++ b/deps/curl/lib/optiontable.pl @@ -105,7 +105,7 @@ while() { if(/^#define (CURLOPT_[^ ]*) *(CURLOPT_\S*)/) { my ($o, $n)=($1, $2); # skip obsolete ones - if($n !~ /OBSOLETE/) { + if(($n !~ /OBSOLETE/) && ($o !~ /OBSOLETE/)) { $o =~ s/^CURLOPT_//; $n =~ s/^CURLOPT_//; $alias{$o} = $n; diff --git a/deps/curl/lib/parsedate.c b/deps/curl/lib/parsedate.c index 1a7195b1..4d0a221f 100644 --- a/deps/curl/lib/parsedate.c +++ b/deps/curl/lib/parsedate.c @@ -218,7 +218,7 @@ static int checkday(const char *check, size_t len) what = &Curl_wkday[0]; else return -1; /* too short */ - for(i = 0; i<7; i++) { + for(i = 0; i < 7; i++) { size_t ilen = strlen(what[0]); if((ilen == len) && strncasecompare(check, what[0], len)) @@ -235,7 +235,7 @@ static int checkmonth(const char *check, size_t len) if(len != 3) return -1; /* not a month */ - for(i = 0; i<12; i++) { + for(i = 0; i < 12; i++) { if(strncasecompare(check, what[0], 3)) return i; what++; @@ -244,7 +244,7 @@ static int checkmonth(const char *check, size_t len) } /* return the time zone offset between GMT and the input one, in number - of seconds or -1 if the timezone wasn't found/legal */ + of seconds or -1 if the timezone was not found/legal */ static int checktz(const char *check, size_t len) { @@ -253,7 +253,7 @@ static int checktz(const char *check, size_t len) if(len > 4) /* longer than any valid timezone */ return -1; - for(i = 0; i< sizeof(tz)/sizeof(tz[0]); i++) { + for(i = 0; i < sizeof(tz)/sizeof(tz[0]); i++) { size_t ilen = strlen(what->name); if((ilen == len) && strncasecompare(check, what->name, len)) @@ -265,7 +265,7 @@ static int checktz(const char *check, size_t len) static void skip(const char **date) { - /* skip everything that aren't letters or digits */ + /* skip everything that are not letters or digits */ while(**date && !ISALNUM(**date)) (*date)++; } @@ -277,7 +277,7 @@ enum assume { }; /* - * time2epoch: time stamp to seconds since epoch in GMT time zone. Similar to + * time2epoch: time stamp to seconds since epoch in GMT time zone. Similar to * mktime but for GMT only. */ static time_t time2epoch(int sec, int min, int hour, @@ -441,11 +441,11 @@ static int parsedate(const char *date, time_t *output) if((tzoff == -1) && ((end - date) == 4) && (val <= 1400) && - (indate< date) && + (indate < date) && ((date[-1] == '+' || date[-1] == '-'))) { /* four digits and a value less than or equal to 1400 (to take into account all sorts of funny time zone diffs) and it is preceded - with a plus or minus. This is a time zone indication. 1400 is + with a plus or minus. This is a time zone indication. 1400 is picked since +1300 is frequently used and +1400 is mentioned as an edge number in the document "ISO C 200X Proposal: Timezone Functions" at http://david.tribble.com/text/c0xtimezone.html If @@ -456,7 +456,7 @@ static int parsedate(const char *date, time_t *output) /* 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; } if(((end - date) == 8) && @@ -471,7 +471,7 @@ static int parsedate(const char *date, time_t *output) } if(!found && (dignext == DATE_MDAY) && (mdaynum == -1)) { - if((val > 0) && (val<32)) { + if((val > 0) && (val < 32)) { mdaynum = val; found = TRUE; } @@ -521,13 +521,13 @@ static int parsedate(const char *date, time_t *output) #if (SIZEOF_TIME_T < 5) #ifdef HAVE_TIME_T_UNSIGNED - /* an unsigned 32 bit time_t can only hold dates to 2106 */ + /* an unsigned 32-bit time_t can only hold dates to 2106 */ if(yearnum > 2105) { *output = TIME_T_MAX; return PARSEDATE_LATER; } #else - /* a signed 32 bit time_t can only hold dates to the beginning of 2038 */ + /* a signed 32-bit time_t can only hold dates to the beginning of 2038 */ if(yearnum > 2037) { *output = TIME_T_MAX; return PARSEDATE_LATER; @@ -549,7 +549,7 @@ static int parsedate(const char *date, time_t *output) return PARSEDATE_FAIL; /* clearly an illegal date */ /* time2epoch() returns a time_t. time_t is often 32 bits, sometimes even on - architectures that feature 64 bit 'long' but ultimately time_t is the + architectures that feature a 64 bits 'long' but ultimately time_t is the correct data type to use. */ t = time2epoch(secnum, minnum, hournum, mdaynum, monnum, yearnum); diff --git a/deps/curl/lib/pingpong.c b/deps/curl/lib/pingpong.c index 81576c08..bd0d3e3a 100644 --- a/deps/curl/lib/pingpong.c +++ b/deps/curl/lib/pingpong.c @@ -52,8 +52,8 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, { struct connectdata *conn = data->conn; timediff_t timeout_ms; /* in milliseconds */ - timediff_t response_time = (data->set.server_response_timeout)? - data->set.server_response_timeout: pp->response_time; + timediff_t response_time = (data->set.server_response_timeout) ? + data->set.server_response_timeout : pp->response_time; /* if CURLOPT_SERVER_RESPONSE_TIMEOUT is set, use that to determine remaining time, or use pp->response because SERVER_RESPONSE_TIMEOUT is @@ -113,13 +113,13 @@ CURLcode Curl_pp_statemach(struct Curl_easy *data, /* We are receiving and there is data ready in the SSL library */ rc = 1; else - rc = Curl_socket_check(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */ + rc = Curl_socket_check(pp->sendleft ? CURL_SOCKET_BAD : sock, /* reading */ CURL_SOCKET_BAD, - pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */ + pp->sendleft ? sock : CURL_SOCKET_BAD, /* writing */ interval_ms); if(block) { - /* if we didn't wait, we don't have to spend time on this now */ + /* 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 @@ -179,7 +179,7 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data, DEBUGASSERT(pp->sendthis == NULL); if(!conn) - /* can't send without a connection! */ + /* cannot send without a connection! */ return CURLE_SEND_ERROR; Curl_dyn_reset(&pp->sendbuf); @@ -199,7 +199,8 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data, #ifdef HAVE_GSSAPI conn->data_prot = PROT_CMD; #endif - result = Curl_conn_send(data, FIRSTSOCKET, s, write_len, &bytes_written); + result = Curl_conn_send(data, FIRSTSOCKET, s, write_len, FALSE, + &bytes_written); if(result == CURLE_AGAIN) { bytes_written = 0; } @@ -285,94 +286,99 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, { struct connectdata *conn = data->conn; CURLcode result = CURLE_OK; + ssize_t gotbytes; + char buffer[900]; *code = 0; /* 0 for errors or not done */ *size = 0; - if(pp->nfinal) { - /* a previous call left this many bytes in the beginning of the buffer as - that was the final line; now ditch that */ - size_t full = Curl_dyn_len(&pp->recvbuf); - - /* trim off the "final" leading part */ - Curl_dyn_tail(&pp->recvbuf, full - pp->nfinal); - - pp->nfinal = 0; /* now gone */ - } - if(!pp->overflow) { - ssize_t gotbytes = 0; - char buffer[900]; - - result = pingpong_read(data, sockindex, buffer, sizeof(buffer), &gotbytes); - if(result == CURLE_AGAIN) - return CURLE_OK; - - if(result) - return result; - - if(gotbytes <= 0) { - failf(data, "response reading failed (errno: %d)", SOCKERRNO); - return CURLE_RECV_ERROR; - } - - result = Curl_dyn_addn(&pp->recvbuf, buffer, gotbytes); - if(result) - return result; - - data->req.headerbytecount += (unsigned int)gotbytes; - - pp->nread_resp += gotbytes; - } - do { - char *line = Curl_dyn_ptr(&pp->recvbuf); - char *nl = memchr(line, '\n', Curl_dyn_len(&pp->recvbuf)); - if(nl) { - /* a newline is CRLF in pp-talk, so the CR is ignored as - the line isn't really terminated until the LF comes */ - size_t length = nl - line + 1; + gotbytes = 0; + if(pp->nfinal) { + /* a previous call left this many bytes in the beginning of the buffer as + that was the final line; now ditch that */ + size_t full = Curl_dyn_len(&pp->recvbuf); - /* output debug output if that is requested */ -#ifdef HAVE_GSSAPI - if(!conn->sec_complete) -#endif - Curl_debug(data, CURLINFO_HEADER_IN, line, length); + /* trim off the "final" leading part */ + Curl_dyn_tail(&pp->recvbuf, full - pp->nfinal); + + pp->nfinal = 0; /* now gone */ + } + if(!pp->overflow) { + result = pingpong_read(data, sockindex, buffer, sizeof(buffer), + &gotbytes); + if(result == CURLE_AGAIN) + return CURLE_OK; - /* - * Pass all response-lines to the callback function registered for - * "headers". The response lines can be seen as a kind of headers. - */ - result = Curl_client_write(data, CLIENTWRITE_INFO, line, length); if(result) return result; - if(pp->endofresp(data, conn, line, length, code)) { - /* When at "end of response", keep the endofresp line first in the - buffer since it will be accessed outside (by pingpong - parsers). Store the overflow counter to inform about additional - data in this buffer after the endofresp line. */ - pp->nfinal = length; - if(Curl_dyn_len(&pp->recvbuf) > length) - pp->overflow = Curl_dyn_len(&pp->recvbuf) - length; - else - pp->overflow = 0; - *size = pp->nread_resp; /* size of the response */ - pp->nread_resp = 0; /* restart */ - break; + if(gotbytes <= 0) { + failf(data, "response reading failed (errno: %d)", SOCKERRNO); + return CURLE_RECV_ERROR; } - if(Curl_dyn_len(&pp->recvbuf) > length) - /* keep the remaining piece */ - Curl_dyn_tail((&pp->recvbuf), Curl_dyn_len(&pp->recvbuf) - length); - else - Curl_dyn_reset(&pp->recvbuf); - } - else { - /* without a newline, there is no overflow */ - pp->overflow = 0; - break; + + result = Curl_dyn_addn(&pp->recvbuf, buffer, gotbytes); + if(result) + return result; + + data->req.headerbytecount += (unsigned int)gotbytes; + + pp->nread_resp += gotbytes; } - } while(1); /* while there's buffer left to scan */ + do { + char *line = Curl_dyn_ptr(&pp->recvbuf); + char *nl = memchr(line, '\n', Curl_dyn_len(&pp->recvbuf)); + if(nl) { + /* a newline is CRLF in pp-talk, so the CR is ignored as + the line is not really terminated until the LF comes */ + size_t length = nl - line + 1; + + /* output debug output if that is requested */ +#ifdef HAVE_GSSAPI + if(!conn->sec_complete) +#endif + Curl_debug(data, CURLINFO_HEADER_IN, line, length); + + /* + * Pass all response-lines to the callback function registered for + * "headers". The response lines can be seen as a kind of headers. + */ + result = Curl_client_write(data, CLIENTWRITE_INFO, line, length); + if(result) + return result; + + if(pp->endofresp(data, conn, line, length, code)) { + /* When at "end of response", keep the endofresp line first in the + buffer since it will be accessed outside (by pingpong + parsers). Store the overflow counter to inform about additional + data in this buffer after the endofresp line. */ + pp->nfinal = length; + if(Curl_dyn_len(&pp->recvbuf) > length) + pp->overflow = Curl_dyn_len(&pp->recvbuf) - length; + else + pp->overflow = 0; + *size = pp->nread_resp; /* size of the response */ + pp->nread_resp = 0; /* restart */ + gotbytes = 0; /* force break out of outer loop */ + break; + } + if(Curl_dyn_len(&pp->recvbuf) > length) + /* keep the remaining piece */ + Curl_dyn_tail((&pp->recvbuf), Curl_dyn_len(&pp->recvbuf) - length); + else + Curl_dyn_reset(&pp->recvbuf); + } + else { + /* without a newline, there is no overflow */ + pp->overflow = 0; + break; + } + + } while(1); /* while there is buffer left to scan */ + + } while(gotbytes == sizeof(buffer)); pp->pending_resp = FALSE; @@ -394,6 +400,13 @@ int Curl_pp_getsock(struct Curl_easy *data, return GETSOCK_READSOCK(0); } +bool Curl_pp_needs_flush(struct Curl_easy *data, + struct pingpong *pp) +{ + (void)data; + return pp->sendleft > 0; +} + CURLcode Curl_pp_flushsend(struct Curl_easy *data, struct pingpong *pp) { @@ -401,9 +414,12 @@ CURLcode Curl_pp_flushsend(struct Curl_easy *data, size_t written; CURLcode result; + if(!Curl_pp_needs_flush(data, pp)) + return CURLE_OK; + result = Curl_conn_send(data, FIRSTSOCKET, pp->sendthis + pp->sendsize - pp->sendleft, - pp->sendleft, &written); + pp->sendleft, FALSE, &written); if(result == CURLE_AGAIN) { result = CURLE_OK; written = 0; diff --git a/deps/curl/lib/pingpong.h b/deps/curl/lib/pingpong.h index 28172c72..72239ff0 100644 --- a/deps/curl/lib/pingpong.h +++ b/deps/curl/lib/pingpong.h @@ -37,7 +37,7 @@ struct connectdata; typedef enum { PPTRANSFER_BODY, /* yes do transfer a body */ PPTRANSFER_INFO, /* do still go through to get info/headers */ - PPTRANSFER_NONE /* don't get anything and don't get info */ + PPTRANSFER_NONE /* do not get anything and do not get info */ } curl_pp_transfer; /* @@ -83,7 +83,7 @@ struct pingpong { * Curl_pp_statemach() * * called repeatedly until done. Set 'wait' to make it wait a while on the - * socket if there's no traffic. + * socket if there is no traffic. */ CURLcode Curl_pp_statemach(struct Curl_easy *data, struct pingpong *pp, bool block, bool disconnecting); @@ -137,6 +137,8 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, int *code, /* return the server code if done */ size_t *size); /* size of the response */ +bool Curl_pp_needs_flush(struct Curl_easy *data, + struct pingpong *pp); CURLcode Curl_pp_flushsend(struct Curl_easy *data, struct pingpong *pp); diff --git a/deps/curl/lib/pop3.c b/deps/curl/lib/pop3.c index 993b2e1c..db6ec04c 100644 --- a/deps/curl/lib/pop3.c +++ b/deps/curl/lib/pop3.c @@ -83,6 +83,10 @@ #include "curl_memory.h" #include "memdebug.h" +#ifndef ARRAYSIZE +#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) +#endif + /* Local API functions */ static CURLcode pop3_regular_transfer(struct Curl_easy *data, bool *done); static CURLcode pop3_do(struct Curl_easy *data, bool *done); @@ -107,12 +111,17 @@ static CURLcode pop3_continue_auth(struct Curl_easy *data, const char *mech, static CURLcode pop3_cancel_auth(struct Curl_easy *data, const char *mech); static CURLcode pop3_get_message(struct Curl_easy *data, struct bufref *out); +/* This function scans the body after the end-of-body and writes everything + * until the end is found */ +static CURLcode pop3_write(struct Curl_easy *data, + const char *str, size_t nread, bool is_eos); + /* * POP3 protocol handler. */ const struct Curl_handler Curl_handler_pop3 = { - "POP3", /* scheme */ + "pop3", /* scheme */ pop3_setup_connection, /* setup_connection */ pop3_do, /* do_it */ pop3_done, /* done */ @@ -125,7 +134,8 @@ const struct Curl_handler Curl_handler_pop3 = { ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ pop3_disconnect, /* disconnect */ - ZERO_NULL, /* write_resp */ + pop3_write, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_POP3, /* defport */ @@ -141,7 +151,7 @@ const struct Curl_handler Curl_handler_pop3 = { */ const struct Curl_handler Curl_handler_pop3s = { - "POP3S", /* scheme */ + "pop3s", /* scheme */ pop3_setup_connection, /* setup_connection */ pop3_do, /* do_it */ pop3_done, /* done */ @@ -154,7 +164,8 @@ const struct Curl_handler Curl_handler_pop3s = { ZERO_NULL, /* domore_getsock */ ZERO_NULL, /* perform_getsock */ pop3_disconnect, /* disconnect */ - ZERO_NULL, /* write_resp */ + pop3_write, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_POP3S, /* defport */ @@ -192,6 +203,53 @@ static void pop3_to_pop3s(struct connectdata *conn) #define pop3_to_pop3s(x) Curl_nop_stmt #endif +struct pop3_cmd { + const char *name; + unsigned short nlen; + BIT(multiline); /* response is multi-line with last '.' line */ + BIT(multiline_with_args); /* is multi-line when command has args */ +}; + +static const struct pop3_cmd pop3cmds[] = { + { "APOP", 4, FALSE, FALSE }, + { "AUTH", 4, FALSE, FALSE }, + { "CAPA", 4, TRUE, TRUE }, + { "DELE", 4, FALSE, FALSE }, + { "LIST", 4, TRUE, FALSE }, + { "MSG", 3, TRUE, TRUE }, + { "NOOP", 4, FALSE, FALSE }, + { "PASS", 4, FALSE, FALSE }, + { "QUIT", 4, FALSE, FALSE }, + { "RETR", 4, TRUE, TRUE }, + { "RSET", 4, FALSE, FALSE }, + { "STAT", 4, FALSE, FALSE }, + { "STLS", 4, FALSE, FALSE }, + { "TOP", 3, TRUE, TRUE }, + { "UIDL", 4, TRUE, FALSE }, + { "USER", 4, FALSE, FALSE }, + { "UTF8", 4, FALSE, FALSE }, + { "XTND", 4, TRUE, TRUE }, +}; + +/* Return iff a command is defined as "multi-line" (RFC 1939), + * has a response terminated by a last line with a '.'. + */ +static bool pop3_is_multiline(const char *cmdline) +{ + size_t i; + for(i = 0; i < ARRAYSIZE(pop3cmds); ++i) { + if(strncasecompare(pop3cmds[i].name, cmdline, pop3cmds[i].nlen)) { + if(!cmdline[pop3cmds[i].nlen]) + return pop3cmds[i].multiline; + else if(cmdline[pop3cmds[i].nlen] == ' ') + return pop3cmds[i].multiline_with_args; + } + } + /* Unknown command, assume multi-line for backward compatibility with + * earlier curl versions that only could do multi-line responses. */ + return TRUE; +} + /*********************************************************************** * * pop3_endofresp() @@ -404,7 +462,7 @@ static CURLcode pop3_perform_user(struct Curl_easy *data, CURLcode result = CURLE_OK; /* Check we have a username and password to authenticate with and end the - connect phase if we don't */ + connect phase if we do not */ if(!data->state.aptr.user) { pop3_state(data, POP3_STOP); @@ -438,7 +496,7 @@ static CURLcode pop3_perform_apop(struct Curl_easy *data, char secret[2 * MD5_DIGEST_LEN + 1]; /* Check we have a username and password to authenticate with and end the - connect phase if we don't */ + connect phase if we do not */ if(!data->state.aptr.user) { pop3_state(data, POP3_STOP); @@ -446,7 +504,7 @@ static CURLcode pop3_perform_apop(struct Curl_easy *data, } /* Create the digest */ - ctxt = Curl_MD5_init(Curl_DIGEST_MD5); + ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; @@ -548,7 +606,7 @@ static CURLcode pop3_perform_authentication(struct Curl_easy *data, saslprogress progress = SASL_IDLE; /* Check we have enough data to authenticate with and end the - connect phase if we don't */ + connect phase if we do not */ if(!Curl_sasl_can_authenticate(&pop3c->sasl, data)) { pop3_state(data, POP3_STOP); return result; @@ -607,18 +665,20 @@ static CURLcode pop3_perform_command(struct Curl_easy *data) else command = "RETR"; + if(pop3->custom && pop3->custom[0] != '\0') + command = pop3->custom; + /* Send the command */ if(pop3->id[0] != '\0') result = Curl_pp_sendf(data, &conn->proto.pop3c.pp, "%s %s", - (pop3->custom && pop3->custom[0] != '\0' ? - pop3->custom : command), pop3->id); + command, pop3->id); else - result = Curl_pp_sendf(data, &conn->proto.pop3c.pp, "%s", - (pop3->custom && pop3->custom[0] != '\0' ? - pop3->custom : command)); + result = Curl_pp_sendf(data, &conn->proto.pop3c.pp, "%s", command); - if(!result) + if(!result) { pop3_state(data, POP3_COMMAND); + data->req.no_body = !pop3_is_multiline(command); + } return result; } @@ -756,7 +816,7 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code, } } else { - /* Clear text is supported when CAPA isn't recognised */ + /* Clear text is supported when CAPA is not recognised */ if(pop3code != '+') pop3c->authtypes |= POP3_TYPE_CLEARTEXT; @@ -929,12 +989,12 @@ static CURLcode pop3_state_command_resp(struct Curl_easy *data, pop3c->eob = 2; /* But since this initial CR LF pair is not part of the actual body, we set - the strip counter here so that these bytes won't be delivered. */ + the strip counter here so that these bytes will not be delivered. */ pop3c->strip = 2; if(pop3->transfer == PPTRANSFER_BODY) { /* POP3 download */ - Curl_xfer_setup(data, FIRSTSOCKET, -1, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, FALSE); if(pp->overflow) { /* The recv buffer contains data that is actually body content so send @@ -946,8 +1006,8 @@ static CURLcode pop3_state_command_resp(struct Curl_easy *data, pp->nfinal = 0; /* done */ if(!data->req.no_body) { - result = Curl_pop3_write(data, Curl_dyn_ptr(&pp->recvbuf), - Curl_dyn_len(&pp->recvbuf)); + result = pop3_write(data, Curl_dyn_ptr(&pp->recvbuf), + Curl_dyn_len(&pp->recvbuf), FALSE); if(result) return result; } @@ -1059,7 +1119,7 @@ static CURLcode pop3_multi_statemach(struct Curl_easy *data, bool *done) } result = Curl_pp_statemach(data, &pop3c->pp, FALSE, FALSE); - *done = (pop3c->state == POP3_STOP) ? TRUE : FALSE; + *done = (pop3c->state == POP3_STOP); return result; } @@ -1445,12 +1505,13 @@ static CURLcode pop3_parse_custom_request(struct Curl_easy *data) /*********************************************************************** * - * Curl_pop3_write() + * pop3_write() * * This function scans the body after the end-of-body and writes everything * until the end is found. */ -CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread) +static CURLcode pop3_write(struct Curl_easy *data, const char *str, + size_t nread, bool is_eos) { /* This code could be made into a special function in the handler struct */ CURLcode result = CURLE_OK; @@ -1460,6 +1521,7 @@ CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread) bool strip_dot = FALSE; size_t last = 0; size_t i; + (void)is_eos; /* Search through the buffer looking for the end-of-body marker which is 5 bytes (0d 0a 2e 0d 0a). Note that a line starting with a dot matches @@ -1475,7 +1537,7 @@ CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread) pop3c->eob++; if(i) { - /* Write out the body part that didn't match */ + /* Write out the body part that did not match */ result = Curl_client_write(data, CLIENTWRITE_BODY, &str[last], i - last); @@ -1488,7 +1550,7 @@ CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread) else if(pop3c->eob == 3) pop3c->eob++; else - /* If the character match wasn't at position 0 or 3 then restart the + /* If the character match was not at position 0 or 3 then restart the pattern matching */ pop3c->eob = 1; break; @@ -1497,7 +1559,7 @@ CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread) if(pop3c->eob == 1 || pop3c->eob == 4) pop3c->eob++; else - /* If the character match wasn't at position 1 or 4 then start the + /* If the character match was not at position 1 or 4 then start the search again */ pop3c->eob = 0; break; @@ -1511,7 +1573,7 @@ CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread) pop3c->eob = 0; } else - /* If the character match wasn't at position 2 then start the search + /* If the character match was not at position 2 then start the search again */ pop3c->eob = 0; break; diff --git a/deps/curl/lib/pop3.h b/deps/curl/lib/pop3.h index 83f0f831..3d08dafa 100644 --- a/deps/curl/lib/pop3.h +++ b/deps/curl/lib/pop3.h @@ -90,8 +90,4 @@ extern const struct Curl_handler Curl_handler_pop3s; #define POP3_EOB "\x0d\x0a\x2e\x0d\x0a" #define POP3_EOB_LEN 5 -/* This function scans the body after the end-of-body and writes everything - * until the end is found */ -CURLcode Curl_pop3_write(struct Curl_easy *data, char *str, size_t nread); - #endif /* HEADER_CURL_POP3_H */ diff --git a/deps/curl/lib/progress.c b/deps/curl/lib/progress.c index d05fcc3e..d3a1b9ac 100644 --- a/deps/curl/lib/progress.c +++ b/deps/curl/lib/progress.c @@ -48,8 +48,7 @@ static void time2str(char *r, curl_off_t seconds) if(h <= CURL_OFF_T_C(99)) { curl_off_t m = (seconds - (h*CURL_OFF_T_C(3600))) / CURL_OFF_T_C(60); curl_off_t s = (seconds - (h*CURL_OFF_T_C(3600))) - (m*CURL_OFF_T_C(60)); - msnprintf(r, 9, "%2" CURL_FORMAT_CURL_OFF_T ":%02" CURL_FORMAT_CURL_OFF_T - ":%02" CURL_FORMAT_CURL_OFF_T, h, m, s); + msnprintf(r, 9, "%2" FMT_OFF_T ":%02" FMT_OFF_T ":%02" FMT_OFF_T, h, m, s); } else { /* this equals to more than 99 hours, switch to a more suitable output @@ -57,10 +56,9 @@ static void time2str(char *r, curl_off_t seconds) curl_off_t d = seconds / CURL_OFF_T_C(86400); h = (seconds - (d*CURL_OFF_T_C(86400))) / CURL_OFF_T_C(3600); if(d <= CURL_OFF_T_C(999)) - msnprintf(r, 9, "%3" CURL_FORMAT_CURL_OFF_T - "d %02" CURL_FORMAT_CURL_OFF_T "h", d, h); + msnprintf(r, 9, "%3" FMT_OFF_T "d %02" FMT_OFF_T "h", d, h); else - msnprintf(r, 9, "%7" CURL_FORMAT_CURL_OFF_T "d", d); + msnprintf(r, 9, "%7" FMT_OFF_T "d", d); } } @@ -76,40 +74,40 @@ static char *max5data(curl_off_t bytes, char *max5) #define ONE_PETABYTE (CURL_OFF_T_C(1024) * ONE_TERABYTE) if(bytes < CURL_OFF_T_C(100000)) - msnprintf(max5, 6, "%5" CURL_FORMAT_CURL_OFF_T, bytes); + msnprintf(max5, 6, "%5" FMT_OFF_T, bytes); else if(bytes < CURL_OFF_T_C(10000) * ONE_KILOBYTE) - msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "k", bytes/ONE_KILOBYTE); + msnprintf(max5, 6, "%4" FMT_OFF_T "k", bytes/ONE_KILOBYTE); else if(bytes < CURL_OFF_T_C(100) * ONE_MEGABYTE) - /* 'XX.XM' is good as long as we're less than 100 megs */ - msnprintf(max5, 6, "%2" CURL_FORMAT_CURL_OFF_T ".%0" - CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE, + /* 'XX.XM' is good as long as we are less than 100 megs */ + msnprintf(max5, 6, "%2" FMT_OFF_T ".%0" + FMT_OFF_T "M", bytes/ONE_MEGABYTE, (bytes%ONE_MEGABYTE) / (ONE_MEGABYTE/CURL_OFF_T_C(10)) ); else if(bytes < CURL_OFF_T_C(10000) * ONE_MEGABYTE) - /* 'XXXXM' is good until we're at 10000MB or above */ - msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE); + /* 'XXXXM' is good until we are at 10000MB or above */ + msnprintf(max5, 6, "%4" FMT_OFF_T "M", bytes/ONE_MEGABYTE); else if(bytes < CURL_OFF_T_C(100) * ONE_GIGABYTE) /* 10000 MB - 100 GB, we show it as XX.XG */ - msnprintf(max5, 6, "%2" CURL_FORMAT_CURL_OFF_T ".%0" - CURL_FORMAT_CURL_OFF_T "G", bytes/ONE_GIGABYTE, + msnprintf(max5, 6, "%2" FMT_OFF_T ".%0" + FMT_OFF_T "G", bytes/ONE_GIGABYTE, (bytes%ONE_GIGABYTE) / (ONE_GIGABYTE/CURL_OFF_T_C(10)) ); else if(bytes < CURL_OFF_T_C(10000) * ONE_GIGABYTE) /* up to 10000GB, display without decimal: XXXXG */ - msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "G", bytes/ONE_GIGABYTE); + msnprintf(max5, 6, "%4" FMT_OFF_T "G", bytes/ONE_GIGABYTE); else if(bytes < CURL_OFF_T_C(10000) * ONE_TERABYTE) /* up to 10000TB, display without decimal: XXXXT */ - msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "T", bytes/ONE_TERABYTE); + msnprintf(max5, 6, "%4" FMT_OFF_T "T", bytes/ONE_TERABYTE); else /* up to 10000PB, display without decimal: XXXXP */ - msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "P", bytes/ONE_PETABYTE); + msnprintf(max5, 6, "%4" FMT_OFF_T "P", bytes/ONE_PETABYTE); - /* 16384 petabytes (16 exabytes) is the maximum a 64 bit unsigned number can + /* 16384 petabytes (16 exabytes) is the maximum a 64-bit unsigned number can hold, but our data type is signed so 8192PB will be the maximum. */ return max5; @@ -140,7 +138,7 @@ int Curl_pgrsDone(struct Curl_easy *data) if(!(data->progress.flags & PGRS_HIDE) && !data->progress.callback) - /* only output if we don't use a progress callback and we're not + /* only output if we do not use a progress callback and we are not * hidden */ fprintf(data->set.err, "\n"); @@ -176,7 +174,7 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, case TIMER_STARTSINGLE: /* This is set at the start of each single transfer */ data->progress.t_startsingle = timestamp; - data->progress.is_t_startransfer_set = false; + data->progress.is_t_startransfer_set = FALSE; break; case TIMER_POSTQUEUE: /* Set when the transfer starts (after potentially having been brought @@ -204,7 +202,7 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, case TIMER_STARTTRANSFER: delta = &data->progress.t_starttransfer; /* prevent updating t_starttransfer unless: - * 1) this is the first time we're setting t_starttransfer + * 1) this is the first time we are setting t_starttransfer * 2) a redirect has occurred since the last time t_starttransfer was set * This prevents repeated invocations of the function from incorrectly * changing the t_starttransfer time. @@ -213,11 +211,11 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, return; } else { - data->progress.is_t_startransfer_set = true; + data->progress.is_t_startransfer_set = TRUE; break; } case TIMER_POSTRANSFER: - /* this is the normal end-of-transfer thing */ + delta = &data->progress.t_posttransfer; break; case TIMER_REDIRECT: data->progress.t_redirect = Curl_timediff_us(timestamp, @@ -251,13 +249,13 @@ void Curl_pgrsStartNow(struct Curl_easy *data) { data->progress.speeder_c = 0; /* reset the progress meter display */ data->progress.start = Curl_now(); - data->progress.is_t_startransfer_set = false; - data->progress.ul_limit_start = data->progress.start; - data->progress.dl_limit_start = data->progress.start; - data->progress.ul_limit_size = 0; - data->progress.dl_limit_size = 0; - data->progress.downloaded = 0; - data->progress.uploaded = 0; + data->progress.is_t_startransfer_set = FALSE; + data->progress.ul.limit.start = data->progress.start; + data->progress.dl.limit.start = data->progress.start; + data->progress.ul.limit.start_size = 0; + data->progress.dl.limit.start_size = 0; + data->progress.dl.cur_size = 0; + data->progress.ul.cur_size = 0; /* clear all bits except HIDE and HEADERS_OUT */ data->progress.flags &= PGRS_HIDE|PGRS_HEADERS_OUT; Curl_ratelimit(data, data->progress.start); @@ -265,11 +263,11 @@ void Curl_pgrsStartNow(struct Curl_easy *data) /* * This is used to handle speed limits, calculating how many milliseconds to - * wait until we're back under the speed limit, if needed. + * 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 + * 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). * @@ -281,17 +279,15 @@ void Curl_pgrsStartNow(struct Curl_easy *data) * 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(curl_off_t cursize, - curl_off_t startsize, - curl_off_t limit, - struct curltime start, +timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, + curl_off_t speed_limit, struct curltime now) { - curl_off_t size = cursize - startsize; + curl_off_t size = d->cur_size - d->limit.start_size; timediff_t minimum; timediff_t actual; - if(!limit || !size) + if(!speed_limit || !size) return 0; /* @@ -299,9 +295,9 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, * stay below 'limit'. */ if(size < CURL_OFF_T_MAX/1000) - minimum = (timediff_t) (CURL_OFF_T_C(1000) * size / limit); + minimum = (timediff_t) (CURL_OFF_T_C(1000) * size / speed_limit); else { - minimum = (timediff_t) (size / limit); + minimum = (timediff_t) (size / speed_limit); if(minimum < TIMEDIFF_T_MAX/1000) minimum *= 1000; else @@ -312,7 +308,7 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, * 'actual' is the time in milliseconds it took to actually download the * last 'size' bytes. */ - actual = Curl_timediff_ceil(now, start); + actual = Curl_timediff_ceil(now, d->limit.start); if(actual < minimum) { /* if it downloaded the data faster than the limit, make it wait the difference */ @@ -327,7 +323,7 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, */ CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size) { - data->progress.downloaded = size; + data->progress.dl.cur_size = size; return CURLE_OK; } @@ -336,19 +332,19 @@ CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size) */ void Curl_ratelimit(struct Curl_easy *data, struct curltime now) { - /* don't set a new stamp unless the time since last update is long enough */ + /* do not set a new stamp unless the time since last update is long enough */ if(data->set.max_recv_speed) { - if(Curl_timediff(now, data->progress.dl_limit_start) >= + if(Curl_timediff(now, data->progress.dl.limit.start) >= MIN_RATE_LIMIT_PERIOD) { - data->progress.dl_limit_start = now; - data->progress.dl_limit_size = data->progress.downloaded; + data->progress.dl.limit.start = now; + data->progress.dl.limit.start_size = data->progress.dl.cur_size; } } if(data->set.max_send_speed) { - if(Curl_timediff(now, data->progress.ul_limit_start) >= + if(Curl_timediff(now, data->progress.ul.limit.start) >= MIN_RATE_LIMIT_PERIOD) { - data->progress.ul_limit_start = now; - data->progress.ul_limit_size = data->progress.uploaded; + data->progress.ul.limit.start = now; + data->progress.ul.limit.start_size = data->progress.ul.cur_size; } } } @@ -358,17 +354,17 @@ void Curl_ratelimit(struct Curl_easy *data, struct curltime now) */ void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size) { - data->progress.uploaded = size; + data->progress.ul.cur_size = size; } void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size) { if(size >= 0) { - data->progress.size_dl = size; + data->progress.dl.total_size = size; data->progress.flags |= PGRS_DL_SIZE_KNOWN; } else { - data->progress.size_dl = 0; + data->progress.dl.total_size = 0; data->progress.flags &= ~PGRS_DL_SIZE_KNOWN; } } @@ -376,15 +372,20 @@ void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size) void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size) { if(size >= 0) { - data->progress.size_ul = size; + data->progress.ul.total_size = size; data->progress.flags |= PGRS_UL_SIZE_KNOWN; } else { - data->progress.size_ul = 0; + data->progress.ul.total_size = 0; data->progress.flags &= ~PGRS_UL_SIZE_KNOWN; } } +void Curl_pgrsEarlyData(struct Curl_easy *data, curl_off_t sent) +{ + data->progress.earlydata_sent = sent; +} + /* returns the average speed in bytes / second */ static curl_off_t trspeed(curl_off_t size, /* number of bytes */ curl_off_t us) /* microseconds */ @@ -399,7 +400,7 @@ static curl_off_t trspeed(curl_off_t size, /* number of bytes */ return CURL_OFF_T_MAX; } -/* returns TRUE if it's time to show the progress meter */ +/* returns TRUE if it is time to show the progress meter */ static bool progress_calc(struct Curl_easy *data, struct curltime now) { bool timetoshow = FALSE; @@ -407,8 +408,8 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) /* The time spent so far (from the start) in microseconds */ p->timespent = Curl_timediff_us(now, p->start); - p->dlspeed = trspeed(p->downloaded, p->timespent); - p->ulspeed = trspeed(p->uploaded, p->timespent); + 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) { @@ -419,7 +420,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) /* Let's do the "current speed" thing, with the dl + ul speeds combined. Store the speed at entry 'nowindex'. */ - p->speeder[ nowindex ] = p->downloaded + p->uploaded; + p->speeder[ nowindex ] = p->dl.cur_size + p->ul.cur_size; /* remember the exact time for this moment */ p->speeder_time [ nowindex ] = now; @@ -431,10 +432,10 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) /* 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've filled in three entries etc. */ - countindex = ((p->speeder_c >= CURR_TIME)? CURR_TIME:p->speeder_c) - 1; + 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 don't do this if there's no counted seconds yet */ + /* first of all, we do not do this if there is no counted seconds yet */ if(countindex) { int checkindex; timediff_t span_ms; @@ -443,7 +444,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) /* 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; + checkindex = (p->speeder_c >= CURR_TIME) ? p->speeder_c%CURR_TIME : 0; /* Figure out the exact time for the time span */ span_ms = Curl_timediff(now, p->speeder_time[checkindex]); @@ -465,113 +466,107 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) } else /* the first second we use the average */ - p->current_speed = p->ulspeed + p->dlspeed; + p->current_speed = p->ul.speed + p->dl.speed; } /* Calculations end */ return timetoshow; } #ifndef CURL_DISABLE_PROGRESS_METER + +struct pgrs_estimate { + curl_off_t secs; + curl_off_t percent; +}; + +static curl_off_t pgrs_est_percent(curl_off_t total, curl_off_t cur) +{ + if(total > CURL_OFF_T_C(10000)) + return cur / (total/CURL_OFF_T_C(100)); + else if(total > CURL_OFF_T_C(0)) + return (cur*100) / total; + return 0; +} + +static void pgrs_estimates(struct pgrs_dir *d, + bool total_known, + struct pgrs_estimate *est) +{ + est->secs = 0; + est->percent = 0; + if(total_known && (d->speed > CURL_OFF_T_C(0))) { + est->secs = d->total_size / d->speed; + est->percent = pgrs_est_percent(d->total_size, d->cur_size); + } +} + static void progress_meter(struct Curl_easy *data) { + struct Progress *p = &data->progress; char max5[6][10]; - curl_off_t dlpercen = 0; - curl_off_t ulpercen = 0; - curl_off_t total_percen = 0; - curl_off_t total_transfer; - curl_off_t total_expected_transfer; + struct pgrs_estimate dl_estm; + struct pgrs_estimate ul_estm; + struct pgrs_estimate total_estm; + curl_off_t total_cur_size; + curl_off_t total_expected_size; char time_left[10]; char time_total[10]; char time_spent[10]; - curl_off_t ulestimate = 0; - curl_off_t dlestimate = 0; - curl_off_t total_estimate; - curl_off_t timespent = - (curl_off_t)data->progress.timespent/1000000; /* seconds */ + curl_off_t cur_secs = (curl_off_t)p->timespent/1000000; /* seconds */ - if(!(data->progress.flags & PGRS_HEADERS_OUT)) { + if(!(p->flags & PGRS_HEADERS_OUT)) { if(data->state.resume_from) { fprintf(data->set.err, - "** Resuming transfer from byte position %" - CURL_FORMAT_CURL_OFF_T "\n", data->state.resume_from); + "** Resuming transfer from byte position %" FMT_OFF_T "\n", + data->state.resume_from); } fprintf(data->set.err, " %% Total %% Received %% Xferd Average Speed " "Time Time Time Current\n" " Dload Upload " "Total Spent Left Speed\n"); - data->progress.flags |= PGRS_HEADERS_OUT; /* headers are shown */ + p->flags |= PGRS_HEADERS_OUT; /* headers are shown */ } - /* Figure out the estimated time of arrival for the upload */ - if((data->progress.flags & PGRS_UL_SIZE_KNOWN) && - (data->progress.ulspeed > CURL_OFF_T_C(0))) { - ulestimate = data->progress.size_ul / data->progress.ulspeed; - - if(data->progress.size_ul > CURL_OFF_T_C(10000)) - ulpercen = data->progress.uploaded / - (data->progress.size_ul/CURL_OFF_T_C(100)); - else if(data->progress.size_ul > CURL_OFF_T_C(0)) - ulpercen = (data->progress.uploaded*100) / - data->progress.size_ul; - } - - /* ... and the download */ - if((data->progress.flags & PGRS_DL_SIZE_KNOWN) && - (data->progress.dlspeed > CURL_OFF_T_C(0))) { - dlestimate = data->progress.size_dl / data->progress.dlspeed; - - if(data->progress.size_dl > CURL_OFF_T_C(10000)) - dlpercen = data->progress.downloaded / - (data->progress.size_dl/CURL_OFF_T_C(100)); - else if(data->progress.size_dl > CURL_OFF_T_C(0)) - dlpercen = (data->progress.downloaded*100) / - data->progress.size_dl; - } - - /* Now figure out which of them is slower and use that one for the - total estimate! */ - total_estimate = ulestimate>dlestimate?ulestimate:dlestimate; + /* Figure out the estimated time of arrival for upload and download */ + pgrs_estimates(&p->ul, (p->flags & PGRS_UL_SIZE_KNOWN), &ul_estm); + pgrs_estimates(&p->dl, (p->flags & PGRS_DL_SIZE_KNOWN), &dl_estm); + /* Since both happen at the same time, total expected duration is max. */ + total_estm.secs = CURLMAX(ul_estm.secs, dl_estm.secs); /* create the three time strings */ - time2str(time_left, total_estimate > 0?(total_estimate - timespent):0); - time2str(time_total, total_estimate); - time2str(time_spent, timespent); + time2str(time_left, total_estm.secs > 0 ? (total_estm.secs - cur_secs) : 0); + time2str(time_total, total_estm.secs); + time2str(time_spent, cur_secs); /* Get the total amount of data expected to get transferred */ - total_expected_transfer = - ((data->progress.flags & PGRS_UL_SIZE_KNOWN)? - data->progress.size_ul:data->progress.uploaded)+ - ((data->progress.flags & PGRS_DL_SIZE_KNOWN)? - data->progress.size_dl:data->progress.downloaded); + total_expected_size = + ((p->flags & PGRS_UL_SIZE_KNOWN) ? p->ul.total_size : p->ul.cur_size) + + ((p->flags & PGRS_DL_SIZE_KNOWN) ? p->dl.total_size : p->dl.cur_size); /* We have transferred this much so far */ - total_transfer = data->progress.downloaded + data->progress.uploaded; + total_cur_size = p->dl.cur_size + p->ul.cur_size; /* Get the percentage of data transferred so far */ - if(total_expected_transfer > CURL_OFF_T_C(10000)) - total_percen = total_transfer / - (total_expected_transfer/CURL_OFF_T_C(100)); - else if(total_expected_transfer > CURL_OFF_T_C(0)) - total_percen = (total_transfer*100) / total_expected_transfer; + total_estm.percent = pgrs_est_percent(total_expected_size, total_cur_size); fprintf(data->set.err, "\r" - "%3" CURL_FORMAT_CURL_OFF_T " %s " - "%3" CURL_FORMAT_CURL_OFF_T " %s " - "%3" CURL_FORMAT_CURL_OFF_T " %s %s %s %s %s %s %s", - total_percen, /* 3 letters */ /* total % */ - max5data(total_expected_transfer, max5[2]), /* total size */ - dlpercen, /* 3 letters */ /* rcvd % */ - max5data(data->progress.downloaded, max5[0]), /* rcvd size */ - ulpercen, /* 3 letters */ /* xfer % */ - max5data(data->progress.uploaded, max5[1]), /* xfer size */ - max5data(data->progress.dlspeed, max5[3]), /* avrg dl speed */ - max5data(data->progress.ulspeed, max5[4]), /* avrg ul speed */ + "%3" FMT_OFF_T " %s " + "%3" FMT_OFF_T " %s " + "%3" FMT_OFF_T " %s %s %s %s %s %s %s", + total_estm.percent, /* 3 letters */ /* total % */ + max5data(total_expected_size, max5[2]), /* total size */ + dl_estm.percent, /* 3 letters */ /* rcvd % */ + max5data(p->dl.cur_size, max5[0]), /* rcvd size */ + ul_estm.percent, /* 3 letters */ /* xfer % */ + max5data(p->ul.cur_size, max5[1]), /* xfer size */ + max5data(p->dl.speed, max5[3]), /* avrg dl speed */ + max5data(p->ul.speed, max5[4]), /* avrg ul speed */ time_total, /* 8 letters */ /* total time */ time_spent, /* 8 letters */ /* time spent */ time_left, /* 8 letters */ /* time left */ - max5data(data->progress.current_speed, max5[5]) + max5data(p->current_speed, max5[5]) ); /* we flush the output stream to make it appear as soon as possible */ @@ -587,21 +582,19 @@ static void progress_meter(struct Curl_easy *data) * Curl_pgrsUpdate() returns 0 for success or the value returned by the * progress callback! */ -int Curl_pgrsUpdate(struct Curl_easy *data) +static int pgrsupdate(struct Curl_easy *data, bool showprogress) { - struct curltime now = Curl_now(); /* what time is it */ - bool showprogress = progress_calc(data, now); if(!(data->progress.flags & PGRS_HIDE)) { if(data->set.fxferinfo) { int result; - /* There's a callback set, call that */ - Curl_set_in_callback(data, true); + /* There is a callback set, call that */ + Curl_set_in_callback(data, TRUE); result = data->set.fxferinfo(data->set.progress_client, - data->progress.size_dl, - data->progress.downloaded, - data->progress.size_ul, - data->progress.uploaded); - Curl_set_in_callback(data, false); + data->progress.dl.total_size, + data->progress.dl.cur_size, + data->progress.ul.total_size, + data->progress.ul.cur_size); + Curl_set_in_callback(data, FALSE); if(result != CURL_PROGRESSFUNC_CONTINUE) { if(result) failf(data, "Callback aborted"); @@ -611,13 +604,13 @@ int Curl_pgrsUpdate(struct Curl_easy *data) else if(data->set.fprogress) { int result; /* The older deprecated callback is set, call that */ - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); result = data->set.fprogress(data->set.progress_client, - (double)data->progress.size_dl, - (double)data->progress.downloaded, - (double)data->progress.size_ul, - (double)data->progress.uploaded); - Curl_set_in_callback(data, false); + (double)data->progress.dl.total_size, + (double)data->progress.dl.cur_size, + (double)data->progress.ul.total_size, + (double)data->progress.ul.cur_size); + Curl_set_in_callback(data, FALSE); if(result != CURL_PROGRESSFUNC_CONTINUE) { if(result) failf(data, "Callback aborted"); @@ -631,3 +624,19 @@ int Curl_pgrsUpdate(struct Curl_easy *data) return 0; } + +int Curl_pgrsUpdate(struct Curl_easy *data) +{ + struct curltime now = Curl_now(); /* what time is it */ + bool showprogress = progress_calc(data, now); + return pgrsupdate(data, showprogress); +} + +/* + * Update all progress, do not do progress meter/callbacks. + */ +void Curl_pgrsUpdate_nometer(struct Curl_easy *data) +{ + struct curltime now = Curl_now(); /* what time is it */ + (void)progress_calc(data, now); +} diff --git a/deps/curl/lib/progress.h b/deps/curl/lib/progress.h index 73749419..326271ef 100644 --- a/deps/curl/lib/progress.h +++ b/deps/curl/lib/progress.h @@ -54,12 +54,12 @@ CURLcode 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); +void Curl_pgrsUpdate_nometer(struct Curl_easy *data); + void Curl_pgrsResetTransferSizes(struct Curl_easy *data); struct curltime Curl_pgrsTime(struct Curl_easy *data, timerid timer); -timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, - curl_off_t startsize, - curl_off_t limit, - struct curltime start, +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`. @@ -69,6 +69,8 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, struct curltime timestamp); +void Curl_pgrsEarlyData(struct Curl_easy *data, curl_off_t sent); + #define PGRS_HIDE (1<<4) #define PGRS_UL_SIZE_KNOWN (1<<5) #define PGRS_DL_SIZE_KNOWN (1<<6) diff --git a/deps/curl/lib/psl.c b/deps/curl/lib/psl.c index 626a203a..0b88b05b 100644 --- a/deps/curl/lib/psl.c +++ b/deps/curl/lib/psl.c @@ -81,7 +81,7 @@ const psl_ctx_t *Curl_psl_use(struct Curl_easy *easy) psl = psl_latest(NULL); dynamic = psl != NULL; /* Take care of possible time computation overflow. */ - expires = now < TIME_T_MAX - PSL_TTL? now + PSL_TTL: TIME_T_MAX; + expires = now < TIME_T_MAX - PSL_TTL ? now + PSL_TTL : TIME_T_MAX; /* Only get the built-in PSL if we do not already have the "latest". */ if(!psl && !pslcache->dynamic) diff --git a/deps/curl/lib/psl.h b/deps/curl/lib/psl.h index 23cfa921..dd5bee21 100644 --- a/deps/curl/lib/psl.h +++ b/deps/curl/lib/psl.h @@ -27,6 +27,8 @@ #ifdef USE_LIBPSL #include +struct Curl_easy; + #define PSL_TTL (72 * 3600) /* PSL time to live before a refresh. */ struct PslCache { diff --git a/deps/curl/lib/rand.c b/deps/curl/lib/rand.c index c62b1a40..8d55e260 100644 --- a/deps/curl/lib/rand.c +++ b/deps/curl/lib/rand.c @@ -48,7 +48,8 @@ #ifdef _WIN32 -#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 +#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 && \ + !defined(CURL_WINDOWS_UWP) # define HAVE_WIN_BCRYPTGENRANDOM # include # ifdef _MSC_VER @@ -99,94 +100,99 @@ CURLcode Curl_win32_random(unsigned char *entropy, size_t length) } #endif -static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) +#if !defined(USE_SSL) +/* ---- possibly non-cryptographic version following ---- */ +static CURLcode weak_random(struct Curl_easy *data, + unsigned char *entropy, + size_t length) /* always 4, size of int */ { - CURLcode result = CURLE_OK; - static unsigned int randseed; - static bool seeded = FALSE; - -#ifdef CURLDEBUG - char *force_entropy = getenv("CURL_ENTROPY"); - if(force_entropy) { - if(!seeded) { - unsigned int seed = 0; - size_t elen = strlen(force_entropy); - size_t clen = sizeof(seed); - size_t min = elen < clen ? elen : clen; - memcpy((char *)&seed, force_entropy, min); - randseed = ntohl(seed); - seeded = TRUE; - } - else - randseed++; - *rnd = randseed; - return CURLE_OK; - } -#endif - - /* data may be NULL! */ - result = Curl_ssl_random(data, (unsigned char *)rnd, sizeof(*rnd)); - if(result != CURLE_NOT_BUILT_IN) - /* only if there is no random function in the TLS backend do the non crypto - version, otherwise return result */ - return result; - - /* ---- non-cryptographic version following ---- */ + unsigned int r; + DEBUGASSERT(length == sizeof(int)); + /* Trying cryptographically secure functions first */ #ifdef _WIN32 - if(!seeded) { - result = Curl_win32_random((unsigned char *)rnd, sizeof(*rnd)); + (void)data; + { + CURLcode result = Curl_win32_random(entropy, length); if(result != CURLE_NOT_BUILT_IN) return result; } #endif -#if defined(HAVE_ARC4RANDOM) && !defined(USE_OPENSSL) - if(!seeded) { - *rnd = (unsigned int)arc4random(); - return CURLE_OK; - } -#endif - -#if defined(RANDOM_FILE) && !defined(_WIN32) - if(!seeded) { - /* if there's a random file to read a seed from, use it */ - int fd = open(RANDOM_FILE, O_RDONLY); - if(fd > -1) { - /* read random data into the randseed variable */ - ssize_t nread = read(fd, &randseed, sizeof(randseed)); - if(nread == sizeof(randseed)) - seeded = TRUE; - close(fd); - } - } -#endif - - if(!seeded) { - struct curltime now = Curl_now(); - infof(data, "WARNING: using weak random seed"); - randseed += (unsigned int)now.tv_usec + (unsigned int)now.tv_sec; - randseed = randseed * 1103515245 + 12345; - randseed = randseed * 1103515245 + 12345; - randseed = randseed * 1103515245 + 12345; - seeded = TRUE; - } - +#if defined(HAVE_ARC4RANDOM) + (void)data; + r = (unsigned int)arc4random(); + memcpy(entropy, &r, length); +#else + infof(data, "WARNING: using weak random seed"); { - unsigned int r; + static unsigned int randseed; + static bool seeded = FALSE; + unsigned int rnd; + if(!seeded) { + struct curltime now = Curl_now(); + randseed += (unsigned int)now.tv_usec + (unsigned int)now.tv_sec; + randseed = randseed * 1103515245 + 12345; + randseed = randseed * 1103515245 + 12345; + randseed = randseed * 1103515245 + 12345; + seeded = TRUE; + } + /* Return an unsigned 32-bit pseudo-random number. */ r = randseed = randseed * 1103515245 + 12345; - *rnd = (r << 16) | ((r >> 16) & 0xFFFF); + rnd = (r << 16) | ((r >> 16) & 0xFFFF); + memcpy(entropy, &rnd, length); } +#endif return CURLE_OK; } +#endif + +#ifdef USE_SSL +#define _random(x,y,z) Curl_ssl_random(x,y,z) +#else +#define _random(x,y,z) weak_random(x,y,z) +#endif + +static CURLcode randit(struct Curl_easy *data, unsigned int *rnd, + bool env_override) +{ +#ifdef DEBUGBUILD + if(env_override) { + char *force_entropy = getenv("CURL_ENTROPY"); + if(force_entropy) { + static unsigned int randseed; + static bool seeded = FALSE; + + if(!seeded) { + unsigned int seed = 0; + size_t elen = strlen(force_entropy); + size_t clen = sizeof(seed); + size_t min = elen < clen ? elen : clen; + memcpy((char *)&seed, force_entropy, min); + randseed = ntohl(seed); + seeded = TRUE; + } + else + randseed++; + *rnd = randseed; + return CURLE_OK; + } + } +#else + (void)env_override; +#endif + + /* data may be NULL! */ + return _random(data, (unsigned char *)rnd, sizeof(*rnd)); +} /* * Curl_rand() stores 'num' number of random unsigned characters in the buffer * 'rnd' points to. * * If libcurl is built without TLS support or with a TLS backend that lacks a - * proper random API (rustls or mbedTLS), this function will use "weak" + * proper random API (Rustls or mbedTLS), this function will use "weak" * random. * * When built *with* TLS support and a backend that offers strong random, it @@ -197,9 +203,16 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) * */ -CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num) +CURLcode Curl_rand_bytes(struct Curl_easy *data, +#ifdef DEBUGBUILD + bool env_override, +#endif + unsigned char *rnd, size_t num) { CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT; +#ifndef DEBUGBUILD + const bool env_override = FALSE; +#endif DEBUGASSERT(num); @@ -207,7 +220,7 @@ CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num) unsigned int r; size_t left = num < sizeof(unsigned int) ? num : sizeof(unsigned int); - result = randit(data, &r); + result = randit(data, &r, env_override); if(result) return result; @@ -269,7 +282,7 @@ CURLcode Curl_rand_alnum(struct Curl_easy *data, unsigned char *rnd, size_t num) { CURLcode result = CURLE_OK; - const int alnumspace = sizeof(alnum) - 1; + const unsigned int alnumspace = sizeof(alnum) - 1; unsigned int r; DEBUGASSERT(num > 1); @@ -277,12 +290,12 @@ CURLcode Curl_rand_alnum(struct Curl_easy *data, unsigned char *rnd, while(num) { do { - result = randit(data, &r); + result = randit(data, &r, TRUE); if(result) return result; } while(r >= (UINT_MAX - UINT_MAX % alnumspace)); - *rnd++ = alnum[r % alnumspace]; + *rnd++ = (unsigned char)alnum[r % alnumspace]; num--; } *rnd = 0; diff --git a/deps/curl/lib/rand.h b/deps/curl/lib/rand.h index bc05239e..2ba60e72 100644 --- a/deps/curl/lib/rand.h +++ b/deps/curl/lib/rand.h @@ -24,7 +24,17 @@ * ***************************************************************************/ -CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num); +CURLcode Curl_rand_bytes(struct Curl_easy *data, +#ifdef DEBUGBUILD + bool allow_env_override, +#endif + unsigned char *rnd, size_t num); + +#ifdef DEBUGBUILD +#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)) +#endif /* * Curl_rand_hex() fills the 'rnd' buffer with a given 'num' size with random diff --git a/deps/curl/lib/rename.c b/deps/curl/lib/rename.c index 4c886980..8715a430 100644 --- a/deps/curl/lib/rename.c +++ b/deps/curl/lib/rename.c @@ -41,7 +41,7 @@ int Curl_rename(const char *oldpath, const char *newpath) { #ifdef _WIN32 - /* rename() on Windows doesn't overwrite, so we can't use it here. + /* 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. */ const int max_wait_ms = 1000; diff --git a/deps/curl/lib/request.c b/deps/curl/lib/request.c index ed4aa714..310e4eac 100644 --- a/deps/curl/lib/request.c +++ b/deps/curl/lib/request.c @@ -40,18 +40,33 @@ #include "curl_memory.h" #include "memdebug.h" -CURLcode Curl_req_init(struct SingleRequest *req) +void Curl_req_init(struct SingleRequest *req) { memset(req, 0, sizeof(*req)); - return CURLE_OK; } -CURLcode Curl_req_start(struct SingleRequest *req, - struct Curl_easy *data) +CURLcode Curl_req_soft_reset(struct SingleRequest *req, + struct Curl_easy *data) { CURLcode result; - req->start = Curl_now(); + req->done = FALSE; + req->upload_done = FALSE; + req->upload_aborted = FALSE; + req->download_done = FALSE; + req->eos_written = FALSE; + req->eos_read = FALSE; + req->eos_sent = FALSE; + req->ignorebody = FALSE; + req->shutdown = FALSE; + req->bytecount = 0; + req->writebytecount = 0; + req->header = TRUE; /* assume header */ + req->headerline = 0; + req->headerbytecount = 0; + req->allheadercount = 0; + req->deductheadercount = 0; + result = Curl_client_start(data); if(result) return result; @@ -73,6 +88,13 @@ CURLcode Curl_req_start(struct SingleRequest *req, return CURLE_OK; } +CURLcode Curl_req_start(struct SingleRequest *req, + struct Curl_easy *data) +{ + req->start = Curl_now(); + return Curl_req_soft_reset(req, data); +} + static CURLcode req_flush(struct Curl_easy *data); CURLcode Curl_req_done(struct SingleRequest *req, @@ -82,26 +104,26 @@ CURLcode Curl_req_done(struct SingleRequest *req, if(!aborted) (void)req_flush(data); Curl_client_reset(data); +#ifndef CURL_DISABLE_DOH + Curl_doh_close(data); +#endif return CURLE_OK; } -void Curl_req_reset(struct SingleRequest *req, struct Curl_easy *data) +void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data) { struct curltime t0 = {0, 0}; /* This is a bit ugly. `req->p` is a union and we assume we can * free this safely without leaks. */ - Curl_safefree(req->p.http); + Curl_safefree(req->p.ftp); Curl_safefree(req->newurl); Curl_client_reset(data); if(req->sendbuf_init) Curl_bufq_reset(&req->sendbuf); #ifndef CURL_DISABLE_DOH - if(req->doh) { - Curl_close(&req->doh->probe[0].easy); - Curl_close(&req->doh->probe[1].easy); - } + Curl_doh_close(data); #endif /* Can no longer memset() this struct as we need to keep some state */ req->size = -1; @@ -116,11 +138,8 @@ void Curl_req_reset(struct SingleRequest *req, struct Curl_easy *data) req->offset = 0; req->httpcode = 0; req->keepon = 0; - req->start100 = t0; - req->exp100 = EXP100_SEND_DATA; req->upgr101 = UPGR101_INIT; req->timeofdoc = 0; - req->bodywrites = 0; req->location = NULL; req->newurl = NULL; #ifndef CURL_DISABLE_COOKIES @@ -131,6 +150,7 @@ void Curl_req_reset(struct SingleRequest *req, struct Curl_easy *data) req->download_done = FALSE; req->eos_written = FALSE; req->eos_read = FALSE; + req->eos_sent = FALSE; req->upload_done = FALSE; req->upload_aborted = FALSE; req->ignorebody = FALSE; @@ -141,27 +161,24 @@ void Curl_req_reset(struct SingleRequest *req, struct Curl_easy *data) req->getheader = FALSE; req->no_body = data->set.opt_no_body; req->authneg = FALSE; + req->shutdown = FALSE; +#ifdef USE_HYPER + req->bodywritten = FALSE; +#endif } void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data) { /* This is a bit ugly. `req->p` is a union and we assume we can * free this safely without leaks. */ - Curl_safefree(req->p.http); + Curl_safefree(req->p.ftp); Curl_safefree(req->newurl); if(req->sendbuf_init) Curl_bufq_free(&req->sendbuf); Curl_client_cleanup(data); #ifndef CURL_DISABLE_DOH - if(req->doh) { - Curl_close(&req->doh->probe[0].easy); - Curl_close(&req->doh->probe[1].easy); - Curl_dyn_free(&req->doh->probe[0].serverdoh); - Curl_dyn_free(&req->doh->probe[1].serverdoh); - curl_slist_free_all(req->doh->headers); - Curl_safefree(req->doh); - } + Curl_doh_cleanup(data); #endif } @@ -170,22 +187,24 @@ static CURLcode xfer_send(struct Curl_easy *data, size_t hds_len, size_t *pnwritten) { CURLcode result = CURLE_OK; + bool eos = FALSE; *pnwritten = 0; -#ifdef CURLDEBUG + DEBUGASSERT(hds_len <= blen); +#ifdef DEBUGBUILD { /* Allow debug builds to override this logic to force short initial - sends - */ + sends */ + size_t body_len = blen - hds_len; char *p = getenv("CURL_SMALLREQSEND"); if(p) { - size_t altsize = (size_t)strtoul(p, NULL, 10); - if(altsize && altsize < blen) - blen = altsize; + size_t body_small = (size_t)strtoul(p, NULL, 10); + if(body_small && body_small < body_len) + blen = hds_len + body_small; } } #endif - /* Make sure this doesn't send more body bytes than what the max send + /* Make sure this does not send more body bytes than what the max send speed says. The headers do not count to the max speed. */ if(data->set.max_send_speed) { size_t body_bytes = blen - hds_len; @@ -193,16 +212,26 @@ static CURLcode xfer_send(struct Curl_easy *data, blen = hds_len + (size_t)data->set.max_send_speed; } - result = Curl_xfer_send(data, buf, blen, pnwritten); - if(!result && *pnwritten) { - if(hds_len) - Curl_debug(data, CURLINFO_HEADER_OUT, (char *)buf, - CURLMIN(hds_len, *pnwritten)); - if(*pnwritten > hds_len) { - size_t body_len = *pnwritten - hds_len; - Curl_debug(data, CURLINFO_DATA_OUT, (char *)buf + hds_len, body_len); - data->req.writebytecount += body_len; - Curl_pgrsSetUploadCounter(data, data->req.writebytecount); + if(data->req.eos_read && + (Curl_bufq_is_empty(&data->req.sendbuf) || + Curl_bufq_len(&data->req.sendbuf) == blen)) { + DEBUGF(infof(data, "sending last upload chunk of %zu bytes", blen)); + eos = TRUE; + } + result = Curl_xfer_send(data, buf, blen, eos, pnwritten); + if(!result) { + if(eos && (blen == *pnwritten)) + data->req.eos_sent = TRUE; + if(*pnwritten) { + if(hds_len) + Curl_debug(data, CURLINFO_HEADER_OUT, (char *)buf, + CURLMIN(hds_len, *pnwritten)); + if(*pnwritten > hds_len) { + size_t body_len = *pnwritten - hds_len; + Curl_debug(data, CURLINFO_DATA_OUT, (char *)buf + hds_len, body_len); + data->req.writebytecount += body_len; + Curl_pgrsSetUploadCounter(data, data->req.writebytecount); + } } } return result; @@ -223,16 +252,6 @@ static CURLcode req_send_buffer_flush(struct Curl_easy *data) Curl_bufq_skip(&data->req.sendbuf, nwritten); if(hds_len) { data->req.sendbuf_hds_len -= CURLMIN(hds_len, nwritten); - if(!data->req.sendbuf_hds_len) { - /* all request headers sent */ - if(data->req.exp100 == EXP100_SENDING_REQUEST) { - /* We are now waiting for a reply from the server or - * a timeout on our side */ - data->req.exp100 = EXP100_AWAITING_CONTINUE; - data->req.start100 = Curl_now(); - Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT); - } - } } /* leave if we could not send all. Maybe network blocking or * speed limits on transfer */ @@ -242,28 +261,32 @@ static CURLcode req_send_buffer_flush(struct Curl_easy *data) return result; } -static CURLcode req_set_upload_done(struct Curl_easy *data) +CURLcode Curl_req_set_upload_done(struct Curl_easy *data) { DEBUGASSERT(!data->req.upload_done); data->req.upload_done = TRUE; - data->req.keepon &= ~KEEP_SEND; /* we're done sending */ + data->req.keepon &= ~(KEEP_SEND|KEEP_SEND_TIMED); /* we are done sending */ - /* FIXME: http specific stuff, need to go somewhere else */ - data->req.exp100 = EXP100_SEND_DATA; - Curl_expire_done(data, EXPIRE_100_TIMEOUT); + Curl_pgrsTime(data, TIMER_POSTRANSFER); + Curl_creader_done(data, data->req.upload_aborted); if(data->req.upload_aborted) { + Curl_bufq_reset(&data->req.sendbuf); if(data->req.writebytecount) - infof(data, "abort upload after having sent %" CURL_FORMAT_CURL_OFF_T - " bytes", data->req.writebytecount); + infof(data, "abort upload after having sent %" FMT_OFF_T " bytes", + data->req.writebytecount); else infof(data, "abort upload"); } else if(data->req.writebytecount) - infof(data, "upload completely sent off: %" CURL_FORMAT_CURL_OFF_T - " bytes", data->req.writebytecount); - else - infof(data, "We are completely uploaded and fine"); + infof(data, "upload completely sent off: %" FMT_OFF_T " bytes", + data->req.writebytecount); + else if(!data->req.download_done) { + DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf)); + infof(data, Curl_creader_total_length(data) ? + "We are completely uploaded and fine" : + "Request completely sent off"); + } return Curl_xfer_send_close(data); } @@ -280,13 +303,43 @@ static CURLcode req_flush(struct Curl_easy *data) if(result) return result; if(!Curl_bufq_is_empty(&data->req.sendbuf)) { + DEBUGF(infof(data, "Curl_req_flush(len=%zu) -> EAGAIN", + Curl_bufq_len(&data->req.sendbuf))); return CURLE_AGAIN; } } + else if(Curl_xfer_needs_flush(data)) { + DEBUGF(infof(data, "Curl_req_flush(), xfer send_pending")); + return Curl_xfer_flush(data); + } - if(!data->req.upload_done && data->req.eos_read && - Curl_bufq_is_empty(&data->req.sendbuf)) { - return req_set_upload_done(data); + if(data->req.eos_read && !data->req.eos_sent) { + char tmp; + size_t nwritten; + result = xfer_send(data, &tmp, 0, 0, &nwritten); + if(result) + return result; + DEBUGASSERT(data->req.eos_sent); + } + + if(!data->req.upload_done && data->req.eos_read && data->req.eos_sent) { + DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf)); + if(data->req.shutdown) { + bool done; + result = Curl_xfer_send_shutdown(data, &done); + if(result && data->req.shutdown_err_ignore) { + infof(data, "Shutdown send direction error: %d. Broken server? " + "Proceeding as if everything is ok.", result); + result = CURLE_OK; + done = TRUE; + } + + if(result) + return result; + if(!done) + return CURLE_AGAIN; + } + return Curl_req_set_upload_done(data); } return CURLE_OK; } @@ -325,49 +378,72 @@ static CURLcode req_send_buffer_add(struct Curl_easy *data, return CURLE_OK; } -CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf) +CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *req) { CURLcode result; + const char *buf; + size_t blen, nwritten; if(!data || !data->conn) return CURLE_FAILED_INIT; - /* We always buffer and send from there. The reason is that on - * blocking, we can retry using the same memory address. This is - * important for TLS libraries that expect this. - * We *could* optimized for non-TLS transfers, but that would mean - * separate code paths and seems not worth it. */ - result = req_send_buffer_add(data, Curl_dyn_ptr(buf), Curl_dyn_len(buf), - Curl_dyn_len(buf)); - if(result) - return result; + buf = Curl_dyn_ptr(req); + blen = Curl_dyn_len(req); + if(!Curl_creader_total_length(data)) { + /* Request without body. Try to send directly from the buf given. */ + data->req.eos_read = TRUE; + result = xfer_send(data, buf, blen, blen, &nwritten); + if(result) + return result; + buf += nwritten; + blen -= nwritten; + } - return Curl_req_send_more(data); + if(blen) { + /* Either we have a request body, or we could not send the complete + * request in one go. Buffer the remainder and try to add as much + * body bytes as room is left in the buffer. Then flush. */ + result = req_send_buffer_add(data, buf, blen, blen); + if(result) + return result; + + return Curl_req_send_more(data); + } + return CURLE_OK; } #endif /* !USE_HYPER */ +bool Curl_req_sendbuf_empty(struct Curl_easy *data) +{ + return !data->req.sendbuf_init || Curl_bufq_is_empty(&data->req.sendbuf); +} + bool Curl_req_want_send(struct Curl_easy *data) { - return data->req.sendbuf_init && !Curl_bufq_is_empty(&data->req.sendbuf); + /* Not done and + * - KEEP_SEND and not PAUSEd. + * - 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)); } bool Curl_req_done_sending(struct Curl_easy *data) { - if(data->req.upload_done) { - DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf)); - return TRUE; - } - return FALSE; + return data->req.upload_done && !Curl_req_want_send(data); } CURLcode Curl_req_send_more(struct Curl_easy *data) { CURLcode result; - /* Fill our send buffer if more from client can be read and - * we are not in a "expect-100" situation. */ - if(!data->req.eos_read && !Curl_bufq_is_full(&data->req.sendbuf) && - (data->req.exp100 == EXP100_SEND_DATA)) { + /* Fill our send buffer if more from client can be read. */ + if(!data->req.upload_aborted && + !data->req.eos_read && + !(data->req.keepon & KEEP_SEND_PAUSE) && + !Curl_bufq_is_full(&data->req.sendbuf)) { ssize_t nread = Curl_bufq_sipn(&data->req.sendbuf, 0, add_from_client, data, &result); if(nread < 0 && result != CURLE_AGAIN) @@ -377,6 +453,7 @@ CURLcode Curl_req_send_more(struct Curl_easy *data) result = req_flush(data); if(result == CURLE_AGAIN) result = CURLE_OK; + return result; } @@ -385,7 +462,18 @@ 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; - return req_set_upload_done(data); + /* no longer KEEP_SEND and KEEP_SEND_PAUSE */ + data->req.keepon &= ~KEEP_SENDBITS; + return Curl_req_set_upload_done(data); } return CURLE_OK; } + +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); + return Curl_req_abort_sending(data); +} diff --git a/deps/curl/lib/request.h b/deps/curl/lib/request.h index 2298e79d..bb722477 100644 --- a/deps/curl/lib/request.h +++ b/deps/curl/lib/request.h @@ -32,6 +32,9 @@ /* forward declarations */ struct UserDefined; +#ifndef CURL_DISABLE_DOH +struct doh_probes; +#endif enum expect100 { EXP100_SEND_DATA, /* enough waiting, just send the body now */ @@ -51,10 +54,10 @@ enum upgrade101 { /* - * Request specific data in the easy handle (Curl_easy). Previously, + * Request specific data in the easy handle (Curl_easy). Previously, * these members were on the connectdata struct but since a conn struct may * now be shared between different Curl_easys, we store connection-specific - * data here. This struct only keeps stuff that's interesting for *this* + * data here. This struct only keeps stuff that is interesting for *this* * request, as it will be cleared between multiple ones */ struct SingleRequest { @@ -68,7 +71,7 @@ struct SingleRequest { unsigned int headerbytecount; /* received server headers (not CONNECT headers) */ unsigned int allheadercount; /* all received headers (server + CONNECT) */ - unsigned int deductheadercount; /* this amount of bytes doesn't count when + unsigned int deductheadercount; /* this amount of bytes does not count when we check if anything has been transferred at the end of a connection. We use this counter to make only a 100 reply (without @@ -78,11 +81,10 @@ struct SingleRequest { first one */ curl_off_t offset; /* possible resume offset read from the Content-Range: header */ + int httpversion; /* Version in response (09, 10, 11, etc.) */ int httpcode; /* error code from the 'HTTP/1.? XXX' or 'RTSP/1.? XXX' line */ int keepon; - struct curltime start100; /* time stamp to wait for the 100 code from */ - enum expect100 exp100; /* expect 100 continue state */ enum upgrade101 upgr101; /* 101 upgrade state */ /* Client Writer stack, handles transfer- and content-encodings, protocol @@ -94,7 +96,6 @@ struct SingleRequest { struct bufq sendbuf; /* data which needs to be send to the server */ size_t sendbuf_hds_len; /* amount of header bytes in sendbuf */ time_t timeofdoc; - long bodywrites; char *location; /* This points to an allocated version of the Location: header data */ char *newurl; /* Set to the new URL to use when a redirect or a retry is @@ -105,7 +106,6 @@ struct SingleRequest { union { struct FILEPROTO *file; struct FTP *ftp; - struct HTTP *http; struct IMAP *imap; struct ldapreqinfo *ldap; struct MQTT *mqtt; @@ -117,16 +117,20 @@ struct SingleRequest { struct TELNET *telnet; } p; #ifndef CURL_DISABLE_DOH - struct dohdata *doh; /* DoH specific data for this request */ + struct doh_probes *doh; /* DoH specific data for this request */ #endif #ifndef CURL_DISABLE_COOKIES unsigned char setcookies; #endif BIT(header); /* incoming data has HTTP header */ + BIT(done); /* request is done, e.g. no more send/recv should + * happen. This can be TRUE before `upload_done` or + * `download_done` is TRUE. */ BIT(content_range); /* set TRUE if Content-Range: was found */ BIT(download_done); /* set to TRUE when download is complete */ BIT(eos_written); /* iff EOS has been written to client */ BIT(eos_read); /* iff EOS has been read from the client */ + BIT(eos_sent); /* iff EOS has been sent to the server */ BIT(rewind_read); /* iff reader needs rewind at next start */ BIT(upload_done); /* set to TRUE when all request data has been sent */ BIT(upload_aborted); /* set to TRUE when upload was aborted. Will also @@ -135,6 +139,7 @@ struct SingleRequest { BIT(http_bodyless); /* HTTP response status code is between 100 and 199, 204 or 304 */ BIT(chunk); /* if set, this is a chunked transfer-encoding */ + BIT(resp_trailer); /* response carried 'Trailer:' header field */ BIT(ignore_cl); /* ignore content-length */ BIT(upload_chunky); /* set TRUE if we are doing chunked transfer-encoding on upload */ @@ -145,19 +150,31 @@ struct SingleRequest { but it is not the final request in the auth negotiation. */ BIT(sendbuf_init); /* sendbuf is initialized */ + BIT(shutdown); /* request end will shutdown connection */ + BIT(shutdown_err_ignore); /* errors in shutdown will not fail request */ +#ifdef USE_HYPER + BIT(bodywritten); +#endif }; /** * Initialize the state of the request for first use. */ -CURLcode Curl_req_init(struct SingleRequest *req); +void Curl_req_init(struct SingleRequest *req); /** - * The request is about to start. + * The request is about to start. Record time and do a soft reset. */ CURLcode Curl_req_start(struct SingleRequest *req, struct Curl_easy *data); +/** + * The request may continue with a follow up. Reset + * members, but keep start time for overall duration calc. + */ +CURLcode Curl_req_soft_reset(struct SingleRequest *req, + struct Curl_easy *data); + /** * The request is done. If not aborted, make sure that buffers are * flushed to the client. @@ -174,10 +191,10 @@ CURLcode Curl_req_done(struct SingleRequest *req, void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data); /** - * Reset the state of the request for new use, given the - * settings. + * Hard reset the state of the request to virgin state base on + * transfer settings. */ -void Curl_req_reset(struct SingleRequest *req, struct Curl_easy *data); +void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data); #ifndef USE_HYPER /** @@ -209,10 +226,26 @@ CURLcode Curl_req_send_more(struct Curl_easy *data); */ bool Curl_req_want_send(struct Curl_easy *data); +/** + * TRUE iff the request has no buffered bytes yet to send. + */ +bool Curl_req_sendbuf_empty(struct Curl_easy *data); + /** * Stop sending any more request data to the server. * Will clear the send buffer and mark request sending as done. */ CURLcode Curl_req_abort_sending(struct Curl_easy *data); +/** + * Stop sending and receiving any more request data. + * Will abort sending if not done. + */ +CURLcode Curl_req_stop_send_recv(struct Curl_easy *data); + +/** + * Invoked when all request data has been uploaded. + */ +CURLcode Curl_req_set_upload_done(struct Curl_easy *data); + #endif /* HEADER_CURL_REQUEST_H */ diff --git a/deps/curl/lib/rtsp.c b/deps/curl/lib/rtsp.c index a0b978d9..0bd6ad62 100644 --- a/deps/curl/lib/rtsp.c +++ b/deps/curl/lib/rtsp.c @@ -70,8 +70,7 @@ static int rtsp_getsock_do(struct Curl_easy *data, static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, const char *buf, size_t blen, - bool is_eos, - bool *done); + bool is_eos); static CURLcode rtsp_setup_connection(struct Curl_easy *data, struct connectdata *conn); @@ -80,7 +79,7 @@ static unsigned int rtsp_conncheck(struct Curl_easy *data, unsigned int checks_to_perform); /* this returns the socket to wait for in the DO and DOING state for the multi - interface and then we're always _sending_ a request and thus we wait for + interface and then we are always _sending_ a request and thus we wait for the single socket to become writable only */ static int rtsp_getsock_do(struct Curl_easy *data, struct connectdata *conn, curl_socket_t *socks) @@ -94,14 +93,14 @@ static int rtsp_getsock_do(struct Curl_easy *data, struct connectdata *conn, static CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, size_t len); static -CURLcode rtsp_parse_transport(struct Curl_easy *data, char *transport); +CURLcode rtsp_parse_transport(struct Curl_easy *data, const char *transport); /* * RTSP handler interface. */ const struct Curl_handler Curl_handler_rtsp = { - "RTSP", /* scheme */ + "rtsp", /* scheme */ rtsp_setup_connection, /* setup_connection */ rtsp_do, /* do_it */ rtsp_done, /* done */ @@ -115,6 +114,7 @@ const struct Curl_handler Curl_handler_rtsp = { ZERO_NULL, /* perform_getsock */ rtsp_disconnect, /* disconnect */ rtsp_rtp_write_resp, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ rtsp_conncheck, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_RTSP, /* defport */ @@ -261,7 +261,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) * Since all RTSP requests are included here, there is no need to * support custom requests like HTTP. **/ - data->req.no_body = TRUE; /* most requests don't contain a body */ + data->req.no_body = TRUE; /* most requests do not contain a body */ switch(rtspreq) { default: failf(data, "Got invalid RTSP request"); @@ -310,13 +310,15 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) } if(rtspreq == RTSPREQ_RECEIVE) { - Curl_xfer_setup(data, FIRSTSOCKET, -1, TRUE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, -1, TRUE); goto out; } p_session_id = data->set.str[STRING_RTSP_SESSION_ID]; if(!p_session_id && - (rtspreq & ~(RTSPREQ_OPTIONS | RTSPREQ_DESCRIBE | RTSPREQ_SETUP))) { + (rtspreq & ~(Curl_RtspReq)(RTSPREQ_OPTIONS | + RTSPREQ_DESCRIBE | + RTSPREQ_SETUP))) { failf(data, "Refusing to issue an RTSP request [%s] without a session ID.", p_request); result = CURLE_BAD_FUNCTION_ARGUMENT; @@ -357,8 +359,8 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) /* Accept Headers for DESCRIBE requests */ if(rtspreq == RTSPREQ_DESCRIBE) { /* Accept Header */ - p_accept = Curl_checkheaders(data, STRCONST("Accept"))? - NULL:"Accept: application/sdp\r\n"; + p_accept = Curl_checkheaders(data, STRCONST("Accept")) ? + NULL : "Accept: application/sdp\r\n"; /* Accept-Encoding header */ if(!Curl_checkheaders(data, STRCONST("Accept-Encoding")) && @@ -394,7 +396,9 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) if(result) goto out; +#ifndef CURL_DISABLE_PROXY p_proxyuserpwd = data->state.aptr.proxyuserpwd; +#endif p_userpwd = data->state.aptr.userpwd; /* Referrer */ @@ -529,8 +533,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) * actually set a custom Content-Length in the headers */ if(!Curl_checkheaders(data, STRCONST("Content-Length"))) { result = - Curl_dyn_addf(&req_buffer, - "Content-Length: %" CURL_FORMAT_CURL_OFF_T"\r\n", + Curl_dyn_addf(&req_buffer, "Content-Length: %" FMT_OFF_T"\r\n", req_clen); if(result) goto out; @@ -556,8 +559,6 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) goto out; } } - - data->state.expect100header = FALSE; /* RTSP posts are simple/small */ } else if(rtspreq == RTSPREQ_GET_PARAMETER) { /* Check for an empty GET_PARAMETER (heartbeat) request */ @@ -576,7 +577,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) if(result) goto out; - Curl_xfer_setup(data, FIRSTSOCKET, -1, TRUE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SENDRECV, -1, TRUE); /* issue the request */ result = Curl_req_send(data, &req_buffer); @@ -614,7 +615,7 @@ static CURLcode rtp_write_body_junk(struct Curl_easy *data, in_body = (data->req.headerline && !rtspc->in_header) && (data->req.size >= 0) && (data->req.bytecount < data->req.size); - body_remain = in_body? (data->req.size - data->req.bytecount) : 0; + body_remain = in_body ? (data->req.size - data->req.bytecount) : 0; DEBUGASSERT(body_remain >= 0); if(body_remain) { if((curl_off_t)blen > body_remain) @@ -790,8 +791,7 @@ out: static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, const char *buf, size_t blen, - bool is_eos, - bool *done) + bool is_eos) { struct rtsp_conn *rtspc = &(data->conn->proto.rtspc); CURLcode result = CURLE_OK; @@ -799,7 +799,6 @@ static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, if(!data->req.header) rtspc->in_header = FALSE; - *done = FALSE; if(!blen) { goto out; } @@ -807,7 +806,7 @@ static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, DEBUGF(infof(data, "rtsp_rtp_write_resp(len=%zu, in_header=%d, eos=%d)", blen, rtspc->in_header, is_eos)); - /* If header parsing is not onging, extract RTP messages */ + /* If header parsing is not ongoing, extract RTP messages */ if(!rtspc->in_header) { result = rtsp_filter_rtp(data, buf, blen, &consumed); if(result) @@ -823,7 +822,7 @@ static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, /* we want to parse headers, do so */ if(data->req.header && blen) { rtspc->in_header = TRUE; - result = Curl_http_write_resp_hds(data, buf, blen, &consumed, done); + result = Curl_http_write_resp_hds(data, buf, blen, &consumed); if(result) goto out; @@ -849,16 +848,17 @@ static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data, } if(rtspc->state != RTP_PARSE_SKIP) - *done = FALSE; + data->req.done = FALSE; /* we SHOULD have consumed all bytes, unless the response is borked. * In which case we write out the left over bytes, letting the client * writer deal with it (it will report EXCESS and fail the transfer). */ DEBUGF(infof(data, "rtsp_rtp_write_resp(len=%zu, in_header=%d, done=%d " - " rtspc->state=%d, req.size=%" CURL_FORMAT_CURL_OFF_T ")", - blen, rtspc->in_header, *done, rtspc->state, data->req.size)); + " rtspc->state=%d, req.size=%" FMT_OFF_T ")", + blen, rtspc->in_header, data->req.done, rtspc->state, + data->req.size)); if(!result && (is_eos || blen)) { result = Curl_client_write(data, CLIENTWRITE_BODY| - (is_eos? CLIENTWRITE_EOS:0), + (is_eos ? CLIENTWRITE_EOS : 0), (char *)buf, blen); } @@ -898,9 +898,9 @@ CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, size_t len) user_ptr = data->set.out; } - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); wrote = writeit((char *)ptr, 1, len, user_ptr); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(CURL_WRITEFUNC_PAUSE == wrote) { failf(data, "Cannot pause RTP"); @@ -915,12 +915,12 @@ CURLcode rtp_client_write(struct Curl_easy *data, const char *ptr, size_t len) return CURLE_OK; } -CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header) +CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header) { if(checkprefix("CSeq:", header)) { long CSeq = 0; char *endp; - char *p = &header[5]; + const char *p = &header[5]; while(ISBLANK(*p)) p++; CSeq = strtol(p, &endp, 10); @@ -935,8 +935,7 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header) } } else if(checkprefix("Session:", header)) { - char *start; - char *end; + const char *start, *end; size_t idlen; /* Find the first non-space letter */ @@ -952,7 +951,7 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header) /* Find the end of Session ID * * Allow any non whitespace content, up to the field separator or end of - * line. RFC 2326 isn't 100% clear on the session ID and for example + * line. RFC 2326 is not 100% clear on the session ID and for example * gstreamer does url-encoded session ID's not covered by the standard. */ end = start; @@ -991,14 +990,13 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header) } static -CURLcode rtsp_parse_transport(struct Curl_easy *data, char *transport) +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 subsequent data validity checks.*/ /* e.g.: ' RTP/AVP/TCP;unicast;interleaved=5-6' */ - char *start; - char *end; + const char *start, *end; start = transport; while(start && *start) { while(*start && ISBLANK(*start) ) @@ -1007,7 +1005,7 @@ CURLcode rtsp_parse_transport(struct Curl_easy *data, char *transport) if(checkprefix("interleaved=", start)) { long chan1, chan2, chan; char *endp; - char *p = start + 12; + const char *p = start + 12; chan1 = strtol(p, &endp, 10); if(p != endp && chan1 >= 0 && chan1 <= 255) { unsigned char *rtp_channel_mask = data->state.rtp_channel_mask; diff --git a/deps/curl/lib/rtsp.h b/deps/curl/lib/rtsp.h index 237b80f8..41b09503 100644 --- a/deps/curl/lib/rtsp.h +++ b/deps/curl/lib/rtsp.h @@ -31,7 +31,7 @@ extern const struct Curl_handler Curl_handler_rtsp; -CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, char *header); +CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header); #else /* disabled */ @@ -62,16 +62,6 @@ struct rtsp_conn { * RTSP unique setup ***************************************************************************/ struct RTSP { - /* - * http_wrapper MUST be the first element of this structure for the wrap - * logic to work. In this way, we get a cheap polymorphism because - * &(data->state.proto.rtsp) == &(data->state.proto.http) per the C spec - * - * HTTP functions can safely treat this as an HTTP struct, but RTSP aware - * functions can also index into the later elements. - */ - struct HTTP http_wrapper; /* wrap HTTP to do the heavy lifting */ - long CSeq_sent; /* CSeq of this request */ long CSeq_recv; /* CSeq received */ }; diff --git a/deps/curl/lib/select.c b/deps/curl/lib/select.c index d92e745a..c1779ad1 100644 --- a/deps/curl/lib/select.c +++ b/deps/curl/lib/select.c @@ -24,6 +24,10 @@ #include "curl_setup.h" +#if !defined(HAVE_SELECT) && !defined(HAVE_POLL) +#error "We cannot compile without select() or poll() support." +#endif + #include #ifdef HAVE_SYS_SELECT_H @@ -32,10 +36,6 @@ #include #endif -#if !defined(HAVE_SELECT) && !defined(HAVE_POLL_FINE) -#error "We can't compile without select() or poll() support." -#endif - #ifdef MSDOS #include /* delay() */ #endif @@ -47,18 +47,21 @@ #include "select.h" #include "timediff.h" #include "warnless.h" +/* The last 3 #include files should be in this order */ +#include "curl_printf.h" +#include "curl_memory.h" +#include "memdebug.h" /* - * Internal function used for waiting a specific amount of ms - * in Curl_socket_check() and Curl_poll() when no file descriptor - * is provided to wait on, just being used to delay execution. - * WinSock select() and poll() timeout mechanisms need a valid - * socket descriptor in a not null file descriptor set to work. - * Waiting indefinitely with this function is not allowed, a - * zero or negative timeout value will return immediately. - * Timeout resolution, accuracy, as well as maximum supported - * value is system dependent, neither factor is a critical issue - * for the intended use of this function in the library. + * Internal function used for waiting a specific amount of ms in + * Curl_socket_check() and Curl_poll() when no file descriptor is provided to + * wait on, just being used to delay execution. Winsock select() and poll() + * timeout mechanisms need a valid socket descriptor in a not null file + * descriptor set to work. Waiting indefinitely with this function is not + * allowed, a zero or negative timeout value will return immediately. Timeout + * resolution, accuracy, as well as maximum supported value is system + * dependent, neither factor is a critical issue for the intended use of this + * function in the library. * * Return values: * -1 = system call error, or invalid timeout value @@ -81,24 +84,17 @@ int Curl_wait_ms(timediff_t timeout_ms) #if TIMEDIFF_T_MAX >= ULONG_MAX if(timeout_ms >= ULONG_MAX) timeout_ms = ULONG_MAX-1; - /* don't use ULONG_MAX, because that is equal to INFINITE */ + /* do not use ULONG_MAX, because that is equal to INFINITE */ #endif Sleep((ULONG)timeout_ms); #else -#if defined(HAVE_POLL_FINE) - /* prevent overflow, timeout_ms is typecast to int. */ -#if TIMEDIFF_T_MAX > INT_MAX - if(timeout_ms > INT_MAX) - timeout_ms = INT_MAX; -#endif - r = poll(NULL, 0, (int)timeout_ms); -#else + /* avoid using poll() for this since it behaves incorrectly with no sockets + on Apple operating systems */ { struct timeval pending_tv; r = select(0, NULL, NULL, NULL, curlx_mstotv(&pending_tv, timeout_ms)); } -#endif /* HAVE_POLL_FINE */ -#endif /* USE_WINSOCK */ +#endif /* _WIN32 */ if(r) { if((r == -1) && (SOCKERRNO == EINTR)) /* make EINTR from select or poll not a "lethal" error */ @@ -109,12 +105,12 @@ int Curl_wait_ms(timediff_t timeout_ms) return r; } -#ifndef HAVE_POLL_FINE +#ifndef HAVE_POLL /* - * This is a wrapper around select() to aid in Windows compatibility. - * A negative timeout value makes this function wait indefinitely, - * unless no valid file descriptor is given, when this happens the - * negative timeout is ignored and the function times out immediately. + * This is a wrapper around select() to aid in Windows compatibility. A + * negative timeout value makes this function wait indefinitely, unless no + * valid file descriptor is given, when this happens the negative timeout is + * ignored and the function times out immediately. * * Return values: * -1 = system call error or fd >= FD_SETSIZE @@ -131,7 +127,7 @@ static int our_select(curl_socket_t maxfd, /* highest socket number */ struct timeval *ptimeout; #ifdef USE_WINSOCK - /* WinSock select() can't handle zero events. See the comment below. */ + /* Winsock select() cannot handle zero events. See the comment below. */ if((!fds_read || fds_read->fd_count == 0) && (!fds_write || fds_write->fd_count == 0) && (!fds_err || fds_err->fd_count == 0)) { @@ -143,16 +139,16 @@ static int our_select(curl_socket_t maxfd, /* highest socket number */ ptimeout = curlx_mstotv(&pending_tv, timeout_ms); #ifdef USE_WINSOCK - /* WinSock select() must not be called with an fd_set that contains zero - fd flags, or it will return WSAEINVAL. But, it also can't be called + /* Winsock select() must not be called with an fd_set that contains zero + fd flags, or it will return WSAEINVAL. But, it also cannot be called with no fd_sets at all! From the documentation: Any two of the parameters, readfds, writefds, or exceptfds, can be given as null. At least one must be non-null, and any non-null descriptor set must contain at least one handle to a socket. - It is unclear why WinSock doesn't just handle this for us instead of - calling this an error. Luckily, with WinSock, we can _also_ ask how + It is unclear why Winsock does not just handle this for us instead of + calling this an error. Luckily, with Winsock, we can _also_ ask how many bits are set on an fd_set. So, let's just check it beforehand. */ return select((int)maxfd + 1, @@ -168,13 +164,13 @@ static int our_select(curl_socket_t maxfd, /* highest socket number */ /* * Wait for read or write events on a set of file descriptors. It uses poll() - * when a fine poll() is available, in order to avoid limits with FD_SETSIZE, - * otherwise select() is used. An error is returned if select() is being used + * when poll() is available, in order to avoid limits with FD_SETSIZE, + * otherwise select() is used. An error is returned if select() is being used * and a file descriptor is too large for FD_SETSIZE. * - * A negative timeout value makes this function wait indefinitely, - * unless no valid file descriptor is given, when this happens the - * negative timeout is ignored and the function times out immediately. + * A negative timeout value makes this function wait indefinitely, unless no + * valid file descriptor is given, when this happens the negative timeout is + * ignored and the function times out immediately. * * Return values: * -1 = system call error or fd >= FD_SETSIZE @@ -226,7 +222,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ num++; } - r = Curl_poll(pfd, num, timeout_ms); + r = Curl_poll(pfd, (unsigned int)num, timeout_ms); if(r <= 0) return r; @@ -257,8 +253,8 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ } /* - * This is a wrapper around poll(). If poll() does not exist, then - * select() is used instead. An error is returned if select() is + * This is a wrapper around poll(). If poll() does not exist, then + * select() is used instead. An error is returned if select() is * being used and a file descriptor is too large for FD_SETSIZE. * A negative timeout value makes this function wait indefinitely, * unless no valid file descriptor is given, when this happens the @@ -271,7 +267,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ */ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) { -#ifdef HAVE_POLL_FINE +#ifdef HAVE_POLL int pending_ms; #else fd_set fds_read; @@ -301,7 +297,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) when function is called with a zero timeout or a negative timeout value indicating a blocking call should be performed. */ -#ifdef HAVE_POLL_FINE +#ifdef HAVE_POLL /* prevent overflow, timeout_ms is typecast to int. */ #if TIMEDIFF_T_MAX > INT_MAX @@ -331,7 +327,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) ufds[i].revents |= POLLIN|POLLOUT; } -#else /* HAVE_POLL_FINE */ +#else /* HAVE_POLL */ FD_ZERO(&fds_read); FD_ZERO(&fds_write); @@ -357,8 +353,8 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) } /* - Note also that WinSock ignores the first argument, so we don't worry - about the fact that maxfd is computed incorrectly with WinSock (since + Note also that Winsock ignores the first argument, so we do not worry + about the fact that maxfd is computed incorrectly with Winsock (since curl_socket_t is unsigned in such cases and thus -1 is the largest value). */ @@ -397,7 +393,151 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) r++; } -#endif /* HAVE_POLL_FINE */ +#endif /* HAVE_POLL */ return r; } + +void Curl_pollfds_init(struct curl_pollfds *cpfds, + struct pollfd *static_pfds, + unsigned int static_count) +{ + DEBUGASSERT(cpfds); + memset(cpfds, 0, sizeof(*cpfds)); + if(static_pfds && static_count) { + cpfds->pfds = static_pfds; + cpfds->count = static_count; + } +} + +void Curl_pollfds_cleanup(struct curl_pollfds *cpfds) +{ + DEBUGASSERT(cpfds); + if(cpfds->allocated_pfds) { + free(cpfds->pfds); + } + memset(cpfds, 0, sizeof(*cpfds)); +} + +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)); + 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); + cpfds->pfds = new_fds; + cpfds->count = new_count; + cpfds->allocated_pfds = TRUE; + return CURLE_OK; +} + +static CURLcode cpfds_add_sock(struct curl_pollfds *cpfds, + curl_socket_t sock, short events, bool fold) +{ + int i; + + if(fold && cpfds->n <= INT_MAX) { + for(i = (int)cpfds->n - 1; i >= 0; --i) { + if(sock == cpfds->pfds[i].fd) { + cpfds->pfds[i].events |= events; + return CURLE_OK; + } + } + } + /* not folded, add new entry */ + if(cpfds->n >= cpfds->count) { + if(cpfds_increase(cpfds, 100)) + return CURLE_OUT_OF_MEMORY; + } + cpfds->pfds[cpfds->n].fd = sock; + cpfds->pfds[cpfds->n].events = events; + ++cpfds->n; + return CURLE_OK; +} + +CURLcode Curl_pollfds_add_sock(struct curl_pollfds *cpfds, + curl_socket_t sock, short events) +{ + return cpfds_add_sock(cpfds, sock, events, FALSE); +} + +CURLcode Curl_pollfds_add_ps(struct curl_pollfds *cpfds, + struct easy_pollset *ps) +{ + size_t i; + + DEBUGASSERT(cpfds); + DEBUGASSERT(ps); + for(i = 0; i < ps->num; i++) { + short events = 0; + if(ps->actions[i] & CURL_POLL_IN) + events |= POLLIN; + if(ps->actions[i] & CURL_POLL_OUT) + events |= POLLOUT; + if(events) { + if(cpfds_add_sock(cpfds, ps->sockets[i], events, TRUE)) + return CURLE_OUT_OF_MEMORY; + } + } + return CURLE_OK; +} + +void Curl_waitfds_init(struct curl_waitfds *cwfds, + struct curl_waitfd *static_wfds, + unsigned int static_count) +{ + DEBUGASSERT(cwfds); + DEBUGASSERT(static_wfds); + memset(cwfds, 0, sizeof(*cwfds)); + cwfds->wfds = static_wfds; + cwfds->count = static_count; +} + +static CURLcode cwfds_add_sock(struct curl_waitfds *cwfds, + curl_socket_t sock, short events) +{ + int i; + + if(cwfds->n <= INT_MAX) { + for(i = (int)cwfds->n - 1; i >= 0; --i) { + if(sock == cwfds->wfds[i].fd) { + cwfds->wfds[i].events |= events; + return CURLE_OK; + } + } + } + /* not folded, add new entry */ + if(cwfds->n >= cwfds->count) + return CURLE_OUT_OF_MEMORY; + cwfds->wfds[cwfds->n].fd = sock; + cwfds->wfds[cwfds->n].events = events; + ++cwfds->n; + return CURLE_OK; +} + +CURLcode Curl_waitfds_add_ps(struct curl_waitfds *cwfds, + struct easy_pollset *ps) +{ + size_t i; + + DEBUGASSERT(cwfds); + DEBUGASSERT(ps); + for(i = 0; i < ps->num; i++) { + short events = 0; + if(ps->actions[i] & CURL_POLL_IN) + events |= CURL_WAIT_POLLIN; + if(ps->actions[i] & CURL_POLL_OUT) + events |= CURL_WAIT_POLLOUT; + if(events) { + if(cwfds_add_sock(cwfds, ps->sockets[i], events)) + return CURLE_OUT_OF_MEMORY; + } + } + return CURLE_OK; +} diff --git a/deps/curl/lib/select.h b/deps/curl/lib/select.h index 5b1ca23e..f01acbde 100644 --- a/deps/curl/lib/select.h +++ b/deps/curl/lib/select.h @@ -111,4 +111,37 @@ int Curl_wait_ms(timediff_t timeout_ms); } while(0) #endif +struct curl_pollfds { + struct pollfd *pfds; + unsigned int n; + unsigned int count; + BIT(allocated_pfds); +}; + +void Curl_pollfds_init(struct curl_pollfds *cpfds, + struct pollfd *static_pfds, + unsigned int static_count); + +void Curl_pollfds_cleanup(struct curl_pollfds *cpfds); + +CURLcode Curl_pollfds_add_ps(struct curl_pollfds *cpfds, + struct easy_pollset *ps); + +CURLcode Curl_pollfds_add_sock(struct curl_pollfds *cpfds, + curl_socket_t sock, short events); + +struct curl_waitfds { + struct curl_waitfd *wfds; + unsigned int n; + unsigned int count; +}; + +void Curl_waitfds_init(struct curl_waitfds *cwfds, + struct curl_waitfd *static_wfds, + unsigned int static_count); + +CURLcode Curl_waitfds_add_ps(struct curl_waitfds *cwfds, + struct easy_pollset *ps); + + #endif /* HEADER_CURL_SELECT_H */ diff --git a/deps/curl/lib/sendf.c b/deps/curl/lib/sendf.c index 5bec063d..30a35172 100644 --- a/deps/curl/lib/sendf.c +++ b/deps/curl/lib/sendf.c @@ -88,7 +88,10 @@ CURLcode Curl_client_write(struct Curl_easy *data, DEBUGASSERT(data->req.writer_stack); } - return Curl_cwriter_write(data, data->req.writer_stack, type, buf, blen); + result = Curl_cwriter_write(data, data->req.writer_stack, type, buf, blen); + CURL_TRC_WRITE(data, "client_write(type=%x, len=%zu) -> %d", + type, blen, result); + return result; } static void cl_reset_writer(struct Curl_easy *data) @@ -115,7 +118,6 @@ static void cl_reset_reader(struct Curl_easy *data) void Curl_client_cleanup(struct Curl_easy *data) { - DEBUGF(infof(data, "Curl_client_cleanup()")); cl_reset_reader(data); cl_reset_writer(data); @@ -127,10 +129,10 @@ void Curl_client_reset(struct Curl_easy *data) { if(data->req.rewind_read) { /* already requested */ - DEBUGF(infof(data, "Curl_client_reset(), will rewind_read")); + CURL_TRC_READ(data, "client_reset, will rewind reader"); } else { - DEBUGF(infof(data, "Curl_client_reset(), clear readers")); + CURL_TRC_READ(data, "client_reset, clear readers"); cl_reset_reader(data); } cl_reset_writer(data); @@ -145,7 +147,7 @@ CURLcode Curl_client_start(struct Curl_easy *data) struct Curl_creader *r = data->req.reader_stack; CURLcode result = CURLE_OK; - DEBUGF(infof(data, "client start, rewind readers")); + CURL_TRC_READ(data, "client start, rewind readers"); while(r) { result = r->crt->rewind(data, r); if(result) { @@ -171,8 +173,7 @@ void Curl_creader_set_rewind(struct Curl_easy *data, bool enable) data->req.rewind_read = !!enable; } -/* Write data using an unencoding writer stack. "nbytes" is not - allowed to be 0. */ +/* Write data using an unencoding writer stack. */ CURLcode Curl_cwriter_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes) @@ -249,7 +250,10 @@ static CURLcode cw_download_write(struct Curl_easy *data, if(!(type & CLIENTWRITE_BODY)) { if(is_connect && data->set.suppress_connect_headers) return CURLE_OK; - return Curl_cwriter_write(data, writer->next, type, buf, nbytes); + result = Curl_cwriter_write(data, writer->next, type, buf, nbytes); + CURL_TRC_WRITE(data, "download_write header(type=%x, blen=%zu) -> %d", + type, nbytes, result); + return result; } /* Here, we deal with REAL BODY bytes. All filtering and transfer @@ -261,8 +265,8 @@ static CURLcode cw_download_write(struct Curl_easy *data, if(data->req.no_body && nbytes > 0) { /* BODY arrives although we want none, bail out */ streamclose(data->conn, "ignoring body"); - DEBUGF(infof(data, "did not want a BODY, but seeing %zu bytes", - nbytes)); + CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu), " + "did not want a BODY", type, nbytes); data->req.download_done = TRUE; if(data->info.header_size) /* if headers have been received, this is fine */ @@ -285,11 +289,18 @@ static CURLcode cw_download_write(struct Curl_easy *data, if(nwrite == wmax) { data->req.download_done = TRUE; } + + if((type & CLIENTWRITE_EOS) && !data->req.no_body && + (data->req.maxdownload > data->req.bytecount)) { + failf(data, "end of response with %" FMT_OFF_T " bytes missing", + data->req.maxdownload - data->req.bytecount); + return CURLE_PARTIAL_FILE; + } } /* Error on too large filesize is handled below, after writing * the permitted bytes */ - if(data->set.max_filesize) { + if(data->set.max_filesize && !data->req.ignorebody) { size_t wmax = get_max_body_write_len(data, data->set.max_filesize); if(nwrite > wmax) { nwrite = wmax; @@ -298,12 +309,16 @@ static CURLcode cw_download_write(struct Curl_easy *data, if(!data->req.ignorebody && (nwrite || (type & CLIENTWRITE_EOS))) { result = Curl_cwriter_write(data, writer->next, type, buf, nwrite); + CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu) -> %d", + type, nbytes, result); if(result) return result; } /* Update stats, write and report progress */ data->req.bytecount += nwrite; - ++data->req.bodywrites; +#ifdef USE_HYPER + data->req.bodywritten = TRUE; +#endif result = Curl_pgrsSetDownloadCounter(data, data->req.bytecount); if(result) return result; @@ -313,18 +328,17 @@ static CURLcode cw_download_write(struct Curl_easy *data, infof(data, "Excess found writing body:" " excess = %zu" - ", size = %" CURL_FORMAT_CURL_OFF_T - ", maxdownload = %" CURL_FORMAT_CURL_OFF_T - ", bytecount = %" CURL_FORMAT_CURL_OFF_T, + ", size = %" FMT_OFF_T + ", maxdownload = %" FMT_OFF_T + ", bytecount = %" FMT_OFF_T, excess_len, data->req.size, data->req.maxdownload, data->req.bytecount); connclose(data->conn, "excess found in a read"); } } - else if(nwrite < nbytes) { + else if((nwrite < nbytes) && !data->req.ignorebody) { failf(data, "Exceeded the maximum allowed file size " - "(%" CURL_FORMAT_CURL_OFF_T ") with %" - CURL_FORMAT_CURL_OFF_T " bytes", + "(%" FMT_OFF_T ") with %" FMT_OFF_T " bytes", data->set.max_filesize, data->req.bytecount); return CURLE_FILESIZE_EXCEEDED; } @@ -333,7 +347,7 @@ static CURLcode cw_download_write(struct Curl_easy *data, } static const struct Curl_cwtype cw_download = { - "download", + "protocol", NULL, Curl_cwriter_def_init, cw_download_write, @@ -384,7 +398,7 @@ CURLcode Curl_cwriter_create(struct Curl_cwriter **pwriter, result = cwt->do_init(data, writer); out: - *pwriter = result? NULL : writer; + *pwriter = result ? NULL : writer; if(result) free(writer); return result; @@ -499,10 +513,22 @@ void Curl_cwriter_remove_by_name(struct Curl_easy *data, } } +bool Curl_cwriter_is_paused(struct Curl_easy *data) +{ + return Curl_cw_out_is_paused(data); +} + +CURLcode Curl_cwriter_unpause(struct Curl_easy *data) +{ + return Curl_cw_out_unpause(data); +} + CURLcode Curl_creader_read(struct Curl_easy *data, struct Curl_creader *reader, char *buf, size_t blen, size_t *nread, bool *eos) { + *nread = 0; + *eos = FALSE; if(!reader) return CURLE_READ_ERROR; return reader->crt->do_read(data, reader, buf, blen, nread, eos); @@ -549,7 +575,7 @@ bool Curl_creader_def_needs_rewind(struct Curl_easy *data, curl_off_t Curl_creader_def_total_length(struct Curl_easy *data, struct Curl_creader *reader) { - return reader->next? + return reader->next ? reader->next->crt->total_length(data, reader->next) : -1; } @@ -579,6 +605,22 @@ CURLcode Curl_creader_def_unpause(struct Curl_easy *data, return CURLE_OK; } +bool Curl_creader_def_is_paused(struct Curl_easy *data, + struct Curl_creader *reader) +{ + (void)data; + (void)reader; + return FALSE; +} + +void Curl_creader_def_done(struct Curl_easy *data, + struct Curl_creader *reader, int premature) +{ + (void)data; + (void)reader; + (void)premature; +} + struct cr_in_ctx { struct Curl_creader super; curl_read_callback read_cb; @@ -589,6 +631,7 @@ struct cr_in_ctx { BIT(seen_eos); BIT(errored); BIT(has_used_cb); + BIT(is_paused); }; static CURLcode cr_in_init(struct Curl_easy *data, struct Curl_creader *reader) @@ -611,6 +654,8 @@ static CURLcode cr_in_read(struct Curl_easy *data, struct cr_in_ctx *ctx = reader->ctx; size_t nread; + ctx->is_paused = FALSE; + /* Once we have errored, we will return the same error forever */ if(ctx->errored) { *pnread = 0; @@ -632,18 +677,18 @@ static CURLcode cr_in_read(struct Curl_easy *data, } nread = 0; if(ctx->read_cb && blen) { - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); nread = ctx->read_cb(buf, 1, blen, ctx->cb_user_data); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); ctx->has_used_cb = TRUE; } switch(nread) { case 0: if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) { - failf(data, "client read function EOF fail, only " - "only %"CURL_FORMAT_CURL_OFF_T"/%"CURL_FORMAT_CURL_OFF_T - " of needed bytes read", ctx->read_len, ctx->total_len); + failf(data, "client read function EOF fail, " + "only %"FMT_OFF_T"/%"FMT_OFF_T " of needed bytes read", + ctx->read_len, ctx->total_len); return CURLE_READ_ERROR; } *pnread = 0; @@ -662,12 +707,14 @@ static CURLcode cr_in_read(struct Curl_easy *data, case CURL_READFUNC_PAUSE: if(data->conn->handler->flags & PROTOPT_NONETWORK) { /* protocols that work without network cannot be paused. This is - actually only FILE:// just now, and it can't pause since the transfer - isn't done using the "normal" procedure. */ + actually only FILE:// just now, and it cannot pause since the transfer + is not done using the "normal" procedure. */ failf(data, "Read callback asked for PAUSE when not supported"); return CURLE_READ_ERROR; } /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */ + CURL_TRC_READ(data, "cr_in_read, callback returned CURL_READFUNC_PAUSE"); + ctx->is_paused = TRUE; data->req.keepon |= KEEP_SEND_PAUSE; /* mark socket send as paused */ *pnread = 0; *peos = FALSE; @@ -690,9 +737,10 @@ static CURLcode cr_in_read(struct Curl_easy *data, *peos = ctx->seen_eos; break; } - DEBUGF(infof(data, "cr_in_read(len=%zu, total=%"CURL_FORMAT_CURL_OFF_T - ", read=%"CURL_FORMAT_CURL_OFF_T") -> %d, %zu, %d", - blen, ctx->total_len, ctx->read_len, CURLE_OK, *pnread, *peos)); + CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%"FMT_OFF_T + ", read=%"FMT_OFF_T") -> %d, nread=%zu, eos=%d", + blen, ctx->total_len, ctx->read_len, CURLE_OK, + *pnread, *peos); return CURLE_OK; } @@ -724,10 +772,10 @@ static CURLcode cr_in_resume_from(struct Curl_easy *data, if(ctx->read_len) return CURLE_READ_ERROR; - if(data->conn->seek_func) { - Curl_set_in_callback(data, true); - seekerr = data->conn->seek_func(data->conn->seek_client, offset, SEEK_SET); - Curl_set_in_callback(data, false); + if(data->set.seek_func) { + Curl_set_in_callback(data, TRUE); + seekerr = data->set.seek_func(data->set.seek_client, offset, SEEK_SET); + Curl_set_in_callback(data, FALSE); } if(seekerr != CURL_SEEKFUNC_OK) { @@ -737,7 +785,7 @@ static CURLcode cr_in_resume_from(struct Curl_easy *data, failf(data, "Could not seek stream"); return CURLE_READ_ERROR; } - /* when seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ + /* when seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { char scratch[4*1024]; size_t readthisamountnow = @@ -746,17 +794,17 @@ static CURLcode cr_in_resume_from(struct Curl_easy *data, curlx_sotouz(offset - passed); size_t actuallyread; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); actuallyread = ctx->read_cb(scratch, 1, readthisamountnow, ctx->cb_user_data); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); passed += actuallyread; if((actuallyread == 0) || (actuallyread > readthisamountnow)) { /* this checks for greater-than only to make sure that the CURL_READFUNC_ABORT return code still aborts */ - failf(data, "Could only read %" CURL_FORMAT_CURL_OFF_T - " bytes from the input", passed); + failf(data, "Could only read %" FMT_OFF_T " bytes from the input", + passed); return CURLE_READ_ERROR; } } while(passed < offset); @@ -771,7 +819,7 @@ static CURLcode cr_in_resume_from(struct Curl_easy *data, return CURLE_PARTIAL_FILE; } } - /* we've passed, proceed as normal */ + /* we have passed, proceed as normal */ return CURLE_OK; } @@ -787,10 +835,10 @@ static CURLcode cr_in_rewind(struct Curl_easy *data, if(data->set.seek_func) { int err; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); err = (data->set.seek_func)(data->set.seek_client, 0, SEEK_SET); - Curl_set_in_callback(data, false); - DEBUGF(infof(data, "cr_in, rewind via set.seek_func -> %d", err)); + Curl_set_in_callback(data, FALSE); + CURL_TRC_READ(data, "cr_in, rewind via set.seek_func -> %d", err); if(err) { failf(data, "seek callback returned error %d", (int)err); return CURLE_SEND_FAIL_REWIND; @@ -799,11 +847,11 @@ static CURLcode cr_in_rewind(struct Curl_easy *data, else if(data->set.ioctl_func) { curlioerr err; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); err = (data->set.ioctl_func)(data, CURLIOCMD_RESTARTREAD, data->set.ioctl_client); - Curl_set_in_callback(data, false); - DEBUGF(infof(data, "cr_in, rewind via set.ioctl_func -> %d", (int)err)); + Curl_set_in_callback(data, FALSE); + CURL_TRC_READ(data, "cr_in, rewind via set.ioctl_func -> %d", (int)err); if(err) { failf(data, "ioctl callback returned error %d", (int)err); return CURLE_SEND_FAIL_REWIND; @@ -815,20 +863,36 @@ static CURLcode cr_in_rewind(struct Curl_easy *data, ourselves with fseek() */ if(data->state.fread_func == (curl_read_callback)fread) { int err = fseek(data->state.in, 0, SEEK_SET); - DEBUGF(infof(data, "cr_in, rewind via fseek -> %d(%d)", - (int)err, (int)errno)); + CURL_TRC_READ(data, "cr_in, rewind via fseek -> %d(%d)", + (int)err, (int)errno); if(-1 != err) /* successful rewind */ return CURLE_OK; } /* no callback set or failure above, makes us fail at once */ - failf(data, "necessary data rewind wasn't possible"); + failf(data, "necessary data rewind was not possible"); return CURLE_SEND_FAIL_REWIND; } return CURLE_OK; } +static CURLcode cr_in_unpause(struct Curl_easy *data, + struct Curl_creader *reader) +{ + struct cr_in_ctx *ctx = reader->ctx; + (void)data; + ctx->is_paused = FALSE; + return CURLE_OK; +} + +static bool cr_in_is_paused(struct Curl_easy *data, + struct Curl_creader *reader) +{ + struct cr_in_ctx *ctx = reader->ctx; + (void)data; + return ctx->is_paused; +} static const struct Curl_crtype cr_in = { "cr-in", @@ -839,7 +903,9 @@ static const struct Curl_crtype cr_in = { cr_in_total_length, cr_in_resume_from, cr_in_rewind, - Curl_creader_def_unpause, + cr_in_unpause, + cr_in_is_paused, + Curl_creader_def_done, sizeof(struct cr_in_ctx) }; @@ -864,7 +930,7 @@ CURLcode Curl_creader_create(struct Curl_creader **preader, result = crt->do_init(data, reader); out: - *preader = result? NULL : reader; + *preader = result ? NULL : reader; if(result) free(reader); return result; @@ -883,6 +949,7 @@ struct cr_lc_ctx { struct bufq buf; BIT(read_eos); /* we read an EOS from the next reader */ BIT(eos); /* we have returned an EOS */ + BIT(prev_cr); /* the last byte was a CR */ }; static CURLcode cr_lc_init(struct Curl_easy *data, struct Curl_creader *reader) @@ -936,13 +1003,18 @@ static CURLcode cr_lc_read(struct Curl_easy *data, ctx->eos = TRUE; *pnread = nread; *peos = ctx->eos; - return CURLE_OK; + goto out; } - /* at least one \n needs conversion to '\r\n', place into ctx->buf */ + /* at least one \n might need conversion to '\r\n', place into ctx->buf */ for(i = start = 0; i < nread; ++i) { - if(buf[i] != '\n') + /* if this byte is not an LF character, or if the preceding character is + a CR (meaning this already is a CRLF pair), go to next */ + if((buf[i] != '\n') || ctx->prev_cr) { + ctx->prev_cr = (buf[i] == '\r'); continue; + } + ctx->prev_cr = FALSE; /* on a soft limit bufq, we do not need to check length */ result = Curl_bufq_cwrite(&ctx->buf, buf + start, i - start, &n); if(!result) @@ -951,13 +1023,19 @@ static CURLcode cr_lc_read(struct Curl_easy *data, return result; start = i + 1; if(!data->set.crlf && (data->state.infilesize != -1)) { - /* we're here only because FTP is in ASCII mode... + /* we are here only because FTP is in ASCII mode... bump infilesize for the LF we just added */ data->state.infilesize++; /* comment: this might work for FTP, but in HTTP we could not change * the content length after having started the request... */ } } + + if(start < i) { /* leftover */ + result = Curl_bufq_cwrite(&ctx->buf, buf + start, i - start, &n); + if(result) + return result; + } } DEBUGASSERT(!Curl_bufq_is_empty(&ctx->buf)); @@ -968,6 +1046,10 @@ static CURLcode cr_lc_read(struct Curl_easy *data, ctx->eos = TRUE; *peos = TRUE; } + +out: + CURL_TRC_READ(data, "cr_lc_read(len=%zu) -> %d, nread=%zu, eos=%d", + blen, result, *pnread, *peos); return result; } @@ -990,6 +1072,8 @@ static const struct Curl_crtype cr_lc = { Curl_creader_def_resume_from, Curl_creader_def_rewind, Curl_creader_def_unpause, + Curl_creader_def_is_paused, + Curl_creader_def_done, sizeof(struct cr_lc_ctx) }; @@ -1024,7 +1108,7 @@ static CURLcode do_init_reader_stack(struct Curl_easy *data, /* if we do not have 0 length init, and crlf conversion is wanted, * add the reader for it */ if(clen && (data->set.crlf -#ifdef CURL_DO_LINEEND_CONV +#ifdef CURL_PREFER_LF_LINEENDS || data->state.prefer_ascii #endif )) { @@ -1044,12 +1128,16 @@ CURLcode Curl_creader_set_fread(struct Curl_easy *data, curl_off_t len) result = Curl_creader_create(&r, data, &cr_in, CURL_CR_CLIENT); if(result) - return result; + goto out; ctx = r->ctx; ctx->total_len = len; cl_reset_reader(data); - return do_init_reader_stack(data, r); + result = do_init_reader_stack(data, r); +out: + CURL_TRC_READ(data, "add fread reader, len=%"FMT_OFF_T " -> %d", + len, result); + return result; } CURLcode Curl_creader_add(struct Curl_easy *data, @@ -1107,6 +1195,8 @@ CURLcode Curl_client_read(struct Curl_easy *data, char *buf, size_t blen, result = Curl_creader_read(data, data->req.reader_stack, buf, blen, nread, eos); + CURL_TRC_READ(data, "client_read(len=%zu) -> %d, nread=%zu, eos=%d", + blen, result, *nread, *eos); return result; } @@ -1114,8 +1204,10 @@ bool Curl_creader_needs_rewind(struct Curl_easy *data) { struct Curl_creader *reader = data->req.reader_stack; while(reader) { - if(reader->crt->needs_rewind(data, reader)) + if(reader->crt->needs_rewind(data, reader)) { + CURL_TRC_READ(data, "client reader needs rewind before next request"); return TRUE; + } reader = reader->next; } return FALSE; @@ -1154,6 +1246,8 @@ static const struct Curl_crtype cr_null = { Curl_creader_def_resume_from, Curl_creader_def_rewind, Curl_creader_def_unpause, + Curl_creader_def_is_paused, + Curl_creader_def_done, sizeof(struct Curl_creader) }; @@ -1198,6 +1292,8 @@ static CURLcode cr_buf_read(struct Curl_easy *data, ctx->index += nread; *peos = (ctx->index == ctx->blen); } + CURL_TRC_READ(data, "cr_buf_read(len=%zu) -> 0, nread=%zu, eos=%d", + blen, *pnread, *peos); return CURLE_OK; } @@ -1250,6 +1346,8 @@ static const struct Curl_crtype cr_buf = { cr_buf_resume_from, Curl_creader_def_rewind, Curl_creader_def_unpause, + Curl_creader_def_is_paused, + Curl_creader_def_done, sizeof(struct cr_buf_ctx) }; @@ -1262,20 +1360,23 @@ CURLcode Curl_creader_set_buf(struct Curl_easy *data, result = Curl_creader_create(&r, data, &cr_buf, CURL_CR_CLIENT); if(result) - return result; + goto out; ctx = r->ctx; ctx->buf = buf; ctx->blen = blen; ctx->index = 0; cl_reset_reader(data); - return do_init_reader_stack(data, r); + result = do_init_reader_stack(data, r); +out: + CURL_TRC_READ(data, "add buf reader, len=%zu -> %d", blen, result); + return result; } curl_off_t Curl_creader_total_length(struct Curl_easy *data) { struct Curl_creader *r = data->req.reader_stack; - return r? r->crt->total_length(data, r) : -1; + return r ? r->crt->total_length(data, r) : -1; } curl_off_t Curl_creader_client_length(struct Curl_easy *data) @@ -1283,7 +1384,7 @@ curl_off_t Curl_creader_client_length(struct Curl_easy *data) struct Curl_creader *r = data->req.reader_stack; while(r && r->phase != CURL_CR_CLIENT) r = r->next; - return r? r->crt->total_length(data, r) : -1; + return r ? r->crt->total_length(data, r) : -1; } CURLcode Curl_creader_resume_from(struct Curl_easy *data, curl_off_t offset) @@ -1291,7 +1392,7 @@ CURLcode Curl_creader_resume_from(struct Curl_easy *data, curl_off_t offset) struct Curl_creader *r = data->req.reader_stack; while(r && r->phase != CURL_CR_CLIENT) r = r->next; - return r? r->crt->resume_from(data, r, offset) : CURLE_READ_ERROR; + return r ? r->crt->resume_from(data, r, offset) : CURLE_READ_ERROR; } CURLcode Curl_creader_unpause(struct Curl_easy *data) @@ -1307,3 +1408,36 @@ CURLcode Curl_creader_unpause(struct Curl_easy *data) } return result; } + +bool Curl_creader_is_paused(struct Curl_easy *data) +{ + struct Curl_creader *reader = data->req.reader_stack; + + while(reader) { + if(reader->crt->is_paused(data, reader)) + return TRUE; + reader = reader->next; + } + return FALSE; +} + +void Curl_creader_done(struct Curl_easy *data, int premature) +{ + struct Curl_creader *reader = data->req.reader_stack; + while(reader) { + reader->crt->done(data, reader, premature); + reader = reader->next; + } +} + +struct Curl_creader *Curl_creader_get_by_type(struct Curl_easy *data, + const struct Curl_crtype *crt) +{ + struct Curl_creader *r; + for(r = data->req.reader_stack; r; r = r->next) { + if(r->crt == crt) + return r; + } + return NULL; + +} diff --git a/deps/curl/lib/sendf.h b/deps/curl/lib/sendf.h index 1bcbb3fd..dc1b82ed 100644 --- a/deps/curl/lib/sendf.h +++ b/deps/curl/lib/sendf.h @@ -180,6 +180,16 @@ CURLcode Curl_cwriter_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes); +/** + * Return TRUE iff client writer is paused. + */ +bool Curl_cwriter_is_paused(struct Curl_easy *data); + +/** + * Unpause client writer and flush any buffered date to the client. + */ +CURLcode Curl_cwriter_unpause(struct Curl_easy *data); + /** * Default implementations for do_init, do_write, do_close that * do nothing and pass the data through. @@ -208,6 +218,9 @@ struct Curl_crtype { struct Curl_creader *reader, curl_off_t offset); CURLcode (*rewind)(struct Curl_easy *data, struct Curl_creader *reader); CURLcode (*unpause)(struct Curl_easy *data, struct Curl_creader *reader); + bool (*is_paused)(struct Curl_easy *data, struct Curl_creader *reader); + void (*done)(struct Curl_easy *data, + struct Curl_creader *reader, int premature); size_t creader_size; /* sizeof() allocated struct Curl_creader */ }; @@ -256,6 +269,10 @@ CURLcode Curl_creader_def_rewind(struct Curl_easy *data, struct Curl_creader *reader); CURLcode Curl_creader_def_unpause(struct Curl_easy *data, struct Curl_creader *reader); +bool Curl_creader_def_is_paused(struct Curl_easy *data, + struct Curl_creader *reader); +void Curl_creader_def_done(struct Curl_easy *data, + struct Curl_creader *reader, int premature); /** * Convenience method for calling `reader->do_read()` that @@ -298,7 +315,7 @@ CURLcode Curl_creader_set(struct Curl_easy *data, struct Curl_creader *r); /** * Read at most `blen` bytes at `buf` from the client. - * @param date the transfer to read client bytes for + * @param data the transfer to read client bytes for * @param buf the memory location to read to * @param blen the amount of memory at `buf` * @param nread on return the number of bytes read into `buf` @@ -346,8 +363,8 @@ curl_off_t Curl_creader_client_length(struct Curl_easy *data); * Ask the installed reader at phase CURL_CR_CLIENT to start * reading from the given offset. On success, this will reduce * the `total_length()` by the amount. - * @param date the transfer to read client bytes for - * param offset the offset where to start reads from, negative + * @param data the transfer to read client bytes for + * @param offset the offset where to start reads from, negative * values will be ignored. * @return CURLE_OK if offset could be set * CURLE_READ_ERROR if not supported by reader or seek/read failed @@ -361,6 +378,24 @@ CURLcode Curl_creader_resume_from(struct Curl_easy *data, curl_off_t offset); */ CURLcode Curl_creader_unpause(struct Curl_easy *data); +/** + * Return TRUE iff any of the installed readers is paused. + */ +bool Curl_creader_is_paused(struct Curl_easy *data); + +/** + * Tell all client readers that they are done. + */ +void Curl_creader_done(struct Curl_easy *data, int premature); + +/** + * Look up an installed client reader on `data` by its type. + * @return first reader with that type or NULL + */ +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/deps/curl/lib/setopt.c b/deps/curl/lib/setopt.c index 8a5a5d7c..4f069721 100644 --- a/deps/curl/lib/setopt.c +++ b/deps/curl/lib/setopt.c @@ -52,6 +52,8 @@ #include "hsts.h" #include "tftp.h" #include "strdup.h" +#include "escape.h" + /* The last 3 #include files should be in this order */ #include "curl_printf.h" #include "curl_memory.h" @@ -109,49 +111,66 @@ CURLcode Curl_setblobopt(struct curl_blob **blobp, static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp) { - CURLcode result = CURLE_OK; char *user = NULL; char *passwd = NULL; + DEBUGASSERT(userp); + DEBUGASSERT(passwdp); + /* Parse the login details if specified. It not then we treat NULL as a hint to clear the existing data */ if(option) { size_t len = strlen(option); + CURLcode result; if(len > CURL_MAX_INPUT_LENGTH) return CURLE_BAD_FUNCTION_ARGUMENT; - result = Curl_parse_login_details(option, len, - (userp ? &user : NULL), - (passwdp ? &passwd : NULL), - NULL); + result = Curl_parse_login_details(option, len, &user, &passwd, NULL); + if(result) + return result; } - if(!result) { - /* Store the username part of option if required */ - if(userp) { - if(!user && option && option[0] == ':') { - /* Allocate an empty string instead of returning NULL as user name */ - user = strdup(""); - if(!user) - result = CURLE_OUT_OF_MEMORY; - } + free(*userp); + *userp = user; - Curl_safefree(*userp); - *userp = user; - } + free(*passwdp); + *passwdp = passwd; - /* Store the password part of option if required */ - if(passwdp) { - Curl_safefree(*passwdp); - *passwdp = passwd; - } + return CURLE_OK; +} + +static CURLcode setstropt_interface(char *option, char **devp, + char **ifacep, char **hostp) +{ + char *dev = NULL; + char *iface = NULL; + char *host = NULL; + CURLcode result; + + DEBUGASSERT(devp); + DEBUGASSERT(ifacep); + DEBUGASSERT(hostp); + + if(option) { + /* Parse the interface details if set, otherwise clear them all */ + result = Curl_parse_interface(option, &dev, &iface, &host); + if(result) + return result; } + free(*devp); + *devp = dev; - return result; + free(*ifacep); + *ifacep = iface; + + free(*hostp); + *hostp = host; + + return CURLE_OK; } #define C_SSLVERSION_VALUE(x) (x & 0xffff) -#define C_SSLVERSION_MAX_VALUE(x) (x & 0xffff0000) +#define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)x & 0xffff0000) static CURLcode protocol2num(const char *str, curl_prot_t *val) { @@ -174,7 +193,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); @@ -191,21 +210,58 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val) return CURLE_OK; } -/* - * Do not make Curl_vsetopt() static: it is called from - * packages/OS400/ccsidcurl.c. - */ -CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) +static CURLcode httpauth(struct Curl_easy *data, bool proxy, + unsigned long auth) { - char *argptr; - CURLcode result = CURLE_OK; - long arg; - unsigned long uarg; - curl_off_t bigsize; + if(auth != CURLAUTH_NONE) { + int bitcheck = 0; + bool authbits = FALSE; + /* the DIGEST_IE bit is only used to set a special marker, for all the + rest we need to handle it as normal DIGEST */ + bool iestyle = !!(auth & CURLAUTH_DIGEST_IE); + if(proxy) + data->state.authproxy.iestyle = iestyle; + else + data->state.authhost.iestyle = iestyle; + if(auth & CURLAUTH_DIGEST_IE) { + auth |= CURLAUTH_DIGEST; /* set standard digest bit */ + auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */ + } + + /* switch off bits we cannot support */ +#ifndef USE_NTLM + auth &= ~CURLAUTH_NTLM; /* no NTLM support */ +#endif +#ifndef USE_SPNEGO + auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without GSS-API + or SSPI */ +#endif + + /* check if any auth bit lower than CURLAUTH_ONLY is still set */ + while(bitcheck < 31) { + if(auth & (1UL << bitcheck++)) { + authbits = TRUE; + break; + } + } + if(!authbits) + return CURLE_NOT_BUILT_IN; /* no supported types left! */ + } + if(proxy) + data->set.proxyauth = auth; + else + data->set.httpauth = auth; + return CURLE_OK; +} + +static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, + long arg) +{ + bool enabled = (0 != arg); + unsigned long uarg = (unsigned long)arg; switch(option) { case CURLOPT_DNS_CACHE_TIMEOUT: - arg = va_arg(param, long); if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; else if(arg > INT_MAX) @@ -214,95 +270,58 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) data->set.dns_cache_timeout = (int)arg; break; case CURLOPT_CA_CACHE_TIMEOUT: - arg = va_arg(param, long); - if(arg < -1) - return CURLE_BAD_FUNCTION_ARGUMENT; - else if(arg > INT_MAX) - arg = INT_MAX; + if(Curl_ssl_supports(data, SSLSUPP_CA_CACHE)) { + if(arg < -1) + return CURLE_BAD_FUNCTION_ARGUMENT; + else if(arg > INT_MAX) + arg = INT_MAX; - data->set.general_ssl.ca_cache_timeout = (int)arg; - break; - case CURLOPT_DNS_USE_GLOBAL_CACHE: - /* deprecated */ - break; - case CURLOPT_SSL_CIPHER_LIST: - /* set a list of cipher we want to use in the SSL connection */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSL_CIPHER_LIST: - /* set a list of cipher we want to use in the SSL connection for proxy */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_TLS13_CIPHERS: - if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) { - /* set preferred list of TLS 1.3 cipher suites */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CIPHER13_LIST], - va_arg(param, char *)); + data->set.general_ssl.ca_cache_timeout = (int)arg; } else return CURLE_NOT_BUILT_IN; break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_TLS13_CIPHERS: - if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) { - /* set preferred list of TLS 1.3 cipher suites for proxy */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CIPHER13_LIST_PROXY], - va_arg(param, char *)); - } - else - return CURLE_NOT_BUILT_IN; - break; -#endif - case CURLOPT_RANDOM_FILE: - break; - case CURLOPT_EGDSOCKET: - break; case CURLOPT_MAXCONNECTS: /* * Set the absolute number of maximum simultaneous alive connection that * libcurl is allowed to have. */ - uarg = va_arg(param, unsigned long); if(uarg > UINT_MAX) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.maxconnects = (unsigned int)uarg; break; - case CURLOPT_FORBID_REUSE: + case CURLOPT_FORBID_REUSE: /* * When this transfer is done, it must not be left to be reused by a * subsequent transfer but shall be closed immediately. */ - data->set.reuse_forbid = (0 != va_arg(param, long)); + data->set.reuse_forbid = enabled; break; case CURLOPT_FRESH_CONNECT: /* * This transfer shall not use a previously cached connection but * should be made with a fresh new connect! */ - data->set.reuse_fresh = (0 != va_arg(param, long)); + data->set.reuse_fresh = enabled; break; case CURLOPT_VERBOSE: /* * Verbose means infof() calls that give a lot of information about * the connection and transfer procedures as well as internal choices. */ - data->set.verbose = (0 != va_arg(param, long)); + data->set.verbose = enabled; break; case CURLOPT_HEADER: /* * Set to include the header in the general data output stream. */ - data->set.include_header = (0 != va_arg(param, long)); + data->set.include_header = enabled; break; case CURLOPT_NOPROGRESS: /* * Shut off the internal supported progress meter */ - data->set.hide_progress = (0 != va_arg(param, long)); + data->set.hide_progress = enabled; if(data->set.hide_progress) data->progress.flags |= PGRS_HIDE; else @@ -312,7 +331,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Do not include the body part in the output data stream. */ - data->set.opt_no_body = (0 != va_arg(param, long)); + data->set.opt_no_body = enabled; #ifndef CURL_DISABLE_HTTP if(data->set.opt_no_body) /* in HTTP lingo, no body means using the HEAD request... */ @@ -323,13 +342,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) break; case CURLOPT_FAILONERROR: /* - * Don't output the >=400 error code HTML-page, but instead only + * Do not output the >=400 error code HTML-page, but instead only * return error. */ - data->set.http_fail_on_error = (0 != va_arg(param, long)); + data->set.http_fail_on_error = enabled; break; case CURLOPT_KEEP_SENDING_ON_ERROR: - data->set.http_keep_sending_on_error = (0 != va_arg(param, long)); + data->set.http_keep_sending_on_error = enabled; break; case CURLOPT_UPLOAD: case CURLOPT_PUT: @@ -337,7 +356,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * We want to sent data to the remote host. If this is HTTP, that equals * using the PUT request. */ - arg = va_arg(param, long); if(arg) { /* If this is HTTP, PUT is what's needed to "upload" */ data->set.method = HTTPREQ_PUT; @@ -348,23 +366,18 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) then this can be changed to HEAD later on) */ data->set.method = HTTPREQ_GET; break; - case CURLOPT_REQUEST_TARGET: - result = Curl_setstropt(&data->set.str[STRING_TARGET], - va_arg(param, char *)); - break; case CURLOPT_FILETIME: /* * Try to get the file time of the remote document. The time will * later (possibly) become available using curl_easy_getinfo(). */ - data->set.get_filetime = (0 != va_arg(param, long)); + data->set.get_filetime = enabled; break; case CURLOPT_SERVER_RESPONSE_TIMEOUT: /* * Option that specifies how quickly a server response must be obtained * before it is considered failure. For pingpong protocols. */ - arg = va_arg(param, long); if((arg >= 0) && (arg <= (INT_MAX/1000))) data->set.server_response_timeout = (unsigned int)arg * 1000; else @@ -375,7 +388,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Option that specifies how quickly a server response must be obtained * before it is considered failure. For pingpong protocols. */ - arg = va_arg(param, long); if((arg >= 0) && (arg <= INT_MAX)) data->set.server_response_timeout = (unsigned int)arg; else @@ -387,15 +399,16 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Option that prevents libcurl from sending TFTP option requests to the * server. */ - data->set.tftp_no_options = va_arg(param, long) != 0; + data->set.tftp_no_options = enabled; break; case CURLOPT_TFTP_BLKSIZE: /* * TFTP option that specifies the block size to use for data transmission. */ - arg = va_arg(param, long); - if(arg > TFTP_BLKSIZE_MAX || arg < TFTP_BLKSIZE_MIN) - return CURLE_BAD_FUNCTION_ARGUMENT; + if(arg < TFTP_BLKSIZE_MIN) + arg = 512; + else if(arg > TFTP_BLKSIZE_MAX) + arg = TFTP_BLKSIZE_MAX; data->set.tftp_blksize = arg; break; #endif @@ -404,18 +417,10 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Parse the $HOME/.netrc file */ - arg = va_arg(param, long); if((arg < CURL_NETRC_IGNORED) || (arg >= CURL_NETRC_LAST)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.use_netrc = (unsigned char)arg; break; - case CURLOPT_NETRC_FILE: - /* - * Use this file instead of the $HOME/.netrc file - */ - result = Curl_setstropt(&data->set.str[STRING_NETRC_FILE], - va_arg(param, char *)); - break; #endif case CURLOPT_TRANSFERTEXT: /* @@ -424,14 +429,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * * Transfer using ASCII (instead of BINARY). */ - data->set.prefer_ascii = (0 != va_arg(param, long)); + data->set.prefer_ascii = enabled; break; case CURLOPT_TIMECONDITION: /* * Set HTTP time condition. This must be one of the defines in the * curl/curl.h header file. */ - arg = va_arg(param, long); if((arg < CURL_TIMECOND_NONE) || (arg >= CURL_TIMECOND_LAST)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.timecondition = (unsigned char)(curl_TimeCond)arg; @@ -441,17 +445,8 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * This is the value to compare with the remote document with the * method set with CURLOPT_TIMECONDITION */ - data->set.timevalue = (time_t)va_arg(param, long); + data->set.timevalue = (time_t)arg; break; - - case CURLOPT_TIMEVALUE_LARGE: - /* - * This is the value to compare with the remote document with the - * method set with CURLOPT_TIMECONDITION - */ - data->set.timevalue = (time_t)va_arg(param, curl_off_t); - break; - case CURLOPT_SSLVERSION: #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXY_SSLVERSION: @@ -468,11 +463,8 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) if(option != CURLOPT_SSLVERSION) primary = &data->set.proxy_ssl.primary; #endif - - arg = va_arg(param, long); - version = C_SSLVERSION_VALUE(arg); - version_max = C_SSLVERSION_MAX_VALUE(arg); + version_max = (long)C_SSLVERSION_MAX_VALUE(arg); if(version < CURL_SSLVERSION_DEFAULT || version == CURL_SSLVERSION_SSLv2 || @@ -486,135 +478,54 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) primary->version_max = (unsigned int)version_max; } #else - result = CURLE_NOT_BUILT_IN; + return CURLE_NOT_BUILT_IN; #endif break; - - /* MQTT "borrows" some of the HTTP options */ -#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT) - case CURLOPT_COPYPOSTFIELDS: - /* - * 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. - */ - argptr = va_arg(param, char *); - - if(!argptr || data->set.postfieldsize == -1) - result = Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], argptr); - else { - /* - * Check that requested length does not overflow the size_t type. - */ - - if((data->set.postfieldsize < 0) || - ((sizeof(curl_off_t) != sizeof(size_t)) && - (data->set.postfieldsize > (curl_off_t)((size_t)-1)))) - result = CURLE_OUT_OF_MEMORY; - 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(argptr, (size_t)data->set.postfieldsize); - (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); - if(!p) - result = CURLE_OUT_OF_MEMORY; - else - data->set.str[STRING_COPYPOSTFIELDS] = p; - } - } - - data->set.postfields = data->set.str[STRING_COPYPOSTFIELDS]; - data->set.method = HTTPREQ_POST; - break; - - case CURLOPT_POSTFIELDS: - /* - * Like above, but use static data instead of copying it. - */ - data->set.postfields = va_arg(param, void *); - /* Release old copied data. */ - (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); - data->set.method = HTTPREQ_POST; - break; - case CURLOPT_POSTFIELDSIZE: /* * The size of the POSTFIELD data to prevent libcurl to do strlen() to * figure it out. Enables binary posts. */ - bigsize = va_arg(param, long); - if(bigsize < -1) + if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; - if(data->set.postfieldsize < bigsize && + if(data->set.postfieldsize < arg && data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */ - (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); + Curl_safefree(data->set.str[STRING_COPYPOSTFIELDS]); data->set.postfields = NULL; } - data->set.postfieldsize = bigsize; + data->set.postfieldsize = arg; break; - - case CURLOPT_POSTFIELDSIZE_LARGE: +#ifndef CURL_DISABLE_HTTP +#if !defined(CURL_DISABLE_COOKIES) + case CURLOPT_COOKIESESSION: /* - * The size of the POSTFIELD data to prevent libcurl to do strlen() to - * figure it out. Enables binary posts. + * Set this option to TRUE to start a new "cookie session". It will + * prevent the forthcoming read-cookies-from-file actions to accept + * cookies that are marked as being session cookies, as they belong to a + * previous session. */ - bigsize = va_arg(param, curl_off_t); - if(bigsize < -1) - return CURLE_BAD_FUNCTION_ARGUMENT; - - if(data->set.postfieldsize < bigsize && - data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { - /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */ - (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); - data->set.postfields = NULL; - } - - data->set.postfieldsize = bigsize; + data->set.cookiesession = enabled; break; #endif -#ifndef CURL_DISABLE_HTTP case CURLOPT_AUTOREFERER: /* * Switch on automatic referer that gets set if curl follows locations. */ - data->set.http_auto_referer = (0 != va_arg(param, long)); - break; - - case CURLOPT_ACCEPT_ENCODING: - /* - * String to use at the value of Accept-Encoding header. - * - * If the encoding is set to "" we use an Accept-Encoding header that - * encompasses all the encodings we support. - * If the encoding is set to NULL we don't send an Accept-Encoding header - * and ignore an received Content-Encoding header. - * - */ - argptr = va_arg(param, char *); - if(argptr && !*argptr) { - char all[256]; - Curl_all_content_encodings(all, sizeof(all)); - result = Curl_setstropt(&data->set.str[STRING_ENCODING], all); - } - else - result = Curl_setstropt(&data->set.str[STRING_ENCODING], argptr); + data->set.http_auto_referer = enabled; break; case CURLOPT_TRANSFER_ENCODING: - data->set.http_transfer_encoding = (0 != va_arg(param, long)); + data->set.http_transfer_encoding = enabled; break; case CURLOPT_FOLLOWLOCATION: /* * Follow Location: header hints on an HTTP-server. */ - data->set.http_follow_location = (0 != va_arg(param, long)); + data->set.http_follow_location = enabled; break; case CURLOPT_UNRESTRICTED_AUTH: @@ -622,7 +533,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Send authentication (user+password) when following locations, even when * hostname changed. */ - data->set.allow_auth_to_other_hosts = (0 != va_arg(param, long)); + data->set.allow_auth_to_other_hosts = enabled; break; case CURLOPT_MAXREDIRS: @@ -630,7 +541,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * The maximum amount of hops you allow curl to follow Location: * headers. This should mostly be used to detect never-ending loops. */ - arg = va_arg(param, long); if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.maxredirs = arg; @@ -646,7 +556,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * CURL_REDIR_POST_ALL - POST is kept as POST after 301, 302 and 303 * other - POST is kept as POST after 301 and 302 */ - arg = va_arg(param, long); if(arg < CURL_REDIR_GET_ALL) /* no return error on too high numbers since the bitmask could be extended in a future */ @@ -656,232 +565,29 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) case CURLOPT_POST: /* Does this option serve a purpose anymore? Yes it does, when - CURLOPT_POSTFIELDS isn't used and the POST data is read off the + CURLOPT_POSTFIELDS is not used and the POST data is read off the callback! */ - if(va_arg(param, long)) { + if(arg) { data->set.method = HTTPREQ_POST; data->set.opt_no_body = FALSE; /* this is implied */ } else data->set.method = HTTPREQ_GET; break; - -#ifndef CURL_DISABLE_FORM_API - case CURLOPT_HTTPPOST: - /* - * Set to make us do HTTP POST. Legacy API-style. - */ - data->set.httppost = va_arg(param, struct curl_httppost *); - data->set.method = HTTPREQ_POST_FORM; - data->set.opt_no_body = FALSE; /* this is implied */ - Curl_mime_cleanpart(data->state.formp); - Curl_safefree(data->state.formp); - data->state.mimepost = NULL; - break; -#endif - -#if !defined(CURL_DISABLE_AWS) - case CURLOPT_AWS_SIGV4: - /* - * String that is merged to some authentication - * parameters are used by the algorithm. - */ - result = Curl_setstropt(&data->set.str[STRING_AWS_SIGV4], - va_arg(param, char *)); - /* - * Basic been set by default it need to be unset here - */ - if(data->set.str[STRING_AWS_SIGV4]) - data->set.httpauth = CURLAUTH_AWS_SIGV4; - break; -#endif - - case CURLOPT_REFERER: - /* - * 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(&data->set.str[STRING_SET_REFERER], - va_arg(param, char *)); - data->state.referer = data->set.str[STRING_SET_REFERER]; - break; - - case CURLOPT_USERAGENT: - /* - * String to use in the HTTP User-Agent field - */ - result = Curl_setstropt(&data->set.str[STRING_USERAGENT], - va_arg(param, char *)); - break; - -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXYHEADER: - /* - * Set a list with proxy headers to use (or replace internals with) - * - * Since CURLOPT_HTTPHEADER was the only way to set HTTP headers for a - * long time we remain doing it this way until CURLOPT_PROXYHEADER is - * used. As soon as this option has been used, if set to anything but - * NULL, custom headers for proxies are only picked from this list. - * - * Set this option to NULL to restore the previous behavior. - */ - data->set.proxyheaders = va_arg(param, struct curl_slist *); - break; -#endif case CURLOPT_HEADEROPT: /* * Set header option. */ - arg = va_arg(param, long); data->set.sep_headers = !!(arg & CURLHEADER_SEPARATE); break; - -#if !defined(CURL_DISABLE_COOKIES) - case CURLOPT_COOKIE: - /* - * Cookie string to send to the remote server in the request. - */ - result = Curl_setstropt(&data->set.str[STRING_COOKIE], - va_arg(param, char *)); - break; - - case CURLOPT_COOKIEFILE: - /* - * Set cookie file to read and parse. Can be used multiple times. - */ - argptr = (char *)va_arg(param, void *); - if(argptr) { - struct curl_slist *cl; - /* general protection against mistakes and abuse */ - if(strlen(argptr) > CURL_MAX_INPUT_LENGTH) - return CURLE_BAD_FUNCTION_ARGUMENT; - /* append the cookie file name to the list of file names, and deal with - them later */ - cl = curl_slist_append(data->state.cookielist, argptr); - if(!cl) { - curl_slist_free_all(data->state.cookielist); - data->state.cookielist = NULL; - return CURLE_OUT_OF_MEMORY; - } - data->state.cookielist = cl; /* store the list for later use */ - } - else { - /* clear the list of cookie files */ - curl_slist_free_all(data->state.cookielist); - data->state.cookielist = NULL; - - if(!data->share || !data->share->cookies) { - /* throw away all existing cookies if this isn't a shared cookie - container */ - Curl_cookie_clearall(data->cookies); - Curl_cookie_cleanup(data->cookies); - } - /* disable the cookie engine */ - data->cookies = NULL; - } - break; - - case CURLOPT_COOKIEJAR: - /* - * Set cookie file name to dump all cookies to when we're done. - */ - { - struct CookieInfo *newcookies; - result = Curl_setstropt(&data->set.str[STRING_COOKIEJAR], - va_arg(param, char *)); - - /* - * Activate the cookie parser. This may or may not already - * have been made. - */ - newcookies = Curl_cookie_init(data, NULL, data->cookies, - data->set.cookiesession); - if(!newcookies) - result = CURLE_OUT_OF_MEMORY; - data->cookies = newcookies; - } - break; - - case CURLOPT_COOKIESESSION: - /* - * Set this option to TRUE to start a new "cookie session". It will - * prevent the forthcoming read-cookies-from-file actions to accept - * cookies that are marked as being session cookies, as they belong to a - * previous session. - */ - data->set.cookiesession = (0 != va_arg(param, long)); - break; - - case CURLOPT_COOKIELIST: - argptr = va_arg(param, char *); - - if(!argptr) - break; - - if(strcasecompare(argptr, "ALL")) { - /* clear all cookies */ - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - Curl_cookie_clearall(data->cookies); - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - } - else if(strcasecompare(argptr, "SESS")) { - /* clear session cookies */ - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - Curl_cookie_clearsess(data->cookies); - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - } - else if(strcasecompare(argptr, "FLUSH")) { - /* flush cookies to file, takes care of the locking */ - Curl_flush_cookies(data, FALSE); - } - else if(strcasecompare(argptr, "RELOAD")) { - /* reload cookies from file */ - Curl_cookie_loadfiles(data); - break; - } - else { - if(!data->cookies) - /* if cookie engine was not running, activate it */ - data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE); - - /* general protection against mistakes and abuse */ - if(strlen(argptr) > CURL_MAX_INPUT_LENGTH) - return CURLE_BAD_FUNCTION_ARGUMENT; - argptr = strdup(argptr); - if(!argptr || !data->cookies) { - result = CURLE_OUT_OF_MEMORY; - free(argptr); - } - else { - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - - if(checkprefix("Set-Cookie:", argptr)) - /* HTTP Header format line */ - Curl_cookie_add(data, data->cookies, TRUE, FALSE, argptr + 11, NULL, - NULL, TRUE); - - else - /* Netscape format line */ - Curl_cookie_add(data, data->cookies, FALSE, FALSE, argptr, NULL, - NULL, TRUE); - - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - free(argptr); - } - } - - break; -#endif /* !CURL_DISABLE_COOKIES */ + case CURLOPT_HTTPAUTH: + return httpauth(data, FALSE, uarg); case CURLOPT_HTTPGET: /* * Set to force us do HTTP GET */ - if(va_arg(param, long)) { + if(enabled) { data->set.method = HTTPREQ_GET; data->set.opt_no_body = FALSE; /* this is implied */ } @@ -892,7 +598,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * This sets a requested HTTP version to be used. The value is one of * the listed enums in curl/curl.h. */ - arg = va_arg(param, long); switch(arg) { case CURL_HTTP_VERSION_NONE: #ifdef USE_HTTP2 @@ -913,7 +618,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* accepted */ break; #endif -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 case CURL_HTTP_VERSION_3: case CURL_HTTP_VERSION_3ONLY: /* accepted */ @@ -933,232 +638,51 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Time to wait for a response to an HTTP request containing an * Expect: 100-continue header before sending the data anyway. */ - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.expect_100_timeout = arg; break; case CURLOPT_HTTP09_ALLOWED: - arg = va_arg(param, unsigned long); - if(arg > 1L) - return CURLE_BAD_FUNCTION_ARGUMENT; #ifdef USE_HYPER /* Hyper does not support HTTP/0.9 */ - if(arg) + if(enabled) return CURLE_BAD_FUNCTION_ARGUMENT; #else - data->set.http09_allowed = !!arg; + data->set.http09_allowed = enabled; #endif break; +#endif /* ! CURL_DISABLE_HTTP */ - case CURLOPT_HTTP200ALIASES: - /* - * Set a list of aliases for HTTP 200 in response header - */ - data->set.http200aliases = va_arg(param, struct curl_slist *); - break; -#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_MIME) - case CURLOPT_HTTPHEADER: - /* - * Set a list with HTTP headers to use (or replace internals with) - */ - data->set.headers = va_arg(param, struct curl_slist *); - break; -# endif - -# ifndef CURL_DISABLE_MIME - case CURLOPT_MIMEPOST: - /* - * Set to make us do MIME POST - */ - result = Curl_mime_set_subparts(&data->set.mimepost, - va_arg(param, curl_mime *), FALSE); - if(!result) { - data->set.method = HTTPREQ_POST_MIME; - data->set.opt_no_body = FALSE; /* this is implied */ -#ifndef CURL_DISABLE_FORM_API - Curl_mime_cleanpart(data->state.formp); - Curl_safefree(data->state.formp); - data->state.mimepost = NULL; -#endif - } - break; - +#ifndef CURL_DISABLE_MIME case CURLOPT_MIME_OPTIONS: - arg = va_arg(param, long); data->set.mime_formescape = !!(arg & CURLMIMEOPT_FORMESCAPE); - break; -# endif -#endif - - case CURLOPT_HTTPAUTH: - /* - * Set HTTP Authentication type BITMASK. - */ - { - int bitcheck; - bool authbits; - unsigned long auth = va_arg(param, unsigned long); - - if(auth == CURLAUTH_NONE) { - data->set.httpauth = auth; - break; - } - - /* the DIGEST_IE bit is only used to set a special marker, for all the - rest we need to handle it as normal DIGEST */ - data->state.authhost.iestyle = !!(auth & CURLAUTH_DIGEST_IE); - - if(auth & CURLAUTH_DIGEST_IE) { - auth |= CURLAUTH_DIGEST; /* set standard digest bit */ - auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */ - } - - /* switch off bits we can't support */ -#ifndef USE_NTLM - auth &= ~CURLAUTH_NTLM; /* no NTLM support */ - auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ -#elif !defined(NTLM_WB_ENABLED) - auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ -#endif -#ifndef USE_SPNEGO - auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without - GSS-API or SSPI */ -#endif - - /* check if any auth bit lower than CURLAUTH_ONLY is still set */ - bitcheck = 0; - authbits = FALSE; - while(bitcheck < 31) { - if(auth & (1UL << bitcheck++)) { - authbits = TRUE; - break; - } - } - if(!authbits) - return CURLE_NOT_BUILT_IN; /* no supported types left! */ - - data->set.httpauth = auth; - } - break; - - case CURLOPT_CUSTOMREQUEST: - /* - * Set a custom string to use as request - */ - result = Curl_setstropt(&data->set.str[STRING_CUSTOMREQUEST], - va_arg(param, char *)); - - /* we don't set - data->set.method = HTTPREQ_CUSTOM; - here, we continue as if we were using the already set type - and this just changes the actual request keyword */ break; - +#endif #ifndef CURL_DISABLE_PROXY case CURLOPT_HTTPPROXYTUNNEL: /* * Tunnel operations through the proxy instead of normal proxy use */ - data->set.tunnel_thru_httpproxy = (0 != va_arg(param, long)); + data->set.tunnel_thru_httpproxy = enabled; break; case CURLOPT_PROXYPORT: /* * Explicitly set HTTP proxy port number. */ - arg = va_arg(param, long); if((arg < 0) || (arg > 65535)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.proxyport = (unsigned short)arg; break; case CURLOPT_PROXYAUTH: - /* - * Set HTTP Authentication type BITMASK. - */ - { - int bitcheck; - bool authbits; - unsigned long auth = va_arg(param, unsigned long); - - if(auth == CURLAUTH_NONE) { - data->set.proxyauth = auth; - break; - } - - /* the DIGEST_IE bit is only used to set a special marker, for all the - rest we need to handle it as normal DIGEST */ - data->state.authproxy.iestyle = !!(auth & CURLAUTH_DIGEST_IE); - - if(auth & CURLAUTH_DIGEST_IE) { - auth |= CURLAUTH_DIGEST; /* set standard digest bit */ - auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */ - } - /* switch off bits we can't support */ -#ifndef USE_NTLM - auth &= ~CURLAUTH_NTLM; /* no NTLM support */ - auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ -#elif !defined(NTLM_WB_ENABLED) - auth &= ~CURLAUTH_NTLM_WB; /* no NTLM_WB support */ -#endif -#ifndef USE_SPNEGO - auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without - GSS-API or SSPI */ -#endif - - /* check if any auth bit lower than CURLAUTH_ONLY is still set */ - bitcheck = 0; - authbits = FALSE; - while(bitcheck < 31) { - if(auth & (1UL << bitcheck++)) { - authbits = TRUE; - break; - } - } - if(!authbits) - return CURLE_NOT_BUILT_IN; /* no supported types left! */ - - data->set.proxyauth = auth; - } - break; - - case CURLOPT_PROXY: - /* - * Set proxy server:port to use as proxy. - * - * If the proxy is set to "" (and CURLOPT_SOCKS_PROXY is set to "" or NULL) - * we explicitly say that we don't want to use a proxy - * (even though there might be environment variables saying so). - * - * Setting it to NULL, means no proxy but allows the environment variables - * to decide for us (if CURLOPT_SOCKS_PROXY setting it to NULL). - */ - result = Curl_setstropt(&data->set.str[STRING_PROXY], - va_arg(param, char *)); - break; - - case CURLOPT_PRE_PROXY: - /* - * Set proxy server:port to use as SOCKS proxy. - * - * If the proxy is set to "" or NULL we explicitly say that we don't want - * to use the socks proxy. - */ - result = Curl_setstropt(&data->set.str[STRING_PRE_PROXY], - va_arg(param, char *)); - break; + return httpauth(data, TRUE, uarg); case CURLOPT_PROXYTYPE: /* * Set proxy type. */ - arg = va_arg(param, long); if((arg < CURLPROXY_HTTP) || (arg > CURLPROXY_SOCKS5_HOSTNAME)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.proxytype = (unsigned char)(curl_proxytype)arg; @@ -1168,81 +692,57 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * set transfer mode (;type=) when doing FTP via an HTTP proxy */ - switch(va_arg(param, long)) { - case 0: - data->set.proxy_transfer_mode = FALSE; - break; - case 1: - data->set.proxy_transfer_mode = TRUE; - break; - default: + if(uarg > 1) /* reserve other values for future use */ - result = CURLE_BAD_FUNCTION_ARGUMENT; - break; - } + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.proxy_transfer_mode = (bool)uarg; break; - case CURLOPT_SOCKS5_AUTH: - data->set.socks5auth = (unsigned char)va_arg(param, unsigned long); if(data->set.socks5auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI)) - result = CURLE_NOT_BUILT_IN; + return CURLE_NOT_BUILT_IN; + data->set.socks5auth = (unsigned char)uarg; break; -#endif /* CURL_DISABLE_PROXY */ + case CURLOPT_HAPROXYPROTOCOL: + /* + * Set to send the HAProxy Proxy Protocol header + */ + data->set.haproxyprotocol = enabled; + break; + case CURLOPT_PROXY_SSL_VERIFYPEER: + /* + * Enable peer SSL verifying for proxy. + */ + data->set.proxy_ssl.primary.verifypeer = enabled; + + /* Update the current connection proxy_ssl_config. */ + Curl_ssl_conn_config_update(data, TRUE); + break; + case CURLOPT_PROXY_SSL_VERIFYHOST: + /* + * Enable verification of the hostname in the peer certificate for proxy + */ + data->set.proxy_ssl.primary.verifyhost = enabled; + + /* Update the current connection proxy_ssl_config. */ + Curl_ssl_conn_config_update(data, TRUE); + break; +#endif /* ! CURL_DISABLE_PROXY */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) case CURLOPT_SOCKS5_GSSAPI_NEC: /* * Set flag for NEC SOCK5 support */ - data->set.socks5_gssapi_nec = (0 != va_arg(param, long)); + data->set.socks5_gssapi_nec = enabled; break; #endif -#ifndef CURL_DISABLE_PROXY - case CURLOPT_SOCKS5_GSSAPI_SERVICE: - case CURLOPT_PROXY_SERVICE_NAME: - /* - * Set proxy authentication service name for Kerberos 5 and SPNEGO - */ - result = Curl_setstropt(&data->set.str[STRING_PROXY_SERVICE_NAME], - va_arg(param, char *)); - break; -#endif - case CURLOPT_SERVICE_NAME: - /* - * Set authentication service name for DIGEST-MD5, Kerberos 5 and SPNEGO - */ - result = Curl_setstropt(&data->set.str[STRING_SERVICE_NAME], - va_arg(param, char *)); - break; - - case CURLOPT_HEADERDATA: - /* - * Custom pointer to pass the header write callback function - */ - data->set.writeheader = (void *)va_arg(param, void *); - break; - case CURLOPT_ERRORBUFFER: - /* - * Error buffer provided by the caller to get the human readable - * error string in. - */ - data->set.errorbuffer = va_arg(param, char *); - break; - case CURLOPT_WRITEDATA: - /* - * FILE pointer to write to. Or possibly - * used as argument to the write callback. - */ - data->set.out = va_arg(param, void *); - break; - #ifdef CURL_LIST_ONLY_PROTOCOL case CURLOPT_DIRLISTONLY: /* * An option that changes the command to one that asks for a list only, no * file info details. Used for FTP, POP3 and SFTP. */ - data->set.list_only = (0 != va_arg(param, long)); + data->set.list_only = enabled; break; #endif case CURLOPT_APPEND: @@ -1250,7 +750,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * We want to upload and append to an existing file. Used for FTP and * SFTP. */ - data->set.remote_append = (0 != va_arg(param, long)); + data->set.remote_append = enabled; break; #ifndef CURL_DISABLE_FTP @@ -1258,34 +758,23 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * How do access files over FTP. */ - arg = va_arg(param, long); if((arg < CURLFTPMETHOD_DEFAULT) || (arg >= CURLFTPMETHOD_LAST)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.ftp_filemethod = (unsigned char)arg; break; - case CURLOPT_FTPPORT: - /* - * Use FTP PORT, this also specifies which IP address to use - */ - result = Curl_setstropt(&data->set.str[STRING_FTPPORT], - va_arg(param, char *)); - data->set.ftp_use_port = !!(data->set.str[STRING_FTPPORT]); - break; - case CURLOPT_FTP_USE_EPRT: - data->set.ftp_use_eprt = (0 != va_arg(param, long)); + data->set.ftp_use_eprt = enabled; break; case CURLOPT_FTP_USE_EPSV: - data->set.ftp_use_epsv = (0 != va_arg(param, long)); + data->set.ftp_use_epsv = enabled; break; case CURLOPT_FTP_USE_PRET: - data->set.ftp_use_pret = (0 != va_arg(param, long)); + data->set.ftp_use_pret = enabled; break; case CURLOPT_FTP_SSL_CCC: - arg = va_arg(param, long); if((arg < CURLFTPSSL_CCC_NONE) || (arg >= CURLFTPSSL_CCC_LAST)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.ftp_ccc = (unsigned char)arg; @@ -1296,162 +785,72 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the * bypass of the IP address in PASV responses. */ - data->set.ftp_skip_ip = (0 != va_arg(param, long)); - break; - - case CURLOPT_FTP_ACCOUNT: - result = Curl_setstropt(&data->set.str[STRING_FTP_ACCOUNT], - va_arg(param, char *)); - break; - - case CURLOPT_FTP_ALTERNATIVE_TO_USER: - result = Curl_setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER], - va_arg(param, char *)); + data->set.ftp_skip_ip = enabled; break; case CURLOPT_FTPSSLAUTH: /* * Set a specific auth for FTP-SSL transfers. */ - arg = va_arg(param, long); if((arg < CURLFTPAUTH_DEFAULT) || (arg >= CURLFTPAUTH_LAST)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.ftpsslauth = (unsigned char)(curl_ftpauth)arg; break; - case CURLOPT_KRBLEVEL: + case CURLOPT_ACCEPTTIMEOUT_MS: /* - * A string that defines the kerberos security level. + * The maximum time for curl to wait for FTP server connect */ - result = Curl_setstropt(&data->set.str[STRING_KRB_LEVEL], - va_arg(param, char *)); - data->set.krb = !!(data->set.str[STRING_KRB_LEVEL]); + if(uarg > UINT_MAX) + uarg = UINT_MAX; + data->set.accepttimeout = (unsigned int)uarg; break; -#endif + case CURLOPT_WILDCARDMATCH: + data->set.wildcard_enabled = enabled; + break; +#endif /* ! CURL_DISABLE_FTP */ #if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) case CURLOPT_FTP_CREATE_MISSING_DIRS: /* * An FTP/SFTP option that modifies an upload to create missing * directories on the server. */ - arg = va_arg(param, long); /* reserve other values for future use */ - if((arg < CURLFTP_CREATE_DIR_NONE) || - (arg > CURLFTP_CREATE_DIR_RETRY)) - result = CURLE_BAD_FUNCTION_ARGUMENT; - else - data->set.ftp_create_missing_dirs = (unsigned char)arg; - break; - - case CURLOPT_POSTQUOTE: - /* - * List of RAW FTP commands to use after a transfer - */ - data->set.postquote = va_arg(param, struct curl_slist *); - break; - case CURLOPT_PREQUOTE: - /* - * List of RAW FTP commands to use prior to RETR (Wesley Laxton) - */ - data->set.prequote = va_arg(param, struct curl_slist *); - break; - case CURLOPT_QUOTE: - /* - * List of RAW FTP commands to use before a transfer - */ - data->set.quote = va_arg(param, struct curl_slist *); - break; -#endif - case CURLOPT_READDATA: - /* - * FILE pointer to read the file to be uploaded from. Or possibly - * used as argument to the read callback. - */ - data->set.in_set = va_arg(param, void *); + if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY)) + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.ftp_create_missing_dirs = (unsigned char)arg; break; +#endif /* ! CURL_DISABLE_FTP || USE_SSH */ case CURLOPT_INFILESIZE: /* * If known, this should inform curl about the file size of the * to-be-uploaded file. */ - arg = va_arg(param, long); if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.filesize = arg; break; - case CURLOPT_INFILESIZE_LARGE: - /* - * If known, this should inform curl about the file size of the - * to-be-uploaded file. - */ - bigsize = va_arg(param, curl_off_t); - if(bigsize < -1) - return CURLE_BAD_FUNCTION_ARGUMENT; - data->set.filesize = bigsize; - break; case CURLOPT_LOW_SPEED_LIMIT: /* * The low speed limit that if transfers are below this for * CURLOPT_LOW_SPEED_TIME, the transfer is aborted. */ - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.low_speed_limit = arg; break; - case CURLOPT_MAX_SEND_SPEED_LARGE: - /* - * When transfer uploads are faster then CURLOPT_MAX_SEND_SPEED_LARGE - * bytes per second the transfer is throttled.. - */ - bigsize = va_arg(param, curl_off_t); - if(bigsize < 0) - return CURLE_BAD_FUNCTION_ARGUMENT; - data->set.max_send_speed = bigsize; - break; - case CURLOPT_MAX_RECV_SPEED_LARGE: - /* - * When receiving data faster than CURLOPT_MAX_RECV_SPEED_LARGE bytes per - * second the transfer is throttled.. - */ - bigsize = va_arg(param, curl_off_t); - if(bigsize < 0) - return CURLE_BAD_FUNCTION_ARGUMENT; - data->set.max_recv_speed = bigsize; - break; case CURLOPT_LOW_SPEED_TIME: /* * The low speed time that if transfers are below the set * CURLOPT_LOW_SPEED_LIMIT during this time, the transfer is aborted. */ - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.low_speed_time = arg; break; - case CURLOPT_CURLU: - /* - * pass CURLU to set URL - */ - data->set.uh = va_arg(param, CURLU *); - break; - case CURLOPT_URL: - /* - * The URL to fetch. - */ - if(data->state.url_alloc) { - /* the already set URL is allocated, free it first! */ - Curl_safefree(data->state.url); - data->state.url_alloc = FALSE; - } - result = Curl_setstropt(&data->set.str[STRING_SET_URL], - va_arg(param, char *)); - data->state.url = data->set.str[STRING_SET_URL]; - break; case CURLOPT_PORT: /* * The port number to use when getting the URL. 0 disables it. */ - arg = va_arg(param, long); if((arg < 0) || (arg > 65535)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.use_port = (unsigned short)arg; @@ -1461,7 +860,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * The maximum time you allow curl to use for a single transfer * operation. */ - arg = va_arg(param, long); if((arg >= 0) && (arg <= (INT_MAX/1000))) data->set.timeout = (unsigned int)arg * 1000; else @@ -1469,7 +867,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) break; case CURLOPT_TIMEOUT_MS: - uarg = va_arg(param, unsigned long); if(uarg > UINT_MAX) uarg = UINT_MAX; data->set.timeout = (unsigned int)uarg; @@ -1479,7 +876,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * The maximum time you allow curl to use to connect. */ - arg = va_arg(param, long); if((arg >= 0) && (arg <= (INT_MAX/1000))) data->set.connecttimeout = (unsigned int)arg * 1000; else @@ -1487,410 +883,32 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) break; case CURLOPT_CONNECTTIMEOUT_MS: - uarg = va_arg(param, unsigned long); if(uarg > UINT_MAX) uarg = UINT_MAX; data->set.connecttimeout = (unsigned int)uarg; break; -#ifndef CURL_DISABLE_FTP - case CURLOPT_ACCEPTTIMEOUT_MS: - /* - * The maximum time for curl to wait for FTP server connect - */ - uarg = va_arg(param, unsigned long); - if(uarg > UINT_MAX) - uarg = UINT_MAX; - data->set.accepttimeout = (unsigned int)uarg; - break; -#endif - - case CURLOPT_USERPWD: - /* - * user:password to use in the operation - */ - result = setstropt_userpwd(va_arg(param, char *), - &data->set.str[STRING_USERNAME], - &data->set.str[STRING_PASSWORD]); - break; - - case CURLOPT_USERNAME: - /* - * authentication user name to use in the operation - */ - result = Curl_setstropt(&data->set.str[STRING_USERNAME], - va_arg(param, char *)); - break; - case CURLOPT_PASSWORD: - /* - * authentication password to use in the operation - */ - result = Curl_setstropt(&data->set.str[STRING_PASSWORD], - va_arg(param, char *)); - break; - - case CURLOPT_LOGIN_OPTIONS: - /* - * authentication options to use in the operation - */ - result = Curl_setstropt(&data->set.str[STRING_OPTIONS], - va_arg(param, char *)); - break; - - case CURLOPT_XOAUTH2_BEARER: - /* - * OAuth 2.0 bearer token to use in the operation - */ - result = Curl_setstropt(&data->set.str[STRING_BEARER], - va_arg(param, char *)); - break; - - case CURLOPT_RESOLVE: - /* - * List of HOST:PORT:[addresses] strings to populate the DNS cache with - * Entries added this way will remain in the cache until explicitly - * removed or the handle is cleaned up. - * - * Prefix the HOST with plus sign (+) to have the entry expire just like - * automatically added entries. - * - * Prefix the HOST with dash (-) to _remove_ the entry from the cache. - * - * This API can remove any entry from the DNS cache, but only entries - * that aren't actually in use right now will be pruned immediately. - */ - data->set.resolve = va_arg(param, struct curl_slist *); - data->state.resolve = data->set.resolve; - break; - case CURLOPT_PROGRESSFUNCTION: - /* - * Progress callback function - */ - data->set.fprogress = va_arg(param, curl_progress_callback); - if(data->set.fprogress) - data->progress.callback = TRUE; /* no longer internal */ - else - data->progress.callback = FALSE; /* NULL enforces internal */ - break; - - case CURLOPT_XFERINFOFUNCTION: - /* - * Transfer info callback function - */ - data->set.fxferinfo = va_arg(param, curl_xferinfo_callback); - if(data->set.fxferinfo) - data->progress.callback = TRUE; /* no longer internal */ - else - data->progress.callback = FALSE; /* NULL enforces internal */ - - break; - - case CURLOPT_PROGRESSDATA: - /* - * Custom client data to pass to the progress callback - */ - data->set.progress_client = va_arg(param, void *); - break; - -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXYUSERPWD: - /* - * user:password needed to use the proxy - */ - result = setstropt_userpwd(va_arg(param, char *), - &data->set.str[STRING_PROXYUSERNAME], - &data->set.str[STRING_PROXYPASSWORD]); - break; - case CURLOPT_PROXYUSERNAME: - /* - * authentication user name to use in the operation - */ - result = Curl_setstropt(&data->set.str[STRING_PROXYUSERNAME], - va_arg(param, char *)); - break; - case CURLOPT_PROXYPASSWORD: - /* - * authentication password to use in the operation - */ - result = Curl_setstropt(&data->set.str[STRING_PROXYPASSWORD], - va_arg(param, char *)); - break; - case CURLOPT_NOPROXY: - /* - * proxy exception list - */ - result = Curl_setstropt(&data->set.str[STRING_NOPROXY], - va_arg(param, char *)); - break; -#endif - - case CURLOPT_RANGE: - /* - * What range of the file you want to transfer - */ - result = Curl_setstropt(&data->set.str[STRING_SET_RANGE], - va_arg(param, char *)); - break; case CURLOPT_RESUME_FROM: /* * Resume transfer at the given file position */ - arg = va_arg(param, long); if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.set_resume_from = arg; break; - case CURLOPT_RESUME_FROM_LARGE: - /* - * Resume transfer at the given file position - */ - bigsize = va_arg(param, curl_off_t); - if(bigsize < -1) - return CURLE_BAD_FUNCTION_ARGUMENT; - data->set.set_resume_from = bigsize; - break; - case CURLOPT_DEBUGFUNCTION: - /* - * stderr write callback. - */ - data->set.fdebug = va_arg(param, curl_debug_callback); - /* - * if the callback provided is NULL, it'll use the default callback - */ - break; - case CURLOPT_DEBUGDATA: - /* - * Set to a void * that should receive all error writes. This - * defaults to CURLOPT_STDERR for normal operations. - */ - data->set.debugdata = va_arg(param, void *); - break; - case CURLOPT_STDERR: - /* - * Set to a FILE * that should receive all error writes. This - * defaults to stderr for normal operations. - */ - data->set.err = va_arg(param, FILE *); - if(!data->set.err) - data->set.err = stderr; - break; - case CURLOPT_HEADERFUNCTION: - /* - * Set header write callback - */ - data->set.fwrite_header = va_arg(param, curl_write_callback); - break; - case CURLOPT_WRITEFUNCTION: - /* - * Set data write callback - */ - data->set.fwrite_func = va_arg(param, curl_write_callback); - if(!data->set.fwrite_func) - /* When set to NULL, reset to our internal default function */ - data->set.fwrite_func = (curl_write_callback)fwrite; - break; - case CURLOPT_READFUNCTION: - /* - * Read data callback - */ - data->set.fread_func_set = va_arg(param, curl_read_callback); - if(!data->set.fread_func_set) { - data->set.is_fread_set = 0; - /* When set to NULL, reset to our internal default function */ - data->set.fread_func_set = (curl_read_callback)fread; - } - else - data->set.is_fread_set = 1; - break; - case CURLOPT_SEEKFUNCTION: - /* - * Seek callback. Might be NULL. - */ - data->set.seek_func = va_arg(param, curl_seek_callback); - break; - case CURLOPT_SEEKDATA: - /* - * Seek control callback. Might be NULL. - */ - data->set.seek_client = va_arg(param, void *); - break; - case CURLOPT_IOCTLFUNCTION: - /* - * I/O control callback. Might be NULL. - */ - data->set.ioctl_func = va_arg(param, curl_ioctl_callback); - break; - case CURLOPT_IOCTLDATA: - /* - * I/O control data pointer. Might be NULL. - */ - data->set.ioctl_client = va_arg(param, void *); - break; - case CURLOPT_SSLCERT: - /* - * String that holds file name of the SSL certificate to use - */ - result = Curl_setstropt(&data->set.str[STRING_CERT], - va_arg(param, char *)); - break; - case CURLOPT_SSLCERT_BLOB: - /* - * Blob that holds file content of the SSL certificate to use - */ - result = Curl_setblobopt(&data->set.blobs[BLOB_CERT], - va_arg(param, struct curl_blob *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSLCERT: - /* - * String that holds file name of the SSL certificate to use for proxy - */ - result = Curl_setstropt(&data->set.str[STRING_CERT_PROXY], - va_arg(param, char *)); - break; - case CURLOPT_PROXY_SSLCERT_BLOB: - /* - * Blob that holds file content of the SSL certificate to use for proxy - */ - result = Curl_setblobopt(&data->set.blobs[BLOB_CERT_PROXY], - va_arg(param, struct curl_blob *)); - break; -#endif - case CURLOPT_SSLCERTTYPE: - /* - * String that holds file type of the SSL certificate to use - */ - result = Curl_setstropt(&data->set.str[STRING_CERT_TYPE], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSLCERTTYPE: - /* - * String that holds file type of the SSL certificate to use for proxy - */ - result = Curl_setstropt(&data->set.str[STRING_CERT_TYPE_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_SSLKEY: - /* - * String that holds file name of the SSL key to use - */ - result = Curl_setstropt(&data->set.str[STRING_KEY], - va_arg(param, char *)); - break; - case CURLOPT_SSLKEY_BLOB: - /* - * Blob that holds file content of the SSL key to use - */ - result = Curl_setblobopt(&data->set.blobs[BLOB_KEY], - va_arg(param, struct curl_blob *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSLKEY: - /* - * String that holds file name of the SSL key to use for proxy - */ - result = Curl_setstropt(&data->set.str[STRING_KEY_PROXY], - va_arg(param, char *)); - break; - case CURLOPT_PROXY_SSLKEY_BLOB: - /* - * Blob that holds file content of the SSL key to use for proxy - */ - result = Curl_setblobopt(&data->set.blobs[BLOB_KEY_PROXY], - va_arg(param, struct curl_blob *)); - break; -#endif - case CURLOPT_SSLKEYTYPE: - /* - * String that holds file type of the SSL key to use - */ - result = Curl_setstropt(&data->set.str[STRING_KEY_TYPE], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSLKEYTYPE: - /* - * String that holds file type of the SSL key to use for proxy - */ - result = Curl_setstropt(&data->set.str[STRING_KEY_TYPE_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_KEYPASSWD: - /* - * String that holds the SSL or SSH private key password. - */ - result = Curl_setstropt(&data->set.str[STRING_KEY_PASSWD], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_KEYPASSWD: - /* - * String that holds the SSL private key password for proxy. - */ - result = Curl_setstropt(&data->set.str[STRING_KEY_PASSWD_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_SSLENGINE: - /* - * String that holds the SSL crypto engine. - */ - argptr = va_arg(param, char *); - if(argptr && argptr[0]) { - result = Curl_setstropt(&data->set.str[STRING_SSL_ENGINE], argptr); - if(!result) { - result = Curl_ssl_set_engine(data, argptr); - } - } - break; - case CURLOPT_SSLENGINE_DEFAULT: - /* - * flag to set engine as default. - */ - Curl_setstropt(&data->set.str[STRING_SSL_ENGINE], NULL); - result = Curl_ssl_set_engine_default(data); - break; case CURLOPT_CRLF: /* * Kludgy option to enable CRLF conversions. Subject for removal. */ - data->set.crlf = (0 != va_arg(param, long)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_HAPROXYPROTOCOL: - /* - * Set to send the HAProxy Proxy Protocol header - */ - data->set.haproxyprotocol = (0 != va_arg(param, long)); - break; - case CURLOPT_HAPROXY_CLIENT_IP: - /* - * Set the client IP to send through HAProxy PROXY protocol - */ - result = Curl_setstropt(&data->set.str[STRING_HAPROXY_CLIENT_IP], - va_arg(param, char *)); - /* We enable implicitly the HAProxy protocol if we use this flag. */ - data->set.haproxyprotocol = TRUE; - break; -#endif - case CURLOPT_INTERFACE: - /* - * Set what interface or address/hostname to bind the socket to when - * performing an operation and thus what from-IP your connection will use. - */ - result = Curl_setstropt(&data->set.str[STRING_DEVICE], - va_arg(param, char *)); + data->set.crlf = enabled; break; + #ifndef CURL_DISABLE_BINDLOCAL case CURLOPT_LOCALPORT: /* * Set what local port to bind the socket to when performing an operation. */ - arg = va_arg(param, long); if((arg < 0) || (arg > 65535)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.localport = curlx_sltous(arg); @@ -1899,17 +917,16 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Set number of local ports to try, starting with CURLOPT_LOCALPORT. */ - arg = va_arg(param, long); if((arg < 0) || (arg > 65535)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.localportrange = curlx_sltous(arg); break; #endif + case CURLOPT_GSSAPI_DELEGATION: /* * GSS-API credential delegation bitmask */ - uarg = va_arg(param, unsigned long); data->set.gssapi_delegation = (unsigned char)uarg& (CURLGSSAPI_DELEGATION_POLICY_FLAG|CURLGSSAPI_DELEGATION_FLAG); break; @@ -1917,7 +934,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Enable peer SSL verifying. */ - data->set.ssl.primary.verifypeer = (0 != va_arg(param, long)); + data->set.ssl.primary.verifypeer = enabled; /* Update the current connection ssl_config. */ Curl_ssl_conn_config_update(data, FALSE); @@ -1927,295 +944,71 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Enable peer SSL verifying for DoH. */ - data->set.doh_verifypeer = (0 != va_arg(param, long)); + data->set.doh_verifypeer = enabled; break; -#endif -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSL_VERIFYPEER: - /* - * Enable peer SSL verifying for proxy. - */ - data->set.proxy_ssl.primary.verifypeer = - (0 != va_arg(param, long))?TRUE:FALSE; - - /* Update the current connection proxy_ssl_config. */ - Curl_ssl_conn_config_update(data, TRUE); - break; -#endif - case CURLOPT_SSL_VERIFYHOST: - /* - * Enable verification of the host name in the peer certificate - */ - arg = va_arg(param, long); - - /* Obviously people are not reading documentation and too many thought - this argument took a boolean when it wasn't and misused it. - Treat 1 and 2 the same */ - data->set.ssl.primary.verifyhost = !!(arg & 3); - - /* Update the current connection ssl_config. */ - Curl_ssl_conn_config_update(data, FALSE); - break; -#ifndef CURL_DISABLE_DOH case CURLOPT_DOH_SSL_VERIFYHOST: /* - * Enable verification of the host name in the peer certificate for DoH + * Enable verification of the hostname in the peer certificate for DoH */ - arg = va_arg(param, long); - - /* Treat both 1 and 2 as TRUE */ - data->set.doh_verifyhost = !!(arg & 3); + data->set.doh_verifyhost = enabled; break; -#endif -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_SSL_VERIFYHOST: - /* - * Enable verification of the host name in the peer certificate for proxy - */ - arg = va_arg(param, long); - - /* Treat both 1 and 2 as TRUE */ - data->set.proxy_ssl.primary.verifyhost = (bool)((arg & 3)?TRUE:FALSE); - /* Update the current connection proxy_ssl_config. */ - Curl_ssl_conn_config_update(data, TRUE); - break; -#endif - case CURLOPT_SSL_VERIFYSTATUS: - /* - * Enable certificate status verifying. - */ - if(!Curl_ssl_cert_status_request()) { - result = CURLE_NOT_BUILT_IN; - break; - } - - data->set.ssl.primary.verifystatus = (0 != va_arg(param, long)); - - /* Update the current connection ssl_config. */ - Curl_ssl_conn_config_update(data, FALSE); - break; -#ifndef CURL_DISABLE_DOH case CURLOPT_DOH_SSL_VERIFYSTATUS: /* * Enable certificate status verifying for DoH. */ - if(!Curl_ssl_cert_status_request()) { - result = CURLE_NOT_BUILT_IN; - break; - } + if(!Curl_ssl_cert_status_request()) + return CURLE_NOT_BUILT_IN; - data->set.doh_verifystatus = (0 != va_arg(param, long)); + data->set.doh_verifystatus = enabled; break; -#endif - case CURLOPT_SSL_CTX_FUNCTION: +#endif /* ! CURL_DISABLE_DOH */ + case CURLOPT_SSL_VERIFYHOST: /* - * Set a SSL_CTX callback + * Enable verification of the hostname in the peer certificate */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) - data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback); - else -#endif - result = CURLE_NOT_BUILT_IN; + + /* Obviously people are not reading documentation and too many thought + this argument took a boolean when it was not and misused it. + Treat 1 and 2 the same */ + data->set.ssl.primary.verifyhost = enabled; + + /* Update the current connection ssl_config. */ + Curl_ssl_conn_config_update(data, FALSE); break; - case CURLOPT_SSL_CTX_DATA: + case CURLOPT_SSL_VERIFYSTATUS: /* - * Set a SSL_CTX callback parameter pointer + * Enable certificate status verifying. */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) - data->set.ssl.fsslctxp = va_arg(param, void *); - else -#endif - result = CURLE_NOT_BUILT_IN; + if(!Curl_ssl_cert_status_request()) + return CURLE_NOT_BUILT_IN; + + data->set.ssl.primary.verifystatus = enabled; + + /* Update the current connection ssl_config. */ + Curl_ssl_conn_config_update(data, FALSE); break; case CURLOPT_SSL_FALSESTART: /* * Enable TLS false start. */ - if(!Curl_ssl_false_start(data)) { - result = CURLE_NOT_BUILT_IN; - break; - } + if(!Curl_ssl_false_start(data)) + return CURLE_NOT_BUILT_IN; - data->set.ssl.falsestart = (0 != va_arg(param, long)); + data->set.ssl.falsestart = enabled; break; case CURLOPT_CERTINFO: #ifdef USE_SSL if(Curl_ssl_supports(data, SSLSUPP_CERTINFO)) - data->set.ssl.certinfo = (0 != va_arg(param, long)); - else -#endif - result = CURLE_NOT_BUILT_IN; - break; - case CURLOPT_PINNEDPUBLICKEY: - /* - * Set pinned public key for SSL connection. - * Specify file name of the public key in DER format. - */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY)) - result = Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY], - va_arg(param, char *)); - else -#endif - result = CURLE_NOT_BUILT_IN; - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_PINNEDPUBLICKEY: - /* - * Set pinned public key for SSL connection. - * Specify file name of the public key in DER format. - */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY)) - result = Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY], - va_arg(param, char *)); - else -#endif - result = CURLE_NOT_BUILT_IN; - break; -#endif - case CURLOPT_CAINFO: - /* - * Set CA info for SSL connection. Specify file name of the CA certificate - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CAFILE], - va_arg(param, char *)); - break; - case CURLOPT_CAINFO_BLOB: - /* - * Blob that holds CA info for SSL connection. - * Specify entire PEM of the CA certificate - */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) { - result = Curl_setblobopt(&data->set.blobs[BLOB_CAINFO], - va_arg(param, struct curl_blob *)); - break; - } + data->set.ssl.certinfo = enabled; else #endif return CURLE_NOT_BUILT_IN; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_CAINFO: - /* - * Set CA info SSL connection for proxy. Specify file name of the - * CA certificate - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CAFILE_PROXY], - va_arg(param, char *)); break; - case CURLOPT_PROXY_CAINFO_BLOB: - /* - * Blob that holds CA info for SSL connection proxy. - * Specify entire PEM of the CA certificate - */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) { - result = Curl_setblobopt(&data->set.blobs[BLOB_CAINFO_PROXY], - va_arg(param, struct curl_blob *)); - break; - } - else -#endif - return CURLE_NOT_BUILT_IN; -#endif - case CURLOPT_CAPATH: - /* - * Set CA path info for SSL connection. Specify directory name of the CA - * certificates which have been prepared using openssl c_rehash utility. - */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) - /* This does not work on windows. */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CAPATH], - va_arg(param, char *)); - else -#endif - result = CURLE_NOT_BUILT_IN; - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_CAPATH: - /* - * Set CA path info for SSL connection proxy. Specify directory name of the - * CA certificates which have been prepared using openssl c_rehash utility. - */ -#ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) - /* This does not work on windows. */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CAPATH_PROXY], - va_arg(param, char *)); - else -#endif - result = CURLE_NOT_BUILT_IN; - break; -#endif - case CURLOPT_CRLFILE: - /* - * Set CRL file info for SSL connection. Specify file name of the CRL - * to check certificates revocation - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_CRLFILE: - /* - * Set CRL file info for SSL connection for proxy. Specify file name of the - * CRL to check certificates revocation - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_ISSUERCERT: - /* - * Set Issuer certificate file - * to check certificates issuer - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT], - va_arg(param, char *)); - break; - case CURLOPT_ISSUERCERT_BLOB: - /* - * Blob that holds Issuer certificate to check certificates issuer - */ - result = Curl_setblobopt(&data->set.blobs[BLOB_SSL_ISSUERCERT], - va_arg(param, struct curl_blob *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_ISSUERCERT: - /* - * Set Issuer certificate file - * to check certificates issuer - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT_PROXY], - va_arg(param, char *)); - break; - case CURLOPT_PROXY_ISSUERCERT_BLOB: - /* - * Blob that holds Issuer certificate to check certificates issuer - */ - result = Curl_setblobopt(&data->set.blobs[BLOB_SSL_ISSUERCERT_PROXY], - va_arg(param, struct curl_blob *)); - break; -#endif -#ifndef CURL_DISABLE_TELNET - case CURLOPT_TELNETOPTIONS: - /* - * Set a linked list of telnet options - */ - data->set.telnet_options = va_arg(param, struct curl_slist *); - break; -#endif case CURLOPT_BUFFERSIZE: /* * The application kindly asks for a differently sized receive buffer. - * If it seems reasonable, we'll use it. + * If it seems reasonable, we will use it. */ - arg = va_arg(param, long); - if(arg > READBUFFER_MAX) arg = READBUFFER_MAX; else if(arg < 1) @@ -2231,8 +1024,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * The application kindly asks for a differently sized upload buffer. * Cap it to sensible. */ - arg = va_arg(param, long); - if(arg > UPLOADBUFFER_MAX) arg = UPLOADBUFFER_MAX; else if(arg < UPLOADBUFFER_MIN) @@ -2246,106 +1037,12 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * The application asks not to set any signal() or alarm() handlers, * even when using a timeout. */ - data->set.no_signal = (0 != va_arg(param, long)); + data->set.no_signal = enabled; break; - - case CURLOPT_SHARE: - { - struct Curl_share *set; - set = va_arg(param, struct Curl_share *); - - /* disconnect from old share, if any */ - if(data->share) { - Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); - - if(data->dns.hostcachetype == HCACHE_SHARED) { - data->dns.hostcache = NULL; - data->dns.hostcachetype = HCACHE_NONE; - } - -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - if(data->share->cookies == data->cookies) - data->cookies = NULL; -#endif - -#ifndef CURL_DISABLE_HSTS - if(data->share->hsts == data->hsts) - data->hsts = NULL; -#endif -#ifdef USE_SSL - if(data->share->sslsession == data->state.session) - data->state.session = NULL; -#endif -#ifdef USE_LIBPSL - if(data->psl == &data->share->psl) - data->psl = data->multi? &data->multi->psl: NULL; -#endif - - data->share->dirty--; - - Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); - data->share = NULL; - } - - if(GOOD_SHARE_HANDLE(set)) - /* use new share if it set */ - data->share = set; - if(data->share) { - - Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); - - data->share->dirty++; - - if(data->share->specifier & (1<< CURL_LOCK_DATA_DNS)) { - /* use shared host cache */ - data->dns.hostcache = &data->share->hostcache; - data->dns.hostcachetype = HCACHE_SHARED; - } -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - if(data->share->cookies) { - /* use shared cookie list, first free own one if any */ - Curl_cookie_cleanup(data->cookies); - /* enable cookies since we now use a share that uses cookies! */ - data->cookies = data->share->cookies; - } -#endif /* CURL_DISABLE_HTTP */ -#ifndef CURL_DISABLE_HSTS - if(data->share->hsts) { - /* first free the private one if any */ - Curl_hsts_cleanup(&data->hsts); - data->hsts = data->share->hsts; - } -#endif /* CURL_DISABLE_HTTP */ -#ifdef USE_SSL - if(data->share->sslsession) { - data->set.general_ssl.max_ssl_sessions = data->share->max_ssl_sessions; - data->state.session = data->share->sslsession; - } -#endif -#ifdef USE_LIBPSL - if(data->share->specifier & (1 << CURL_LOCK_DATA_PSL)) - data->psl = &data->share->psl; -#endif - - Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); - } - /* check for host cache not needed, - * it will be done by curl_easy_perform */ - } - break; - - case CURLOPT_PRIVATE: - /* - * Set private data pointer. - */ - data->set.private_data = va_arg(param, void *); - break; - case CURLOPT_MAXFILESIZE: /* * Set the maximum size of a file to download. */ - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.max_filesize = arg; @@ -2356,14 +1053,11 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Make transfers attempt to use SSL/TLS. */ - arg = va_arg(param, long); if((arg < CURLUSESSL_NONE) || (arg >= CURLUSESSL_LAST)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.use_ssl = (unsigned char)arg; break; - case CURLOPT_SSL_OPTIONS: - arg = va_arg(param, long); data->set.ssl.primary.ssl_options = (unsigned char)(arg & 0xff); data->set.ssl.enable_beast = !!(arg & CURLSSLOPT_ALLOW_BEAST); data->set.ssl.no_revoke = !!(arg & CURLSSLOPT_NO_REVOKE); @@ -2371,13 +1065,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) data->set.ssl.revoke_best_effort = !!(arg & CURLSSLOPT_REVOKE_BEST_EFFORT); data->set.ssl.native_ca_store = !!(arg & CURLSSLOPT_NATIVE_CA); data->set.ssl.auto_client_cert = !!(arg & CURLSSLOPT_AUTO_CLIENT_CERT); + data->set.ssl.earlydata = !!(arg & CURLSSLOPT_EARLYDATA); /* If a setting is added here it should also be added in dohprobe() which sets its own CURLOPT_SSL_OPTIONS based on these settings. */ break; #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXY_SSL_OPTIONS: - arg = va_arg(param, long); data->set.proxy_ssl.primary.ssl_options = (unsigned char)(arg & 0xff); data->set.proxy_ssl.enable_beast = !!(arg & CURLSSLOPT_ALLOW_BEAST); data->set.proxy_ssl.no_revoke = !!(arg & CURLSSLOPT_NO_REVOKE); @@ -2390,42 +1084,22 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) break; #endif - case CURLOPT_SSL_EC_CURVES: - /* - * Set accepted curves in SSL connection setup. - * Specify colon-delimited list of curve algorithm names. - */ - result = Curl_setstropt(&data->set.str[STRING_SSL_EC_CURVES], - va_arg(param, char *)); - break; -#endif +#endif /* USE_SSL */ case CURLOPT_IPRESOLVE: - arg = va_arg(param, long); if((arg < CURL_IPRESOLVE_WHATEVER) || (arg > CURL_IPRESOLVE_V6)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.ipver = (unsigned char) arg; break; - - case CURLOPT_MAXFILESIZE_LARGE: - /* - * Set the maximum size of a file to download. - */ - bigsize = va_arg(param, curl_off_t); - if(bigsize < 0) - return CURLE_BAD_FUNCTION_ARGUMENT; - data->set.max_filesize = bigsize; - break; - case CURLOPT_TCP_NODELAY: /* * Enable or disable TCP_NODELAY, which will disable/enable the Nagle * algorithm */ - data->set.tcp_nodelay = (0 != va_arg(param, long)); + data->set.tcp_nodelay = enabled; break; case CURLOPT_IGNORE_CONTENT_LENGTH: - data->set.ignorecl = (0 != va_arg(param, long)); + data->set.ignorecl = enabled; break; case CURLOPT_CONNECT_ONLY: @@ -2434,172 +1108,45 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * (1) - only do connection * (2) - do first get request but get no content */ - arg = va_arg(param, long); if(arg > 2) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.connect_only = (unsigned char)arg; break; - case CURLOPT_SOCKOPTFUNCTION: - /* - * socket callback function: called after socket() but before connect() - */ - data->set.fsockopt = va_arg(param, curl_sockopt_callback); - break; - - case CURLOPT_SOCKOPTDATA: - /* - * socket callback data pointer. Might be NULL. - */ - data->set.sockopt_client = va_arg(param, void *); - break; - - case CURLOPT_OPENSOCKETFUNCTION: - /* - * open/create socket callback function: called instead of socket(), - * before connect() - */ - data->set.fopensocket = va_arg(param, curl_opensocket_callback); - break; - - case CURLOPT_OPENSOCKETDATA: - /* - * socket callback data pointer. Might be NULL. - */ - data->set.opensocket_client = va_arg(param, void *); - break; - - case CURLOPT_CLOSESOCKETFUNCTION: - /* - * close socket callback function: called instead of close() - * when shutting down a connection - */ - data->set.fclosesocket = va_arg(param, curl_closesocket_callback); - break; - - case CURLOPT_RESOLVER_START_FUNCTION: - /* - * resolver start callback function: called before a new resolver request - * is started - */ - data->set.resolver_start = va_arg(param, curl_resolver_start_callback); - break; - - case CURLOPT_RESOLVER_START_DATA: - /* - * resolver start callback data pointer. Might be NULL. - */ - data->set.resolver_start_client = va_arg(param, void *); - break; - - case CURLOPT_CLOSESOCKETDATA: - /* - * socket callback data pointer. Might be NULL. - */ - data->set.closesocket_client = va_arg(param, void *); - break; - case CURLOPT_SSL_SESSIONID_CACHE: - data->set.ssl.primary.sessionid = (0 != va_arg(param, long)); + data->set.ssl.primary.cache_session = enabled; #ifndef CURL_DISABLE_PROXY - data->set.proxy_ssl.primary.sessionid = data->set.ssl.primary.sessionid; + data->set.proxy_ssl.primary.cache_session = + data->set.ssl.primary.cache_session; #endif break; #ifdef USE_SSH /* we only include SSH options if explicitly built to support SSH */ case CURLOPT_SSH_AUTH_TYPES: - data->set.ssh_auth_types = (unsigned int)va_arg(param, long); + data->set.ssh_auth_types = (int)arg; break; - - case CURLOPT_SSH_PUBLIC_KEYFILE: - /* - * Use this file instead of the $HOME/.ssh/id_dsa.pub file - */ - result = Curl_setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY], - va_arg(param, char *)); - break; - - case CURLOPT_SSH_PRIVATE_KEYFILE: - /* - * Use this file instead of the $HOME/.ssh/id_dsa file - */ - result = Curl_setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY], - va_arg(param, char *)); - break; - case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5: - /* - * Option to allow for the MD5 of the host public key to be checked - * for validation purposes. - */ - result = Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5], - va_arg(param, char *)); - break; - - case CURLOPT_SSH_KNOWNHOSTS: - /* - * Store the file name to read known hosts from. - */ - result = Curl_setstropt(&data->set.str[STRING_SSH_KNOWNHOSTS], - va_arg(param, char *)); - break; -#ifdef USE_LIBSSH2 - case CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256: - /* - * Option to allow for the SHA256 of the host public key to be checked - * for validation purposes. - */ - result = Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_SHA256], - va_arg(param, char *)); - break; - - case CURLOPT_SSH_HOSTKEYFUNCTION: - /* the callback to check the hostkey without the knownhost file */ - data->set.ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback); - break; - - case CURLOPT_SSH_HOSTKEYDATA: - /* - * Custom client data to pass to the SSH keyfunc callback - */ - data->set.ssh_hostkeyfunc_userp = va_arg(param, void *); + case CURLOPT_SSH_COMPRESSION: + data->set.ssh_compression = enabled; break; #endif - case CURLOPT_SSH_KEYFUNCTION: - /* setting to NULL is fine since the ssh.c functions themselves will - then revert to use the internal default */ - data->set.ssh_keyfunc = va_arg(param, curl_sshkeycallback); - break; - - case CURLOPT_SSH_KEYDATA: - /* - * Custom client data to pass to the SSH keyfunc callback - */ - data->set.ssh_keyfunc_userp = va_arg(param, void *); - break; - - case CURLOPT_SSH_COMPRESSION: - data->set.ssh_compression = (0 != va_arg(param, long))?TRUE:FALSE; - break; -#endif /* USE_SSH */ - case CURLOPT_HTTP_TRANSFER_DECODING: /* * disable libcurl transfer encoding is used */ #ifndef USE_HYPER - data->set.http_te_skip = (0 == va_arg(param, long)); + data->set.http_te_skip = !enabled; /* reversed */ break; #else - return CURLE_NOT_BUILT_IN; /* hyper doesn't support */ + return CURLE_NOT_BUILT_IN; /* hyper does not support */ #endif case CURLOPT_HTTP_CONTENT_DECODING: /* * raw data passed to the application when content encoding is used */ - data->set.http_ce_skip = (0 == va_arg(param, long)); + data->set.http_ce_skip = enabled; break; #if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) @@ -2607,7 +1154,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Uses these permissions instead of 0644 */ - arg = va_arg(param, long); if((arg < 0) || (arg > 0777)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.new_file_perms = (unsigned int)arg; @@ -2618,21 +1164,18 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Uses these permissions instead of 0755 */ - arg = va_arg(param, long); if((arg < 0) || (arg > 0777)) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.new_directory_perms = (unsigned int)arg; break; #endif - -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case CURLOPT_ADDRESS_SCOPE: /* * Use this scope id when using IPv6 * We always get longs when passed plain numericals so we should check - * that the value fits into an unsigned 32 bit integer. + * that the value fits into an unsigned 32-bit integer. */ - uarg = va_arg(param, unsigned long); #if SIZEOF_LONG > 4 if(uarg > UINT_MAX) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -2640,75 +1183,30 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) data->set.scope_id = (unsigned int)uarg; break; #endif - case CURLOPT_PROTOCOLS: /* set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other - external inputs and want to restrict what protocol(s) to deal - with. Defaults to CURLPROTO_ALL. */ - data->set.allowed_protocols = (curl_prot_t)va_arg(param, long); + external inputs and want to restrict what protocol(s) to deal with. + Defaults to CURLPROTO_ALL. */ + data->set.allowed_protocols = (curl_prot_t)arg; break; case CURLOPT_REDIR_PROTOCOLS: /* set the bitmask for the protocols that libcurl is allowed to follow to, - as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs - to be set in both bitmasks to be allowed to get redirected to. */ - data->set.redir_protocols = (curl_prot_t)va_arg(param, long); + as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol + needs to be set in both bitmasks to be allowed to get redirected to. */ + data->set.redir_protocols = (curl_prot_t)arg; break; - case CURLOPT_PROTOCOLS_STR: { - argptr = va_arg(param, char *); - result = protocol2num(argptr, &data->set.allowed_protocols); - if(result) - return result; - break; - } - - case CURLOPT_REDIR_PROTOCOLS_STR: { - argptr = va_arg(param, char *); - result = protocol2num(argptr, &data->set.redir_protocols); - if(result) - return result; - break; - } - - case CURLOPT_DEFAULT_PROTOCOL: - /* Set the protocol to use when the URL doesn't include any protocol */ - result = Curl_setstropt(&data->set.str[STRING_DEFAULT_PROTOCOL], - va_arg(param, char *)); - break; #ifndef CURL_DISABLE_SMTP - case CURLOPT_MAIL_FROM: - /* Set the SMTP mail originator */ - result = Curl_setstropt(&data->set.str[STRING_MAIL_FROM], - va_arg(param, char *)); - break; - - case CURLOPT_MAIL_AUTH: - /* Set the SMTP auth originator */ - result = Curl_setstropt(&data->set.str[STRING_MAIL_AUTH], - va_arg(param, char *)); - break; - - case CURLOPT_MAIL_RCPT: - /* Set the list of mail recipients */ - data->set.mail_rcpt = va_arg(param, struct curl_slist *); - break; case CURLOPT_MAIL_RCPT_ALLOWFAILS: /* allow RCPT TO command to fail for some recipients */ - data->set.mail_rcpt_allowfails = (0 != va_arg(param, long)); + data->set.mail_rcpt_allowfails = enabled; break; -#endif - - case CURLOPT_SASL_AUTHZID: - /* Authorization identity (identity to act as) */ - result = Curl_setstropt(&data->set.str[STRING_SASL_AUTHZID], - va_arg(param, char *)); - break; - +#endif /* !CURL_DISABLE_SMTP */ case CURLOPT_SASL_IR: /* Enable/disable SASL initial response */ - data->set.sasl_ir = (0 != va_arg(param, long)); + data->set.sasl_ir = enabled; break; #ifndef CURL_DISABLE_RTSP case CURLOPT_RTSP_REQUEST: @@ -2717,9 +1215,8 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Set the RTSP request method (OPTIONS, SETUP, PLAY, etc...) * Would this be better if the RTSPREQ_* were just moved into here? */ - long in_rtspreq = va_arg(param, long); Curl_RtspReq rtspreq = RTSPREQ_NONE; - switch(in_rtspreq) { + switch(arg) { case CURL_RTSPREQ_OPTIONS: rtspreq = RTSPREQ_OPTIONS; break; @@ -2764,151 +1261,32 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) rtspreq = RTSPREQ_RECEIVE; break; default: - rtspreq = RTSPREQ_NONE; + return CURLE_BAD_FUNCTION_ARGUMENT; } data->set.rtspreq = rtspreq; break; } - - - case CURLOPT_RTSP_SESSION_ID: - /* - * Set the RTSP Session ID manually. Useful if the application is - * resuming a previously established RTSP session - */ - result = Curl_setstropt(&data->set.str[STRING_RTSP_SESSION_ID], - va_arg(param, char *)); - break; - - case CURLOPT_RTSP_STREAM_URI: - /* - * Set the Stream URI for the RTSP request. Unless the request is - * for generic server options, the application will need to set this. - */ - result = Curl_setstropt(&data->set.str[STRING_RTSP_STREAM_URI], - va_arg(param, char *)); - break; - - case CURLOPT_RTSP_TRANSPORT: - /* - * The content of the Transport: header for the RTSP request - */ - result = Curl_setstropt(&data->set.str[STRING_RTSP_TRANSPORT], - va_arg(param, char *)); - break; - case CURLOPT_RTSP_CLIENT_CSEQ: /* * Set the CSEQ number to issue for the next RTSP request. Useful if the * application is resuming a previously broken connection. The CSEQ * will increment from this new number henceforth. */ - data->state.rtsp_next_client_CSeq = va_arg(param, long); + data->state.rtsp_next_client_CSeq = arg; break; case CURLOPT_RTSP_SERVER_CSEQ: /* Same as the above, but for server-initiated requests */ - data->state.rtsp_next_server_CSeq = va_arg(param, long); + data->state.rtsp_next_server_CSeq = arg; break; - case CURLOPT_INTERLEAVEDATA: - data->set.rtp_out = va_arg(param, void *); - break; - case CURLOPT_INTERLEAVEFUNCTION: - /* Set the user defined RTP write function */ - data->set.fwrite_rtp = va_arg(param, curl_write_callback); - break; -#endif -#ifndef CURL_DISABLE_FTP - case CURLOPT_WILDCARDMATCH: - data->set.wildcard_enabled = (0 != va_arg(param, long)); - break; - case CURLOPT_CHUNK_BGN_FUNCTION: - data->set.chunk_bgn = va_arg(param, curl_chunk_bgn_callback); - break; - case CURLOPT_CHUNK_END_FUNCTION: - data->set.chunk_end = va_arg(param, curl_chunk_end_callback); - break; - case CURLOPT_FNMATCH_FUNCTION: - data->set.fnmatch = va_arg(param, curl_fnmatch_callback); - break; - case CURLOPT_CHUNK_DATA: - data->set.wildcardptr = va_arg(param, void *); - break; - case CURLOPT_FNMATCH_DATA: - data->set.fnmatch_data = va_arg(param, void *); - break; -#endif -#ifdef USE_TLS_SRP - case CURLOPT_TLSAUTH_USERNAME: - result = Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_TLSAUTH_USERNAME: - result = Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_TLSAUTH_PASSWORD: - result = Curl_setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD], - va_arg(param, char *)); - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_TLSAUTH_PASSWORD: - result = Curl_setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD_PROXY], - va_arg(param, char *)); - break; -#endif - case CURLOPT_TLSAUTH_TYPE: - argptr = va_arg(param, char *); - if(argptr && !strcasecompare(argptr, "SRP")) - return CURLE_BAD_FUNCTION_ARGUMENT; - break; -#ifndef CURL_DISABLE_PROXY - case CURLOPT_PROXY_TLSAUTH_TYPE: - argptr = va_arg(param, char *); - if(argptr && !strcasecompare(argptr, "SRP")) - return CURLE_BAD_FUNCTION_ARGUMENT; - break; -#endif -#endif -#ifdef USE_ARES - case CURLOPT_DNS_SERVERS: - result = Curl_setstropt(&data->set.str[STRING_DNS_SERVERS], - va_arg(param, char *)); - if(result) - return result; - result = Curl_set_dns_servers(data, data->set.str[STRING_DNS_SERVERS]); - break; - case CURLOPT_DNS_INTERFACE: - result = Curl_setstropt(&data->set.str[STRING_DNS_INTERFACE], - va_arg(param, char *)); - if(result) - return result; - result = Curl_set_dns_interface(data, data->set.str[STRING_DNS_INTERFACE]); - break; - case CURLOPT_DNS_LOCAL_IP4: - result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP4], - va_arg(param, char *)); - if(result) - return result; - result = Curl_set_dns_local_ip4(data, data->set.str[STRING_DNS_LOCAL_IP4]); - break; - case CURLOPT_DNS_LOCAL_IP6: - result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP6], - va_arg(param, char *)); - if(result) - return result; - result = Curl_set_dns_local_ip6(data, data->set.str[STRING_DNS_LOCAL_IP6]); - break; -#endif +#endif /* ! CURL_DISABLE_RTSP */ + case CURLOPT_TCP_KEEPALIVE: - data->set.tcp_keepalive = (0 != va_arg(param, long)); + data->set.tcp_keepalive = enabled; break; case CURLOPT_TCP_KEEPIDLE: - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; else if(arg > INT_MAX) @@ -2916,131 +1294,1314 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) data->set.tcp_keepidle = (int)arg; break; case CURLOPT_TCP_KEEPINTVL: - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; else if(arg > INT_MAX) arg = INT_MAX; data->set.tcp_keepintvl = (int)arg; break; + case CURLOPT_TCP_KEEPCNT: + if(arg < 0) + return CURLE_BAD_FUNCTION_ARGUMENT; + else if(arg > INT_MAX) + arg = INT_MAX; + data->set.tcp_keepcnt = (int)arg; + break; case CURLOPT_TCP_FASTOPEN: -#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \ - defined(TCP_FASTOPEN_CONNECT) - data->set.tcp_fastopen = (0 != va_arg(param, long))?TRUE:FALSE; +#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \ + defined(TCP_FASTOPEN_CONNECT) + data->set.tcp_fastopen = enabled; #else - result = CURLE_NOT_BUILT_IN; + return CURLE_NOT_BUILT_IN; #endif break; case CURLOPT_SSL_ENABLE_NPN: break; case CURLOPT_SSL_ENABLE_ALPN: - data->set.ssl_enable_alpn = (0 != va_arg(param, long)); + data->set.ssl_enable_alpn = enabled; break; -#ifdef USE_UNIX_SOCKETS - case CURLOPT_UNIX_SOCKET_PATH: - data->set.abstract_unix_socket = FALSE; - result = Curl_setstropt(&data->set.str[STRING_UNIX_SOCKET_PATH], - va_arg(param, char *)); - break; - case CURLOPT_ABSTRACT_UNIX_SOCKET: - data->set.abstract_unix_socket = TRUE; - result = Curl_setstropt(&data->set.str[STRING_UNIX_SOCKET_PATH], - va_arg(param, char *)); - break; -#endif - case CURLOPT_PATH_AS_IS: - data->set.path_as_is = (0 != va_arg(param, long)); + data->set.path_as_is = enabled; break; case CURLOPT_PIPEWAIT: - data->set.pipewait = (0 != va_arg(param, long)); + data->set.pipewait = enabled; break; case CURLOPT_STREAM_WEIGHT: #if defined(USE_HTTP2) || defined(USE_HTTP3) - arg = va_arg(param, long); if((arg >= 1) && (arg <= 256)) data->set.priority.weight = (int)arg; break; #else return CURLE_NOT_BUILT_IN; #endif - case CURLOPT_STREAM_DEPENDS: - case CURLOPT_STREAM_DEPENDS_E: - { - struct Curl_easy *dep = va_arg(param, struct Curl_easy *); - if(!dep || GOOD_EASY_HANDLE(dep)) { - return Curl_data_priority_add_child(dep, data, - option == CURLOPT_STREAM_DEPENDS_E); - } - break; - } - case CURLOPT_CONNECT_TO: - data->set.connect_to = va_arg(param, struct curl_slist *); - break; case CURLOPT_SUPPRESS_CONNECT_HEADERS: - data->set.suppress_connect_headers = (0 != va_arg(param, long))?TRUE:FALSE; + data->set.suppress_connect_headers = enabled; break; case CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS: - uarg = va_arg(param, unsigned long); if(uarg > UINT_MAX) uarg = UINT_MAX; data->set.happy_eyeballs_timeout = (unsigned int)uarg; break; #ifndef CURL_DISABLE_SHUFFLE_DNS case CURLOPT_DNS_SHUFFLE_ADDRESSES: - data->set.dns_shuffle_addresses = (0 != va_arg(param, long)); + data->set.dns_shuffle_addresses = enabled; break; #endif case CURLOPT_DISALLOW_USERNAME_IN_URL: - data->set.disallow_username_in_url = (0 != va_arg(param, long)); + data->set.disallow_username_in_url = enabled; break; -#ifndef CURL_DISABLE_DOH - case CURLOPT_DOH_URL: - result = Curl_setstropt(&data->set.str[STRING_DOH], - va_arg(param, char *)); - data->set.doh = data->set.str[STRING_DOH]?TRUE:FALSE; - break; -#endif + case CURLOPT_UPKEEP_INTERVAL_MS: - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.upkeep_interval_ms = arg; break; case CURLOPT_MAXAGE_CONN: - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.maxage_conn = arg; break; case CURLOPT_MAXLIFETIME_CONN: - arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; data->set.maxlifetime_conn = arg; break; - case CURLOPT_TRAILERFUNCTION: -#ifndef CURL_DISABLE_HTTP - data->set.trailer_callback = va_arg(param, curl_trailer_callback); +#ifndef CURL_DISABLE_HSTS + case CURLOPT_HSTS_CTRL: + if(arg & CURLHSTS_ENABLE) { + if(!data->hsts) { + data->hsts = Curl_hsts_init(); + if(!data->hsts) + return CURLE_OUT_OF_MEMORY; + } + } + else + Curl_hsts_cleanup(&data->hsts); + break; +#endif /* ! CURL_DISABLE_HSTS */ +#ifndef CURL_DISABLE_ALTSVC + case CURLOPT_ALTSVC_CTRL: + if(!arg) { + DEBUGF(infof(data, "bad CURLOPT_ALTSVC_CTRL input")); + return CURLE_BAD_FUNCTION_ARGUMENT; + } + if(!data->asi) { + data->asi = Curl_altsvc_init(); + if(!data->asi) + return CURLE_OUT_OF_MEMORY; + } + return Curl_altsvc_ctrl(data->asi, arg); +#endif /* ! CURL_DISABLE_ALTSVC */ +#ifndef CURL_DISABLE_WEBSOCKETS + case CURLOPT_WS_OPTIONS: + data->set.ws_raw_mode = (bool)(arg & CURLWS_RAW_MODE); + break; #endif + case CURLOPT_QUICK_EXIT: + data->set.quick_exit = enabled; + break; + case CURLOPT_DNS_USE_GLOBAL_CACHE: + /* deprecated */ + break; + case CURLOPT_SSLENGINE_DEFAULT: + /* + * flag to set engine as default. + */ + Curl_safefree(data->set.str[STRING_SSL_ENGINE]); + return Curl_ssl_set_engine_default(data); + + default: + /* unknown option */ + return CURLE_UNKNOWN_OPTION; + } + return CURLE_OK; +} + +static CURLcode setopt_slist(struct Curl_easy *data, CURLoption option, + struct curl_slist *slist) +{ + CURLcode result = CURLE_OK; + switch(option) { +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXYHEADER: + /* + * Set a list with proxy headers to use (or replace internals with) + * + * Since CURLOPT_HTTPHEADER was the only way to set HTTP headers for a + * long time we remain doing it this way until CURLOPT_PROXYHEADER is + * used. As soon as this option has been used, if set to anything but + * NULL, custom headers for proxies are only picked from this list. + * + * Set this option to NULL to restore the previous behavior. + */ + data->set.proxyheaders = slist; + break; +#endif +#ifndef CURL_DISABLE_HTTP + case CURLOPT_HTTP200ALIASES: + /* + * Set a list of aliases for HTTP 200 in response header + */ + data->set.http200aliases = slist; + break; +#endif +#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) + case CURLOPT_POSTQUOTE: + /* + * List of RAW FTP commands to use after a transfer + */ + data->set.postquote = slist; + break; + case CURLOPT_PREQUOTE: + /* + * List of RAW FTP commands to use prior to RETR (Wesley Laxton) + */ + data->set.prequote = slist; + break; + case CURLOPT_QUOTE: + /* + * List of RAW FTP commands to use before a transfer + */ + data->set.quote = slist; + break; +#endif + case CURLOPT_RESOLVE: + /* + * List of HOST:PORT:[addresses] strings to populate the DNS cache with + * Entries added this way will remain in the cache until explicitly + * removed or the handle is cleaned up. + * + * Prefix the HOST with plus sign (+) to have the entry expire just like + * automatically added entries. + * + * Prefix the HOST with dash (-) to _remove_ the entry from the cache. + * + * This API can remove any entry from the DNS cache, but only entries + * that are not actually in use right now will be pruned immediately. + */ + data->set.resolve = slist; + data->state.resolve = data->set.resolve; + break; +#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MIME) + case CURLOPT_HTTPHEADER: + /* + * Set a list with HTTP headers to use (or replace internals with) + */ + data->set.headers = slist; + break; +#endif +#ifndef CURL_DISABLE_TELNET + case CURLOPT_TELNETOPTIONS: + /* + * Set a linked list of telnet options + */ + data->set.telnet_options = slist; + break; +#endif +#ifndef CURL_DISABLE_SMTP + case CURLOPT_MAIL_RCPT: + /* Set the list of mail recipients */ + data->set.mail_rcpt = slist; + break; +#endif + case CURLOPT_CONNECT_TO: + data->set.connect_to = slist; + break; + default: + return CURLE_UNKNOWN_OPTION; + } + return result; +} + +/* assorted pointer type arguments */ +static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, + va_list param) +{ + CURLcode result = CURLE_OK; + switch(option) { +#ifndef CURL_DISABLE_HTTP +#ifndef CURL_DISABLE_FORM_API + case CURLOPT_HTTPPOST: + /* + * Set to make us do HTTP POST. Legacy API-style. + */ + data->set.httppost = va_arg(param, struct curl_httppost *); + data->set.method = HTTPREQ_POST_FORM; + data->set.opt_no_body = FALSE; /* this is implied */ + Curl_mime_cleanpart(data->state.formp); + Curl_safefree(data->state.formp); + data->state.mimepost = NULL; + break; +#endif /* ! CURL_DISABLE_FORM_API */ +#endif /* ! CURL_DISABLE_HTTP */ +#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ + !defined(CURL_DISABLE_IMAP) +# ifndef CURL_DISABLE_MIME + case CURLOPT_MIMEPOST: + /* + * Set to make us do MIME POST + */ + result = Curl_mime_set_subparts(&data->set.mimepost, + va_arg(param, curl_mime *), + FALSE); + if(!result) { + data->set.method = HTTPREQ_POST_MIME; + data->set.opt_no_body = FALSE; /* this is implied */ +#ifndef CURL_DISABLE_FORM_API + Curl_mime_cleanpart(data->state.formp); + Curl_safefree(data->state.formp); + data->state.mimepost = NULL; +#endif + } + break; +#endif /* ! CURL_DISABLE_MIME */ +#endif /* ! disabled HTTP, SMTP or IMAP */ + case CURLOPT_STDERR: + /* + * Set to a FILE * that should receive all error writes. This + * defaults to stderr for normal operations. + */ + data->set.err = va_arg(param, FILE *); + if(!data->set.err) + data->set.err = stderr; + break; + case CURLOPT_SHARE: + { + struct Curl_share *set = va_arg(param, struct Curl_share *); + + /* disconnect from old share, if any */ + if(data->share) { + Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); + + if(data->dns.hostcachetype == HCACHE_SHARED) { + data->dns.hostcache = NULL; + data->dns.hostcachetype = HCACHE_NONE; + } + +#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) + if(data->share->cookies == data->cookies) + data->cookies = NULL; +#endif + +#ifndef CURL_DISABLE_HSTS + if(data->share->hsts == data->hsts) + data->hsts = NULL; +#endif +#ifdef USE_SSL + if(data->share->sslsession == data->state.session) + data->state.session = NULL; +#endif +#ifdef USE_LIBPSL + if(data->psl == &data->share->psl) + data->psl = data->multi ? &data->multi->psl : NULL; +#endif + + data->share->dirty--; + + Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); + data->share = NULL; + } + + if(GOOD_SHARE_HANDLE(set)) + /* use new share if it set */ + data->share = set; + if(data->share) { + + Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); + + data->share->dirty++; + + if(data->share->specifier & (1 << CURL_LOCK_DATA_DNS)) { + /* use shared host cache */ + data->dns.hostcache = &data->share->hostcache; + data->dns.hostcachetype = HCACHE_SHARED; + } +#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) + if(data->share->cookies) { + /* use shared cookie list, first free own one if any */ + Curl_cookie_cleanup(data->cookies); + /* enable cookies since we now use a share that uses cookies! */ + data->cookies = data->share->cookies; + } +#endif /* CURL_DISABLE_HTTP */ +#ifndef CURL_DISABLE_HSTS + if(data->share->hsts) { + /* first free the private one if any */ + Curl_hsts_cleanup(&data->hsts); + data->hsts = data->share->hsts; + } +#endif +#ifdef USE_SSL + if(data->share->sslsession) { + data->set.general_ssl.max_ssl_sessions = data->share->max_ssl_sessions; + data->state.session = data->share->sslsession; + } +#endif +#ifdef USE_LIBPSL + if(data->share->specifier & (1 << CURL_LOCK_DATA_PSL)) + data->psl = &data->share->psl; +#endif + + Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); + } + /* check for host cache not needed, + * it will be done by curl_easy_perform */ + } + break; + +#ifdef USE_HTTP2 + case CURLOPT_STREAM_DEPENDS: + case CURLOPT_STREAM_DEPENDS_E: { + struct Curl_easy *dep = va_arg(param, struct Curl_easy *); + if(!dep || GOOD_EASY_HANDLE(dep)) + return Curl_data_priority_add_child(dep, data, + option == CURLOPT_STREAM_DEPENDS_E); + break; + } +#endif + + default: + return CURLE_UNKNOWN_OPTION; + } + return result; +} + +static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, + char *ptr) +{ + CURLcode result = CURLE_OK; + switch(option) { + case CURLOPT_SSL_CIPHER_LIST: + if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) + /* set a list of cipher we want to use in the SSL connection */ + return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST], ptr); + return CURLE_NOT_BUILT_IN; + break; +#ifndef CURL_DISABLE_PROXY + 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(&data->set.str[STRING_SSL_CIPHER_LIST_PROXY], + ptr); + } + else + return CURLE_NOT_BUILT_IN; + break; +#endif + case CURLOPT_TLS13_CIPHERS: + if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) { + /* set preferred list of TLS 1.3 cipher suites */ + return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER13_LIST], ptr); + } + else + return CURLE_NOT_BUILT_IN; + break; +#ifndef CURL_DISABLE_PROXY + 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(&data->set.str[STRING_SSL_CIPHER13_LIST_PROXY], + ptr); + else + return CURLE_NOT_BUILT_IN; + break; +#endif + case CURLOPT_RANDOM_FILE: + break; + case CURLOPT_EGDSOCKET: + break; + case CURLOPT_REQUEST_TARGET: + return Curl_setstropt(&data->set.str[STRING_TARGET], ptr); +#ifndef CURL_DISABLE_NETRC + case CURLOPT_NETRC_FILE: + /* + * Use this file instead of the $HOME/.netrc file + */ + return Curl_setstropt(&data->set.str[STRING_NETRC_FILE], ptr); +#endif + +#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT) + case CURLOPT_COPYPOSTFIELDS: + /* + * 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. + */ + if(!ptr || data->set.postfieldsize == -1) + result = Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], ptr); + else { + if(data->set.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(data->set.postfieldsize > SIZE_T_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)data->set.postfieldsize); + if(!p) + return CURLE_OUT_OF_MEMORY; + else { + free(data->set.str[STRING_COPYPOSTFIELDS]); + data->set.str[STRING_COPYPOSTFIELDS] = p; + } + } + } + + data->set.postfields = data->set.str[STRING_COPYPOSTFIELDS]; + data->set.method = HTTPREQ_POST; + break; + + case CURLOPT_POSTFIELDS: + /* + * Like above, but use static data instead of copying it. + */ + data->set.postfields = ptr; + /* Release old copied data. */ + Curl_safefree(data->set.str[STRING_COPYPOSTFIELDS]); + data->set.method = HTTPREQ_POST; + break; + +#ifndef CURL_DISABLE_HTTP + case CURLOPT_ACCEPT_ENCODING: + /* + * String to use at the value of Accept-Encoding header. + * + * If the encoding is set to "" we use an Accept-Encoding header that + * encompasses all the encodings we support. + * If the encoding is set to NULL we do not send an Accept-Encoding header + * and ignore an received Content-Encoding header. + * + */ + if(ptr && !*ptr) { + char all[256]; + Curl_all_content_encodings(all, sizeof(all)); + return Curl_setstropt(&data->set.str[STRING_ENCODING], all); + } + return Curl_setstropt(&data->set.str[STRING_ENCODING], ptr); + +#if !defined(CURL_DISABLE_AWS) + case CURLOPT_AWS_SIGV4: + /* + * String that is merged to some authentication + * parameters are used by the algorithm. + */ + result = Curl_setstropt(&data->set.str[STRING_AWS_SIGV4], ptr); + /* + * Basic been set by default it need to be unset here + */ + if(data->set.str[STRING_AWS_SIGV4]) + data->set.httpauth = CURLAUTH_AWS_SIGV4; + break; +#endif + case CURLOPT_REFERER: + /* + * 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(&data->set.str[STRING_SET_REFERER], ptr); + data->state.referer = data->set.str[STRING_SET_REFERER]; + break; + + case CURLOPT_USERAGENT: + /* + * String to use in the HTTP User-Agent field + */ + return Curl_setstropt(&data->set.str[STRING_USERAGENT], ptr); + +#if !defined(CURL_DISABLE_COOKIES) + case CURLOPT_COOKIE: + /* + * Cookie string to send to the remote server in the request. + */ + return Curl_setstropt(&data->set.str[STRING_COOKIE], ptr); + + case CURLOPT_COOKIEFILE: + /* + * Set cookie file to read and parse. Can be used multiple times. + */ + if(ptr) { + struct curl_slist *cl; + /* general protection against mistakes and abuse */ + if(strlen(ptr) > CURL_MAX_INPUT_LENGTH) + return CURLE_BAD_FUNCTION_ARGUMENT; + /* append the cookie filename to the list of filenames, and deal with + them later */ + cl = curl_slist_append(data->state.cookielist, ptr); + if(!cl) { + curl_slist_free_all(data->state.cookielist); + data->state.cookielist = NULL; + return CURLE_OUT_OF_MEMORY; + } + data->state.cookielist = cl; /* store the list for later use */ + } + else { + /* clear the list of cookie files */ + curl_slist_free_all(data->state.cookielist); + data->state.cookielist = NULL; + + if(!data->share || !data->share->cookies) { + /* throw away all existing cookies if this is not a shared cookie + container */ + Curl_cookie_clearall(data->cookies); + Curl_cookie_cleanup(data->cookies); + } + /* disable the cookie engine */ + data->cookies = NULL; + } + break; + + case CURLOPT_COOKIEJAR: + /* + * Set cookie filename to dump all cookies to when we are done. + */ + result = Curl_setstropt(&data->set.str[STRING_COOKIEJAR], ptr); + if(!result) { + /* + * Activate the cookie parser. This may or may not already + * have been made. + */ + struct CookieInfo *newcookies = + Curl_cookie_init(data, NULL, data->cookies, data->set.cookiesession); + if(!newcookies) + result = CURLE_OUT_OF_MEMORY; + data->cookies = newcookies; + } + break; + + case CURLOPT_COOKIELIST: + if(!ptr) + break; + + if(strcasecompare(ptr, "ALL")) { + /* clear all cookies */ + Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); + Curl_cookie_clearall(data->cookies); + Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); + } + else if(strcasecompare(ptr, "SESS")) { + /* clear session cookies */ + Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); + Curl_cookie_clearsess(data->cookies); + Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); + } + else if(strcasecompare(ptr, "FLUSH")) { + /* flush cookies to file, takes care of the locking */ + Curl_flush_cookies(data, FALSE); + } + else if(strcasecompare(ptr, "RELOAD")) { + /* reload cookies from file */ + Curl_cookie_loadfiles(data); + break; + } + else { + if(!data->cookies) { + /* if cookie engine was not running, activate it */ + data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE); + if(!data->cookies) + return CURLE_OUT_OF_MEMORY; + } + + /* general protection against mistakes and abuse */ + if(strlen(ptr) > CURL_MAX_INPUT_LENGTH) + return CURLE_BAD_FUNCTION_ARGUMENT; + + 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); + else + /* Netscape format line */ + Curl_cookie_add(data, data->cookies, FALSE, FALSE, ptr, NULL, + NULL, TRUE); + Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); + } + break; +#endif /* !CURL_DISABLE_COOKIES */ + +#endif /* ! CURL_DISABLE_HTTP */ + + case CURLOPT_CUSTOMREQUEST: + /* + * Set a custom string to use as request + */ + return Curl_setstropt(&data->set.str[STRING_CUSTOMREQUEST], ptr); + + /* we do not set + data->set.method = HTTPREQ_CUSTOM; + here, we continue as if we were using the already set type + and this just changes the actual request keyword */ + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY: + /* + * Set proxy server:port to use as proxy. + * + * If the proxy is set to "" (and CURLOPT_SOCKS_PROXY is set to "" or NULL) + * we explicitly say that we do not want to use a proxy + * (even though there might be environment variables saying so). + * + * Setting it to NULL, means no proxy but allows the environment variables + * to decide for us (if CURLOPT_SOCKS_PROXY setting it to NULL). + */ + return Curl_setstropt(&data->set.str[STRING_PROXY], ptr); + break; + + case CURLOPT_PRE_PROXY: + /* + * Set proxy server:port to use as SOCKS proxy. + * + * If the proxy is set to "" or NULL we explicitly say that we do not want + * to use the socks proxy. + */ + return Curl_setstropt(&data->set.str[STRING_PRE_PROXY], ptr); +#endif /* CURL_DISABLE_PROXY */ + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_SOCKS5_GSSAPI_SERVICE: + case CURLOPT_PROXY_SERVICE_NAME: + /* + * Set proxy authentication service name for Kerberos 5 and SPNEGO + */ + return Curl_setstropt(&data->set.str[STRING_PROXY_SERVICE_NAME], ptr); +#endif + case CURLOPT_SERVICE_NAME: + /* + * Set authentication service name for DIGEST-MD5, Kerberos 5 and SPNEGO + */ + return Curl_setstropt(&data->set.str[STRING_SERVICE_NAME], ptr); + break; + + case CURLOPT_HEADERDATA: + /* + * Custom pointer to pass the header write callback function + */ + data->set.writeheader = (void *)ptr; + break; + case CURLOPT_READDATA: + /* + * FILE pointer to read the file to be uploaded from. Or possibly used as + * argument to the read callback. + */ + data->set.in_set = (void *)ptr; + break; + case CURLOPT_WRITEDATA: + /* + * FILE pointer to write to. Or possibly used as argument to the write + * callback. + */ + data->set.out = (void *)ptr; + break; + case CURLOPT_DEBUGDATA: + /* + * Set to a void * that should receive all error writes. This + * defaults to CURLOPT_STDERR for normal operations. + */ + data->set.debugdata = (void *)ptr; + break; + case CURLOPT_PROGRESSDATA: + /* + * Custom client data to pass to the progress callback + */ + data->set.progress_client = (void *)ptr; + break; + case CURLOPT_SEEKDATA: + /* + * Seek control callback. Might be NULL. + */ + data->set.seek_client = (void *)ptr; + break; + case CURLOPT_IOCTLDATA: + /* + * I/O control data pointer. Might be NULL. + */ + data->set.ioctl_client = (void *)ptr; + break; + case CURLOPT_SSL_CTX_DATA: + /* + * Set a SSL_CTX callback parameter pointer + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) + data->set.ssl.fsslctxp = (void *)ptr; + else +#endif + return CURLE_NOT_BUILT_IN; + break; + case CURLOPT_SOCKOPTDATA: + /* + * socket callback data pointer. Might be NULL. + */ + data->set.sockopt_client = (void *)ptr; + break; + case CURLOPT_OPENSOCKETDATA: + /* + * socket callback data pointer. Might be NULL. + */ + data->set.opensocket_client = (void *)ptr; + break; + case CURLOPT_RESOLVER_START_DATA: + /* + * resolver start callback data pointer. Might be NULL. + */ + data->set.resolver_start_client = (void *)ptr; + break; + case CURLOPT_CLOSESOCKETDATA: + /* + * socket callback data pointer. Might be NULL. + */ + data->set.closesocket_client = (void *)ptr; break; case CURLOPT_TRAILERDATA: #ifndef CURL_DISABLE_HTTP - data->set.trailer_data = va_arg(param, void *); + data->set.trailer_data = (void *)ptr; #endif break; + case CURLOPT_PREREQDATA: + data->set.prereq_userp = (void *)ptr; + break; + + case CURLOPT_ERRORBUFFER: + /* + * Error buffer provided by the caller to get the human readable error + * string in. + */ + data->set.errorbuffer = ptr; + break; + +#ifndef CURL_DISABLE_FTP + case CURLOPT_FTPPORT: + /* + * Use FTP PORT, this also specifies which IP address to use + */ + result = Curl_setstropt(&data->set.str[STRING_FTPPORT], ptr); + data->set.ftp_use_port = !!(data->set.str[STRING_FTPPORT]); + break; + + case CURLOPT_FTP_ACCOUNT: + return Curl_setstropt(&data->set.str[STRING_FTP_ACCOUNT], ptr); + + case CURLOPT_FTP_ALTERNATIVE_TO_USER: + return Curl_setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER], ptr); + +#ifdef HAVE_GSSAPI + case CURLOPT_KRBLEVEL: + /* + * A string that defines the kerberos security level. + */ + result = Curl_setstropt(&data->set.str[STRING_KRB_LEVEL], ptr); + data->set.krb = !!(data->set.str[STRING_KRB_LEVEL]); + break; +#endif +#endif + case CURLOPT_URL: + /* + * The URL to fetch. + */ + if(data->state.url_alloc) { + /* the already set URL is allocated, free it first! */ + Curl_safefree(data->state.url); + data->state.url_alloc = FALSE; + } + result = Curl_setstropt(&data->set.str[STRING_SET_URL], ptr); + data->state.url = data->set.str[STRING_SET_URL]; + break; + + case CURLOPT_USERPWD: + /* + * user:password to use in the operation + */ + return setstropt_userpwd(ptr, &data->set.str[STRING_USERNAME], + &data->set.str[STRING_PASSWORD]); + + case CURLOPT_USERNAME: + /* + * authentication username to use in the operation + */ + return Curl_setstropt(&data->set.str[STRING_USERNAME], ptr); + + case CURLOPT_PASSWORD: + /* + * authentication password to use in the operation + */ + return Curl_setstropt(&data->set.str[STRING_PASSWORD], ptr); + + case CURLOPT_LOGIN_OPTIONS: + /* + * authentication options to use in the operation + */ + return Curl_setstropt(&data->set.str[STRING_OPTIONS], ptr); + + case CURLOPT_XOAUTH2_BEARER: + /* + * OAuth 2.0 bearer token to use in the operation + */ + return Curl_setstropt(&data->set.str[STRING_BEARER], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXYUSERPWD: { + /* + * user:password needed to use the proxy + */ + char *u = NULL; + char *p = NULL; + result = setstropt_userpwd(ptr, &u, &p); + + /* URL decode the components */ + if(!result && u) + result = Curl_urldecode(u, 0, &data->set.str[STRING_PROXYUSERNAME], NULL, + REJECT_ZERO); + if(!result && p) + result = Curl_urldecode(p, 0, &data->set.str[STRING_PROXYPASSWORD], NULL, + REJECT_ZERO); + free(u); + free(p); + } + break; + case CURLOPT_PROXYUSERNAME: + /* + * authentication username to use in the operation + */ + return Curl_setstropt(&data->set.str[STRING_PROXYUSERNAME], ptr); + + case CURLOPT_PROXYPASSWORD: + /* + * authentication password to use in the operation + */ + return Curl_setstropt(&data->set.str[STRING_PROXYPASSWORD], ptr); + + case CURLOPT_NOPROXY: + /* + * proxy exception list + */ + return Curl_setstropt(&data->set.str[STRING_NOPROXY], ptr); +#endif + + case CURLOPT_RANGE: + /* + * What range of the file you want to transfer + */ + return Curl_setstropt(&data->set.str[STRING_SET_RANGE], ptr); + +#endif /* ! CURL_DISABLE_PROXY */ + case CURLOPT_CURLU: + /* + * pass CURLU to set URL + */ + data->set.uh = (CURLU *)ptr; + break; + case CURLOPT_SSLCERT: + /* + * String that holds filename of the SSL certificate to use + */ + return Curl_setstropt(&data->set.str[STRING_CERT], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_SSLCERT: + /* + * String that holds filename of the SSL certificate to use for proxy + */ + return Curl_setstropt(&data->set.str[STRING_CERT_PROXY], ptr); + +#endif + case CURLOPT_SSLCERTTYPE: + /* + * String that holds file type of the SSL certificate to use + */ + return Curl_setstropt(&data->set.str[STRING_CERT_TYPE], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_SSLCERTTYPE: + /* + * String that holds file type of the SSL certificate to use for proxy + */ + return Curl_setstropt(&data->set.str[STRING_CERT_TYPE_PROXY], ptr); +#endif + case CURLOPT_SSLKEY: + /* + * String that holds filename of the SSL key to use + */ + return Curl_setstropt(&data->set.str[STRING_KEY], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_SSLKEY: + /* + * String that holds filename of the SSL key to use for proxy + */ + return Curl_setstropt(&data->set.str[STRING_KEY_PROXY], ptr); + +#endif + case CURLOPT_SSLKEYTYPE: + /* + * String that holds file type of the SSL key to use + */ + return Curl_setstropt(&data->set.str[STRING_KEY_TYPE], ptr); + break; +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_SSLKEYTYPE: + /* + * String that holds file type of the SSL key to use for proxy + */ + return Curl_setstropt(&data->set.str[STRING_KEY_TYPE_PROXY], ptr); + +#endif + case CURLOPT_KEYPASSWD: + /* + * String that holds the SSL or SSH private key password. + */ + return Curl_setstropt(&data->set.str[STRING_KEY_PASSWD], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_KEYPASSWD: + /* + * String that holds the SSL private key password for proxy. + */ + return Curl_setstropt(&data->set.str[STRING_KEY_PASSWD_PROXY], ptr); +#endif + case CURLOPT_SSLENGINE: + /* + * String that holds the SSL crypto engine. + */ + if(ptr && ptr[0]) { + result = Curl_setstropt(&data->set.str[STRING_SSL_ENGINE], ptr); + if(!result) { + result = Curl_ssl_set_engine(data, ptr); + } + } + break; + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_HAPROXY_CLIENT_IP: + /* + * Set the client IP to send through HAProxy PROXY protocol + */ + result = Curl_setstropt(&data->set.str[STRING_HAPROXY_CLIENT_IP], ptr); + /* enable the HAProxy protocol */ + data->set.haproxyprotocol = TRUE; + break; +#endif + case CURLOPT_INTERFACE: + /* + * Set what interface or address/hostname to bind the socket to when + * performing an operation and thus what from-IP your connection will use. + */ + return setstropt_interface(ptr, + &data->set.str[STRING_DEVICE], + &data->set.str[STRING_INTERFACE], + &data->set.str[STRING_BINDHOST]); + + case CURLOPT_PINNEDPUBLICKEY: + /* + * Set pinned public key for SSL connection. + * Specify filename of the public key in DER format. + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY)) + return Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY], ptr); +#endif + return CURLE_NOT_BUILT_IN; + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_PINNEDPUBLICKEY: + /* + * Set pinned public key for SSL connection. + * Specify filename of the public key in DER format. + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY)) + return Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY], + ptr); +#endif + return CURLE_NOT_BUILT_IN; +#endif + case CURLOPT_CAINFO: + /* + * Set CA info for SSL connection. Specify filename of the CA certificate + */ + return Curl_setstropt(&data->set.str[STRING_SSL_CAFILE], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_CAINFO: + /* + * Set CA info SSL connection for proxy. Specify filename of the + * CA certificate + */ + return Curl_setstropt(&data->set.str[STRING_SSL_CAFILE_PROXY], ptr); +#endif + + case CURLOPT_CAPATH: + /* + * Set CA path info for SSL connection. Specify directory name of the CA + * certificates which have been prepared using openssl c_rehash utility. + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) + /* This does not work on Windows. */ + return Curl_setstropt(&data->set.str[STRING_SSL_CAPATH], ptr); +#endif + return CURLE_NOT_BUILT_IN; +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_CAPATH: + /* + * Set CA path info for SSL connection proxy. Specify directory name of the + * CA certificates which have been prepared using openssl c_rehash utility. + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) + /* This does not work on Windows. */ + return Curl_setstropt(&data->set.str[STRING_SSL_CAPATH_PROXY], ptr); +#endif + return CURLE_NOT_BUILT_IN; +#endif + case CURLOPT_CRLFILE: + /* + * Set CRL file info for SSL connection. Specify filename of the CRL + * to check certificates revocation + */ + return Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_CRLFILE: + /* + * Set CRL file info for SSL connection for proxy. Specify filename of the + * CRL to check certificates revocation + */ + return Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE_PROXY], ptr); +#endif + case CURLOPT_ISSUERCERT: + /* + * Set Issuer certificate file + * to check certificates issuer + */ + return Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_ISSUERCERT: + /* + * Set Issuer certificate file + * to check certificates issuer + */ + return Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT_PROXY], ptr); + +#endif + + case CURLOPT_PRIVATE: + /* + * Set private data pointer. + */ + data->set.private_data = (void *)ptr; + break; + +#ifdef USE_SSL + case CURLOPT_SSL_EC_CURVES: + /* + * Set accepted curves in SSL connection setup. + * Specify colon-delimited list of curve algorithm names. + */ + return Curl_setstropt(&data->set.str[STRING_SSL_EC_CURVES], ptr); +#endif +#ifdef USE_SSH + case CURLOPT_SSH_PUBLIC_KEYFILE: + /* + * Use this file instead of the $HOME/.ssh/id_dsa.pub file + */ + return Curl_setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY], ptr); + + case CURLOPT_SSH_PRIVATE_KEYFILE: + /* + * Use this file instead of the $HOME/.ssh/id_dsa file + */ + return Curl_setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY], ptr); + + case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5: + /* + * Option to allow for the MD5 of the host public key to be checked + * for validation purposes. + */ + return Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5], ptr); + + case CURLOPT_SSH_KNOWNHOSTS: + /* + * Store the filename to read known hosts from. + */ + return Curl_setstropt(&data->set.str[STRING_SSH_KNOWNHOSTS], ptr); + + case CURLOPT_SSH_KEYDATA: + /* + * Custom client data to pass to the SSH keyfunc callback + */ + data->set.ssh_keyfunc_userp = (void *)ptr; + break; +#ifdef USE_LIBSSH2 + case CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256: + /* + * Option to allow for the SHA256 of the host public key to be checked + * for validation purposes. + */ + return Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_SHA256], + ptr); + + case CURLOPT_SSH_HOSTKEYDATA: + /* + * Custom client data to pass to the SSH keyfunc callback + */ + data->set.ssh_hostkeyfunc_userp = (void *)ptr; + break; +#endif /* USE_LIBSSH2 */ +#endif /* USE_SSH */ + case CURLOPT_PROTOCOLS_STR: + if(ptr) + return protocol2num(ptr, &data->set.allowed_protocols); + /* make a NULL argument reset to default */ + data->set.allowed_protocols = (curl_prot_t) CURLPROTO_ALL; + break; + + case CURLOPT_REDIR_PROTOCOLS_STR: + if(ptr) + return protocol2num(ptr, &data->set.redir_protocols); + /* make a NULL argument reset to default */ + data->set.redir_protocols = (curl_prot_t) CURLPROTO_REDIR; + break; + + case CURLOPT_DEFAULT_PROTOCOL: + /* Set the protocol to use when the URL does not include any protocol */ + return Curl_setstropt(&data->set.str[STRING_DEFAULT_PROTOCOL], ptr); + +#ifndef CURL_DISABLE_SMTP + case CURLOPT_MAIL_FROM: + /* Set the SMTP mail originator */ + return Curl_setstropt(&data->set.str[STRING_MAIL_FROM], ptr); + + case CURLOPT_MAIL_AUTH: + /* Set the SMTP auth originator */ + return Curl_setstropt(&data->set.str[STRING_MAIL_AUTH], ptr); +#endif + + case CURLOPT_SASL_AUTHZID: + /* Authorization identity (identity to act as) */ + return Curl_setstropt(&data->set.str[STRING_SASL_AUTHZID], ptr); + +#ifndef CURL_DISABLE_RTSP + case CURLOPT_RTSP_SESSION_ID: + /* + * Set the RTSP Session ID manually. Useful if the application is + * resuming a previously established RTSP session + */ + return Curl_setstropt(&data->set.str[STRING_RTSP_SESSION_ID], ptr); + + case CURLOPT_RTSP_STREAM_URI: + /* + * Set the Stream URI for the RTSP request. Unless the request is + * for generic server options, the application will need to set this. + */ + return Curl_setstropt(&data->set.str[STRING_RTSP_STREAM_URI], ptr); + break; + + case CURLOPT_RTSP_TRANSPORT: + /* + * The content of the Transport: header for the RTSP request + */ + return Curl_setstropt(&data->set.str[STRING_RTSP_TRANSPORT], ptr); + + case CURLOPT_INTERLEAVEDATA: + data->set.rtp_out = (void *)ptr; + break; +#endif /* ! CURL_DISABLE_RTSP */ +#ifndef CURL_DISABLE_FTP + case CURLOPT_CHUNK_DATA: + data->set.wildcardptr = (void *)ptr; + break; + case CURLOPT_FNMATCH_DATA: + data->set.fnmatch_data = (void *)ptr; + break; +#endif +#ifdef USE_TLS_SRP + case CURLOPT_TLSAUTH_USERNAME: + return Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_TLSAUTH_USERNAME: + return Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME_PROXY], ptr); + +#endif + case CURLOPT_TLSAUTH_PASSWORD: + return Curl_setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD], ptr); + +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_TLSAUTH_PASSWORD: + return Curl_setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD_PROXY], ptr); +#endif + case CURLOPT_TLSAUTH_TYPE: + if(ptr && !strcasecompare(ptr, "SRP")) + return CURLE_BAD_FUNCTION_ARGUMENT; + break; +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_TLSAUTH_TYPE: + if(ptr && !strcasecompare(ptr, "SRP")) + return CURLE_BAD_FUNCTION_ARGUMENT; + break; +#endif +#endif +#ifdef USE_ARES + case CURLOPT_DNS_SERVERS: + result = Curl_setstropt(&data->set.str[STRING_DNS_SERVERS], ptr); + if(result) + return result; + return Curl_set_dns_servers(data, data->set.str[STRING_DNS_SERVERS]); + + case CURLOPT_DNS_INTERFACE: + result = Curl_setstropt(&data->set.str[STRING_DNS_INTERFACE], ptr); + if(result) + return result; + return Curl_set_dns_interface(data, data->set.str[STRING_DNS_INTERFACE]); + + case CURLOPT_DNS_LOCAL_IP4: + result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP4], ptr); + if(result) + return result; + return Curl_set_dns_local_ip4(data, data->set.str[STRING_DNS_LOCAL_IP4]); + + case CURLOPT_DNS_LOCAL_IP6: + result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP6], ptr); + if(result) + return result; + return Curl_set_dns_local_ip6(data, data->set.str[STRING_DNS_LOCAL_IP6]); + +#endif +#ifdef USE_UNIX_SOCKETS + case CURLOPT_UNIX_SOCKET_PATH: + data->set.abstract_unix_socket = FALSE; + return Curl_setstropt(&data->set.str[STRING_UNIX_SOCKET_PATH], ptr); + + case CURLOPT_ABSTRACT_UNIX_SOCKET: + data->set.abstract_unix_socket = TRUE; + return Curl_setstropt(&data->set.str[STRING_UNIX_SOCKET_PATH], ptr); + +#endif + +#ifndef CURL_DISABLE_DOH + case CURLOPT_DOH_URL: + result = Curl_setstropt(&data->set.str[STRING_DOH], ptr); + data->set.doh = !!(data->set.str[STRING_DOH]); + break; +#endif #ifndef CURL_DISABLE_HSTS - case CURLOPT_HSTSREADFUNCTION: - data->set.hsts_read = va_arg(param, curl_hstsread_callback); - break; case CURLOPT_HSTSREADDATA: - data->set.hsts_read_userp = va_arg(param, void *); - break; - case CURLOPT_HSTSWRITEFUNCTION: - data->set.hsts_write = va_arg(param, curl_hstswrite_callback); + data->set.hsts_read_userp = (void *)ptr; break; case CURLOPT_HSTSWRITEDATA: - data->set.hsts_write_userp = va_arg(param, void *); + data->set.hsts_write_userp = (void *)ptr; break; case CURLOPT_HSTS: { struct curl_slist *h; @@ -3049,15 +2610,14 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) if(!data->hsts) return CURLE_OUT_OF_MEMORY; } - argptr = va_arg(param, char *); - if(argptr) { - result = Curl_setstropt(&data->set.str[STRING_HSTS], argptr); + if(ptr) { + result = Curl_setstropt(&data->set.str[STRING_HSTS], ptr); if(result) return result; - /* this needs to build a list of file names to read from, so that it can + /* this needs to build a list of filenames to read from, so that it can read them later, as we might get a shared HSTS handle to load them into */ - h = curl_slist_append(data->state.hstslist, argptr); + h = curl_slist_append(data->state.hstslist, ptr); if(!h) { curl_slist_free_all(data->state.hstslist); data->state.hstslist = NULL; @@ -3075,19 +2635,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) } break; } - case CURLOPT_HSTS_CTRL: - arg = va_arg(param, long); - if(arg & CURLHSTS_ENABLE) { - if(!data->hsts) { - data->hsts = Curl_hsts_init(); - if(!data->hsts) - return CURLE_OUT_OF_MEMORY; - } - } - else - Curl_hsts_cleanup(&data->hsts); - break; -#endif +#endif /* ! CURL_DISABLE_HSTS */ #ifndef CURL_DISABLE_ALTSVC case CURLOPT_ALTSVC: if(!data->asi) { @@ -3095,54 +2643,417 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) if(!data->asi) return CURLE_OUT_OF_MEMORY; } - argptr = va_arg(param, char *); - result = Curl_setstropt(&data->set.str[STRING_ALTSVC], argptr); + result = Curl_setstropt(&data->set.str[STRING_ALTSVC], ptr); if(result) return result; - if(argptr) - (void)Curl_altsvc_load(data->asi, argptr); + if(ptr) + (void)Curl_altsvc_load(data->asi, ptr); break; - case CURLOPT_ALTSVC_CTRL: - if(!data->asi) { - data->asi = Curl_altsvc_init(); - if(!data->asi) - return CURLE_OUT_OF_MEMORY; +#endif /* ! CURL_DISABLE_ALTSVC */ +#ifdef USE_ECH + case CURLOPT_ECH: { + size_t plen = 0; + + if(!ptr) { + data->set.tls_ech = CURLECH_DISABLE; + return CURLE_OK; } - arg = va_arg(param, long); - if(!arg) { - DEBUGF(infof(data, "bad CURLOPT_ALTSVC_CTRL input")); + plen = strlen(ptr); + if(plen > CURL_MAX_INPUT_LENGTH) { + data->set.tls_ech = CURLECH_DISABLE; return CURLE_BAD_FUNCTION_ARGUMENT; } - result = Curl_altsvc_ctrl(data->asi, arg); - if(result) - return result; + /* set tls_ech flag value, preserving CLA_CFG bit */ + if(!strcmp(ptr, "false")) + data->set.tls_ech = CURLECH_DISABLE | + (data->set.tls_ech & CURLECH_CLA_CFG); + else if(!strcmp(ptr, "grease")) + data->set.tls_ech = CURLECH_GREASE | + (data->set.tls_ech & CURLECH_CLA_CFG); + else if(!strcmp(ptr, "true")) + data->set.tls_ech = CURLECH_ENABLE | + (data->set.tls_ech & CURLECH_CLA_CFG); + else if(!strcmp(ptr, "hard")) + data->set.tls_ech = CURLECH_HARD | + (data->set.tls_ech & CURLECH_CLA_CFG); + else if(plen > 5 && !strncmp(ptr, "ecl:", 4)) { + result = Curl_setstropt(&data->set.str[STRING_ECH_CONFIG], ptr + 4); + if(result) + return result; + data->set.tls_ech |= CURLECH_CLA_CFG; + } + else if(plen > 4 && !strncmp(ptr, "pn:", 3)) { + result = Curl_setstropt(&data->set.str[STRING_ECH_PUBLIC], ptr + 3); + if(result) + return result; + } + break; + } +#endif + default: + return CURLE_UNKNOWN_OPTION; + } + return result; +} + +static CURLcode setopt_func(struct Curl_easy *data, CURLoption option, + va_list param) +{ + switch(option) { + case CURLOPT_PROGRESSFUNCTION: + /* + * Progress callback function + */ + data->set.fprogress = va_arg(param, curl_progress_callback); + if(data->set.fprogress) + data->progress.callback = TRUE; /* no longer internal */ + else + data->progress.callback = FALSE; /* NULL enforces internal */ + break; + + case CURLOPT_XFERINFOFUNCTION: + /* + * Transfer info callback function + */ + data->set.fxferinfo = va_arg(param, curl_xferinfo_callback); + if(data->set.fxferinfo) + data->progress.callback = TRUE; /* no longer internal */ + else + data->progress.callback = FALSE; /* NULL enforces internal */ + + break; + case CURLOPT_DEBUGFUNCTION: + /* + * stderr write callback. + */ + data->set.fdebug = va_arg(param, curl_debug_callback); + /* + * if the callback provided is NULL, it will use the default callback + */ + break; + case CURLOPT_HEADERFUNCTION: + /* + * Set header write callback + */ + data->set.fwrite_header = va_arg(param, curl_write_callback); + break; + case CURLOPT_WRITEFUNCTION: + /* + * Set data write callback + */ + data->set.fwrite_func = va_arg(param, curl_write_callback); + if(!data->set.fwrite_func) + /* When set to NULL, reset to our internal default function */ + data->set.fwrite_func = (curl_write_callback)fwrite; + break; + case CURLOPT_READFUNCTION: + /* + * Read data callback + */ + data->set.fread_func_set = va_arg(param, curl_read_callback); + if(!data->set.fread_func_set) { + data->set.is_fread_set = 0; + /* When set to NULL, reset to our internal default function */ + data->set.fread_func_set = (curl_read_callback)fread; + } + else + data->set.is_fread_set = 1; + break; + case CURLOPT_SEEKFUNCTION: + /* + * Seek callback. Might be NULL. + */ + data->set.seek_func = va_arg(param, curl_seek_callback); + break; + case CURLOPT_IOCTLFUNCTION: + /* + * I/O control callback. Might be NULL. + */ + data->set.ioctl_func = va_arg(param, curl_ioctl_callback); + break; + case CURLOPT_SSL_CTX_FUNCTION: + /* + * Set a SSL_CTX callback + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) + data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback); + else +#endif + return CURLE_NOT_BUILT_IN; + break; + + case CURLOPT_SOCKOPTFUNCTION: + /* + * socket callback function: called after socket() but before connect() + */ + data->set.fsockopt = va_arg(param, curl_sockopt_callback); + break; + + case CURLOPT_OPENSOCKETFUNCTION: + /* + * open/create socket callback function: called instead of socket(), + * before connect() + */ + data->set.fopensocket = va_arg(param, curl_opensocket_callback); + break; + + case CURLOPT_CLOSESOCKETFUNCTION: + /* + * close socket callback function: called instead of close() + * when shutting down a connection + */ + data->set.fclosesocket = va_arg(param, curl_closesocket_callback); + break; + + case CURLOPT_RESOLVER_START_FUNCTION: + /* + * resolver start callback function: called before a new resolver request + * is started + */ + data->set.resolver_start = va_arg(param, curl_resolver_start_callback); + break; + + +#ifdef USE_SSH +#ifdef USE_LIBSSH2 + case CURLOPT_SSH_HOSTKEYFUNCTION: + /* the callback to check the hostkey without the knownhost file */ + data->set.ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback); + break; +#endif + + case CURLOPT_SSH_KEYFUNCTION: + /* setting to NULL is fine since the ssh.c functions themselves will + then revert to use the internal default */ + data->set.ssh_keyfunc = va_arg(param, curl_sshkeycallback); + break; + +#endif /* USE_SSH */ + +#ifndef CURL_DISABLE_RTSP + case CURLOPT_INTERLEAVEFUNCTION: + /* Set the user defined RTP write function */ + data->set.fwrite_rtp = va_arg(param, curl_write_callback); + break; +#endif +#ifndef CURL_DISABLE_FTP + case CURLOPT_CHUNK_BGN_FUNCTION: + data->set.chunk_bgn = va_arg(param, curl_chunk_bgn_callback); + break; + case CURLOPT_CHUNK_END_FUNCTION: + data->set.chunk_end = va_arg(param, curl_chunk_end_callback); + break; + case CURLOPT_FNMATCH_FUNCTION: + data->set.fnmatch = va_arg(param, curl_fnmatch_callback); + break; +#endif +#ifndef CURL_DISABLE_HTTP + case CURLOPT_TRAILERFUNCTION: + data->set.trailer_callback = va_arg(param, curl_trailer_callback); + break; +#endif +#ifndef CURL_DISABLE_HSTS + case CURLOPT_HSTSREADFUNCTION: + data->set.hsts_read = va_arg(param, curl_hstsread_callback); + break; + case CURLOPT_HSTSWRITEFUNCTION: + data->set.hsts_write = va_arg(param, curl_hstswrite_callback); break; #endif case CURLOPT_PREREQFUNCTION: data->set.fprereq = va_arg(param, curl_prereq_callback); break; - case CURLOPT_PREREQDATA: - data->set.prereq_userp = va_arg(param, void *); - break; -#ifdef USE_WEBSOCKETS - case CURLOPT_WS_OPTIONS: { - bool raw; - arg = va_arg(param, long); - raw = (arg & CURLWS_RAW_MODE); - data->set.ws_raw_mode = raw; - break; - } -#endif - case CURLOPT_QUICK_EXIT: - data->set.quick_exit = (0 != va_arg(param, long)) ? 1L:0L; - break; default: - /* unknown tag and its companion, just ignore: */ - result = CURLE_UNKNOWN_OPTION; - break; + return CURLE_UNKNOWN_OPTION; } + return CURLE_OK; +} - return result; +static CURLcode setopt_offt(struct Curl_easy *data, CURLoption option, + curl_off_t offt) +{ + switch(option) { + case CURLOPT_TIMEVALUE_LARGE: + /* + * This is the value to compare with the remote document with the + * method set with CURLOPT_TIMECONDITION + */ + data->set.timevalue = (time_t)offt; + break; + + /* MQTT "borrows" some of the HTTP options */ + case CURLOPT_POSTFIELDSIZE_LARGE: + /* + * The size of the POSTFIELD data to prevent libcurl to do strlen() to + * figure it out. Enables binary posts. + */ + if(offt < -1) + return CURLE_BAD_FUNCTION_ARGUMENT; + + if(data->set.postfieldsize < offt && + data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { + /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */ + Curl_safefree(data->set.str[STRING_COPYPOSTFIELDS]); + data->set.postfields = NULL; + } + data->set.postfieldsize = offt; + break; + case CURLOPT_INFILESIZE_LARGE: + /* + * If known, this should inform curl about the file size of the + * to-be-uploaded file. + */ + if(offt < -1) + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.filesize = offt; + break; + case CURLOPT_MAX_SEND_SPEED_LARGE: + /* + * When transfer uploads are faster then CURLOPT_MAX_SEND_SPEED_LARGE + * bytes per second the transfer is throttled.. + */ + if(offt < 0) + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.max_send_speed = offt; + break; + case CURLOPT_MAX_RECV_SPEED_LARGE: + /* + * When receiving data faster than CURLOPT_MAX_RECV_SPEED_LARGE bytes per + * second the transfer is throttled.. + */ + if(offt < 0) + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.max_recv_speed = offt; + break; + case CURLOPT_RESUME_FROM_LARGE: + /* + * Resume transfer at the given file position + */ + if(offt < -1) + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.set_resume_from = offt; + break; + case CURLOPT_MAXFILESIZE_LARGE: + /* + * Set the maximum size of a file to download. + */ + if(offt < 0) + return CURLE_BAD_FUNCTION_ARGUMENT; + data->set.max_filesize = offt; + break; + + default: + return CURLE_UNKNOWN_OPTION; + } + return CURLE_OK; +} + +static CURLcode setopt_blob(struct Curl_easy *data, CURLoption option, + struct curl_blob *blob) +{ + switch(option) { + case CURLOPT_SSLCERT_BLOB: + /* + * Blob that holds file content of the SSL certificate to use + */ + return Curl_setblobopt(&data->set.blobs[BLOB_CERT], blob); +#ifndef CURL_DISABLE_PROXY + case CURLOPT_PROXY_SSLCERT_BLOB: + /* + * Blob that holds file content of the SSL certificate to use for proxy + */ + return Curl_setblobopt(&data->set.blobs[BLOB_CERT_PROXY], blob); + case CURLOPT_PROXY_SSLKEY_BLOB: + /* + * Blob that holds file content of the SSL key to use for proxy + */ + return Curl_setblobopt(&data->set.blobs[BLOB_KEY_PROXY], blob); + case CURLOPT_PROXY_CAINFO_BLOB: + /* + * Blob that holds CA info for SSL connection proxy. + * Specify entire PEM of the CA certificate + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) + return Curl_setblobopt(&data->set.blobs[BLOB_CAINFO_PROXY], blob); +#endif + return CURLE_NOT_BUILT_IN; + case CURLOPT_PROXY_ISSUERCERT_BLOB: + /* + * Blob that holds Issuer certificate to check certificates issuer + */ + return Curl_setblobopt(&data->set.blobs[BLOB_SSL_ISSUERCERT_PROXY], + blob); +#endif + case CURLOPT_SSLKEY_BLOB: + /* + * Blob that holds file content of the SSL key to use + */ + return Curl_setblobopt(&data->set.blobs[BLOB_KEY], blob); + case CURLOPT_CAINFO_BLOB: + /* + * Blob that holds CA info for SSL connection. + * Specify entire PEM of the CA certificate + */ +#ifdef USE_SSL + if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) + return Curl_setblobopt(&data->set.blobs[BLOB_CAINFO], blob); +#endif + return CURLE_NOT_BUILT_IN; + case CURLOPT_ISSUERCERT_BLOB: + /* + * Blob that holds Issuer certificate to check certificates issuer + */ + return Curl_setblobopt(&data->set.blobs[BLOB_SSL_ISSUERCERT], blob); + + default: + return CURLE_UNKNOWN_OPTION; + } + /* unreachable */ +} + +/* + * Do not make Curl_vsetopt() static: it is called from + * packages/OS400/ccsidcurl.c. + */ +CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) +{ + if(option < CURLOPTTYPE_OBJECTPOINT) + return setopt_long(data, option, va_arg(param, long)); + else if(option < CURLOPTTYPE_FUNCTIONPOINT) { + /* unfortunately, different pointer types cannot be identified any other + way than being listed explicitly */ + switch(option) { + case CURLOPT_HTTPHEADER: + case CURLOPT_QUOTE: + case CURLOPT_POSTQUOTE: + case CURLOPT_TELNETOPTIONS: + case CURLOPT_PREQUOTE: + case CURLOPT_HTTP200ALIASES: + case CURLOPT_MAIL_RCPT: + case CURLOPT_RESOLVE: + case CURLOPT_PROXYHEADER: + case CURLOPT_CONNECT_TO: + return setopt_slist(data, option, va_arg(param, struct curl_slist *)); + case CURLOPT_HTTPPOST: /* curl_httppost * */ + case CURLOPT_MIMEPOST: /* curl_mime * */ + case CURLOPT_STDERR: /* FILE * */ + case CURLOPT_SHARE: /* CURLSH * */ + case CURLOPT_STREAM_DEPENDS: /* CURL * */ + case CURLOPT_STREAM_DEPENDS_E: /* CURL * */ + return setopt_pointers(data, option, param); + default: + break; + } + /* the char pointer options */ + return setopt_cptr(data, option, va_arg(param, char *)); + } + else if(option < CURLOPTTYPE_OFF_T) + return setopt_func(data, option, param); + else if(option < CURLOPTTYPE_BLOB) + return setopt_offt(data, option, va_arg(param, curl_off_t)); + return setopt_blob(data, option, va_arg(param, struct curl_blob *)); } /* @@ -3154,10 +3065,11 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) */ #undef curl_easy_setopt -CURLcode curl_easy_setopt(struct Curl_easy *data, CURLoption tag, ...) +CURLcode curl_easy_setopt(CURL *d, CURLoption tag, ...) { va_list arg; CURLcode result; + struct Curl_easy *data = d; if(!data) return CURLE_BAD_FUNCTION_ARGUMENT; diff --git a/deps/curl/lib/setopt.h b/deps/curl/lib/setopt.h index 3c14a05e..b0237467 100644 --- a/deps/curl/lib/setopt.h +++ b/deps/curl/lib/setopt.h @@ -24,9 +24,10 @@ * ***************************************************************************/ -CURLcode Curl_setstropt(char **charp, const char *s); +CURLcode Curl_setstropt(char **charp, const char *s) WARN_UNUSED_RESULT; CURLcode Curl_setblobopt(struct curl_blob **blobp, - const struct curl_blob *blob); -CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list arg); + const struct curl_blob *blob) WARN_UNUSED_RESULT; +CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list arg) + WARN_UNUSED_RESULT; #endif /* HEADER_CURL_SETOPT_H */ diff --git a/deps/curl/lib/setup-os400.h b/deps/curl/lib/setup-os400.h index 53e91777..ef7baca6 100644 --- a/deps/curl/lib/setup-os400.h +++ b/deps/curl/lib/setup-os400.h @@ -38,6 +38,15 @@ typedef unsigned long u_int32_t; #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')) + + /* System API wrapper prototypes & definitions to support ASCII parameters. */ #include @@ -46,6 +55,8 @@ typedef unsigned long u_int32_t; #include #include +#ifdef BUILDING_LIBCURL + extern int Curl_getaddrinfo_a(const char *nodename, const char *servname, const struct addrinfo *hints, @@ -141,4 +152,6 @@ extern int Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen); #define inflateEnd Curl_os400_inflateEnd #endif +#endif /* BUILDING_LIBCURL */ + #endif /* HEADER_CURL_SETUP_OS400_H */ diff --git a/deps/curl/lib/setup-vms.h b/deps/curl/lib/setup-vms.h index 645cc1a9..33b74db3 100644 --- a/deps/curl/lib/setup-vms.h +++ b/deps/curl/lib/setup-vms.h @@ -101,7 +101,7 @@ static char *vms_translate_path(const char *path) } } # else - /* VMS translate path is actually not needed on the current 64 bit */ + /* 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 @@ -144,7 +144,7 @@ static struct passwd *vms_getpwuid(uid_t uid) { struct passwd *my_passwd; -/* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */ +/* Hack needed to support 64-bit builds, decc_getpwnam is 32-bit only */ #ifdef __DECC # if __INITIAL_POINTER_SIZE __char_ptr32 unix_path; @@ -374,8 +374,8 @@ static struct passwd *vms_getpwuid(uid_t uid) #ifdef HAVE_NETDB_H #include #ifndef AI_NUMERICHOST -#ifdef ENABLE_IPV6 -#undef ENABLE_IPV6 +#ifdef USE_IPV6 +#undef USE_IPV6 #endif #endif #endif diff --git a/deps/curl/lib/setup-win32.h b/deps/curl/lib/setup-win32.h index d7e2e6be..a297bdcf 100644 --- a/deps/curl/lib/setup-win32.h +++ b/deps/curl/lib/setup-win32.h @@ -62,11 +62,11 @@ #endif /* - * Include header files for windows builds before redefining anything. + * Include header files for Windows builds before redefining anything. * Use this preprocessor block only to include or exclude windows.h, - * winsock2.h or ws2tcpip.h. Any other windows thing belongs - * to any other further and independent block. Under Cygwin things work - * just as under linux (e.g. ) and the winsock headers should + * winsock2.h or ws2tcpip.h. Any other Windows thing belongs + * to any other further and independent block. Under Cygwin things work + * just as under Linux (e.g. ) and the Winsock headers should * never be included when __CYGWIN__ is defined. */ @@ -78,7 +78,7 @@ # error "_UNICODE is defined but UNICODE is not defined" # endif /* - * Don't include unneeded stuff in Windows headers to avoid compiler + * Do not include unneeded stuff in Windows headers to avoid compiler * warnings and macro clashes. * Make sure to define this macro before including any Windows headers. */ diff --git a/deps/curl/lib/sha256.c b/deps/curl/lib/sha256.c index 4a02045d..ce60d85e 100644 --- a/deps/curl/lib/sha256.c +++ b/deps/curl/lib/sha256.c @@ -100,13 +100,14 @@ #if defined(USE_OPENSSL_SHA256) -struct sha256_ctx { +struct ossl_sha256_ctx { EVP_MD_CTX *openssl_ctx; }; -typedef struct sha256_ctx my_sha256_ctx; +typedef struct ossl_sha256_ctx my_sha256_ctx; -static CURLcode my_sha256_init(my_sha256_ctx *ctx) +static CURLcode my_sha256_init(void *in) { + my_sha256_ctx *ctx = (my_sha256_ctx *)in; ctx->openssl_ctx = EVP_MD_CTX_create(); if(!ctx->openssl_ctx) return CURLE_OUT_OF_MEMORY; @@ -118,15 +119,17 @@ static CURLcode my_sha256_init(my_sha256_ctx *ctx) return CURLE_OK; } -static void my_sha256_update(my_sha256_ctx *ctx, +static void my_sha256_update(void *in, const unsigned char *data, unsigned int length) { + my_sha256_ctx *ctx = (my_sha256_ctx *)in; EVP_DigestUpdate(ctx->openssl_ctx, data, length); } -static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) +static void my_sha256_final(unsigned char *digest, void *in) { + my_sha256_ctx *ctx = (my_sha256_ctx *)in; EVP_DigestFinal_ex(ctx->openssl_ctx, digest, NULL); EVP_MD_CTX_destroy(ctx->openssl_ctx); } @@ -135,20 +138,20 @@ static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) typedef struct sha256_ctx my_sha256_ctx; -static CURLcode my_sha256_init(my_sha256_ctx *ctx) +static CURLcode my_sha256_init(void *ctx) { sha256_init(ctx); return CURLE_OK; } -static void my_sha256_update(my_sha256_ctx *ctx, +static void my_sha256_update(void *ctx, const unsigned char *data, unsigned int length) { sha256_update(ctx, length, data); } -static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) +static void my_sha256_final(unsigned char *digest, void *ctx) { sha256_digest(ctx, SHA256_DIGEST_SIZE, digest); } @@ -157,7 +160,7 @@ static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) typedef mbedtls_sha256_context my_sha256_ctx; -static CURLcode my_sha256_init(my_sha256_ctx *ctx) +static CURLcode my_sha256_init(void *ctx) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) (void) mbedtls_sha256_starts(ctx, 0); @@ -167,7 +170,7 @@ static CURLcode my_sha256_init(my_sha256_ctx *ctx) return CURLE_OK; } -static void my_sha256_update(my_sha256_ctx *ctx, +static void my_sha256_update(void *ctx, const unsigned char *data, unsigned int length) { @@ -178,7 +181,7 @@ static void my_sha256_update(my_sha256_ctx *ctx, #endif } -static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) +static void my_sha256_final(unsigned char *digest, void *ctx) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) (void) mbedtls_sha256_finish(ctx, digest); @@ -190,20 +193,20 @@ static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) #elif defined(AN_APPLE_OS) typedef CC_SHA256_CTX my_sha256_ctx; -static CURLcode my_sha256_init(my_sha256_ctx *ctx) +static CURLcode my_sha256_init(void *ctx) { (void) CC_SHA256_Init(ctx); return CURLE_OK; } -static void my_sha256_update(my_sha256_ctx *ctx, +static void my_sha256_update(void *ctx, const unsigned char *data, unsigned int length) { (void) CC_SHA256_Update(ctx, data, length); } -static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) +static void my_sha256_final(unsigned char *digest, void *ctx) { (void) CC_SHA256_Final(digest, ctx); } @@ -220,8 +223,9 @@ typedef struct sha256_ctx my_sha256_ctx; #define CALG_SHA_256 0x0000800c #endif -static CURLcode my_sha256_init(my_sha256_ctx *ctx) +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)) return CURLE_OUT_OF_MEMORY; @@ -235,19 +239,21 @@ static CURLcode my_sha256_init(my_sha256_ctx *ctx) return CURLE_OK; } -static void my_sha256_update(my_sha256_ctx *ctx, +static void my_sha256_update(void *in, const unsigned char *data, unsigned int length) { + my_sha256_ctx *ctx = (my_sha256_ctx *)in; CryptHashData(ctx->hHash, (unsigned char *) data, length, 0); } -static void my_sha256_final(unsigned char *digest, my_sha256_ctx *ctx) +static void my_sha256_final(unsigned char *digest, void *in) { + my_sha256_ctx *ctx = (my_sha256_ctx *)in; unsigned long length = 0; CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0); - if(length == SHA256_DIGEST_LENGTH) + if(length == CURL_SHA256_DIGEST_LENGTH) CryptGetHashParam(ctx->hHash, HP_HASHVAL, digest, &length, 0); if(ctx->hHash) @@ -334,14 +340,14 @@ static const unsigned long K[64] = { #define RORc(x, y) \ (((((unsigned long)(x) & 0xFFFFFFFFUL) >> (unsigned long)((y) & 31)) | \ ((unsigned long)(x) << (unsigned long)(32 - ((y) & 31)))) & 0xFFFFFFFFUL) -#define Ch(x,y,z) (z ^ (x & (y ^ z))) -#define Maj(x,y,z) (((x | y) & z) | (x & y)) -#define S(x, n) RORc((x), (n)) -#define R(x, n) (((x)&0xFFFFFFFFUL)>>(n)) -#define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) -#define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) -#define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) -#define Gamma1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10)) +#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, @@ -364,12 +370,12 @@ static int sha256_compress(struct sha256_state *md, } /* Compress */ -#define RND(a,b,c,d,e,f,g,h,i) \ - do { \ - unsigned long t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ - unsigned long t1 = Sigma0(a) + Maj(a, b, c); \ - d += t0; \ - h = t0 + t1; \ +#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); \ + d += t0; \ + h = t0 + t1; \ } while(0) for(i = 0; i < 64; ++i) { @@ -388,8 +394,9 @@ static int sha256_compress(struct sha256_state *md, } /* Initialize the hash state */ -static CURLcode my_sha256_init(struct sha256_state *md) +static CURLcode my_sha256_init(void *in) { + struct sha256_state *md = (struct sha256_state *)in; md->curlen = 0; md->length = 0; md->state[0] = 0x6A09E667UL; @@ -409,41 +416,39 @@ static CURLcode my_sha256_init(struct sha256_state *md) @param md The hash state @param in The data to hash @param inlen The length of the data (octets) - @return 0 if successful */ -static int my_sha256_update(struct sha256_state *md, - const unsigned char *in, - unsigned long inlen) +static void my_sha256_update(void *ctx, + const unsigned char *in, + unsigned int len) { + unsigned long inlen = len; unsigned long n; - -#define block_size 64 + struct sha256_state *md = (struct sha256_state *)ctx; +#define CURL_SHA256_BLOCK_SIZE 64 if(md->curlen > sizeof(md->buf)) - return -1; + return; while(inlen > 0) { - if(md->curlen == 0 && inlen >= block_size) { + if(md->curlen == 0 && inlen >= CURL_SHA256_BLOCK_SIZE) { if(sha256_compress(md, (unsigned char *)in) < 0) - return -1; - md->length += block_size * 8; - in += block_size; - inlen -= block_size; + return; + md->length += CURL_SHA256_BLOCK_SIZE * 8; + in += CURL_SHA256_BLOCK_SIZE; + inlen -= CURL_SHA256_BLOCK_SIZE; } else { - n = CURLMIN(inlen, (block_size - md->curlen)); + n = CURLMIN(inlen, (CURL_SHA256_BLOCK_SIZE - md->curlen)); memcpy(md->buf + md->curlen, in, n); md->curlen += n; in += n; inlen -= n; - if(md->curlen == block_size) { + if(md->curlen == CURL_SHA256_BLOCK_SIZE) { if(sha256_compress(md, md->buf) < 0) - return -1; - md->length += 8 * block_size; + return; + md->length += 8 * CURL_SHA256_BLOCK_SIZE; md->curlen = 0; } } } - - return 0; } /* @@ -452,13 +457,13 @@ static int my_sha256_update(struct sha256_state *md, @param out [out] The destination of the hash (32 bytes) @return 0 if successful */ -static int my_sha256_final(unsigned char *out, - struct sha256_state *md) +static void my_sha256_final(unsigned char *out, void *ctx) { + struct sha256_state *md = ctx; int i; if(md->curlen >= sizeof(md->buf)) - return -1; + return; /* Increase the length of the message */ md->length += md->curlen * 8; @@ -467,7 +472,7 @@ static int my_sha256_final(unsigned char *out, md->buf[md->curlen++] = (unsigned char)0x80; /* If the length is currently above 56 bytes we append zeros - * then compress. Then we can fall back to padding zeros and length + * then compress. Then we can fall back to padding zeros and length * encoding like normal. */ if(md->curlen > 56) { @@ -490,8 +495,6 @@ static int my_sha256_final(unsigned char *out, /* Copy output */ for(i = 0; i < 8; i++) WPA_PUT_BE32(out + (4 * i), md->state[i]); - - return 0; } #endif /* CRYPTO LIBS */ @@ -510,7 +513,7 @@ static int my_sha256_final(unsigned char *out, * Returns CURLE_OK on success. */ CURLcode Curl_sha256it(unsigned char *output, const unsigned char *input, - const size_t length) + const size_t length) { CURLcode result; my_sha256_ctx ctx; @@ -524,22 +527,14 @@ CURLcode Curl_sha256it(unsigned char *output, const unsigned char *input, } -const struct HMAC_params Curl_HMAC_SHA256[] = { - { - /* Hash initialization function. */ - CURLX_FUNCTION_CAST(HMAC_hinit_func, my_sha256_init), - /* Hash update function. */ - CURLX_FUNCTION_CAST(HMAC_hupdate_func, my_sha256_update), - /* Hash computation end function. */ - CURLX_FUNCTION_CAST(HMAC_hfinal_func, my_sha256_final), - /* Size of hash context structure. */ - sizeof(my_sha256_ctx), - /* Maximum key length. */ - 64, - /* Result size. */ - 32 - } +const struct HMAC_params Curl_HMAC_SHA256 = { + my_sha256_init, /* Hash initialization function. */ + my_sha256_update, /* Hash update function. */ + my_sha256_final, /* Hash computation end function. */ + sizeof(my_sha256_ctx), /* Size of hash context structure. */ + 64, /* Maximum key length. */ + 32 /* Result size. */ }; -#endif /* AWS, DIGEST, or libSSH2 */ +#endif /* AWS, DIGEST, or libssh2 */ diff --git a/deps/curl/lib/share.c b/deps/curl/lib/share.c index 8fa5cda0..6cdba18e 100644 --- a/deps/curl/lib/share.c +++ b/deps/curl/lib/share.c @@ -26,23 +26,25 @@ #include #include "urldata.h" +#include "connect.h" #include "share.h" #include "psl.h" #include "vtls/vtls.h" #include "hsts.h" +#include "url.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" #include "curl_memory.h" #include "memdebug.h" -struct Curl_share * +CURLSH * curl_share_init(void) { struct Curl_share *share = calloc(1, sizeof(struct Curl_share)); if(share) { share->magic = CURL_GOOD_SHARE; - share->specifier |= (1<specifier |= (1 << CURL_LOCK_DATA_SHARE); Curl_init_dnscache(&share->hostcache, 23); } @@ -51,7 +53,7 @@ curl_share_init(void) #undef curl_share_setopt CURLSHcode -curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) +curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) { va_list param; int type; @@ -59,12 +61,13 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) curl_unlock_function unlockfunc; void *ptr; CURLSHcode res = CURLSHE_OK; + struct Curl_share *share = sh; if(!GOOD_SHARE_HANDLE(share)) return CURLSHE_INVALID; if(share->dirty) - /* don't allow setting options while one or more handles are already + /* do not allow setting options while one or more handles are already using this share */ return CURLSHE_IN_USE; @@ -119,8 +122,12 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) break; case CURL_LOCK_DATA_CONNECT: - if(Curl_conncache_init(&share->conn_cache, 103)) - res = CURLSHE_NOMEM; + /* It is safe to set this option several times on a share. */ + if(!share->cpool.idata) { + if(Curl_cpool_init(&share->cpool, Curl_on_disconnect, + NULL, share, 103)) + res = CURLSHE_NOMEM; + } break; case CURL_LOCK_DATA_PSL: @@ -133,13 +140,13 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) res = CURLSHE_BAD_OPTION; } if(!res) - share->specifier |= (unsigned int)(1<specifier |= (unsigned int)(1 << type); break; case CURLSHOPT_UNSHARE: /* this is a type this share will no longer share */ type = va_arg(param, int); - share->specifier &= ~(unsigned int)(1<specifier &= ~(unsigned int)(1 << type); switch(type) { case CURL_LOCK_DATA_DNS: break; @@ -208,8 +215,9 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...) } CURLSHcode -curl_share_cleanup(struct Curl_share *share) +curl_share_cleanup(CURLSH *sh) { + struct Curl_share *share = sh; if(!GOOD_SHARE_HANDLE(share)) return CURLSHE_INVALID; @@ -223,8 +231,9 @@ curl_share_cleanup(struct Curl_share *share) return CURLSHE_IN_USE; } - Curl_conncache_close_all_connections(&share->conn_cache); - Curl_conncache_destroy(&share->conn_cache); + if(share->specifier & (1 << CURL_LOCK_DATA_CONNECT)) { + Curl_cpool_destroy(&share->cpool); + } Curl_hash_destroy(&share->hostcache); #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) @@ -264,11 +273,11 @@ Curl_share_lock(struct Curl_easy *data, curl_lock_data type, if(!share) return CURLSHE_INVALID; - if(share->specifier & (unsigned int)(1<specifier & (unsigned int)(1 << type)) { if(share->lockfunc) /* only call this if set! */ share->lockfunc(data, type, accesstype, share->clientdata); } - /* else if we don't share this, pretend successful lock */ + /* else if we do not share this, pretend successful lock */ return CURLSHE_OK; } @@ -281,7 +290,7 @@ Curl_share_unlock(struct Curl_easy *data, curl_lock_data type) if(!share) return CURLSHE_INVALID; - if(share->specifier & (unsigned int)(1<specifier & (unsigned int)(1 << type)) { if(share->unlockfunc) /* only call this if set! */ share->unlockfunc (data, type, share->clientdata); } diff --git a/deps/curl/lib/share.h b/deps/curl/lib/share.h index 632d9198..124f7049 100644 --- a/deps/curl/lib/share.h +++ b/deps/curl/lib/share.h @@ -34,7 +34,10 @@ #define CURL_GOOD_SHARE 0x7e117a1e #define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE) -/* this struct is libcurl-private, don't export details */ +#define CURL_SHARE_KEEP_CONNECT(s) \ + ((s) && ((s)->specifier & (1<< CURL_LOCK_DATA_CONNECT))) + +/* this struct is libcurl-private, do not export details */ struct Curl_share { unsigned int magic; /* CURL_GOOD_SHARE */ unsigned int specifier; @@ -43,7 +46,7 @@ struct Curl_share { curl_lock_function lockfunc; curl_unlock_function unlockfunc; void *clientdata; - struct conncache conn_cache; + struct cpool cpool; struct Curl_hash hostcache; #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) struct CookieInfo *cookies; diff --git a/deps/curl/lib/sigpipe.h b/deps/curl/lib/sigpipe.h index 9b29403c..c57580f4 100644 --- a/deps/curl/lib/sigpipe.h +++ b/deps/curl/lib/sigpipe.h @@ -35,6 +35,13 @@ struct sigpipe_ignore { }; #define SIGPIPE_VARIABLE(x) struct sigpipe_ignore x +#define SIGPIPE_MEMBER(x) struct sigpipe_ignore x + +static void sigpipe_init(struct sigpipe_ignore *ig) +{ + memset(ig, 0, sizeof(*ig)); + ig->no_signal = TRUE; +} /* * sigpipe_ignore() makes sure we ignore SIGPIPE while running libcurl @@ -70,11 +77,23 @@ static void sigpipe_restore(struct sigpipe_ignore *ig) sigaction(SIGPIPE, &ig->old_pipe_act, NULL); } +static void sigpipe_apply(struct Curl_easy *data, + struct sigpipe_ignore *ig) +{ + if(data->set.no_signal != ig->no_signal) { + sigpipe_restore(ig); + sigpipe_ignore(data, ig); + } +} + #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_VARIABLE(x) +#define SIGPIPE_MEMBER(x) bool x #endif #endif /* HEADER_CURL_SIGPIPE_H */ diff --git a/deps/curl/lib/smb.c b/deps/curl/lib/smb.c index 77d34e31..a242fc5c 100644 --- a/deps/curl/lib/smb.c +++ b/deps/curl/lib/smb.c @@ -28,7 +28,9 @@ #if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) #ifdef _WIN32 -#define getpid GetCurrentProcessId +#define Curl_getpid() ((unsigned int)GetCurrentProcessId()) +#else +#define Curl_getpid() ((unsigned int)getpid()) #endif #include "smb.h" @@ -44,7 +46,8 @@ #include "escape.h" #include "curl_endian.h" -/* The last #include files should be: */ +/* The last 3 #include files should be in this order */ +#include "curl_printf.h" #include "curl_memory.h" #include "memdebug.h" @@ -259,7 +262,7 @@ static CURLcode smb_parse_url_path(struct Curl_easy *data, * SMB handler interface */ const struct Curl_handler Curl_handler_smb = { - "SMB", /* scheme */ + "smb", /* scheme */ smb_setup_connection, /* setup_connection */ smb_do, /* do_it */ ZERO_NULL, /* done */ @@ -273,6 +276,7 @@ const struct Curl_handler Curl_handler_smb = { ZERO_NULL, /* perform_getsock */ smb_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SMB, /* defport */ @@ -286,7 +290,7 @@ const struct Curl_handler Curl_handler_smb = { * SMBS handler interface */ const struct Curl_handler Curl_handler_smbs = { - "SMBS", /* scheme */ + "smbs", /* scheme */ smb_setup_connection, /* setup_connection */ smb_do, /* do_it */ ZERO_NULL, /* done */ @@ -300,6 +304,7 @@ const struct Curl_handler Curl_handler_smbs = { ZERO_NULL, /* perform_getsock */ smb_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SMBS, /* defport */ @@ -314,20 +319,6 @@ const struct Curl_handler Curl_handler_smbs = { #define CLIENTNAME "curl" #define SERVICENAME "?????" -/* Append a string to an SMB message */ -#define MSGCAT(str) \ - do { \ - strcpy(p, (str)); \ - p += strlen(str); \ - } while(0) - -/* Append a null-terminated string to an SMB message */ -#define MSGCATNULL(str) \ - do { \ - strcpy(p, (str)); \ - p += strlen(str) + 1; \ - } while(0) - /* SMB is mostly little endian */ #if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || \ defined(__OS400__) @@ -557,7 +548,7 @@ static void smb_format_message(struct Curl_easy *data, struct smb_header *h, h->flags2 = smb_swap16(SMB_FLAGS2_IS_LONG_NAME | SMB_FLAGS2_KNOWS_LONG_NAME); h->uid = smb_swap16(smbc->uid); h->tid = smb_swap16(req->tid); - pid = getpid(); + pid = Curl_getpid(); h->pid_high = smb_swap16((unsigned short)(pid >> 16)); h->pid = smb_swap16((unsigned short) pid); } @@ -570,7 +561,7 @@ static CURLcode smb_send(struct Curl_easy *data, size_t len, size_t bytes_written; CURLcode result; - result = Curl_xfer_send(data, smbc->send_buf, len, &bytes_written); + result = Curl_xfer_send(data, smbc->send_buf, len, FALSE, &bytes_written); if(result) return result; @@ -595,7 +586,7 @@ static CURLcode smb_flush(struct Curl_easy *data) if(!smbc->send_size) return CURLE_OK; - result = Curl_xfer_send(data, smbc->send_buf + smbc->sent, len, + result = Curl_xfer_send(data, smbc->send_buf + smbc->sent, len, FALSE, &bytes_written); if(result) return result; @@ -640,9 +631,9 @@ static CURLcode smb_send_setup(struct Curl_easy *data) unsigned char nt_hash[21]; unsigned char nt[24]; - size_t byte_count = sizeof(lm) + sizeof(nt); - byte_count += strlen(smbc->user) + strlen(smbc->domain); - byte_count += strlen(OS) + strlen(CLIENTNAME) + 4; /* 4 null chars */ + const size_t byte_count = sizeof(lm) + sizeof(nt) + + strlen(smbc->user) + strlen(smbc->domain) + + strlen(CURL_OS) + strlen(CLIENTNAME) + 4; /* 4 null chars */ if(byte_count > sizeof(msg.bytes)) return CURLE_FILESIZE_EXCEEDED; @@ -651,7 +642,7 @@ static CURLcode smb_send_setup(struct Curl_easy *data) Curl_ntlm_core_mk_nt_hash(conn->passwd, nt_hash); Curl_ntlm_core_lm_resp(nt_hash, smbc->challenge, nt); - memset(&msg, 0, sizeof(msg)); + memset(&msg, 0, sizeof(msg) - sizeof(msg.bytes)); msg.word_count = SMB_WC_SETUP_ANDX; msg.andx.command = SMB_COM_NO_ANDX_COMMAND; msg.max_buffer_size = smb_swap16(MAX_MESSAGE_SIZE); @@ -665,11 +656,14 @@ static CURLcode smb_send_setup(struct Curl_easy *data) p += sizeof(lm); memcpy(p, nt, sizeof(nt)); p += sizeof(nt); - MSGCATNULL(smbc->user); - MSGCATNULL(smbc->domain); - MSGCATNULL(OS); - MSGCATNULL(CLIENTNAME); - byte_count = p - msg.bytes; + p += msnprintf(p, byte_count - sizeof(nt) - sizeof(lm), + "%s%c" /* user */ + "%s%c" /* domain */ + "%s%c" /* OS */ + "%s", /* client name */ + smbc->user, 0, smbc->domain, 0, CURL_OS, 0, CLIENTNAME); + p++; /* count the final null termination */ + DEBUGASSERT(byte_count == (size_t)(p - msg.bytes)); msg.byte_count = smb_swap16((unsigned short)byte_count); return smb_send_message(data, SMB_COM_SETUP_ANDX, &msg, @@ -683,21 +677,23 @@ static CURLcode smb_send_tree_connect(struct Curl_easy *data) struct smb_conn *smbc = &conn->proto.smbc; char *p = msg.bytes; - size_t byte_count = strlen(conn->host.name) + strlen(smbc->share); - byte_count += strlen(SERVICENAME) + 5; /* 2 nulls and 3 backslashes */ + const size_t byte_count = strlen(conn->host.name) + strlen(smbc->share) + + strlen(SERVICENAME) + 5; /* 2 nulls and 3 backslashes */ if(byte_count > sizeof(msg.bytes)) return CURLE_FILESIZE_EXCEEDED; - memset(&msg, 0, sizeof(msg)); + memset(&msg, 0, sizeof(msg) - sizeof(msg.bytes)); msg.word_count = SMB_WC_TREE_CONNECT_ANDX; msg.andx.command = SMB_COM_NO_ANDX_COMMAND; msg.pw_len = 0; - MSGCAT("\\\\"); - MSGCAT(conn->host.name); - MSGCAT("\\"); - MSGCATNULL(smbc->share); - MSGCATNULL(SERVICENAME); /* Match any type of service */ - byte_count = p - msg.bytes; + + p += msnprintf(p, byte_count, + "\\\\%s\\" /* hostname */ + "%s%c" /* share */ + "%s", /* service */ + conn->host.name, smbc->share, 0, SERVICENAME); + p++; /* count the final null termination */ + DEBUGASSERT(byte_count == (size_t)(p - msg.bytes)); msg.byte_count = smb_swap16((unsigned short)byte_count); return smb_send_message(data, SMB_COM_TREE_CONNECT_ANDX, &msg, @@ -708,16 +704,15 @@ static CURLcode smb_send_open(struct Curl_easy *data) { struct smb_request *req = data->req.p.smb; struct smb_nt_create msg; - size_t byte_count; + const size_t byte_count = strlen(req->path) + 1; - if((strlen(req->path) + 1) > sizeof(msg.bytes)) + if(byte_count > sizeof(msg.bytes)) return CURLE_FILESIZE_EXCEEDED; - memset(&msg, 0, sizeof(msg)); + memset(&msg, 0, sizeof(msg) - sizeof(msg.bytes)); msg.word_count = SMB_WC_NT_CREATE_ANDX; msg.andx.command = SMB_COM_NO_ANDX_COMMAND; - byte_count = strlen(req->path); - msg.name_length = smb_swap16((unsigned short)byte_count); + msg.name_length = smb_swap16((unsigned short)(byte_count - 1)); msg.share_access = smb_swap32(SMB_FILE_SHARE_ALL); if(data->state.upload) { msg.access = smb_swap32(SMB_GENERIC_READ | SMB_GENERIC_WRITE); @@ -727,7 +722,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, SMB_COM_NT_CREATE_ANDX, &msg, @@ -907,7 +902,7 @@ static CURLcode smb_connection_state(struct Curl_easy *data, bool *done) } smbc->uid = smb_swap16(h->uid); conn_state(data, SMB_CONNECTED); - *done = true; + *done = TRUE; break; default: @@ -922,7 +917,7 @@ static CURLcode smb_connection_state(struct Curl_easy *data, bool *done) /* * Convert a timestamp from the Windows world (100 nsec units from 1 Jan 1601) - * to Posix time. Cap the output to fit within a time_t. + * to POSIX time. Cap the output to fit within a time_t. */ static void get_posix_time(time_t *out, curl_off_t timestamp) { @@ -1069,7 +1064,7 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) break; case SMB_CLOSE: - /* We don't care if the close failed, proceed to tree disconnect anyway */ + /* We do not care if the close failed, proceed to tree disconnect anyway */ next_state = SMB_TREE_DISCONNECT; break; @@ -1107,7 +1102,7 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) case SMB_DONE: result = req->result; - *done = true; + *done = TRUE; break; default: diff --git a/deps/curl/lib/smtp.c b/deps/curl/lib/smtp.c index b32ef36e..d854d364 100644 --- a/deps/curl/lib/smtp.c +++ b/deps/curl/lib/smtp.c @@ -118,7 +118,7 @@ static CURLcode cr_eob_add(struct Curl_easy *data); */ const struct Curl_handler Curl_handler_smtp = { - "SMTP", /* scheme */ + "smtp", /* scheme */ smtp_setup_connection, /* setup_connection */ smtp_do, /* do_it */ smtp_done, /* done */ @@ -132,6 +132,7 @@ const struct Curl_handler Curl_handler_smtp = { ZERO_NULL, /* perform_getsock */ smtp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SMTP, /* defport */ @@ -147,7 +148,7 @@ const struct Curl_handler Curl_handler_smtp = { */ const struct Curl_handler Curl_handler_smtps = { - "SMTPS", /* scheme */ + "smtps", /* scheme */ smtp_setup_connection, /* setup_connection */ smtp_do, /* do_it */ smtp_done, /* done */ @@ -161,6 +162,7 @@ const struct Curl_handler Curl_handler_smtps = { ZERO_NULL, /* perform_getsock */ smtp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SMTPS, /* defport */ @@ -286,7 +288,7 @@ static CURLcode smtp_get_message(struct Curl_easy *data, struct bufref *out) static void smtp_state(struct Curl_easy *data, smtpstate newstate) { struct smtp_conn *smtpc = &data->conn->proto.smtpc; -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[] = { "STOP", @@ -306,8 +308,8 @@ static void smtp_state(struct Curl_easy *data, smtpstate newstate) }; if(smtpc->state != newstate) - infof(data, "SMTP %p state change from %s to %s", - (void *)smtpc, names[smtpc->state], names[newstate]); + CURL_TRC_SMTP(data, "state change from %s to %s", + names[smtpc->state], names[newstate]); #endif smtpc->state = newstate; @@ -532,16 +534,16 @@ static CURLcode smtp_perform_command(struct Curl_easy *data) if(smtp->rcpt) { /* We notify the server we are sending UTF-8 data if a) it supports the SMTPUTF8 extension and b) The mailbox contains UTF-8 characters, in - either the local address or host name parts. This is regardless of - whether the host name is encoded using IDN ACE */ + either the local address or hostname parts. This is regardless of + whether the hostname is encoded using IDN ACE */ bool utf8 = FALSE; if((!smtp->custom) || (!smtp->custom[0])) { char *address = NULL; struct hostname host = { NULL, NULL, NULL, NULL }; - /* Parse the mailbox to verify into the local address and host name - parts, converting the host name to an IDN A-label if necessary */ + /* Parse the mailbox to verify into the local address and hostname + parts, converting the hostname to an IDN A-label if necessary */ result = smtp_parse_address(smtp->rcpt->data, &address, &host); if(result) @@ -553,7 +555,7 @@ static CURLcode smtp_perform_command(struct Curl_easy *data) ((host.encalloc) || (!Curl_is_ASCII_name(address)) || (!Curl_is_ASCII_name(host.name))); - /* Send the VRFY command (Note: The host name part may be absent when the + /* Send the VRFY command (Note: The hostname part may be absent when the host is a local system) */ result = Curl_pp_sendf(data, &conn->proto.smtpc.pp, "VRFY %s%s%s%s", address, @@ -605,8 +607,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) /* We notify the server we are sending UTF-8 data if a) it supports the SMTPUTF8 extension and b) The mailbox contains UTF-8 characters, in - either the local address or host name parts. This is regardless of - whether the host name is encoded using IDN ACE */ + either the local address or hostname parts. This is regardless of + whether the hostname is encoded using IDN ACE */ bool utf8 = FALSE; /* Calculate the FROM parameter */ @@ -614,8 +616,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) char *address = NULL; struct hostname host = { NULL, NULL, NULL, NULL }; - /* Parse the FROM mailbox into the local address and host name parts, - converting the host name to an IDN A-label if necessary */ + /* Parse the FROM mailbox into the local address and hostname parts, + converting the hostname to an IDN A-label if necessary */ result = smtp_parse_address(data->set.str[STRING_MAIL_FROM], &address, &host); if(result) @@ -633,8 +635,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) Curl_free_idnconverted_hostname(&host); } else - /* An invalid mailbox was provided but we'll simply let the server worry - about that and reply with a 501 error */ + /* An invalid mailbox was provided but we will simply let the server + worry about that and reply with a 501 error */ from = aprintf("<%s>", address); free(address); @@ -654,8 +656,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) char *address = NULL; struct hostname host = { NULL, NULL, NULL, NULL }; - /* Parse the AUTH mailbox into the local address and host name parts, - converting the host name to an IDN A-label if necessary */ + /* Parse the AUTH mailbox into the local address and hostname parts, + converting the hostname to an IDN A-label if necessary */ result = smtp_parse_address(data->set.str[STRING_MAIL_AUTH], &address, &host); if(result) @@ -674,7 +676,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) Curl_free_idnconverted_hostname(&host); } else - /* An invalid mailbox was provided but we'll simply let the server + /* An invalid mailbox was provided but we will simply let the server worry about it */ auth = aprintf("<%s>", address); free(address); @@ -693,7 +695,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) /* Prepare the mime data if some. */ if(data->set.mimepost.kind != MIMEKIND_NONE) { /* Use the whole structure as data. */ - data->set.mimepost.flags &= ~MIME_BODY_ONLY; + data->set.mimepost.flags &= ~(unsigned int)MIME_BODY_ONLY; /* Add external headers and mime version. */ curl_mime_headers(&data->set.mimepost, data->set.headers, 0); @@ -721,7 +723,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) /* Calculate the optional SIZE parameter */ if(conn->proto.smtpc.size_supported && data->state.infilesize > 0) { - size = aprintf("%" CURL_FORMAT_CURL_OFF_T, data->state.infilesize); + size = aprintf("%" FMT_OFF_T, data->state.infilesize); if(!size) { result = CURLE_OUT_OF_MEMORY; @@ -729,7 +731,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) } } - /* If the mailboxes in the FROM and AUTH parameters don't include a UTF-8 + /* If the mailboxes in the FROM and AUTH parameters do not include a UTF-8 based address then quickly scan through the recipient list and check if any there do, as we need to correctly identify our support for SMTPUTF8 in the envelope, as per RFC-6531 sect. 3.4 */ @@ -738,7 +740,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) struct curl_slist *rcpt = smtp->rcpt; while(rcpt && !utf8) { - /* Does the host name contain non-ASCII characters? */ + /* Does the hostname contain non-ASCII characters? */ if(!Curl_is_ASCII_name(rcpt->data)) utf8 = TRUE; @@ -788,8 +790,8 @@ static CURLcode smtp_perform_rcpt_to(struct Curl_easy *data) char *address = NULL; struct hostname host = { NULL, NULL, NULL, NULL }; - /* Parse the recipient mailbox into the local address and host name parts, - converting the host name to an IDN A-label if necessary */ + /* Parse the recipient mailbox into the local address and hostname parts, + converting the hostname to an IDN A-label if necessary */ result = smtp_parse_address(smtp->rcpt->data, &address, &host); if(result) @@ -800,7 +802,7 @@ static CURLcode smtp_perform_rcpt_to(struct Curl_easy *data) result = Curl_pp_sendf(data, &conn->proto.smtpc.pp, "RCPT TO:<%s@%s>", address, host.name); else - /* An invalid mailbox was provided but we'll simply let the server worry + /* An invalid mailbox was provided but we will simply let the server worry about that and reply with a 501 error */ result = Curl_pp_sendf(data, &conn->proto.smtpc.pp, "RCPT TO:<%s>", address); @@ -956,7 +958,7 @@ static CURLcode smtp_state_ehlo_resp(struct Curl_easy *data, if(smtpcode != 1) { if(data->set.use_ssl && !Curl_conn_is_ssl(conn, FIRSTSOCKET)) { - /* We don't have a SSL/TLS connection yet, but SSL is requested */ + /* We do not have a SSL/TLS connection yet, but SSL is requested */ if(smtpc->tls_supported) /* Switch to TLS connection now */ result = smtp_perform_starttls(data, conn); @@ -1098,12 +1100,11 @@ static CURLcode smtp_state_rcpt_resp(struct Curl_easy *data, (void)instate; /* no use for this yet */ - is_smtp_err = (smtpcode/100 != 2) ? TRUE : FALSE; + is_smtp_err = (smtpcode/100 != 2); - /* If there's multiple RCPT TO to be issued, it's possible to ignore errors + /* If there is multiple RCPT TO to be issued, it is possible to ignore errors and proceed with only the valid addresses. */ - is_smtp_blocking_err = - (is_smtp_err && !data->set.mail_rcpt_allowfails) ? TRUE : FALSE; + is_smtp_blocking_err = (is_smtp_err && !data->set.mail_rcpt_allowfails); if(is_smtp_err) { /* Remembering the last failure which we can report if all "RCPT TO" have @@ -1127,7 +1128,7 @@ static CURLcode smtp_state_rcpt_resp(struct Curl_easy *data, /* Send the next RCPT TO command */ result = smtp_perform_rcpt_to(data); else { - /* We weren't able to issue a successful RCPT TO command while going + /* We were not able to issue a successful RCPT TO command while going over recipients (potentially multiple). Sending back last error. */ if(!smtp->rcpt_had_ok) { failf(data, "RCPT failed: %d (last error)", smtp->rcpt_last_error); @@ -1162,7 +1163,7 @@ static CURLcode smtp_state_data_resp(struct Curl_easy *data, int smtpcode, Curl_pgrsSetUploadSize(data, data->state.infilesize); /* SMTP upload */ - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); /* End of DO phase */ smtp_state(data, SMTP_STOP); @@ -1200,6 +1201,7 @@ static CURLcode smtp_statemachine(struct Curl_easy *data, size_t nread = 0; /* Busy upgrading the connection; right now all I/O is SSL/TLS, not SMTP */ +upgrade_tls: if(smtpc->state == SMTP_UPGRADETLS) return smtp_perform_upgrade_tls(data); @@ -1236,6 +1238,10 @@ static CURLcode smtp_statemachine(struct Curl_easy *data, case SMTP_STARTTLS: result = smtp_state_starttls_resp(data, smtpcode, smtpc->state); + /* During UPGRADETLS, leave the read loop as we need to connect + * (e.g. TLS handshake) before we continue sending/receiving. */ + if(!result && (smtpc->state == SMTP_UPGRADETLS)) + goto upgrade_tls; break; case SMTP_AUTH: @@ -1289,7 +1295,7 @@ static CURLcode smtp_multi_statemach(struct Curl_easy *data, bool *done) } result = Curl_pp_statemach(data, &smtpc->pp, FALSE, FALSE); - *done = (smtpc->state == SMTP_STOP) ? TRUE : FALSE; + *done = (smtpc->state == SMTP_STOP); return result; } @@ -1415,7 +1421,8 @@ static CURLcode smtp_done(struct Curl_easy *data, CURLcode status, /* Clear the transfer mode for the next request */ smtp->transfer = PPTRANSFER_BODY; - + CURL_TRC_SMTP(data, "smtp_done(status=%d, premature=%d) -> %d", + status, premature, result); return result; } @@ -1433,7 +1440,7 @@ static CURLcode smtp_perform(struct Curl_easy *data, bool *connected, CURLcode result = CURLE_OK; struct SMTP *smtp = data->req.p.smtp; - DEBUGF(infof(data, "DO phase starts")); + CURL_TRC_SMTP(data, "smtp_perform(), start"); if(data->req.no_body) { /* Requested no body means no transfer */ @@ -1445,10 +1452,10 @@ static CURLcode smtp_perform(struct Curl_easy *data, bool *connected, /* Store the first recipient (or NULL if not specified) */ smtp->rcpt = data->set.mail_rcpt; - /* Track of whether we've successfully sent at least one RCPT TO command */ + /* Track of whether we have successfully sent at least one RCPT TO command */ smtp->rcpt_had_ok = FALSE; - /* Track of the last error we've received by sending RCPT TO command */ + /* Track of the last error we have received by sending RCPT TO command */ smtp->rcpt_last_error = 0; /* Initial data character is the first character in line: it is implicitly @@ -1465,16 +1472,16 @@ static CURLcode smtp_perform(struct Curl_easy *data, bool *connected, result = smtp_perform_command(data); if(result) - return result; + goto out; /* Run the state-machine */ result = smtp_multi_statemach(data, dophase_done); *connected = Curl_conn_is_connected(data->conn, FIRSTSOCKET); - if(*dophase_done) - DEBUGF(infof(data, "DO phase is complete")); - +out: + CURL_TRC_SMTP(data, "smtp_perform() -> %d, connected=%d, done=%d", + result, *connected, *dophase_done); return result; } @@ -1500,7 +1507,7 @@ static CURLcode smtp_do(struct Curl_easy *data, bool *done) return result; result = smtp_regular_transfer(data, done); - + CURL_TRC_SMTP(data, "smtp_do() -> %d, done=%d", result, *done); return result; } @@ -1535,6 +1542,7 @@ static CURLcode smtp_disconnect(struct Curl_easy *data, /* Cleanup our connection based variables */ Curl_safefree(smtpc->domain); + CURL_TRC_SMTP(data, "smtp_disconnect(), finished"); return CURLE_OK; } @@ -1548,7 +1556,7 @@ static CURLcode smtp_dophase_done(struct Curl_easy *data, bool connected) if(smtp->transfer != PPTRANSFER_BODY) /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); return CURLE_OK; } @@ -1566,6 +1574,7 @@ static CURLcode smtp_doing(struct Curl_easy *data, bool *dophase_done) DEBUGF(infof(data, "DO phase is complete")); } + CURL_TRC_SMTP(data, "smtp_doing() -> %d, done=%d", result, *dophase_done); return result; } @@ -1600,6 +1609,8 @@ static CURLcode smtp_regular_transfer(struct Curl_easy *data, if(!result && *dophase_done) result = smtp_dophase_done(data, connected); + CURL_TRC_SMTP(data, "smtp_regular_transfer() -> %d, done=%d", + result, *dophase_done); return result; } @@ -1613,10 +1624,8 @@ static CURLcode smtp_setup_connection(struct Curl_easy *data, /* Initialise the SMTP layer */ result = smtp_init(data); - if(result) - return result; - - return CURLE_OK; + CURL_TRC_SMTP(data, "smtp_setup_connection() -> %d", result); + return result; } /*********************************************************************** @@ -1706,7 +1715,7 @@ static CURLcode smtp_parse_custom_request(struct Curl_easy *data) * smtp_parse_address() * * Parse the fully qualified mailbox address into a local address part and the - * host name, converting the host name to an IDN A-label, as per RFC-5890, if + * hostname, converting the hostname to an IDN A-label, as per RFC-5890, if * necessary. * * Parameters: @@ -1717,8 +1726,8 @@ static CURLcode smtp_parse_custom_request(struct Curl_easy *data) * address [in/out] - A new allocated buffer which holds the local * address part of the mailbox. This buffer must be * free'ed by the caller. - * host [in/out] - The host name structure that holds the original, - * and optionally encoded, host name. + * host [in/out] - The hostname structure that holds the original, + * and optionally encoded, hostname. * Curl_free_idnconverted_hostname() must be called * once the caller has finished with the structure. * @@ -1726,14 +1735,14 @@ static CURLcode smtp_parse_custom_request(struct Curl_easy *data) * * Notes: * - * Should a UTF-8 host name require conversion to IDN ACE and we cannot honor + * Should a UTF-8 hostname require conversion to IDN ACE and we cannot honor * that conversion then we shall return success. This allow the caller to send * the data to the server as a U-label (as per RFC-6531 sect. 3.2). * * If an mailbox '@' separator cannot be located then the mailbox is considered * to be either a local mailbox or an invalid mailbox (depending on what the * calling function deems it to be) then the input will simply be returned in - * the address part with the host name being NULL. + * the address part with the hostname being NULL. */ static CURLcode smtp_parse_address(const char *fqma, char **address, struct hostname *host) @@ -1742,7 +1751,7 @@ static CURLcode smtp_parse_address(const char *fqma, char **address, size_t length; /* Duplicate the fully qualified email address so we can manipulate it, - ensuring it doesn't contain the delimiters if specified */ + ensuring it does not contain the delimiters if specified */ char *dup = strdup(fqma[0] == '<' ? fqma + 1 : fqma); if(!dup) return CURLE_OUT_OF_MEMORY; @@ -1753,17 +1762,17 @@ static CURLcode smtp_parse_address(const char *fqma, char **address, dup[length - 1] = '\0'; } - /* Extract the host name from the address (if we can) */ + /* Extract the hostname from the address (if we can) */ host->name = strpbrk(dup, "@"); if(host->name) { *host->name = '\0'; host->name = host->name + 1; - /* Attempt to convert the host name to IDN ACE */ + /* Attempt to convert the hostname to IDN ACE */ (void) Curl_idnconvert_hostname(host); /* If Curl_idnconvert_hostname() fails then we shall attempt to continue - and send the host name using UTF-8 rather than as 7-bit ACE (which is + and send the hostname using UTF-8 rather than as 7-bit ACE (which is our preference) */ } @@ -1901,7 +1910,7 @@ static CURLcode cr_eob_read(struct Curl_easy *data, *peos = ctx->eos; DEBUGF(infof(data, "cr_eob_read(%zu) -> %d, %zd, %d", blen, result, *pnread, *peos)); - return CURLE_OK; + return result; } static curl_off_t cr_eob_total_length(struct Curl_easy *data, @@ -1923,6 +1932,8 @@ static const struct Curl_crtype cr_eob = { Curl_creader_def_resume_from, Curl_creader_def_rewind, Curl_creader_def_unpause, + Curl_creader_def_is_paused, + Curl_creader_def_done, sizeof(struct cr_eob_ctx) }; diff --git a/deps/curl/lib/sockaddr.h b/deps/curl/lib/sockaddr.h index 5a6bb207..2e2d375e 100644 --- a/deps/curl/lib/sockaddr.h +++ b/deps/curl/lib/sockaddr.h @@ -30,7 +30,7 @@ struct Curl_sockaddr_storage { union { struct sockaddr sa; struct sockaddr_in sa_in; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct sockaddr_in6 sa_in6; #endif #ifdef HAVE_STRUCT_SOCKADDR_STORAGE diff --git a/deps/curl/lib/socketpair.c b/deps/curl/lib/socketpair.c index d01b2551..b14f5a5f 100644 --- a/deps/curl/lib/socketpair.c +++ b/deps/curl/lib/socketpair.c @@ -27,7 +27,77 @@ #include "urldata.h" #include "rand.h" -#if !defined(HAVE_SOCKETPAIR) && !defined(CURL_DISABLE_SOCKETPAIR) +#if defined(USE_EVENTFD) +#ifdef HAVE_SYS_EVENTFD_H +#include +#endif + +int Curl_eventfd(curl_socket_t socks[2], bool nonblocking) +{ + int efd = eventfd(0, nonblocking ? EFD_CLOEXEC | EFD_NONBLOCK : EFD_CLOEXEC); + if(efd == -1) { + socks[0] = socks[1] = CURL_SOCKET_BAD; + return -1; + } + socks[0] = socks[1] = efd; + return 0; +} +#elif defined(HAVE_PIPE) +#ifdef HAVE_FCNTL +#include +#endif + +int Curl_pipe(curl_socket_t socks[2], bool nonblocking) +{ + if(pipe(socks)) + return -1; +#ifdef HAVE_FCNTL + if(fcntl(socks[0], F_SETFD, FD_CLOEXEC) || + fcntl(socks[1], F_SETFD, FD_CLOEXEC) ) { + close(socks[0]); + close(socks[1]); + socks[0] = socks[1] = CURL_SOCKET_BAD; + return -1; + } +#endif + if(nonblocking) { + if(curlx_nonblock(socks[0], TRUE) < 0 || + curlx_nonblock(socks[1], TRUE) < 0) { + close(socks[0]); + close(socks[1]); + socks[0] = socks[1] = CURL_SOCKET_BAD; + return -1; + } + } + + return 0; +} +#endif + + +#ifndef CURL_DISABLE_SOCKETPAIR +#ifdef HAVE_SOCKETPAIR +int Curl_socketpair(int domain, int type, int protocol, + curl_socket_t socks[2], bool nonblocking) +{ +#ifdef SOCK_NONBLOCK + type = nonblocking ? type | SOCK_NONBLOCK : type; +#endif + if(socketpair(domain, type, protocol, socks)) + return -1; +#ifndef SOCK_NONBLOCK + if(nonblocking) { + if(curlx_nonblock(socks[0], TRUE) < 0 || + curlx_nonblock(socks[1], TRUE) < 0) { + close(socks[0]); + close(socks[1]); + return -1; + } + } +#endif + return 0; +} +#else /* !HAVE_SOCKETPAIR */ #ifdef _WIN32 /* * This is a socketpair() implementation for Windows. @@ -59,7 +129,7 @@ #include "memdebug.h" int Curl_socketpair(int domain, int type, int protocol, - curl_socket_t socks[2]) + curl_socket_t socks[2], bool nonblocking) { union { struct sockaddr_in inaddr; @@ -85,7 +155,7 @@ int Curl_socketpair(int domain, int type, int protocol, socks[0] = socks[1] = CURL_SOCKET_BAD; #if defined(_WIN32) || defined(__CYGWIN__) - /* don't set SO_REUSEADDR on Windows */ + /* do not set SO_REUSEADDR on Windows */ (void)reuse; #ifdef SO_EXCLUSIVEADDRUSE { @@ -113,7 +183,7 @@ int Curl_socketpair(int domain, int type, int protocol, if(connect(socks[0], &a.addr, sizeof(a.inaddr)) == -1) goto error; - /* use non-blocking accept to make sure we don't block forever */ + /* use non-blocking accept to make sure we do not block forever */ if(curlx_nonblock(listener, TRUE) < 0) goto error; pfd[0].fd = listener; @@ -147,7 +217,7 @@ int Curl_socketpair(int domain, int type, int protocol, nread = sread(socks[1], p, s); if(nread == -1) { int sockerr = SOCKERRNO; - /* Don't block forever */ + /* Do not block forever */ if(Curl_timediff(Curl_now(), start) > (60 * 1000)) goto error; if( @@ -177,6 +247,10 @@ int Curl_socketpair(int domain, int type, int protocol, } while(1); } + if(nonblocking) + if(curlx_nonblock(socks[0], TRUE) < 0 || + curlx_nonblock(socks[1], TRUE) < 0) + goto error; sclose(listener); return 0; @@ -186,5 +260,5 @@ error: sclose(socks[1]); return -1; } - -#endif /* ! HAVE_SOCKETPAIR */ +#endif +#endif /* !CURL_DISABLE_SOCKETPAIR */ diff --git a/deps/curl/lib/socketpair.h b/deps/curl/lib/socketpair.h index bd499abb..3044f112 100644 --- a/deps/curl/lib/socketpair.h +++ b/deps/curl/lib/socketpair.h @@ -26,29 +26,73 @@ #include "curl_setup.h" -#ifdef HAVE_PIPE +#if defined(HAVE_EVENTFD) && \ + defined(__x86_64__) && \ + defined(__aarch64__) && \ + defined(__ia64__) && \ + defined(__ppc64__) && \ + defined(__mips64) && \ + defined(__sparc64__) && \ + defined(__riscv_64e) && \ + defined(__s390x__) + +/* Use eventfd only with 64-bit CPU architectures because eventfd has a + * stringent rule of requiring the 8-byte buffer when calling read(2) and + * write(2) on it. In some rare cases, the C standard library implementation + * on a 32-bit system might choose to define uint64_t as a 32-bit type for + * various reasons (memory limitations, compatibility with older code), + * which makes eventfd broken. + */ +#define USE_EVENTFD 1 #define wakeup_write write #define wakeup_read read #define wakeup_close close -#define wakeup_create pipe +#define wakeup_create(p,nb) Curl_eventfd(p,nb) -#else /* HAVE_PIPE */ +#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) + +#include +int Curl_pipe(curl_socket_t socks[2], bool nonblocking); + +#else /* !USE_EVENTFD && !HAVE_PIPE */ #define wakeup_write swrite #define wakeup_read sread #define wakeup_close sclose -#define wakeup_create(p) Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, p) -#endif /* HAVE_PIPE */ +#if defined(USE_UNIX_SOCKETS) && defined(HAVE_SOCKETPAIR) +#define SOCKETPAIR_FAMILY AF_UNIX +#elif !defined(HAVE_SOCKETPAIR) +#define SOCKETPAIR_FAMILY 0 /* not used */ +#else +#error "unsupported Unix domain and socketpair build combo" +#endif -#ifndef HAVE_SOCKETPAIR +#ifdef SOCK_CLOEXEC +#define SOCKETPAIR_TYPE (SOCK_STREAM | SOCK_CLOEXEC) +#else +#define SOCKETPAIR_TYPE SOCK_STREAM +#endif + +#define wakeup_create(p,nb)\ +Curl_socketpair(SOCKETPAIR_FAMILY, SOCKETPAIR_TYPE, 0, p, nb) + +#endif /* USE_EVENTFD */ + +#ifndef CURL_DISABLE_SOCKETPAIR #include int Curl_socketpair(int domain, int type, int protocol, - curl_socket_t socks[2]); -#else -#define Curl_socketpair(a,b,c,d) socketpair(a,b,c,d) + curl_socket_t socks[2], bool nonblocking); #endif #endif /* HEADER_CURL_SOCKETPAIR_H */ diff --git a/deps/curl/lib/socks.c b/deps/curl/lib/socks.c index ecd2f7ea..d16a30b9 100644 --- a/deps/curl/lib/socks.c +++ b/deps/curl/lib/socks.c @@ -125,7 +125,7 @@ int Curl_blockread_all(struct Curl_cfilter *cf, } nread = Curl_conn_cf_recv(cf->next, data, buf, buffersize, &err); if(nread <= 0) { - result = err; + result = (int)err; if(CURLE_AGAIN == err) continue; if(err) { @@ -194,7 +194,7 @@ static void socksstate(struct socks_state *sx, struct Curl_easy *data, (void)data; if(oldstate == state) - /* don't bother when the new state is the same as the old state */ + /* do not bother when the new state is the same as the old state */ return; sx->state = state; @@ -217,7 +217,7 @@ static CURLproxycode socks_state_send(struct Curl_cfilter *cf, CURLcode result; nwritten = Curl_conn_cf_send(cf->next, data, (char *)sx->outp, - sx->outstanding, &result); + sx->outstanding, FALSE, &result); if(nwritten <= 0) { if(CURLE_AGAIN == result) { return CURLPX_OK; @@ -286,7 +286,7 @@ static CURLproxycode do_SOCKS4(struct Curl_cfilter *cf, { struct connectdata *conn = cf->conn; const bool protocol4a = - (conn->socks_proxy.proxytype == CURLPROXY_SOCKS4A) ? TRUE : FALSE; + (conn->socks_proxy.proxytype == CURLPROXY_SOCKS4A); unsigned char *socksreq = sx->buffer; CURLcode result; CURLproxycode presult; @@ -335,13 +335,13 @@ static CURLproxycode do_SOCKS4(struct Curl_cfilter *cf, goto CONNECT_RESOLVED; } - /* socks4a doesn't resolve anything locally */ + /* socks4a does not resolve anything locally */ sxstate(sx, data, CONNECT_REQ_INIT); goto CONNECT_REQ_INIT; case CONNECT_RESOLVING: /* check if we have the name resolved by now */ - dns = Curl_fetch_addr(data, sx->hostname, (int)conn->port); + dns = Curl_fetch_addr(data, sx->hostname, conn->primary.remote_port); if(dns) { #ifdef CURLRES_ASYNCH @@ -365,7 +365,7 @@ CONNECT_RESOLVED: { struct Curl_addrinfo *hp = NULL; /* - * We cannot use 'hostent' as a struct that Curl_resolv() returns. It + * We cannot use 'hostent' as a struct that Curl_resolv() returns. It * returns a Curl_addrinfo pointer that may not always look the same. */ if(dns) { @@ -388,7 +388,7 @@ CONNECT_RESOLVED: infof(data, "SOCKS4 connect to IPv4 %s (locally resolved)", buf); - Curl_resolv_unlock(data, dns); /* not used anymore from now on */ + Curl_resolv_unlink(data, &dns); /* not used anymore from now on */ } else failf(data, "SOCKS4 connection to %s not supported", sx->hostname); @@ -413,7 +413,7 @@ CONNECT_REQ_INIT: /* there is no real size limit to this field in the protocol, but SOCKS5 limits the proxy user field to 255 bytes and it seems likely that a longer field is either a mistake or malicious input */ - failf(data, "Too long SOCKS proxy user name"); + failf(data, "Too long SOCKS proxy username"); return CURLPX_LONG_USER; } /* copy the proxy name WITH trailing zero */ @@ -440,7 +440,7 @@ CONNECT_REQ_INIT: (packetsize + hostnamelen < sizeof(sx->buffer))) strcpy((char *)socksreq + packetsize, sx->hostname); else { - failf(data, "SOCKS4: too long host name"); + failf(data, "SOCKS4: too long hostname"); return CURLPX_LONG_HOSTNAME; } packetsize += hostnamelen; @@ -512,11 +512,11 @@ CONNECT_REQ_INIT: /* Result */ switch(socksreq[1]) { case 90: - infof(data, "SOCKS4%s request granted.", protocol4a?"a":""); + infof(data, "SOCKS4%s request granted.", protocol4a ? "a" : ""); break; case 91: failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" + "cannot complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" ", request rejected or failed.", socksreq[4], socksreq[5], socksreq[6], socksreq[7], (((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]), @@ -524,7 +524,7 @@ CONNECT_REQ_INIT: return CURLPX_REQUEST_FAILED; case 92: failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" + "cannot complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" ", request rejected because SOCKS server cannot connect to " "identd on the client.", socksreq[4], socksreq[5], socksreq[6], socksreq[7], @@ -533,7 +533,7 @@ CONNECT_REQ_INIT: return CURLPX_IDENTD; case 93: failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" + "cannot complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" ", request rejected because the client program and identd " "report different user-ids.", socksreq[4], socksreq[5], socksreq[6], socksreq[7], @@ -542,7 +542,7 @@ CONNECT_REQ_INIT: return CURLPX_IDENTD_DIFFER; default: failf(data, - "Can't complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" + "cannot complete SOCKS4 connection to %d.%d.%d.%d:%d. (%d)" ", Unknown.", socksreq[4], socksreq[5], socksreq[6], socksreq[7], (((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]), @@ -562,7 +562,7 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf, struct Curl_easy *data) { /* - According to the RFC1928, section "6. Replies". This is what a SOCK5 + According to the RFC1928, section "6. Replies". This is what a SOCK5 replies: +----+-----+-------+------+----------+----------+ @@ -583,7 +583,7 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf, CURLcode result; CURLproxycode presult; bool socks5_resolve_local = - (conn->socks_proxy.proxytype == CURLPROXY_SOCKS5) ? TRUE : FALSE; + (conn->socks_proxy.proxytype == CURLPROXY_SOCKS5); const size_t hostname_len = strlen(sx->hostname); size_t len = 0; const unsigned char auth = data->set.socks5auth; @@ -714,7 +714,7 @@ CONNECT_SOCKS_READ_INIT: CONNECT_AUTH_INIT: case CONNECT_AUTH_INIT: { - /* Needs user name and password */ + /* Needs username and password */ size_t proxy_user_len, proxy_password_len; if(sx->proxy_user && sx->proxy_password) { proxy_user_len = strlen(sx->proxy_user); @@ -738,7 +738,7 @@ CONNECT_AUTH_INIT: if(sx->proxy_user && proxy_user_len) { /* the length must fit in a single byte */ if(proxy_user_len > 255) { - failf(data, "Excessive user name length for proxy auth"); + failf(data, "Excessive username length for proxy auth"); return CURLPX_LONG_USER; } memcpy(socksreq + len, sx->proxy_user, proxy_user_len); @@ -838,7 +838,7 @@ CONNECT_RESOLVED: struct Curl_addrinfo *hp = NULL; if(dns) hp = dns->addr; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(data->set.ipver != CURL_IPRESOLVE_WHATEVER) { int wanted_family = data->set.ipver == CURL_IPRESOLVE_V4 ? AF_INET : AF_INET6; @@ -872,7 +872,7 @@ CONNECT_RESOLVED: infof(data, "SOCKS5 connect to %s:%d (locally resolved)", dest, sx->remote_port); } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else if(hp->ai_family == AF_INET6) { int i; struct sockaddr_in6 *saddr_in6; @@ -893,7 +893,7 @@ CONNECT_RESOLVED: failf(data, "SOCKS5 connection to %s not supported", dest); } - Curl_resolv_unlock(data, dns); /* not used anymore from now on */ + Curl_resolv_unlink(data, &dns); /* not used anymore from now on */ goto CONNECT_REQ_SEND; } CONNECT_RESOLVE_REMOTE: @@ -909,7 +909,7 @@ CONNECT_RESOLVE_REMOTE: IPv6 == 4, IPv4 == 1 */ unsigned char ip4[4]; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(conn->bits.ipv6_ip) { char ip6[16]; if(1 != Curl_inet_pton(AF_INET6, sx->hostname, ip6)) @@ -990,7 +990,7 @@ CONNECT_REQ_SEND: else if(socksreq[1]) { /* Anything besides 0 is an error */ CURLproxycode rc = CURLPX_REPLY_UNASSIGNED; int code = socksreq[1]; - failf(data, "Can't complete SOCKS5 connection to %s. (%d)", + failf(data, "cannot complete SOCKS5 connection to %s. (%d)", sx->hostname, (unsigned char)socksreq[1]); if(code < 9) { /* RFC 1928 section 6 lists: */ @@ -1120,7 +1120,7 @@ static void socks_proxy_cf_free(struct Curl_cfilter *cf) } /* After a TCP connection to the proxy has been verified, this function does - the next magic steps. If 'done' isn't set TRUE, it is not done yet and + the next magic steps. If 'done' is not set TRUE, it is not done yet and must be called again. Note: this function's sub-functions call failf() @@ -1175,7 +1175,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, result = connect_SOCKS(cf, sx, data); if(!result && sx->state == CONNECT_DONE) { cf->connected = TRUE; - Curl_verboseconnect(data, conn); + Curl_verboseconnect(data, conn, cf->sockindex); socks_proxy_cf_free(cf); } @@ -1244,11 +1244,12 @@ static void socks_cf_get_host(struct Curl_cfilter *cf, struct Curl_cftype Curl_cft_socks_proxy = { "SOCKS-PROXYY", - CF_TYPE_IP_CONNECT, + CF_TYPE_IP_CONNECT|CF_TYPE_PROXY, 0, socks_proxy_cf_destroy, socks_proxy_cf_connect, socks_proxy_cf_close, + Curl_cf_def_shutdown, socks_cf_get_host, socks_cf_adjust_pollset, Curl_cf_def_data_pending, diff --git a/deps/curl/lib/socks_gssapi.c b/deps/curl/lib/socks_gssapi.c index c0b42b87..f6fd55dc 100644 --- a/deps/curl/lib/socks_gssapi.c +++ b/deps/curl/lib/socks_gssapi.c @@ -42,6 +42,8 @@ #include "curl_memory.h" #include "memdebug.h" +#define MAX_GSS_LEN 1024 + static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT; /* @@ -56,10 +58,9 @@ static int check_gss_err(struct Curl_easy *data, OM_uint32 maj_stat, min_stat; OM_uint32 msg_ctx = 0; gss_buffer_desc status_string = GSS_C_EMPTY_BUFFER; - char buf[1024]; - size_t len; + struct dynbuf dbuf; - len = 0; + Curl_dyn_init(&dbuf, MAX_GSS_LEN); msg_ctx = 0; while(!msg_ctx) { /* convert major status code (GSS-API error) to text */ @@ -68,19 +69,16 @@ static int check_gss_err(struct Curl_easy *data, GSS_C_NULL_OID, &msg_ctx, &status_string); if(maj_stat == GSS_S_COMPLETE) { - if(sizeof(buf) > len + status_string.length + 1) { - strcpy(buf + len, (char *) status_string.value); - len += status_string.length; - } + if(Curl_dyn_addn(&dbuf, status_string.value, + status_string.length)) + return 1; /* error */ gss_release_buffer(&min_stat, &status_string); break; } gss_release_buffer(&min_stat, &status_string); } - if(sizeof(buf) > len + 3) { - strcpy(buf + len, ".\n"); - len += 2; - } + if(Curl_dyn_addn(&dbuf, ".\n", 2)) + return 1; /* error */ msg_ctx = 0; while(!msg_ctx) { /* convert minor status code (underlying routine error) to text */ @@ -89,14 +87,16 @@ static int check_gss_err(struct Curl_easy *data, GSS_C_NULL_OID, &msg_ctx, &status_string); if(maj_stat == GSS_S_COMPLETE) { - if(sizeof(buf) > len + status_string.length) - strcpy(buf + len, (char *) status_string.value); + if(Curl_dyn_addn(&dbuf, status_string.value, + status_string.length)) + return 1; /* error */ gss_release_buffer(&min_stat, &status_string); break; } gss_release_buffer(&min_stat, &status_string); } - failf(data, "GSS-API error: %s failed: %s", function, buf); + failf(data, "GSS-API error: %s failed: %s", function, Curl_dyn_ptr(&dbuf)); + Curl_dyn_free(&dbuf); return 1; } @@ -172,7 +172,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's no */ + /* As long as we need to keep sending some context info, and there is no */ /* errors, keep sending it... */ for(;;) { gss_major_status = Curl_gss_init_sec_context(data, @@ -201,10 +201,11 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(gss_send_token.length) { socksreq[0] = 1; /* GSS-API subnegotiation version */ socksreq[1] = 1; /* authentication message type */ - us_length = htons((short)gss_send_token.length); + us_length = htons((unsigned short)gss_send_token.length); memcpy(socksreq + 2, &us_length, sizeof(short)); - nwritten = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, &code); + nwritten = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, + FALSE, &code); if(code || (4 != nwritten)) { failf(data, "Failed to send GSS-API authentication request."); gss_release_name(&gss_status, &server); @@ -216,7 +217,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, nwritten = Curl_conn_cf_send(cf->next, data, (char *)gss_send_token.value, - gss_send_token.length, &code); + gss_send_token.length, FALSE, &code); if(code || ((ssize_t)gss_send_token.length != nwritten)) { failf(data, "Failed to send GSS-API authentication token."); gss_release_name(&gss_status, &server); @@ -306,7 +307,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, gss_minor_status, "gss_inquire_context")) { gss_delete_sec_context(&gss_status, &gss_context, NULL); gss_release_name(&gss_status, &gss_client_name); - failf(data, "Failed to determine user name."); + failf(data, "Failed to determine username."); return CURLE_COULDNT_CONNECT; } gss_major_status = gss_display_name(&gss_minor_status, gss_client_name, @@ -316,7 +317,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, 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); - failf(data, "Failed to determine user name."); + failf(data, "Failed to determine username."); return CURLE_COULDNT_CONNECT; } user = malloc(gss_send_token.length + 1); @@ -348,7 +349,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, gss_enc = 1; infof(data, "SOCKS5 server supports GSS-API %s data protection.", - (gss_enc == 0)?"no":((gss_enc==1)?"integrity":"confidentiality")); + (gss_enc == 0) ? "no" : + ((gss_enc == 1) ? "integrity" : "confidentiality")); /* force for the moment to no data protection */ gss_enc = 0; /* @@ -377,7 +379,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, * * The token is produced by encapsulating an octet containing the * required protection level using gss_seal()/gss_wrap() with conf_req - * set to FALSE. The token is verified using gss_unseal()/ + * set to FALSE. The token is verified using gss_unseal()/ * gss_unwrap(). * */ @@ -406,11 +408,12 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, } gss_release_buffer(&gss_status, &gss_send_token); - us_length = htons((short)gss_w_token.length); + us_length = htons((unsigned short)gss_w_token.length); memcpy(socksreq + 2, &us_length, sizeof(short)); } - nwritten = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, &code); + nwritten = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE, + &code); if(code || (4 != nwritten)) { failf(data, "Failed to send GSS-API encryption request."); gss_release_buffer(&gss_status, &gss_w_token); @@ -420,7 +423,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(data->set.socks5_gssapi_nec) { memcpy(socksreq, &gss_enc, 1); - nwritten = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, &code); + nwritten = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE, + &code); if(code || ( 1 != nwritten)) { failf(data, "Failed to send GSS-API encryption type."); gss_delete_sec_context(&gss_status, &gss_context, NULL); @@ -430,7 +434,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, else { nwritten = Curl_conn_cf_send(cf->next, data, (char *)gss_w_token.value, - gss_w_token.length, &code); + gss_w_token.length, FALSE, &code); if(code || ((ssize_t)gss_w_token.length != nwritten)) { failf(data, "Failed to send GSS-API encryption type."); gss_release_buffer(&gss_status, &gss_w_token); @@ -522,8 +526,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, (void)curlx_nonblock(sock, TRUE); infof(data, "SOCKS5 access with%s protection granted.", - (socksreq[0] == 0)?"out GSS-API data": - ((socksreq[0] == 1)?" GSS-API integrity":" GSS-API confidentiality")); + (socksreq[0] == 0) ? "out GSS-API data": + ((socksreq[0] == 1) ? " GSS-API integrity" : + " GSS-API confidentiality")); conn->socks5_gssapi_enctype = socksreq[0]; if(socksreq[0] == 0) diff --git a/deps/curl/lib/socks_sspi.c b/deps/curl/lib/socks_sspi.c index 2baae2c2..6d8e6ef7 100644 --- a/deps/curl/lib/socks_sspi.c +++ b/deps/curl/lib/socks_sspi.c @@ -139,7 +139,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, cred_handle.dwLower = 0; cred_handle.dwUpper = 0; - status = s_pSecFn->AcquireCredentialsHandle(NULL, + status = Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT("Kerberos"), SECPKG_CRED_OUTBOUND, NULL, @@ -152,13 +152,13 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(check_sspi_err(data, status, "AcquireCredentialsHandle")) { failf(data, "Failed to acquire credentials."); free(service_name); - s_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); return CURLE_COULDNT_CONNECT; } (void)curlx_nonblock(sock, FALSE); - /* As long as we need to keep sending some context info, and there's no */ + /* As long as we need to keep sending some context info, and there is no */ /* errors, keep sending it... */ for(;;) { TCHAR *sname; @@ -167,7 +167,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(!sname) return CURLE_OUT_OF_MEMORY; - status = s_pSecFn->InitializeSecurityContext(&cred_handle, + status = Curl_pSecFn->InitializeSecurityContext(&cred_handle, context_handle, sname, ISC_REQ_MUTUAL_AUTH | @@ -186,17 +186,17 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, curlx_unicodefree(sname); if(sspi_recv_token.pvBuffer) { - s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); sspi_recv_token.pvBuffer = NULL; sspi_recv_token.cbBuffer = 0; } if(check_sspi_err(data, status, "InitializeSecurityContext")) { free(service_name); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); if(sspi_recv_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); failf(data, "Failed to initialise security context."); return CURLE_COULDNT_CONNECT; } @@ -204,47 +204,48 @@ 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 */ - us_length = htons((short)sspi_send_token.cbBuffer); + us_length = htons((unsigned short)sspi_send_token.cbBuffer); memcpy(socksreq + 2, &us_length, sizeof(short)); - written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, &code); + written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE, + &code); if(code || (4 != written)) { failf(data, "Failed to send SSPI authentication request."); free(service_name); if(sspi_send_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); if(sspi_recv_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } written = Curl_conn_cf_send(cf->next, data, (char *)sspi_send_token.pvBuffer, - sspi_send_token.cbBuffer, &code); + sspi_send_token.cbBuffer, FALSE, &code); if(code || (sspi_send_token.cbBuffer != (size_t)written)) { failf(data, "Failed to send SSPI authentication token."); free(service_name); if(sspi_send_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); if(sspi_recv_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } } if(sspi_send_token.pvBuffer) { - s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); sspi_send_token.pvBuffer = NULL; } sspi_send_token.cbBuffer = 0; if(sspi_recv_token.pvBuffer) { - s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); sspi_recv_token.pvBuffer = NULL; } sspi_recv_token.cbBuffer = 0; @@ -266,8 +267,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(result || (actualread != 4)) { failf(data, "Failed to receive SSPI authentication response."); free(service_name); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -276,8 +277,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "User was rejected by the SOCKS5 server (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); free(service_name); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -285,8 +286,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "Invalid SSPI authentication response type (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); free(service_name); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -298,8 +299,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(!sspi_recv_token.pvBuffer) { free(service_name); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } result = Curl_blockread_all(cf, data, (char *)sspi_recv_token.pvBuffer, @@ -309,9 +310,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "Failed to receive SSPI authentication token."); free(service_name); if(sspi_recv_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); - s_pSecFn->FreeCredentialsHandle(&cred_handle); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_recv_token.pvBuffer); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -321,14 +322,14 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, free(service_name); /* Everything is good so far, user was authenticated! */ - status = s_pSecFn->QueryCredentialsAttributes(&cred_handle, + status = Curl_pSecFn->QueryCredentialsAttributes(&cred_handle, SECPKG_CRED_ATTR_NAMES, &names); - s_pSecFn->FreeCredentialsHandle(&cred_handle); + Curl_pSecFn->FreeCredentialsHandle(&cred_handle); if(check_sspi_err(data, status, "QueryCredentialAttributes")) { - s_pSecFn->DeleteSecurityContext(&sspi_context); - s_pSecFn->FreeContextBuffer(names.sUserName); - failf(data, "Failed to determine user name."); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(names.sUserName); + failf(data, "Failed to determine username."); return CURLE_COULDNT_CONNECT; } else { @@ -338,7 +339,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, (user_utf8 ? user_utf8 : "(unknown)")); curlx_unicodefree(user_utf8); #endif - s_pSecFn->FreeContextBuffer(names.sUserName); + Curl_pSecFn->FreeContextBuffer(names.sUserName); } /* Do encryption */ @@ -354,7 +355,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, gss_enc = 1; infof(data, "SOCKS5 server supports GSS-API %s data protection.", - (gss_enc == 0)?"no":((gss_enc == 1)?"integrity":"confidentiality") ); + (gss_enc == 0) ? "no" : + ((gss_enc == 1) ? "integrity":"confidentiality") ); /* force to no data protection, avoid encryption/decryption for now */ gss_enc = 0; /* @@ -383,21 +385,21 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, * * The token is produced by encapsulating an octet containing the * required protection level using gss_seal()/gss_wrap() with conf_req - * set to FALSE. The token is verified using gss_unseal()/ + * set to FALSE. The token is verified using gss_unseal()/ * gss_unwrap(). * */ if(data->set.socks5_gssapi_nec) { - us_length = htons((short)1); + us_length = htons((unsigned short)1); memcpy(socksreq + 2, &us_length, sizeof(short)); } else { - status = s_pSecFn->QueryContextAttributes(&sspi_context, + status = Curl_pSecFn->QueryContextAttributes(&sspi_context, SECPKG_ATTR_SIZES, &sspi_sizes); if(check_sspi_err(data, status, "QueryContextAttributes")) { - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); failf(data, "Failed to query security context attributes."); return CURLE_COULDNT_CONNECT; } @@ -407,15 +409,15 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, sspi_w_token[0].pvBuffer = malloc(sspi_sizes.cbSecurityTrailer); if(!sspi_w_token[0].pvBuffer) { - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } sspi_w_token[1].cbBuffer = 1; sspi_w_token[1].pvBuffer = malloc(1); if(!sspi_w_token[1].pvBuffer) { - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } @@ -424,20 +426,20 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, sspi_w_token[2].cbBuffer = sspi_sizes.cbBlockSize; sspi_w_token[2].pvBuffer = malloc(sspi_sizes.cbBlockSize); if(!sspi_w_token[2].pvBuffer) { - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } - status = s_pSecFn->EncryptMessage(&sspi_context, + status = Curl_pSecFn->EncryptMessage(&sspi_context, KERB_WRAP_NO_ENCRYPT, &wrap_desc, 0); if(check_sspi_err(data, status, "EncryptMessage")) { - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); failf(data, "Failed to query security context attributes."); return CURLE_COULDNT_CONNECT; } @@ -446,10 +448,10 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, + sspi_w_token[2].cbBuffer; sspi_send_token.pvBuffer = malloc(sspi_send_token.cbBuffer); if(!sspi_send_token.pvBuffer) { - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } @@ -462,57 +464,59 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, + sspi_w_token[1].cbBuffer, sspi_w_token[2].pvBuffer, sspi_w_token[2].cbBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); sspi_w_token[0].pvBuffer = NULL; sspi_w_token[0].cbBuffer = 0; - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); sspi_w_token[1].pvBuffer = NULL; sspi_w_token[1].cbBuffer = 0; - s_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[2].pvBuffer); sspi_w_token[2].pvBuffer = NULL; sspi_w_token[2].cbBuffer = 0; - us_length = htons((short)sspi_send_token.cbBuffer); + us_length = htons((unsigned short)sspi_send_token.cbBuffer); memcpy(socksreq + 2, &us_length, sizeof(short)); } - written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, &code); + written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE, + &code); if(code || (4 != written)) { failf(data, "Failed to send SSPI encryption request."); if(sspi_send_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(data->set.socks5_gssapi_nec) { memcpy(socksreq, &gss_enc, 1); - written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, &code); + written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE, + &code); if(code || (1 != written)) { failf(data, "Failed to send SSPI encryption type."); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } } else { written = Curl_conn_cf_send(cf->next, data, (char *)sspi_send_token.pvBuffer, - sspi_send_token.cbBuffer, &code); + sspi_send_token.cbBuffer, FALSE, &code); if(code || (sspi_send_token.cbBuffer != (size_t)written)) { failf(data, "Failed to send SSPI encryption type."); if(sspi_send_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(sspi_send_token.pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer); } result = Curl_blockread_all(cf, data, (char *)socksreq, 4, &actualread); if(result || (actualread != 4)) { failf(data, "Failed to receive SSPI encryption response."); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -520,14 +524,14 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(socksreq[1] == 255) { /* status / message type */ failf(data, "User was rejected by the SOCKS5 server (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } if(socksreq[1] != 2) { /* status / message type */ failf(data, "Invalid SSPI encryption response type (%u %u).", (unsigned int)socksreq[0], (unsigned int)socksreq[1]); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -537,7 +541,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, sspi_w_token[0].cbBuffer = us_length; sspi_w_token[0].pvBuffer = malloc(us_length); if(!sspi_w_token[0].pvBuffer) { - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_OUT_OF_MEMORY; } @@ -546,8 +550,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, if(result || (actualread != us_length)) { failf(data, "Failed to receive SSPI encryption type."); - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } @@ -559,17 +563,17 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, sspi_w_token[1].cbBuffer = 0; sspi_w_token[1].pvBuffer = NULL; - status = s_pSecFn->DecryptMessage(&sspi_context, + status = Curl_pSecFn->DecryptMessage(&sspi_context, &wrap_desc, 0, &qop); if(check_sspi_err(data, status, "DecryptMessage")) { if(sspi_w_token[0].pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); if(sspi_w_token[1].pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); failf(data, "Failed to query security context attributes."); return CURLE_COULDNT_CONNECT; } @@ -578,40 +582,41 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, failf(data, "Invalid SSPI encryption response length (%lu).", (unsigned long)sspi_w_token[1].cbBuffer); if(sspi_w_token[0].pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); if(sspi_w_token[1].pvBuffer) - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } memcpy(socksreq, sspi_w_token[1].pvBuffer, sspi_w_token[1].cbBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[1].pvBuffer); } else { if(sspi_w_token[0].cbBuffer != 1) { failf(data, "Invalid SSPI encryption response length (%lu).", (unsigned long)sspi_w_token[0].cbBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); return CURLE_COULDNT_CONNECT; } memcpy(socksreq, sspi_w_token[0].pvBuffer, sspi_w_token[0].cbBuffer); - s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); + Curl_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer); } (void)curlx_nonblock(sock, TRUE); infof(data, "SOCKS5 access with%s protection granted.", - (socksreq[0] == 0)?"out GSS-API data": - ((socksreq[0] == 1)?" GSS-API integrity":" GSS-API confidentiality")); + (socksreq[0] == 0) ? "out GSS-API data": + ((socksreq[0] == 1) ? " GSS-API integrity" : + " GSS-API confidentiality")); /* For later use if encryption is required conn->socks5_gssapi_enctype = socksreq[0]; if(socksreq[0] != 0) conn->socks5_sspi_context = sspi_context; else { - s_pSecFn->DeleteSecurityContext(&sspi_context); + Curl_pSecFn->DeleteSecurityContext(&sspi_context); conn->socks5_sspi_context = sspi_context; } */ diff --git a/deps/curl/lib/speedcheck.h b/deps/curl/lib/speedcheck.h index bff2f32b..8b116f15 100644 --- a/deps/curl/lib/speedcheck.h +++ b/deps/curl/lib/speedcheck.h @@ -27,7 +27,7 @@ #include "curl_setup.h" #include "timeval.h" - +struct Curl_easy; void Curl_speedinit(struct Curl_easy *data); CURLcode Curl_speedcheck(struct Curl_easy *data, struct curltime now); diff --git a/deps/curl/lib/splay.c b/deps/curl/lib/splay.c index 48e079b3..3f2bae02 100644 --- a/deps/curl/lib/splay.c +++ b/deps/curl/lib/splay.c @@ -24,6 +24,7 @@ #include "curl_setup.h" +#include "timeval.h" #include "splay.h" /* @@ -33,7 +34,7 @@ * zero : when i is equal to j * positive when : when i is larger than j */ -#define compare(i,j) Curl_splaycomparekeys((i),(j)) +#define compare(i,j) Curl_timediff_us(i,j) /* * Splay using the key i (which may or may not be in the tree.) The starting @@ -45,12 +46,12 @@ struct Curl_tree *Curl_splay(struct curltime i, struct Curl_tree N, *l, *r, *y; if(!t) - return t; + return NULL; N.smaller = N.larger = NULL; l = r = &N; for(;;) { - long comp = compare(i, t->key); + timediff_t comp = compare(i, t->key); if(comp < 0) { if(!t->smaller) break; @@ -93,7 +94,7 @@ struct Curl_tree *Curl_splay(struct curltime i, return t; } -/* Insert key i into the tree t. Return a pointer to the resulting tree or +/* Insert key i into the tree t. Return a pointer to the resulting tree or * NULL if something went wrong. * * @unittest: 1309 @@ -106,15 +107,15 @@ struct Curl_tree *Curl_splayinsert(struct curltime i, ~0, -1 }; /* will *NEVER* appear */ - if(!node) - return t; + DEBUGASSERT(node); if(t) { t = Curl_splay(i, t); + DEBUGASSERT(t); if(compare(i, t->key) == 0) { - /* There already exists a node in the tree with the very same key. Build - a doubly-linked circular list of nodes. We add the new 'node' struct - to the end of this list. */ + /* There already exists a node in the tree with the same key. Build a + doubly-linked circular list of nodes. We add the new 'node' struct to + the end of this list. */ node->key = KEY_NOTUSED; /* we set the key in the sub node to NOTUSED to quickly identify this node as a subnode */ @@ -150,7 +151,7 @@ struct Curl_tree *Curl_splayinsert(struct curltime i, } /* Finds and deletes the best-fit node from the tree. Return a pointer to the - resulting tree. best-fit means the smallest node if it is not larger than + resulting tree. best-fit means the smallest node if it is not larger than the key */ struct Curl_tree *Curl_splaygetbest(struct curltime i, struct Curl_tree *t, @@ -166,6 +167,7 @@ struct Curl_tree *Curl_splaygetbest(struct curltime i, /* find smallest */ t = Curl_splay(tv_zero, t); + DEBUGASSERT(t); if(compare(i, t->key) < 0) { /* even the smallest is too big */ *removed = NULL; @@ -197,13 +199,13 @@ struct Curl_tree *Curl_splaygetbest(struct curltime i, } -/* Deletes the very node we point out from the tree if it's there. Stores a +/* Deletes the node we point out from the tree if it is there. Stores a * pointer to the new resulting tree in 'newroot'. * * Returns zero on success and non-zero on errors! * When returning error, it does not touch the 'newroot' pointer. * - * NOTE: when the last node of the tree is removed, there's no tree left so + * NOTE: when the last node of the tree is removed, there is no tree left so * 'newroot' will be made to point to NULL. * * @unittest: 1309 @@ -217,9 +219,11 @@ int Curl_splayremove(struct Curl_tree *t, }; /* will *NEVER* appear */ struct Curl_tree *x; - if(!t || !removenode) + if(!t) return 1; + DEBUGASSERT(removenode); + if(compare(KEY_NOTUSED, removenode->key) == 0) { /* Key set to NOTUSED means it is a subnode within a 'same' linked list and thus we can unlink it easily. */ @@ -238,10 +242,11 @@ int Curl_splayremove(struct Curl_tree *t, } t = Curl_splay(removenode->key, t); + DEBUGASSERT(t); /* First make sure that we got the same root node as the one we want to remove, as otherwise we might be trying to remove a node that - isn't actually in the tree. + is not actually in the tree. We cannot just compare the keys here as a double remove in quick succession of a node with key != KEY_NOTUSED && same != NULL @@ -249,7 +254,7 @@ int Curl_splayremove(struct Curl_tree *t, if(t != removenode) return 2; - /* Check if there is a list with identical sizes, as then we're trying to + /* Check if there is a list with identical sizes, as then we are trying to remove the root node of a list of nodes with identical keys. */ x = t->samen; if(x != t) { @@ -268,6 +273,7 @@ int Curl_splayremove(struct Curl_tree *t, x = t->larger; else { x = Curl_splay(removenode->key, t->smaller); + DEBUGASSERT(x); x->larger = t->larger; } } @@ -276,3 +282,16 @@ int Curl_splayremove(struct Curl_tree *t, return 0; } + +/* set and get the custom payload for this tree node */ +void Curl_splayset(struct Curl_tree *node, void *payload) +{ + DEBUGASSERT(node); + node->ptr = payload; +} + +void *Curl_splayget(struct Curl_tree *node) +{ + DEBUGASSERT(node); + return node->ptr; +} diff --git a/deps/curl/lib/splay.h b/deps/curl/lib/splay.h index dd1d07ac..b8c9360e 100644 --- a/deps/curl/lib/splay.h +++ b/deps/curl/lib/splay.h @@ -26,13 +26,14 @@ #include "curl_setup.h" #include "timeval.h" +/* only use function calls to access this struct */ struct Curl_tree { struct Curl_tree *smaller; /* smaller node */ struct Curl_tree *larger; /* larger node */ struct Curl_tree *samen; /* points to the next node with identical key */ struct Curl_tree *samep; /* points to the prev node with identical key */ - struct curltime key; /* this node's "sort" key */ - void *payload; /* data the splay code doesn't care about */ + struct curltime key; /* this node's "sort" key */ + void *ptr; /* data the splay code does not care about */ }; struct Curl_tree *Curl_splay(struct curltime i, @@ -50,9 +51,8 @@ int Curl_splayremove(struct Curl_tree *t, struct Curl_tree *removenode, struct Curl_tree **newroot); -#define Curl_splaycomparekeys(i,j) ( ((i.tv_sec) < (j.tv_sec)) ? -1 : \ - ( ((i.tv_sec) > (j.tv_sec)) ? 1 : \ - ( ((i.tv_usec) < (j.tv_usec)) ? -1 : \ - ( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0)))) +/* set and get the custom payload for this tree node */ +void Curl_splayset(struct Curl_tree *node, void *payload); +void *Curl_splayget(struct Curl_tree *node); #endif /* HEADER_CURL_SPLAY_H */ diff --git a/deps/curl/lib/strcase.c b/deps/curl/lib/strcase.c index 7c0b4ef9..b22dd31f 100644 --- a/deps/curl/lib/strcase.c +++ b/deps/curl/lib/strcase.c @@ -71,7 +71,7 @@ static const unsigned char tolowermap[256] = { altered by the current locale. */ char Curl_raw_toupper(char in) { - return touppermap[(unsigned char) in]; + return (char)touppermap[(unsigned char) in]; } @@ -79,7 +79,7 @@ char Curl_raw_toupper(char in) altered by the current locale. */ char Curl_raw_tolower(char in) { - return tolowermap[(unsigned char) in]; + return (char)tolowermap[(unsigned char) in]; } /* @@ -93,12 +93,12 @@ static int casecompare(const char *first, const char *second) { while(*first && *second) { if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) - /* get out of the loop as soon as they don't match */ + /* get out of the loop as soon as they do not match */ return 0; first++; second++; } - /* If we're here either the strings are the same or the length is different. + /* If we are here either the strings are the same or the length is different. We can just test if the "current" character is non-zero for one and zero for the other. Note that the characters may not be exactly the same even if they match, we only want to compare zero-ness. */ @@ -141,8 +141,8 @@ int curl_strnequal(const char *first, const char *second, size_t max) /* if both pointers are NULL then treat them as equal if max is non-zero */ return (NULL == first && NULL == second && max); } -/* Copy an upper case version of the string from src to dest. The - * strings may overlap. No more than n characters of the string are copied +/* Copy an upper case version of the string from src to dest. The + * strings may overlap. No more than n characters of the string are copied * (including any NUL) and the destination string will NOT be * NUL-terminated if that limit is reached. */ @@ -156,8 +156,8 @@ void Curl_strntoupper(char *dest, const char *src, size_t n) } while(*src++ && --n); } -/* Copy a lower case version of the string from src to dest. The - * strings may overlap. No more than n characters of the string are copied +/* Copy a lower case version of the string from src to dest. The + * strings may overlap. No more than n characters of the string are copied * (including any NUL) and the destination string will NOT be * NUL-terminated if that limit is reached. */ diff --git a/deps/curl/lib/strerror.c b/deps/curl/lib/strerror.c index a900e78d..7d326e16 100644 --- a/deps/curl/lib/strerror.c +++ b/deps/curl/lib/strerror.c @@ -74,13 +74,13 @@ curl_easy_strerror(CURLcode error) " this libcurl due to a build-time decision."; case CURLE_COULDNT_RESOLVE_PROXY: - return "Couldn't resolve proxy name"; + return "Could not resolve proxy name"; case CURLE_COULDNT_RESOLVE_HOST: - return "Couldn't resolve host name"; + return "Could not resolve hostname"; case CURLE_COULDNT_CONNECT: - return "Couldn't connect to server"; + return "Could not connect to server"; case CURLE_WEIRD_SERVER_REPLY: return "Weird server reply"; @@ -107,19 +107,19 @@ curl_easy_strerror(CURLcode error) return "FTP: unknown 227 response format"; case CURLE_FTP_CANT_GET_HOST: - return "FTP: can't figure out the host in the PASV response"; + return "FTP: cannot figure out the host in the PASV response"; case CURLE_HTTP2: return "Error in the HTTP2 framing layer"; case CURLE_FTP_COULDNT_SET_TYPE: - return "FTP: couldn't set file type"; + return "FTP: could not set file type"; case CURLE_PARTIAL_FILE: return "Transferred a partial file"; case CURLE_FTP_COULDNT_RETR_FILE: - return "FTP: couldn't retrieve (RETR failed) the specified file"; + return "FTP: could not retrieve (RETR failed) the specified file"; case CURLE_QUOTE_ERROR: return "Quote command returned error"; @@ -158,10 +158,10 @@ curl_easy_strerror(CURLcode error) return "SSL connect error"; case CURLE_BAD_DOWNLOAD_RESUME: - return "Couldn't resume download"; + return "Could not resume download"; case CURLE_FILE_COULDNT_READ_FILE: - return "Couldn't read a file:// file"; + return "Could not read a file:// file"; case CURLE_LDAP_CANNOT_BIND: return "LDAP: cannot bind"; @@ -212,7 +212,7 @@ curl_easy_strerror(CURLcode error) return "Problem with the local SSL certificate"; case CURLE_SSL_CIPHER: - return "Couldn't use specified SSL cipher"; + return "Could not use specified SSL cipher"; case CURLE_PEER_FAILED_VERIFICATION: return "SSL peer certificate or SSH remote key was not OK"; @@ -322,6 +322,9 @@ curl_easy_strerror(CURLcode error) case CURLE_TOO_LARGE: return "A value or data field grew larger than allowed"; + case CURLE_ECH_REQUIRED: + return "ECH attempted but failed"; + /* error codes not used by current libcurl */ case CURLE_OBSOLETE20: case CURLE_OBSOLETE24: @@ -342,16 +345,15 @@ curl_easy_strerror(CURLcode error) /* * By using a switch, gcc -Wall will complain about enum values * which do not appear, helping keep this function up-to-date. - * By using gcc -Wall -Werror, you can't forget. + * By using gcc -Wall -Werror, you cannot forget. * - * A table would not have the same benefit. Most compilers will - * generate code very similar to a table in any case, so there - * is little performance gain from a table. And something is broken - * for the user's application, anyways, so does it matter how fast - * it _doesn't_ work? + * A table would not have the same benefit. Most compilers will generate + * code similar to a table in any case, so there is little performance gain + * from a table. Something is broken for the user's application, anyways, so + * does it matter how fast it _does not_ work? * - * The line number for the error will be near this comment, which - * is why it is here, and not at the start of the switch. + * The line number for the error will be near this comment, which is why it + * is here, and not at the start of the switch. */ return "Unknown error"; #else @@ -792,7 +794,7 @@ get_winapi_error(int err, char *buf, size_t buflen) expect the local codepage (eg fprintf, failf, infof). FormatMessageW -> wcstombs is used for Windows CE compatibility. */ if(FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err, + FORMAT_MESSAGE_IGNORE_INSERTS), NULL, (DWORD)err, LANG_NEUTRAL, wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL)) { size_t written = wcstombs(buf, wbuf, buflen - 1); if(written != (size_t)-1) @@ -820,9 +822,9 @@ get_winapi_error(int err, char *buf, size_t buflen) * The 'err' argument passed in to this function MUST be a true errno number * as reported on this system. We do no range checking on the number before * we pass it to the "number-to-message" conversion function and there might - * be systems that don't do proper range checking in there themselves. + * be systems that do not do proper range checking in there themselves. * - * We don't do range checking (on systems other than Windows) since there is + * We do not do range checking (on systems other than Windows) since there is * no good reliable and portable way to do it. * * On Windows different types of error codes overlap. This function has an @@ -862,7 +864,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) #ifdef USE_WINSOCK !get_winsock_error(err, buf, buflen) && #endif - !get_winapi_error((DWORD)err, buf, buflen)) + !get_winapi_error(err, buf, buflen)) msnprintf(buf, buflen, "Unknown error %d (%#x)", err, err); } #else /* not Windows coming up */ @@ -941,7 +943,7 @@ const char *Curl_winapi_strerror(DWORD err, char *buf, size_t buflen) *buf = '\0'; #ifndef CURL_DISABLE_VERBOSE_STRINGS - if(!get_winapi_error(err, buf, buflen)) { + if(!get_winapi_error((int)err, buf, buflen)) { msnprintf(buf, buflen, "Unknown error %lu (0x%08lX)", err, err); } #else diff --git a/deps/curl/lib/strtok.c b/deps/curl/lib/strtok.c index d8e1e818..d2cc71c4 100644 --- a/deps/curl/lib/strtok.c +++ b/deps/curl/lib/strtok.c @@ -65,4 +65,4 @@ Curl_strtok_r(char *ptr, const char *sep, char **end) return NULL; } -#endif /* this was only compiled if strtok_r wasn't present */ +#endif /* this was only compiled if strtok_r was not present */ diff --git a/deps/curl/lib/strtoofft.c b/deps/curl/lib/strtoofft.c index 580fd23b..f1c7ba27 100644 --- a/deps/curl/lib/strtoofft.c +++ b/deps/curl/lib/strtoofft.c @@ -31,7 +31,7 @@ * NOTE: * * In the ISO C standard (IEEE Std 1003.1), there is a strtoimax() function we - * could use in case strtoll() doesn't exist... See + * could use in case strtoll() does not exist... See * https://www.opengroup.org/onlinepubs/009695399/functions/strtoimax.html */ @@ -73,7 +73,7 @@ static const char valchars[] = static int get_char(char c, int base); /** - * Custom version of the strtooff function. This extracts a curl_off_t + * Custom version of the strtooff function. This extracts a curl_off_t * value from the given input string and returns it. */ static curl_off_t strtooff(const char *nptr, char **endptr, int base) @@ -120,8 +120,8 @@ static curl_off_t strtooff(const char *nptr, char **endptr, int base) } } - /* Matching strtol, if the base is 0 and it doesn't look like - * the number is octal or hex, we assume it's base 10. + /* Matching strtol, if the base is 0 and it does not look like + * the number is octal or hex, we assume it is base 10. */ if(base == 0) { base = 10; @@ -168,7 +168,7 @@ static curl_off_t strtooff(const char *nptr, char **endptr, int base) * @param c the character to interpret according to base * @param base the base in which to interpret c * - * @return the value of c in base, or -1 if c isn't in range + * @return the value of c in base, or -1 if c is not in range */ static int get_char(char c, int base) { @@ -204,10 +204,10 @@ static int get_char(char c, int base) return value; } -#endif /* Only present if we need strtoll, but don't have it. */ +#endif /* Only present if we need strtoll, but do not have it. */ /* - * Parse a *positive* up to 64 bit number written in ascii. + * Parse a *positive* up to 64-bit number written in ASCII. */ CURLofft curlx_strtoofft(const char *str, char **endp, int base, curl_off_t *num) @@ -222,7 +222,7 @@ CURLofft curlx_strtoofft(const char *str, char **endp, int base, str++; if(('-' == *str) || (ISSPACE(*str))) { if(endp) - *endp = (char *)str; /* didn't actually move */ + *endp = (char *)str; /* did not actually move */ return CURL_OFFT_INVAL; /* nothing parsed */ } number = strtooff(str, &end, base); diff --git a/deps/curl/lib/strtoofft.h b/deps/curl/lib/strtoofft.h index 34d293ba..71808b71 100644 --- a/deps/curl/lib/strtoofft.h +++ b/deps/curl/lib/strtoofft.h @@ -30,7 +30,7 @@ * Determine which string to integral data type conversion function we use * to implement string conversion to our curl_off_t integral data type. * - * Notice that curl_off_t might be 64 or 32 bit wide, and that it might use + * Notice that curl_off_t might be 64 or 32 bits wide, and that it might use * an underlying data type which might be 'long', 'int64_t', 'long long' or * '__int64' and more remotely other data types. * diff --git a/deps/curl/lib/system_win32.c b/deps/curl/lib/system_win32.c index d2862de9..5ab71187 100644 --- a/deps/curl/lib/system_win32.c +++ b/deps/curl/lib/system_win32.c @@ -38,25 +38,18 @@ LARGE_INTEGER Curl_freq; bool Curl_isVistaOrGreater; -bool Curl_isWindows8OrGreater; /* Handle of iphlpapp.dll */ static HMODULE s_hIpHlpApiDll = NULL; -/* Function pointers */ +/* Pointer to the if_nametoindex function */ IF_NAMETOINDEX_FN Curl_if_nametoindex = NULL; -FREEADDRINFOEXW_FN Curl_FreeAddrInfoExW = NULL; -GETADDRINFOEXCANCEL_FN Curl_GetAddrInfoExCancel = NULL; -GETADDRINFOEXW_FN Curl_GetAddrInfoExW = NULL; -/* Curl_win32_init() performs win32 global initialization */ +/* Curl_win32_init() performs Win32 global initialization */ CURLcode Curl_win32_init(long flags) { -#ifdef USE_WINSOCK - HMODULE ws2_32Dll; -#endif /* CURL_GLOBAL_WIN32 controls the *optional* part of the initialization which - is just for Winsock at the moment. Any required win32 initialization + is just for Winsock at the moment. Any required Win32 initialization should take place after this block. */ if(flags & CURL_GLOBAL_WIN32) { #ifdef USE_WINSOCK @@ -68,7 +61,7 @@ CURLcode Curl_win32_init(long flags) res = WSAStartup(wVersionRequested, &wsaData); if(res) - /* Tell the user that we couldn't find a usable */ + /* Tell the user that we could not find a usable */ /* winsock.dll. */ return CURLE_FAILED_INIT; @@ -80,7 +73,7 @@ CURLcode Curl_win32_init(long flags) if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) || HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) { - /* Tell the user that we couldn't find a usable */ + /* Tell the user that we could not find a usable */ /* winsock.dll. */ WSACleanup(); @@ -111,18 +104,6 @@ CURLcode Curl_win32_init(long flags) Curl_if_nametoindex = pIfNameToIndex; } -#ifdef USE_WINSOCK - ws2_32Dll = GetModuleHandleA("ws2_32"); - if(ws2_32Dll) { - Curl_FreeAddrInfoExW = CURLX_FUNCTION_CAST(FREEADDRINFOEXW_FN, - GetProcAddress(ws2_32Dll, "FreeAddrInfoExW")); - Curl_GetAddrInfoExCancel = CURLX_FUNCTION_CAST(GETADDRINFOEXCANCEL_FN, - GetProcAddress(ws2_32Dll, "GetAddrInfoExCancel")); - Curl_GetAddrInfoExW = CURLX_FUNCTION_CAST(GETADDRINFOEXW_FN, - GetProcAddress(ws2_32Dll, "GetAddrInfoExW")); - } -#endif - /* curlx_verify_windows_version must be called during init at least once because it has its own initialization routine. */ if(curlx_verify_windows_version(6, 0, 0, PLATFORM_WINNT, @@ -132,13 +113,6 @@ CURLcode Curl_win32_init(long flags) else Curl_isVistaOrGreater = FALSE; - if(curlx_verify_windows_version(6, 2, 0, PLATFORM_WINNT, - VERSION_GREATER_THAN_EQUAL)) { - Curl_isWindows8OrGreater = TRUE; - } - else - Curl_isWindows8OrGreater = FALSE; - QueryPerformanceFrequency(&Curl_freq); return CURLE_OK; } @@ -146,9 +120,6 @@ CURLcode Curl_win32_init(long flags) /* Curl_win32_cleanup() is the opposite of Curl_win32_init() */ void Curl_win32_cleanup(long init_flags) { - Curl_FreeAddrInfoExW = NULL; - Curl_GetAddrInfoExCancel = NULL; - Curl_GetAddrInfoExW = NULL; if(s_hIpHlpApiDll) { FreeLibrary(s_hIpHlpApiDll); s_hIpHlpApiDll = NULL; @@ -204,11 +175,11 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD); */ HMODULE Curl_load_library(LPCTSTR filename) { -#ifndef CURL_WINDOWS_APP +#ifndef CURL_WINDOWS_UWP HMODULE hModule = NULL; LOADLIBRARYEX_FN pLoadLibraryEx = NULL; - /* Get a handle to kernel32 so we can access it's functions at runtime */ + /* Get a handle to kernel32 so we can access its functions at runtime */ HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32")); if(!hKernel32) return NULL; @@ -219,7 +190,7 @@ HMODULE Curl_load_library(LPCTSTR filename) CURLX_FUNCTION_CAST(LOADLIBRARYEX_FN, (GetProcAddress(hKernel32, LOADLIBARYEX))); - /* Detect if there's already a path in the filename and load the library if + /* Detect if there is already a path in the filename and load the library if there is. Note: Both back slashes and forward slashes have been supported since the earlier days of DOS at an API level although they are not supported by command prompt */ @@ -261,7 +232,7 @@ HMODULE Curl_load_library(LPCTSTR filename) } return hModule; #else - /* the Universal Windows Platform (UWP) can't do this */ + /* the Universal Windows Platform (UWP) cannot do this */ (void)filename; return NULL; #endif diff --git a/deps/curl/lib/system_win32.h b/deps/curl/lib/system_win32.h index bd490cab..024d959f 100644 --- a/deps/curl/lib/system_win32.h +++ b/deps/curl/lib/system_win32.h @@ -26,11 +26,12 @@ #include "curl_setup.h" -#ifdef _WIN32 +#if defined(_WIN32) + +#include extern LARGE_INTEGER Curl_freq; extern bool Curl_isVistaOrGreater; -extern bool Curl_isWindows8OrGreater; CURLcode Curl_win32_init(long flags); void Curl_win32_cleanup(long init_flags); @@ -41,33 +42,6 @@ typedef unsigned int(WINAPI *IF_NAMETOINDEX_FN)(const char *); /* This is used instead of if_nametoindex if available on Windows */ extern IF_NAMETOINDEX_FN Curl_if_nametoindex; -/* Identical copy of addrinfoexW/ADDRINFOEXW */ -typedef struct addrinfoexW_ -{ - int ai_flags; - int ai_family; - int ai_socktype; - int ai_protocol; - size_t ai_addrlen; - PWSTR ai_canonname; - struct sockaddr *ai_addr; - void *ai_blob; - size_t ai_bloblen; - LPGUID ai_provider; - struct addrinfoexW_ *ai_next; -} ADDRINFOEXW_; - -typedef void (CALLBACK *LOOKUP_COMPLETION_FN)(DWORD, DWORD, LPWSAOVERLAPPED); -typedef void (WSAAPI *FREEADDRINFOEXW_FN)(ADDRINFOEXW_*); -typedef int (WSAAPI *GETADDRINFOEXCANCEL_FN)(LPHANDLE); -typedef int (WSAAPI *GETADDRINFOEXW_FN)(PCWSTR, PCWSTR, DWORD, LPGUID, - const ADDRINFOEXW_*, ADDRINFOEXW_**, struct timeval*, LPOVERLAPPED, - LOOKUP_COMPLETION_FN, LPHANDLE); - -extern FREEADDRINFOEXW_FN Curl_FreeAddrInfoExW; -extern GETADDRINFOEXCANCEL_FN Curl_GetAddrInfoExCancel; -extern GETADDRINFOEXW_FN Curl_GetAddrInfoExW; - /* This is used to dynamically load DLLs */ HMODULE Curl_load_library(LPCTSTR filename); #else /* _WIN32 */ diff --git a/deps/curl/lib/telnet.c b/deps/curl/lib/telnet.c index 56ee0855..64d552d1 100644 --- a/deps/curl/lib/telnet.c +++ b/deps/curl/lib/telnet.c @@ -154,8 +154,8 @@ struct TELNET { int himq[256]; int him_preferred[256]; int subnegotiation[256]; - char subopt_ttype[32]; /* Set with suboption TTYPE */ - char subopt_xdisploc[128]; /* Set with suboption XDISPLOC */ + char *subopt_ttype; /* Set with suboption TTYPE */ + char *subopt_xdisploc; /* Set with suboption XDISPLOC */ unsigned short subopt_wsx; /* Set with suboption NAWS */ unsigned short subopt_wsy; /* Set with suboption NAWS */ TelnetReceive telrcv_state; @@ -173,7 +173,7 @@ struct TELNET { */ const struct Curl_handler Curl_handler_telnet = { - "TELNET", /* scheme */ + "telnet", /* scheme */ ZERO_NULL, /* setup_connection */ telnet_do, /* do_it */ telnet_done, /* done */ @@ -187,6 +187,7 @@ const struct Curl_handler Curl_handler_telnet = { ZERO_NULL, /* perform_getsock */ ZERO_NULL, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_TELNET, /* defport */ @@ -670,7 +671,7 @@ static void printsub(struct Curl_easy *data, if(data->set.verbose) { unsigned int i = 0; if(direction) { - infof(data, "%s IAC SB ", (direction == '<')? "RCVD":"SENT"); + infof(data, "%s IAC SB ", (direction == '<') ? "RCVD" : "SENT"); if(length >= 3) { int j; @@ -720,8 +721,8 @@ static void printsub(struct Curl_easy *data, switch(pointer[0]) { case CURL_TELOPT_NAWS: if(length > 4) - infof(data, "Width: %d ; Height: %d", (pointer[1]<<8) | pointer[2], - (pointer[3]<<8) | pointer[4]); + infof(data, "Width: %d ; Height: %d", (pointer[1] << 8) | pointer[2], + (pointer[3] << 8) | pointer[4]); break; default: switch(pointer[1]) { @@ -797,12 +798,12 @@ static CURLcode check_telnet_options(struct Curl_easy *data) struct TELNET *tn = data->req.p.telnet; CURLcode result = CURLE_OK; - /* Add the user name as an environment variable if it + /* Add the username as an environment variable if it was given on the command line */ if(data->state.aptr.user) { char buffer[256]; if(str_is_nonascii(data->conn->user)) { - DEBUGF(infof(data, "set a non ASCII user name in telnet")); + DEBUGF(infof(data, "set a non ASCII username in telnet")); return CURLE_BAD_FUNCTION_ARGUMENT; } msnprintf(buffer, sizeof(buffer), "USER,%s", data->conn->user); @@ -830,12 +831,9 @@ static CURLcode check_telnet_options(struct Curl_easy *data) case 5: /* Terminal type */ if(strncasecompare(option, "TTYPE", 5)) { - size_t l = strlen(arg); - if(l < sizeof(tn->subopt_ttype)) { - strcpy(tn->subopt_ttype, arg); - tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES; - break; - } + tn->subopt_ttype = arg; + tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES; + break; } result = CURLE_UNKNOWN_OPTION; break; @@ -843,12 +841,9 @@ static CURLcode check_telnet_options(struct Curl_easy *data) case 8: /* Display variable */ if(strncasecompare(option, "XDISPLOC", 8)) { - size_t l = strlen(arg); - if(l < sizeof(tn->subopt_xdisploc)) { - strcpy(tn->subopt_xdisploc, arg); - tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES; - break; - } + tn->subopt_xdisploc = arg; + tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES; + break; } result = CURLE_UNKNOWN_OPTION; break; @@ -1190,12 +1185,12 @@ process_iac: 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 + * 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 + * 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 + * 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); @@ -1275,7 +1270,7 @@ static CURLcode send_telnet_data(struct Curl_easy *data, default: /* write! */ bytes_written = 0; result = Curl_xfer_send(data, outbuf + total_written, - outlen - total_written, &bytes_written); + outlen - total_written, FALSE, &bytes_written); total_written += bytes_written; break; } @@ -1341,7 +1336,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) #ifdef USE_WINSOCK /* We want to wait for both stdin and the socket. Since - ** the select() function in winsock only works on sockets + ** the select() function in Winsock only works on sockets ** we have to use the WaitForMultipleObjects() call. */ @@ -1352,7 +1347,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) return CURLE_FAILED_INIT; } - /* Tell winsock what events we want to listen to */ + /* Tell Winsock what events we want to listen to */ if(WSAEventSelect(sockfd, event_handle, FD_READ|FD_CLOSE) == SOCKET_ERROR) { WSACloseEvent(event_handle); return CURLE_OK; @@ -1369,7 +1364,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) else use the old WaitForMultipleObjects() way */ if(GetFileType(stdin_handle) == FILE_TYPE_PIPE || data->set.is_fread_set) { - /* Don't wait for stdin_handle, just wait for event_handle */ + /* Do not wait for stdin_handle, just wait for event_handle */ obj_count = 1; /* Check stdin_handle per 100 milliseconds */ wait_timeout = 100; @@ -1469,7 +1464,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) if(events.lNetworkEvents & FD_READ) { /* read data from network */ result = Curl_xfer_recv(data, buffer, sizeof(buffer), &nread); - /* read would've blocked. Loop again */ + /* read would have blocked. Loop again */ if(result == CURLE_AGAIN) break; /* returned not-zero, this an error */ @@ -1491,7 +1486,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } /* Negotiate if the peer has started negotiating, - otherwise don't. We don't want to speak telnet with + otherwise do not. We do not want to speak telnet with non-telnet servers, like POP or SMTP. */ if(tn->please_negotiate && !tn->already_negotiated) { negotiate(data); @@ -1534,11 +1529,16 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) pfd[1].events = POLLIN; poll_cnt = 2; interval_ms = 1 * 1000; + if(pfd[1].fd < 0) { + failf(data, "cannot read input"); + result = CURLE_RECV_ERROR; + keepon = FALSE; + } } while(keepon) { DEBUGF(infof(data, "telnet_do, poll %d fds", poll_cnt)); - switch(Curl_poll(pfd, poll_cnt, interval_ms)) { + switch(Curl_poll(pfd, (unsigned int)poll_cnt, interval_ms)) { case -1: /* error, stop reading */ keepon = FALSE; continue; @@ -1550,7 +1550,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) if(pfd[0].revents & POLLIN) { /* read data from network */ result = Curl_xfer_recv(data, buffer, sizeof(buffer), &nread); - /* read would've blocked. Loop again */ + /* read would have blocked. Loop again */ if(result == CURLE_AGAIN) break; /* returned not-zero, this an error */ @@ -1582,7 +1582,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } /* Negotiate if the peer has started negotiating, - otherwise don't. We don't want to speak telnet with + otherwise do not. We do not want to speak telnet with non-telnet servers, like POP or SMTP. */ if(tn->please_negotiate && !tn->already_negotiated) { negotiate(data); @@ -1639,7 +1639,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) } #endif /* mark this as "no further transfer wanted" */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); return result; } diff --git a/deps/curl/lib/tftp.c b/deps/curl/lib/tftp.c index ff2b7b74..e92e5127 100644 --- a/deps/curl/lib/tftp.c +++ b/deps/curl/lib/tftp.c @@ -168,7 +168,7 @@ static CURLcode tftp_translate_code(tftp_error_t error); */ const struct Curl_handler Curl_handler_tftp = { - "TFTP", /* scheme */ + "tftp", /* scheme */ tftp_setup_connection, /* setup_connection */ tftp_do, /* do_it */ tftp_done, /* done */ @@ -182,6 +182,7 @@ const struct Curl_handler Curl_handler_tftp = { ZERO_NULL, /* perform_getsock */ tftp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_TFTP, /* defport */ @@ -204,7 +205,7 @@ static CURLcode tftp_set_timeouts(struct tftp_state_data *state) { time_t maxtime, timeout; timediff_t timeout_ms; - bool start = (state->state == TFTP_STATE_START) ? TRUE : FALSE; + bool start = (state->state == TFTP_STATE_START); /* Compute drop-dead time */ timeout_ms = Curl_timeleft(state->data, NULL, start); @@ -227,24 +228,23 @@ static CURLcode tftp_set_timeouts(struct tftp_state_data *state) state->retry_max = (int)timeout/5; /* But bound the total number */ - if(state->retry_max<3) + if(state->retry_max < 3) state->retry_max = 3; - if(state->retry_max>50) + if(state->retry_max > 50) state->retry_max = 50; /* Compute the re-ACK interval to suit the timeout */ state->retry_time = (int)(timeout/state->retry_max); - if(state->retry_time<1) + if(state->retry_time < 1) state->retry_time = 1; infof(state->data, - "set timeouts for state %d; Total % " CURL_FORMAT_CURL_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 */ - time(&state->rx_time); + state->rx_time = time(NULL); return CURLE_OK; } @@ -314,7 +314,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_state_data *state, const char *tmp = ptr; struct Curl_easy *data = state->data; - /* if OACK doesn't contain blksize option, the default (512) must be used */ + /* if OACK does not contain blksize option, the default (512) must be used */ state->blksize = TFTP_BLKSIZE_DEFAULT; while(tmp < ptr + len) { @@ -348,7 +348,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_state_data *state, return CURLE_TFTP_ILLEGAL; } else if(blksize > state->requested_blksize) { - /* could realloc pkt buffers here, but the spec doesn't call out + /* could realloc pkt buffers here, but the spec does not call out * support for the server requesting a bigger blksize than the client * requests */ failf(data, "%s (%ld)", @@ -433,7 +433,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, struct Curl_easy *data = state->data; CURLcode result = CURLE_OK; - /* Set ascii mode if -B flag was used */ + /* Set ASCII mode if -B flag was used */ if(data->state.prefer_ascii) mode = "netascii"; @@ -443,7 +443,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, case TFTP_EVENT_TIMEOUT: /* Resend the first packet out */ /* Increment the retry counter, quit if over the limit */ state->retries++; - if(state->retries>state->retry_max) { + if(state->retries > state->retry_max) { state->error = TFTP_ERR_NORESPONSE; state->state = TFTP_STATE_FIN; return result; @@ -460,7 +460,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, setpacketevent(&state->spacket, TFTP_EVENT_RRQ); } /* As RFC3617 describes the separator slash is not actually part of the - file name so we skip the always-present first letter of the path + filename so we skip the always-present first letter of the path string. */ result = Curl_urldecode(&state->data->state.up.path[1], 0, &filename, NULL, REJECT_ZERO); @@ -468,9 +468,9 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, return result; if(strlen(filename) > (state->blksize - strlen(mode) - 4)) { - failf(data, "TFTP file name too long"); + failf(data, "TFTP filename too long"); free(filename); - return CURLE_TFTP_ILLEGAL; /* too long file name field */ + return CURLE_TFTP_ILLEGAL; /* too long filename field */ } msnprintf((char *)state->spacket.data + 2, @@ -482,11 +482,9 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, if(!data->set.tftp_no_options) { char buf[64]; /* add tsize option */ - if(data->state.upload && (data->state.infilesize != -1)) - msnprintf(buf, sizeof(buf), "%" CURL_FORMAT_CURL_OFF_T, - data->state.infilesize); - else - strcpy(buf, "0"); /* the destination is large enough */ + msnprintf(buf, sizeof(buf), "%" FMT_OFF_T, + data->state.upload && (data->state.infilesize != -1) ? + data->state.infilesize : 0); result = tftp_option_add(state, &sbytes, (char *)state->spacket.data + sbytes, @@ -526,8 +524,8 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, not have a size_t argument, like older unixes that want an 'int' */ senddata = sendto(state->sockfd, (void *)state->spacket.data, (SEND_TYPE_ARG3)sbytes, 0, - &data->conn->remote_addr->sa_addr, - data->conn->remote_addr->addrlen); + &data->conn->remote_addr->curl_sa_addr, + (curl_socklen_t)data->conn->remote_addr->addrlen); if(senddata != (ssize_t)sbytes) { char buffer[STRERROR_LEN]; failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); @@ -589,7 +587,7 @@ static CURLcode tftp_rx(struct tftp_state_data *state, /* Is this the block we expect? */ rblock = getrpacketblock(&state->rpacket); if(NEXT_BLOCKNUM(state->block) == rblock) { - /* This is the expected block. Reset counters and ACK it. */ + /* This is the expected block. Reset counters and ACK it. */ state->retries = 0; } else if(state->block == rblock) { @@ -625,7 +623,7 @@ static CURLcode tftp_rx(struct tftp_state_data *state, else { state->state = TFTP_STATE_RX; } - time(&state->rx_time); + state->rx_time = time(NULL); break; case TFTP_EVENT_OACK: @@ -643,16 +641,16 @@ static CURLcode tftp_rx(struct tftp_state_data *state, return CURLE_SEND_ERROR; } - /* we're ready to RX data */ + /* we are ready to RX data */ state->state = TFTP_STATE_RX; - time(&state->rx_time); + state->rx_time = time(NULL); break; case TFTP_EVENT_TIMEOUT: /* Increment the retry count and fail if over the limit */ state->retries++; infof(data, - "Timeout waiting for block %d ACK. Retries = %d", + "Timeout waiting for block %d ACK. Retries = %d", NEXT_BLOCKNUM(state->block), state->retries); if(state->retries > state->retry_max) { state->error = TFTP_ERR_TIMEOUT; @@ -664,7 +662,7 @@ static CURLcode tftp_rx(struct tftp_state_data *state, 4, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); - if(sbytes<0) { + if(sbytes < 0) { failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); return CURLE_SEND_ERROR; } @@ -678,8 +676,8 @@ static CURLcode tftp_rx(struct tftp_state_data *state, 4, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); - /* don't bother with the return code, but if the socket is still up we - * should be a good TFTP client and let the server know we're done */ + /* do not bother with the return code, but if the socket is still up we + * should be a good TFTP client and let the server know we are done */ state->state = TFTP_STATE_FIN; break; @@ -718,18 +716,18 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) int rblock = getrpacketblock(&state->rpacket); if(rblock != state->block && - /* There's a bug in tftpd-hpa that causes it to send us an ack for - * 65535 when the block number wraps to 0. So when we're expecting + /* There is a bug in tftpd-hpa that causes it to send us an ack for + * 65535 when the block number wraps to 0. So when we are expecting * 0, also accept 65535. See * https://www.syslinux.org/archives/2010-September/015612.html * */ !(state->block == 0 && rblock == 65535)) { - /* This isn't the expected block. Log it and up the retry counter */ + /* This is not the expected block. Log it and up the retry counter */ infof(data, "Received ACK for block %d, expecting %d", rblock, state->block); state->retries++; /* Bail out if over the maximum */ - if(state->retries>state->retry_max) { + if(state->retries > state->retry_max) { failf(data, "tftp_tx: giving up waiting for block %d ack", state->block); result = CURLE_SEND_ERROR; @@ -737,11 +735,11 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) else { /* Re-send the data packet */ sbytes = sendto(state->sockfd, (void *)state->spacket.data, - 4 + state->sbytes, SEND_4TH_ARG, + 4 + (SEND_TYPE_ARG3)state->sbytes, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); /* Check all sbytes were sent */ - if(sbytes<0) { + if(sbytes < 0) { failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); result = CURLE_SEND_ERROR; @@ -750,9 +748,9 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) return result; } - /* This is the expected packet. Reset the counters and send the next + /* This is the expected packet. Reset the counters and send the next block */ - time(&state->rx_time); + state->rx_time = time(NULL); state->block++; } else @@ -782,11 +780,11 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) } while(state->sbytes < state->blksize && cb); sbytes = sendto(state->sockfd, (void *) state->spacket.data, - 4 + state->sbytes, SEND_4TH_ARG, + 4 + (SEND_TYPE_ARG3)state->sbytes, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); /* Check all sbytes were sent */ - if(sbytes<0) { + if(sbytes < 0) { failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); return CURLE_SEND_ERROR; } @@ -800,7 +798,7 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) state->retries++; infof(data, "Timeout waiting for block %d ACK. " " Retries = %d", NEXT_BLOCKNUM(state->block), state->retries); - /* Decide if we've had enough */ + /* Decide if we have had enough */ if(state->retries > state->retry_max) { state->error = TFTP_ERR_TIMEOUT; state->state = TFTP_STATE_FIN; @@ -808,11 +806,11 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) else { /* Re-send the data packet */ sbytes = sendto(state->sockfd, (void *)state->spacket.data, - 4 + state->sbytes, SEND_4TH_ARG, + 4 + (SEND_TYPE_ARG3)state->sbytes, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); /* Check all sbytes were sent */ - if(sbytes<0) { + if(sbytes < 0) { failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); return CURLE_SEND_ERROR; } @@ -828,8 +826,8 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event) (void)sendto(state->sockfd, (void *)state->spacket.data, 4, SEND_4TH_ARG, (struct sockaddr *)&state->remote_addr, state->remote_addrlen); - /* don't bother with the return code, but if the socket is still up we - * should be a good TFTP client and let the server know we're done */ + /* do not bother with the return code, but if the socket is still up we + * should be a good TFTP client and let the server know we are done */ state->state = TFTP_STATE_FIN; break; @@ -1000,7 +998,7 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done) return CURLE_OUT_OF_MEMORY; } - /* we don't keep TFTP connections up basically because there's none or very + /* we do not keep TFTP connections up basically because there is none or * little gain for UDP */ connclose(conn, "TFTP"); @@ -1031,7 +1029,7 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done) * IPv4 and IPv6... */ int rc = bind(state->sockfd, (struct sockaddr *)&state->local_addr, - conn->remote_addr->addrlen); + (curl_socklen_t)conn->remote_addr->addrlen); if(rc) { char buffer[STRERROR_LEN]; failf(data, "bind() failed; %s", @@ -1099,24 +1097,20 @@ static int tftp_getsock(struct Curl_easy *data, **********************************************************/ static CURLcode tftp_receive_packet(struct Curl_easy *data) { - struct Curl_sockaddr_storage fromaddr; curl_socklen_t fromlen; CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; struct tftp_state_data *state = conn->proto.tftpc; /* Receive the packet */ - fromlen = sizeof(fromaddr); + fromlen = sizeof(state->remote_addr); state->rbytes = (int)recvfrom(state->sockfd, (void *)state->rpacket.data, - state->blksize + 4, + (RECV_TYPE_ARG3)state->blksize + 4, 0, - (struct sockaddr *)&fromaddr, + (struct sockaddr *)&state->remote_addr, &fromlen); - if(state->remote_addrlen == 0) { - memcpy(&state->remote_addr, &fromaddr, fromlen); - state->remote_addrlen = fromlen; - } + state->remote_addrlen = fromlen; /* Sanity check packet length */ if(state->rbytes < 4) { @@ -1131,7 +1125,7 @@ static CURLcode tftp_receive_packet(struct Curl_easy *data) switch(state->event) { case TFTP_EVENT_DATA: - /* Don't pass to the client empty or retransmitted packets */ + /* Do not pass to the client empty or retransmitted packets */ if(state->rbytes > 4 && (NEXT_BLOCKNUM(state->block) == getrpacketblock(&state->rpacket))) { result = Curl_client_write(data, CLIENTWRITE_BODY, @@ -1203,11 +1197,11 @@ static timediff_t tftp_state_timeout(struct Curl_easy *data, state->state = TFTP_STATE_FIN; return 0; } - time(¤t); + current = time(NULL); if(current > state->rx_time + state->retry_time) { if(event) *event = TFTP_EVENT_TIMEOUT; - time(&state->rx_time); /* update even though we received nothing */ + state->rx_time = time(NULL); /* update even though we received nothing */ } return timeout_ms; @@ -1238,10 +1232,10 @@ static CURLcode tftp_multi_statemach(struct Curl_easy *data, bool *done) result = tftp_state_machine(state, event); if(result) return result; - *done = (state->state == TFTP_STATE_FIN) ? TRUE : FALSE; + *done = (state->state == TFTP_STATE_FIN); if(*done) - /* Tell curl we're done */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + /* Tell curl we are done */ + Curl_xfer_setup_nop(data); } else { /* no timeouts to handle, check our socket */ @@ -1261,10 +1255,10 @@ static CURLcode tftp_multi_statemach(struct Curl_easy *data, bool *done) result = tftp_state_machine(state, state->event); if(result) return result; - *done = (state->state == TFTP_STATE_FIN) ? TRUE : FALSE; + *done = (state->state == TFTP_STATE_FIN); if(*done) - /* Tell curl we're done */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + /* Tell curl we are done */ + Curl_xfer_setup_nop(data); } /* if rc == 0, then select() timed out */ } @@ -1288,7 +1282,7 @@ static CURLcode tftp_doing(struct Curl_easy *data, bool *dophase_done) DEBUGF(infof(data, "DO phase is complete")); } else if(!result) { - /* The multi code doesn't have this logic for the DOING state so we + /* 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)) @@ -1375,7 +1369,7 @@ static CURLcode tftp_setup_connection(struct Curl_easy *data, conn->transport = TRNSPRT_UDP; /* TFTP URLs support an extension like ";mode=" that - * we'll try to get now! */ + * we will try to get now! */ type = strstr(data->state.up.path, ";mode="); if(!type) diff --git a/deps/curl/lib/timediff.h b/deps/curl/lib/timediff.h index fb318d4f..75f996c5 100644 --- a/deps/curl/lib/timediff.h +++ b/deps/curl/lib/timediff.h @@ -26,10 +26,10 @@ #include "curl_setup.h" -/* Use a larger type even for 32 bit time_t systems so that we can keep +/* Use a larger type even for 32-bit time_t systems so that we can keep microsecond accuracy in it */ typedef curl_off_t timediff_t; -#define CURL_FORMAT_TIMEDIFF_T CURL_FORMAT_CURL_OFF_T +#define FMT_TIMEDIFF_T FMT_OFF_T #define TIMEDIFF_T_MAX CURL_OFF_T_MAX #define TIMEDIFF_T_MIN CURL_OFF_T_MIN diff --git a/deps/curl/lib/timeval.c b/deps/curl/lib/timeval.c index 5a6727cb..bb29bfdf 100644 --- a/deps/curl/lib/timeval.c +++ b/deps/curl/lib/timeval.c @@ -51,8 +51,8 @@ struct curltime Curl_now(void) #pragma warning(pop) #endif - now.tv_sec = milliseconds / 1000; - now.tv_usec = (milliseconds % 1000) * 1000; + now.tv_sec = (time_t)(milliseconds / 1000); + now.tv_usec = (int)((milliseconds % 1000) * 1000); } return now; } @@ -77,7 +77,7 @@ struct curltime Curl_now(void) /* ** clock_gettime() may be defined by Apple's SDK as weak symbol thus - ** code compiles but fails during run-time if clock_gettime() is + ** code compiles but fails during runtime if clock_gettime() is ** called on unsupported OS version. */ #if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \ @@ -95,7 +95,7 @@ struct curltime Curl_now(void) #endif (0 == clock_gettime(CLOCK_MONOTONIC_RAW, &tsnow))) { cnow.tv_sec = tsnow.tv_sec; - cnow.tv_usec = (unsigned int)(tsnow.tv_nsec / 1000); + cnow.tv_usec = (int)(tsnow.tv_nsec / 1000); } else #endif @@ -107,18 +107,18 @@ struct curltime Curl_now(void) #endif (0 == clock_gettime(CLOCK_MONOTONIC, &tsnow))) { cnow.tv_sec = tsnow.tv_sec; - cnow.tv_usec = (unsigned int)(tsnow.tv_nsec / 1000); + cnow.tv_usec = (int)(tsnow.tv_nsec / 1000); } /* ** Even when the configure process has truly detected monotonic clock ** availability, it might happen that it is not actually available at - ** run-time. When this occurs simply fallback to other time source. + ** runtime. When this occurs simply fallback to other time source. */ #ifdef HAVE_GETTIMEOFDAY else { (void)gettimeofday(&now, NULL); cnow.tv_sec = now.tv_sec; - cnow.tv_usec = (unsigned int)now.tv_usec; + cnow.tv_usec = (int)now.tv_usec; } #else else { @@ -137,7 +137,7 @@ struct curltime Curl_now(void) struct curltime Curl_now(void) { /* - ** Monotonic timer on Mac OS is provided by mach_absolute_time(), which + ** Monotonic timer on macOS is provided by mach_absolute_time(), which ** returns time in Mach "absolute time units," which are platform-dependent. ** To convert to nanoseconds, one must use conversion factors specified by ** mach_timebase_info(). diff --git a/deps/curl/lib/transfer.c b/deps/curl/lib/transfer.c index 669beebd..d7d3d16f 100644 --- a/deps/curl/lib/transfer.c +++ b/deps/curl/lib/transfer.c @@ -53,7 +53,7 @@ #endif #ifndef HAVE_SOCKET -#error "We can't compile without socket() support!" +#error "We cannot compile without socket() support!" #endif #include "urldata.h" @@ -79,7 +79,6 @@ #include "http2.h" #include "mime.h" #include "strcase.h" -#include "urlapi-int.h" #include "hsts.h" #include "setopt.h" #include "headers.h" @@ -160,6 +159,42 @@ bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc) return TRUE; } +static CURLcode xfer_recv_shutdown(struct Curl_easy *data, bool *done) +{ + int sockindex; + + if(!data || !data->conn) + return CURLE_FAILED_INIT; + if(data->conn->sockfd == CURL_SOCKET_BAD) + return CURLE_FAILED_INIT; + sockindex = (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET]); + return Curl_conn_shutdown(data, sockindex, done); +} + +static bool xfer_recv_shutdown_started(struct Curl_easy *data) +{ + int sockindex; + + if(!data || !data->conn) + return CURLE_FAILED_INIT; + if(data->conn->sockfd == CURL_SOCKET_BAD) + return CURLE_FAILED_INIT; + sockindex = (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET]); + return Curl_shutdown_started(data, sockindex); +} + +CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done) +{ + int sockindex; + + if(!data || !data->conn) + return CURLE_FAILED_INIT; + if(data->conn->writesockfd == CURL_SOCKET_BAD) + return CURLE_FAILED_INIT; + sockindex = (data->conn->writesockfd == data->conn->sock[SECONDARYSOCKET]); + return Curl_conn_shutdown(data, sockindex, done); +} + /** * Receive raw response data for the transfer. * @param data the transfer @@ -169,10 +204,10 @@ bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc) * @param err error code in case of -1 return * @return number of bytes read or -1 for error */ -static ssize_t Curl_xfer_recv_resp(struct Curl_easy *data, - char *buf, size_t blen, - bool eos_reliable, - CURLcode *err) +static ssize_t xfer_recv_resp(struct Curl_easy *data, + char *buf, size_t blen, + bool eos_reliable, + CURLcode *err) { ssize_t nread; @@ -186,19 +221,36 @@ static ssize_t Curl_xfer_recv_resp(struct Curl_easy *data, else if(totalleft < (curl_off_t)blen) blen = (size_t)totalleft; } - - if(!blen) { - /* want nothing - continue as if read nothing. */ - DEBUGF(infof(data, "readwrite_data: we're done")); - *err = CURLE_OK; - return 0; + 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); } - *err = Curl_xfer_recv(data, buf, blen, &nread); if(*err) return -1; + if(nread == 0) { + if(data->req.shutdown) { + bool done; + *err = xfer_recv_shutdown(data, &done); + if(*err) + return -1; + if(!done) { + *err = CURLE_AGAIN; + return -1; + } + } + DEBUGF(infof(data, "sendrecv_dl: we are done")); + } DEBUGASSERT(nread >= 0); - *err = CURLE_OK; return nread; } @@ -207,9 +259,9 @@ static ssize_t Curl_xfer_recv_resp(struct Curl_easy *data, * the stream was rewound (in which case we have data in a * buffer) */ -static CURLcode readwrite_data(struct Curl_easy *data, - struct SingleRequest *k, - int *didwhat, bool *done) +static CURLcode sendrecv_dl(struct Curl_easy *data, + struct SingleRequest *k, + int *didwhat) { struct connectdata *conn = data->conn; CURLcode result = CURLE_OK; @@ -219,8 +271,6 @@ static CURLcode readwrite_data(struct Curl_easy *data, curl_off_t total_received = 0; bool is_multiplex = FALSE; - *done = FALSE; - result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen); if(result) goto out; @@ -242,24 +292,30 @@ static CURLcode readwrite_data(struct Curl_easy *data, buf = xfer_buf; bytestoread = xfer_blen; - if(bytestoread && data->set.max_recv_speed) { + if(bytestoread && data->set.max_recv_speed > 0) { /* In case of speed limit on receiving: if this loop already got * data, break out. If not, limit the amount of bytes to receive. * The overall, timed, speed limiting is done in multi.c */ if(total_received) break; - if((size_t)data->set.max_recv_speed < bytestoread) + if(data->set.max_recv_speed < (curl_off_t)bytestoread) bytestoread = (size_t)data->set.max_recv_speed; } - nread = Curl_xfer_recv_resp(data, buf, bytestoread, - is_multiplex, &result); + nread = xfer_recv_resp(data, buf, bytestoread, is_multiplex, &result); if(nread < 0) { - if(CURLE_AGAIN == result) { - result = CURLE_OK; - break; /* get out of loop */ + if(CURLE_AGAIN != result) + goto out; /* real error */ + result = CURLE_OK; + if(data->req.download_done && data->req.no_body && + !data->req.resp_trailer) { + DEBUGF(infof(data, "EAGAIN, download done, no trailer announced, " + "not waiting for EOS")); + nread = 0; + /* continue as if we read the EOS */ } - goto out; /* real error */ + else + break; /* get out of loop */ } /* We only get a 0-length read on EndOfStream */ @@ -274,15 +330,16 @@ static CURLcode readwrite_data(struct Curl_easy *data, DEBUGF(infof(data, "nread == 0, stream closed, bailing")); else DEBUGF(infof(data, "nread <= 0, server closed connection, bailing")); - if(k->eos_written) { /* already did write this to client, leave */ - k->keepon = 0; /* stop sending as well */ + result = Curl_req_stop_send_recv(data); + if(result) + goto out; + 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, done); - if(result || *done) + result = Curl_xfer_write_resp(data, buf, blen, is_eos); + if(result || data->req.done) goto out; /* if we are done, we stop receiving. On multiplexed connections, @@ -295,10 +352,11 @@ static CURLcode readwrite_data(struct Curl_easy *data, if((k->keepon & KEEP_RECV_PAUSE) || !(k->keepon & KEEP_RECV)) break; - } while(maxloops-- && data_pending(data)); + } while(maxloops--); - if(maxloops <= 0) { - /* did not read until EAGAIN, mark read-again-please */ + if((maxloops <= 0) || data_pending(data)) { + /* did not read until EAGAIN or there is still pending data, mark as + read-again-please */ data->state.select_bits = CURL_CSELECT_IN; if((k->keepon & KEEP_SENDBITS) == KEEP_SEND) data->state.select_bits |= CURL_CSELECT_OUT; @@ -306,55 +364,25 @@ static CURLcode readwrite_data(struct Curl_easy *data, if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) && (conn->bits.close || is_multiplex)) { - /* When we've read the entire thing and the close bit is set, the server - may now close the connection. If there's now any kind of sending going + /* 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 on from our side, we need to stop that immediately. */ infof(data, "we are done reading and this is set to close, stop send"); - k->keepon &= ~KEEP_SEND; /* no writing anymore either */ - k->keepon &= ~KEEP_SEND_PAUSE; /* no pausing anymore either */ + Curl_req_abort_sending(data); } out: Curl_multi_xfer_buf_release(data, xfer_buf); if(result) - DEBUGF(infof(data, "readwrite_data() -> %d", result)); + DEBUGF(infof(data, "sendrecv_dl() -> %d", result)); return result; } -#if defined(_WIN32) && defined(USE_WINSOCK) -#ifndef SIO_IDEAL_SEND_BACKLOG_QUERY -#define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747B -#endif - -static void win_update_buffer_size(curl_socket_t sockfd) -{ - int result; - ULONG ideal; - DWORD ideallen; - result = WSAIoctl(sockfd, SIO_IDEAL_SEND_BACKLOG_QUERY, 0, 0, - &ideal, sizeof(ideal), &ideallen, 0, 0); - if(result == 0) { - setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, - (const char *)&ideal, sizeof(ideal)); - } -} -#else -#define win_update_buffer_size(x) -#endif - -#define curl_upload_refill_watermark(data) \ - ((size_t)((data)->set.upload_buffer_size >> 5)) - /* * Send data to upload to the server, when the socket is writable. */ -static CURLcode readwrite_upload(struct Curl_easy *data, int *didwhat) +static CURLcode sendrecv_ul(struct Curl_easy *data, int *didwhat) { - CURLcode result = CURLE_OK; - - if((data->req.keepon & KEEP_SEND_PAUSE)) - return CURLE_OK; - /* We should not get here when the sending is already done. It * probably means that someone set `data-req.keepon |= KEEP_SEND` * when it should not. */ @@ -362,23 +390,9 @@ static CURLcode readwrite_upload(struct Curl_easy *data, int *didwhat) if(!Curl_req_done_sending(data)) { *didwhat |= KEEP_SEND; - result = Curl_req_send_more(data); - if(result) - return result; - -#if defined(_WIN32) && defined(USE_WINSOCK) - /* FIXME: this looks like it would fit better into cf-socket.c - * but then I do not know enough Windows to say... */ - { - struct curltime n = Curl_now(); - if(Curl_timediff(n, data->conn->last_sndbuf_update) > 1000) { - win_update_buffer_size(data->conn->writesockfd); - data->conn->last_sndbuf_update = n; - } - } -#endif + return Curl_req_send_more(data); } - return result; + return CURLE_OK; } static int select_bits_paused(struct Curl_easy *data, int select_bits) @@ -400,76 +414,46 @@ static int select_bits_paused(struct Curl_easy *data, int select_bits) } /* - * Curl_readwrite() is the low-level function to be called when data is to + * Curl_sendrecv() is the low-level function to be called when data is to * be read and written to/from the connection. */ -CURLcode Curl_readwrite(struct Curl_easy *data, - bool *done) +CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp) { - struct connectdata *conn = data->conn; struct SingleRequest *k = &data->req; - CURLcode result; - struct curltime now; + CURLcode result = CURLE_OK; int didwhat = 0; - int select_bits; + DEBUGASSERT(nowp); if(data->state.select_bits) { if(select_bits_paused(data, data->state.select_bits)) { /* leave the bits unchanged, so they'll tell us what to do when * this transfer gets unpaused. */ - DEBUGF(infof(data, "readwrite, select_bits, early return on PAUSED")); result = CURLE_OK; goto out; } - select_bits = data->state.select_bits; data->state.select_bits = 0; } - else { - curl_socket_t fd_read; - curl_socket_t fd_write; - /* only use the proper socket if the *_HOLD bit is not set simultaneously - as then we are in rate limiting state in that transfer direction */ - if((k->keepon & KEEP_RECVBITS) == KEEP_RECV) - fd_read = conn->sockfd; - else - fd_read = CURL_SOCKET_BAD; - - if((k->keepon & KEEP_SENDBITS) == KEEP_SEND) - fd_write = conn->writesockfd; - else - fd_write = CURL_SOCKET_BAD; - - select_bits = Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write, 0); - } - - if(select_bits == CURL_CSELECT_ERR) { - failf(data, "select/poll returned error"); - result = CURLE_SEND_ERROR; - goto out; - } #ifdef USE_HYPER - if(conn->datastream) { - result = conn->datastream(data, conn, &didwhat, done, select_bits); - if(result || *done) + if(data->conn->datastream) { + result = data->conn->datastream(data, data->conn, &didwhat, + CURL_CSELECT_OUT|CURL_CSELECT_IN); + if(result || data->req.done) goto out; } else { #endif - /* We go ahead and do a read if we have a readable socket or if - the stream was rewound (in which case we have data in a - buffer) */ - if((k->keepon & KEEP_RECV) && (select_bits & CURL_CSELECT_IN)) { - result = readwrite_data(data, k, &didwhat, done); - if(result || *done) + /* We go ahead and do a read if we have a readable socket or if the stream + was rewound (in which case we have data in a buffer) */ + if(k->keepon & KEEP_RECV) { + result = sendrecv_dl(data, k, &didwhat); + if(result || data->req.done) goto out; } /* If we still have writing to do, we check if we have a writable socket. */ - if((k->keepon & KEEP_SEND) && (select_bits & CURL_CSELECT_OUT)) { - /* write */ - - result = readwrite_upload(data, &didwhat); + if(Curl_req_want_send(data) || (data->req.keepon & KEEP_SEND_TIMED)) { + result = sendrecv_ul(data, &didwhat); if(result) goto out; } @@ -477,33 +461,8 @@ CURLcode Curl_readwrite(struct Curl_easy *data, } #endif - now = Curl_now(); if(!didwhat) { - /* no read no write, this is a timeout? */ - if(k->exp100 == EXP100_AWAITING_CONTINUE) { - /* This should allow some time for the header to arrive, but only a - very short time as otherwise it'll be too much wasted time too - often. */ - - /* Quoting RFC2616, section "8.2.3 Use of the 100 (Continue) Status": - - Therefore, when a client sends this header field to an origin server - (possibly via a proxy) from which it has never seen a 100 (Continue) - status, the client SHOULD NOT wait for an indefinite period before - sending the request body. - - */ - - timediff_t ms = Curl_timediff(now, k->start100); - if(ms >= data->set.expect_100_timeout) { - /* we've waited long enough, continue anyway */ - k->exp100 = EXP100_SEND_DATA; - k->keepon |= KEEP_SEND; - Curl_expire_done(data, EXPIRE_100_TIMEOUT); - infof(data, "Done waiting for 100-continue"); - } - } - + /* Transfer wanted to send/recv, but nothing was possible. */ result = Curl_conn_ev_data_idle(data); if(result) goto out; @@ -512,23 +471,23 @@ CURLcode Curl_readwrite(struct Curl_easy *data, if(Curl_pgrsUpdate(data)) result = CURLE_ABORTED_BY_CALLBACK; else - result = Curl_speedcheck(data, now); + result = Curl_speedcheck(data, *nowp); if(result) goto out; if(k->keepon) { - if(0 > Curl_timeleft(data, &now, FALSE)) { + if(0 > Curl_timeleft(data, nowp, FALSE)) { if(k->size != -1) { - failf(data, "Operation timed out after %" CURL_FORMAT_TIMEDIFF_T - " milliseconds with %" CURL_FORMAT_CURL_OFF_T " out of %" - CURL_FORMAT_CURL_OFF_T " bytes received", - Curl_timediff(now, data->progress.t_startsingle), + failf(data, "Operation timed out after %" FMT_TIMEDIFF_T + " milliseconds with %" FMT_OFF_T " out of %" + FMT_OFF_T " bytes received", + Curl_timediff(*nowp, data->progress.t_startsingle), k->bytecount, k->size); } else { - failf(data, "Operation timed out after %" CURL_FORMAT_TIMEDIFF_T - " milliseconds with %" CURL_FORMAT_CURL_OFF_T " bytes received", - Curl_timediff(now, data->progress.t_startsingle), + failf(data, "Operation timed out after %" FMT_TIMEDIFF_T + " milliseconds with %" FMT_OFF_T " bytes received", + Curl_timediff(*nowp, data->progress.t_startsingle), k->bytecount); } result = CURLE_OPERATION_TIMEDOUT; @@ -541,16 +500,8 @@ CURLcode Curl_readwrite(struct Curl_easy *data, * returning. */ if(!(data->req.no_body) && (k->size != -1) && - (k->bytecount != k->size) && -#ifdef CURL_DO_LINEEND_CONV - /* Most FTP servers don't adjust their file SIZE response for CRLFs, - so we'll check to see if the discrepancy can be explained - by the number of CRLFs we've changed to LFs. - */ - (k->bytecount != (k->size + data->state.crlf_conversions)) && -#endif /* CURL_DO_LINEEND_CONV */ - !k->newurl) { - failf(data, "transfer closed with %" CURL_FORMAT_CURL_OFF_T + (k->bytecount != k->size) && !k->newurl) { + failf(data, "transfer closed with %" FMT_OFF_T " bytes remaining to read", k->size - k->bytecount); result = CURLE_PARTIAL_FILE; goto out; @@ -561,11 +512,13 @@ CURLcode Curl_readwrite(struct Curl_easy *data, } } - /* Now update the "done" boolean we return */ - *done = (0 == (k->keepon&(KEEP_RECVBITS|KEEP_SENDBITS))) ? TRUE : FALSE; + /* If there is nothing more to send/recv, the request is done */ + if(0 == (k->keepon&(KEEP_RECVBITS|KEEP_SENDBITS))) + data->req.done = TRUE; + out: if(result) - DEBUGF(infof(data, "Curl_readwrite() -> %d", result)); + DEBUGF(infof(data, "Curl_sendrecv() -> %d", result)); return result; } @@ -588,7 +541,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) CURLcode result; if(!data->state.url && !data->set.uh) { - /* we can't do anything without URL */ + /* we cannot do anything without URL */ failf(data, "No URL set"); return CURLE_URL_MALFORMAT; } @@ -612,7 +565,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) } if(data->set.postfields && data->set.set_resume_from) { - /* we can't */ + /* we cannot */ failf(data, "cannot mix POSTFIELDS with RESUME_FROM"); return CURLE_BAD_FUNCTION_ARGUMENT; } @@ -714,7 +667,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) /* * Set user-agent. Used for HTTP, but since we can attempt to tunnel - * basically anything through an HTTP proxy we can't limit this based on + * basically anything through an HTTP proxy we cannot limit this based on * protocol. */ if(data->set.str[STRING_USERAGENT]) { @@ -725,332 +678,29 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) return CURLE_OUT_OF_MEMORY; } + if(data->set.str[STRING_USERNAME] || + data->set.str[STRING_PASSWORD]) + data->state.creds_from = CREDS_OPTION; if(!result) result = Curl_setstropt(&data->state.aptr.user, data->set.str[STRING_USERNAME]); if(!result) result = Curl_setstropt(&data->state.aptr.passwd, data->set.str[STRING_PASSWORD]); +#ifndef CURL_DISABLE_PROXY if(!result) result = Curl_setstropt(&data->state.aptr.proxyuser, data->set.str[STRING_PROXYUSERNAME]); if(!result) result = Curl_setstropt(&data->state.aptr.proxypasswd, data->set.str[STRING_PROXYPASSWORD]); +#endif data->req.headerbytecount = 0; Curl_headers_cleanup(data); return result; } -/* - * Curl_posttransfer() is called immediately after a transfer ends - */ -CURLcode Curl_posttransfer(struct Curl_easy *data) -{ -#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL) - /* restore the signal handler for SIGPIPE before we get back */ - if(!data->set.no_signal) - signal(SIGPIPE, data->state.prev_signal); -#else - (void)data; /* unused parameter */ -#endif - - return CURLE_OK; -} - -/* - * Curl_follow() handles the URL redirect magic. Pass in the 'newurl' string - * as given by the remote server and set up the new URL to request. - * - * This function DOES NOT FREE the given url. - */ -CURLcode Curl_follow(struct Curl_easy *data, - char *newurl, /* the Location: string */ - followtype type) /* see transfer.h */ -{ -#ifdef CURL_DISABLE_HTTP - (void)data; - (void)newurl; - (void)type; - /* Location: following will not happen when HTTP is disabled */ - return CURLE_TOO_MANY_REDIRECTS; -#else - - /* Location: redirect */ - bool disallowport = FALSE; - bool reachedmax = FALSE; - CURLUcode uc; - - DEBUGASSERT(type != FOLLOW_NONE); - - if(type != FOLLOW_FAKE) - data->state.requests++; /* count all real follows */ - if(type == FOLLOW_REDIR) { - if((data->set.maxredirs != -1) && - (data->state.followlocation >= data->set.maxredirs)) { - reachedmax = TRUE; - type = FOLLOW_FAKE; /* switch to fake to store the would-be-redirected - to URL */ - } - else { - data->state.followlocation++; /* count redirect-followings, including - auth reloads */ - - if(data->set.http_auto_referer) { - CURLU *u; - char *referer = NULL; - - /* 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; - } - - /* Make a copy of the URL without credentials and fragment */ - u = curl_url(); - if(!u) - return CURLE_OUT_OF_MEMORY; - - uc = curl_url_set(u, CURLUPART_URL, data->state.url, 0); - if(!uc) - uc = curl_url_set(u, CURLUPART_FRAGMENT, NULL, 0); - if(!uc) - uc = curl_url_set(u, CURLUPART_USER, NULL, 0); - if(!uc) - uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0); - if(!uc) - uc = curl_url_get(u, CURLUPART_URL, &referer, 0); - - curl_url_cleanup(u); - - if(uc || !referer) - return CURLE_OUT_OF_MEMORY; - - data->state.referer = referer; - data->state.referer_alloc = TRUE; /* yes, free this later */ - } - } - } - - if((type != FOLLOW_RETRY) && - (data->req.httpcode != 401) && (data->req.httpcode != 407) && - Curl_is_absolute_url(newurl, NULL, 0, FALSE)) { - /* If this is not redirect due to a 401 or 407 response and an absolute - URL: don't allow a custom port number */ - disallowport = TRUE; - } - - DEBUGASSERT(data->state.uh); - uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, - (type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME : - ((type == FOLLOW_REDIR) ? CURLU_URLENCODE : 0) | - CURLU_ALLOW_SPACE | - (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)); - if(uc) { - if(type != FOLLOW_FAKE) { - failf(data, "The redirect target URL could not be parsed: %s", - curl_url_strerror(uc)); - return Curl_uc_to_curlcode(uc); - } - - /* the URL could not be parsed for some reason, but since this is FAKE - mode, just duplicate the field as-is */ - newurl = strdup(newurl); - if(!newurl) - return CURLE_OUT_OF_MEMORY; - } - else { - uc = curl_url_get(data->state.uh, CURLUPART_URL, &newurl, 0); - if(uc) - return Curl_uc_to_curlcode(uc); - - /* Clear auth if this redirects to a different port number or protocol, - unless permitted */ - if(!data->set.allow_auth_to_other_hosts && (type != FOLLOW_FAKE)) { - char *portnum; - int port; - bool clear = FALSE; - - if(data->set.use_port && data->state.allow_port) - /* a custom port is used */ - port = (int)data->set.use_port; - else { - uc = curl_url_get(data->state.uh, CURLUPART_PORT, &portnum, - CURLU_DEFAULT_PORT); - if(uc) { - free(newurl); - return Curl_uc_to_curlcode(uc); - } - port = atoi(portnum); - free(portnum); - } - if(port != data->info.conn_remote_port) { - infof(data, "Clear auth, redirects to port from %u to %u", - data->info.conn_remote_port, port); - clear = TRUE; - } - else { - char *scheme; - const struct Curl_handler *p; - uc = curl_url_get(data->state.uh, CURLUPART_SCHEME, &scheme, 0); - if(uc) { - free(newurl); - return Curl_uc_to_curlcode(uc); - } - - p = Curl_get_scheme_handler(scheme); - if(p && (p->protocol != data->info.conn_protocol)) { - infof(data, "Clear auth, redirects scheme from %s to %s", - data->info.conn_scheme, scheme); - clear = TRUE; - } - free(scheme); - } - if(clear) { - Curl_safefree(data->state.aptr.user); - Curl_safefree(data->state.aptr.passwd); - } - } - } - - if(type == FOLLOW_FAKE) { - /* we're only figuring out the new url if we would've followed locations - but now we're done so we can get out! */ - data->info.wouldredirect = newurl; - - if(reachedmax) { - failf(data, "Maximum (%ld) redirects followed", data->set.maxredirs); - return CURLE_TOO_MANY_REDIRECTS; - } - return CURLE_OK; - } - - if(disallowport) - data->state.allow_port = FALSE; - - if(data->state.url_alloc) - Curl_safefree(data->state.url); - - data->state.url = newurl; - data->state.url_alloc = TRUE; - - infof(data, "Issue another request to this URL: '%s'", data->state.url); - - /* - * We get here when the HTTP code is 300-399 (and 401). We need to perform - * differently based on exactly what return code there was. - * - * News from 7.10.6: we can also get here on a 401 or 407, in case we act on - * an HTTP (proxy-) authentication scheme other than Basic. - */ - switch(data->info.httpcode) { - /* 401 - Act on a WWW-Authenticate, we keep on moving and do the - Authorization: XXXX header in the HTTP request code snippet */ - /* 407 - Act on a Proxy-Authenticate, we keep on moving and do the - Proxy-Authorization: XXXX header in the HTTP request code snippet */ - /* 300 - Multiple Choices */ - /* 306 - Not used */ - /* 307 - Temporary Redirect */ - default: /* for all above (and the unknown ones) */ - /* Some codes are explicitly mentioned since I've checked RFC2616 and they - * seem to be OK to POST to. - */ - break; - case 301: /* Moved Permanently */ - /* (quote from RFC7231, section 6.4.2) - * - * Note: For historical reasons, a user agent MAY change the request - * method from POST to GET for the subsequent request. If this - * behavior is undesired, the 307 (Temporary Redirect) status code - * can be used instead. - * - * ---- - * - * Many webservers expect this, so these servers often answers to a POST - * request with an error page. To be sure that libcurl gets the page that - * most user agents would get, libcurl has to force GET. - * - * 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)) { - infof(data, "Switch from POST to GET"); - data->state.httpreq = HTTPREQ_GET; - Curl_creader_set_rewind(data, FALSE); - } - break; - case 302: /* Found */ - /* (quote from RFC7231, section 6.4.3) - * - * Note: For historical reasons, a user agent MAY change the request - * method from POST to GET for the subsequent request. If this - * behavior is undesired, the 307 (Temporary Redirect) status code - * can be used instead. - * - * ---- - * - * Many webservers expect this, so these servers often answers to a POST - * request with an error page. To be sure that libcurl gets the page that - * most user agents would get, libcurl has to force GET. - * - * 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)) { - infof(data, "Switch from POST to GET"); - data->state.httpreq = HTTPREQ_GET; - Curl_creader_set_rewind(data, FALSE); - } - break; - - case 303: /* See Other */ - /* 'See Other' location is not the resource but a substitute for the - * resource. In this case we switch the method to GET/HEAD, unless the - * method is POST and the user specified to keep it as POST. - * https://github.com/curl/curl/issues/5237#issuecomment-614641049 - */ - if(data->state.httpreq != HTTPREQ_GET && - ((data->state.httpreq != HTTPREQ_POST && - data->state.httpreq != HTTPREQ_POST_FORM && - data->state.httpreq != HTTPREQ_POST_MIME) || - !(data->set.keep_post & CURL_REDIR_POST_303))) { - data->state.httpreq = HTTPREQ_GET; - infof(data, "Switch to %s", - data->req.no_body?"HEAD":"GET"); - } - break; - case 304: /* Not Modified */ - /* 304 means we did a conditional request and it was "Not modified". - * We shouldn't get any Location: header in this response! - */ - break; - case 305: /* Use Proxy */ - /* (quote from RFC2616, section 10.3.6): - * "The requested resource MUST be accessed through the proxy given - * by the Location field. The Location field gives the URI of the - * proxy. The recipient is expected to repeat this single request - * via the proxy. 305 responses MUST only be generated by origin - * servers." - */ - break; - } - Curl_pgrsTime(data, TIMER_REDIRECT); - Curl_pgrsResetTransferSizes(data); - - return CURLE_OK; -#endif /* CURL_DISABLE_HTTP */ -} - /* Returns CURLE_OK *and* sets '*url' if a request retry is wanted. NOTE: that the *url is malloc()ed. */ @@ -1060,8 +710,9 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) bool retry = FALSE; *url = NULL; - /* if we're talking upload, we can't do the checks below, unless the protocol - is HTTP as when uploading over HTTP we will still get a response */ + /* if we are talking upload, we cannot do the checks below, unless the + 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))) return CURLE_OK; @@ -1107,7 +758,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) return CURLE_OUT_OF_MEMORY; connclose(conn, "retry"); /* close this connection */ - conn->bits.retry = TRUE; /* mark this as a connection we're about + conn->bits.retry = TRUE; /* mark this as a connection we are about to retry. Marking it this way should prevent i.e HTTP transfers to return error just because nothing has been @@ -1118,16 +769,19 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url) } /* - * Curl_xfer_setup() is called to setup some basic properties for the - * upcoming transfer. + * xfer_setup() is called to setup basic properties for the transfer. */ -void Curl_xfer_setup( +static void xfer_setup( struct Curl_easy *data, /* transfer */ int sockindex, /* socket index to read from or -1 */ curl_off_t size, /* -1 if unknown at this point */ bool getheader, /* TRUE if header parsing is wanted */ - int writesockindex /* socket index to write to, it may very well be - the same we read from. -1 disables */ + int writesockindex, /* socket index to write to, it may be the same we + read from. -1 disables */ + bool shutdown, /* shutdown connection at transfer end. Only + * supported when sending OR receiving. */ + bool shutdown_err_ignore /* errors during shutdown do not fail the + * transfer */ ) { struct SingleRequest *k = &data->req; @@ -1137,6 +791,7 @@ void Curl_xfer_setup( DEBUGASSERT(conn != NULL); DEBUGASSERT((sockindex <= 1) && (sockindex >= -1)); DEBUGASSERT((writesockindex <= 1) && (writesockindex >= -1)); + DEBUGASSERT(!shutdown || (sockindex == -1) || (writesockindex == -1)); if(conn->bits.multiplex || conn->httpversion >= 20 || want_send) { /* when multiplexing, the read/write sockets need to be the same! */ @@ -1145,18 +800,20 @@ void Curl_xfer_setup( conn->sock[sockindex]; conn->writesockfd = conn->sockfd; if(want_send) - /* special and very HTTP-specific */ + /* special and HTTP-specific */ writesockindex = FIRSTSOCKET; } else { conn->sockfd = sockindex == -1 ? CURL_SOCKET_BAD : conn->sock[sockindex]; conn->writesockfd = writesockindex == -1 ? - CURL_SOCKET_BAD:conn->sock[writesockindex]; + CURL_SOCKET_BAD : conn->sock[writesockindex]; } - k->getheader = getheader; + k->getheader = getheader; k->size = size; + k->shutdown = shutdown; + k->shutdown_err_ignore = shutdown_err_ignore; /* The code sequence below is placed in this function just because all necessary input is not always known in do_complete() as this function may @@ -1167,56 +824,57 @@ void Curl_xfer_setup( if(size > 0) Curl_pgrsSetDownloadSize(data, size); } - /* we want header and/or body, if neither then don't do this! */ + /* we want header and/or body, if neither then do not do this! */ if(k->getheader || !data->req.no_body) { if(sockindex != -1) k->keepon |= KEEP_RECV; - if(writesockindex != -1) { - /* HTTP 1.1 magic: - - Even if we require a 100-return code before uploading data, we might - need to write data before that since the REQUEST may not have been - finished sent off just yet. - - Thus, we must check if the request has been sent before we set the - state info where we wait for the 100-return code - */ - if((data->state.expect100header) && - (conn->handler->protocol&PROTO_FAMILY_HTTP)) { - /* wait with write until we either got 100-continue or a timeout */ - k->exp100 = EXP100_AWAITING_CONTINUE; - k->start100 = Curl_now(); - - /* Set a timeout for the multi interface. Add the inaccuracy margin so - that we don't fire slightly too early and get denied to run. */ - Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT); - } - else { - if(data->state.expect100header) - /* when we've sent off the rest of the headers, we must await a - 100-continue but first finish sending the request */ - k->exp100 = EXP100_SENDING_REQUEST; - - /* enable the write bit when we're not waiting for continue */ - k->keepon |= KEEP_SEND; - } - } /* if(writesockindex != -1) */ + if(writesockindex != -1) + k->keepon |= KEEP_SEND; } /* if(k->getheader || !data->req.no_body) */ } +void Curl_xfer_setup_nop(struct Curl_easy *data) +{ + xfer_setup(data, -1, -1, FALSE, -1, FALSE, FALSE); +} + +void Curl_xfer_setup1(struct Curl_easy *data, + int send_recv, + curl_off_t recv_size, + bool getheader) +{ + int recv_index = (send_recv & CURL_XFER_RECV) ? FIRSTSOCKET : -1; + int send_index = (send_recv & CURL_XFER_SEND) ? FIRSTSOCKET : -1; + DEBUGASSERT((recv_index >= 0) || (recv_size == -1)); + xfer_setup(data, recv_index, recv_size, getheader, send_index, FALSE, FALSE); +} + +void Curl_xfer_setup2(struct Curl_easy *data, + int send_recv, + curl_off_t recv_size, + bool shutdown, + bool shutdown_err_ignore) +{ + int recv_index = (send_recv & CURL_XFER_RECV) ? SECONDARYSOCKET : -1; + int send_index = (send_recv & CURL_XFER_SEND) ? SECONDARYSOCKET : -1; + DEBUGASSERT((recv_index >= 0) || (recv_size == -1)); + xfer_setup(data, recv_index, recv_size, FALSE, send_index, + shutdown, shutdown_err_ignore); +} + CURLcode Curl_xfer_write_resp(struct Curl_easy *data, - char *buf, size_t blen, - bool is_eos, bool *done) + const char *buf, size_t blen, + bool is_eos) { CURLcode result = CURLE_OK; if(data->conn->handler->write_resp) { /* protocol handlers offering this function take full responsibility * for writing all received download data to the client. */ - result = data->conn->handler->write_resp(data, buf, blen, is_eos, done); + result = data->conn->handler->write_resp(data, buf, blen, is_eos); } else { /* No special handling by protocol handler, write all received data @@ -1225,15 +883,7 @@ CURLcode Curl_xfer_write_resp(struct Curl_easy *data, int cwtype = CLIENTWRITE_BODY; if(is_eos) cwtype |= CLIENTWRITE_EOS; - -#ifndef CURL_DISABLE_POP3 - if(blen && data->conn->handler->protocol & PROTO_FAMILY_POP3) { - result = data->req.ignorebody? CURLE_OK : - Curl_pop3_write(data, buf, blen); - } - else -#endif /* CURL_DISABLE_POP3 */ - result = Curl_client_write(data, cwtype, buf, blen); + result = Curl_client_write(data, cwtype, buf, blen); } } @@ -1242,38 +892,67 @@ CURLcode Curl_xfer_write_resp(struct Curl_easy *data, data->req.eos_written = TRUE; data->req.download_done = TRUE; } + CURL_TRC_WRITE(data, "xfer_write_resp(len=%zu, eos=%d) -> %d", + blen, is_eos, result); return result; } +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) { + /* 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); + } + /* No special handling by protocol handler, write as response bytes */ + return Curl_xfer_write_resp(data, hd0, hdlen, is_eos); +} + CURLcode Curl_xfer_write_done(struct Curl_easy *data, bool premature) { (void)premature; return Curl_cw_out_done(data); } +bool Curl_xfer_needs_flush(struct Curl_easy *data) +{ + int sockindex; + sockindex = ((data->conn->writesockfd != CURL_SOCKET_BAD) && + (data->conn->writesockfd == data->conn->sock[SECONDARYSOCKET])); + return Curl_conn_needs_flush(data, sockindex); +} + +CURLcode Curl_xfer_flush(struct Curl_easy *data) +{ + int sockindex; + sockindex = ((data->conn->writesockfd != CURL_SOCKET_BAD) && + (data->conn->writesockfd == data->conn->sock[SECONDARYSOCKET])); + return Curl_conn_flush(data, sockindex); +} + CURLcode Curl_xfer_send(struct Curl_easy *data, - const void *buf, size_t blen, + const void *buf, size_t blen, bool eos, size_t *pnwritten) { CURLcode result; int sockindex; - if(!data || !data->conn) - return CURLE_FAILED_INIT; - /* FIXME: would like to enable this, but some protocols (MQTT) do not - * setup the transfer correctly, it seems - if(data->conn->writesockfd == CURL_SOCKET_BAD) { - failf(data, "transfer not setup for sending"); - DEBUGASSERT(0); - return CURLE_SEND_ERROR; - } */ + DEBUGASSERT(data); + DEBUGASSERT(data->conn); + sockindex = ((data->conn->writesockfd != CURL_SOCKET_BAD) && (data->conn->writesockfd == data->conn->sock[SECONDARYSOCKET])); - result = Curl_conn_send(data, sockindex, buf, blen, pnwritten); + result = Curl_conn_send(data, sockindex, buf, blen, eos, pnwritten); if(result == CURLE_AGAIN) { result = CURLE_OK; *pnwritten = 0; } + else if(!result && *pnwritten) + data->info.request_size += *pnwritten; + + DEBUGF(infof(data, "Curl_xfer_send(len=%zu, eos=%d) -> %d, %zu", + blen, eos, result, *pnwritten)); return result; } @@ -1283,18 +962,13 @@ CURLcode Curl_xfer_recv(struct Curl_easy *data, { int sockindex; - if(!data || !data->conn) - return CURLE_FAILED_INIT; - /* FIXME: would like to enable this, but some protocols (MQTT) do not - * setup the transfer correctly, it seems - if(data->conn->sockfd == CURL_SOCKET_BAD) { - failf(data, "transfer not setup for receiving"); - DEBUGASSERT(0); - return CURLE_RECV_ERROR; - } */ + DEBUGASSERT(data); + DEBUGASSERT(data->conn); + DEBUGASSERT(data->set.buffer_size > 0); + sockindex = ((data->conn->sockfd != CURL_SOCKET_BAD) && (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET])); - if(data->set.buffer_size > 0 && (size_t)data->set.buffer_size < blen) + if((size_t)data->set.buffer_size < blen) blen = (size_t)data->set.buffer_size; return Curl_conn_recv(data, sockindex, buf, blen, pnrcvd); } @@ -1304,3 +978,15 @@ CURLcode Curl_xfer_send_close(struct Curl_easy *data) Curl_conn_ev_data_done_send(data); return CURLE_OK; } + +bool Curl_xfer_is_blocked(struct Curl_easy *data) +{ + bool want_send = ((data)->req.keepon & KEEP_SEND); + bool want_recv = ((data)->req.keepon & KEEP_RECV); + if(!want_send) + return (want_recv && Curl_cwriter_is_paused(data)); + else if(!want_recv) + return (want_send && Curl_creader_is_paused(data)); + else + return Curl_creader_is_paused(data) && Curl_cwriter_is_paused(data); +} diff --git a/deps/curl/lib/transfer.h b/deps/curl/lib/transfer.h index 96e69988..8c9b88c1 100644 --- a/deps/curl/lib/transfer.h +++ b/deps/curl/lib/transfer.h @@ -32,7 +32,6 @@ char *Curl_checkheaders(const struct Curl_easy *data, void Curl_init_CONNECT(struct Curl_easy *data); CURLcode Curl_pretransfer(struct Curl_easy *data); -CURLcode Curl_posttransfer(struct Curl_easy *data); typedef enum { FOLLOW_NONE, /* not used within the function, just a placeholder to @@ -43,9 +42,7 @@ typedef enum { FOLLOW_REDIR /* a full true redirect */ } followtype; -CURLcode Curl_follow(struct Curl_easy *data, char *newurl, - followtype type); -CURLcode Curl_readwrite(struct Curl_easy *data, bool *done); +CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp); int Curl_single_getsock(struct Curl_easy *data, struct connectdata *conn, curl_socket_t *socks); CURLcode Curl_retry_request(struct Curl_easy *data, char **url); @@ -62,21 +59,52 @@ bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc); * @param blen the amount of bytes in `buf` * @param is_eos TRUE iff the connection indicates this to be the last * bytes of the response - * @param done on returnm, TRUE iff the response is complete */ CURLcode Curl_xfer_write_resp(struct Curl_easy *data, - char *buf, size_t blen, - bool is_eos, bool *done); + const char *buf, size_t blen, + bool is_eos); -/* This sets up a forthcoming transfer */ -void Curl_xfer_setup(struct Curl_easy *data, - int sockindex, /* socket index to read from or -1 */ - curl_off_t size, /* -1 if unknown at this point */ - bool getheader, /* TRUE if header parsing is wanted */ - int writesockindex /* socket index to write to. May be - the same we read from. -1 - disables */ - ); +/** + * Write a single "header" line from a server response. + * @param hd0 the 0-terminated, single header line + * @param hdlen the length of the header line + * @param is_eos TRUE iff this is the end of the response + */ +CURLcode Curl_xfer_write_resp_hd(struct Curl_easy *data, + const char *hd0, size_t hdlen, bool is_eos); + +#define CURL_XFER_NOP (0) +#define CURL_XFER_RECV (1<<(0)) +#define CURL_XFER_SEND (1<<(1)) +#define CURL_XFER_SENDRECV (CURL_XFER_RECV|CURL_XFER_SEND) + +/** + * The transfer is neither receiving nor sending now. + */ +void Curl_xfer_setup_nop(struct Curl_easy *data); + +/** + * The transfer will use socket 1 to send/recv. `recv_size` is + * the amount to receive or -1 if unknown. `getheader` indicates + * response header processing is expected. + */ +void Curl_xfer_setup1(struct Curl_easy *data, + int send_recv, + curl_off_t recv_size, + bool getheader); + +/** + * The transfer will use socket 2 to send/recv. `recv_size` is + * the amount to receive or -1 if unknown. With `shutdown` being + * set, the transfer is only allowed to either send OR receive + * and the socket 2 connection will be shutdown at the end of + * the transfer. An unclean shutdown will fail the transfer + * unless `shutdown_err_ignore` is TRUE. + */ +void Curl_xfer_setup2(struct Curl_easy *data, + int send_recv, + curl_off_t recv_size, + bool shutdown, bool shutdown_err_ignore); /** * Multi has set transfer to DONE. Last chance to trigger @@ -84,13 +112,24 @@ void Curl_xfer_setup(struct Curl_easy *data, */ CURLcode Curl_xfer_write_done(struct Curl_easy *data, bool premature); +/** + * Return TRUE iff transfer has pending data to send. Checks involved + * connection filters. + */ +bool Curl_xfer_needs_flush(struct Curl_easy *data); + +/** + * Flush any pending send data on the transfer connection. + */ +CURLcode Curl_xfer_flush(struct Curl_easy *data); + /** * Send data on the socket/connection filter designated * for transfer's outgoing data. * Will return CURLE_OK on blocking with (*pnwritten == 0). */ CURLcode Curl_xfer_send(struct Curl_easy *data, - const void *buf, size_t blen, + const void *buf, size_t blen, bool eos, size_t *pnwritten); /** @@ -103,5 +142,13 @@ CURLcode Curl_xfer_recv(struct Curl_easy *data, ssize_t *pnrcvd); CURLcode Curl_xfer_send_close(struct Curl_easy *data); +CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done); + +/** + * Return TRUE iff the transfer is not done, but further progress + * is blocked. For example when it is only receiving and its writer + * is PAUSED. + */ +bool Curl_xfer_is_blocked(struct Curl_easy *data); #endif /* HEADER_CURL_TRANSFER_H */ diff --git a/deps/curl/lib/url.c b/deps/curl/lib/url.c index b3057659..f9bb05f7 100644 --- a/deps/curl/lib/url.c +++ b/deps/curl/lib/url.c @@ -56,7 +56,7 @@ #endif #ifndef HAVE_SOCKET -#error "We can't compile without socket() support!" +#error "We cannot compile without socket() support!" #endif #include @@ -136,7 +136,7 @@ static void data_priority_cleanup(struct Curl_easy *data); #endif /* Some parts of the code (e.g. chunked encoding) assume this buffer has at - * more than just a few bytes to play with. Don't let it become too small or + * more than just a few bytes to play with. Do not let it become too small or * bad things will happen. */ #if READBUFFER_SIZE < READBUFFER_MIN @@ -234,8 +234,6 @@ CURLcode Curl_close(struct Curl_easy **datap) data = *datap; *datap = NULL; - Curl_expire_clear(data); /* shut off timers */ - /* Detach connection if any is left. This should not be normal, but can be the case for example with CONNECT_ONLY + recv/send (test 556) */ Curl_detach_connection(data); @@ -253,6 +251,8 @@ CURLcode Curl_close(struct Curl_easy **datap) } } + Curl_expire_clear(data); /* shut off any timers left */ + data->magic = 0; /* force a clear AFTER the possibly enforced removal from the multi handle, since that function uses the magic field! */ @@ -260,13 +260,12 @@ CURLcode Curl_close(struct Curl_easy **datap) if(data->state.rangestringalloc) free(data->state.range); - /* freed here just in case DONE wasn't called */ + /* freed here just in case DONE was not called */ Curl_req_free(&data->req, data); /* Close down all open SSL info and sessions */ Curl_ssl_close_all(data); Curl_safefree(data->state.first_host); - Curl_safefree(data->state.scratch); Curl_ssl_free_certinfo(data); if(data->state.referer_alloc) { @@ -278,10 +277,12 @@ CURLcode Curl_close(struct Curl_easy **datap) up_free(data); Curl_dyn_free(&data->state.headerb); Curl_flush_cookies(data, TRUE); +#ifndef CURL_DISABLE_ALTSVC Curl_altsvc_save(data, data->asi, data->set.str[STRING_ALTSVC]); Curl_altsvc_cleanup(&data->asi); - Curl_hsts_save(data, data->hsts, data->set.str[STRING_HSTS]); +#endif #ifndef CURL_DISABLE_HSTS + Curl_hsts_save(data, data->hsts, data->set.str[STRING_HSTS]); if(!data->share || !data->share->hsts) Curl_hsts_cleanup(&data->hsts); curl_slist_free_all(data->state.hstslist); /* clean up list */ @@ -305,7 +306,9 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); } +#ifndef CURL_DISABLE_PROXY Curl_safefree(data->state.aptr.proxyuserpwd); +#endif Curl_safefree(data->state.aptr.uagent); Curl_safefree(data->state.aptr.userpwd); Curl_safefree(data->state.aptr.accept_encoding); @@ -313,12 +316,18 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_safefree(data->state.aptr.rangeline); Curl_safefree(data->state.aptr.ref); Curl_safefree(data->state.aptr.host); +#ifndef CURL_DISABLE_COOKIES Curl_safefree(data->state.aptr.cookiehost); +#endif +#ifndef CURL_DISABLE_RTSP Curl_safefree(data->state.aptr.rtsp_transport); +#endif Curl_safefree(data->state.aptr.user); Curl_safefree(data->state.aptr.passwd); +#ifndef CURL_DISABLE_PROXY Curl_safefree(data->state.aptr.proxyuser); Curl_safefree(data->state.aptr.proxypasswd); +#endif #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API) Curl_mime_cleanpart(data->state.formp); @@ -329,6 +338,7 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_wildcard_dtor(&data->wildcard); Curl_freeset(data); Curl_headers_cleanup(data); + Curl_netrc_cleanup(&data->state.netrc); free(data); return CURLE_OK; } @@ -353,10 +363,9 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) set->fread_func_set = (curl_read_callback)fread; set->is_fread_set = 0; - set->seek_func = ZERO_NULL; set->seek_client = ZERO_NULL; - set->filesize = -1; /* we don't know the size */ + set->filesize = -1; /* we do not know the size */ set->postfieldsize = -1; /* unknown size */ set->maxredirs = 30; /* sensible default */ @@ -406,8 +415,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) set->new_file_perms = 0644; /* Default permissions */ set->allowed_protocols = (curl_prot_t) CURLPROTO_ALL; - set->redir_protocols = CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | - CURLPROTO_FTPS; + set->redir_protocols = CURLPROTO_REDIR; #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) /* @@ -419,9 +427,9 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) /* Set the default CA cert bundle/path detected/specified at build time. * - * If Schannel or SecureTransport is the selected SSL backend then these - * locations are ignored. We allow setting CA location for schannel and - * securetransport when explicitly specified by the user via + * If Schannel or Secure Transport is the selected SSL backend then these + * locations are ignored. We allow setting CA location for Schannel and + * Secure Transport when explicitly specified by the user via * CURLOPT_CAINFO / --cacert. */ if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL && @@ -430,20 +438,22 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], CURL_CA_BUNDLE); if(result) return result; - +#ifndef CURL_DISABLE_PROXY result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], CURL_CA_BUNDLE); if(result) return result; #endif +#endif #if defined(CURL_CA_PATH) result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], CURL_CA_PATH); if(result) return result; - +#ifndef CURL_DISABLE_PROXY result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], CURL_CA_PATH); if(result) return result; +#endif #endif } @@ -456,6 +466,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) set->tcp_keepalive = FALSE; set->tcp_keepintvl = 60; set->tcp_keepidle = 60; + set->tcp_keepcnt = 9; set->tcp_fastopen = FALSE; set->tcp_nodelay = TRUE; set->ssl_enable_alpn = TRUE; @@ -495,22 +506,17 @@ CURLcode Curl_open(struct Curl_easy **curl) CURLcode result; struct Curl_easy *data; - /* Very simple start-up: alloc the struct, init it with zeroes and return */ + /* simple start-up: alloc the struct, init it with zeroes and return */ data = calloc(1, sizeof(struct Curl_easy)); if(!data) { - /* this is a very serious error */ + /* this is a serious error */ DEBUGF(fprintf(stderr, "Error: calloc of Curl_easy failed\n")); return CURLE_OUT_OF_MEMORY; } data->magic = CURLEASY_MAGIC_NUMBER; - result = Curl_req_init(&data->req); - if(result) { - DEBUGF(fprintf(stderr, "Error: request init failed\n")); - free(data); - return result; - } + Curl_req_init(&data->req); result = Curl_resolver_init(data, &data->state.async.resolver); if(result) { @@ -530,9 +536,17 @@ CURLcode Curl_open(struct Curl_easy **curl) data->state.recent_conn_id = -1; /* and not assigned an id yet */ data->id = -1; + data->mid = -1; +#ifndef CURL_DISABLE_DOH + data->set.dohfor_mid = -1; +#endif data->progress.flags |= PGRS_HIDE; data->state.current_speed = -1; /* init to negative == impossible */ +#ifndef CURL_DISABLE_HTTP + Curl_llist_init(&data->state.httphdrs, NULL); +#endif + Curl_netrc_init(&data->state.netrc); } if(result) { @@ -545,23 +559,10 @@ CURLcode Curl_open(struct Curl_easy **curl) } else *curl = data; - return result; } -static void conn_shutdown(struct Curl_easy *data) -{ - DEBUGASSERT(data); - infof(data, "Closing connection"); - - /* possible left-overs from the async name resolvers */ - Curl_resolver_cancel(data); - - Curl_conn_close(data, SECONDARYSOCKET); - Curl_conn_close(data, FIRSTSOCKET); -} - -static void conn_free(struct Curl_easy *data, struct connectdata *conn) +void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn) { size_t i; @@ -588,8 +589,8 @@ static void conn_free(struct Curl_easy *data, struct connectdata *conn) Curl_safefree(conn->sasl_authzid); Curl_safefree(conn->options); Curl_safefree(conn->oauth_bearer); - Curl_safefree(conn->host.rawalloc); /* host name buffer */ - Curl_safefree(conn->conn_to_host.rawalloc); /* host name buffer */ + Curl_safefree(conn->host.rawalloc); /* hostname buffer */ + Curl_safefree(conn->conn_to_host.rawalloc); /* hostname buffer */ Curl_safefree(conn->hostname_resolve); Curl_safefree(conn->secondaryhostname); Curl_safefree(conn->localdev); @@ -598,13 +599,14 @@ static void conn_free(struct Curl_easy *data, struct connectdata *conn) #ifdef USE_UNIX_SOCKETS Curl_safefree(conn->unix_domain_socket); #endif + Curl_safefree(conn->destination); free(conn); /* free all the connection oriented data */ } /* * Disconnects the given connection. Note the connection may not be the - * primary connection, like when freeing room in the connection cache or + * primary connection, like when freeing room in the connection pool or * killing of a dead old connection. * * A connection needs an easy handle when closing down. We support this passed @@ -612,18 +614,16 @@ static void conn_free(struct Curl_easy *data, struct connectdata *conn) * disassociated from an easy handle. * * This function MUST NOT reset state in the Curl_easy struct if that - * isn't strictly bound to the life-time of *this* particular connection. - * + * is not strictly bound to the life-time of *this* particular connection. */ - -void Curl_disconnect(struct Curl_easy *data, - struct connectdata *conn, bool dead_connection) +bool Curl_on_disconnect(struct Curl_easy *data, + struct connectdata *conn, bool aborted) { /* there must be a connection to close */ DEBUGASSERT(conn); - /* it must be removed from the connection cache */ - DEBUGASSERT(!conn->bundle); + /* it must be removed from the connection pool */ + DEBUGASSERT(!conn->bits.in_cpool); /* there must be an associated transfer */ DEBUGASSERT(data); @@ -631,22 +631,11 @@ void Curl_disconnect(struct Curl_easy *data, /* the transfer must be detached from the connection */ DEBUGASSERT(!data->conn); - DEBUGF(infof(data, "Curl_disconnect(conn #%" - CURL_FORMAT_CURL_OFF_T ", dead=%d)", - conn->connection_id, dead_connection)); - /* - * If this connection isn't marked to force-close, leave it open if there - * are other users of it - */ - if(CONN_INUSE(conn) && !dead_connection) { - DEBUGF(infof(data, "Curl_disconnect when inuse: %zu", CONN_INUSE(conn))); - return; - } + DEBUGF(infof(data, "Curl_disconnect(conn #%" FMT_OFF_T ", aborted=%d)", + conn->connection_id, aborted)); - if(conn->dns_entry) { - Curl_resolv_unlock(data, conn->dns_entry); - conn->dns_entry = NULL; - } + if(conn->dns_entry) + Curl_resolv_unlink(data, &conn->dns_entry); /* Cleanup NTLM connection-related data */ Curl_http_auth_cleanup_ntlm(conn); @@ -655,46 +644,31 @@ void Curl_disconnect(struct Curl_easy *data, Curl_http_auth_cleanup_negotiate(conn); if(conn->connect_only) - /* treat the connection as dead in CONNECT_ONLY situations */ - dead_connection = TRUE; + /* treat the connection as aborted in CONNECT_ONLY situations */ + aborted = TRUE; - /* temporarily attach the connection to this transfer handle for the - disconnect and shutdown */ - Curl_attach_connection(data, conn); - - if(conn->handler && conn->handler->disconnect) - /* This is set if protocol-specific cleanups should be made */ - conn->handler->disconnect(data, conn, dead_connection); - - conn_shutdown(data); - - /* detach it again */ - Curl_detach_connection(data); - - conn_free(data, conn); + return aborted; } /* - * IsMultiplexingPossible() + * xfer_may_multiplex() * - * Return a bitmask with the available multiplexing options for the given - * requested connection. + * Return a TRUE, iff the transfer can be done over an (appropriate) + * multiplexed connection. */ -static int IsMultiplexingPossible(const struct Curl_easy *handle, - const struct connectdata *conn) +static bool xfer_may_multiplex(const struct Curl_easy *data, + const struct connectdata *conn) { - int avail = 0; - /* If an HTTP protocol and multiplexing is enabled */ if((conn->handler->protocol & PROTO_FAMILY_HTTP) && (!conn->bits.protoconnstart || !conn->bits.close)) { - if(Curl_multiplex_wanted(handle->multi) && - (handle->state.httpwant >= CURL_HTTP_VERSION_2)) - /* allows HTTP/2 */ - avail |= CURLPIPE_MULTIPLEX; + if(Curl_multiplex_wanted(data->multi) && + (data->state.httpwant >= CURL_HTTP_VERSION_2)) + /* allows HTTP/2 or newer */ + return TRUE; } - return avail; + return FALSE; } #ifndef CURL_DISABLE_PROXY @@ -729,7 +703,7 @@ socks_proxy_info_matches(const struct proxy_info *data, return TRUE; } #else -/* disabled, won't get called */ +/* disabled, will not get called */ #define proxy_info_matches(x,y) FALSE #define socks_proxy_info_matches(x,y) FALSE #endif @@ -748,7 +722,7 @@ static bool conn_maxage(struct Curl_easy *data, idletime /= 1000; /* integer seconds is fine */ if(idletime > data->set.maxage_conn) { - infof(data, "Too old connection (%" CURL_FORMAT_TIMEDIFF_T + infof(data, "Too old connection (%" FMT_TIMEDIFF_T " seconds idle), disconnect it", idletime); return TRUE; } @@ -758,7 +732,7 @@ static bool conn_maxage(struct Curl_easy *data, if(data->set.maxlifetime_conn && lifetime > data->set.maxlifetime_conn) { infof(data, - "Too old connection (%" CURL_FORMAT_TIMEDIFF_T + "Too old connection (%" FMT_TIMEDIFF_T " seconds since creation), disconnect it", lifetime); return TRUE; } @@ -768,23 +742,24 @@ static bool conn_maxage(struct Curl_easy *data, } /* - * This function checks if the given connection is dead and extracts it from - * the connection cache if so. - * - * When this is called as a Curl_conncache_foreach() callback, the connection - * cache lock is held! - * - * Returns TRUE if the connection was dead and extracted. + * Return TRUE iff the given connection is considered dead. */ -static bool extract_if_dead(struct connectdata *conn, - struct Curl_easy *data) +bool Curl_conn_seems_dead(struct connectdata *conn, + struct Curl_easy *data, + struct curltime *pnow) { + DEBUGASSERT(!data->conn); if(!CONN_INUSE(conn)) { - /* The check for a dead socket makes sense only if the connection isn't in + /* The check for a dead socket makes sense only if the connection is not in use */ bool dead; - struct curltime now = Curl_now(); - if(conn_maxage(data, conn, now)) { + struct curltime now; + if(!pnow) { + now = Curl_now(); + pnow = &now; + } + + if(conn_maxage(data, conn, *pnow)) { /* avoid check if already too old */ dead = TRUE; } @@ -804,7 +779,7 @@ static bool extract_if_dead(struct connectdata *conn, } else { - bool input_pending; + bool input_pending = FALSE; Curl_attach_connection(data, conn); dead = !Curl_conn_is_alive(data, conn, &input_pending); @@ -817,77 +792,47 @@ static bool extract_if_dead(struct connectdata *conn, * any time (HTTP/2 PING for example), the protocol handler needs * to install its own `connection_check` callback. */ + DEBUGF(infof(data, "connection has input pending, not reusable")); dead = TRUE; } Curl_detach_connection(data); } if(dead) { - infof(data, "Connection %" CURL_FORMAT_CURL_OFF_T " seems to be dead", + /* remove connection from cpool */ + infof(data, "Connection %" FMT_OFF_T " seems to be dead", conn->connection_id); - Curl_conncache_remove_conn(data, conn, FALSE); return TRUE; } } return FALSE; } -struct prunedead { - struct Curl_easy *data; - struct connectdata *extracted; -}; - -/* - * Wrapper to use extract_if_dead() function in Curl_conncache_foreach() - * - */ -static int call_extract_if_dead(struct Curl_easy *data, - struct connectdata *conn, void *param) +CURLcode Curl_conn_upkeep(struct Curl_easy *data, + struct connectdata *conn, + struct curltime *now) { - struct prunedead *p = (struct prunedead *)param; - if(extract_if_dead(conn, data)) { - /* stop the iteration here, pass back the connection that was extracted */ - p->extracted = conn; - return 1; + CURLcode result = CURLE_OK; + if(Curl_timediff(*now, conn->keepalive) <= data->set.upkeep_interval_ms) + return result; + + /* briefly attach for action */ + Curl_attach_connection(data, conn); + if(conn->handler->connection_check) { + /* Do a protocol-specific keepalive check on the connection. */ + unsigned int rc; + rc = conn->handler->connection_check(data, conn, CONNCHECK_KEEPALIVE); + if(rc & CONNRESULT_DEAD) + result = CURLE_RECV_ERROR; } - return 0; /* continue iteration */ -} - -/* - * This function scans the connection cache for half-open/dead connections, - * closes and removes them. The cleanup is done at most once per second. - * - * When called, this transfer has no connection attached. - */ -static void prune_dead_connections(struct Curl_easy *data) -{ - struct curltime now = Curl_now(); - timediff_t elapsed; - - DEBUGASSERT(!data->conn); /* no connection */ - CONNCACHE_LOCK(data); - elapsed = - Curl_timediff(now, data->state.conn_cache->last_cleanup); - CONNCACHE_UNLOCK(data); - - if(elapsed >= 1000L) { - struct prunedead prune; - prune.data = data; - prune.extracted = NULL; - while(Curl_conncache_foreach(data, data->state.conn_cache, &prune, - call_extract_if_dead)) { - /* unlocked */ - - /* remove connection from cache */ - Curl_conncache_remove_conn(data, prune.extracted, TRUE); - - /* disconnect it */ - Curl_disconnect(data, prune.extracted, TRUE); - } - CONNCACHE_LOCK(data); - data->state.conn_cache->last_cleanup = now; - CONNCACHE_UNLOCK(data); + else { + /* Do the generic action on the FIRSTSOCKET filter chain */ + result = Curl_conn_keep_alive(data, conn, FIRSTSOCKET); } + Curl_detach_connection(data); + + conn->keepalive = *now; + return result; } #ifdef USE_SSH @@ -901,6 +846,384 @@ static bool ssh_config_matches(struct connectdata *one, #define ssh_config_matches(x,y) FALSE #endif +struct url_conn_match { + struct connectdata *found; + struct Curl_easy *data; + struct connectdata *needle; + BIT(may_multiplex); + BIT(want_ntlm_http); + BIT(want_proxy_ntlm_http); + + BIT(wait_pipe); + BIT(force_reuse); + BIT(seen_pending_conn); + BIT(seen_single_use_conn); + BIT(seen_multiplex_conn); +}; + +static bool url_match_conn(struct connectdata *conn, void *userdata) +{ + struct url_conn_match *match = userdata; + struct Curl_easy *data = match->data; + struct connectdata *needle = match->needle; + + /* Check if `conn` can be used for transfer `data` */ + + if(conn->connect_only || conn->bits.close) + /* connect-only or to-be-closed connections will not be reused */ + return FALSE; + + if(data->set.ipver != CURL_IPRESOLVE_WHATEVER + && data->set.ipver != conn->ip_version) { + /* skip because the connection is not via the requested IP version */ + return FALSE; + } + + if(needle->localdev || needle->localport) { + /* If we are bound to a specific local end (IP+port), we must not reuse a + random other one, although if we did not ask for a particular one we + can reuse one that was bound. + + This comparison is a bit rough and too strict. Since the input + parameters can be specified in numerous ways and still end up the same + it would take a lot of processing to make it really accurate. Instead, + this matching will assume that reuses of bound connections will most + likely also reuse the exact same binding parameters and missing out a + few edge cases should not hurt anyone much. + */ + if((conn->localport != needle->localport) || + (conn->localportrange != needle->localportrange) || + (needle->localdev && + (!conn->localdev || strcmp(conn->localdev, needle->localdev)))) + return FALSE; + } + + if(needle->bits.conn_to_host != conn->bits.conn_to_host) + /* do not mix connections that use the "connect to host" feature and + * connections that do not use this feature */ + return FALSE; + + if(needle->bits.conn_to_port != conn->bits.conn_to_port) + /* do not mix connections that use the "connect to port" feature and + * connections that do not use this feature */ + return FALSE; + + if(!Curl_conn_is_connected(conn, FIRSTSOCKET) || + conn->bits.asks_multiplex) { + /* Not yet connected, or not yet decided if it multiplexes. The later + * happens for HTTP/2 Upgrade: requests that need a response. */ + if(match->may_multiplex) { + match->seen_pending_conn = TRUE; + /* Do not pick a connection that has not connected yet */ + infof(data, "Connection #%" FMT_OFF_T + " is not open enough, cannot reuse", conn->connection_id); + } + /* Do not pick a connection that has not connected yet */ + return FALSE; + } + /* `conn` is connected. If it has transfers, can we add ours to it? */ + + if(CONN_INUSE(conn)) { + if(!conn->bits.multiplex) { + /* conn busy and conn cannot take more transfers */ + match->seen_single_use_conn = TRUE; + return FALSE; + } + match->seen_multiplex_conn = TRUE; + if(!match->may_multiplex) + /* conn busy and transfer cannot be multiplexed */ + return FALSE; + else { + /* transfer and conn multiplex. Are they on the same multi? */ + struct Curl_llist_node *e = Curl_llist_head(&conn->easyq); + struct Curl_easy *entry = Curl_node_elem(e); + if(entry->multi != data->multi) + return FALSE; + } + } + /* `conn` is connected and we could add the transfer to it, if + * all the other criteria do match. */ + + /* Does `conn` use the correct protocol? */ +#ifdef USE_UNIX_SOCKETS + if(needle->unix_domain_socket) { + if(!conn->unix_domain_socket) + return FALSE; + if(strcmp(needle->unix_domain_socket, conn->unix_domain_socket)) + return FALSE; + if(needle->bits.abstract_unix_socket != conn->bits.abstract_unix_socket) + return FALSE; + } + else if(conn->unix_domain_socket) + return FALSE; +#endif + + if((needle->handler->flags&PROTOPT_SSL) != + (conn->handler->flags&PROTOPT_SSL)) + /* do not do mixed SSL and non-SSL connections */ + if(get_protocol_family(conn->handler) != + needle->handler->protocol || !conn->bits.tls_upgraded) + /* except protocols that have been upgraded via TLS */ + return FALSE; + +#ifndef CURL_DISABLE_PROXY + if(needle->bits.httpproxy != conn->bits.httpproxy || + needle->bits.socksproxy != conn->bits.socksproxy) + return FALSE; + + if(needle->bits.socksproxy && + !socks_proxy_info_matches(&needle->socks_proxy, + &conn->socks_proxy)) + return FALSE; + + if(needle->bits.httpproxy) { + if(needle->bits.tunnel_proxy != conn->bits.tunnel_proxy) + return FALSE; + + if(!proxy_info_matches(&needle->http_proxy, &conn->http_proxy)) + return FALSE; + + if(IS_HTTPS_PROXY(needle->http_proxy.proxytype)) { + /* https proxies come in different types, http/1.1, h2, ... */ + if(needle->http_proxy.proxytype != conn->http_proxy.proxytype) + return FALSE; + /* match SSL config to proxy */ + if(!Curl_ssl_conn_config_match(data, conn, TRUE)) { + DEBUGF(infof(data, + "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 + * further below */ + } + } +#endif + + if(match->may_multiplex && + (data->state.httpwant == CURL_HTTP_VERSION_2_0) && + (needle->handler->protocol & CURLPROTO_HTTP) && + !conn->httpversion) { + if(data->set.pipewait) { + infof(data, "Server upgrade does not support multiplex yet, wait"); + match->found = NULL; + match->wait_pipe = TRUE; + return TRUE; /* stop searching, we want to wait */ + } + infof(data, "Server upgrade cannot be used"); + return FALSE; + } + + if(!(needle->handler->flags & PROTOPT_CREDSPERREQUEST)) { + /* This protocol requires credentials per connection, + so verify that we are using the same name and password as well */ + if(Curl_timestrcmp(needle->user, conn->user) || + Curl_timestrcmp(needle->passwd, conn->passwd) || + Curl_timestrcmp(needle->sasl_authzid, conn->sasl_authzid) || + Curl_timestrcmp(needle->oauth_bearer, conn->oauth_bearer)) { + /* one of them was different */ + return FALSE; + } + } + + /* GSS delegation differences do not actually affect every connection + and auth method, but this check takes precaution before efficiency */ + if(needle->gssapi_delegation != conn->gssapi_delegation) + return FALSE; + + /* If looking for HTTP and the HTTP version we want is less + * than the HTTP version of conn, continue looking. + * CURL_HTTP_VERSION_2TLS is default which indicates no preference, + * so we take any existing connection. */ + if((needle->handler->protocol & PROTO_FAMILY_HTTP) && + (data->state.httpwant != CURL_HTTP_VERSION_2TLS)) { + if((conn->httpversion >= 20) && + (data->state.httpwant < CURL_HTTP_VERSION_2_0)) { + DEBUGF(infof(data, "nor reusing conn #%" CURL_FORMAT_CURL_OFF_T + " with httpversion=%d, we want a version less than h2", + conn->connection_id, conn->httpversion)); + } + if((conn->httpversion >= 30) && + (data->state.httpwant < CURL_HTTP_VERSION_3)) { + DEBUGF(infof(data, "nor reusing conn #%" CURL_FORMAT_CURL_OFF_T + " with httpversion=%d, we want a version less than h3", + conn->connection_id, conn->httpversion)); + return FALSE; + } + } +#ifdef USE_SSH + else if(get_protocol_family(needle->handler) & PROTO_FAMILY_SSH) { + if(!ssh_config_matches(needle, conn)) + return FALSE; + } +#endif +#ifndef CURL_DISABLE_FTP + else if(get_protocol_family(needle->handler) & PROTO_FAMILY_FTP) { + /* Also match ACCOUNT, ALTERNATIVE-TO-USER, USE_SSL and CCC options */ + if(Curl_timestrcmp(needle->proto.ftpc.account, + conn->proto.ftpc.account) || + Curl_timestrcmp(needle->proto.ftpc.alternative_to_user, + conn->proto.ftpc.alternative_to_user) || + (needle->proto.ftpc.use_ssl != conn->proto.ftpc.use_ssl) || + (needle->proto.ftpc.ccc != conn->proto.ftpc.ccc)) + return FALSE; + } +#endif + + /* Additional match requirements if talking TLS OR + * not talking to an HTTP proxy OR using a tunnel through a proxy */ + if((needle->handler->flags&PROTOPT_SSL) +#ifndef CURL_DISABLE_PROXY + || !needle->bits.httpproxy || needle->bits.tunnel_proxy +#endif + ) { + /* Talking the same protocol scheme or a TLS upgraded protocol in the + * same protocol family? */ + if(!strcasecompare(needle->handler->scheme, conn->handler->scheme) && + (get_protocol_family(conn->handler) != + needle->handler->protocol || !conn->bits.tls_upgraded)) + return FALSE; + + /* If needle has "conn_to_*" set, conn must match this */ + if((needle->bits.conn_to_host && !strcasecompare( + needle->conn_to_host.name, conn->conn_to_host.name)) || + (needle->bits.conn_to_port && + needle->conn_to_port != conn->conn_to_port)) + return FALSE; + + /* hostname and port must match */ + if(!strcasecompare(needle->host.name, conn->host.name) || + needle->remote_port != conn->remote_port) + return FALSE; + + /* If talking TLS, conn needs to use the same SSL options. */ + if((needle->handler->flags & PROTOPT_SSL) && + !Curl_ssl_conn_config_match(data, conn, FALSE)) { + DEBUGF(infof(data, + "Connection #%" FMT_OFF_T + " has different SSL parameters, cannot reuse", + conn->connection_id)); + return FALSE; + } + } + +#if defined(USE_NTLM) + /* If we are looking for an HTTP+NTLM connection, check if this is + already authenticating with the right credentials. If not, keep + looking so that we can reuse NTLM connections if + possible. (Especially we must not reuse the same connection if + partway through a handshake!) */ + if(match->want_ntlm_http) { + if(Curl_timestrcmp(needle->user, conn->user) || + Curl_timestrcmp(needle->passwd, conn->passwd)) { + + /* we prefer a credential match, but this is at least a connection + that can be reused and "upgraded" to NTLM */ + if(conn->http_ntlm_state == NTLMSTATE_NONE) + match->found = conn; + return FALSE; + } + } + else if(conn->http_ntlm_state != NTLMSTATE_NONE) { + /* Connection is using NTLM auth but we do not want NTLM */ + return FALSE; + } + +#ifndef CURL_DISABLE_PROXY + /* Same for Proxy NTLM authentication */ + if(match->want_proxy_ntlm_http) { + /* Both conn->http_proxy.user and conn->http_proxy.passwd can be + * NULL */ + if(!conn->http_proxy.user || !conn->http_proxy.passwd) + return FALSE; + + if(Curl_timestrcmp(needle->http_proxy.user, + conn->http_proxy.user) || + Curl_timestrcmp(needle->http_proxy.passwd, + conn->http_proxy.passwd)) + return FALSE; + } + else if(conn->proxy_ntlm_state != NTLMSTATE_NONE) { + /* Proxy connection is using NTLM auth but we do not want NTLM */ + return FALSE; + } +#endif + if(match->want_ntlm_http || match->want_proxy_ntlm_http) { + /* Credentials are already checked, we may use this connection. + * With NTLM being weird as it is, we MUST use a + * connection where it has already been fully negotiated. + * If it has not, we keep on looking for a better one. */ + match->found = conn; + + if((match->want_ntlm_http && + (conn->http_ntlm_state != NTLMSTATE_NONE)) || + (match->want_proxy_ntlm_http && + (conn->proxy_ntlm_state != NTLMSTATE_NONE))) { + /* We must use this connection, no other */ + match->force_reuse = TRUE; + return TRUE; + } + /* Continue look up for a better connection */ + return FALSE; + } +#endif + + if(CONN_INUSE(conn)) { + DEBUGASSERT(match->may_multiplex); + DEBUGASSERT(conn->bits.multiplex); + /* If multiplexed, make sure we do not go over concurrency limit */ + if(CONN_INUSE(conn) >= + Curl_multi_max_concurrent_streams(data->multi)) { + infof(data, "client side MAX_CONCURRENT_STREAMS reached" + ", skip (%zu)", CONN_INUSE(conn)); + return FALSE; + } + if(CONN_INUSE(conn) >= + Curl_conn_get_max_concurrent(data, conn, FIRSTSOCKET)) { + infof(data, "MAX_CONCURRENT_STREAMS reached, skip (%zu)", + CONN_INUSE(conn)); + return FALSE; + } + /* When not multiplexed, we have a match here! */ + infof(data, "Multiplexed connection found"); + } + else if(Curl_conn_seems_dead(conn, data, NULL)) { + /* removed and disconnect. Do not treat as aborted. */ + Curl_cpool_disconnect(data, conn, FALSE); + return FALSE; + } + + /* We have found a connection. Let's stop searching. */ + match->found = conn; + return TRUE; +} + +static bool url_match_result(bool result, void *userdata) +{ + struct url_conn_match *match = userdata; + (void)result; + if(match->found) { + /* Attach it now while still under lock, so the connection does + * no longer appear idle and can be reaped. */ + Curl_attach_connection(match->data, match->found); + 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 + * no multiplexed one. It seems safe to assume that the server does + * not support multiplexing. */ + match->wait_pipe = FALSE; + } + else if(match->seen_pending_conn && match->data->set.pipewait) { + infof(match->data, + "Found pending candidate for reuse and CURLOPT_PIPEWAIT is set"); + match->wait_pipe = TRUE; + } + match->force_reuse = FALSE; + return FALSE; +} + /* * Given one filled in connection struct (named needle), this function should * detect if there already is one that has all the significant details @@ -919,408 +1242,36 @@ ConnectionExists(struct Curl_easy *data, bool *force_reuse, bool *waitpipe) { - struct connectdata *chosen = NULL; - bool foundPendingCandidate = FALSE; - bool canmultiplex = FALSE; - struct connectbundle *bundle; - struct Curl_llist_element *curr; + struct url_conn_match match; + bool result; + + memset(&match, 0, sizeof(match)); + match.data = data; + match.needle = needle; + match.may_multiplex = xfer_may_multiplex(data, needle); #ifdef USE_NTLM - bool wantNTLMhttp = ((data->state.authhost.want & - (CURLAUTH_NTLM | CURLAUTH_NTLM_WB)) && - (needle->handler->protocol & PROTO_FAMILY_HTTP)); + match.want_ntlm_http = ((data->state.authhost.want & CURLAUTH_NTLM) && + (needle->handler->protocol & PROTO_FAMILY_HTTP)); #ifndef CURL_DISABLE_PROXY - bool wantProxyNTLMhttp = (needle->bits.proxy_user_passwd && - ((data->state.authproxy.want & - (CURLAUTH_NTLM | CURLAUTH_NTLM_WB)) && - (needle->handler->protocol & PROTO_FAMILY_HTTP))); -#else - bool wantProxyNTLMhttp = FALSE; + match.want_proxy_ntlm_http = + (needle->bits.proxy_user_passwd && + (data->state.authproxy.want & CURLAUTH_NTLM) && + (needle->handler->protocol & PROTO_FAMILY_HTTP)); #endif #endif - /* plain HTTP with upgrade */ - bool h2upgrade = (data->state.httpwant == CURL_HTTP_VERSION_2_0) && - (needle->handler->protocol & CURLPROTO_HTTP); - *usethis = NULL; - *force_reuse = FALSE; - *waitpipe = FALSE; + /* Find a connection in the pool that matches what "data + needle" + * requires. If a suitable candidate is found, it is attached to "data". */ + result = Curl_cpool_find(data, needle->destination, needle->destination_len, + url_match_conn, url_match_result, &match); - /* Look up the bundle with all the connections to this particular host. - Locks the connection cache, beware of early returns! */ - bundle = Curl_conncache_find_bundle(data, needle, data->state.conn_cache); - if(!bundle) { - CONNCACHE_UNLOCK(data); - return FALSE; - } - infof(data, "Found bundle for host: %p [%s]", - (void *)bundle, (bundle->multiuse == BUNDLE_MULTIPLEX ? - "can multiplex" : "serially")); - - /* We can only multiplex iff the transfer allows it AND we know - * that the server we want to talk to supports it as well. */ - canmultiplex = FALSE; - if(IsMultiplexingPossible(data, needle)) { - if(bundle->multiuse == BUNDLE_UNKNOWN) { - if(data->set.pipewait) { - infof(data, "Server doesn't support multiplex yet, wait"); - *waitpipe = TRUE; - CONNCACHE_UNLOCK(data); - return FALSE; /* no reuse */ - } - infof(data, "Server doesn't support multiplex (yet)"); - } - else if(bundle->multiuse == BUNDLE_MULTIPLEX) { - if(Curl_multiplex_wanted(data->multi)) - canmultiplex = TRUE; - else - infof(data, "Could multiplex, but not asked to"); - } - else if(bundle->multiuse == BUNDLE_NO_MULTIUSE) { - infof(data, "Can not multiplex, even if we wanted to"); - } - } - - curr = bundle->conn_list.head; - while(curr) { - struct connectdata *check = curr->ptr; - /* Get next node now. We might remove a dead `check` connection which - * would invalidate `curr` as well. */ - curr = curr->next; - - /* Note that if we use an HTTP proxy in normal mode (no tunneling), we - * check connections to that proxy and not to the actual remote server. - */ - if(check->connect_only || check->bits.close) - /* connect-only or to-be-closed connections will not be reused */ - continue; - - if(data->set.ipver != CURL_IPRESOLVE_WHATEVER - && data->set.ipver != check->ip_version) { - /* skip because the connection is not via the requested IP version */ - continue; - } - - if(!canmultiplex) { - if(Curl_resolver_asynch() && - /* primary_ip[0] is NUL only if the resolving of the name hasn't - completed yet and until then we don't reuse this connection */ - !check->primary_ip[0]) - continue; - } - - if(CONN_INUSE(check)) { - if(!canmultiplex) { - /* transfer can't be multiplexed and check is in use */ - continue; - } - else { - /* Could multiplex, but not when check belongs to another multi */ - struct Curl_llist_element *e = check->easyq.head; - struct Curl_easy *entry = e->ptr; - if(entry->multi != data->multi) - continue; - } - } - - if(!Curl_conn_is_connected(check, FIRSTSOCKET)) { - foundPendingCandidate = TRUE; - /* Don't pick a connection that hasn't connected yet */ - infof(data, "Connection #%" CURL_FORMAT_CURL_OFF_T - " isn't open enough, can't reuse", check->connection_id); - continue; - } - - /* `check` is connected. if it is in use and does not support multiplex, - * we cannot use it. */ - if(!check->bits.multiplex && CONN_INUSE(check)) - continue; - -#ifdef USE_UNIX_SOCKETS - if(needle->unix_domain_socket) { - if(!check->unix_domain_socket) - continue; - if(strcmp(needle->unix_domain_socket, check->unix_domain_socket)) - continue; - if(needle->bits.abstract_unix_socket != - check->bits.abstract_unix_socket) - continue; - } - else if(check->unix_domain_socket) - continue; -#endif - - if((needle->handler->flags&PROTOPT_SSL) != - (check->handler->flags&PROTOPT_SSL)) - /* don't do mixed SSL and non-SSL connections */ - if(get_protocol_family(check->handler) != - needle->handler->protocol || !check->bits.tls_upgraded) - /* except protocols that have been upgraded via TLS */ - continue; - - if(needle->bits.conn_to_host != check->bits.conn_to_host) - /* don't mix connections that use the "connect to host" feature and - * connections that don't use this feature */ - continue; - - if(needle->bits.conn_to_port != check->bits.conn_to_port) - /* don't mix connections that use the "connect to port" feature and - * connections that don't use this feature */ - continue; - -#ifndef CURL_DISABLE_PROXY - if(needle->bits.httpproxy != check->bits.httpproxy || - needle->bits.socksproxy != check->bits.socksproxy) - continue; - - if(needle->bits.socksproxy && - !socks_proxy_info_matches(&needle->socks_proxy, - &check->socks_proxy)) - continue; - - if(needle->bits.httpproxy) { - if(needle->bits.tunnel_proxy != check->bits.tunnel_proxy) - continue; - - if(!proxy_info_matches(&needle->http_proxy, &check->http_proxy)) - continue; - - if(IS_HTTPS_PROXY(needle->http_proxy.proxytype)) { - /* https proxies come in different types, http/1.1, h2, ... */ - if(needle->http_proxy.proxytype != check->http_proxy.proxytype) - continue; - /* match SSL config to proxy */ - if(!Curl_ssl_conn_config_match(data, check, TRUE)) { - DEBUGF(infof(data, - "Connection #%" CURL_FORMAT_CURL_OFF_T - " has different SSL proxy parameters, can't reuse", - check->connection_id)); - continue; - } - /* the SSL config to the server, which may apply here is checked - * further below */ - } - } -#endif - - if(h2upgrade && !check->httpversion && canmultiplex) { - if(data->set.pipewait) { - infof(data, "Server upgrade doesn't support multiplex yet, wait"); - *waitpipe = TRUE; - CONNCACHE_UNLOCK(data); - return FALSE; /* no reuse */ - } - infof(data, "Server upgrade cannot be used"); - continue; /* can't be used atm */ - } - - if(needle->localdev || needle->localport) { - /* If we are bound to a specific local end (IP+port), we must not - reuse a random other one, although if we didn't ask for a - particular one we can reuse one that was bound. - - This comparison is a bit rough and too strict. Since the input - parameters can be specified in numerous ways and still end up the - same it would take a lot of processing to make it really accurate. - Instead, this matching will assume that reuses of bound connections - will most likely also reuse the exact same binding parameters and - missing out a few edge cases shouldn't hurt anyone very much. - */ - if((check->localport != needle->localport) || - (check->localportrange != needle->localportrange) || - (needle->localdev && - (!check->localdev || strcmp(check->localdev, needle->localdev)))) - continue; - } - - if(!(needle->handler->flags & PROTOPT_CREDSPERREQUEST)) { - /* This protocol requires credentials per connection, - so verify that we're using the same name and password as well */ - if(Curl_timestrcmp(needle->user, check->user) || - Curl_timestrcmp(needle->passwd, check->passwd) || - Curl_timestrcmp(needle->sasl_authzid, check->sasl_authzid) || - Curl_timestrcmp(needle->oauth_bearer, check->oauth_bearer)) { - /* one of them was different */ - continue; - } - } - - /* GSS delegation differences do not actually affect every connection - and auth method, but this check takes precaution before efficiency */ - if(needle->gssapi_delegation != check->gssapi_delegation) - continue; - - /* If looking for HTTP and the HTTP version we want is less - * than the HTTP version of the check connection, continue looking */ - if((needle->handler->protocol & PROTO_FAMILY_HTTP) && - (((check->httpversion >= 20) && - (data->state.httpwant < CURL_HTTP_VERSION_2_0)) - || ((check->httpversion >= 30) && - (data->state.httpwant < CURL_HTTP_VERSION_3)))) - continue; -#ifdef USE_SSH - else if(get_protocol_family(needle->handler) & PROTO_FAMILY_SSH) { - if(!ssh_config_matches(needle, check)) - continue; - } -#endif -#ifndef CURL_DISABLE_FTP - else if(get_protocol_family(needle->handler) & PROTO_FAMILY_FTP) { - /* Also match ACCOUNT, ALTERNATIVE-TO-USER, USE_SSL and CCC options */ - if(Curl_timestrcmp(needle->proto.ftpc.account, - check->proto.ftpc.account) || - Curl_timestrcmp(needle->proto.ftpc.alternative_to_user, - check->proto.ftpc.alternative_to_user) || - (needle->proto.ftpc.use_ssl != check->proto.ftpc.use_ssl) || - (needle->proto.ftpc.ccc != check->proto.ftpc.ccc)) - continue; - } -#endif - - /* Additional match requirements if talking TLS OR - * not talking to a HTTP proxy OR using a tunnel through a proxy */ - if((needle->handler->flags&PROTOPT_SSL) -#ifndef CURL_DISABLE_PROXY - || !needle->bits.httpproxy || needle->bits.tunnel_proxy -#endif - ) { - /* Talking the same protocol scheme or a TLS upgraded protocol in the - * same protocol family? */ - if(!strcasecompare(needle->handler->scheme, check->handler->scheme) && - (get_protocol_family(check->handler) != - needle->handler->protocol || !check->bits.tls_upgraded)) - continue; - - /* If needle has "conn_to_*" set, check must match this */ - if((needle->bits.conn_to_host && !strcasecompare( - needle->conn_to_host.name, check->conn_to_host.name)) || - (needle->bits.conn_to_port && - needle->conn_to_port != check->conn_to_port)) - continue; - - /* hostname and port must match */ - if(!strcasecompare(needle->host.name, check->host.name) || - needle->remote_port != check->remote_port) - continue; - - /* If talking TLS, check needs to use the same SSL options. */ - if((needle->handler->flags & PROTOPT_SSL) && - !Curl_ssl_conn_config_match(data, check, FALSE)) { - DEBUGF(infof(data, - "Connection #%" CURL_FORMAT_CURL_OFF_T - " has different SSL parameters, can't reuse", - check->connection_id)); - continue; - } - } - -#if defined(USE_NTLM) - /* If we are looking for an HTTP+NTLM connection, check if this is - already authenticating with the right credentials. If not, keep - looking so that we can reuse NTLM connections if - possible. (Especially we must not reuse the same connection if - partway through a handshake!) */ - if(wantNTLMhttp) { - if(Curl_timestrcmp(needle->user, check->user) || - Curl_timestrcmp(needle->passwd, check->passwd)) { - - /* we prefer a credential match, but this is at least a connection - that can be reused and "upgraded" to NTLM */ - if(check->http_ntlm_state == NTLMSTATE_NONE) - chosen = check; - continue; - } - } - else if(check->http_ntlm_state != NTLMSTATE_NONE) { - /* Connection is using NTLM auth but we don't want NTLM */ - continue; - } - -#ifndef CURL_DISABLE_PROXY - /* Same for Proxy NTLM authentication */ - if(wantProxyNTLMhttp) { - /* Both check->http_proxy.user and check->http_proxy.passwd can be - * NULL */ - if(!check->http_proxy.user || !check->http_proxy.passwd) - continue; - - if(Curl_timestrcmp(needle->http_proxy.user, - check->http_proxy.user) || - Curl_timestrcmp(needle->http_proxy.passwd, - check->http_proxy.passwd)) - continue; - } - else if(check->proxy_ntlm_state != NTLMSTATE_NONE) { - /* Proxy connection is using NTLM auth but we don't want NTLM */ - continue; - } -#endif - if(wantNTLMhttp || wantProxyNTLMhttp) { - /* Credentials are already checked, we may use this connection. - * With NTLM being weird as it is, we MUST use a - * connection where it has already been fully negotiated. - * If it has not, we keep on looking for a better one. */ - chosen = check; - - if((wantNTLMhttp && - (check->http_ntlm_state != NTLMSTATE_NONE)) || - (wantProxyNTLMhttp && - (check->proxy_ntlm_state != NTLMSTATE_NONE))) { - /* We must use this connection, no other */ - *force_reuse = TRUE; - break; - } - /* Continue look up for a better connection */ - continue; - } -#endif - - if(CONN_INUSE(check)) { - DEBUGASSERT(canmultiplex); - DEBUGASSERT(check->bits.multiplex); - /* If multiplexed, make sure we don't go over concurrency limit */ - if(CONN_INUSE(check) >= - Curl_multi_max_concurrent_streams(data->multi)) { - infof(data, "client side MAX_CONCURRENT_STREAMS reached" - ", skip (%zu)", CONN_INUSE(check)); - continue; - } - if(CONN_INUSE(check) >= - Curl_conn_get_max_concurrent(data, check, FIRSTSOCKET)) { - infof(data, "MAX_CONCURRENT_STREAMS reached, skip (%zu)", - CONN_INUSE(check)); - continue; - } - /* When not multiplexed, we have a match here! */ - infof(data, "Multiplexed connection found"); - } - else if(extract_if_dead(check, data)) { - /* disconnect it */ - Curl_disconnect(data, check, TRUE); - continue; - } - - /* We have found a connection. Let's stop searching. */ - chosen = check; - break; - } /* loop over connection bundle */ - - if(chosen) { - /* mark it as used before releasing the lock */ - Curl_attach_connection(data, chosen); - CONNCACHE_UNLOCK(data); - *usethis = chosen; - return TRUE; /* yes, we found one to use! */ - } - CONNCACHE_UNLOCK(data); - - if(foundPendingCandidate && data->set.pipewait) { - infof(data, - "Found pending candidate for reuse and CURLOPT_PIPEWAIT is set"); - *waitpipe = TRUE; - } - - return FALSE; /* no matching connecting exists */ + /* wait_pipe is TRUE if we encounter a bundle that is undecided. There + * is no matching connection then, yet. */ + *usethis = match.found; + *force_reuse = match.force_reuse; + *waitpipe = match.wait_pipe; + return result; } /* @@ -1328,11 +1279,30 @@ ConnectionExists(struct Curl_easy *data, */ #ifndef CURL_DISABLE_VERBOSE_STRINGS void Curl_verboseconnect(struct Curl_easy *data, - struct connectdata *conn) + struct connectdata *conn, int sockindex) { - if(data->set.verbose) + if(data->set.verbose && sockindex == SECONDARYSOCKET) + infof(data, "Connected 2nd connection to %s port %u", + conn->secondary.remote_ip, conn->secondary.remote_port); + else infof(data, "Connected to %s (%s) port %u", - CURL_CONN_HOST_DISPNAME(conn), conn->primary_ip, conn->port); + CURL_CONN_HOST_DISPNAME(conn), conn->primary.remote_ip, + conn->primary.remote_port); +#if !defined(CURL_DISABLE_HTTP) + if(conn->handler->protocol & PROTO_FAMILY_HTTP) { + switch(conn->alpn) { + case CURL_HTTP_VERSION_3: + infof(data, "using HTTP/3"); + break; + case CURL_HTTP_VERSION_2: + infof(data, "using HTTP/2"); + break; + default: + infof(data, "using HTTP/1.x"); + break; + } + } +#endif } #endif @@ -1352,10 +1322,10 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->sockfd = CURL_SOCKET_BAD; conn->writesockfd = CURL_SOCKET_BAD; conn->connection_id = -1; /* no ID */ - conn->port = -1; /* unknown at this point */ + conn->primary.remote_port = -1; /* unknown at this point */ conn->remote_port = -1; /* unknown at this point */ - /* Default protocol-independent behavior doesn't support persistent + /* 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"); @@ -1373,22 +1343,19 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) /* note that these two proxy bits are now just on what looks to be requested, they may be altered down the road */ conn->bits.proxy = (data->set.str[STRING_PROXY] && - *data->set.str[STRING_PROXY]) ? TRUE : FALSE; + *data->set.str[STRING_PROXY]); conn->bits.httpproxy = (conn->bits.proxy && (conn->http_proxy.proxytype == CURLPROXY_HTTP || conn->http_proxy.proxytype == CURLPROXY_HTTP_1_0 || - IS_HTTPS_PROXY(conn->http_proxy.proxytype))) ? - TRUE : FALSE; - conn->bits.socksproxy = (conn->bits.proxy && - !conn->bits.httpproxy) ? TRUE : FALSE; + IS_HTTPS_PROXY(conn->http_proxy.proxytype))); + conn->bits.socksproxy = (conn->bits.proxy && !conn->bits.httpproxy); if(data->set.str[STRING_PRE_PROXY] && *data->set.str[STRING_PRE_PROXY]) { conn->bits.proxy = TRUE; conn->bits.socksproxy = TRUE; } - conn->bits.proxy_user_passwd = - (data->state.aptr.proxyuser) ? TRUE : FALSE; + conn->bits.proxy_user_passwd = !!data->state.aptr.proxyuser; conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy; #endif /* CURL_DISABLE_PROXY */ @@ -1400,12 +1367,6 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->connect_only = data->set.connect_only; conn->transport = TRNSPRT_TCP; /* most of them are TCP streams */ -#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) && \ - defined(NTLM_WB_ENABLED) - conn->ntlm.ntlm_auth_hlpr_socket = CURL_SOCKET_BAD; - conn->proxyntlm.ntlm_auth_hlpr_socket = CURL_SOCKET_BAD; -#endif - /* Initialize the easy handle list */ Curl_llist_init(&conn->easyq, NULL); @@ -1547,7 +1508,7 @@ const struct Curl_handler *Curl_getn_scheme_handler(const char *scheme, #else NULL, #endif -#if defined(USE_WEBSOCKETS) && \ +#if !defined(CURL_DISABLE_WEBSOCKETS) && \ defined(USE_SSL) && !defined(CURL_DISABLE_HTTP) &Curl_handler_wss, #else @@ -1616,7 +1577,7 @@ const struct Curl_handler *Curl_getn_scheme_handler(const char *scheme, NULL, #endif NULL, -#if defined(USE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) &Curl_handler_ws, #else NULL, @@ -1647,7 +1608,7 @@ const struct Curl_handler *Curl_getn_scheme_handler(const char *scheme, unsigned int c = 978; while(l) { c <<= 5; - c += Curl_raw_tolower(*s); + c += (unsigned int)Curl_raw_tolower(*s); s++; l--; } @@ -1682,7 +1643,7 @@ static CURLcode findprotocol(struct Curl_easy *data, } } - /* The protocol was not found in the table, but we don't have to assign it + /* The protocol was not found in the table, but we do not have to assign it to anything since it is already assigned to a dummy-struct in the create_conn() function when the connectdata struct is allocated. */ failf(data, "Protocol \"%s\" %s%s", protostr, @@ -1707,7 +1668,7 @@ CURLcode Curl_uc_to_curlcode(CURLUcode uc) } } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 /* * If the URL was set with an IPv6 numerical address with a zone id part, set * the scope_id based on that! @@ -1800,12 +1761,12 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, if(!use_set_uh) { char *newurl; - uc = curl_url_set(uh, CURLUPART_URL, data->state.url, - CURLU_GUESS_SCHEME | - CURLU_NON_SUPPORT_SCHEME | - (data->set.disallow_username_in_url ? - CURLU_DISALLOW_USER : 0) | - (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)); + uc = curl_url_set(uh, CURLUPART_URL, data->state.url, (unsigned int) + (CURLU_GUESS_SCHEME | + CURLU_NON_SUPPORT_SCHEME | + (data->set.disallow_username_in_url ? + CURLU_DISALLOW_USER : 0) | + (data->set.path_as_is ? CURLU_PATH_AS_IS : 0))); if(uc) { failf(data, "URL rejected: %s", curl_url_strerror(uc)); return Curl_uc_to_curlcode(uc); @@ -1831,7 +1792,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; } else if(strlen(data->state.up.hostname) > MAX_URL_LEN) { - failf(data, "Too long host name (maximum is %d)", MAX_URL_LEN); + failf(data, "Too long hostname (maximum is %d)", MAX_URL_LEN); return CURLE_URL_MALFORMAT; } hostname = data->state.up.hostname; @@ -1849,7 +1810,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, zonefrom_url(uh, data, conn); } - /* make sure the connect struct gets its own copy of the host name */ + /* make sure the connect struct gets its own copy of the hostname */ conn->host.rawalloc = strdup(hostname ? hostname : ""); if(!conn->host.rawalloc) return CURLE_OUT_OF_MEMORY; @@ -1896,10 +1857,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, return result; /* - * User name and password set with their own options override the - * credentials possibly set in the URL. + * username and password set with their own options override the credentials + * possibly set in the URL, but netrc does not. */ - if(!data->set.str[STRING_PASSWORD]) { + if(!data->state.aptr.passwd || (data->state.creds_from != CREDS_OPTION)) { uc = curl_url_get(uh, CURLUPART_PASSWORD, &data->state.up.password, 0); if(!uc) { char *decoded; @@ -1912,13 +1873,14 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, result = Curl_setstropt(&data->state.aptr.passwd, decoded); if(result) return result; + data->state.creds_from = CREDS_URL; } else if(uc != CURLUE_NO_PASSWORD) return Curl_uc_to_curlcode(uc); } - if(!data->set.str[STRING_USERNAME]) { - /* we don't use the URL API's URL decoder option here since it rejects + if(!data->state.aptr.user || (data->state.creds_from != CREDS_OPTION)) { + /* we do not use the URL API's URL decoder option here since it rejects control codes and we want to allow them for some schemes in the user and password fields */ uc = curl_url_get(uh, CURLUPART_USER, &data->state.up.user, 0); @@ -1931,13 +1893,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, return result; conn->user = decoded; result = Curl_setstropt(&data->state.aptr.user, decoded); + data->state.creds_from = CREDS_URL; } else if(uc != CURLUE_NO_USER) return Curl_uc_to_curlcode(uc); - else if(data->state.aptr.passwd) { - /* no user was set but a password, set a blank user */ - result = Curl_setstropt(&data->state.aptr.user, ""); - } if(result) return result; } @@ -1965,14 +1924,14 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, } else { unsigned long port = strtoul(data->state.up.port, NULL, 10); - conn->port = conn->remote_port = + conn->primary.remote_port = conn->remote_port = (data->set.use_port && data->state.allow_port) ? data->set.use_port : curlx_ultous(port); } (void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0); -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 if(data->set.scope_id) /* Override any scope that was set above. */ conn->scope_id = data->set.scope_id; @@ -1983,7 +1942,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, /* - * If we're doing a resumed transfer, we need to setup our stuff + * If we are doing a resumed transfer, we need to setup our stuff * properly. */ static CURLcode setup_range(struct Curl_easy *data) @@ -1995,15 +1954,15 @@ static CURLcode setup_range(struct Curl_easy *data) free(s->range); if(s->resume_from) - s->range = aprintf("%" CURL_FORMAT_CURL_OFF_T "-", s->resume_from); + s->range = aprintf("%" FMT_OFF_T "-", s->resume_from); else s->range = strdup(data->set.str[STRING_SET_RANGE]); - s->rangestringalloc = (s->range) ? TRUE : FALSE; - if(!s->range) return CURLE_OUT_OF_MEMORY; + s->rangestringalloc = TRUE; + /* tell ourselves to fetch this range */ s->use_range = TRUE; /* enable range download */ } @@ -2027,6 +1986,8 @@ static CURLcode setup_connection_internals(struct Curl_easy *data, struct connectdata *conn) { const struct Curl_handler *p; + const char *hostname; + int port; CURLcode result; /* Perform setup complement if some. */ @@ -2041,10 +2002,38 @@ static CURLcode setup_connection_internals(struct Curl_easy *data, p = conn->handler; /* May have changed. */ } - if(conn->port < 0) - /* we check for -1 here since if proxy was detected already, this - was very likely already set to the proxy port */ - conn->port = p->defport; + if(conn->primary.remote_port < 0) + /* we check for -1 here since if proxy was detected already, this was + likely already set to the proxy port */ + conn->primary.remote_port = p->defport; + + /* Now create the destination name */ +#ifndef CURL_DISABLE_PROXY + if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) { + hostname = conn->http_proxy.host.name; + port = conn->primary.remote_port; + } + else +#endif + { + port = conn->remote_port; + if(conn->bits.conn_to_host) + hostname = conn->conn_to_host.name; + else + hostname = conn->host.name; + } + +#ifdef USE_IPV6 + conn->destination = aprintf("%u/%d/%s", conn->scope_id, port, hostname); +#else + conn->destination = aprintf("%d/%s", port, hostname); +#endif + if(!conn->destination) + return CURLE_OUT_OF_MEMORY; + + conn->destination_len = strlen(conn->destination) + 1; + Curl_strntolower(conn->destination, conn->destination, + conn->destination_len - 1); return CURLE_OK; } @@ -2078,27 +2067,21 @@ static char *detect_proxy(struct Curl_easy *data, * the first to check for.) * * For compatibility, the all-uppercase versions of these variables are - * checked if the lowercase versions don't exist. + * checked if the lowercase versions do not exist. */ - char proxy_env[128]; - const char *protop = conn->handler->scheme; + char proxy_env[20]; char *envp = proxy_env; #ifdef CURL_DISABLE_VERBOSE_STRINGS (void)data; #endif - /* Now, build _proxy and check for such a one to use */ - while(*protop) - *envp++ = Curl_raw_tolower(*protop++); - - /* append _proxy */ - strcpy(envp, "_proxy"); + msnprintf(proxy_env, sizeof(proxy_env), "%s_proxy", conn->handler->scheme); /* read the protocol proxy: */ proxy = curl_getenv(proxy_env); /* - * We don't try the uppercase version of HTTP_PROXY because of + * We do not try the uppercase version of HTTP_PROXY because of * security reasons: * * When curl is used in a webserver application @@ -2115,9 +2098,8 @@ static char *detect_proxy(struct Curl_easy *data, proxy = curl_getenv(proxy_env); } - envp = proxy_env; if(!proxy) { -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS /* websocket proxy fallbacks */ if(strcasecompare("ws_proxy", proxy_env)) { proxy = curl_getenv("http_proxy"); @@ -2135,7 +2117,7 @@ static char *detect_proxy(struct Curl_easy *data, envp = (char *)"ALL_PROXY"; proxy = curl_getenv(envp); } -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS } #endif } @@ -2148,7 +2130,7 @@ static char *detect_proxy(struct Curl_easy *data, /* * If this is supposed to use a proxy, we need to figure out the proxy - * host name, so that we can reuse an existing connection + * hostname, so that we can reuse an existing connection * that may exist registered to the same proxy host. */ static CURLcode parse_proxy(struct Curl_easy *data, @@ -2290,11 +2272,12 @@ static CURLcode parse_proxy(struct Curl_easy *data, } if(port >= 0) { proxyinfo->port = port; - if(conn->port < 0 || sockstype || !conn->socks_proxy.host.rawalloc) - conn->port = port; + if(conn->primary.remote_port < 0 || sockstype || + !conn->socks_proxy.host.rawalloc) + conn->primary.remote_port = port; } - /* now, clone the proxy host name */ + /* now, clone the proxy hostname */ uc = curl_url_get(uhp, CURLUPART_HOST, &host, CURLU_URLDECODE); if(uc) { result = CURLE_OUT_OF_MEMORY; @@ -2362,21 +2345,20 @@ static CURLcode parse_proxy_auth(struct Curl_easy *data, data->state.aptr.proxyuser : ""; const char *proxypasswd = data->state.aptr.proxypasswd ? data->state.aptr.proxypasswd : ""; - CURLcode result = Curl_urldecode(proxyuser, 0, &conn->http_proxy.user, NULL, - REJECT_ZERO); - if(!result) - result = Curl_setstropt(&data->state.aptr.proxyuser, - conn->http_proxy.user); - if(!result) - result = Curl_urldecode(proxypasswd, 0, &conn->http_proxy.passwd, - NULL, REJECT_ZERO); - if(!result) - result = Curl_setstropt(&data->state.aptr.proxypasswd, - conn->http_proxy.passwd); + CURLcode result = CURLE_OUT_OF_MEMORY; + + conn->http_proxy.user = strdup(proxyuser); + if(conn->http_proxy.user) { + conn->http_proxy.passwd = strdup(proxypasswd); + if(conn->http_proxy.passwd) + result = CURLE_OK; + else + Curl_safefree(conn->http_proxy.user); + } return result; } -/* create_conn helper to parse and init proxy values. to be called after unix +/* create_conn helper to parse and init proxy values. to be called after Unix socket init but before any proxy vars are evaluated. */ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, struct connectdata *conn) @@ -2385,7 +2367,6 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, char *socksproxy = NULL; char *no_proxy = NULL; CURLcode result = CURLE_OK; - bool spacesep = FALSE; /************************************************************* * Extract the user and password from the authentication string @@ -2432,8 +2413,7 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, } if(Curl_check_noproxy(conn->host.name, data->set.str[STRING_NOPROXY] ? - data->set.str[STRING_NOPROXY] : no_proxy, - &spacesep)) { + data->set.str[STRING_NOPROXY] : no_proxy)) { Curl_safefree(proxy); Curl_safefree(socksproxy); } @@ -2442,13 +2422,10 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, /* if the host is not in the noproxy list, detect proxy. */ proxy = detect_proxy(data, conn); #endif /* CURL_DISABLE_HTTP */ - if(spacesep) - infof(data, "space-separated NOPROXY patterns are deprecated"); - Curl_safefree(no_proxy); #ifdef USE_UNIX_SOCKETS - /* For the time being do not mix proxy and unix domain sockets. See #1274 */ + /* For the time being do not mix proxy and Unix domain sockets. See #1274 */ if(proxy && conn->unix_domain_socket) { free(proxy); proxy = NULL; @@ -2456,14 +2433,14 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, #endif if(proxy && (!*proxy || (conn->handler->flags & PROTOPT_NONETWORK))) { - free(proxy); /* Don't bother with an empty proxy string or if the - protocol doesn't work with network */ + 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); /* Don't bother with an empty socks proxy string or if - the protocol doesn't work with network */ + free(socksproxy); /* Do not bother with an empty socks proxy string or if + the protocol does not work with network */ socksproxy = NULL; } @@ -2535,7 +2512,7 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, conn->bits.proxy = conn->bits.httpproxy || conn->bits.socksproxy; if(!conn->bits.proxy) { - /* we aren't using the proxy after all... */ + /* we are not using the proxy after all... */ conn->bits.proxy = FALSE; conn->bits.httpproxy = FALSE; conn->bits.socksproxy = FALSE; @@ -2557,7 +2534,7 @@ out: /* * Curl_parse_login_details() * - * This is used to parse a login string for user name, password and options in + * This is used to parse a login string for username, password and options in * the following formats: * * user @@ -2572,14 +2549,15 @@ out: * * Parameters: * - * login [in] - The login string. - * len [in] - The length of the login string. - * userp [in/out] - The address where a pointer to newly allocated memory + * login [in] - login string. + * len [in] - length of the login string. + * userp [in/out] - address where a pointer to newly allocated memory * holding the user will be stored upon completion. - * passwdp [in/out] - The address where a pointer to newly allocated memory + * passwdp [in/out] - address where a pointer to newly allocated memory * holding the password will be stored upon completion. - * optionsp [in/out] - The address where a pointer to newly allocated memory - * holding the options will be stored upon completion. + * optionsp [in/out] - OPTIONAL address where a pointer to newly allocated + * memory holding the options will be stored upon + * completion. * * Returns CURLE_OK on success. */ @@ -2587,19 +2565,19 @@ CURLcode Curl_parse_login_details(const char *login, const size_t len, char **userp, char **passwdp, char **optionsp) { - CURLcode result = CURLE_OK; char *ubuf = NULL; char *pbuf = NULL; - char *obuf = NULL; const char *psep = NULL; const char *osep = NULL; size_t ulen; size_t plen; size_t olen; + DEBUGASSERT(userp); + DEBUGASSERT(passwdp); + /* Attempt to find the password separator */ - if(passwdp) - psep = memchr(login, ':', len); + psep = memchr(login, ':', len); /* Attempt to find the options separator */ if(optionsp) @@ -2611,64 +2589,40 @@ CURLcode Curl_parse_login_details(const char *login, const size_t len, (osep ? (size_t)(osep - login) : len)); plen = (psep ? (osep && osep > psep ? (size_t)(osep - psep) : - (size_t)(login + len - psep)) - 1 : 0); + (size_t)(login + len - psep)) - 1 : 0); olen = (osep ? (psep && psep > osep ? (size_t)(psep - osep) : - (size_t)(login + len - osep)) - 1 : 0); + (size_t)(login + len - osep)) - 1 : 0); - /* Allocate the user portion buffer, which can be zero length */ - if(userp) { - ubuf = malloc(ulen + 1); - if(!ubuf) - result = CURLE_OUT_OF_MEMORY; - } + /* Clone the user portion buffer, which can be zero length */ + ubuf = Curl_memdup0(login, ulen); + if(!ubuf) + goto error; - /* Allocate the password portion buffer */ - if(!result && passwdp && psep) { - pbuf = malloc(plen + 1); - if(!pbuf) { - free(ubuf); - result = CURLE_OUT_OF_MEMORY; - } + /* Clone the password portion buffer */ + if(psep) { + pbuf = Curl_memdup0(&psep[1], plen); + if(!pbuf) + goto error; } /* Allocate the options portion buffer */ - if(!result && optionsp && olen) { - obuf = malloc(olen + 1); - if(!obuf) { - free(pbuf); - free(ubuf); - result = CURLE_OUT_OF_MEMORY; + if(optionsp) { + char *obuf = NULL; + if(olen) { + obuf = Curl_memdup0(&osep[1], olen); + if(!obuf) + goto error; } + *optionsp = obuf; } - - if(!result) { - /* Store the user portion if necessary */ - if(ubuf) { - memcpy(ubuf, login, ulen); - ubuf[ulen] = '\0'; - Curl_safefree(*userp); - *userp = ubuf; - } - - /* Store the password portion if necessary */ - if(pbuf) { - memcpy(pbuf, psep + 1, plen); - pbuf[plen] = '\0'; - Curl_safefree(*passwdp); - *passwdp = pbuf; - } - - /* Store the options portion if necessary */ - if(obuf) { - memcpy(obuf, osep + 1, olen); - obuf[olen] = '\0'; - Curl_safefree(*optionsp); - *optionsp = obuf; - } - } - - return result; + *userp = ubuf; + *passwdp = pbuf; + return CURLE_OK; +error: + free(ubuf); + free(pbuf); + return CURLE_OUT_OF_MEMORY; } /************************************************************* @@ -2726,13 +2680,14 @@ static CURLcode override_login(struct Curl_easy *data, int ret; bool url_provided = FALSE; - if(data->state.aptr.user) { - /* there was a user name in the URL. Use the URL decoded version */ + if(data->state.aptr.user && + (data->state.creds_from != CREDS_NETRC)) { + /* there was a username in the URL. Use the URL decoded version */ userp = &data->state.aptr.user; url_provided = TRUE; } - ret = Curl_parsenetrc(conn->host.name, + ret = Curl_parsenetrc(&data->state.netrc, conn->host.name, userp, passwdp, data->set.str[STRING_NETRC_FILE]); if(ret > 0) { @@ -2774,6 +2729,7 @@ static CURLcode override_login(struct Curl_easy *data, result = Curl_setstropt(&data->state.aptr.user, *userp); if(result) return result; + data->state.creds_from = CREDS_NETRC; } } if(data->state.aptr.user) { @@ -2791,6 +2747,7 @@ static CURLcode override_login(struct Curl_easy *data, CURLcode result = Curl_setstropt(&data->state.aptr.passwd, *passwdp); if(result) return result; + data->state.creds_from = CREDS_NETRC; } if(data->state.aptr.passwd) { uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, @@ -2808,7 +2765,7 @@ static CURLcode override_login(struct Curl_easy *data, } /* - * Set the login details so they're available in the connection + * Set the login details so they are available in the connection */ static CURLcode set_login(struct Curl_easy *data, struct connectdata *conn) @@ -2879,7 +2836,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, /* detect and extract RFC6874-style IPv6-addresses */ if(*hostptr == '[') { -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 char *ptr = ++hostptr; /* advance beyond the initial bracket */ while(*ptr && (ISXDIGIT(*ptr) || (*ptr == ':') || (*ptr == '.'))) ptr++; @@ -2899,8 +2856,8 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, else infof(data, "Invalid IPv6 address format"); portptr = ptr; - /* Note that if this didn't end with a bracket, we still advanced the - * hostptr first, but I can't see anything wrong with that as no host + /* Note that if this did not end with a bracket, we still advanced the + * hostptr first, but I cannot see anything wrong with that as no host * name nor a numeric can legally start with a bracket. */ #else @@ -2914,7 +2871,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, host_portno = strchr(portptr, ':'); if(host_portno) { char *endp = NULL; - *host_portno = '\0'; /* cut off number from host name */ + *host_portno = '\0'; /* cut off number from hostname */ host_portno++; if(*host_portno) { long portparse = strtol(host_portno, &endp, 10); @@ -2929,7 +2886,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, } } - /* now, clone the cleaned host name */ + /* now, clone the cleaned hostname */ DEBUGASSERT(hostptr); *hostname_result = strdup(hostptr); if(!*hostname_result) { @@ -2956,8 +2913,8 @@ static CURLcode parse_connect_to_string(struct Curl_easy *data, { CURLcode result = CURLE_OK; const char *ptr = conn_to_host; - int host_match = FALSE; - int port_match = FALSE; + bool host_match = FALSE; + bool port_match = FALSE; *host_result = NULL; *port_result = -1; @@ -3062,7 +3019,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, #ifndef CURL_DISABLE_ALTSVC if(data->asi && !host && (port == -1) && ((conn->handler->protocol == CURLPROTO_HTTPS) || -#ifdef CURLDEBUG +#ifdef DEBUGBUILD /* allow debug builds to circumvent the HTTPS restriction */ getenv("CURL_ALTSVC_HTTP") #else @@ -3070,35 +3027,77 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, #endif )) { /* no connect_to match, try alt-svc! */ - enum alpnid srcalpnid; - bool hit; - struct altsvc *as; + enum alpnid srcalpnid = ALPN_none; + bool use_alt_svc = FALSE; + bool hit = FALSE; + struct altsvc *as = NULL; const int allowed_versions = ( ALPN_h1 #ifdef USE_HTTP2 | ALPN_h2 #endif -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 | ALPN_h3 #endif ) & data->asi->flags; + static enum alpnid alpn_ids[] = { +#ifdef USE_HTTP3 + ALPN_h3, +#endif +#ifdef USE_HTTP2 + ALPN_h2, +#endif + ALPN_h1, + }; + size_t i; + + switch(data->state.httpwant) { + case CURL_HTTP_VERSION_1_0: + break; + case CURL_HTTP_VERSION_1_1: + use_alt_svc = TRUE; + srcalpnid = ALPN_h1; /* only regard alt-svc advice for http/1.1 */ + break; + case CURL_HTTP_VERSION_2_0: + use_alt_svc = TRUE; + srcalpnid = ALPN_h2; /* only regard alt-svc advice for h2 */ + break; + case CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE: + break; + case CURL_HTTP_VERSION_3: + use_alt_svc = TRUE; + srcalpnid = ALPN_h3; /* only regard alt-svc advice for h3 */ + break; + case CURL_HTTP_VERSION_3ONLY: + break; + default: /* no specific HTTP version wanted, look at all of alt-svc */ + use_alt_svc = TRUE; + srcalpnid = ALPN_none; + break; + } + if(!use_alt_svc) + return CURLE_OK; host = conn->host.rawalloc; -#ifdef USE_HTTP2 - /* with h2 support, check that first */ - srcalpnid = ALPN_h2; - hit = Curl_altsvc_lookup(data->asi, - srcalpnid, host, conn->remote_port, /* from */ - &as /* to */, - allowed_versions); - if(!hit) -#endif - { - srcalpnid = ALPN_h1; + DEBUGF(infof(data, "check Alt-Svc for host %s", host)); + if(srcalpnid == ALPN_none) { + /* scan all alt-svc protocol ids in order or relevance */ + for(i = 0; !hit && (i < ARRAYSIZE(alpn_ids)); ++i) { + srcalpnid = alpn_ids[i]; + hit = Curl_altsvc_lookup(data->asi, + srcalpnid, host, conn->remote_port, /* from */ + &as /* to */, + allowed_versions); + } + } + else { + /* look for a specific alt-svc protocol id */ hit = Curl_altsvc_lookup(data->asi, srcalpnid, host, conn->remote_port, /* from */ &as /* to */, allowed_versions); } + + if(hit) { char *hostd = strdup((char *)as->dst.host); if(!hostd) @@ -3125,7 +3124,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, conn->transport = TRNSPRT_QUIC; conn->httpversion = 30; break; - default: /* shouldn't be possible */ + default: /* should not be possible */ break; } } @@ -3164,118 +3163,12 @@ static CURLcode resolve_unix(struct Curl_easy *data, return longpath ? CURLE_COULDNT_RESOLVE_HOST : CURLE_OUT_OF_MEMORY; } - hostaddr->inuse++; + hostaddr->refcount = 1; /* connection is the only one holding this */ conn->dns_entry = hostaddr; return CURLE_OK; } #endif -#ifndef CURL_DISABLE_PROXY -static CURLcode resolve_proxy(struct Curl_easy *data, - struct connectdata *conn, - bool *async) -{ - struct Curl_dns_entry *hostaddr = NULL; - struct hostname *host; - timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); - int rc; - - DEBUGASSERT(conn->dns_entry == NULL); - - host = conn->bits.socksproxy ? &conn->socks_proxy.host : - &conn->http_proxy.host; - - conn->hostname_resolve = strdup(host->name); - if(!conn->hostname_resolve) - return CURLE_OUT_OF_MEMORY; - - rc = Curl_resolv_timeout(data, conn->hostname_resolve, (int)conn->port, - &hostaddr, timeout_ms); - conn->dns_entry = hostaddr; - if(rc == CURLRESOLV_PENDING) - *async = TRUE; - else if(rc == CURLRESOLV_TIMEDOUT) - return CURLE_OPERATION_TIMEDOUT; - else if(!hostaddr) { - failf(data, "Couldn't resolve proxy '%s'", host->dispname); - return CURLE_COULDNT_RESOLVE_PROXY; - } - - return CURLE_OK; -} -#endif - -static CURLcode resolve_host(struct Curl_easy *data, - struct connectdata *conn, - bool *async) -{ - struct Curl_dns_entry *hostaddr = NULL; - struct hostname *connhost; - timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); - int rc; - - DEBUGASSERT(conn->dns_entry == NULL); - - connhost = conn->bits.conn_to_host ? &conn->conn_to_host : &conn->host; - - /* If not connecting via a proxy, extract the port from the URL, if it is - * there, thus overriding any defaults that might have been set above. */ - conn->port = conn->bits.conn_to_port ? conn->conn_to_port : - conn->remote_port; - - /* Resolve target host right on */ - conn->hostname_resolve = strdup(connhost->name); - if(!conn->hostname_resolve) - return CURLE_OUT_OF_MEMORY; - - rc = Curl_resolv_timeout(data, conn->hostname_resolve, (int)conn->port, - &hostaddr, timeout_ms); - conn->dns_entry = hostaddr; - if(rc == CURLRESOLV_PENDING) - *async = TRUE; - else if(rc == CURLRESOLV_TIMEDOUT) { - failf(data, "Failed to resolve host '%s' with timeout after %" - CURL_FORMAT_TIMEDIFF_T " ms", connhost->dispname, - Curl_timediff(Curl_now(), data->progress.t_startsingle)); - return CURLE_OPERATION_TIMEDOUT; - } - else if(!hostaddr) { - failf(data, "Could not resolve host: %s", connhost->dispname); - return CURLE_COULDNT_RESOLVE_HOST; - } - - return CURLE_OK; -} - -/* Perform a fresh resolve */ -static CURLcode resolve_fresh(struct Curl_easy *data, - struct connectdata *conn, - bool *async) -{ -#ifdef USE_UNIX_SOCKETS - char *unix_path = conn->unix_domain_socket; - -#ifndef CURL_DISABLE_PROXY - if(!unix_path && conn->socks_proxy.host.name && - !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 - - if(unix_path) { - conn->transport = TRNSPRT_UNIX; - return resolve_unix(data, conn, unix_path); - } -#endif - -#ifndef CURL_DISABLE_PROXY - if(CONN_IS_PROXIED(conn)) - return resolve_proxy(data, conn, async); -#endif - - return resolve_host(data, conn, async); -} - /************************************************************* * Resolve the address of the server or proxy *************************************************************/ @@ -3283,24 +3176,72 @@ static CURLcode resolve_server(struct Curl_easy *data, struct connectdata *conn, bool *async) { - DEBUGASSERT(conn); - DEBUGASSERT(data); + struct hostname *ehost; + timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); + const char *peertype = "host"; + int rc; +#ifdef USE_UNIX_SOCKETS + char *unix_path = conn->unix_domain_socket; - /* Resolve the name of the server or proxy */ - if(conn->bits.reuse) { - /* We're reusing the connection - no need to resolve anything, and - idnconvert_hostname() was called already in create_conn() for the reuse - case. */ - *async = FALSE; - return CURLE_OK; +#ifndef CURL_DISABLE_PROXY + if(!unix_path && CONN_IS_PROXIED(conn) && conn->socks_proxy.host.name && + !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 + + if(unix_path) { + /* TODO, this only works if previous transport is TRNSPRT_TCP. Check it? */ + conn->transport = TRNSPRT_UNIX; + return resolve_unix(data, conn, unix_path); + } +#endif + + DEBUGASSERT(conn->dns_entry == NULL); + +#ifndef CURL_DISABLE_PROXY + if(CONN_IS_PROXIED(conn)) { + ehost = conn->bits.socksproxy ? &conn->socks_proxy.host : + &conn->http_proxy.host; + peertype = "proxy"; + } + else +#endif + { + ehost = conn->bits.conn_to_host ? &conn->conn_to_host : &conn->host; + /* If not connecting via a proxy, extract the port from the URL, if it is + * there, thus overriding any defaults that might have been set above. */ + conn->primary.remote_port = conn->bits.conn_to_port ? conn->conn_to_port : + conn->remote_port; } - return resolve_fresh(data, conn, async); + /* Resolve target host right on */ + conn->hostname_resolve = strdup(ehost->name); + if(!conn->hostname_resolve) + return CURLE_OUT_OF_MEMORY; + + rc = Curl_resolv_timeout(data, conn->hostname_resolve, + conn->primary.remote_port, + &conn->dns_entry, timeout_ms); + if(rc == CURLRESOLV_PENDING) + *async = TRUE; + else if(rc == CURLRESOLV_TIMEDOUT) { + failf(data, "Failed to resolve %s '%s' with timeout after %" + FMT_TIMEDIFF_T " ms", peertype, ehost->dispname, + Curl_timediff(Curl_now(), data->progress.t_startsingle)); + return CURLE_OPERATION_TIMEDOUT; + } + else if(!conn->dns_entry) { + failf(data, "Could not resolve %s: %s", peertype, ehost->dispname); + return CURLE_COULDNT_RESOLVE_HOST; + } + + return CURLE_OK; } /* * Cleanup the connection `temp`, just allocated for `data`, before using the - * previously `existing` one for `data`. All relevant info is copied over + * previously `existing` one for `data`. All relevant info is copied over * and `temp` is freed. */ static void reuse_conn(struct Curl_easy *data, @@ -3310,7 +3251,7 @@ static void reuse_conn(struct Curl_easy *data, /* get the user+password information from the temp struct since it may * be new for this request even when we reuse an existing connection */ if(temp->user) { - /* use the new user name and password though */ + /* use the new username and password though */ Curl_safefree(existing->user); Curl_safefree(existing->passwd); existing->user = temp->user; @@ -3322,7 +3263,7 @@ static void reuse_conn(struct Curl_easy *data, #ifndef CURL_DISABLE_PROXY existing->bits.proxy_user_passwd = temp->bits.proxy_user_passwd; if(existing->bits.proxy_user_passwd) { - /* use the new proxy user name and proxy password though */ + /* use the new proxy username and proxy password though */ Curl_safefree(existing->http_proxy.user); Curl_safefree(existing->socks_proxy.user); Curl_safefree(existing->http_proxy.passwd); @@ -3338,7 +3279,7 @@ static void reuse_conn(struct Curl_easy *data, } #endif - /* Finding a connection for reuse in the cache matches, among other + /* Finding a connection for reuse in the cpool matches, among other * things on the "remote-relevant" hostname. This is not necessarily * the authority of the URL, e.g. conn->host. For example: * - we use a proxy (not tunneling). we want to send all requests @@ -3369,14 +3310,14 @@ static void reuse_conn(struct Curl_easy *data, temp->hostname_resolve = NULL; /* reuse init */ - existing->bits.reuse = TRUE; /* yes, we're reusing here */ + existing->bits.reuse = TRUE; /* yes, we are reusing here */ - conn_free(data, temp); + Curl_conn_free(data, temp); } /** * create_conn() sets up a new connectdata struct, or reuses an already - * existing one, and resolves host name. + * existing one, and resolves hostname. * * if this function returns CURLE_OK and *async is set to TRUE, the resolve * response will be coming asynchronously. If *async is FALSE, the name is @@ -3400,8 +3341,6 @@ static CURLcode create_conn(struct Curl_easy *data, bool connections_available = TRUE; bool force_reuse = FALSE; bool waitpipe = FALSE; - size_t max_host_connections = Curl_multi_max_host_connections(data->multi); - size_t max_total_connections = Curl_multi_max_total_connections(data->multi); *async = FALSE; *in_connect = NULL; @@ -3461,7 +3400,7 @@ static CURLcode create_conn(struct Curl_easy *data, } #endif - /* After the unix socket init but before the proxy vars are used, parse and + /* After the Unix socket init but before the proxy vars are used, parse and initialize the proxy vars */ #ifndef CURL_DISABLE_PROXY result = create_conn_helper_init_proxy(data, conn); @@ -3558,7 +3497,7 @@ static CURLcode create_conn(struct Curl_easy *data, goto out; /*********************************************************************** - * file: is a special case in that it doesn't need a network connection + * file: is a special case in that it does not need a network connection ***********************************************************************/ #ifndef CURL_DISABLE_FILE if(conn->handler->flags & PROTOPT_NONETWORK) { @@ -3566,13 +3505,15 @@ static CURLcode create_conn(struct Curl_easy *data, /* this is supposed to be the connect function so we better at least check that the file is present here! */ DEBUGASSERT(conn->handler->connect_it); - Curl_persistconninfo(data, conn, NULL, -1); + data->info.conn_scheme = conn->handler->scheme; + /* conn_protocol can only provide "old" protocols */ + data->info.conn_protocol = (conn->handler->protocol) & CURLPROTO_MASK; result = conn->handler->connect_it(data, &done); - /* Setup a "faked" transfer that'll do nothing */ + /* Setup a "faked" transfer that will do nothing */ if(!result) { Curl_attach_connection(data, conn); - result = Curl_conncache_add_conn(data); + result = Curl_cpool_add_conn(data, conn); if(result) goto out; @@ -3586,7 +3527,7 @@ static CURLcode create_conn(struct Curl_easy *data, (void)conn->handler->done(data, result, FALSE); goto out; } - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); } /* since we skip do_init() */ @@ -3608,7 +3549,8 @@ static CURLcode create_conn(struct Curl_easy *data, if(result) goto out; - prune_dead_connections(data); + /* FIXME: do we really want to run this every time we add a transfer? */ + Curl_cpool_prune_dead(data); /************************************************************* * Check the current list of connections to see if we can @@ -3641,7 +3583,7 @@ static CURLcode create_conn(struct Curl_easy *data, #ifndef CURL_DISABLE_PROXY infof(data, "Re-using existing connection with %s %s", - conn->bits.proxy?"proxy":"host", + conn->bits.proxy ? "proxy" : "host", conn->socks_proxy.host.name ? conn->socks_proxy.host.dispname : conn->http_proxy.host.name ? conn->http_proxy.host.dispname : conn->host.dispname); @@ -3667,50 +3609,31 @@ static CURLcode create_conn(struct Curl_easy *data, "soon", and we wait for that */ connections_available = FALSE; else { - /* this gets a lock on the conncache */ - struct connectbundle *bundle = - Curl_conncache_find_bundle(data, conn, data->state.conn_cache); - - if(max_host_connections > 0 && bundle && - (bundle->num_connections >= max_host_connections)) { - struct connectdata *conn_candidate; - - /* The bundle is full. Extract the oldest connection. */ - conn_candidate = Curl_conncache_extract_bundle(data, bundle); - CONNCACHE_UNLOCK(data); - - if(conn_candidate) - Curl_disconnect(data, conn_candidate, FALSE); - else { - infof(data, "No more connections allowed to host: %zu", - max_host_connections); + switch(Curl_cpool_check_limits(data, conn)) { + case CPOOL_LIMIT_DEST: + infof(data, "No more connections allowed to host"); + connections_available = FALSE; + break; + case CPOOL_LIMIT_TOTAL: +#ifndef CURL_DISABLE_DOH + if(data->set.dohfor_mid >= 0) + infof(data, "Allowing DoH to override max connection limit"); + else +#endif + { + infof(data, "No connections available in cache"); connections_available = FALSE; } - } - else - CONNCACHE_UNLOCK(data); - - } - - if(connections_available && - (max_total_connections > 0) && - (Curl_conncache_size(data) >= max_total_connections)) { - struct connectdata *conn_candidate; - - /* The cache is full. Let's see if we can kill a connection. */ - conn_candidate = Curl_conncache_extract_oldest(data); - if(conn_candidate) - Curl_disconnect(data, conn_candidate, FALSE); - else { - infof(data, "No connections available in cache"); - connections_available = FALSE; + break; + default: + break; } } if(!connections_available) { infof(data, "No connections available."); - conn_free(data, conn); + Curl_conn_free(data, conn); *in_connect = NULL; result = CURLE_NO_CONNECTION_AVAILABLE; @@ -3728,23 +3651,23 @@ static CURLcode create_conn(struct Curl_easy *data, } Curl_attach_connection(data, conn); - result = Curl_conncache_add_conn(data); + result = Curl_cpool_add_conn(data, conn); if(result) goto out; } #if defined(USE_NTLM) - /* If NTLM is requested in a part of this connection, make sure we don't + /* If NTLM is requested in a part of this connection, make sure we do not assume the state is fine as this is a fresh connection and NTLM is connection based. */ - if((data->state.authhost.picked & (CURLAUTH_NTLM | CURLAUTH_NTLM_WB)) && + if((data->state.authhost.picked & CURLAUTH_NTLM) && data->state.authhost.done) { infof(data, "NTLM picked AND auth done set, clear picked"); data->state.authhost.picked = CURLAUTH_NONE; data->state.authhost.done = FALSE; } - if((data->state.authproxy.picked & (CURLAUTH_NTLM | CURLAUTH_NTLM_WB)) && + if((data->state.authproxy.picked & CURLAUTH_NTLM) && data->state.authproxy.done) { infof(data, "NTLM-proxy picked AND auth done set, clear picked"); data->state.authproxy.picked = CURLAUTH_NONE; @@ -3765,23 +3688,35 @@ static CURLcode create_conn(struct Curl_easy *data, /* Continue connectdata initialization here. */ - /* - * Inherit the proper values from the urldata struct AFTER we have arranged - * the persistent connection stuff - */ - conn->seek_func = data->set.seek_func; - conn->seek_client = data->set.seek_client; + if(conn->bits.reuse) { + /* We are reusing the connection - no need to resolve anything, and + idnconvert_hostname() was called already in create_conn() for the reuse + case. */ + *async = FALSE; + } + else { + /************************************************************* + * Resolve the address of the server or proxy + *************************************************************/ + result = resolve_server(data, conn, async); + if(result) + goto out; + } - /************************************************************* - * Resolve the address of the server or proxy - *************************************************************/ - result = resolve_server(data, conn, async); - if(result) - goto out; + /* persist the scheme and handler the transfer is using */ + data->info.conn_scheme = conn->handler->scheme; + /* conn_protocol can only provide "old" protocols */ + data->info.conn_protocol = (conn->handler->protocol) & CURLPROTO_MASK; + data->info.used_proxy = +#ifdef CURL_DISABLE_PROXY + 0 +#else + conn->bits.proxy +#endif + ; /* Everything general done, inform filters that they need - * to prepare for a data transfer. - */ + * to prepare for a data transfer. */ result = Curl_conn_ev_data_setup(data); out: @@ -3807,18 +3742,6 @@ CURLcode Curl_setup_conn(struct Curl_easy *data, return result; } -#ifndef CURL_DISABLE_PROXY - /* set proxy_connect_closed to false unconditionally already here since it - is used strictly to provide extra information to a parent function in the - case of proxy CONNECT failures and we must make sure we don't have it - lingering set from a previous invoke */ - conn->bits.proxy_connect_closed = FALSE; -#endif - -#ifdef CURL_DO_LINEEND_CONV - data->state.crlf_conversions = 0; /* reset CRLF conversion counter */ -#endif /* CURL_DO_LINEEND_CONV */ - /* set start time here for timeout purposes in the connect procedure, it is later set again for the progress meter purpose */ conn->now = Curl_now(); @@ -3842,8 +3765,8 @@ CURLcode Curl_connect(struct Curl_easy *data, *asyncp = FALSE; /* assume synchronous resolves by default */ - /* init the single-transfer specific data */ - Curl_req_reset(&data->req, data); + /* Set the request to virgin state based on transfer settings */ + Curl_req_hard_reset(&data->req, data); /* call the stuff that needs to be called */ result = create_conn(data, &conn, asyncp); @@ -3853,7 +3776,7 @@ CURLcode Curl_connect(struct Curl_easy *data, /* multiplexed */ *protocol_done = TRUE; else if(!*asyncp) { - /* DNS resolution is done: that's either because this is a reused + /* DNS resolution is done: that is either because this is a reused connection, in which case DNS was unnecessary, or because DNS really did finish already (synch resolver/fast async resolve) */ result = Curl_setup_conn(data, protocol_done); @@ -3864,11 +3787,10 @@ CURLcode Curl_connect(struct Curl_easy *data, return result; } else if(result && conn) { - /* We're not allowed to return failure with memory left allocated in the + /* We are not allowed to return failure with memory left allocated in the connectdata struct, free those here */ Curl_detach_connection(data); - Curl_conncache_remove_conn(data, conn, TRUE); - Curl_disconnect(data, conn, TRUE); + Curl_cpool_disconnect(data, conn, TRUE); } return result; @@ -3886,42 +3808,31 @@ CURLcode Curl_connect(struct Curl_easy *data, CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn) { - struct SingleRequest *k = &data->req; - /* if this is a pushed stream, we need this: */ - CURLcode result = Curl_preconnect(data); - if(result) - return result; + CURLcode result; if(conn) { - conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to + conn->bits.do_more = FALSE; /* by default there is no curl_do_more() to use */ - /* if the protocol used doesn't support wildcards, switch it off */ + /* if the protocol used does not support wildcards, switch it off */ if(data->state.wildcardmatch && !(conn->handler->flags & PROTOPT_WILDCARD)) data->state.wildcardmatch = FALSE; } data->state.done = FALSE; /* *_done() is not called yet */ - data->state.expect100header = FALSE; if(data->req.no_body) /* in HTTP lingo, no body means using the HEAD request... */ data->state.httpreq = HTTPREQ_HEAD; result = Curl_req_start(&data->req, data); - if(result) - return result; - - k->header = TRUE; /* assume header */ - k->bytecount = 0; - k->ignorebody = FALSE; - - Curl_speedinit(data); - Curl_pgrsSetUploadCounter(data, 0); - Curl_pgrsSetDownloadCounter(data, 0); - - return CURLE_OK; + if(!result) { + Curl_speedinit(data); + Curl_pgrsSetUploadCounter(data, 0); + Curl_pgrsSetDownloadCounter(data, 0); + } + return result; } #if defined(USE_HTTP2) || defined(USE_HTTP3) diff --git a/deps/curl/lib/url.h b/deps/curl/lib/url.h index 6d369508..47c1db44 100644 --- a/deps/curl/lib/url.h +++ b/deps/curl/lib/url.h @@ -37,10 +37,11 @@ void Curl_freeset(struct Curl_easy *data); CURLcode Curl_uc_to_curlcode(CURLUcode uc); CURLcode Curl_close(struct Curl_easy **datap); /* opposite of curl_open() */ CURLcode Curl_connect(struct Curl_easy *, bool *async, bool *protocol_connect); -void Curl_disconnect(struct Curl_easy *data, - struct connectdata *, bool dead_connection); +bool Curl_on_disconnect(struct Curl_easy *data, + struct connectdata *, bool aborted); CURLcode Curl_setup_conn(struct Curl_easy *data, bool *protocol_done); +void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn); CURLcode Curl_parse_login_details(const char *login, const size_t len, char **userptr, char **passwdptr, char **optionsptr); @@ -58,11 +59,27 @@ const struct Curl_handler *Curl_getn_scheme_handler(const char *scheme, specified */ #ifdef CURL_DISABLE_VERBOSE_STRINGS -#define Curl_verboseconnect(x,y) Curl_nop_stmt +#define Curl_verboseconnect(x,y,z) Curl_nop_stmt #else -void Curl_verboseconnect(struct Curl_easy *data, struct connectdata *conn); +void Curl_verboseconnect(struct Curl_easy *data, struct connectdata *conn, + int sockindex); #endif +/** + * Return TRUE iff the given connection is considered dead. + * @param nowp NULL or pointer to time being checked against. + */ +bool Curl_conn_seems_dead(struct connectdata *conn, + struct Curl_easy *data, + struct curltime *nowp); + +/** + * Perform upkeep operations on the connection. + */ +CURLcode Curl_conn_upkeep(struct Curl_easy *data, + struct connectdata *conn, + struct curltime *now); + #if defined(USE_HTTP2) || defined(USE_HTTP3) void Curl_data_priority_clear_state(struct Curl_easy *data); #else diff --git a/deps/curl/lib/urlapi-int.h b/deps/curl/lib/urlapi-int.h index d6e240aa..fcffab2e 100644 --- a/deps/curl/lib/urlapi-int.h +++ b/deps/curl/lib/urlapi-int.h @@ -28,12 +28,11 @@ size_t Curl_is_absolute_url(const char *url, char *buf, size_t buflen, bool guess_scheme); -CURLUcode Curl_url_set_authority(CURLU *u, const char *authority, - unsigned int flags); +CURLUcode Curl_url_set_authority(CURLU *u, const char *authority); -#ifdef DEBUGBUILD -CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, - bool has_scheme); +#ifdef UNITTESTS +UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, + bool has_scheme); #endif #endif /* HEADER_CURL_URLAPI_INT_H */ diff --git a/deps/curl/lib/urlapi.c b/deps/curl/lib/urlapi.c index dc424897..98c8f6fe 100644 --- a/deps/curl/lib/urlapi.c +++ b/deps/curl/lib/urlapi.c @@ -34,20 +34,19 @@ #include "inet_ntop.h" #include "strdup.h" #include "idn.h" -#include "curl_memrchr.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" #include "curl_memory.h" #include "memdebug.h" - /* MSDOS/Windows style drive prefix, eg c: in c:foo */ + /* 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] == ':')) - /* MSDOS/Windows style drive prefix, optionally with + /* 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') || \ @@ -59,11 +58,11 @@ #define MAX_SCHEME_LEN 40 /* - * If ENABLE_IPV6 is disabled, we still want to parse IPv6 addresses, so make + * If USE_IPV6 is disabled, we still want to parse IPv6 addresses, so make * sure we have _some_ value for AF_INET6 without polluting our fake value * everywhere. */ -#if !defined(ENABLE_IPV6) && !defined(AF_INET6) +#if !defined(USE_IPV6) && !defined(AF_INET6) #define AF_INET6 (AF_INET + 1) #endif @@ -79,7 +78,10 @@ struct Curl_URL { char *path; char *query; char *fragment; - long portnum; /* the numerical version */ + unsigned short portnum; /* the numerical version (if 'port' is set) */ + BIT(query_present); /* to support blank */ + BIT(fragment_present); /* to support blank */ + BIT(guessed_scheme); /* when a URL without scheme is parsed */ }; #define DEFAULT_SCHEME "https" @@ -99,7 +101,7 @@ static void free_urlhandle(struct Curl_URL *u) } /* - * Find the separator at the end of the host name, or the '?' in cases like + * Find the separator at the end of the hostname, or the '?' in cases like * http://www.example.com?id=2380 */ static const char *find_host_sep(const char *url) @@ -138,7 +140,7 @@ static const char hexdigits[] = "0123456789abcdef"; /* urlencode_str() writes data into an output dynbuf and URL-encodes the * spaces in the source URL accordingly. * - * URL encoding should be skipped for host names, otherwise IDN resolution + * URL encoding should be skipped for hostnames, otherwise IDN resolution * will fail. */ static CURLUcode urlencode_str(struct dynbuf *o, const char *url, @@ -179,7 +181,7 @@ static CURLUcode urlencode_str(struct dynbuf *o, const char *url, if(urlchar_needs_escaping(*iptr)) { char out[3]={'%'}; - out[1] = hexdigits[*iptr>>4]; + out[1] = hexdigits[*iptr >> 4]; out[2] = hexdigits[*iptr & 0xf]; result = Curl_dyn_addn(o, out, 3); } @@ -203,7 +205,7 @@ static CURLUcode urlencode_str(struct dynbuf *o, const char *url, size_t Curl_is_absolute_url(const char *url, char *buf, size_t buflen, bool guess_scheme) { - int i = 0; + size_t i = 0; DEBUGASSERT(!buf || (buflen > MAX_SCHEME_LEN)); (void)buflen; /* only used in debug-builds */ if(buf) @@ -227,15 +229,13 @@ size_t Curl_is_absolute_url(const char *url, char *buf, size_t buflen, if(i && (url[i] == ':') && ((url[i + 1] == '/') || !guess_scheme)) { /* If this does not guess scheme, the scheme always ends with the colon so that this also detects data: URLs etc. In guessing mode, data: could - be the host name "data" with a specified port number. */ + be the hostname "data" with a specified port number. */ /* the length of the scheme is the name part only */ size_t len = i; if(buf) { + Curl_strntolower(buf, url, i); buf[i] = 0; - while(i--) { - buf[i] = Curl_raw_tolower(url[i]); - } } return len; } @@ -264,9 +264,10 @@ static CURLcode concat_url(char *base, const char *relurl, char **newurl) const char *useurl = relurl; CURLcode result = CURLE_OK; CURLUcode uc; + bool skip_slash = FALSE; *newurl = NULL; - /* protsep points to the start of the host name */ + /* protsep points to the start of the hostname */ protsep = strstr(base, "//"); if(!protsep) protsep = base; @@ -276,55 +277,57 @@ static CURLcode concat_url(char *base, const char *relurl, char **newurl) if('/' != relurl[0]) { int level = 0; - /* First we need to find out if there's a ?-letter in the URL, + /* First we need to find out if there is a ?-letter in the URL, and cut it and the right-side of that off */ pathsep = strchr(protsep, '?'); if(pathsep) *pathsep = 0; - /* we have a relative path to append to the last slash if there's one - available, or if the new URL is just a query string (starts with a - '?') we append the new one at the end of the entire currently worked - out URL */ - if(useurl[0] != '?') { + /* we have a relative path to append to the last slash if there is one + available, or the new URL is just a query string (starts with a '?') or + a fragment (starts with '#') we append the new one at the end of the + current URL */ + if((useurl[0] != '?') && (useurl[0] != '#')) { pathsep = strrchr(protsep, '/'); if(pathsep) *pathsep = 0; - } - /* Check if there's any slash after the host name, and if so, remember - that position instead */ - pathsep = strchr(protsep, '/'); - if(pathsep) - protsep = pathsep + 1; - else - protsep = NULL; + /* Check if there is any slash after the hostname, and if so, remember + that position instead */ + pathsep = strchr(protsep, '/'); + if(pathsep) + protsep = pathsep + 1; + else + protsep = NULL; - /* now deal with one "./" or any amount of "../" in the newurl - and act accordingly */ + /* now deal with one "./" or any amount of "../" in the newurl + and act accordingly */ - if((useurl[0] == '.') && (useurl[1] == '/')) - useurl += 2; /* just skip the "./" */ + if((useurl[0] == '.') && (useurl[1] == '/')) + useurl += 2; /* just skip the "./" */ - while((useurl[0] == '.') && - (useurl[1] == '.') && - (useurl[2] == '/')) { - level++; - useurl += 3; /* pass the "../" */ - } + while((useurl[0] == '.') && + (useurl[1] == '.') && + (useurl[2] == '/')) { + level++; + useurl += 3; /* pass the "../" */ + } - if(protsep) { - while(level--) { - /* cut off one more level from the right of the original URL */ - pathsep = strrchr(protsep, '/'); - if(pathsep) - *pathsep = 0; - else { - *protsep = 0; - break; + if(protsep) { + while(level--) { + /* cut off one more level from the right of the original URL */ + pathsep = strrchr(protsep, '/'); + if(pathsep) + *pathsep = 0; + else { + *protsep = 0; + break; + } } } } + else + skip_slash = TRUE; } else { /* We got a new absolute path for this server */ @@ -344,7 +347,7 @@ static CURLcode concat_url(char *base, const char *relurl, char **newurl) if(pathsep) { /* When people use badly formatted URLs, such as "http://www.example.com?dir=/home/daniel" we must not use the first - slash, if there's a ?-letter before it! */ + slash, if there is a ?-letter before it! */ char *sep = strchr(protsep, '?'); if(sep && (sep < pathsep)) pathsep = sep; @@ -352,8 +355,8 @@ static CURLcode concat_url(char *base, const char *relurl, char **newurl) } else { /* There was no slash. Now, since we might be operating on a badly - formatted URL, such as "http://www.example.com?id=2380" which - doesn't use a slash separator as it is supposed to, we need to check + formatted URL, such as "http://www.example.com?id=2380" which does + not use a slash separator as it is supposed to, we need to check for a ?-letter as well! */ pathsep = strchr(protsep, '?'); if(pathsep) @@ -364,13 +367,13 @@ static CURLcode concat_url(char *base, const char *relurl, char **newurl) Curl_dyn_init(&newest, CURL_MAX_INPUT_LENGTH); - /* copy over the root url part */ + /* copy over the root URL part */ result = Curl_dyn_add(&newest, base); if(result) return result; /* check if we need to append a slash */ - if(('/' == useurl[0]) || (protsep && !*protsep) || ('?' == useurl[0])) + if(('/' == useurl[0]) || (protsep && !*protsep) || skip_slash) ; else { result = Curl_dyn_addn(&newest, "/", 1); @@ -417,15 +420,15 @@ static CURLUcode junkscan(const char *url, size_t *urllen, unsigned int flags) /* * parse_hostname_login() * - * Parse the login details (user name, password and options) from the URL and - * strip them out of the host name + * Parse the login details (username, password and options) from the URL and + * strip them out of the hostname * */ static CURLUcode parse_hostname_login(struct Curl_URL *u, const char *login, size_t len, unsigned int flags, - size_t *offset) /* to the host name */ + size_t *offset) /* to the hostname */ { CURLUcode result = CURLUE_OK; CURLcode ccode; @@ -464,7 +467,7 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u, ccode = Curl_parse_login_details(login, ptr - login - 1, &userp, &passwdp, (h && (h->flags & PROTOPT_URLOPTIONS)) ? - &optionsp:NULL); + &optionsp : NULL); if(ccode) { result = CURLUE_BAD_LOGIN; goto out; @@ -472,7 +475,7 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u, if(userp) { if(flags & CURLU_DISALLOW_USER) { - /* Option DISALLOW_USER is set and url contains username. */ + /* Option DISALLOW_USER is set and URL contains username. */ result = CURLUE_USER_NOT_ALLOWED; goto out; } @@ -490,7 +493,7 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u, u->options = optionsp; } - /* the host name starts at this offset */ + /* the hostname starts at this offset */ *offset = ptr - login; return CURLUE_OK; @@ -532,14 +535,14 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, if(portptr) { char *rest = NULL; - long port; + unsigned long port; size_t keep = portptr - hostname; - /* Browser behavior adaptation. If there's a colon with no digits after, + /* Browser behavior adaptation. If there is a colon with no digits after, just cut off the name there which makes us ignore the colon and just use the default port. Firefox, Chrome and Safari all do that. - Don't do it if the URL has no scheme, to make something that looks like + Do not do it if the URL has no scheme, to make something that looks like a scheme not work! */ Curl_dyn_setlen(host, keep); @@ -550,15 +553,13 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, if(!ISDIGIT(*portptr)) return CURLUE_BAD_PORT_NUMBER; - port = strtol(portptr, &rest, 10); /* Port number must be decimal */ + errno = 0; + port = strtoul(portptr, &rest, 10); /* Port number must be decimal */ - if(port > 0xffff) + if(errno || (port > 0xffff) || *rest) return CURLUE_BAD_PORT_NUMBER; - if(rest[0]) - return CURLUE_BAD_PORT_NUMBER; - - u->portnum = port; + u->portnum = (unsigned short) port; /* generate a new port number string to get rid of leading zeroes etc */ free(u->port); u->port = aprintf("%ld", port); @@ -590,7 +591,7 @@ static CURLUcode ipv6_parse(struct Curl_URL *u, char *hostname, char zoneid[16]; int i = 0; char *h = &hostname[len + 1]; - /* pass '25' if present and is a url encoded percent sign */ + /* pass '25' if present and is a URL encoded percent sign */ if(!strncmp(h, "25", 2) && h[2] && (h[2] != ']')) h += 2; while(*h && (*h != ']') && (i < 15)) @@ -609,19 +610,14 @@ static CURLUcode ipv6_parse(struct Curl_URL *u, char *hostname, /* hostname is fine */ } - /* Check the IPv6 address. */ + /* Normalize the IPv6 address */ { char dest[16]; /* fits a binary IPv6 address */ - char norm[MAX_IPADR_LEN]; hostname[hlen] = 0; /* end the address there */ if(1 != Curl_inet_pton(AF_INET6, hostname, dest)) return CURLUE_BAD_IPV6; - - /* check if it can be done shorter */ - if(Curl_inet_ntop(AF_INET6, dest, norm, sizeof(norm)) && - (strlen(norm) < hlen)) { - strcpy(hostname, norm); - hlen = strlen(norm); + if(Curl_inet_ntop(AF_INET6, dest, hostname, hlen)) { + hlen = strlen(hostname); /* might be shorter now */ hostname[hlen + 1] = 0; } hostname[hlen] = ']'; /* restore ending bracket */ @@ -663,7 +659,6 @@ static CURLUcode hostname_check(struct Curl_URL *u, char *hostname, */ #define HOST_ERROR -1 /* out of memory */ -#define HOST_BAD -2 /* bad IPv4 address */ #define HOST_NAME 1 #define HOST_IPV4 2 @@ -680,13 +675,21 @@ static int ipv4_normalize(struct dynbuf *host) if(*c == '[') return HOST_IPV6; + errno = 0; /* for strtoul */ while(!done) { char *endp = NULL; unsigned long l; if(!ISDIGIT(*c)) - /* most importantly this doesn't allow a leading plus or minus */ + /* most importantly this does not allow a leading plus or minus */ return HOST_NAME; l = strtoul(c, &endp, 0); + if(errno) + return HOST_NAME; +#if SIZEOF_LONG > 4 + /* a value larger than 32 bits */ + if(l > UINT_MAX) + return HOST_NAME; +#endif parts[n] = l; c = endp; @@ -706,16 +709,6 @@ static int ipv4_normalize(struct dynbuf *host) default: return HOST_NAME; } - - /* overflow */ - if((l == ULONG_MAX) && (errno == ERANGE)) - return HOST_NAME; - -#if SIZEOF_LONG > 4 - /* a value larger than 32 bits */ - if(l > UINT_MAX) - return HOST_NAME; -#endif } switch(n) { @@ -803,7 +796,7 @@ static CURLUcode parse_authority(struct Curl_URL *u, CURLcode result; /* - * Parse the login details and strip them out of the host name. + * Parse the login details and strip them out of the hostname. */ uc = parse_hostname_login(u, auth, authlen, flags, &offset); if(uc) @@ -836,7 +829,6 @@ static CURLUcode parse_authority(struct Curl_URL *u, case HOST_ERROR: uc = CURLUE_OUT_OF_MEMORY; break; - case HOST_BAD: default: uc = CURLUE_BAD_HOSTNAME; /* Bad IPv4 address even */ break; @@ -846,8 +838,8 @@ out: return uc; } -CURLUcode Curl_url_set_authority(CURLU *u, const char *authority, - unsigned int flags) +/* used for HTTP/2 server push */ +CURLUcode Curl_url_set_authority(CURLU *u, const char *authority) { CURLUcode result; struct dynbuf host; @@ -855,8 +847,8 @@ CURLUcode Curl_url_set_authority(CURLU *u, const char *authority, DEBUGASSERT(authority); Curl_dyn_init(&host, CURL_MAX_INPUT_LENGTH); - result = parse_authority(u, authority, strlen(authority), flags, - &host, !!u->scheme); + result = parse_authority(u, authority, strlen(authority), + CURLU_DISALLOW_USER, &host, !!u->scheme); if(result) Curl_dyn_free(&host); else { @@ -908,7 +900,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) do { bool dotdot = TRUE; if(*input == '.') { - /* A. If the input buffer begins with a prefix of "../" or "./", then + /* A. If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, */ if(!strncmp("./", input, 2)) { @@ -919,7 +911,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) input += 3; clen -= 3; } - /* D. if the input buffer consists only of "." or "..", then remove + /* D. if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, */ else if(!strcmp(".", input) || !strcmp("..", input) || @@ -931,7 +923,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) dotdot = FALSE; } else if(*input == '/') { - /* B. if the input buffer begins with a prefix of "/./" or "/.", where + /* B. if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, */ if(!strncmp("/./", input, 3)) { @@ -944,7 +936,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) break; } - /* C. if the input buffer begins with a prefix of "/../" or "/..", + /* C. if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, */ @@ -978,7 +970,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) dotdot = FALSE; if(!dotdot) { - /* E. move the first path segment in the input buffer to the end of + /* E. move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer. */ @@ -1071,7 +1063,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) * Appendix E, but believe me, it was meant to be there. --MK) */ if(ptr[0] != '/' && !STARTS_WITH_URL_DRIVE_PREFIX(ptr)) { - /* the URL includes a host name, it must match "localhost" or + /* the URL includes a hostname, it must match "localhost" or "127.0.0.1" to be valid */ if(checkprefix("localhost/", ptr) || checkprefix("127.0.0.1/", ptr)) { @@ -1081,9 +1073,9 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) #if defined(_WIN32) size_t len; - /* the host name, NetBIOS computer name, can not contain disallowed + /* the hostname, NetBIOS computer name, can not contain disallowed chars, and the delimiting slash character must be appended to the - host name */ + hostname */ path = strpbrk(ptr, "/\\:*?\"<>|"); if(!path || *path != '/') { result = CURLUE_BAD_FILE_URL; @@ -1119,11 +1111,11 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) Curl_dyn_reset(&host); #if !defined(_WIN32) && !defined(MSDOS) && !defined(__CYGWIN__) - /* Don't allow Windows drive letters when not in Windows. + /* Do not allow Windows drive letters when not in Windows. * This catches both "file:/c:" and "file:c:" */ if(('/' == path[0] && STARTS_WITH_URL_DRIVE_PREFIX(&path[1])) || STARTS_WITH_URL_DRIVE_PREFIX(path)) { - /* File drive letters are only accepted in MSDOS/Windows */ + /* File drive letters are only accepted in MS-DOS/Windows */ result = CURLUE_BAD_FILE_URL; goto fail; } @@ -1163,7 +1155,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) result = CURLUE_BAD_SLASHES; goto fail; } - hostp = p; /* host name starts here */ + hostp = p; /* hostname starts here */ } else { /* no scheme! */ @@ -1189,7 +1181,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) } } - /* find the end of the host name + port number */ + /* find the end of the hostname + port number */ hostlen = strcspn(hostp, "/?#"); path = &hostp[hostlen]; @@ -1203,7 +1195,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) if((flags & CURLU_GUESS_SCHEME) && !schemep) { const char *hostname = Curl_dyn_ptr(&host); - /* legacy curl-style guess based on host name */ + /* legacy curl-style guess based on hostname */ if(checkprefix("ftp.", hostname)) schemep = "ftp"; else if(checkprefix("dict.", hostname)) @@ -1224,6 +1216,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) result = CURLUE_OUT_OF_MEMORY; goto fail; } + u->guessed_scheme = TRUE; } } else if(flags & CURLU_NO_AUTHORITY) { @@ -1242,6 +1235,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) fragment = strchr(path, '#'); if(fragment) { fraglen = pathlen - (fragment - path); + u->fragment_present = TRUE; if(fraglen > 1) { /* skip the leading '#' in the copy but include the terminating null */ if(flags & CURLU_URLENCODE) { @@ -1269,6 +1263,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) size_t qlen = fragment ? (size_t)(fragment - query) : pathlen - (query - path); pathlen -= qlen; + u->query_present = TRUE; if(qlen > 1) { if(flags & CURLU_URLENCODE) { struct dynbuf enc; @@ -1404,6 +1399,8 @@ CURLU *curl_url_dup(const CURLU *in) DUP(u, in, fragment); DUP(u, in, zoneid); u->portnum = in->portnum; + u->fragment_present = in->fragment_present; + u->query_present = in->query_present; } return u; fail: @@ -1417,8 +1414,8 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, const char *ptr; CURLUcode ifmissing = CURLUE_UNKNOWN_PART; char portbuf[7]; - bool urldecode = (flags & CURLU_URLDECODE)?1:0; - bool urlencode = (flags & CURLU_URLENCODE)?1:0; + bool urldecode = (flags & CURLU_URLDECODE) ? 1 : 0; + bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0; bool punycode = FALSE; bool depunyfy = FALSE; bool plusdecode = FALSE; @@ -1434,6 +1431,8 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, ptr = u->scheme; ifmissing = CURLUE_NO_SCHEME; urldecode = FALSE; /* never for schemes */ + if((flags & CURLU_NO_GUESS_SCHEME) && u->guessed_scheme) + return CURLUE_NO_SCHEME; break; case CURLUPART_USER: ptr = u->user; @@ -1450,8 +1449,8 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, case CURLUPART_HOST: ptr = u->host; ifmissing = CURLUE_NO_HOST; - punycode = (flags & CURLU_PUNYCODE)?1:0; - depunyfy = (flags & CURLU_PUNY2IDN)?1:0; + punycode = (flags & CURLU_PUNYCODE) ? 1 : 0; + depunyfy = (flags & CURLU_PUNY2IDN) ? 1 : 0; break; case CURLUPART_ZONEID: ptr = u->zoneid; @@ -1462,7 +1461,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, ifmissing = CURLUE_NO_PORT; urldecode = FALSE; /* never for port */ if(!ptr && (flags & CURLU_DEFAULT_PORT) && u->scheme) { - /* there's no stored port number, but asked to deliver + /* there is no stored port number, but asked to deliver a default one for the scheme */ const struct Curl_handler *h = Curl_get_scheme_handler(u->scheme); if(h) { @@ -1488,10 +1487,16 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, ptr = u->query; ifmissing = CURLUE_NO_QUERY; plusdecode = urldecode; + if(ptr && !ptr[0] && !(flags & CURLU_GET_EMPTY)) + /* there was a blank query and the user do not ask for it */ + ptr = NULL; break; case CURLUPART_FRAGMENT: ptr = u->fragment; ifmissing = CURLUE_NO_FRAGMENT; + if(!ptr && u->fragment_present && flags & CURLU_GET_EMPTY) + /* there was a blank fragment and the user asks for it */ + ptr = ""; break; case CURLUPART_URL: { char *url; @@ -1499,18 +1504,24 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, char *options = u->options; char *port = u->port; char *allochost = NULL; - punycode = (flags & CURLU_PUNYCODE)?1:0; - depunyfy = (flags & CURLU_PUNY2IDN)?1:0; + bool show_fragment = + u->fragment || (u->fragment_present && flags & CURLU_GET_EMPTY); + bool show_query = + (u->query && u->query[0]) || + (u->query_present && flags & CURLU_GET_EMPTY); + punycode = (flags & CURLU_PUNYCODE) ? 1 : 0; + depunyfy = (flags & CURLU_PUNY2IDN) ? 1 : 0; if(u->scheme && strcasecompare("file", u->scheme)) { url = aprintf("file://%s%s%s", u->path, - u->fragment? "#": "", - u->fragment? u->fragment : ""); + show_fragment ? "#": "", + u->fragment ? u->fragment : ""); } else if(!u->host) return CURLUE_NO_HOST; else { const struct Curl_handler *h = NULL; + char schemebuf[MAX_SCHEME_LEN + 5]; if(u->scheme) scheme = u->scheme; else if(flags & CURLU_DEFAULT_SCHEME) @@ -1520,7 +1531,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, h = Curl_get_scheme_handler(scheme); if(!port && (flags & CURLU_DEFAULT_PORT)) { - /* there's no stored port number, but asked to deliver + /* there is no stored port number, but asked to deliver a default one for the scheme */ if(h) { msnprintf(portbuf, sizeof(portbuf), "%u", h->defport); @@ -1581,8 +1592,13 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, } } - url = aprintf("%s://%s%s%s%s%s%s%s%s%s%s%s%s%s%s", - scheme, + if(!(flags & CURLU_NO_GUESS_SCHEME) || !u->guessed_scheme) + msnprintf(schemebuf, sizeof(schemebuf), "%s://", scheme); + else + schemebuf[0] = 0; + + url = aprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + schemebuf, u->user ? u->user : "", u->password ? ":": "", u->password ? u->password : "", @@ -1593,10 +1609,10 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, port ? ":": "", port ? port : "", u->path ? u->path : "/", - (u->query && u->query[0]) ? "?": "", - (u->query && u->query[0]) ? u->query : "", - u->fragment? "#": "", - u->fragment? u->fragment : ""); + show_query ? "?": "", + u->query ? u->query : "", + show_fragment ? "#": "", + u->fragment ? u->fragment : ""); free(allochost); } if(!url) @@ -1687,8 +1703,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, const char *part, unsigned int flags) { char **storep = NULL; - long port = 0; - bool urlencode = (flags & CURLU_URLENCODE)? 1 : 0; + bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0; bool plusencode = FALSE; bool urlskipslash = FALSE; bool leadingslash = FALSE; @@ -1705,6 +1720,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, break; case CURLUPART_SCHEME: storep = &u->scheme; + u->guessed_scheme = FALSE; break; case CURLUPART_USER: storep = &u->user; @@ -1730,9 +1746,11 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, break; case CURLUPART_QUERY: storep = &u->query; + u->query_present = FALSE; break; case CURLUPART_FRAGMENT: storep = &u->fragment; + u->fragment_present = FALSE; break; default: return CURLUE_UNKNOWN_PART; @@ -1775,6 +1793,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, } else return CURLUE_BAD_SCHEME; + u->guessed_scheme = FALSE; break; } case CURLUPART_USER: @@ -1794,18 +1813,26 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, storep = &u->zoneid; break; case CURLUPART_PORT: - { - char *endp; - urlencode = FALSE; /* never */ - port = strtol(part, &endp, 10); /* Port number must be decimal */ - if((port <= 0) || (port > 0xffff)) + if(!ISDIGIT(part[0])) + /* not a number */ return CURLUE_BAD_PORT_NUMBER; - if(*endp) - /* weirdly provided number, not good! */ - return CURLUE_BAD_PORT_NUMBER; - storep = &u->port; - } - break; + else { + char *tmp; + char *endp; + unsigned long port; + errno = 0; + port = strtoul(part, &endp, 10); /* must be decimal */ + if(errno || (port > 0xffff) || *endp) + /* weirdly provided number, not good! */ + return CURLUE_BAD_PORT_NUMBER; + tmp = strdup(part); + if(!tmp) + return CURLUE_OUT_OF_MEMORY; + free(u->port); + u->port = tmp; + u->portnum = (unsigned short)port; + return CURLUE_OK; + } case CURLUPART_PATH: urlskipslash = TRUE; leadingslash = TRUE; /* enforce */ @@ -1813,12 +1840,14 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, break; case CURLUPART_QUERY: plusencode = urlencode; - appendquery = (flags & CURLU_APPENDQUERY)?1:0; + appendquery = (flags & CURLU_APPENDQUERY) ? 1 : 0; equalsencode = appendquery; storep = &u->query; + u->query_present = TRUE; break; case CURLUPART_FRAGMENT: storep = &u->fragment; + u->fragment_present = TRUE; break; case CURLUPART_URL: { /* @@ -1837,7 +1866,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, 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'), + * (we could not get an absolute URL in 'oldurl'), * then replace the existing with the new. */ if(Curl_is_absolute_url(part, NULL, 0, flags & (CURLU_GUESS_SCHEME| @@ -1893,7 +1922,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, } else { char out[3]={'%'}; - out[1] = hexdigits[*i>>4]; + out[1] = hexdigits[*i >> 4]; out[2] = hexdigits[*i & 0xf]; result = Curl_dyn_addn(&enc, out, 3); if(result) @@ -1953,10 +1982,26 @@ nomem: else if(what == CURLUPART_HOST) { size_t n = Curl_dyn_len(&enc); if(!n && (flags & CURLU_NO_AUTHORITY)) { - /* Skip hostname check, it's allowed to be empty. */ + /* Skip hostname check, it is allowed to be empty. */ } else { - if(!n || hostname_check(u, (char *)newp, n)) { + bool bad = FALSE; + 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 + URL encoded so we need to decode it to check */ + size_t dlen; + char *decoded = NULL; + CURLcode result = + Curl_urldecode(newp, n, &decoded, &dlen, REJECT_CTRL); + if(result || hostname_check(u, decoded, dlen)) + bad = TRUE; + free(decoded); + } + else if(hostname_check(u, (char *)newp, n)) + bad = TRUE; + if(bad) { Curl_dyn_free(&enc); return CURLUE_BAD_HOSTNAME; } @@ -1966,9 +2011,5 @@ nomem: free(*storep); *storep = (char *)newp; } - /* set after the string, to make it not assigned if the allocation above - fails */ - if(port) - u->portnum = port; return CURLUE_OK; } diff --git a/deps/curl/lib/urldata.h b/deps/curl/lib/urldata.h index b9e57027..704fb7a1 100644 --- a/deps/curl/lib/urldata.h +++ b/deps/curl/lib/urldata.h @@ -55,10 +55,19 @@ struct curl_trc_featt; -#ifdef USE_WEBSOCKETS +#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) +#endif + +#ifndef CURL_DISABLE_WEBSOCKETS /* CURLPROTO_GOPHERS (29) is the highest publicly used protocol bit number, * the rest are internal information. If we use higher bits we only do this on - * platforms that have a >= 64 bit type and then we use such a type for the + * 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 (1<<30) @@ -68,6 +77,10 @@ struct curl_trc_featt; #define CURLPROTO_WSS 0 #endif +/* the default protocols accepting a redirect to */ +#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \ + CURLPROTO_FTPS) + /* This should be undefined once we need bit 32 or higher */ #define PROTO_TYPE_SMALL @@ -92,6 +105,12 @@ typedef unsigned int curl_prot_t; #define CURL_DEFAULT_USER "anonymous" #define CURL_DEFAULT_PASSWORD "ftp@example.com" +#if !defined(_WIN32) && !defined(MSDOS) && !defined(__EMX__) +/* do FTP line-end CRLF => LF conversions on platforms that prefer LF-only. It + also means: keep CRLF line endings on the CRLF platforms */ +#define CURL_PREFER_LF_LINEENDS +#endif + /* Convenience defines for checking protocols or their SSL based version. Each protocol handler should only ever have a single CURLPROTO_ in its protocol field. */ @@ -104,7 +123,7 @@ typedef unsigned int curl_prot_t; #define PROTO_FAMILY_SSH (CURLPROTO_SCP|CURLPROTO_SFTP) #if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) || \ - !defined(CURL_DISABLE_POP3) + !defined(CURL_DISABLE_POP3) || !defined(CURL_DISABLE_FILE) /* these protocols support CURLOPT_DIRLISTONLY */ #define CURL_LIST_ONLY_PROTOCOL 1 #endif @@ -144,12 +163,14 @@ typedef unsigned int curl_prot_t; #include "dynbuf.h" #include "dynhds.h" #include "request.h" +#include "netrc.h" /* return the count of bytes sent, or -1 on error */ typedef ssize_t (Curl_send)(struct Curl_easy *data, /* transfer */ int sockindex, /* socketindex */ const void *buf, /* data to write */ size_t len, /* max amount to write */ + bool eos, /* last chunk */ CURLcode *err); /* error to return */ /* return the count of bytes read, or -1 on error */ @@ -163,7 +184,6 @@ typedef ssize_t (Curl_recv)(struct Curl_easy *data, /* transfer */ typedef CURLcode (*Curl_datastream)(struct Curl_easy *data, struct connectdata *conn, int *didwhat, - bool *done, int select_res); #endif @@ -233,8 +253,7 @@ typedef CURLcode (*Curl_datastream)(struct Curl_easy *data, #ifdef HAVE_GSSAPI /* Types needed for krb5-ftp connections */ struct krb5buffer { - void *data; - size_t size; + struct dynbuf buf; size_t index; BIT(eof_flag); }; @@ -250,22 +269,6 @@ enum protection_level { }; #endif -/* enum for the nonblocking SSL connection state machine */ -typedef enum { - ssl_connect_1, - ssl_connect_2, - ssl_connect_2_reading, - ssl_connect_2_writing, - ssl_connect_3, - ssl_connect_done -} ssl_connect_state; - -typedef enum { - ssl_connection_none, - ssl_connection_negotiating, - ssl_connection_complete -} ssl_connection_state; - /* SSL backend-specific data; declared differently by each SSL backend */ struct ssl_backend_data; @@ -280,10 +283,12 @@ struct ssl_peer { char *dispname; /* display version of hostname */ char *sni; /* SNI version of hostname or NULL if not usable */ ssl_peer_type type; /* type of the peer information */ + int port; /* port we are talking to */ + int transport; /* one of TRNSPRT_* defines */ }; struct ssl_primary_config { - char *CApath; /* certificate dir (doesn't work on windows) */ + char *CApath; /* certificate dir (does not work on Windows) */ char *CAfile; /* certificate to verify peer against */ char *issuercert; /* optional issuer certificate filename */ char *clientcert; @@ -305,7 +310,7 @@ struct ssl_primary_config { BIT(verifypeer); /* set TRUE if this is desired */ BIT(verifyhost); /* set TRUE if CN/SAN must match hostname */ BIT(verifystatus); /* set TRUE if certificate status must be checked */ - BIT(sessionid); /* cache session IDs or not */ + BIT(cache_session); /* cache session or not */ }; struct ssl_config_data { @@ -314,15 +319,16 @@ struct ssl_config_data { 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 *key; /* private key file name */ + char *key; /* private key filename */ struct curl_blob *key_blob; 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(falsestart); + BIT(earlydata); /* use tls1.3 early data */ BIT(enable_beast); /* allow this flaw for interoperability's sake */ BIT(no_revoke); /* disable SSL certificate revocation checks */ - BIT(no_partialchain); /* don't accept partial certificate chains */ + 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 */ @@ -335,16 +341,21 @@ struct ssl_general_config { int ca_cache_timeout; /* Certificate store cache timeout (seconds) */ }; +typedef void Curl_ssl_sessionid_dtor(void *sessionid, size_t idsize); + /* information stored about one single SSL session */ struct Curl_ssl_session { - char *name; /* host name for which this ID was used */ - char *conn_to_host; /* host name for the connection (may be NULL) */ + char *name; /* hostname for which this ID was used */ + char *conn_to_host; /* hostname for the connection (may be NULL) */ const char *scheme; /* protocol scheme used */ + char *alpn; /* APLN TLS negotiated protocol string */ void *sessionid; /* as returned from the SSL layer */ size_t idsize; /* if known, otherwise 0 */ + Curl_ssl_sessionid_dtor *sessionid_free; /* free `sessionid` callback */ long age; /* just a number, the higher the more recent */ int remote_port; /* remote port */ int conn_to_port; /* remote port for the connection (may be -1) */ + int transport; /* TCP or QUIC */ struct ssl_primary_config ssl_config; /* setup for this session */ }; @@ -444,15 +455,7 @@ struct ntlmdata { unsigned int flags; unsigned char nonce[8]; unsigned int target_info_len; - void *target_info; /* TargetInfo received in the ntlm type-2 message */ - -#if defined(NTLM_WB_ENABLED) - /* used for communication with Samba's winbind daemon helper ntlm_auth */ - curl_socket_t ntlm_auth_hlpr_socket; - pid_t ntlm_auth_hlpr_pid; - char *challenge; /* The received base64 encoded ntlm type-2 message */ - char *response; /* The generated base64 ntlm type-1/type-3 message */ -#endif + void *target_info; /* TargetInfo received in the NTLM type-2 message */ #endif }; #endif @@ -465,6 +468,7 @@ struct negotiatedata { gss_ctx_id_t context; gss_name_t spn; gss_buffer_desc output_token; + struct dynbuf channel_binding_data; #else #ifdef USE_WINDOWS_SSPI #ifdef SECPKG_ATTR_ENDPOINT_BINDINGS @@ -506,9 +510,6 @@ struct ConnectBits { This is implicit when SSL-protocols are used through proxies, but can also be enabled explicitly by apps */ - BIT(proxy_connect_closed); /* TRUE if a proxy disconnected the connection - in a CONNECT request with auth, so that - libcurl should reconnect and continue. */ BIT(proxy); /* if set, this transfer is done through a proxy - any type */ #endif /* always modify bits.close with the connclose() and connkeep() macros! */ @@ -530,10 +531,10 @@ struct ConnectBits { re-attempted at another connection. */ #ifndef CURL_DISABLE_FTP BIT(ftp_use_epsv); /* As set with CURLOPT_FTP_USE_EPSV, but if we find out - EPSV doesn't work we disable it for the forthcoming + EPSV does not work we disable it for the forthcoming requests */ BIT(ftp_use_eprt); /* As set with CURLOPT_FTP_USE_EPRT, but if we find out - EPRT doesn't work we disable it for the forthcoming + EPRT does not work we disable it for the forthcoming requests */ BIT(ftp_use_data_ssl); /* Enabled SSL for the data connection */ BIT(ftp_use_control_ssl); /* Enabled SSL for the control connection */ @@ -543,6 +544,7 @@ struct ConnectBits { #endif BIT(bound); /* set true if bind() has already been done on this socket/ connection */ + BIT(asks_multiplex); /* connection asks for multiplexing, but is not yet */ BIT(multiplex); /* connection is multiplexed */ BIT(tcp_fastopen); /* use TCP Fast Open */ BIT(tls_enable_alpn); /* TLS ALPN extension? */ @@ -557,6 +559,10 @@ struct ConnectBits { accept() */ BIT(parallel_connect); /* set TRUE when a parallel connect attempt has started (happy eyeballs) */ + BIT(aborted); /* connection was aborted, e.g. in unclean state */ + BIT(shutdown_handler); /* connection shutdown: handler shut down */ + BIT(shutdown_filters); /* connection shutdown: filters shut down */ + BIT(in_cpool); /* connection is kept in a connection pool */ }; struct hostname { @@ -580,6 +586,14 @@ struct hostname { #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) @@ -617,30 +631,12 @@ struct easy_pollset { unsigned char actions[MAX_SOCKSPEREASYHANDLE]; }; -enum doh_slots { - /* Explicit values for first two symbols so as to match hard-coded - * constants in existing code - */ - DOH_PROBE_SLOT_IPADDR_V4 = 0, /* make 'V4' stand out for readability */ - DOH_PROBE_SLOT_IPADDR_V6 = 1, /* 'V6' likewise */ - - /* Space here for (possibly build-specific) additional slot definitions */ - - /* for example */ - /* #ifdef WANT_DOH_FOOBAR_TXT */ - /* DOH_PROBE_SLOT_FOOBAR_TXT, */ - /* #endif */ - - /* AFTER all slot definitions, establish how many we have */ - DOH_PROBE_SLOTS -}; - /* * Specific protocol handler. */ struct Curl_handler { - const char *scheme; /* URL scheme name. */ + const char *scheme; /* URL scheme name in lowercase */ /* Complement to setup_connection_internals(). This is done before the transfer "owns" the connection. */ @@ -660,7 +656,7 @@ struct Curl_handler { /* This function *MAY* be set to a protocol-dependent function that is run * after the connect() and everything is done, as a step in the connection. * The 'done' pointer points to a bool that should be set to TRUE if the - * function completes before return. If it doesn't complete, the caller + * function completes before return. If it does not complete, the caller * should call the ->connecting() function until it is. */ CURLcode (*connect_it)(struct Curl_easy *data, bool *done); @@ -691,7 +687,7 @@ struct Curl_handler { struct connectdata *conn, curl_socket_t *socks); /* This function *MAY* be set to a protocol-dependent function that is run - * by the curl_disconnect(), as a step in the disconnection. If the handler + * by the curl_disconnect(), as a step in the disconnection. If the handler * is called because the connection has been considered dead, * dead_connection is set to TRUE. The connection is (again) associated with * the transfer here. @@ -699,11 +695,17 @@ struct Curl_handler { CURLcode (*disconnect)(struct Curl_easy *, struct connectdata *, bool dead_connection); - /* If used, this function gets called from transfer.c:readwrite_data() to + /* If used, this function gets called from transfer.c to allow the protocol to do extra handling in writing response to the client. */ CURLcode (*write_resp)(struct Curl_easy *data, const char *buf, size_t blen, - bool is_eos, bool *done); + bool is_eos); + + /* If used, this function gets called from transfer.c to + allow the protocol to do extra handling in writing a single response + header line to the client. */ + CURLcode (*write_resp_hd)(struct Curl_easy *data, + const char *hd, size_t hdlen, bool is_eos); /* This function can perform various checks on the connection. See CONNCHECK_* for more information about the checks that can be performed, @@ -733,11 +735,11 @@ struct Curl_handler { the send function might need to be called while uploading, or vice versa. */ #define PROTOPT_DIRLOCK (1<<3) -#define PROTOPT_NONETWORK (1<<4) /* protocol doesn't use the network! */ +#define PROTOPT_NONETWORK (1<<4) /* protocol does not use the network! */ #define PROTOPT_NEEDSPWD (1<<5) /* needs a password, and if none is set it gets a default */ -#define PROTOPT_NOURLQUERY (1<<6) /* protocol can't handle - url query strings (?foo=bar) ! */ +#define PROTOPT_NOURLQUERY (1<<6) /* protocol cannot handle + URL query strings (?foo=bar) ! */ #define PROTOPT_CREDSPERREQUEST (1<<7) /* requires login credentials per request instead of per connection */ #define PROTOPT_ALPN (1<<8) /* set ALPN for this */ @@ -748,9 +750,9 @@ struct Curl_handler { 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_USERPWDCTRL (1<<13) /* Allow "control bytes" (< 32 ascii) in - user name and password */ -#define PROTOPT_NOTCPPROXY (1<<14) /* this protocol can't proxy over TCP */ +#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 CONNCHECK_NONE 0 /* No checks */ #define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ @@ -759,12 +761,19 @@ struct Curl_handler { #define CONNRESULT_NONE 0 /* No extra information. */ #define CONNRESULT_DEAD (1<<0) /* The connection is dead. */ +struct ip_quadruple { + char remote_ip[MAX_IPADR_LEN]; + char local_ip[MAX_IPADR_LEN]; + int remote_port; + int local_port; +}; + struct proxy_info { struct hostname host; int port; unsigned char proxytype; /* curl_proxytype: what kind of proxy that is in use */ - char *user; /* proxy user name string, allocated */ + char *user; /* proxy username string, allocated */ char *passwd; /* proxy password string, allocated */ }; @@ -780,20 +789,22 @@ struct ldapconninfo; * unique for an entire connection. */ struct connectdata { - struct Curl_llist_element bundle_node; /* conncache */ + struct Curl_llist_node cpool_node; /* conncache lists */ curl_closesocket_callback fclosesocket; /* function closing the socket(s) */ void *closesocket_client; - /* This is used by the connection cache logic. If this returns TRUE, this + /* This is used by the connection pool logic. If this returns TRUE, this 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) ((c)->easyq.size) +#define CONN_INUSE(c) Curl_llist_count(&(c)->easyq) /**** Fields set when inited and not modified again */ curl_off_t connection_id; /* Contains a unique number to make it easier to track the connections in the log output */ + char *destination; /* string carrying normalized hostname+port+scope */ + size_t destination_len; /* strlen(destination) + 1 */ /* 'dns_entry' is the particular host we use. This points to an entry in the DNS cache and it will not get pruned while locked. It gets unlocked in @@ -806,35 +817,42 @@ struct connectdata { const struct Curl_sockaddr_ex *remote_addr; struct hostname host; - char *hostname_resolve; /* host name to resolve to address, allocated */ - char *secondaryhostname; /* secondary socket host name (ftp) */ + char *hostname_resolve; /* hostname to resolve to address, allocated */ + char *secondaryhostname; /* secondary socket hostname (ftp) */ struct hostname conn_to_host; /* the host to connect to. valid only if bits.conn_to_host is set */ #ifndef CURL_DISABLE_PROXY struct proxy_info socks_proxy; struct proxy_info http_proxy; #endif - /* 'primary_ip' and 'primary_port' get filled with peer's numerical - ip address and port number whenever an outgoing connection is - *attempted* from the primary socket to a remote address. When more - than one address is tried for a connection these will hold data + /* 'primary' and 'secondary' get filled with IP quadruple + (local/remote numerical ip address and port) whenever a connect is + *attempted*. + When more than one address is tried for a connection these will hold data for the last attempt. When the connection is actually established these are updated with data which comes directly from the socket. */ - - char primary_ip[MAX_IPADR_LEN]; - char *user; /* user name string, allocated */ + struct ip_quadruple primary; + struct ip_quadruple secondary; + char *user; /* username string, allocated */ char *passwd; /* password string, allocated */ char *options; /* options string, allocated */ char *sasl_authzid; /* authorization identity string, allocated */ char *oauth_bearer; /* OAUTH2 bearer, allocated */ struct curltime now; /* "current" time */ struct curltime created; /* creation time */ - struct curltime lastused; /* when returned to the connection cache */ + struct curltime lastused; /* when returned to the connection poolas idle */ curl_socket_t sock[2]; /* two sockets, the second is used for the data transfer when doing FTP */ Curl_recv *recv[2]; Curl_send *send[2]; struct Curl_cfilter *cfilter[2]; /* connection filters */ + struct { + struct curltime start[2]; /* when filter shutdown started */ + unsigned int timeout_ms; /* 0 means no timeout */ + } shutdown; + /* Last pollset used in connection shutdown. Used to detect changes + * for multi_socket API. */ + struct easy_pollset shutdown_poll; struct ssl_primary_config ssl_config; #ifndef CURL_DISABLE_PROXY @@ -853,9 +871,8 @@ struct connectdata { /**** curl_get() phase fields */ curl_socket_t sockfd; /* socket to read from or CURL_SOCKET_BAD */ - curl_socket_t writesockfd; /* socket to write to, it may very - well be the same we read from. - CURL_SOCKET_BAD disables */ + curl_socket_t writesockfd; /* socket to write to, it may be the same we read + from. CURL_SOCKET_BAD disables */ #ifdef HAVE_GSSAPI BIT(sec_complete); /* if Kerberos is enabled for this connection */ @@ -874,19 +891,12 @@ struct connectdata { #endif /* however, some of them are ftp specific. */ struct Curl_llist easyq; /* List of easy handles using this connection */ - curl_seek_callback seek_func; /* function that seeks the input */ - void *seek_client; /* pointer to pass to the seek() above */ /*************** Request - specific items ************/ #if defined(USE_WINDOWS_SSPI) && defined(SECPKG_ATTR_ENDPOINT_BINDINGS) CtxtHandle *sslContext; #endif -#if defined(_WIN32) && defined(USE_WINSOCK) - struct curltime last_sndbuf_update; /* last time readwrite_upload called - win_update_buffer_size */ -#endif - #ifdef USE_GSASL struct gsasldata gsasl; #endif @@ -943,13 +953,12 @@ struct connectdata { #ifndef CURL_DISABLE_MQTT struct mqtt_conn mqtt; #endif -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS struct websocket *ws; #endif unsigned int unused:1; /* avoids empty union */ } proto; - struct connectbundle *bundle; /* The bundle we are member of */ #ifdef USE_UNIX_SOCKETS char *unix_domain_socket; #endif @@ -960,7 +969,7 @@ struct connectdata { /* When this connection is created, store the conditions for the local end bind. This is stored before the actual bind and before any connection is made and will serve the purpose of being used for comparison reasons so - that subsequent bound-requested connections aren't accidentally reusing + that subsequent bound-requested connections are not accidentally reusing wrong connections. */ char *localdev; unsigned short localportrange; @@ -969,11 +978,10 @@ struct connectdata { int socks5_gssapi_enctype; #endif /* The field below gets set in connect.c:connecthost() */ - int port; /* which port to use locally - to connect to */ 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 */ -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int scope_id; /* Scope id for IPv6 */ #endif unsigned short localport; @@ -1020,60 +1028,62 @@ struct PureInfo { unsigned long httpauthavail; /* what host auth types were announced */ long numconnects; /* how many new connection did libcurl created */ char *contenttype; /* the content type of the object */ - char *wouldredirect; /* URL this would've been redirected to if asked to */ + char *wouldredirect; /* URL this would have been redirected to if asked to */ curl_off_t retry_after; /* info from Retry-After: header */ unsigned int header_size; /* size of read header(s) in bytes */ - /* PureInfo members 'conn_primary_ip', 'conn_primary_port', 'conn_local_ip' - and, 'conn_local_port' are copied over from the connectdata struct in - order to allow curl_easy_getinfo() to return this information even when - the session handle is no longer associated with a connection, and also - allow curl_easy_reset() to clear this information from the session handle - without disturbing information which is still alive, and that might be - reused, in the connection cache. */ - - char conn_primary_ip[MAX_IPADR_LEN]; - int conn_primary_port; /* this is the destination port to the connection, - which might have been a proxy */ + /* PureInfo primary ip_quadruple is copied over from the connectdata + struct in order to allow curl_easy_getinfo() to return this information + even when the session handle is no longer associated with a connection, + and also allow curl_easy_reset() to clear this information from the + session handle without disturbing information which is still alive, and + that might be reused, in the connection pool. */ + struct ip_quadruple primary; int conn_remote_port; /* this is the "remote port", which is the port number of the used URL, independent of proxy or not */ - char conn_local_ip[MAX_IPADR_LEN]; - int conn_local_port; const char *conn_scheme; unsigned int conn_protocol; struct curl_certinfo certs; /* info about the certs. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ CURLproxycode pxcode; - BIT(timecond); /* set to TRUE if the time condition didn't match, which + BIT(timecond); /* set to TRUE if the time condition did not match, which thus made the document NOT get fetched */ 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 Progress { time_t lastshow; /* time() of the last displayed progress meter or NULL to force redraw at next call */ - curl_off_t size_dl; /* total expected size */ - curl_off_t size_ul; /* total expected size */ - curl_off_t downloaded; /* transferred so far */ - curl_off_t uploaded; /* transferred so far */ + struct pgrs_dir ul; + struct pgrs_dir dl; curl_off_t current_speed; /* uses the currently fastest transfer */ + curl_off_t earlydata_sent; int width; /* screen width at download start */ int flags; /* see progress.h */ timediff_t timespent; - curl_off_t dlspeed; - curl_off_t ulspeed; - timediff_t t_postqueue; timediff_t t_nslookup; timediff_t t_connect; timediff_t t_appconnect; timediff_t t_pretransfer; + timediff_t t_posttransfer; timediff_t t_starttransfer; timediff_t t_redirect; @@ -1082,14 +1092,6 @@ struct Progress { struct curltime t_startop; struct curltime t_acceptdata; - - /* upload speed limit */ - struct curltime ul_limit_start; - curl_off_t ul_limit_size; - /* download speed limit */ - struct curltime dl_limit_start; - curl_off_t dl_limit_size; - #define CURR_TIME (5 + 1) /* 6 entries for 5 seconds */ curl_off_t speeder[ CURR_TIME ]; @@ -1186,7 +1188,7 @@ typedef enum { * One instance for each timeout an easy handle can set. */ struct time_node { - struct Curl_llist_element list; + struct Curl_llist_node list; struct curltime time; expire_id eid; }; @@ -1203,9 +1205,12 @@ struct urlpieces { char *query; }; +#define CREDS_NONE 0 +#define CREDS_URL 1 /* from URL */ +#define CREDS_OPTION 2 /* set with a CURLOPT_ */ +#define CREDS_NETRC 3 /* found in netrc */ + struct UrlState { - /* Points to the connection cache */ - struct conncache *conn_cache; /* buffers to store authentication data in, as parsed from input options */ struct curltime keeps_speed; /* for the progress meter really */ @@ -1218,8 +1223,8 @@ struct UrlState { curl_off_t current_speed; /* the ProgressShow() function sets this, bytes / second */ - /* host name, port number and protocol of the first (not followed) request. - if set, this should be the host name that we will sent authorization to, + /* hostname, port number and protocol of the first (not followed) request. + if set, this should be the hostname that we will sent authorization to, no else. Used to make Location: following not keep sending user+password. This is strdup()ed data. */ char *first_host; @@ -1230,7 +1235,6 @@ struct UrlState { struct Curl_ssl_session *session; /* array of 'max_ssl_sessions' size */ long sessionage; /* number of the most recent session */ int os_errno; /* filled in with errno whenever an error occurs */ - char *scratch; /* huge buffer[set.buffer_size*2] for upload CRLF replacing */ long followlocation; /* redirect counter */ int requests; /* request counter: redirects + authentication retakes */ #ifdef HAVE_SIGNAL @@ -1258,12 +1262,6 @@ struct UrlState { /* a place to store the most recently set (S)FTP entrypath */ char *most_recent_ftp_entrypath; -#if !defined(_WIN32) && !defined(MSDOS) && !defined(__EMX__) -/* do FTP line-end conversions on most platforms */ -#define CURL_DO_LINEEND_CONV - /* for FTP downloads: how many CRLFs did we converted to LFs? */ - curl_off_t crlf_conversions; -#endif char *range; /* range, if used. See README for detailed specification on this syntax. */ curl_off_t resume_from; /* continue [ftp] transfer from here */ @@ -1320,27 +1318,36 @@ struct UrlState { struct curl_trc_feat *feat; /* opt. trace feature transfer is part of */ #endif +#ifndef CURL_DISABLE_NETRC + struct store_netrc netrc; +#endif + /* Dynamically allocated strings, MUST be freed before this struct is killed. */ struct dynamically_allocated_data { - char *proxyuserpwd; char *uagent; char *accept_encoding; char *userpwd; char *rangeline; char *ref; char *host; +#ifndef CURL_DISABLE_COOKIES char *cookiehost; +#endif +#ifndef CURL_DISABLE_RTSP char *rtsp_transport; +#endif char *te; /* TE: request header */ /* transfer credentials */ char *user; char *passwd; +#ifndef CURL_DISABLE_PROXY + char *proxyuserpwd; char *proxyuser; char *proxypasswd; +#endif } aptr; - unsigned char httpwant; /* when non-zero, a specific HTTP version requested to be used in the library's request(s) */ unsigned char httpversion; /* the lowest HTTP version*10 reported by any @@ -1350,9 +1357,9 @@ struct UrlState { unsigned char select_bits; /* != 0 -> bitmask of socket events for this transfer overriding anything the socket may report */ -#ifdef CURLDEBUG - BIT(conncache_lock); -#endif + unsigned int creds_from:2; /* where is the server credentials originating + from, see the CREDS_* defines above */ + /* when curl_easy_perform() is called, the multi handle is "owned" by the easy handle so curl_easy_cleanup() on such an easy handle will also close the multi handle! */ @@ -1365,10 +1372,9 @@ struct UrlState { called. */ BIT(allow_port); /* Is set.use_port allowed to take effect or not. This is always set TRUE when curl_easy_perform() is called. */ - BIT(authproblem); /* TRUE if there's some problem authenticating */ + BIT(authproblem); /* TRUE if there is some problem authenticating */ /* set after initial USER failure, to prevent an authentication loop */ BIT(wildcardmatch); /* enable wildcard matching */ - BIT(expect100header); /* TRUE if we added Expect: 100-continue */ BIT(disableexpect); /* TRUE if Expect: is disabled due to a previous 417 response */ BIT(use_range); @@ -1376,7 +1382,6 @@ struct UrlState { BIT(done); /* set to FALSE when Curl_init_do() is called and set to TRUE when multi_done() is called, to prevent multi_done() to get invoked twice when the multi interface is used. */ - BIT(previouslypending); /* this transfer WAS in the multi->pending queue */ #ifndef CURL_DISABLE_COOKIES BIT(cookie_engine); #endif @@ -1404,95 +1409,129 @@ struct UrlState { struct Curl_multi; /* declared in multihandle.c */ -/* - * This enumeration MUST not use conditional directives (#ifdefs), new - * null terminated strings MUST be added to the enumeration immediately - * before STRING_LASTZEROTERMINATED, binary fields immediately before - * STRING_LAST. When doing so, ensure that the packages/OS400/chkstring.c - * test is updated and applicable changes for EBCDIC to ASCII conversion - * are catered for in curl_easy_setopt_ccsid() - */ enum dupstring { - STRING_CERT, /* client certificate file name */ - STRING_CERT_PROXY, /* client certificate file name */ + STRING_CERT, /* client certificate filename */ STRING_CERT_TYPE, /* format for certificate (default: PEM)*/ + STRING_KEY, /* private key filename */ + STRING_KEY_PASSWD, /* plain text private key password */ + STRING_KEY_TYPE, /* format for private key (default: PEM) */ + STRING_SSL_CAPATH, /* CA directory name (does not work on Windows) */ + STRING_SSL_CAFILE, /* certificate file to verify peer against */ + 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_ISSUERCERT, /* issuer cert file to check certificate */ + STRING_SERVICE_NAME, /* Service name */ +#ifndef CURL_DISABLE_PROXY + STRING_CERT_PROXY, /* client certificate filename */ STRING_CERT_TYPE_PROXY, /* format for certificate (default: PEM)*/ + STRING_KEY_PROXY, /* private key filename */ + STRING_KEY_PASSWD_PROXY, /* plain text private key password */ + STRING_KEY_TYPE_PROXY, /* format for private key (default: PEM) */ + STRING_SSL_CAPATH_PROXY, /* CA directory name (does not work on Windows) */ + STRING_SSL_CAFILE_PROXY, /* certificate file to verify peer against */ + 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_ISSUERCERT_PROXY, /* issuer cert file to check certificate */ + STRING_PROXY_SERVICE_NAME, /* Proxy service name */ +#endif +#ifndef CURL_DISABLE_COOKIES STRING_COOKIE, /* HTTP cookie string to send */ STRING_COOKIEJAR, /* dump all cookies to this file */ +#endif STRING_CUSTOMREQUEST, /* HTTP/FTP/RTSP request/method to use */ - STRING_DEFAULT_PROTOCOL, /* Protocol to use when the URL doesn't specify */ + STRING_DEFAULT_PROTOCOL, /* Protocol to use when the URL does not specify */ STRING_DEVICE, /* local network interface/address to use */ + STRING_INTERFACE, /* local network interface to use */ + STRING_BINDHOST, /* local address to use */ STRING_ENCODING, /* Accept-Encoding string */ +#ifndef CURL_DISABLE_FTP STRING_FTP_ACCOUNT, /* ftp account data */ STRING_FTP_ALTERNATIVE_TO_USER, /* command to send if USER/PASS fails */ STRING_FTPPORT, /* port to send with the FTP PORT command */ - STRING_KEY, /* private key file name */ - STRING_KEY_PROXY, /* private key file name */ - STRING_KEY_PASSWD, /* plain text private key password */ - STRING_KEY_PASSWD_PROXY, /* plain text private key password */ - STRING_KEY_TYPE, /* format for private key (default: PEM) */ - STRING_KEY_TYPE_PROXY, /* format for private key (default: PEM) */ +#endif +#if defined(HAVE_GSSAPI) STRING_KRB_LEVEL, /* krb security level */ +#endif +#ifndef CURL_DISABLE_NETRC STRING_NETRC_FILE, /* if not NULL, use this instead of trying to find $HOME/.netrc */ +#endif +#ifndef CURL_DISABLE_PROXY STRING_PROXY, /* proxy to use */ STRING_PRE_PROXY, /* pre socks proxy to use */ +#endif STRING_SET_RANGE, /* range, if used */ STRING_SET_REFERER, /* custom string for the HTTP referer field */ STRING_SET_URL, /* what original URL to work on */ - STRING_SSL_CAPATH, /* CA directory name (doesn't work on windows) */ - STRING_SSL_CAPATH_PROXY, /* CA directory name (doesn't work on windows) */ - STRING_SSL_CAFILE, /* certificate file to verify peer against */ - STRING_SSL_CAFILE_PROXY, /* certificate file to verify peer against */ - STRING_SSL_PINNEDPUBLICKEY, /* public key file to verify peer against */ - STRING_SSL_PINNEDPUBLICKEY_PROXY, /* public key file to verify proxy */ - STRING_SSL_CIPHER_LIST, /* list of ciphers to use */ - STRING_SSL_CIPHER_LIST_PROXY, /* list of ciphers to use */ - STRING_SSL_CIPHER13_LIST, /* list of TLS 1.3 ciphers to use */ - STRING_SSL_CIPHER13_LIST_PROXY, /* list of TLS 1.3 ciphers to use */ STRING_USERAGENT, /* User-Agent string */ - STRING_SSL_CRLFILE, /* crl file to check certificate */ - STRING_SSL_CRLFILE_PROXY, /* crl file to check certificate */ - STRING_SSL_ISSUERCERT, /* issuer cert file to check certificate */ - STRING_SSL_ISSUERCERT_PROXY, /* issuer cert file to check certificate */ STRING_SSL_ENGINE, /* name of ssl engine */ STRING_USERNAME, /* , if used */ STRING_PASSWORD, /* , if used */ STRING_OPTIONS, /* , if used */ +#ifndef CURL_DISABLE_PROXY STRING_PROXYUSERNAME, /* Proxy , if used */ STRING_PROXYPASSWORD, /* Proxy , if used */ STRING_NOPROXY, /* List of hosts which should not use the proxy, if used */ +#endif +#ifndef CURL_DISABLE_RTSP STRING_RTSP_SESSION_ID, /* Session ID to use */ STRING_RTSP_STREAM_URI, /* Stream URI for this request */ STRING_RTSP_TRANSPORT, /* Transport for this session */ +#endif +#ifdef USE_SSH STRING_SSH_PRIVATE_KEY, /* path to the private key file for auth */ STRING_SSH_PUBLIC_KEY, /* path to the public key file for auth */ - STRING_SSH_HOST_PUBLIC_KEY_MD5, /* md5 of host public key in ascii hex */ + STRING_SSH_HOST_PUBLIC_KEY_MD5, /* md5 of host public key in ASCII hex */ STRING_SSH_HOST_PUBLIC_KEY_SHA256, /* sha256 of host public key in base64 */ - STRING_SSH_KNOWNHOSTS, /* file name of knownhosts file */ - STRING_PROXY_SERVICE_NAME, /* Proxy service name */ - STRING_SERVICE_NAME, /* Service name */ + STRING_SSH_KNOWNHOSTS, /* filename of knownhosts file */ +#endif +#ifndef CURL_DISABLE_SMTP STRING_MAIL_FROM, STRING_MAIL_AUTH, +#endif +#ifdef USE_TLS_SRP STRING_TLSAUTH_USERNAME, /* TLS auth */ - STRING_TLSAUTH_USERNAME_PROXY, /* TLS auth */ STRING_TLSAUTH_PASSWORD, /* TLS auth */ +#ifndef CURL_DISABLE_PROXY + STRING_TLSAUTH_USERNAME_PROXY, /* TLS auth */ STRING_TLSAUTH_PASSWORD_PROXY, /* TLS auth */ +#endif +#endif STRING_BEARER, /* , if used */ +#ifdef USE_UNIX_SOCKETS STRING_UNIX_SOCKET_PATH, /* path to Unix socket, if used */ +#endif STRING_TARGET, /* CURLOPT_REQUEST_TARGET */ +#ifndef CURL_DISABLE_DOH STRING_DOH, /* CURLOPT_DOH_URL */ +#endif +#ifndef CURL_DISABLE_ALTSVC STRING_ALTSVC, /* CURLOPT_ALTSVC */ +#endif +#ifndef CURL_DISABLE_HSTS STRING_HSTS, /* CURLOPT_HSTS */ +#endif STRING_SASL_AUTHZID, /* CURLOPT_SASL_AUTHZID */ +#ifdef USE_ARES STRING_DNS_SERVERS, STRING_DNS_INTERFACE, STRING_DNS_LOCAL_IP4, STRING_DNS_LOCAL_IP6, +#endif STRING_SSL_EC_CURVES, +#ifndef CURL_DISABLE_AWS STRING_AWS_SIGV4, /* Parameters for V4 signature */ +#endif +#ifndef CURL_DISABLE_PROXY STRING_HAPROXY_CLIENT_IP, /* CURLOPT_HAPROXY_CLIENT_IP */ +#endif + STRING_ECH_CONFIG, /* CURLOPT_ECH_CONFIG */ + STRING_ECH_PUBLIC, /* CURLOPT_ECH_PUBLIC */ /* -- end of null-terminated strings -- */ @@ -1507,18 +1546,20 @@ enum dupstring { enum dupblob { BLOB_CERT, - BLOB_CERT_PROXY, BLOB_KEY, - BLOB_KEY_PROXY, BLOB_SSL_ISSUERCERT, - BLOB_SSL_ISSUERCERT_PROXY, BLOB_CAINFO, +#ifndef CURL_DISABLE_PROXY + BLOB_CERT_PROXY, + BLOB_KEY_PROXY, + BLOB_SSL_ISSUERCERT_PROXY, BLOB_CAINFO_PROXY, +#endif BLOB_LAST }; /* callback that gets called when this easy handle is completed within a multi - handle. Only used for internally created transfers, like for example + handle. Only used for internally created transfers, like for example DoH. */ typedef int (*multidone_func)(struct Curl_easy *easy, CURLcode result); @@ -1543,7 +1584,7 @@ struct UserDefined { #ifndef CURL_DISABLE_BINDLOCAL unsigned short localport; /* local port number to bind to */ unsigned short localportrange; /* number of additional port numbers to test - in case the 'localport' one can't be + in case the 'localport' one cannot be bind()ed */ #endif curl_write_callback fwrite_func; /* function that stores the output */ @@ -1576,9 +1617,10 @@ struct UserDefined { void *progress_client; /* pointer to pass to the progress callback */ void *ioctl_client; /* pointer to pass to the ioctl callback */ unsigned int timeout; /* ms, 0 means no timeout */ - unsigned int connecttimeout; /* ms, 0 means no timeout */ + unsigned int connecttimeout; /* ms, 0 means default timeout */ unsigned int happy_eyeballs_timeout; /* ms, 0 is a valid value */ unsigned int server_response_timeout; /* ms, 0 means no timeout */ + unsigned int shutdowntimeout; /* ms, 0 means default timeout */ long maxage_conn; /* in seconds, max idle time to allow a connection that is to be reused */ long maxlifetime_conn; /* in seconds, max time since creation to allow a @@ -1643,7 +1685,7 @@ struct UserDefined { struct curl_slist *postquote; /* after the transfer */ struct curl_slist *prequote; /* before the transfer, after type */ /* Despite the name, ftp_create_missing_dirs is for FTP(S) and SFTP - 1 - create directories that don't exist + 1 - create directories that do not exist 2 - the same but also allow MKD to fail once */ unsigned char ftp_create_missing_dirs; @@ -1664,7 +1706,7 @@ struct UserDefined { unsigned int new_file_perms; /* when creating remote files */ char *str[STRING_LAST]; /* array of strings, pointing to allocated memory */ struct curl_blob *blobs[BLOB_LAST]; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 unsigned int scope_id; /* Scope id for IPv6 */ #endif curl_prot_t allowed_protocols; @@ -1690,6 +1732,7 @@ struct UserDefined { int tcp_keepidle; /* seconds in idle before sending keepalive probe */ int tcp_keepintvl; /* seconds between TCP keepalive probes */ + int tcp_keepcnt; /* maximum number of keepalive probes */ long expect_100_timeout; /* in milliseconds */ #if defined(USE_HTTP2) || defined(USE_HTTP3) @@ -1701,7 +1744,7 @@ struct UserDefined { long upkeep_interval_ms; /* Time between calls for connection upkeep. */ multidone_func fmultidone; #ifndef CURL_DISABLE_DOH - struct Curl_easy *dohfor; /* this is a DoH request for that transfer */ + curl_off_t dohfor_mid; /* this is a DoH request for that transfer */ #endif CURLU *uh; /* URL handle for the current parsed URL */ #ifndef CURL_DISABLE_HTTP @@ -1732,17 +1775,21 @@ struct UserDefined { BIT(cookiesession); /* new cookie session? */ #endif BIT(crlf); /* convert crlf on ftp upload(?) */ +#ifdef USE_SSH BIT(ssh_compression); /* enable SSH compression */ +#endif /* Here follows boolean settings that define how to behave during this session. They are STATIC, set by libcurl users or at least initially - and they don't change during operations. */ + and they do not change during operations. */ BIT(quick_exit); /* set 1L when it is okay to leak things (like - threads), as we're about to exit() anyway and - don't want lengthy cleanups to delay termination, + threads), as we are about to exit() anyway and + do not want lengthy cleanups to delay termination, e.g. after a DNS timeout */ BIT(get_filetime); /* get the time and get of the remote file */ +#ifndef CURL_DISABLE_PROXY BIT(tunnel_thru_httpproxy); /* use CONNECT through an HTTP proxy */ +#endif BIT(prefer_ascii); /* ASCII rather than binary */ BIT(remote_append); /* append, not overwrite, on upload */ #ifdef CURL_LIST_ONLY_PROTOCOL @@ -1757,7 +1804,7 @@ struct UserDefined { us */ BIT(wildcard_enabled); /* enable wildcard matching */ #endif - BIT(hide_progress); /* don't use the progress meter */ + BIT(hide_progress); /* do not use the progress meter */ BIT(http_fail_on_error); /* fail on HTTP error codes >= 400 */ BIT(http_keep_sending_on_error); /* for HTTP status codes >= 300 */ BIT(http_follow_location); /* follow HTTP redirects */ @@ -1769,7 +1816,9 @@ struct UserDefined { location: */ BIT(opt_no_body); /* as set with CURLOPT_NOBODY */ BIT(verbose); /* output verbosity */ +#if defined(HAVE_GSSAPI) BIT(krb); /* Kerberos connection requested */ +#endif BIT(reuse_forbid); /* forbidden to be reused, close after use */ BIT(reuse_fresh); /* do not reuse an existing connection */ BIT(no_signal); /* do not use any signal/alarm handler */ @@ -1794,10 +1843,14 @@ struct UserDefined { BIT(suppress_connect_headers); /* suppress proxy CONNECT response headers from user callbacks */ BIT(dns_shuffle_addresses); /* whether to shuffle addresses before use */ +#ifndef CURL_DISABLE_PROXY BIT(haproxyprotocol); /* whether to send HAProxy PROXY protocol v1 header */ +#endif +#ifdef USE_UNIX_SOCKETS BIT(abstract_unix_socket); - BIT(disallow_username_in_url); /* disallow username in url */ +#endif + BIT(disallow_username_in_url); /* disallow username in URL */ #ifndef CURL_DISABLE_DOH BIT(doh); /* DNS-over-HTTPS enabled */ BIT(doh_verifypeer); /* DoH certificate peer verification */ @@ -1805,9 +1858,12 @@ struct UserDefined { BIT(doh_verifystatus); /* DoH certificate status verification */ #endif BIT(http09_allowed); /* allow HTTP/0.9 responses */ -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS BIT(ws_raw_mode); #endif +#ifdef USE_ECH + int tls_ech; /* TLS ECH configuration */ +#endif }; #ifndef CURL_DISABLE_MIME @@ -1839,22 +1895,21 @@ struct Curl_easy { /* First a simple identifier to easier detect if a user mix up this easy handle with a multi handle. Set this to CURLEASY_MAGIC_NUMBER */ unsigned int magic; - /* once an easy handle is tied to a connection cache - a non-negative number to distinguish this transfer from - other using the same cache. For easier tracking - in log output. - This may wrap around after LONG_MAX to 0 again, so it - has no uniqueness guarantee for very large processings. */ + /* once an easy handle is tied to a connection pool a non-negative number to + distinguish this transfer from other using the same pool. For easier + tracking in log output. This may wrap around after LONG_MAX to 0 again, + so it has no uniqueness guarantee for large processings. Note: it has no + uniqueness either IFF more than one connection pool is used by the + libcurl application. */ curl_off_t id; - - /* first, two fields for the linked list of these */ - struct Curl_easy *next; - struct Curl_easy *prev; + /* 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. */ + curl_off_t mid; struct connectdata *conn; - struct Curl_llist_element connect_queue; /* for the pending and msgsent - lists */ - struct Curl_llist_element conn_queue; /* list per connectdata */ + struct Curl_llist_node multi_queue; /* for multihandle list management */ + struct Curl_llist_node conn_queue; /* list per connectdata */ CURLMstate mstate; /* the handle's state */ CURLcode result; /* previous result */ diff --git a/deps/curl/lib/vauth/.checksrc b/deps/curl/lib/vauth/.checksrc new file mode 100644 index 00000000..9066946c --- /dev/null +++ b/deps/curl/lib/vauth/.checksrc @@ -0,0 +1,2 @@ +enable STRERROR +enable STRNCPY diff --git a/deps/curl/lib/vauth/cleartext.c b/deps/curl/lib/vauth/cleartext.c index 972a8744..cf8108ac 100644 --- a/deps/curl/lib/vauth/cleartext.c +++ b/deps/curl/lib/vauth/cleartext.c @@ -100,39 +100,38 @@ CURLcode Curl_auth_create_plain_message(const char *authzid, * Curl_auth_create_login_message() * * This is used to generate an already encoded LOGIN message containing the - * user name or password ready for sending to the recipient. + * username or password ready for sending to the recipient. * * Parameters: * - * valuep [in] - The user name or user's password. + * valuep [in] - The username or user's password. * out [out] - The result storage. * - * Returns CURLE_OK on success. + * Returns void. */ -CURLcode Curl_auth_create_login_message(const char *valuep, struct bufref *out) +void Curl_auth_create_login_message(const char *valuep, struct bufref *out) { Curl_bufref_set(out, valuep, strlen(valuep), NULL); - return CURLE_OK; } /* * Curl_auth_create_external_message() * * This is used to generate an already encoded EXTERNAL message containing - * the user name ready for sending to the recipient. + * the username ready for sending to the recipient. * * Parameters: * - * user [in] - The user name. + * user [in] - The username. * out [out] - The result storage. * - * Returns CURLE_OK on success. + * Returns void. */ -CURLcode Curl_auth_create_external_message(const char *user, +void Curl_auth_create_external_message(const char *user, struct bufref *out) { /* This is the same formatting as the login message */ - return Curl_auth_create_login_message(user, out); + Curl_auth_create_login_message(user, out); } #endif /* if no users */ diff --git a/deps/curl/lib/vauth/cram.c b/deps/curl/lib/vauth/cram.c index 91fb261c..c51c7285 100644 --- a/deps/curl/lib/vauth/cram.c +++ b/deps/curl/lib/vauth/cram.c @@ -51,7 +51,7 @@ * Parameters: * * chlg [in] - The challenge. - * userp [in] - The user name. + * userp [in] - The username. * passwdp [in] - The user's password. * out [out] - The result storage. * @@ -67,7 +67,7 @@ CURLcode Curl_auth_create_cram_md5_message(const struct bufref *chlg, char *response; /* Compute the digest using the password as the key */ - ctxt = Curl_HMAC_init(Curl_HMAC_MD5, + ctxt = Curl_HMAC_init(&Curl_HMAC_MD5, (const unsigned char *) passwdp, curlx_uztoui(strlen(passwdp))); if(!ctxt) diff --git a/deps/curl/lib/vauth/digest.c b/deps/curl/lib/vauth/digest.c index 358bfb60..cd3fca19 100644 --- a/deps/curl/lib/vauth/digest.c +++ b/deps/curl/lib/vauth/digest.c @@ -103,7 +103,7 @@ bool Curl_auth_digest_get_pair(const char *str, char *value, char *content, case ',': if(!starts_with_quote) { - /* This signals the end of the content if we didn't get a starting + /* This signals the end of the content if we did not get a starting quote and then we do "sloppy" parsing */ c = 0; /* the end */ continue; @@ -142,7 +142,7 @@ bool Curl_auth_digest_get_pair(const char *str, char *value, char *content, } #if !defined(USE_WINDOWS_SSPI) -/* Convert md5 chunk to RFC2617 (section 3.1.3) -suitable ascii string */ +/* 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 */ { @@ -151,7 +151,7 @@ static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */ msnprintf((char *) &dest[i * 2], 3, "%02x", source[i]); } -/* Convert sha256 or SHA-512/256 chunk to RFC7616 -suitable ascii string */ +/* 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 */ { @@ -288,7 +288,7 @@ static CURLcode auth_decode_digest_md5_message(const struct bufref *chlgref, /* Retrieve realm string from the challenge */ if(!auth_digest_get_key_value(chlg, "realm=\"", realm, rlen, '\"')) { /* Challenge does not have a realm, set empty string [RFC2831] page 6 */ - strcpy(realm, ""); + *realm = '\0'; } /* Retrieve algorithm string from the challenge */ @@ -326,7 +326,7 @@ bool Curl_auth_is_digest_supported(void) * * data [in] - The session handle. * chlg [in] - The challenge message. - * userp [in] - The user name. + * userp [in] - The username. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. * out [out] - The result storage. @@ -388,7 +388,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, return result; /* So far so good, now calculate A1 and H(A1) according to RFC 2831 */ - ctxt = Curl_MD5_init(Curl_DIGEST_MD5); + ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; @@ -402,7 +402,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, curlx_uztoui(strlen(passwdp))); Curl_MD5_final(ctxt, digest); - ctxt = Curl_MD5_init(Curl_DIGEST_MD5); + ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) return CURLE_OUT_OF_MEMORY; @@ -425,7 +425,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; /* Calculate H(A2) */ - ctxt = Curl_MD5_init(Curl_DIGEST_MD5); + ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) { free(spn); @@ -443,7 +443,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, msnprintf(&HA2_hex[2 * i], 3, "%02x", digest[i]); /* Now calculate the response hash */ - ctxt = Curl_MD5_init(Curl_DIGEST_MD5); + ctxt = Curl_MD5_init(&Curl_DIGEST_MD5); if(!ctxt) { free(spn); @@ -629,7 +629,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, } } else - break; /* We're done here */ + break; /* We are done here */ /* Pass all additional spaces here */ while(*chlg && ISBLANK(*chlg)) @@ -646,7 +646,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, if(before && !digest->stale) return CURLE_BAD_CONTENT_ENCODING; - /* We got this header without a nonce, that's a bad Digest line! */ + /* We got this header without a nonce, that is a bad Digest line! */ if(!digest->nonce) return CURLE_BAD_CONTENT_ENCODING; @@ -666,7 +666,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, * Parameters: * * data [in] - The session handle. - * userp [in] - The user name. + * userp [in] - The username. * passwdp [in] - The user's password. * request [in] - The HTTP request. * uripath [in] - The path of the HTTP uri. @@ -788,7 +788,7 @@ static CURLcode auth_create_digest_http_message( return CURLE_OUT_OF_MEMORY; if(digest->qop && strcasecompare(digest->qop, "auth-int")) { - /* We don't support auth-int for PUT or POST */ + /* We do not support auth-int for PUT or POST */ char hashed[65]; char *hashthis2; @@ -835,12 +835,12 @@ static CURLcode auth_create_digest_http_message( Authorization: Digest username="testuser", realm="testrealm", \ nonce="1053604145", uri="/64", response="c55f7f30d83d774a3d2dcacf725abaca" - Digest parameters are all quoted strings. Username which is provided by + Digest parameters are all quoted strings. Username which is provided by the user will need double quotes and backslashes within it escaped. realm, nonce, and opaque will need backslashes as well as they were - de-escaped when copied from request header. cnonce is generated with - web-safe characters. uri is already percent encoded. nc is 8 hex - characters. algorithm and qop with standard values only contain web-safe + de-escaped when copied from request header. cnonce is generated with + web-safe characters. uri is already percent encoded. nc is 8 hex + characters. algorithm and qop with standard values only contain web-safe characters. */ userp_quoted = auth_digest_string_quoted(digest->userhash ? userh : userp); @@ -957,7 +957,7 @@ static CURLcode auth_create_digest_http_message( * Parameters: * * data [in] - The session handle. - * userp [in] - The user name. + * userp [in] - The username. * passwdp [in] - The user's password. * request [in] - The HTTP request. * uripath [in] - The path of the HTTP uri. diff --git a/deps/curl/lib/vauth/digest_sspi.c b/deps/curl/lib/vauth/digest_sspi.c index 4696f29a..2ae6fb30 100644 --- a/deps/curl/lib/vauth/digest_sspi.c +++ b/deps/curl/lib/vauth/digest_sspi.c @@ -60,15 +60,16 @@ bool Curl_auth_is_digest_supported(void) SECURITY_STATUS status; /* Query the security package for Digest */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), - &SecurityPackage); + status = + Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), + &SecurityPackage); /* Release the package buffer as it is not required anymore */ if(status == SEC_E_OK) { - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); } - return (status == SEC_E_OK ? TRUE : FALSE); + return (status == SEC_E_OK); } /* @@ -81,7 +82,7 @@ bool Curl_auth_is_digest_supported(void) * * data [in] - The session handle. * chlg [in] - The challenge message. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. * out [out] - The result storage. @@ -119,17 +120,18 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, } /* Query the security package for DigestSSP */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), - &SecurityPackage); + status = + Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), + &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info"); + failf(data, "SSPI: could not get auth info"); return CURLE_AUTH_ERROR; } token_max = SecurityPackage->cbMaxToken; /* Release the package buffer as it is not required anymore */ - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our response buffer */ output_token = malloc(token_max); @@ -160,7 +162,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, p_identity = NULL; /* Acquire our credentials handle */ - status = s_pSecFn->AcquireCredentialsHandle(NULL, + status = Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT(SP_NAME_DIGEST), SECPKG_CRED_OUTBOUND, NULL, p_identity, NULL, NULL, @@ -190,20 +192,20 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, resp_buf.cbBuffer = curlx_uztoul(token_max); /* Generate our response message */ - status = s_pSecFn->InitializeSecurityContext(&credentials, NULL, spn, + status = Curl_pSecFn->InitializeSecurityContext(&credentials, NULL, spn, 0, 0, 0, &chlg_desc, 0, &context, &resp_desc, &attrs, &expiry); if(status == SEC_I_COMPLETE_NEEDED || status == SEC_I_COMPLETE_AND_CONTINUE) - s_pSecFn->CompleteAuthToken(&credentials, &resp_desc); + Curl_pSecFn->CompleteAuthToken(&credentials, &resp_desc); else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { #if !defined(CURL_DISABLE_VERBOSE_STRINGS) char buffer[STRERROR_LEN]; #endif - s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); free(spn); free(output_token); @@ -223,8 +225,8 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, Curl_bufref_set(out, output_token, resp_buf.cbBuffer, curl_free); /* Free our handles */ - s_pSecFn->DeleteSecurityContext(&context); - s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_pSecFn->DeleteSecurityContext(&context); + Curl_pSecFn->FreeCredentialsHandle(&credentials); /* Free the identity structure */ Curl_sspi_free_identity(p_identity); @@ -291,7 +293,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, } } else - break; /* We're done here */ + break; /* We are done here */ /* Pass all additional spaces here */ while(*chlg && ISBLANK(*chlg)) @@ -324,10 +326,10 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, { size_t chlglen = strlen(chlg); - /* We had an input token before so if there's another one now that means we - provided bad credentials in the previous request or it's stale. */ + /* We had an input token before so if there is another one now that means we + provided bad credentials in the previous request or it is stale. */ if(digest->input_token) { - bool stale = false; + bool stale = FALSE; const char *p = chlg; /* Check for the 'stale' directive */ @@ -343,7 +345,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, if(strcasecompare(value, "stale") && strcasecompare(content, "true")) { - stale = true; + stale = TRUE; break; } @@ -379,7 +381,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * request [in] - The HTTP request. * uripath [in] - The path of the HTTP uri. @@ -410,17 +412,18 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, (void) data; /* Query the security package for DigestSSP */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), - &SecurityPackage); + status = + Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), + &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info"); + failf(data, "SSPI: could not get auth info"); return CURLE_AUTH_ERROR; } token_max = SecurityPackage->cbMaxToken; /* Release the package buffer as it is not required anymore */ - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate the output buffer according to the max token size as indicated by the security package */ @@ -436,7 +439,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, (userp && digest->user && Curl_timestrcmp(userp, digest->user)) || (passwdp && digest->passwd && Curl_timestrcmp(passwdp, digest->passwd))) { if(digest->http_context) { - s_pSecFn->DeleteSecurityContext(digest->http_context); + Curl_pSecFn->DeleteSecurityContext(digest->http_context); Curl_safefree(digest->http_context); } Curl_safefree(digest->user); @@ -463,13 +466,14 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, chlg_buf[4].pvBuffer = output_token; chlg_buf[4].cbBuffer = curlx_uztoul(token_max); - status = s_pSecFn->MakeSignature(digest->http_context, 0, &chlg_desc, 0); + status = Curl_pSecFn->MakeSignature(digest->http_context, 0, &chlg_desc, + 0); if(status == SEC_E_OK) output_token_len = chlg_buf[4].cbBuffer; else { /* delete the context so a new one can be made */ infof(data, "digest_sspi: MakeSignature failed, error 0x%08lx", (long)status); - s_pSecFn->DeleteSecurityContext(digest->http_context); + Curl_pSecFn->DeleteSecurityContext(digest->http_context); Curl_safefree(digest->http_context); } } @@ -529,7 +533,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, } /* Acquire our credentials handle */ - status = s_pSecFn->AcquireCredentialsHandle(NULL, + status = Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT(SP_NAME_DIGEST), SECPKG_CRED_OUTBOUND, NULL, p_identity, NULL, NULL, @@ -565,7 +569,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, spn = curlx_convert_UTF8_to_tchar((char *) uripath); if(!spn) { - s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); free(output_token); @@ -579,7 +583,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; /* Generate our response message */ - status = s_pSecFn->InitializeSecurityContext(&credentials, NULL, + status = Curl_pSecFn->InitializeSecurityContext(&credentials, NULL, spn, ISC_REQ_USE_HTTP_STYLE, 0, 0, &chlg_desc, 0, @@ -589,13 +593,13 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, if(status == SEC_I_COMPLETE_NEEDED || status == SEC_I_COMPLETE_AND_CONTINUE) - s_pSecFn->CompleteAuthToken(&credentials, &resp_desc); + Curl_pSecFn->CompleteAuthToken(&credentials, &resp_desc); else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { #if !defined(CURL_DISABLE_VERBOSE_STRINGS) char buffer[STRERROR_LEN]; #endif - s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); free(output_token); @@ -615,7 +619,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, output_token_len = resp_buf.cbBuffer; - s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); } @@ -660,7 +664,7 @@ void Curl_auth_digest_cleanup(struct digestdata *digest) /* Delete security context */ if(digest->http_context) { - s_pSecFn->DeleteSecurityContext(digest->http_context); + Curl_pSecFn->DeleteSecurityContext(digest->http_context); Curl_safefree(digest->http_context); } diff --git a/deps/curl/lib/vauth/gsasl.c b/deps/curl/lib/vauth/gsasl.c index c7d0a8d3..ee11b603 100644 --- a/deps/curl/lib/vauth/gsasl.c +++ b/deps/curl/lib/vauth/gsasl.c @@ -59,7 +59,7 @@ bool Curl_auth_gsasl_is_supported(struct Curl_easy *data, return FALSE; } - return true; + return TRUE; } CURLcode Curl_auth_gsasl_start(struct Curl_easy *data, diff --git a/deps/curl/lib/vauth/krb5_gssapi.c b/deps/curl/lib/vauth/krb5_gssapi.c index 16b6e403..e7927828 100644 --- a/deps/curl/lib/vauth/krb5_gssapi.c +++ b/deps/curl/lib/vauth/krb5_gssapi.c @@ -65,10 +65,10 @@ bool Curl_auth_is_gssapi_supported(void) * Parameters: * * data [in] - The session handle. - * userp [in] - The user name. + * userp [in] - The username. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. - * host [in[ - The host name. + * host [in[ - The hostname. * mutual_auth [in] - Flag specifying whether or not mutual authentication * is enabled. * chlg [in] - Optional challenge message. @@ -158,7 +158,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; } @@ -243,7 +243,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, /* Process the maximum message size the server can receive */ if(max_size > 0) { /* The server has told us it supports a maximum receive buffer, however, as - we don't require one unless we are encrypting data, we tell the server + we do not require one unless we are encrypting data, we tell the server our receive buffer is zero. */ max_size = 0; } diff --git a/deps/curl/lib/vauth/krb5_sspi.c b/deps/curl/lib/vauth/krb5_sspi.c index 17a517a9..4af0bd1e 100644 --- a/deps/curl/lib/vauth/krb5_sspi.c +++ b/deps/curl/lib/vauth/krb5_sspi.c @@ -55,16 +55,16 @@ bool Curl_auth_is_gssapi_supported(void) SECURITY_STATUS status; /* Query the security package for Kerberos */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) + status = Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_KERBEROS), &SecurityPackage); /* Release the package buffer as it is not required anymore */ if(status == SEC_E_OK) { - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); } - return (status == SEC_E_OK ? TRUE : FALSE); + return (status == SEC_E_OK); } /* @@ -76,10 +76,10 @@ bool Curl_auth_is_gssapi_supported(void) * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. - * host [in] - The host name. + * host [in] - The hostname. * mutual_auth [in] - Flag specifying whether or not mutual authentication * is enabled. * chlg [in] - Optional challenge message. @@ -118,18 +118,18 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, if(!krb5->output_token) { /* Query the security package for Kerberos */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) + status = Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_KERBEROS), &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info"); + failf(data, "SSPI: could not get auth info"); return CURLE_AUTH_ERROR; } krb5->token_max = SecurityPackage->cbMaxToken; /* Release the package buffer as it is not required anymore */ - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our response buffer */ krb5->output_token = malloc(krb5->token_max); @@ -158,7 +158,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; /* Acquire our credentials handle */ - status = s_pSecFn->AcquireCredentialsHandle(NULL, + status = Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT(SP_NAME_KERBEROS), SECPKG_CRED_OUTBOUND, NULL, @@ -197,7 +197,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, resp_buf.cbBuffer = curlx_uztoul(krb5->token_max); /* Generate our challenge-response message */ - status = s_pSecFn->InitializeSecurityContext(krb5->credentials, + status = Curl_pSecFn->InitializeSecurityContext(krb5->credentials, chlg ? krb5->context : NULL, krb5->spn, (mutual_auth ? @@ -215,7 +215,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, return CURLE_AUTH_ERROR; if(memcmp(&context, krb5->context, sizeof(context))) { - s_pSecFn->DeleteSecurityContext(krb5->context); + Curl_pSecFn->DeleteSecurityContext(krb5->context); memcpy(krb5->context, &context, sizeof(context)); } @@ -282,7 +282,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, } /* Get our response size information */ - status = s_pSecFn->QueryContextAttributes(krb5->context, + status = Curl_pSecFn->QueryContextAttributes(krb5->context, SECPKG_ATTR_SIZES, &sizes); @@ -304,7 +304,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, input_buf[1].cbBuffer = 0; /* Decrypt the inbound challenge and obtain the qop */ - status = s_pSecFn->DecryptMessage(krb5->context, &input_desc, 0, &qop); + status = Curl_pSecFn->DecryptMessage(krb5->context, &input_desc, 0, &qop); if(status != SEC_E_OK) { infof(data, "GSSAPI handshake failure (empty security message)"); return CURLE_BAD_CONTENT_ENCODING; @@ -323,7 +323,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, ((unsigned long)indata[2] << 8) | indata[3]; /* Free the challenge as it is not required anymore */ - s_pSecFn->FreeContextBuffer(input_buf[1].pvBuffer); + Curl_pSecFn->FreeContextBuffer(input_buf[1].pvBuffer); /* Process the security layer */ if(!(sec_layer & KERB_WRAP_NO_ENCRYPT)) { @@ -335,7 +335,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, /* Process the maximum message size the server can receive */ if(max_size > 0) { /* The server has told us it supports a maximum receive buffer, however, as - we don't require one unless we are encrypting data, we tell the server + we do not require one unless we are encrypting data, we tell the server our receive buffer is zero. */ max_size = 0; } @@ -392,7 +392,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, wrap_buf[2].cbBuffer = sizes.cbBlockSize; /* Encrypt the data */ - status = s_pSecFn->EncryptMessage(krb5->context, KERB_WRAP_NO_ENCRYPT, + status = Curl_pSecFn->EncryptMessage(krb5->context, KERB_WRAP_NO_ENCRYPT, &wrap_desc, 0); if(status != SEC_E_OK) { free(padding); @@ -448,14 +448,14 @@ void Curl_auth_cleanup_gssapi(struct kerberos5data *krb5) { /* Free our security context */ if(krb5->context) { - s_pSecFn->DeleteSecurityContext(krb5->context); + Curl_pSecFn->DeleteSecurityContext(krb5->context); free(krb5->context); krb5->context = NULL; } /* Free our credentials handle */ if(krb5->credentials) { - s_pSecFn->FreeCredentialsHandle(krb5->credentials); + Curl_pSecFn->FreeCredentialsHandle(krb5->credentials); free(krb5->credentials); krb5->credentials = NULL; } diff --git a/deps/curl/lib/vauth/ntlm.c b/deps/curl/lib/vauth/ntlm.c index 018e6a67..f8f6aea0 100644 --- a/deps/curl/lib/vauth/ntlm.c +++ b/deps/curl/lib/vauth/ntlm.c @@ -59,10 +59,6 @@ /* "NTLMSSP" signature is always in ASCII regardless of the platform */ #define NTLMSSP_SIGNATURE "\x4e\x54\x4c\x4d\x53\x53\x50" -/* The fixed host name we provide, in order to not leak our real local host - name. Copy the name used by Firefox. */ -#define NTLM_HOSTNAME "WORKSTATION" - #if DEBUG_ME # define DEBUG_OUT(x) x static void ntlm_print_flags(FILE *handle, unsigned long flags) @@ -73,7 +69,7 @@ static void ntlm_print_flags(FILE *handle, unsigned long flags) fprintf(handle, "NTLMFLAG_NEGOTIATE_OEM "); if(flags & NTLMFLAG_REQUEST_TARGET) fprintf(handle, "NTLMFLAG_REQUEST_TARGET "); - if(flags & (1<<3)) + if(flags & (1 << 3)) fprintf(handle, "NTLMFLAG_UNKNOWN_3 "); if(flags & NTLMFLAG_NEGOTIATE_SIGN) fprintf(handle, "NTLMFLAG_NEGOTIATE_SIGN "); @@ -85,7 +81,7 @@ static void ntlm_print_flags(FILE *handle, unsigned long flags) fprintf(handle, "NTLMFLAG_NEGOTIATE_LM_KEY "); if(flags & NTLMFLAG_NEGOTIATE_NTLM_KEY) fprintf(handle, "NTLMFLAG_NEGOTIATE_NTLM_KEY "); - if(flags & (1<<10)) + if(flags & (1 << 10)) fprintf(handle, "NTLMFLAG_UNKNOWN_10 "); if(flags & NTLMFLAG_NEGOTIATE_ANONYMOUS) fprintf(handle, "NTLMFLAG_NEGOTIATE_ANONYMOUS "); @@ -113,15 +109,15 @@ static void ntlm_print_flags(FILE *handle, unsigned long flags) fprintf(handle, "NTLMFLAG_REQUEST_NONNT_SESSION_KEY "); if(flags & NTLMFLAG_NEGOTIATE_TARGET_INFO) fprintf(handle, "NTLMFLAG_NEGOTIATE_TARGET_INFO "); - if(flags & (1<<24)) + if(flags & (1 << 24)) fprintf(handle, "NTLMFLAG_UNKNOWN_24 "); - if(flags & (1<<25)) + if(flags & (1 << 25)) fprintf(handle, "NTLMFLAG_UNKNOWN_25 "); - if(flags & (1<<26)) + if(flags & (1 << 26)) fprintf(handle, "NTLMFLAG_UNKNOWN_26 "); - if(flags & (1<<27)) + if(flags & (1 << 27)) fprintf(handle, "NTLMFLAG_UNKNOWN_27 "); - if(flags & (1<<28)) + if(flags & (1 << 28)) fprintf(handle, "NTLMFLAG_UNKNOWN_28 "); if(flags & NTLMFLAG_NEGOTIATE_128) fprintf(handle, "NTLMFLAG_NEGOTIATE_128 "); @@ -325,10 +321,10 @@ static void unicodecpy(unsigned char *dest, const char *src, size_t length) * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. - * host [in] - The host name. + * host [in] - The hostname. * ntlm [in/out] - The NTLM data struct being used and modified. * out [out] - The result storage. * @@ -384,9 +380,9 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, "%c%c" /* 2 zeroes */ "%c%c" /* host length */ "%c%c" /* host allocated space */ - "%c%c" /* host name offset */ + "%c%c" /* hostname offset */ "%c%c" /* 2 zeroes */ - "%s" /* host name */ + "%s" /* hostname */ "%s", /* domain string */ 0, /* trailing zero */ 0, 0, 0, /* part of type-1 long */ @@ -448,7 +444,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * ntlm [in/out] - The NTLM data struct being used and modified. * out [out] - The result storage. @@ -470,7 +466,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, 12 LM/LMv2 Response security buffer 20 NTLM/NTLMv2 Response security buffer 28 Target Name security buffer - 36 User Name security buffer + 36 username security buffer 44 Workstation Name security buffer (52) Session Key security buffer (*) (60) Flags long (*) @@ -482,15 +478,17 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, CURLcode result = CURLE_OK; size_t size; unsigned char ntlmbuf[NTLM_BUFSIZE]; - int lmrespoff; + unsigned int lmrespoff; unsigned char lmresp[24]; /* fixed-size */ - int ntrespoff; + unsigned int ntrespoff; unsigned int ntresplen = 24; unsigned char ntresp[24]; /* fixed-size */ unsigned char *ptr_ntresp = &ntresp[0]; unsigned char *ntlmv2resp = NULL; - bool unicode = (ntlm->flags & NTLMFLAG_NEGOTIATE_UNICODE) ? TRUE : FALSE; - char host[HOSTNAME_MAX + 1] = ""; + bool unicode = (ntlm->flags & NTLMFLAG_NEGOTIATE_UNICODE); + /* The fixed hostname we provide, in order to not leak our real local host + name. Copy the name used by Firefox. */ + static const char host[] = "WORKSTATION"; const char *user; const char *domain = ""; size_t hostoff = 0; @@ -515,21 +513,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, user = userp; userlen = strlen(user); - -#ifndef NTLM_HOSTNAME - /* Get the machine's un-qualified host name as NTLM doesn't like the fully - qualified domain name */ - if(Curl_gethostname(host, sizeof(host))) { - infof(data, "gethostname() failed, continuing without"); - hostlen = 0; - } - else { - hostlen = strlen(host); - } -#else - (void)msnprintf(host, sizeof(host), "%s", NTLM_HOSTNAME); - hostlen = sizeof(NTLM_HOSTNAME)-1; -#endif + hostlen = sizeof(host) - 1; if(ntlm->flags & NTLMFLAG_NEGOTIATE_NTLM2_KEY) { unsigned char ntbuffer[0x18]; @@ -585,7 +569,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, return result; Curl_ntlm_core_lm_resp(lmbuffer, &ntlm->nonce[0], lmresp); - ntlm->flags &= ~NTLMFLAG_NEGOTIATE_NTLM2_KEY; + ntlm->flags &= ~(unsigned int)NTLMFLAG_NEGOTIATE_NTLM2_KEY; /* A safer but less compatible alternative is: * Curl_ntlm_core_lm_resp(ntbuffer, &ntlm->nonce[0], lmresp); @@ -722,7 +706,7 @@ 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 + host name too big"); + failf(data, "user + domain + hostname too big"); return CURLE_OUT_OF_MEMORY; } diff --git a/deps/curl/lib/vauth/ntlm_sspi.c b/deps/curl/lib/vauth/ntlm_sspi.c index 92054316..a2e5bc10 100644 --- a/deps/curl/lib/vauth/ntlm_sspi.c +++ b/deps/curl/lib/vauth/ntlm_sspi.c @@ -55,15 +55,15 @@ bool Curl_auth_is_ntlm_supported(void) SECURITY_STATUS status; /* Query the security package for NTLM */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM), + status = Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM), &SecurityPackage); /* Release the package buffer as it is not required anymore */ if(status == SEC_E_OK) { - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); } - return (status == SEC_E_OK ? TRUE : FALSE); + return (status == SEC_E_OK); } /* @@ -75,10 +75,10 @@ bool Curl_auth_is_ntlm_supported(void) * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. - * host [in] - The host name. + * host [in] - The hostname. * ntlm [in/out] - The NTLM data struct being used and modified. * out [out] - The result storage. * @@ -103,17 +103,17 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, Curl_auth_cleanup_ntlm(ntlm); /* Query the security package for NTLM */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM), + status = Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM), &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info"); + failf(data, "SSPI: could not get auth info"); return CURLE_AUTH_ERROR; } ntlm->token_max = SecurityPackage->cbMaxToken; /* Release the package buffer as it is not required anymore */ - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our output buffer */ ntlm->output_token = malloc(ntlm->token_max); @@ -141,7 +141,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; /* Acquire our credentials handle */ - status = s_pSecFn->AcquireCredentialsHandle(NULL, + status = Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *) TEXT(SP_NAME_NTLM), SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity, NULL, NULL, @@ -167,7 +167,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, type_1_buf.cbBuffer = curlx_uztoul(ntlm->token_max); /* Generate our type-1 message */ - status = s_pSecFn->InitializeSecurityContext(ntlm->credentials, NULL, + status = Curl_pSecFn->InitializeSecurityContext(ntlm->credentials, NULL, ntlm->spn, 0, 0, SECURITY_NETWORK_DREP, NULL, 0, @@ -175,7 +175,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, &attrs, &expiry); if(status == SEC_I_COMPLETE_NEEDED || status == SEC_I_COMPLETE_AND_CONTINUE) - s_pSecFn->CompleteAuthToken(ntlm->context, &type_1_desc); + Curl_pSecFn->CompleteAuthToken(ntlm->context, &type_1_desc); else if(status == SEC_E_INSUFFICIENT_MEMORY) return CURLE_OUT_OF_MEMORY; else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) @@ -233,7 +233,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data, * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * ntlm [in/out] - The NTLM data struct being used and modified. * out [out] - The result storage. @@ -282,7 +282,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, SEC_CHANNEL_BINDINGS channelBindings; SecPkgContext_Bindings pkgBindings; pkgBindings.Bindings = &channelBindings; - status = s_pSecFn->QueryContextAttributes( + status = Curl_pSecFn->QueryContextAttributes( ntlm->sslContext, SECPKG_ATTR_ENDPOINT_BINDINGS, &pkgBindings @@ -305,7 +305,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, type_3_buf.cbBuffer = curlx_uztoul(ntlm->token_max); /* Generate our type-3 message */ - status = s_pSecFn->InitializeSecurityContext(ntlm->credentials, + status = Curl_pSecFn->InitializeSecurityContext(ntlm->credentials, ntlm->context, ntlm->spn, 0, 0, SECURITY_NETWORK_DREP, @@ -343,14 +343,14 @@ void Curl_auth_cleanup_ntlm(struct ntlmdata *ntlm) { /* Free our security context */ if(ntlm->context) { - s_pSecFn->DeleteSecurityContext(ntlm->context); + Curl_pSecFn->DeleteSecurityContext(ntlm->context); free(ntlm->context); ntlm->context = NULL; } /* Free our credentials handle */ if(ntlm->credentials) { - s_pSecFn->FreeCredentialsHandle(ntlm->credentials); + Curl_pSecFn->FreeCredentialsHandle(ntlm->credentials); free(ntlm->credentials); ntlm->credentials = NULL; } diff --git a/deps/curl/lib/vauth/oauth2.c b/deps/curl/lib/vauth/oauth2.c index a4adbdcf..dc94afa3 100644 --- a/deps/curl/lib/vauth/oauth2.c +++ b/deps/curl/lib/vauth/oauth2.c @@ -49,8 +49,8 @@ * * Parameters: * - * user[in] - The user name. - * host[in] - The host name. + * user[in] - The username. + * host[in] - The hostname. * port[in] - The port(when not Port 80). * bearer[in] - The bearer token. * out[out] - The result storage. @@ -87,7 +87,7 @@ CURLcode Curl_auth_create_oauth_bearer_message(const char *user, * * Parameters: * - * user[in] - The user name. + * user[in] - The username. * bearer[in] - The bearer token. * out[out] - The result storage. * diff --git a/deps/curl/lib/vauth/spnego_gssapi.c b/deps/curl/lib/vauth/spnego_gssapi.c index e1d52b75..f48d9b70 100644 --- a/deps/curl/lib/vauth/spnego_gssapi.c +++ b/deps/curl/lib/vauth/spnego_gssapi.c @@ -65,10 +65,10 @@ bool Curl_auth_is_spnego_supported(void) * Parameters: * * data [in] - The session handle. - * userp [in] - The user name in the format User or Domain\User. + * userp [in] - The username in the format User or Domain\User. * passwdp [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. - * host [in] - The host name. + * host [in] - The hostname. * chlg64 [in] - The optional base64 encoded challenge message. * nego [in/out] - The Negotiate data struct being used and modified. * @@ -91,14 +91,16 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, gss_buffer_desc spn_token = GSS_C_EMPTY_BUFFER; 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; + struct gss_channel_bindings_struct chan; (void) user; (void) password; if(nego->context && nego->status == GSS_S_COMPLETE) { /* We finished successfully our part of authentication, but server - * rejected it (since we're again here). Exit with an error since we - * can't invent anything better */ + * rejected it (since we are again here). Exit with an error since we + * cannot invent anything better */ Curl_auth_cleanup_spnego(nego); return CURLE_LOGIN_DENIED; } @@ -148,13 +150,21 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, input_token.length = chlglen; } + /* Set channel binding data if available */ + if(nego->channel_binding_data.leng > 0) { + memset(&chan, 0, sizeof(struct gss_channel_bindings_struct)); + chan.application_data.length = nego->channel_binding_data.leng; + chan.application_data.value = nego->channel_binding_data.bufr; + chan_bindings = &chan; + } + /* Generate our challenge-response message */ major_status = Curl_gss_init_sec_context(data, &minor_status, &nego->context, nego->spn, &Curl_spnego_mech_oid, - GSS_C_NO_CHANNEL_BINDINGS, + chan_bindings, &input_token, &output_token, TRUE, diff --git a/deps/curl/lib/vauth/spnego_sspi.c b/deps/curl/lib/vauth/spnego_sspi.c index d3245d0b..7a27c298 100644 --- a/deps/curl/lib/vauth/spnego_sspi.c +++ b/deps/curl/lib/vauth/spnego_sspi.c @@ -57,17 +57,17 @@ bool Curl_auth_is_spnego_supported(void) SECURITY_STATUS status; /* Query the security package for Negotiate */ - status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) + status = Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NEGOTIATE), &SecurityPackage); /* Release the package buffer as it is not required anymore */ if(status == SEC_E_OK) { - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); } - return (status == SEC_E_OK ? TRUE : FALSE); + return (status == SEC_E_OK); } /* @@ -79,10 +79,10 @@ bool Curl_auth_is_spnego_supported(void) * Parameters: * * data [in] - The session handle. - * user [in] - The user name in the format User or Domain\User. + * user [in] - The username in the format User or Domain\User. * password [in] - The user's password. * service [in] - The service type such as http, smtp, pop or imap. - * host [in] - The host name. + * host [in] - The hostname. * chlg64 [in] - The optional base64 encoded challenge message. * nego [in/out] - The Negotiate data struct being used and modified. * @@ -113,8 +113,8 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, if(nego->context && nego->status == SEC_E_OK) { /* We finished successfully our part of authentication, but server - * rejected it (since we're again here). Exit with an error since we - * can't invent anything better */ + * rejected it (since we are again here). Exit with an error since we + * cannot invent anything better */ Curl_auth_cleanup_spnego(nego); return CURLE_LOGIN_DENIED; } @@ -128,18 +128,18 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, if(!nego->output_token) { /* Query the security package for Negotiate */ - nego->status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) - TEXT(SP_NAME_NEGOTIATE), - &SecurityPackage); + nego->status = (DWORD)Curl_pSecFn->QuerySecurityPackageInfo((TCHAR *) + TEXT(SP_NAME_NEGOTIATE), + &SecurityPackage); if(nego->status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info"); + failf(data, "SSPI: could not get auth info"); return CURLE_AUTH_ERROR; } nego->token_max = SecurityPackage->cbMaxToken; /* Release the package buffer as it is not required anymore */ - s_pSecFn->FreeContextBuffer(SecurityPackage); + Curl_pSecFn->FreeContextBuffer(SecurityPackage); /* Allocate our output buffer */ nego->output_token = malloc(nego->token_max); @@ -168,8 +168,8 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; /* Acquire our credentials handle */ - nego->status = - s_pSecFn->AcquireCredentialsHandle(NULL, + nego->status = (DWORD) + Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *)TEXT(SP_NAME_NEGOTIATE), SECPKG_CRED_OUTBOUND, NULL, nego->p_identity, NULL, NULL, @@ -218,7 +218,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, SEC_CHANNEL_BINDINGS channelBindings; SecPkgContext_Bindings pkgBindings; pkgBindings.Bindings = &channelBindings; - nego->status = s_pSecFn->QueryContextAttributes( + nego->status = (DWORD)Curl_pSecFn->QueryContextAttributes( nego->sslContext, SECPKG_ATTR_ENDPOINT_BINDINGS, &pkgBindings @@ -242,16 +242,16 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, resp_buf.cbBuffer = curlx_uztoul(nego->token_max); /* Generate our challenge-response message */ - nego->status = s_pSecFn->InitializeSecurityContext(nego->credentials, - chlg ? nego->context : - NULL, - nego->spn, - ISC_REQ_CONFIDENTIALITY, - 0, SECURITY_NATIVE_DREP, - chlg ? &chlg_desc : NULL, - 0, nego->context, - &resp_desc, &attrs, - &expiry); + nego->status = + (DWORD)Curl_pSecFn->InitializeSecurityContext(nego->credentials, + chlg ? nego->context : NULL, + nego->spn, + ISC_REQ_CONFIDENTIALITY, + 0, SECURITY_NATIVE_DREP, + chlg ? &chlg_desc : NULL, + 0, nego->context, + &resp_desc, &attrs, + &expiry); /* Free the decoded challenge as it is not required anymore */ free(chlg); @@ -259,7 +259,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, if(GSS_ERROR(nego->status)) { char buffer[STRERROR_LEN]; failf(data, "InitializeSecurityContext failed: %s", - Curl_sspi_strerror(nego->status, buffer, sizeof(buffer))); + Curl_sspi_strerror((int)nego->status, buffer, sizeof(buffer))); if(nego->status == (DWORD)SEC_E_INSUFFICIENT_MEMORY) return CURLE_OUT_OF_MEMORY; @@ -269,11 +269,12 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, if(nego->status == SEC_I_COMPLETE_NEEDED || nego->status == SEC_I_COMPLETE_AND_CONTINUE) { - nego->status = s_pSecFn->CompleteAuthToken(nego->context, &resp_desc); + nego->status = (DWORD)Curl_pSecFn->CompleteAuthToken(nego->context, + &resp_desc); if(GSS_ERROR(nego->status)) { char buffer[STRERROR_LEN]; failf(data, "CompleteAuthToken failed: %s", - Curl_sspi_strerror(nego->status, buffer, sizeof(buffer))); + Curl_sspi_strerror((int)nego->status, buffer, sizeof(buffer))); if(nego->status == (DWORD)SEC_E_INSUFFICIENT_MEMORY) return CURLE_OUT_OF_MEMORY; @@ -332,14 +333,14 @@ void Curl_auth_cleanup_spnego(struct negotiatedata *nego) { /* Free our security context */ if(nego->context) { - s_pSecFn->DeleteSecurityContext(nego->context); + Curl_pSecFn->DeleteSecurityContext(nego->context); free(nego->context); nego->context = NULL; } /* Free our credentials handle */ if(nego->credentials) { - s_pSecFn->FreeCredentialsHandle(nego->credentials); + Curl_pSecFn->FreeCredentialsHandle(nego->credentials); free(nego->credentials); nego->credentials = NULL; } diff --git a/deps/curl/lib/vauth/vauth.c b/deps/curl/lib/vauth/vauth.c index 62fc7c40..a7e7e17f 100644 --- a/deps/curl/lib/vauth/vauth.c +++ b/deps/curl/lib/vauth/vauth.c @@ -48,7 +48,7 @@ * Parameters: * * service [in] - The service type such as http, smtp, pop or imap. - * host [in] - The host name. + * host [in] - The hostname. * realm [in] - The realm. * * Returns a pointer to the newly allocated SPN. @@ -93,7 +93,7 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host, return NULL; /* Allocate and return a TCHAR based SPN. Since curlx_convert_UTF8_to_tchar - must be freed by curlx_unicodefree we'll dupe the result so that the + 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); @@ -115,14 +115,14 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host, * Domain/User (curl Down-level format - for compatibility with existing code) * User@Domain (User Principal Name) * - * Note: The user name may be empty when using a GSS-API library or Windows + * Note: The username may be empty when using a GSS-API library or Windows * SSPI as the user and domain are either obtained from the credentials cache * when using GSS-API or via the currently logged in user's credentials when * using Windows SSPI. * * Parameters: * - * user [in] - The user name. + * user [in] - The username. * * Returns TRUE on success; otherwise FALSE. */ @@ -134,8 +134,7 @@ bool Curl_auth_user_contains_domain(const char *user) /* Check we have a domain name or UPN present */ char *p = strpbrk(user, "\\/@"); - valid = (p != NULL && p > user && p < user + strlen(user) - 1 ? TRUE : - FALSE); + valid = (p != NULL && p > user && p < user + strlen(user) - 1); } #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) else diff --git a/deps/curl/lib/vauth/vauth.h b/deps/curl/lib/vauth/vauth.h index 9da05408..7e823484 100644 --- a/deps/curl/lib/vauth/vauth.h +++ b/deps/curl/lib/vauth/vauth.h @@ -79,12 +79,10 @@ CURLcode Curl_auth_create_plain_message(const char *authzid, struct bufref *out); /* This is used to generate a LOGIN cleartext message */ -CURLcode Curl_auth_create_login_message(const char *value, - struct bufref *out); +void Curl_auth_create_login_message(const char *value, struct bufref *out); /* This is used to generate an EXTERNAL cleartext message */ -CURLcode Curl_auth_create_external_message(const char *user, - struct bufref *out); +void Curl_auth_create_external_message(const char *user, struct bufref *out); #ifndef CURL_DISABLE_DIGEST_AUTH /* This is used to generate a CRAM-MD5 response message */ diff --git a/deps/curl/lib/version.c b/deps/curl/lib/version.c index 88f3696d..1d5b96d2 100644 --- a/deps/curl/lib/version.c +++ b/deps/curl/lib/version.c @@ -55,6 +55,7 @@ #ifdef USE_LIBRTMP #include +#include "curl_rtmp.h" #endif #ifdef HAVE_LIBZ @@ -62,13 +63,13 @@ #endif #ifdef HAVE_BROTLI -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) /* Ignore -Wvla warnings in brotli headers */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvla" #endif #include -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif #endif @@ -92,20 +93,71 @@ static void brotli_version(char *buf, size_t bufsz) unsigned int major = brotli_version >> 24; unsigned int minor = (brotli_version & 0x00FFFFFF) >> 12; unsigned int patch = brotli_version & 0x00000FFF; - (void)msnprintf(buf, bufsz, "%u.%u.%u", major, minor, patch); + (void)msnprintf(buf, bufsz, "brotli/%u.%u.%u", major, minor, patch); } #endif #ifdef HAVE_ZSTD static void zstd_version(char *buf, size_t bufsz) { - unsigned long zstd_version = (unsigned long)ZSTD_versionNumber(); - unsigned int major = (unsigned int)(zstd_version / (100 * 100)); - unsigned int minor = (unsigned int)((zstd_version - - (major * 100 * 100)) / 100); - unsigned int patch = (unsigned int)(zstd_version - - (major * 100 * 100) - (minor * 100)); - (void)msnprintf(buf, bufsz, "%u.%u.%u", major, minor, patch); + unsigned int version = ZSTD_versionNumber(); + unsigned int major = version / (100 * 100); + unsigned int minor = (version - (major * 100 * 100)) / 100; + unsigned int patch = version - (major * 100 * 100) - (minor * 100); + (void)msnprintf(buf, bufsz, "zstd/%u.%u.%u", major, minor, patch); +} +#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; + 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 + msnprintf(buf, bufsz, "OpenLDAP"); +} +#endif + +#ifdef USE_LIBPSL +static void psl_version(char *buf, size_t bufsz) +{ +#if defined(PSL_VERSION_MAJOR) && (PSL_VERSION_MAJOR > 0 || \ + PSL_VERSION_MINOR >= 11) + int num = psl_check_version_number(0); + msnprintf(buf, bufsz, "libpsl/%d.%d.%d", + num >> 16, (num >> 8) & 0xff, num & 0xff); +#else + msnprintf(buf, bufsz, "libpsl/%s", psl_get_version()); +#endif +} +#endif + +#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN) +#define USE_IDN +#endif + +#ifdef USE_IDN +static void idn_version(char *buf, size_t bufsz) +{ +#ifdef USE_LIBIDN2 + msnprintf(buf, bufsz, "libidn2/%s", idn2_check_version(NULL)); +#elif defined(USE_WIN32_IDN) + msnprintf(buf, bufsz, "WinIDN"); +#elif defined(USE_APPLE_IDN) + msnprintf(buf, bufsz, "AppleIDN"); +#endif } #endif @@ -129,34 +181,34 @@ char *curl_version(void) char ssl_version[200]; #endif #ifdef HAVE_LIBZ - char z_version[40]; + char z_version[30]; #endif #ifdef HAVE_BROTLI - char br_version[40] = "brotli/"; + char br_version[30]; #endif #ifdef HAVE_ZSTD - char zst_version[40] = "zstd/"; + char zstd_ver[30]; #endif #ifdef USE_ARES - char cares_version[40]; + char cares_version[30]; #endif -#if defined(USE_LIBIDN2) - char idn_version[40]; +#ifdef USE_IDN + char idn_ver[30]; #endif #ifdef USE_LIBPSL - char psl_version[40]; + char psl_ver[30]; #endif #ifdef USE_SSH - char ssh_version[40]; + char ssh_version[30]; #endif #ifdef USE_NGHTTP2 - char h2_version[40]; + char h2_version[30]; #endif -#ifdef ENABLE_QUIC - char h3_version[40]; +#ifdef USE_HTTP3 + char h3_version[30]; #endif #ifdef USE_LIBRTMP - char rtmp_version[40]; + char rtmp_version[30]; #endif #ifdef USE_HYPER char hyper_buf[30]; @@ -174,8 +226,7 @@ char *curl_version(void) /* Override version string when environment variable CURL_VERSION is set */ const char *debugversion = getenv("CURL_VERSION"); if(debugversion) { - strncpy(out, debugversion, sizeof(out)-1); - out[sizeof(out)-1] = '\0'; + msnprintf(out, sizeof(out), "%s", debugversion); return out; } #endif @@ -190,41 +241,26 @@ char *curl_version(void) src[i++] = z_version; #endif #ifdef HAVE_BROTLI - brotli_version(&br_version[7], sizeof(br_version) - 7); + brotli_version(br_version, sizeof(br_version)); src[i++] = br_version; #endif #ifdef HAVE_ZSTD - zstd_version(&zst_version[5], sizeof(zst_version) - 5); - src[i++] = zst_version; + zstd_version(zstd_ver, sizeof(zstd_ver)); + src[i++] = zstd_ver; #endif #ifdef USE_ARES msnprintf(cares_version, sizeof(cares_version), "c-ares/%s", ares_version(NULL)); src[i++] = cares_version; #endif -#ifdef USE_LIBIDN2 - msnprintf(idn_version, sizeof(idn_version), - "libidn2/%s", idn2_check_version(NULL)); - src[i++] = idn_version; -#elif defined(USE_WIN32_IDN) - src[i++] = (char *)"WinIDN"; +#ifdef USE_IDN + idn_version(idn_ver, sizeof(idn_ver)); + src[i++] = idn_ver; #endif - #ifdef USE_LIBPSL - { -#if defined(PSL_VERSION_MAJOR) && (PSL_VERSION_MAJOR > 0 || \ - PSL_VERSION_MINOR >= 11) - int num = psl_check_version_number(0); - msnprintf(psl_version, sizeof(psl_version), "libpsl/%d.%d.%d", - num >> 16, (num >> 8) & 0xff, num & 0xff); -#else - msnprintf(psl_version, sizeof(psl_version), "libpsl/%s", - psl_get_version()); + psl_version(psl_ver, sizeof(psl_ver)); + src[i++] = psl_ver; #endif - src[i++] = psl_version; - } -#endif - #ifdef USE_SSH Curl_ssh_version(ssh_version, sizeof(ssh_version)); src[i++] = ssh_version; @@ -233,25 +269,13 @@ char *curl_version(void) Curl_http2_ver(h2_version, sizeof(h2_version)); src[i++] = h2_version; #endif -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 Curl_quic_ver(h3_version, sizeof(h3_version)); src[i++] = h3_version; #endif #ifdef USE_LIBRTMP - { - char suff[2]; - if(RTMP_LIB_VERSION & 0xff) { - suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1; - suff[1] = '\0'; - } - else - suff[0] = '\0'; - - msnprintf(rtmp_version, sizeof(rtmp_version), "librtmp/%d.%d%s", - RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, - suff); - src[i++] = rtmp_version; - } + Curl_rtmp_version(rtmp_version, sizeof(rtmp_version)); + src[i++] = rtmp_version; #endif #ifdef USE_HYPER msnprintf(hyper_buf, sizeof(hyper_buf), "Hyper/%s", hyper_version()); @@ -263,22 +287,8 @@ char *curl_version(void) src[i++] = gsasl_buf; #endif #ifdef USE_OPENLDAP - { - 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 = api.ldapai_vendor_version % 100; - unsigned int major = api.ldapai_vendor_version / 10000; - unsigned int minor = - ((api.ldapai_vendor_version - major * 10000) - patch) / 100; - msnprintf(ldap_buf, sizeof(ldap_buf), "%s/%u.%u.%u", - api.ldapai_vendor_name, major, minor, patch); - src[i++] = ldap_buf; - ldap_memfree(api.ldapai_vendor_name); - ber_memvfree((void **)api.ldapai_extensions); - } - } + oldap_version(ldap_buf, sizeof(ldap_buf)); + src[i++] = ldap_buf; #endif DEBUGASSERT(i <= VERSION_PARTS); @@ -393,18 +403,21 @@ static const char * const supported_protocols[] = { #ifndef CURL_DISABLE_TFTP "tftp", #endif -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_HTTP + /* WebSocket support relies on HTTP */ +#ifndef CURL_DISABLE_WEBSOCKETS "ws", #endif -#if defined(USE_SSL) && defined(USE_WEBSOCKETS) +#if defined(USE_SSL) && !defined(CURL_DISABLE_WEBSOCKETS) "wss", +#endif #endif NULL }; /* - * Feature presence run-time check functions. + * Feature presence runtime check functions. * * Warning: the value returned by these should not change between * curl_global_init() and curl_global_cleanup() calls. @@ -428,6 +441,14 @@ static int https_proxy_present(curl_version_info_data *info) } #endif +#if defined(USE_SSL) && defined(USE_ECH) +static int ech_present(curl_version_info_data *info) +{ + (void) info; + return Curl_ssl_supports(NULL, SSLSUPP_ECH); +} +#endif + /* * Features table. * @@ -456,6 +477,9 @@ static const struct feat features_table[] = { #ifdef DEBUGBUILD FEATURE("Debug", NULL, CURL_VERSION_DEBUG), #endif +#if defined(USE_SSL) && defined(USE_ECH) + FEATURE("ECH", ech_present, 0), +#endif #ifdef USE_GSASL FEATURE("gsasl", NULL, CURL_VERSION_GSASL), #endif @@ -468,17 +492,17 @@ static const struct feat features_table[] = { #if defined(USE_NGHTTP2) FEATURE("HTTP2", NULL, CURL_VERSION_HTTP2), #endif -#if defined(ENABLE_QUIC) +#if defined(USE_HTTP3) FEATURE("HTTP3", NULL, CURL_VERSION_HTTP3), #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_PROXY) && \ !defined(CURL_DISABLE_HTTP) FEATURE("HTTPS-proxy", https_proxy_present, CURL_VERSION_HTTPS_PROXY), #endif -#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) +#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN) FEATURE("IDN", idn_present, CURL_VERSION_IDN), #endif -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 FEATURE("IPv6", NULL, CURL_VERSION_IPV6), #endif #ifdef USE_KERBEROS5 @@ -497,10 +521,6 @@ static const struct feat features_table[] = { #ifdef USE_NTLM FEATURE("NTLM", NULL, CURL_VERSION_NTLM), #endif -#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) && \ - defined(NTLM_WB_ENABLED) - FEATURE("NTLM_WB", NULL, CURL_VERSION_NTLM_WB), -#endif #if defined(USE_LIBPSL) FEATURE("PSL", NULL, CURL_VERSION_PSL), #endif @@ -542,8 +562,8 @@ static curl_version_info_data version_info = { CURLVERSION_NOW, LIBCURL_VERSION, LIBCURL_VERSION_NUM, - OS, /* as found by configure or set by hand at build-time */ - 0, /* features bitmask is built at run-time */ + CURL_OS, /* as found by configure or set by hand at build-time */ + 0, /* features bitmask is built at runtime */ NULL, /* ssl_version */ 0, /* ssl_version_num, this is kept at zero */ NULL, /* zlib_version */ @@ -572,7 +592,8 @@ static curl_version_info_data version_info = { NULL, /* zstd version */ NULL, /* Hyper version */ NULL, /* gsasl version */ - feature_names + feature_names, + NULL /* rtmp version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) @@ -582,7 +603,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp) int features = 0; #if defined(USE_SSH) - static char ssh_buffer[80]; + static char ssh_buf[80]; /* 'ssh_buffer' clashes with libssh/libssh.h */ #endif #ifdef USE_SSL #ifdef CURL_WITH_MULTI_SSL @@ -598,7 +619,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp) static char zstd_buffer[80]; #endif - (void)stamp; /* avoid compiler warnings, we don't use this */ + (void)stamp; /* avoid compiler warnings, we do not use this */ #ifdef USE_SSL Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer)); @@ -623,8 +644,8 @@ curl_version_info_data *curl_version_info(CURLversion stamp) #endif #if defined(USE_SSH) - Curl_ssh_version(ssh_buffer, sizeof(ssh_buffer)); - version_info.libssh_version = ssh_buffer; + Curl_ssh_version(ssh_buf, sizeof(ssh_buf)); + version_info.libssh_version = ssh_buf; #endif #ifdef HAVE_BROTLI @@ -642,12 +663,12 @@ curl_version_info_data *curl_version_info(CURLversion stamp) #ifdef USE_NGHTTP2 { nghttp2_info *h2 = nghttp2_version(0); - version_info.nghttp2_ver_num = h2->version_num; + version_info.nghttp2_ver_num = (unsigned int)h2->version_num; version_info.nghttp2_version = h2->version_str; } #endif -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 { static char quicbuffer[80]; Curl_quic_ver(quicbuffer, sizeof(quicbuffer)); @@ -680,5 +701,13 @@ curl_version_info_data *curl_version_info(CURLversion stamp) feature_names[n] = NULL; /* Terminate array. */ version_info.features = features; +#ifdef USE_LIBRTMP + { + static char rtmp_version[30]; + Curl_rtmp_version(rtmp_version, sizeof(rtmp_version)); + version_info.rtmp_version = rtmp_version; + } +#endif + return &version_info; } diff --git a/deps/curl/lib/version_win32.c b/deps/curl/lib/version_win32.c index e0f239e1..21a122f2 100644 --- a/deps/curl/lib/version_win32.c +++ b/deps/curl/lib/version_win32.c @@ -30,8 +30,10 @@ #include "version_win32.h" #include "warnless.h" -/* The last #include files should be: */ +/* The last 2 #include files should be in this order */ +#ifdef BUILDING_LIBCURL #include "curl_memory.h" +#endif #include "memdebug.h" /* This Unicode version struct works for VerifyVersionInfoW (OSVERSIONINFOEXW) @@ -53,7 +55,7 @@ struct OUR_OSVERSIONINFOEXW { /* * curlx_verify_windows_version() * - * This is used to verify if we are running on a specific windows version. + * This is used to verify if we are running on a specific Windows version. * * Parameters: * @@ -63,7 +65,7 @@ struct OUR_OSVERSIONINFOEXW { * ignored. * platform [in] - The optional platform identifier. * condition [in] - The test condition used to specifier whether we are - * checking a version less then, equal to or greater than + * checking a version less than, equal to or greater than * what is specified in the major and minor version * numbers. * @@ -77,14 +79,14 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, { bool matched = FALSE; -#if defined(CURL_WINDOWS_APP) - (void)buildVersion; - +#if defined(CURL_WINDOWS_UWP) /* We have no way to determine the Windows version from Windows apps, - so let's assume we're running on the target Windows version. */ + so let's assume we are running on the target Windows version. */ const WORD fullVersion = MAKEWORD(minorVersion, majorVersion); const WORD targetVersion = (WORD)_WIN32_WINNT; + (void)buildVersion; + switch(condition) { case VERSION_LESS_THAN: matched = targetVersion < fullVersion; @@ -108,7 +110,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, } if(matched && (platform == PLATFORM_WINDOWS)) { - /* we're always running on PLATFORM_WINNT */ + /* we are always running on PLATFORM_WINNT */ matched = FALSE; } #elif !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \ @@ -207,12 +209,12 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, typedef LONG (APIENTRY *RTLVERIFYVERSIONINFO_FN) (struct OUR_OSVERSIONINFOEXW *, ULONG, ULONGLONG); static RTLVERIFYVERSIONINFO_FN pRtlVerifyVersionInfo; - static bool onetime = true; /* safe because first call is during init */ + static bool onetime = TRUE; /* safe because first call is during init */ if(onetime) { pRtlVerifyVersionInfo = CURLX_FUNCTION_CAST(RTLVERIFYVERSIONINFO_FN, (GetProcAddress(GetModuleHandleA("ntdll"), "RtlVerifyVersionInfo"))); - onetime = false; + onetime = FALSE; } switch(condition) { diff --git a/deps/curl/lib/version_win32.h b/deps/curl/lib/version_win32.h index 95c06611..95a9e7f2 100644 --- a/deps/curl/lib/version_win32.h +++ b/deps/curl/lib/version_win32.h @@ -44,7 +44,7 @@ typedef enum { PLATFORM_WINNT } PlatformIdentifier; -/* This is used to verify if we are running on a specific windows version */ +/* This is used to verify if we are running on a specific Windows version */ bool curlx_verify_windows_version(const unsigned int majorVersion, const unsigned int minorVersion, const unsigned int buildVersion, diff --git a/deps/curl/lib/vquic/.checksrc b/deps/curl/lib/vquic/.checksrc new file mode 100644 index 00000000..9066946c --- /dev/null +++ b/deps/curl/lib/vquic/.checksrc @@ -0,0 +1,2 @@ +enable STRERROR +enable STRNCPY diff --git a/deps/curl/lib/vquic/curl_msh3.c b/deps/curl/lib/vquic/curl_msh3.c index 7674bc1f..fe812f87 100644 --- a/deps/curl/lib/vquic/curl_msh3.c +++ b/deps/curl/lib/vquic/curl_msh3.c @@ -27,6 +27,7 @@ #ifdef USE_MSH3 #include "urldata.h" +#include "hash.h" #include "timeval.h" #include "multiif.h" #include "sendf.h" @@ -70,7 +71,7 @@ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); \ pthread_mutex_init(lock, &attr); \ pthread_mutexattr_destroy(&attr); \ -}while(0) +} while(0) #define msh3_lock_uninitialize(lock) pthread_mutex_destroy(lock) #define msh3_lock_acquire(lock) pthread_mutex_lock(lock) #define msh3_lock_release(lock) pthread_mutex_unlock(lock) @@ -118,15 +119,40 @@ struct cf_msh3_ctx { struct cf_call_data call_data; struct curltime connect_started; /* time the current attempt started */ struct curltime handshake_at; /* time connect handshake finished */ + struct Curl_hash streams; /* hash `data->mid` to `stream_ctx` */ /* Flags written by msh3/msquic thread */ bool handshake_complete; bool handshake_succeeded; bool connected; + BIT(initialized); /* Flags written by curl thread */ BIT(verbose); BIT(active); }; +static void h3_stream_hash_free(void *stream); + +static void cf_msh3_ctx_init(struct cf_msh3_ctx *ctx, + const struct Curl_addrinfo *ai) +{ + DEBUGASSERT(!ctx->initialized); + Curl_hash_offt_init(&ctx->streams, 63, h3_stream_hash_free); + Curl_sock_assign_addr(&ctx->addr, ai, TRNSPRT_QUIC); + ctx->sock[SP_LOCAL] = CURL_SOCKET_BAD; + ctx->sock[SP_REMOTE] = CURL_SOCKET_BAD; + ctx->initialized = TRUE; +} + +static void cf_msh3_ctx_free(struct cf_msh3_ctx *ctx) +{ + if(ctx && ctx->initialized) { + Curl_hash_destroy(&ctx->streams); + } + free(ctx); +} + +static struct cf_msh3_ctx *h3_get_msh3_ctx(struct Curl_easy *data); + /* How to access `call_data` from a cf_msh3 filter */ #undef CF_CTX_CALL_DATA #define CF_CTX_CALL_DATA(cf) \ @@ -153,18 +179,26 @@ struct stream_ctx { bool recv_header_complete; }; -#define H3_STREAM_CTX(d) ((struct stream_ctx *)(((d) && (d)->req.p.http)? \ - ((struct HTTP *)(d)->req.p.http)->h3_ctx \ - : NULL)) -#define H3_STREAM_LCTX(d) ((struct HTTP *)(d)->req.p.http)->h3_ctx -#define H3_STREAM_ID(d) (H3_STREAM_CTX(d)? \ - H3_STREAM_CTX(d)->id : -2) +#define H3_STREAM_CTX(ctx,data) ((struct stream_ctx *)((data && ctx)? \ + Curl_hash_offt_get(&(ctx)->streams, (data)->mid) : NULL)) +static void h3_stream_ctx_free(struct stream_ctx *stream) +{ + Curl_bufq_free(&stream->recvbuf); + free(stream); +} + +static void h3_stream_hash_free(void *stream) +{ + DEBUGASSERT(stream); + h3_stream_ctx_free((struct stream_ctx *)stream); +} static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream) return CURLE_OK; @@ -173,25 +207,29 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, if(!stream) return CURLE_OUT_OF_MEMORY; - H3_STREAM_LCTX(data) = stream; stream->req = ZERO_NULL; msh3_lock_initialize(&stream->recv_lock); Curl_bufq_init2(&stream->recvbuf, H3_STREAM_CHUNK_SIZE, H3_STREAM_RECV_CHUNKS, BUFQ_OPT_SOFT_LIMIT); CURL_TRC_CF(data, cf, "data setup"); + + if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { + h3_stream_ctx_free(stream); + return CURLE_OUT_OF_MEMORY; + } + return CURLE_OK; } static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)cf; if(stream) { CURL_TRC_CF(data, cf, "easy handle is done"); - Curl_bufq_free(&stream->recvbuf); - free(stream); - H3_STREAM_LCTX(data) = NULL; + Curl_hash_offt_remove(&ctx->streams, data->mid); } } @@ -210,10 +248,11 @@ static void drain_stream_from_other_thread(struct Curl_easy *data, } } -static void drain_stream(struct Curl_cfilter *cf, - struct Curl_easy *data) +static void h3_drain_stream(struct Curl_cfilter *cf, + struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); unsigned char bits; (void)cf; @@ -241,9 +280,9 @@ static void MSH3_CALL msh3_conn_connected(MSH3_CONNECTION *Connection, (void)Connection; CURL_TRC_CF(data, cf, "[MSH3] connected"); - ctx->handshake_succeeded = true; - ctx->connected = true; - ctx->handshake_complete = true; + ctx->handshake_succeeded = TRUE; + ctx->connected = TRUE; + ctx->handshake_complete = TRUE; } static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection, @@ -255,8 +294,8 @@ static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection, (void)Connection; CURL_TRC_CF(data, cf, "[MSH3] shutdown complete"); - ctx->connected = false; - ctx->handshake_complete = true; + ctx->connected = FALSE; + ctx->handshake_complete = TRUE; } static void MSH3_CALL msh3_conn_new_request(MSH3_CONNECTION *Connection, @@ -276,7 +315,7 @@ static const MSH3_REQUEST_IF msh3_request_if = { msh3_data_sent }; -/* Decode HTTP status code. Returns -1 if no valid status code was +/* Decode HTTP status code. Returns -1 if no valid status code was decoded. (duplicate from http2.c) */ static int decode_status_code(const char *value, size_t len) { @@ -311,7 +350,8 @@ static int decode_status_code(const char *value, size_t len) static CURLcode write_resp_raw(struct Curl_easy *data, const void *mem, size_t memlen) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = h3_get_msh3_ctx(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; ssize_t nwritten; @@ -337,10 +377,12 @@ static void MSH3_CALL msh3_header_received(MSH3_REQUEST *Request, const MSH3_HEADER *hd) { struct Curl_easy *data = userp; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = h3_get_msh3_ctx(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result; (void)Request; + DEBUGF(infof(data, "[MSH3] header received, stream=%d", !!stream)); if(!stream || stream->recv_header_complete) { return; } @@ -386,7 +428,8 @@ static bool MSH3_CALL msh3_data_received(MSH3_REQUEST *Request, const uint8_t *buf) { struct Curl_easy *data = IfContext; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = h3_get_msh3_ctx(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result; bool rv = FALSE; @@ -407,7 +450,7 @@ static bool MSH3_CALL msh3_data_received(MSH3_REQUEST *Request, stream->recv_error = result; goto out; } - stream->recv_header_complete = true; + stream->recv_header_complete = TRUE; } result = write_resp_raw(data, buf, *buflen); @@ -425,14 +468,15 @@ static void MSH3_CALL msh3_complete(MSH3_REQUEST *Request, void *IfContext, bool aborted, uint64_t error) { struct Curl_easy *data = IfContext; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = h3_get_msh3_ctx(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)Request; if(!stream) return; msh3_lock_acquire(&stream->recv_lock); stream->closed = TRUE; - stream->recv_header_complete = true; + stream->recv_header_complete = TRUE; if(error) stream->error3 = error; if(aborted) @@ -444,7 +488,8 @@ static void MSH3_CALL msh3_shutdown_complete(MSH3_REQUEST *Request, void *IfContext) { struct Curl_easy *data = IfContext; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = h3_get_msh3_ctx(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(!stream) return; @@ -456,7 +501,8 @@ static void MSH3_CALL msh3_data_sent(MSH3_REQUEST *Request, void *IfContext, void *SendContext) { struct Curl_easy *data = IfContext; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = h3_get_msh3_ctx(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(!stream) return; (void)Request; @@ -468,7 +514,8 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf, struct Curl_easy *data, CURLcode *err) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nread = -1; if(!stream) { @@ -501,7 +548,8 @@ out: static void set_quic_expire(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); /* we have no indication from msh3 when it would be a good time * to juggle the connection again. So, we compromise by calling @@ -518,17 +566,17 @@ static void set_quic_expire(struct Curl_cfilter *cf, struct Curl_easy *data) static ssize_t cf_msh3_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nread = -1; struct cf_call_data save; - (void)cf; + CURL_TRC_CF(data, cf, "cf_recv(len=%zu), stream=%d", len, !!stream); if(!stream) { *err = CURLE_RECV_ERROR; return -1; } CF_DATA_SAVE(save, cf, data); - CURL_TRC_CF(data, cf, "req: recv with %zu byte buffer", len); msh3_lock_acquire(&stream->recv_lock); @@ -548,7 +596,7 @@ static ssize_t cf_msh3_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(nread < 0) goto out; if(stream->closed) - drain_stream(cf, data); + h3_drain_stream(cf, data); } else if(stream->closed) { nread = recv_closed_stream(cf, data, err); @@ -567,17 +615,17 @@ out: } static ssize_t cf_msh3_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_msh3_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); struct h1_req_parser h1; struct dynhds h2_headers; MSH3_HEADER *nva = NULL; size_t nheader, i; ssize_t nwritten = -1; struct cf_call_data save; - bool eos; CF_DATA_SAVE(save, cf, data); @@ -620,21 +668,6 @@ static ssize_t cf_msh3_send(struct Curl_cfilter *cf, struct Curl_easy *data, nva[i].ValueLength = e->valuelen; } - switch(data->state.httpreq) { - case HTTPREQ_POST: - case HTTPREQ_POST_FORM: - case HTTPREQ_POST_MIME: - case HTTPREQ_PUT: - /* known request body size or -1 */ - eos = FALSE; - break; - default: - /* there is not request body */ - eos = TRUE; - stream->upload_done = TRUE; - break; - } - CURL_TRC_CF(data, cf, "req: send %zu headers", nheader); stream->req = MsH3RequestOpen(ctx->qconn, &msh3_request_if, data, nva, nheader, @@ -663,7 +696,7 @@ static ssize_t cf_msh3_send(struct Curl_cfilter *cf, struct Curl_easy *data, } /* TODO - msh3/msquic will hold onto this memory until the send complete - event. How do we make sure curl doesn't free it until then? */ + event. How do we make sure curl does not free it until then? */ *err = CURLE_OK; nwritten = len; } @@ -682,18 +715,18 @@ static void cf_msh3_adjust_pollset(struct Curl_cfilter *cf, struct easy_pollset *ps) { struct cf_msh3_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); struct cf_call_data save; CF_DATA_SAVE(save, cf, data); if(stream && ctx->sock[SP_LOCAL] != CURL_SOCKET_BAD) { if(stream->recv_error) { Curl_pollset_add_in(data, ps, ctx->sock[SP_LOCAL]); - drain_stream(cf, data); + h3_drain_stream(cf, data); } else if(stream->req) { Curl_pollset_add_out(data, ps, ctx->sock[SP_LOCAL]); - drain_stream(cf, data); + h3_drain_stream(cf, data); } } } @@ -701,7 +734,8 @@ static void cf_msh3_adjust_pollset(struct Curl_cfilter *cf, static bool cf_msh3_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); struct cf_call_data save; bool pending = FALSE; @@ -715,36 +749,19 @@ static bool cf_msh3_data_pending(struct Curl_cfilter *cf, pending = !Curl_bufq_is_empty(&stream->recvbuf); msh3_lock_release(&stream->recv_lock); if(pending) - drain_stream(cf, (struct Curl_easy *)data); + h3_drain_stream(cf, (struct Curl_easy *)data); } CF_DATA_RESTORE(cf, save); return pending; } -static void cf_msh3_active(struct Curl_cfilter *cf, struct Curl_easy *data) -{ - struct cf_msh3_ctx *ctx = cf->ctx; - - /* use this socket from now on */ - cf->conn->sock[cf->sockindex] = ctx->sock[SP_LOCAL]; - /* the first socket info gets set at conn and data */ - if(cf->sockindex == FIRSTSOCKET) { - cf->conn->remote_addr = &ctx->addr; - #ifdef ENABLE_IPV6 - cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6)? TRUE : FALSE; - #endif - Curl_persistconninfo(data, cf->conn, ctx->l_ip, ctx->l_port); - } - ctx->active = TRUE; -} - static CURLcode h3_data_pause(struct Curl_cfilter *cf, struct Curl_easy *data, bool pause) { if(!pause) { - drain_stream(cf, data); + h3_drain_stream(cf, data); Curl_expire(data, 0, EXPIRE_RUN_NOW); } return CURLE_OK; @@ -754,7 +771,8 @@ static CURLcode cf_msh3_data_event(struct Curl_cfilter *cf, struct Curl_easy *data, int event, int arg1, void *arg2) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_msh3_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); struct cf_call_data save; CURLcode result = CURLE_OK; @@ -785,10 +803,6 @@ static CURLcode cf_msh3_data_event(struct Curl_cfilter *cf, } } break; - case CF_CTRL_CONN_INFO_UPDATE: - CURL_TRC_CF(data, cf, "req: update info"); - cf_msh3_active(cf, data); - break; default: break; } @@ -806,12 +820,13 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, CURLcode result; bool verify; + DEBUGASSERT(ctx->initialized); conn_config = Curl_ssl_cf_get_primary_config(cf); if(!conn_config) return CURLE_FAILED_INIT; verify = !!conn_config->verifypeer; - memcpy(&addr, &ctx->addr.sa_addr, ctx->addr.addrlen); + memcpy(&addr, &ctx->addr.curl_sa_addr, ctx->addr.addrlen); MSH3_SET_PORT(&addr, (uint16_t)cf->conn->remote_port); if(verify && (conn_config->CAfile || conn_config->CApath)) { @@ -832,7 +847,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, ctx->api = MsH3ApiOpen(); if(!ctx->api) { - failf(data, "can't create msh3 api"); + failf(data, "cannot create msh3 api"); return CURLE_FAILED_INIT; } @@ -843,7 +858,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, &addr, !verify); if(!ctx->qconn) { - failf(data, "can't create msh3 connection"); + failf(data, "cannot create msh3 connection"); if(ctx->api) { MsH3ApiClose(ctx->api); ctx->api = NULL; @@ -875,7 +890,7 @@ static CURLcode cf_msh3_connect(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); if(ctx->sock[SP_LOCAL] == CURL_SOCKET_BAD) { - if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx->sock[0]) < 0) { + if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx->sock[0], FALSE) < 0) { ctx->sock[SP_LOCAL] = CURL_SOCKET_BAD; ctx->sock[SP_REMOTE] = CURL_SOCKET_BAD; return CURLE_COULDNT_CONNECT; @@ -896,7 +911,6 @@ static CURLcode cf_msh3_connect(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "handshake succeeded"); cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ cf->conn->httpversion = 30; - cf->conn->bundle->multiuse = BUNDLE_MULTIPLEX; cf->connected = TRUE; cf->conn->alpn = CURL_HTTP_VERSION_3; *done = TRUE; @@ -970,10 +984,11 @@ static void cf_msh3_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) CF_DATA_SAVE(save, cf, data); cf_msh3_close(cf, data); - free(cf->ctx); - cf->ctx = NULL; + if(cf->ctx) { + cf_msh3_ctx_free(cf->ctx); + cf->ctx = NULL; + } /* no CF_DATA_RESTORE(cf, save); its gone */ - } static CURLcode cf_msh3_query(struct Curl_cfilter *cf, @@ -1005,7 +1020,7 @@ static CURLcode cf_msh3_query(struct Curl_cfilter *cf, default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -1029,6 +1044,7 @@ struct Curl_cftype Curl_cft_http3 = { cf_msh3_destroy, cf_msh3_connect, cf_msh3_close, + Curl_cf_def_shutdown, Curl_cf_def_get_host, cf_msh3_adjust_pollset, cf_msh3_data_pending, @@ -1040,6 +1056,20 @@ struct Curl_cftype Curl_cft_http3 = { cf_msh3_query, }; +static struct cf_msh3_ctx *h3_get_msh3_ctx(struct Curl_easy *data) +{ + if(data && data->conn) { + struct Curl_cfilter *cf = data->conn->cfilter[FIRSTSOCKET]; + while(cf) { + if(cf->cft == &Curl_cft_http3) + return cf->ctx; + cf = cf->next; + } + } + DEBUGF(infof(data, "no filter context found")); + return NULL; +} + CURLcode Curl_cf_msh3_create(struct Curl_cfilter **pcf, struct Curl_easy *data, struct connectdata *conn, @@ -1057,17 +1087,15 @@ CURLcode Curl_cf_msh3_create(struct Curl_cfilter **pcf, result = CURLE_OUT_OF_MEMORY; goto out; } - Curl_sock_assign_addr(&ctx->addr, ai, TRNSPRT_QUIC); - ctx->sock[SP_LOCAL] = CURL_SOCKET_BAD; - ctx->sock[SP_REMOTE] = CURL_SOCKET_BAD; + cf_msh3_ctx_init(ctx, ai); result = Curl_cf_create(&cf, &Curl_cft_http3, ctx); out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { Curl_safefree(cf); - Curl_safefree(ctx); + cf_msh3_ctx_free(ctx); } return result; @@ -1077,7 +1105,7 @@ bool Curl_conn_is_msh3(const struct Curl_easy *data, const struct connectdata *conn, int sockindex) { - struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL; + struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; (void)data; for(; cf; cf = cf->next) { diff --git a/deps/curl/lib/vquic/curl_ngtcp2.c b/deps/curl/lib/vquic/curl_ngtcp2.c index b49956ab..4a3c0045 100644 --- a/deps/curl/lib/vquic/curl_ngtcp2.c +++ b/deps/curl/lib/vquic/curl_ngtcp2.c @@ -41,9 +41,11 @@ #include "vtls/gtls.h" #elif defined(USE_WOLFSSL) #include +#include "vtls/wolfssl.h" #endif #include "urldata.h" +#include "hash.h" #include "sendf.h" #include "strdup.h" #include "rand.h" @@ -87,7 +89,7 @@ /* The pool keeps spares around and half of a full stream windows * seems good. More does not seem to improve performance. * The benefit of the pool is that stream buffer to not keep - * spares. So memory consumption goes down when streams run empty, + * 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 @@ -113,7 +115,7 @@ void Curl_ngtcp2_ver(char *p, size_t len) struct cf_ngtcp2_ctx { struct cf_quic_ctx q; struct ssl_peer peer; - struct quic_tls_ctx tls; + struct curl_tls_ctx tls; ngtcp2_path connected_path; ngtcp2_conn *qconn; ngtcp2_cid dcid; @@ -128,11 +130,16 @@ struct cf_ngtcp2_ctx { nghttp3_settings h3settings; struct curltime started_at; /* time the current attempt started */ struct curltime handshake_at; /* time connect handshake finished */ - struct curltime reconnect_at; /* time the next attempt should start */ struct bufc_pool stream_bufcp; /* chunk pool for streams */ + struct dynbuf scratch; /* temp buffer for header construction */ + struct Curl_hash streams; /* hash `data->mid` to `h3_stream_ctx` */ size_t max_stream_window; /* max flow window for one stream */ uint64_t max_idle_ms; /* max idle time for QUIC connection */ + uint64_t used_bidi_streams; /* bidi streams we have opened */ + uint64_t max_bidi_streams; /* max bidi streams we can open */ int qlogfd; + BIT(initialized); + BIT(shutdown_started); /* queued shutdown packets */ }; /* How to access `call_data` from a cf_ngtcp2 filter */ @@ -140,18 +147,54 @@ struct cf_ngtcp2_ctx { #define CF_CTX_CALL_DATA(cf) \ ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data +static void h3_stream_hash_free(void *stream); + +static void cf_ngtcp2_ctx_init(struct cf_ngtcp2_ctx *ctx) +{ + DEBUGASSERT(!ctx->initialized); + ctx->qlogfd = -1; + ctx->version = NGTCP2_PROTO_VER_MAX; + ctx->max_stream_window = H3_STREAM_WINDOW_SIZE; + ctx->max_idle_ms = CURL_QUIC_MAX_IDLE_MS; + Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, + H3_STREAM_POOL_SPARES); + Curl_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); + Curl_hash_offt_init(&ctx->streams, 63, h3_stream_hash_free); + ctx->initialized = TRUE; +} + +static void cf_ngtcp2_ctx_free(struct cf_ngtcp2_ctx *ctx) +{ + if(ctx && ctx->initialized) { + Curl_bufcp_free(&ctx->stream_bufcp); + Curl_dyn_free(&ctx->scratch); + Curl_hash_clean(&ctx->streams); + Curl_hash_destroy(&ctx->streams); + Curl_ssl_peer_cleanup(&ctx->peer); + } + free(ctx); +} + +struct pkt_io_ctx; +static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct pkt_io_ctx *pktx); +static CURLcode cf_progress_egress(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct pkt_io_ctx *pktx); + /** * All about the H3 internals of a stream */ struct h3_stream_ctx { - int64_t id; /* HTTP/3 protocol identifier */ + curl_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" */ - size_t upload_blocked_len; /* the amount written last and EGAINed */ - uint64_t error3; /* HTTP/3 stream error code */ + curl_uint64_t error3; /* HTTP/3 stream error code */ curl_off_t upload_left; /* number of request bytes left to upload */ int status_code; /* HTTP status code */ + CURLcode xfer_result; /* result from xfer_resp_write(_hd) */ bool resp_hds_complete; /* we have a complete, final response */ bool closed; /* TRUE on stream close */ bool reset; /* TRUE on stream reset */ @@ -159,23 +202,32 @@ struct h3_stream_ctx { BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ }; -#define H3_STREAM_CTX(d) ((struct h3_stream_ctx *)(((d) && (d)->req.p.http)? \ - ((struct HTTP *)(d)->req.p.http)->h3_ctx \ - : NULL)) -#define H3_STREAM_LCTX(d) ((struct HTTP *)(d)->req.p.http)->h3_ctx -#define H3_STREAM_ID(d) (H3_STREAM_CTX(d)? \ - H3_STREAM_CTX(d)->id : -2) +#define H3_STREAM_CTX(ctx,data) ((struct h3_stream_ctx *)(\ + data? Curl_hash_offt_get(&(ctx)->streams, (data)->mid) : NULL)) +#define H3_STREAM_CTX_ID(ctx,id) ((struct h3_stream_ctx *)(\ + Curl_hash_offt_get(&(ctx)->streams, (id)))) + +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); +} + +static void h3_stream_hash_free(void *stream) +{ + DEBUGASSERT(stream); + h3_stream_ctx_free((struct h3_stream_ctx *)stream); +} static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_ngtcp2_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - if(!data || !data->req.p.http) { - failf(data, "initialization failure, transfer not http initialized"); + if(!data) return CURLE_FAILED_INIT; - } if(stream) return CURLE_OK; @@ -191,59 +243,86 @@ 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); - H3_STREAM_LCTX(data) = stream; + if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { + h3_stream_ctx_free(stream); + return CURLE_OUT_OF_MEMORY; + } + return CURLE_OK; } +static void cf_ngtcp2_stream_close(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream) +{ + struct cf_ngtcp2_ctx *ctx = cf->ctx; + DEBUGASSERT(data); + DEBUGASSERT(stream); + if(!stream->closed && ctx->qconn && ctx->h3conn) { + CURLcode result; + + nghttp3_conn_set_stream_user_data(ctx->h3conn, stream->id, NULL); + ngtcp2_conn_set_stream_user_data(ctx->qconn, stream->id, NULL); + stream->closed = TRUE; + (void)ngtcp2_conn_shutdown_stream(ctx->qconn, 0, stream->id, + NGHTTP3_H3_REQUEST_CANCELLED); + result = cf_progress_egress(cf, data, NULL); + if(result) + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cancel stream -> %d", + stream->id, result); + } +} + static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_ngtcp2_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(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); - if(ctx->h3conn && !stream->closed) { - nghttp3_conn_shutdown_stream_read(ctx->h3conn, stream->id); - nghttp3_conn_close_stream(ctx->h3conn, stream->id, - NGHTTP3_H3_REQUEST_CANCELLED); - nghttp3_conn_set_stream_user_data(ctx->h3conn, stream->id, NULL); - ngtcp2_conn_set_stream_user_data(ctx->qconn, stream->id, NULL); - stream->closed = TRUE; - } - - Curl_bufq_free(&stream->sendbuf); - Curl_h1_req_parse_free(&stream->h1); - free(stream); - H3_STREAM_LCTX(data) = NULL; + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] easy handle is done", + stream->id); + cf_ngtcp2_stream_close(cf, data, stream); + Curl_hash_offt_remove(&ctx->streams, data->mid); } } static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, struct Curl_easy *data, - int64_t stream_id) + int64_t stream_id, + struct h3_stream_ctx **pstream) { - struct Curl_easy *sdata; + struct cf_ngtcp2_ctx *ctx = cf->ctx; + struct h3_stream_ctx *stream; (void)cf; - if(H3_STREAM_ID(data) == stream_id) { + stream = H3_STREAM_CTX(ctx, data); + if(stream && stream->id == stream_id) { + *pstream = stream; return data; } else { + struct Curl_llist_node *e; DEBUGASSERT(data->multi); - for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { - if((sdata->conn == data->conn) && H3_STREAM_ID(sdata) == stream_id) { + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); + if(sdata->conn != data->conn) + continue; + stream = H3_STREAM_CTX(ctx, sdata); + if(stream && stream->id == stream_id) { + *pstream = stream; return sdata; } } } + *pstream = NULL; return NULL; } static void h3_drain_stream(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_ngtcp2_ctx *ctx = cf->ctx; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); unsigned char bits; (void)cf; @@ -274,8 +353,8 @@ static void pktx_update_time(struct pkt_io_ctx *pktx, struct cf_ngtcp2_ctx *ctx = cf->ctx; vquic_ctx_update_time(&ctx->q); - pktx->ts = ctx->q.last_op.tv_sec * NGTCP2_SECONDS + - ctx->q.last_op.tv_usec * NGTCP2_MICROSECONDS; + pktx->ts = (ngtcp2_tstamp)ctx->q.last_op.tv_sec * NGTCP2_SECONDS + + (ngtcp2_tstamp)ctx->q.last_op.tv_usec * NGTCP2_MICROSECONDS; } static void pktx_init(struct pkt_io_ctx *pktx, @@ -289,12 +368,6 @@ static void pktx_init(struct pkt_io_ctx *pktx, pktx_update_time(pktx, cf); } -static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct pkt_io_ctx *pktx); -static CURLcode cf_progress_egress(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct pkt_io_ctx *pktx); static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id, uint64_t datalen, void *user_data, void *stream_user_data); @@ -357,7 +430,7 @@ static void quic_settings(struct cf_ngtcp2_ctx *ctx, s->initial_ts = pktx->ts; s->handshake_timeout = QUIC_HANDSHAKE_TIMEOUT; s->max_window = 100 * ctx->max_stream_window; - s->max_stream_window = ctx->max_stream_window; + s->max_stream_window = 10 * ctx->max_stream_window; t->initial_max_data = 10 * ctx->max_stream_window; t->initial_max_stream_data_bidi_local = ctx->max_stream_window; @@ -371,7 +444,7 @@ static void quic_settings(struct cf_ngtcp2_ctx *ctx, } } -static int init_ngh3_conn(struct Curl_cfilter *cf); +static CURLcode init_ngh3_conn(struct Curl_cfilter *cf); static int cb_handshake_completed(ngtcp2_conn *tconn, void *user_data) { @@ -380,13 +453,60 @@ static int cb_handshake_completed(ngtcp2_conn *tconn, void *user_data) return 0; } +static void cf_ngtcp2_conn_close(struct Curl_cfilter *cf, + struct Curl_easy *data); + +static bool cf_ngtcp2_err_is_fatal(int code) +{ + return (NGTCP2_ERR_FATAL >= code) || + (NGTCP2_ERR_DROP_CONN == code) || + (NGTCP2_ERR_IDLE_CLOSE == code); +} + +static void cf_ngtcp2_err_set(struct Curl_cfilter *cf, + struct Curl_easy *data, int code) +{ + struct cf_ngtcp2_ctx *ctx = cf->ctx; + if(!ctx->last_error.error_code) { + if(NGTCP2_ERR_CRYPTO == code) { + ngtcp2_ccerr_set_tls_alert(&ctx->last_error, + ngtcp2_conn_get_tls_alert(ctx->qconn), + NULL, 0); + } + else { + ngtcp2_ccerr_set_liberr(&ctx->last_error, code, NULL, 0); + } + } + if(cf_ngtcp2_err_is_fatal(code)) + cf_ngtcp2_conn_close(cf, data); +} + +static bool cf_ngtcp2_h3_err_is_fatal(int code) +{ + return (NGHTTP3_ERR_FATAL >= code) || + (NGHTTP3_ERR_H3_CLOSED_CRITICAL_STREAM == code); +} + +static void cf_ngtcp2_h3_err_set(struct Curl_cfilter *cf, + struct Curl_easy *data, int code) +{ + struct cf_ngtcp2_ctx *ctx = cf->ctx; + if(!ctx->last_error.error_code) { + ngtcp2_ccerr_set_application_error(&ctx->last_error, + nghttp3_err_infer_quic_app_error_code(code), NULL, 0); + } + if(cf_ngtcp2_h3_err_is_fatal(code)) + cf_ngtcp2_conn_close(cf, data); +} + static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags, - int64_t stream_id, uint64_t offset, + int64_t sid, 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; @@ -395,26 +515,26 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags, nconsumed = nghttp3_conn_read_stream(ctx->h3conn, stream_id, buf, buflen, fin); - CURL_TRC_CF(data, cf, "[%" PRId64 "] read_stream(len=%zu) -> %zd", - stream_id, buflen, nconsumed); + if(!data) + data = CF_DATA_CURRENT(cf); + if(data) + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read_stream(len=%zu) -> %zd", + stream_id, buflen, nconsumed); if(nconsumed < 0) { - if(!data) { - struct Curl_easy *cdata = CF_DATA_CURRENT(cf); - CURL_TRC_CF(cdata, cf, "[%" PRId64 "] nghttp3 error on stream not " - "used by us, ignored", stream_id); - return 0; + struct h3_stream_ctx *stream = H3_STREAM_CTX_ID(ctx, stream_id); + if(data && stream) { + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] error on known stream, " + "reset=%d, closed=%d", + stream_id, stream->reset, stream->closed); } - ngtcp2_ccerr_set_application_error( - &ctx->last_error, - nghttp3_err_infer_quic_app_error_code((int)nconsumed), NULL, 0); return NGTCP2_ERR_CALLBACK_FAILURE; } /* number of bytes inside buflen which consists of framing overhead * including QPACK HEADERS. In other words, it does not consume payload of * DATA frame. */ - ngtcp2_conn_extend_max_stream_offset(tconn, stream_id, nconsumed); - ngtcp2_conn_extend_max_offset(tconn, nconsumed); + ngtcp2_conn_extend_max_stream_offset(tconn, stream_id, (uint64_t)nconsumed); + ngtcp2_conn_extend_max_offset(tconn, (uint64_t)nconsumed); return 0; } @@ -442,41 +562,45 @@ 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 stream3_id, uint64_t app_error_code, + int64_t sid, uint64_t app_error_code, void *user_data, void *stream_user_data) { struct Curl_cfilter *cf = user_data; - struct Curl_easy *data = stream_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; - (void)data; /* stream is closed... */ + if(!data) + data = CF_DATA_CURRENT(cf); + if(!data) + return NGTCP2_ERR_CALLBACK_FAILURE; if(!(flags & NGTCP2_STREAM_CLOSE_FLAG_APP_ERROR_CODE_SET)) { app_error_code = NGHTTP3_H3_NO_ERROR; } - rv = nghttp3_conn_close_stream(ctx->h3conn, stream3_id, - app_error_code); - CURL_TRC_CF(data, cf, "[%" PRId64 "] quic close(err=%" - PRIu64 ") -> %d", stream3_id, app_error_code, rv); + 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); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { - ngtcp2_ccerr_set_application_error( - &ctx->last_error, nghttp3_err_infer_quic_app_error_code(rv), NULL, 0); + cf_ngtcp2_h3_err_set(cf, data, rv); return NGTCP2_ERR_CALLBACK_FAILURE; } return 0; } -static int cb_stream_reset(ngtcp2_conn *tconn, int64_t stream_id, +static int cb_stream_reset(ngtcp2_conn *tconn, int64_t sid, 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; @@ -485,7 +609,7 @@ static int cb_stream_reset(ngtcp2_conn *tconn, int64_t stream_id, (void)data; rv = nghttp3_conn_shutdown_stream_read(ctx->h3conn, stream_id); - CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { return NGTCP2_ERR_CALLBACK_FAILURE; } @@ -516,19 +640,26 @@ static int cb_extend_max_local_streams_bidi(ngtcp2_conn *tconn, uint64_t max_streams, void *user_data) { - (void)tconn; - (void)max_streams; - (void)user_data; + struct Curl_cfilter *cf = user_data; + struct cf_ngtcp2_ctx *ctx = cf->ctx; + struct Curl_easy *data = CF_DATA_CURRENT(cf); + (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); return 0; } -static int cb_extend_max_stream_data(ngtcp2_conn *tconn, int64_t stream_id, +static int cb_extend_max_stream_data(ngtcp2_conn *tconn, int64_t sid, uint64_t max_data, 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 = CF_DATA_CURRENT(cf); struct Curl_easy *s_data; struct h3_stream_ctx *stream; @@ -541,12 +672,11 @@ static int cb_extend_max_stream_data(ngtcp2_conn *tconn, int64_t stream_id, if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { return NGTCP2_ERR_CALLBACK_FAILURE; } - s_data = get_stream_easy(cf, data, stream_id); - stream = H3_STREAM_CTX(s_data); - if(stream && stream->quic_flow_blocked) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] unblock quic flow", stream_id); + s_data = get_stream_easy(cf, data, stream_id, &stream); + if(s_data && stream && stream->quic_flow_blocked) { + CURL_TRC_CF(s_data, cf, "[%" FMT_PRId64 "] unblock quic flow", stream_id); stream->quic_flow_blocked = FALSE; - h3_drain_stream(cf, data); + h3_drain_stream(cf, s_data); } return 0; } @@ -559,7 +689,7 @@ static void cb_rand(uint8_t *dest, size_t destlen, result = Curl_rand(NULL, dest, destlen); if(result) { - /* cb_rand is only used for non-cryptographic context. If Curl_rand + /* cb_rand is only used for non-cryptographic context. If Curl_rand failed, just fill 0 and call it *random*. */ memset(dest, 0, destlen); } @@ -602,6 +732,11 @@ static int cb_recv_rx_key(ngtcp2_conn *tconn, ngtcp2_encryption_level level, return 0; } +#if defined(_MSC_VER) && defined(_DLL) +# pragma warning(push) +# pragma warning(disable:4232) /* MSVC extension, dllimport identity */ +#endif + static ngtcp2_callbacks ng_callbacks = { ngtcp2_crypto_client_initial_cb, NULL, /* recv_client_initial */ @@ -645,6 +780,10 @@ static ngtcp2_callbacks ng_callbacks = { NULL, /* early_data_rejected */ }; +#if defined(_MSC_VER) && defined(_DLL) +# pragma warning(pop) +#endif + /** * Connection maintenance like timeouts on packet ACKs etc. are done by us, not * the OS like for TCP. POLL events on the socket therefore are not @@ -676,7 +815,7 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, if(rv) { failf(data, "ngtcp2_conn_handle_expiry returned error: %s", ngtcp2_strerror(rv)); - ngtcp2_ccerr_set_liberr(&ctx->last_error, rv, NULL, 0); + cf_ngtcp2_err_set(cf, data, rv); return CURLE_SEND_ERROR; } result = cf_progress_ingress(cf, data, pktx); @@ -694,7 +833,8 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, if(timeout % NGTCP2_MILLISECONDS) { timeout += NGTCP2_MILLISECONDS; } - Curl_expire(data, timeout / NGTCP2_MILLISECONDS, EXPIRE_QUIC); + Curl_expire(data, (timediff_t)(timeout / NGTCP2_MILLISECONDS), + EXPIRE_QUIC); } } return CURLE_OK; @@ -711,8 +851,11 @@ static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, return; Curl_pollset_check(data, ps, ctx->q.sockfd, &want_recv, &want_send); + if(!want_send && !Curl_bufq_is_empty(&ctx->q.sendbuf)) + want_send = TRUE; + if(want_recv || want_send) { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); struct cf_call_data save; bool c_exhaust, s_exhaust; @@ -730,13 +873,15 @@ static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, } } -static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, +static int cb_h3_stream_close(nghttp3_conn *conn, int64_t sid, 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; - struct h3_stream_ctx *stream = H3_STREAM_CTX(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; @@ -745,25 +890,50 @@ static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, return 0; stream->closed = TRUE; - stream->error3 = app_error_code; + stream->error3 = (curl_uint64_t)app_error_code; if(stream->error3 != NGHTTP3_H3_NO_ERROR) { stream->reset = TRUE; stream->send_closed = TRUE; - CURL_TRC_CF(data, cf, "[%" PRId64 "] RESET: error %" PRId64, + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] RESET: error %" FMT_PRIu64, stream->id, stream->error3); } else { - CURL_TRC_CF(data, cf, "[%" PRId64 "] CLOSED", stream->id); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] CLOSED", stream->id); } h3_drain_stream(cf, data); return 0; } -static CURLcode write_resp_hds(struct Curl_easy *data, - const char *buf, size_t blen) +static void h3_xfer_write_resp_hd(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream, + const char *buf, size_t blen, bool eos) { - bool done; - return Curl_xfer_write_resp(data, (char *)buf, blen, FALSE, &done); + + /* If we already encountered an error, skip further writes */ + 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 " + "bytes of headers", stream->id, stream->xfer_result, blen); + } +} + +static void h3_xfer_write_resp(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct h3_stream_ctx *stream, + const char *buf, size_t blen, bool eos) +{ + + /* If we already encountered an error, skip further writes */ + 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 */ + if(stream->xfer_result) { + CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] error %d writing %zu bytes " + "of data", stream->id, stream->xfer_result, blen); + } + } } static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, @@ -773,9 +943,7 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, struct Curl_cfilter *cf = user_data; struct cf_ngtcp2_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); - CURLcode result; - bool done; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)stream3_id; @@ -783,19 +951,14 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, if(!stream) return NGHTTP3_ERR_CALLBACK_FAILURE; - result = Curl_xfer_write_resp(data, (char *)buf, blen, FALSE, &done); - if(result) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, ERROR receiving %d", - stream->id, blen, result); - return NGHTTP3_ERR_CALLBACK_FAILURE; - } + h3_xfer_write_resp(cf, data, stream, (char *)buf, blen, FALSE); if(blen) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] ACK %zu bytes of DATA", + 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, "[%" PRId64 "] DATA len=%zu", stream->id, blen); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu", stream->id, blen); return 0; } @@ -815,13 +978,14 @@ 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 stream_id, +static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, 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; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); - CURLcode result = CURLE_OK; + curl_int64_t stream_id = (curl_int64_t)sid; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)stream_id; (void)fin; @@ -829,13 +993,10 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, if(!stream) return 0; - /* add a CRLF only if we've received some headers */ - result = write_resp_hds(data, "\r\n", 2); - if(result) { - return -1; - } + /* 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, "[%" PRId64 "] end_headers, status=%d", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] end_headers, status=%d", stream_id, stream->status_code); if(stream->status_code / 100 != 1) { stream->resp_hds_complete = TRUE; @@ -844,16 +1005,18 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, return 0; } -static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, +static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, 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; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; (void)conn; (void)stream_id; @@ -866,42 +1029,45 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, return 0; if(token == NGHTTP3_QPACK_TOKEN__STATUS) { - char line[14]; /* status line is always 13 characters long */ - size_t ncopy; result = Curl_http_decode_status(&stream->status_code, (const char *)h3val.base, h3val.len); if(result) return -1; - ncopy = msnprintf(line, sizeof(line), "HTTP/3 %03d \r\n", - stream->status_code); - CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s", stream_id, line); - result = write_resp_hds(data, line, ncopy); + Curl_dyn_reset(&ctx->scratch); + result = Curl_dyn_addn(&ctx->scratch, STRCONST("HTTP/3 ")); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, + (const char *)h3val.base, h3val.len); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); + if(!result) + h3_xfer_write_resp_hd(cf, data, stream, Curl_dyn_ptr(&ctx->scratch), + Curl_dyn_len(&ctx->scratch), FALSE); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] status: %s", + stream_id, Curl_dyn_ptr(&ctx->scratch)); if(result) { return -1; } } else { /* store as an HTTP1-style header */ - CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] header: %.*s: %.*s", stream_id, (int)h3name.len, h3name.base, (int)h3val.len, h3val.base); - result = write_resp_hds(data, (const char *)h3name.base, h3name.len); - if(result) { - return -1; - } - result = write_resp_hds(data, ": ", 2); - if(result) { - return -1; - } - result = write_resp_hds(data, (const char *)h3val.base, h3val.len); - if(result) { - return -1; - } - result = write_resp_hds(data, "\r\n", 2); - if(result) { - return -1; - } + Curl_dyn_reset(&ctx->scratch); + result = Curl_dyn_addn(&ctx->scratch, + (const char *)h3name.base, h3name.len); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, STRCONST(": ")); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, + (const char *)h3val.base, h3val.len); + if(!result) + result = Curl_dyn_addn(&ctx->scratch, STRCONST("\r\n")); + if(!result) + h3_xfer_write_resp_hd(cf, data, stream, Curl_dyn_ptr(&ctx->scratch), + Curl_dyn_len(&ctx->scratch), FALSE); } return 0; } @@ -919,17 +1085,18 @@ static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id, rv = ngtcp2_conn_shutdown_stream_read(ctx->qconn, 0, stream_id, app_error_code); if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) { - return NGTCP2_ERR_CALLBACK_FAILURE; + return NGHTTP3_ERR_CALLBACK_FAILURE; } return 0; } -static int cb_h3_reset_stream(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) { 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; @@ -937,9 +1104,9 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id, rv = ngtcp2_conn_shutdown_stream_write(ctx->qconn, 0, stream_id, app_error_code); - CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) { - return NGTCP2_ERR_CALLBACK_FAILURE; + return NGHTTP3_ERR_CALLBACK_FAILURE; } return 0; @@ -963,7 +1130,7 @@ static nghttp3_callbacks ngh3_callbacks = { NULL /* recv_settings */ }; -static int init_ngh3_conn(struct Curl_cfilter *cf) +static CURLcode init_ngh3_conn(struct Curl_cfilter *cf) { struct cf_ngtcp2_ctx *ctx = cf->ctx; CURLcode result; @@ -1032,15 +1199,14 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf, (void)cf; if(stream->reset) { - failf(data, - "HTTP/3 stream %" PRId64 " reset by server", stream->id); - *err = stream->resp_hds_complete? CURLE_PARTIAL_FILE : CURLE_HTTP3; + failf(data, "HTTP/3 stream %" FMT_PRId64 " reset by server", stream->id); + *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; goto out; } else if(!stream->resp_hds_complete) { failf(data, - "HTTP/3 stream %" PRId64 " was closed cleanly, but before getting" - " all response header fields, treated as error", + "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; @@ -1057,7 +1223,7 @@ static ssize_t cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t blen, CURLcode *err) { struct cf_ngtcp2_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nread = -1; struct cf_call_data save; struct pkt_io_ctx pktx; @@ -1074,7 +1240,7 @@ static ssize_t cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, pktx_init(&pktx, cf, data); - if(!stream) { + if(!stream || ctx->shutdown_started) { *err = CURLE_RECV_ERROR; goto out; } @@ -1085,7 +1251,14 @@ static ssize_t cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, goto out; } - if(stream->closed) { + if(stream->xfer_result) { + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] xfer write failed", stream->id); + cf_ngtcp2_stream_close(cf, data, stream); + *err = stream->xfer_result; + nread = -1; + goto out; + } + else if(stream->closed) { nread = recv_closed_stream(cf, data, stream, err); goto out; } @@ -1104,8 +1277,8 @@ out: nread = -1; } } - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv(blen=%zu) -> %zd, %d", - stream? stream->id : -1, blen, nread, *err); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(blen=%zu) -> %zd, %d", + stream ? stream->id : -1, blen, nread, *err); CF_DATA_RESTORE(cf, save); return nread; } @@ -1115,8 +1288,9 @@ static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_cfilter *cf = user_data; + struct cf_ngtcp2_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); size_t skiplen; (void)cf; @@ -1132,11 +1306,11 @@ static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id, Curl_bufq_skip(&stream->sendbuf, skiplen); stream->sendbuf_len_in_flight -= skiplen; - /* Everything ACKed, we resume upload processing */ - if(!stream->sendbuf_len_in_flight) { + /* Resume upload processing if we have more data to send */ + if(stream->sendbuf_len_in_flight < Curl_bufq_len(&stream->sendbuf)) { int rv = nghttp3_conn_resume_stream(conn, stream_id); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { - return NGTCP2_ERR_CALLBACK_FAILURE; + return NGHTTP3_ERR_CALLBACK_FAILURE; } } return 0; @@ -1149,8 +1323,9 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_cfilter *cf = user_data; + struct cf_ngtcp2_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nwritten = 0; size_t nvecs = 0; (void)cf; @@ -1193,16 +1368,15 @@ 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", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> AGAIN", stream->id); return NGHTTP3_ERR_WOULDBLOCK; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> " - "%d vecs%s with %zu (buffered=%zu, left=%" - CURL_FORMAT_CURL_OFF_T ")", + CURL_TRC_CF(data, cf, "[%" FMT_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":"", + *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "", nwritten, Curl_bufq_len(&stream->sendbuf), stream->upload_left); return (nghttp3_ssize)nvecs; @@ -1219,6 +1393,7 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, { struct cf_ngtcp2_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = NULL; + int64_t sid; struct dynhds h2_headers; size_t nheader; nghttp3_nv *nva = NULL; @@ -1233,7 +1408,7 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, *err = h3_data_setup(cf, data); if(*err) goto out; - stream = H3_STREAM_CTX(data); + stream = H3_STREAM_CTX(ctx, data); DEBUGASSERT(stream); if(!stream) { *err = CURLE_FAILED_INIT; @@ -1274,12 +1449,15 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, nva[i].flags = NGHTTP3_NV_FLAG_NONE; } - rc = ngtcp2_conn_open_bidi_stream(ctx->qconn, &stream->id, data); + rc = ngtcp2_conn_open_bidi_stream(ctx->qconn, &sid, data); if(rc) { failf(data, "can get bidi streams"); *err = CURLE_SEND_ERROR; + nwritten = -1; goto out; } + stream->id = (curl_int64_t)sid; + ++ctx->used_bidi_streams; switch(data->state.httpreq) { case HTTPREQ_POST: @@ -1310,12 +1488,12 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, if(rc) { switch(rc) { case NGHTTP3_ERR_CONN_CLOSING: - CURL_TRC_CF(data, cf, "h3sid[%"PRId64"] failed to send, " + CURL_TRC_CF(data, cf, "h3sid[%" FMT_PRId64 "] failed to send, " "connection is closing", stream->id); break; default: - CURL_TRC_CF(data, cf, "h3sid[%"PRId64"] failed to send -> %d (%s)", - stream->id, rc, ngtcp2_strerror(rc)); + CURL_TRC_CF(data, cf, "h3sid[%" FMT_PRId64 "] failed to send -> " + "%d (%s)", stream->id, rc, nghttp3_strerror(rc)); break; } *err = CURLE_SEND_ERROR; @@ -1324,10 +1502,10 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, } if(Curl_trc_is_verbose(data)) { - infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", + infof(data, "[HTTP/3] [%" FMT_PRId64 "] OPENED stream for %s", stream->id, data->state.url); for(i = 0; i < nheader; ++i) { - infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->id, + infof(data, "[HTTP/3] [%" FMT_PRId64 "] [%.*s: %.*s]", stream->id, (int)nva[i].namelen, nva[i].name, (int)nva[i].valuelen, nva[i].value); } @@ -1340,10 +1518,11 @@ out: } static ssize_t cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_ngtcp2_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t sent = 0; struct cf_call_data save; struct pkt_io_ctx pktx; @@ -1356,6 +1535,7 @@ static ssize_t cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, pktx_init(&pktx, cf, data); *err = CURLE_OK; + (void)eos; /* TODO: use for stream EOF and block handling */ result = cf_progress_ingress(cf, data, &pktx); if(result) { *err = result; @@ -1363,27 +1543,25 @@ static ssize_t cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, } if(!stream || stream->id < 0) { + if(ctx->shutdown_started) { + CURL_TRC_CF(data, cf, "cannot open stream on closed connection"); + *err = CURLE_SEND_ERROR; + sent = -1; + goto out; + } sent = h3_stream_open(cf, data, buf, len, err); if(sent < 0) { CURL_TRC_CF(data, cf, "failed to open stream -> %d", *err); goto out; } - stream = H3_STREAM_CTX(data); + stream = H3_STREAM_CTX(ctx, data); } - else if(stream->upload_blocked_len) { - /* the data in `buf` has already been submitted or added to the - * buffers, but have been EAGAINed on the last invocation. */ - DEBUGASSERT(len >= stream->upload_blocked_len); - if(len < stream->upload_blocked_len) { - /* Did we get called again with a smaller `len`? This should not - * happen. We are not prepared to handle that. */ - failf(data, "HTTP/3 send again with decreased length"); - *err = CURLE_HTTP3; - sent = -1; - goto out; - } - sent = (ssize_t)stream->upload_blocked_len; - stream->upload_blocked_len = 0; + else if(stream->xfer_result) { + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] xfer write failed", stream->id); + cf_ngtcp2_stream_close(cf, data, stream); + *err = stream->xfer_result; + sent = -1; + goto out; } else if(stream->closed) { if(stream->resp_hds_complete) { @@ -1392,21 +1570,27 @@ static ssize_t 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, "[%" PRId64 "] discarding data" + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] discarding data" "on closed stream with response", stream->id); *err = CURLE_OK; sent = (ssize_t)len; goto out; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send_body(len=%zu) " "-> stream closed", stream->id, len); *err = CURLE_HTTP3; sent = -1; goto out; } + else if(ctx->shutdown_started) { + CURL_TRC_CF(data, cf, "cannot send on closed connection"); + *err = CURLE_SEND_ERROR; + sent = -1; + goto out; + } else { sent = Curl_bufq_write(&stream->sendbuf, buf, len, err); - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send, add to " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send, add to " "sendbuf(len=%zu) -> %zd, %d", stream->id, len, sent, *err); if(sent < 0) { @@ -1422,26 +1606,14 @@ static ssize_t cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, sent = -1; } - if(stream && sent > 0 && stream->sendbuf_len_in_flight) { - /* We have unacknowledged DATA and cannot report success to our - * caller. Instead we EAGAIN and remember how much we have already - * "written" into our various internal connection buffers. */ - stream->upload_blocked_len = sent; - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu), " - "%zu bytes in flight -> EGAIN", stream->id, len, - stream->sendbuf_len_in_flight); - *err = CURLE_AGAIN; - sent = -1; - } - out: result = check_and_set_expiry(cf, data, &pktx); if(result) { *err = result; sent = -1; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu) -> %zd, %d", - stream? stream->id : -1, len, sent, *err); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %zd, %d", + stream ? stream->id : -1, len, sent, *err); CF_DATA_RESTORE(cf, save); return sent; } @@ -1453,7 +1625,6 @@ static CURLcode qng_verify_peer(struct Curl_cfilter *cf, cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ cf->conn->httpversion = 30; - cf->conn->bundle->multiuse = BUNDLE_MULTIPLEX; return Curl_vquic_tls_verify_peer(&ctx->tls, cf, data, &ctx->peer); } @@ -1471,7 +1642,7 @@ static CURLcode recv_pkt(const unsigned char *pkt, size_t pktlen, ++pktx->pkt_count; ngtcp2_addr_init(&path.local, (struct sockaddr *)&ctx->q.local_addr, - ctx->q.local_addrlen); + (socklen_t)ctx->q.local_addrlen); ngtcp2_addr_init(&path.remote, (struct sockaddr *)remote_addr, remote_addrlen); pi.ecn = (uint8_t)ecn; @@ -1480,16 +1651,7 @@ static CURLcode recv_pkt(const unsigned char *pkt, size_t pktlen, if(rv) { CURL_TRC_CF(pktx->data, pktx->cf, "ingress, read_pkt -> %s (%d)", ngtcp2_strerror(rv), rv); - if(!ctx->last_error.error_code) { - if(rv == NGTCP2_ERR_CRYPTO) { - ngtcp2_ccerr_set_tls_alert(&ctx->last_error, - ngtcp2_conn_get_tls_alert(ctx->qconn), - NULL, 0); - } - else { - ngtcp2_ccerr_set_liberr(&ctx->last_error, rv, NULL, 0); - } - } + cf_ngtcp2_err_set(pktx->cf, pktx->data, rv); if(rv == NGTCP2_ERR_CRYPTO) /* this is a "TLS problem", but a failed certificate verification @@ -1572,9 +1734,7 @@ static ssize_t read_pkt_to_send(void *userp, if(veccnt < 0) { failf(x->data, "nghttp3_conn_writev_stream returned error: %s", nghttp3_strerror((int)veccnt)); - ngtcp2_ccerr_set_application_error( - &ctx->last_error, - nghttp3_err_infer_quic_app_error_code((int)veccnt), NULL, 0); + cf_ngtcp2_h3_err_set(x->cf, x->data, (int)veccnt); *err = CURLE_SEND_ERROR; return -1; } @@ -1595,11 +1755,11 @@ static ssize_t read_pkt_to_send(void *userp, else if(n < 0) { switch(n) { case NGTCP2_ERR_STREAM_DATA_BLOCKED: { - struct h3_stream_ctx *stream = H3_STREAM_CTX(x->data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, x->data); DEBUGASSERT(ndatalen == -1); nghttp3_conn_block_stream(ctx->h3conn, stream_id); - CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] block quic flow", - stream_id); + CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRId64 "] block quic flow", + (curl_int64_t)stream_id); DEBUGASSERT(stream); if(stream) stream->quic_flow_blocked = TRUE; @@ -1621,7 +1781,7 @@ static ssize_t read_pkt_to_send(void *userp, DEBUGASSERT(ndatalen == -1); failf(x->data, "ngtcp2_conn_writev_stream returned error: %s", ngtcp2_strerror((int)n)); - ngtcp2_ccerr_set_liberr(&ctx->last_error, (int)n, NULL, 0); + cf_ngtcp2_err_set(x->cf, x->data, (int)n); *err = CURLE_SEND_ERROR; nwritten = -1; goto out; @@ -1718,7 +1878,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, DEBUGASSERT(nread > 0); if(pktcnt == 0) { /* first packet in buffer. This is either of a known, "good" - * payload size or it is a PMTUD. We'll see. */ + * payload size or it is a PMTUD. We will see. */ gsolen = (size_t)nread; } else if((size_t)nread > gsolen || @@ -1809,16 +1969,17 @@ static CURLcode cf_ngtcp2_data_event(struct Curl_cfilter *cf, h3_data_done(cf, data); break; case CF_CTRL_DATA_DONE_SEND: { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream && !stream->send_closed) { stream->send_closed = TRUE; - stream->upload_left = Curl_bufq_len(&stream->sendbuf); + stream->upload_left = Curl_bufq_len(&stream->sendbuf) - + stream->sendbuf_len_in_flight; (void)nghttp3_conn_resume_stream(ctx->h3conn, stream->id); } break; } case CF_CTRL_DATA_IDLE: { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURL_TRC_CF(data, cf, "data idle"); if(stream && !stream->closed) { result = check_and_set_expiry(cf, data, NULL); @@ -1834,27 +1995,118 @@ static CURLcode cf_ngtcp2_data_event(struct Curl_cfilter *cf, return result; } -static void cf_ngtcp2_ctx_clear(struct cf_ngtcp2_ctx *ctx) +static void cf_ngtcp2_ctx_close(struct cf_ngtcp2_ctx *ctx) { struct cf_call_data save = ctx->call_data; + if(!ctx->initialized) + return; if(ctx->qlogfd != -1) { close(ctx->qlogfd); } + ctx->qlogfd = -1; Curl_vquic_tls_cleanup(&ctx->tls); vquic_ctx_free(&ctx->q); if(ctx->h3conn) nghttp3_conn_del(ctx->h3conn); if(ctx->qconn) ngtcp2_conn_del(ctx->qconn); - Curl_bufcp_free(&ctx->stream_bufcp); - Curl_ssl_peer_cleanup(&ctx->peer); - - memset(ctx, 0, sizeof(*ctx)); - ctx->qlogfd = -1; ctx->call_data = save; } +static CURLcode cf_ngtcp2_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + struct cf_ngtcp2_ctx *ctx = cf->ctx; + struct cf_call_data save; + struct pkt_io_ctx pktx; + CURLcode result = CURLE_OK; + + if(cf->shutdown || !ctx->qconn) { + *done = TRUE; + return CURLE_OK; + } + + CF_DATA_SAVE(save, cf, data); + *done = FALSE; + pktx_init(&pktx, cf, data); + + if(!ctx->shutdown_started) { + char buffer[NGTCP2_MAX_UDP_PAYLOAD_SIZE]; + ngtcp2_ssize nwritten; + + if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) { + CURL_TRC_CF(data, cf, "shutdown, flushing sendbuf"); + result = cf_progress_egress(cf, data, &pktx); + if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) { + CURL_TRC_CF(data, cf, "sending shutdown packets blocked"); + result = CURLE_OK; + goto out; + } + else if(result) { + CURL_TRC_CF(data, cf, "shutdown, error %d flushing sendbuf", result); + *done = TRUE; + goto out; + } + } + + ctx->shutdown_started = TRUE; + nwritten = ngtcp2_conn_write_connection_close( + ctx->qconn, NULL, /* path */ + NULL, /* pkt_info */ + (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); + if(nwritten > 0) { + Curl_bufq_write(&ctx->q.sendbuf, (const unsigned char *)buffer, + (size_t)nwritten, &result); + if(result) { + CURL_TRC_CF(data, cf, "error %d adding shutdown packets to sendbuf, " + "aborting shutdown", result); + goto out; + } + ctx->q.no_gso = TRUE; + ctx->q.gsolen = (size_t)nwritten; + ctx->q.split_len = 0; + } + } + + if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) { + CURL_TRC_CF(data, cf, "shutdown, flushing egress"); + result = vquic_flush(cf, data, &ctx->q); + if(result == CURLE_AGAIN) { + CURL_TRC_CF(data, cf, "sending shutdown packets blocked"); + result = CURLE_OK; + goto out; + } + else if(result) { + CURL_TRC_CF(data, cf, "shutdown, error %d flushing sendbuf", result); + *done = TRUE; + goto out; + } + } + + if(Curl_bufq_is_empty(&ctx->q.sendbuf)) { + /* Sent everything off. ngtcp2 seems to have no support for graceful + * shutdowns. So, we are done. */ + CURL_TRC_CF(data, cf, "shutdown completely sent off, done"); + *done = TRUE; + result = CURLE_OK; + } +out: + CF_DATA_RESTORE(cf, save); + return result; +} + +static void cf_ngtcp2_conn_close(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + bool done; + cf_ngtcp2_shutdown(cf, data, &done); +} + static void cf_ngtcp2_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_ngtcp2_ctx *ctx = cf->ctx; @@ -1862,71 +2114,147 @@ static void cf_ngtcp2_close(struct Curl_cfilter *cf, struct Curl_easy *data) CF_DATA_SAVE(save, cf, data); if(ctx && ctx->qconn) { - char buffer[NGTCP2_MAX_UDP_PAYLOAD_SIZE]; - struct pkt_io_ctx pktx; - ngtcp2_ssize rc; - + cf_ngtcp2_conn_close(cf, data); + cf_ngtcp2_ctx_close(ctx); CURL_TRC_CF(data, cf, "close"); - pktx_init(&pktx, cf, data); - rc = ngtcp2_conn_write_connection_close(ctx->qconn, NULL, /* path */ - NULL, /* pkt_info */ - (uint8_t *)buffer, sizeof(buffer), - &ctx->last_error, pktx.ts); - if(rc > 0) { - while((send(ctx->q.sockfd, buffer, (SEND_TYPE_ARG3)rc, 0) == -1) && - SOCKERRNO == EINTR); - } - - cf_ngtcp2_ctx_clear(ctx); } - cf->connected = FALSE; CF_DATA_RESTORE(cf, save); } static void cf_ngtcp2_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct cf_ngtcp2_ctx *ctx = cf->ctx; - struct cf_call_data save; - - CF_DATA_SAVE(save, cf, data); CURL_TRC_CF(data, cf, "destroy"); - if(ctx) { - cf_ngtcp2_ctx_clear(ctx); - free(ctx); + if(cf->ctx) { + cf_ngtcp2_ctx_free(cf->ctx); + cf->ctx = NULL; } - cf->ctx = NULL; - /* No CF_DATA_RESTORE(cf, save) possible */ - (void)save; } -static CURLcode tls_ctx_setup(struct quic_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data) +#ifdef USE_OPENSSL +/* The "new session" callback must return zero if the session can be removed + * or non-zero if the session has been put into the session cache. + */ +static int quic_ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) { - (void)cf; + struct Curl_cfilter *cf; + struct cf_ngtcp2_ctx *ctx; + struct Curl_easy *data; + ngtcp2_crypto_conn_ref *cref; + + cref = (ngtcp2_crypto_conn_ref *)SSL_get_app_data(ssl); + cf = cref ? cref->user_data : NULL; + ctx = cf ? cf->ctx : NULL; + data = cf ? CF_DATA_CURRENT(cf) : NULL; + if(cf && data && ctx) { + Curl_ossl_add_session(cf, data, &ctx->peer, ssl_sessionid); + return 1; + } + return 0; +} +#endif /* USE_OPENSSL */ + +#ifdef USE_GNUTLS +static int quic_gtls_handshake_cb(gnutls_session_t session, unsigned int htype, + unsigned when, unsigned int incoming, + const gnutls_datum_t *msg) +{ + ngtcp2_crypto_conn_ref *conn_ref = gnutls_session_get_ptr(session); + struct Curl_cfilter *cf = conn_ref ? conn_ref->user_data : NULL; + struct cf_ngtcp2_ctx *ctx = cf ? cf->ctx : NULL; + + (void)msg; + (void)incoming; + if(when && cf && ctx) { /* after message has been processed */ + struct Curl_easy *data = CF_DATA_CURRENT(cf); + DEBUGASSERT(data); + if(data) { + CURL_TRC_CF(data, cf, "handshake: %s message type %d", + incoming ? "incoming" : "outgoing", htype); + } + switch(htype) { + case GNUTLS_HANDSHAKE_NEW_SESSION_TICKET: { + (void)Curl_gtls_update_session_id(cf, data, session, &ctx->peer, "h3"); + break; + } + default: + break; + } + } + return 0; +} +#endif /* USE_GNUTLS */ + +#ifdef USE_WOLFSSL +static int wssl_quic_new_session_cb(WOLFSSL *ssl, WOLFSSL_SESSION *session) +{ + ngtcp2_crypto_conn_ref *conn_ref = wolfSSL_get_app_data(ssl); + struct Curl_cfilter *cf = conn_ref ? conn_ref->user_data : NULL; + + DEBUGASSERT(cf != NULL); + if(cf && session) { + struct cf_ngtcp2_ctx *ctx = cf->ctx; + struct Curl_easy *data = CF_DATA_CURRENT(cf); + DEBUGASSERT(data); + if(data && ctx) { + (void)wssl_cache_session(cf, data, &ctx->peer, session); + } + } + return 0; +} +#endif /* USE_WOLFSSL */ + +static CURLcode tls_ctx_setup(struct Curl_cfilter *cf, + struct Curl_easy *data, + 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) - if(ngtcp2_crypto_boringssl_configure_client_context(ctx->ssl_ctx) != 0) { + if(ngtcp2_crypto_boringssl_configure_client_context(ctx->ossl.ssl_ctx) + != 0) { failf(data, "ngtcp2_crypto_boringssl_configure_client_context failed"); return CURLE_FAILED_INIT; } #else - if(ngtcp2_crypto_quictls_configure_client_context(ctx->ssl_ctx) != 0) { + if(ngtcp2_crypto_quictls_configure_client_context(ctx->ossl.ssl_ctx) != 0) { failf(data, "ngtcp2_crypto_quictls_configure_client_context failed"); return CURLE_FAILED_INIT; } #endif /* !OPENSSL_IS_BORINGSSL && !OPENSSL_IS_AWSLC */ + if(ssl_config->primary.cache_session) { + /* 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. + */ + SSL_CTX_set_session_cache_mode(ctx->ossl.ssl_ctx, + SSL_SESS_CACHE_CLIENT | + SSL_SESS_CACHE_NO_INTERNAL); + SSL_CTX_sess_set_new_cb(ctx->ossl.ssl_ctx, quic_ossl_new_session_cb); + } + #elif defined(USE_GNUTLS) - if(ngtcp2_crypto_gnutls_configure_client_session(ctx->gtls->session) != 0) { + if(ngtcp2_crypto_gnutls_configure_client_session(ctx->gtls.session) != 0) { failf(data, "ngtcp2_crypto_gnutls_configure_client_session failed"); return CURLE_FAILED_INIT; } + if(ssl_config->primary.cache_session) { + gnutls_handshake_set_hook_function(ctx->gtls.session, + GNUTLS_HANDSHAKE_ANY, GNUTLS_HOOK_POST, + quic_gtls_handshake_cb); + } + #elif defined(USE_WOLFSSL) - if(ngtcp2_crypto_wolfssl_configure_client_context(ctx->ssl_ctx) != 0) { + if(ngtcp2_crypto_wolfssl_configure_client_context(ctx->wssl.ctx) != 0) { failf(data, "ngtcp2_crypto_wolfssl_configure_client_context failed"); return CURLE_FAILED_INIT; } + if(ssl_config->primary.cache_session) { + /* Register to get notified when a new session is received */ + wolfSSL_CTX_sess_set_new_cb(ctx->wssl.ctx, wssl_quic_new_session_cb); + } #endif return CURLE_OK; } @@ -1945,23 +2273,22 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, const struct Curl_sockaddr_ex *sockaddr = NULL; int qfd; - ctx->version = NGTCP2_PROTO_VER_MAX; - ctx->max_stream_window = H3_STREAM_WINDOW_SIZE; - ctx->max_idle_ms = CURL_QUIC_MAX_IDLE_MS; - Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, - H3_STREAM_POOL_SPARES); - - result = Curl_ssl_peer_init(&ctx->peer, cf); + DEBUGASSERT(ctx->initialized); + result = Curl_ssl_peer_init(&ctx->peer, cf, TRNSPRT_QUIC); if(result) return result; #define H3_ALPN "\x2h3\x5h3-29" result = Curl_vquic_tls_init(&ctx->tls, cf, data, &ctx->peer, H3_ALPN, sizeof(H3_ALPN) - 1, - tls_ctx_setup, &ctx->conn_ref); + tls_ctx_setup, &ctx->tls, &ctx->conn_ref); if(result) return result; +#ifdef USE_OPENSSL + SSL_set_quic_use_legacy_codepoint(ctx->tls.ossl.ssl, 0); +#endif + ctx->dcid.datalen = NGTCP2_MAX_CIDLEN; result = Curl_rand(data, ctx->dcid.data, NGTCP2_MAX_CIDLEN); if(result) @@ -1980,8 +2307,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, if(result) return result; - Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, - &sockaddr, NULL, NULL, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, &sockaddr, NULL); if(!sockaddr) return CURLE_QUIC_CONNECT_ERROR; ctx->q.local_addrlen = sizeof(ctx->q.local_addr); @@ -1994,7 +2320,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, (struct sockaddr *)&ctx->q.local_addr, ctx->q.local_addrlen); ngtcp2_addr_init(&ctx->connected_path.remote, - &sockaddr->sa_addr, sockaddr->addrlen); + &sockaddr->curl_sa_addr, (socklen_t)sockaddr->addrlen); rc = ngtcp2_conn_client_new(&ctx->qconn, &ctx->dcid, &ctx->scid, &ctx->connected_path, @@ -2004,10 +2330,14 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, if(rc) return CURLE_QUIC_CONNECT_ERROR; -#ifdef USE_GNUTLS - ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->tls.gtls->session); +#ifdef USE_OPENSSL + ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->tls.ossl.ssl); +#elif defined(USE_GNUTLS) + ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->tls.gtls.session); +#elif defined(USE_WOLFSSL) + ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->tls.wssl.handle); #else - ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->tls.ssl); + #error "ngtcp2 TLS backend not defined" #endif ngtcp2_ccerr_default(&ctx->last_error); @@ -2046,12 +2376,6 @@ static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); - if(ctx->reconnect_at.tv_sec && Curl_timediff(now, ctx->reconnect_at) < 0) { - /* Not time yet to attempt the next connect */ - CURL_TRC_CF(data, cf, "waiting for reconnect time"); - goto out; - } - if(!ctx->qconn) { ctx->started_at = now; result = cf_connect_start(cf, data, &pktx); @@ -2096,13 +2420,11 @@ out: #ifndef CURL_DISABLE_VERBOSE_STRINGS if(result) { - const char *r_ip = NULL; - int r_port = 0; + struct ip_quadruple ip; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); infof(data, "QUIC connect to %s port %u failed: %s", - r_ip, r_port, curl_easy_strerror(result)); + ip.remote_ip, ip.remote_port, curl_easy_strerror(result)); } #endif if(!result && ctx->qconn) { @@ -2123,24 +2445,35 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf, switch(query) { case CF_QUERY_MAX_CONCURRENT: { - const ngtcp2_transport_params *rp; DEBUGASSERT(pres1); - CF_DATA_SAVE(save, cf, data); - rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn); - if(rp) - *pres1 = (rp->initial_max_streams_bidi > INT_MAX)? - INT_MAX : (int)rp->initial_max_streams_bidi; - else /* not arrived yet? */ - *pres1 = Curl_multi_max_concurrent_streams(data->multi); - CURL_TRC_CF(data, cf, "query max_conncurrent -> %d", *pres1); + /* Set after transport params arrived and continually updated + * by callback. QUIC counts the number over the lifetime of the + * connection, ever increasing. + * We count the *open* transfers plus the budget for new ones. */ + if(!ctx->qconn || ctx->shutdown_started) { + *pres1 = 0; + } + else if(ctx->max_bidi_streams) { + uint64_t avail_bidi_streams = 0; + uint64_t max_streams = CONN_INUSE(cf->conn); + 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; + *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams; + } + else /* transport params not arrived yet? take our default. */ + *pres1 = (int)Curl_multi_max_concurrent_streams(data->multi); + CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: " + "MAX_CONCURRENT -> %d (%zu in use)", + cf->conn->connection_id, *pres1, CONN_INUSE(cf->conn)); CF_DATA_RESTORE(cf, save); return CURLE_OK; } case CF_QUERY_CONNECT_REPLY_MS: if(ctx->q.got_first_byte) { timediff_t ms = Curl_timediff(ctx->q.first_byte_at, ctx->started_at); - *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX; + *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else *pres1 = -1; @@ -2160,7 +2493,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf, default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -2174,9 +2507,9 @@ static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf, const ngtcp2_transport_params *rp; struct cf_call_data save; - CF_DATA_SAVE(save, cf, data); + CF_DATA_SAVE(save, cf, data); *input_pending = FALSE; - if(!ctx->qconn) + if(!ctx->qconn || ctx->shutdown_started) goto out; /* Both sides of the QUIC connection announce they max idle times in @@ -2203,13 +2536,13 @@ static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf, alive = TRUE; if(*input_pending) { CURLcode result; - /* This happens before we've sent off a request and the connection is - not in use by any other transfer, there shouldn't be any data here, + /* This happens before we have sent off a request and the connection is + not in use by any other transfer, there should not be any data here, only "protocol frames" */ *input_pending = FALSE; result = cf_progress_ingress(cf, data, NULL); CURL_TRC_CF(data, cf, "is_alive, progress ingress -> %d", result); - alive = result? FALSE : TRUE; + alive = result ? FALSE : TRUE; } out: @@ -2224,6 +2557,7 @@ struct Curl_cftype Curl_cft_http3 = { cf_ngtcp2_destroy, cf_ngtcp2_connect, cf_ngtcp2_close, + cf_ngtcp2_shutdown, Curl_cf_def_get_host, cf_ngtcp2_adjust_pollset, cf_ngtcp2_data_pending, @@ -2250,8 +2584,7 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf, result = CURLE_OUT_OF_MEMORY; goto out; } - ctx->qlogfd = -1; - cf_ngtcp2_ctx_clear(ctx); + cf_ngtcp2_ctx_init(ctx); result = Curl_cf_create(&cf, &Curl_cft_http3, ctx); if(result) @@ -2267,12 +2600,12 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf, cf->next = udp_cf; out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { if(udp_cf) Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE); Curl_safefree(cf); - Curl_safefree(ctx); + cf_ngtcp2_ctx_free(ctx); } return result; } @@ -2281,7 +2614,7 @@ 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; + struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; (void)data; for(; cf; cf = cf->next) { diff --git a/deps/curl/lib/vquic/curl_osslq.c b/deps/curl/lib/vquic/curl_osslq.c index 0e5606d7..e5f737f8 100644 --- a/deps/curl/lib/vquic/curl_osslq.c +++ b/deps/curl/lib/vquic/curl_osslq.c @@ -32,6 +32,7 @@ #include #include "urldata.h" +#include "hash.h" #include "sendf.h" #include "strdup.h" #include "rand.h" @@ -70,7 +71,7 @@ /* The pool keeps spares around and half of a full stream window * seems good. More does not seem to improve performance. * The benefit of the pool is that stream buffer to not keep - * spares. So memory consumption goes down when streams run empty, + * 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 @@ -174,7 +175,7 @@ static CURLcode make_bio_addr(BIO_ADDR **pbio_addr, switch(addr->family) { case AF_INET: { struct sockaddr_in * const sin = - (struct sockaddr_in * const)(void *)&addr->sa_addr; + (struct sockaddr_in * const)(void *)&addr->curl_sa_addr; if(!BIO_ADDR_rawmake(ba, AF_INET, &sin->sin_addr, sizeof(sin->sin_addr), sin->sin_port)) { goto out; @@ -182,17 +183,17 @@ static CURLcode make_bio_addr(BIO_ADDR **pbio_addr, result = CURLE_OK; break; } -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case AF_INET6: { struct sockaddr_in6 * const sin = - (struct sockaddr_in6 * const)(void *)&addr->sa_addr; + (struct sockaddr_in6 * const)(void *)&addr->curl_sa_addr; if(!BIO_ADDR_rawmake(ba, AF_INET6, &sin->sin6_addr, sizeof(sin->sin6_addr), sin->sin6_port)) { } result = CURLE_OK; break; } -#endif /* ENABLE_IPV6 */ +#endif /* USE_IPV6 */ default: /* sunsupported */ DEBUGASSERT(0); @@ -210,7 +211,7 @@ out: /* QUIC stream (not necessarily H3) */ struct cf_osslq_stream { - int64_t id; + curl_int64_t id; SSL *ssl; struct bufq recvbuf; /* QUIC war data recv buffer */ BIT(recvd_eos); @@ -231,7 +232,7 @@ static CURLcode cf_osslq_stream_open(struct cf_osslq_stream *s, if(!s->ssl) { return CURLE_FAILED_INIT; } - s->id = SSL_get_stream_id(s->ssl); + s->id = (curl_int64_t)SSL_get_stream_id(s->ssl); SSL_set_app_data(s->ssl, user_data); return CURLE_OK; } @@ -281,47 +282,142 @@ static void cf_osslq_h3conn_cleanup(struct cf_osslq_h3conn *h3) struct cf_osslq_ctx { struct cf_quic_ctx q; struct ssl_peer peer; - struct quic_tls_ctx tls; + struct curl_tls_ctx tls; struct cf_call_data call_data; struct cf_osslq_h3conn h3; struct curltime started_at; /* time the current attempt started */ struct curltime handshake_at; /* time connect handshake finished */ struct curltime first_byte_at; /* when first byte was recvd */ - struct curltime reconnect_at; /* time the next attempt should start */ struct bufc_pool stream_bufcp; /* chunk pool for streams */ + struct Curl_hash streams; /* hash `data->mid` to `h3_stream_ctx` */ size_t max_stream_window; /* max flow window for one stream */ uint64_t max_idle_ms; /* max idle time for QUIC connection */ + BIT(initialized); BIT(got_first_byte); /* if first byte was received */ -#ifdef USE_OPENSSL BIT(x509_store_setup); /* if x509 store has been set up */ BIT(protocol_shutdown); /* QUIC connection is shut down */ -#endif + BIT(need_recv); /* QUIC connection needs to receive */ + BIT(need_send); /* QUIC connection needs to send */ }; -static void cf_osslq_ctx_clear(struct cf_osslq_ctx *ctx) +static void h3_stream_hash_free(void *stream); + +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_hash_offt_init(&ctx->streams, 63, h3_stream_hash_free); + ctx->initialized = TRUE; +} + +static void cf_osslq_ctx_free(struct cf_osslq_ctx *ctx) +{ + if(ctx && ctx->initialized) { + Curl_bufcp_free(&ctx->stream_bufcp); + Curl_hash_clean(&ctx->streams); + Curl_hash_destroy(&ctx->streams); + Curl_ssl_peer_cleanup(&ctx->peer); + } + free(ctx); +} + +static void cf_osslq_ctx_close(struct cf_osslq_ctx *ctx) { struct cf_call_data save = ctx->call_data; cf_osslq_h3conn_cleanup(&ctx->h3); Curl_vquic_tls_cleanup(&ctx->tls); vquic_ctx_free(&ctx->q); - Curl_bufcp_free(&ctx->stream_bufcp); - Curl_ssl_peer_cleanup(&ctx->peer); - - memset(ctx, 0, sizeof(*ctx)); ctx->call_data = save; } +static CURLcode cf_osslq_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) +{ + struct cf_osslq_ctx *ctx = cf->ctx; + struct cf_call_data save; + CURLcode result = CURLE_OK; + int rc; + + CF_DATA_SAVE(save, cf, data); + + if(cf->shutdown || ctx->protocol_shutdown) { + *done = TRUE; + return CURLE_OK; + } + + CF_DATA_SAVE(save, cf, data); + *done = FALSE; + ctx->need_send = FALSE; + ctx->need_recv = FALSE; + + rc = SSL_shutdown_ex(ctx->tls.ossl.ssl, + SSL_SHUTDOWN_FLAG_NO_BLOCK, NULL, 0); + if(rc == 0) { /* ongoing */ + CURL_TRC_CF(data, cf, "shutdown ongoing"); + ctx->need_recv = TRUE; + goto out; + } + else if(rc == 1) { /* done */ + CURL_TRC_CF(data, cf, "shutdown finished"); + *done = TRUE; + goto out; + } + else { + long sslerr; + char err_buffer[256]; + int err = SSL_get_error(ctx->tls.ossl.ssl, rc); + + switch(err) { + case SSL_ERROR_NONE: + case SSL_ERROR_ZERO_RETURN: + CURL_TRC_CF(data, cf, "shutdown not received, but closed"); + *done = TRUE; + goto out; + case SSL_ERROR_WANT_READ: + /* SSL has send its notify and now wants to read the reply + * from the server. We are not really interested in that. */ + CURL_TRC_CF(data, cf, "shutdown sent, want receive"); + ctx->need_recv = TRUE; + goto out; + case SSL_ERROR_WANT_WRITE: + CURL_TRC_CF(data, cf, "shutdown send blocked"); + ctx->need_send = TRUE; + goto out; + default: + /* We give up on this. */ + sslerr = ERR_get_error(); + CURL_TRC_CF(data, cf, "shutdown, ignore recv error: '%s', errno %d", + (sslerr ? + osslq_strerror(sslerr, err_buffer, sizeof(err_buffer)) : + osslq_SSL_ERROR_to_str(err)), + SOCKERRNO); + *done = TRUE; + result = CURLE_OK; + goto out; + } + } +out: + CF_DATA_RESTORE(cf, save); + return result; +} + static void cf_osslq_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; struct cf_call_data save; CF_DATA_SAVE(save, cf, data); - if(ctx && ctx->tls.ssl) { - /* TODO: send connection close */ + if(ctx && ctx->tls.ossl.ssl) { CURL_TRC_CF(data, cf, "cf_osslq_close()"); - cf_osslq_ctx_clear(ctx); + if(!cf->shutdown && !ctx->protocol_shutdown) { + /* last best effort, which OpenSSL calls a "rapid" shutdown. */ + SSL_shutdown_ex(ctx->tls.ossl.ssl, + (SSL_SHUTDOWN_FLAG_NO_BLOCK | SSL_SHUTDOWN_FLAG_RAPID), + NULL, 0); + } + cf_osslq_ctx_close(ctx); } cf->connected = FALSE; @@ -337,8 +433,9 @@ static void cf_osslq_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) CURL_TRC_CF(data, cf, "destroy"); if(ctx) { CURL_TRC_CF(data, cf, "cf_osslq_destroy()"); - cf_osslq_ctx_clear(ctx); - free(ctx); + if(ctx->tls.ossl.ssl) + cf_osslq_ctx_close(ctx); + cf_osslq_ctx_free(ctx); } cf->ctx = NULL; /* No CF_DATA_RESTORE(cf, save) possible */ @@ -351,11 +448,11 @@ static CURLcode cf_osslq_h3conn_add_stream(struct cf_osslq_h3conn *h3, struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; - int64_t stream_id = SSL_get_stream_id(stream_ssl); + curl_int64_t stream_id = (curl_int64_t)SSL_get_stream_id(stream_ssl); if(h3->remote_ctrl_n >= ARRAYSIZE(h3->remote_ctrl)) { /* rejected, we are full */ - CURL_TRC_CF(data, cf, "[%" PRId64 "] rejecting additional remote stream", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] rejecting remote stream", stream_id); SSL_free(stream_ssl); return CURLE_FAILED_INIT; @@ -366,12 +463,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, "[%" PRId64 "] accepted new remote uni stream", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] accepted remote uni stream", stream_id); break; } default: - CURL_TRC_CF(data, cf, "[%" PRId64 "] rejecting remote non-uni-read" + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reject remote non-uni-read" " stream", stream_id); SSL_free(stream_ssl); return CURLE_FAILED_INIT; @@ -403,7 +500,7 @@ static CURLcode cf_osslq_ssl_err(struct Curl_cfilter *cf, (reason == SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED))) { result = CURLE_PEER_FAILED_VERIFICATION; - lerr = SSL_get_verify_result(ctx->tls.ssl); + lerr = SSL_get_verify_result(ctx->tls.ossl.ssl); if(lerr != X509_V_OK) { ssl_config->certverifyresult = lerr; msnprintf(ebuf, sizeof(ebuf), @@ -436,23 +533,21 @@ static CURLcode cf_osslq_ssl_err(struct Curl_cfilter *cf, /* detail is already set to the SSL error above */ - /* If we e.g. use SSLv2 request-method and the server doesn't like us + /* If we e.g. use SSLv2 request-method and the server does not like us * (RST connection, etc.), OpenSSL gives no explanation whatsoever and * the SO_ERROR is also lost. */ if(CURLE_SSL_CONNECT_ERROR == result && errdetail == 0) { char extramsg[80]=""; int sockerr = SOCKERRNO; - const char *r_ip = NULL; - int r_port = 0; + struct ip_quadruple ip; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); if(sockerr && detail == SSL_ERROR_SYSCALL) Curl_strerror(sockerr, extramsg, sizeof(extramsg)); failf(data, "QUIC connect: %s in connection to %s:%d (%s)", extramsg[0] ? extramsg : osslq_SSL_ERROR_to_str(detail), - ctx->peer.dispname, r_port, r_ip); + ctx->peer.dispname, ip.remote_port, ip.remote_ip); } else { /* Could be a CERT problem */ @@ -468,7 +563,6 @@ static CURLcode cf_osslq_verify_peer(struct Curl_cfilter *cf, cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ cf->conn->httpversion = 30; - cf->conn->bundle->multiuse = BUNDLE_MULTIPLEX; return Curl_vquic_tls_verify_peer(&ctx->tls, cf, data, &ctx->peer); } @@ -482,9 +576,8 @@ struct h3_stream_ctx { 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 upload_blocked_len; /* the amount written last and EGAINed */ size_t recv_buf_nonflow; /* buffered bytes, not counting for flow control */ - uint64_t error3; /* HTTP/3 stream error code */ + curl_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 */ @@ -495,23 +588,32 @@ struct h3_stream_ctx { BIT(quic_flow_blocked); /* stream is blocked by QUIC flow control */ }; -#define H3_STREAM_CTX(d) ((struct h3_stream_ctx *)(((d) && (d)->req.p.http)? \ - ((struct HTTP *)(d)->req.p.http)->h3_ctx \ - : NULL)) -#define H3_STREAM_LCTX(d) ((struct HTTP *)(d)->req.p.http)->h3_ctx -#define H3_STREAM_ID(d) (H3_STREAM_CTX(d)? \ - H3_STREAM_CTX(d)->s.id : -2) +#define H3_STREAM_CTX(ctx,data) ((struct h3_stream_ctx *)(\ + data? Curl_hash_offt_get(&(ctx)->streams, (data)->mid) : NULL)) + +static void h3_stream_ctx_free(struct h3_stream_ctx *stream) +{ + cf_osslq_stream_cleanup(&stream->s); + Curl_bufq_free(&stream->sendbuf); + Curl_bufq_free(&stream->recvbuf); + Curl_h1_req_parse_free(&stream->h1); + free(stream); +} + +static void h3_stream_hash_free(void *stream) +{ + DEBUGASSERT(stream); + h3_stream_ctx_free((struct h3_stream_ctx *)stream); +} static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - if(!data || !data->req.p.http) { - failf(data, "initialization failure, transfer not http initialized"); + if(!data) return CURLE_FAILED_INIT; - } if(stream) return CURLE_OK; @@ -532,18 +634,23 @@ 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); - H3_STREAM_LCTX(data) = stream; + if(!Curl_hash_offt_set(&ctx->streams, data->mid, stream)) { + h3_stream_ctx_free(stream); + return CURLE_OUT_OF_MEMORY; + } + return CURLE_OK; } static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(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->s.id); + CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] easy handle is done", + stream->s.id); if(ctx->h3.conn && !stream->closed) { nghttp3_conn_shutdown_stream_read(ctx->h3.conn, stream->s.id); nghttp3_conn_close_stream(ctx->h3.conn, stream->s.id, @@ -552,12 +659,7 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) stream->closed = TRUE; } - cf_osslq_stream_cleanup(&stream->s); - Curl_bufq_free(&stream->sendbuf); - Curl_bufq_free(&stream->recvbuf); - Curl_h1_req_parse_free(&stream->h1); - free(stream); - H3_STREAM_LCTX(data) = NULL; + Curl_hash_offt_remove(&ctx->streams, data->mid); } } @@ -566,8 +668,7 @@ static struct cf_osslq_stream *cf_osslq_get_qstream(struct Curl_cfilter *cf, int64_t stream_id) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); - struct Curl_easy *sdata; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream && stream->s.id == stream_id) { return &stream->s; @@ -582,11 +683,15 @@ static struct cf_osslq_stream *cf_osslq_get_qstream(struct Curl_cfilter *cf, return &ctx->h3.s_qpack_dec; } else { + struct Curl_llist_node *e; DEBUGASSERT(data->multi); - for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { - if((sdata->conn == data->conn) && H3_STREAM_ID(sdata) == stream_id) { - stream = H3_STREAM_CTX(sdata); - return stream? &stream->s : NULL; + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); + if(sdata->conn != data->conn) + continue; + stream = H3_STREAM_CTX(ctx, sdata); + if(stream && stream->s.id == stream_id) { + return &stream->s; } } } @@ -596,7 +701,8 @@ static struct cf_osslq_stream *cf_osslq_get_qstream(struct Curl_cfilter *cf, static void h3_drain_stream(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_osslq_ctx *ctx = cf->ctx; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); unsigned char bits; (void)cf; @@ -626,8 +732,9 @@ static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_cfilter *cf = user_data; + struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)stream_id; @@ -640,11 +747,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, "[%" PRId64 "] RESET: error %" PRId64, + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] RESET: error %" FMT_PRIu64, stream->s.id, stream->error3); } else { - CURL_TRC_CF(data, cf, "[%" PRId64 "] CLOSED", stream->s.id); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] CLOSED", stream->s.id); } h3_drain_stream(cf, data); return 0; @@ -660,7 +767,8 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf, const void *mem, size_t memlen, bool flow) { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_osslq_ctx *ctx = cf->ctx; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; ssize_t nwritten; @@ -690,8 +798,9 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id, 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; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result; (void)conn; @@ -702,12 +811,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, "[%" PRId64 "] DATA len=%zu, ERROR receiving %d", + CURL_TRC_CF(data, cf, "[%" FMT_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, "[%" PRId64 "] DATA len=%zu, total=%zd", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu, total=%zd", stream->s.id, buflen, stream->download_recvd); h3_drain_stream(cf, data); return 0; @@ -718,27 +827,30 @@ static int cb_h3_deferred_consume(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_cfilter *cf = user_data; + struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)stream_id; if(stream) - CURL_TRC_CF(data, cf, "[%" PRId64 "] deferred consume %zu bytes", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] deferred consume %zu bytes", stream->s.id, consumed); return 0; } -static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, +static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, 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); struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; (void)conn; (void)stream_id; @@ -760,7 +872,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, return -1; ncopy = msnprintf(line, sizeof(line), "HTTP/3 %03d \r\n", stream->status_code); - CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s", stream_id, line); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] status: %s", stream_id, line); result = write_resp_raw(cf, data, line, ncopy, FALSE); if(result) { return -1; @@ -768,7 +880,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, } else { /* store as an HTTP1-style header */ - CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s", + CURL_TRC_CF(data, cf, "[%" FMT_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); @@ -791,12 +903,14 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, return 0; } -static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, +static int cb_h3_end_headers(nghttp3_conn *conn, int64_t sid, 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; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + curl_int64_t stream_id = sid; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; (void)conn; (void)stream_id; @@ -805,13 +919,13 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, if(!stream) return 0; - /* add a CRLF only if we've received some headers */ + /* add a CRLF only if we have received some headers */ result = write_resp_raw(cf, data, "\r\n", 2, FALSE); if(result) { return -1; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] end_headers, status=%d", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] end_headers, status=%d", stream_id, stream->status_code); if(stream->status_code / 100 != 1) { stream->resp_hds_complete = TRUE; @@ -820,30 +934,34 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, return 0; } -static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id, +static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t sid, 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; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + curl_int64_t stream_id = sid; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)conn; (void)app_error_code; if(!stream || !stream->s.ssl) return 0; - CURL_TRC_CF(data, cf, "[%" PRId64 "] stop_sending", stream_id); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] stop_sending", stream_id); cf_osslq_stream_close(&stream->s); return 0; } -static int cb_h3_reset_stream(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) { struct Curl_cfilter *cf = user_data; + struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + curl_int64_t stream_id = sid; + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); int rv; (void)conn; @@ -851,7 +969,7 @@ static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id, 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); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); if(!rv) { return NGHTTP3_ERR_CALLBACK_FAILURE; } @@ -866,8 +984,9 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_cfilter *cf = user_data; + struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nwritten = 0; size_t nvecs = 0; (void)cf; @@ -910,16 +1029,15 @@ 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", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> AGAIN", stream->s.id); return NGHTTP3_ERR_WOULDBLOCK; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> " - "%d vecs%s with %zu (buffered=%zu, left=%" - CURL_FORMAT_CURL_OFF_T ")", + CURL_TRC_CF(data, cf, "[%" FMT_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":"", + *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "", nwritten, Curl_bufq_len(&stream->sendbuf), stream->upload_left); return (nghttp3_ssize)nvecs; @@ -930,8 +1048,9 @@ static int cb_h3_acked_stream_data(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_cfilter *cf = user_data; + struct cf_osslq_ctx *ctx = cf->ctx; struct Curl_easy *data = stream_user_data; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); size_t skiplen; (void)cf; @@ -947,8 +1066,8 @@ static int cb_h3_acked_stream_data(nghttp3_conn *conn, int64_t stream_id, Curl_bufq_skip(&stream->sendbuf, skiplen); stream->sendbuf_len_in_flight -= skiplen; - /* Everything ACKed, we resume upload processing */ - if(!stream->sendbuf_len_in_flight) { + /* Resume upload processing if we have more data to send */ + if(stream->sendbuf_len_in_flight < Curl_bufq_len(&stream->sendbuf)) { int rv = nghttp3_conn_resume_stream(conn, stream_id); if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { return NGHTTP3_ERR_CALLBACK_FAILURE; @@ -1039,20 +1158,18 @@ static CURLcode cf_osslq_ctx_start(struct Curl_cfilter *cf, CURLcode result; int rv; const struct Curl_sockaddr_ex *peer_addr = NULL; - int peer_port; BIO *bio = NULL; BIO_ADDR *baddr = NULL; - Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, - H3_STREAM_POOL_SPARES); - result = Curl_ssl_peer_init(&ctx->peer, cf); + DEBUGASSERT(ctx->initialized); + result = Curl_ssl_peer_init(&ctx->peer, cf, TRNSPRT_QUIC); if(result) goto out; #define H3_ALPN "\x2h3" result = Curl_vquic_tls_init(&ctx->tls, cf, data, &ctx->peer, H3_ALPN, sizeof(H3_ALPN) - 1, - NULL, NULL); + NULL, NULL, NULL); if(result) goto out; @@ -1061,8 +1178,7 @@ static CURLcode cf_osslq_ctx_start(struct Curl_cfilter *cf, goto out; result = CURLE_QUIC_CONNECT_ERROR; - Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, - &peer_addr, NULL, &peer_port, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, &peer_addr, NULL); if(!peer_addr) goto out; @@ -1097,12 +1213,12 @@ static CURLcode cf_osslq_ctx_start(struct Curl_cfilter *cf, goto out; } - if(!SSL_set1_initial_peer_addr(ctx->tls.ssl, baddr)) { + if(!SSL_set1_initial_peer_addr(ctx->tls.ossl.ssl, baddr)) { failf(data, "failed to set the initial peer address"); result = CURLE_FAILED_INIT; goto out; } - if(!SSL_set_blocking_mode(ctx->tls.ssl, 0)) { + if(!SSL_set_blocking_mode(ctx->tls.ossl.ssl, 0)) { failf(data, "failed to turn off blocking mode"); result = CURLE_FAILED_INIT; goto out; @@ -1110,7 +1226,8 @@ static CURLcode cf_osslq_ctx_start(struct Curl_cfilter *cf, #ifdef SSL_VALUE_QUIC_IDLE_TIMEOUT /* Added in OpenSSL v3.3.x */ - if(!SSL_set_feature_request_uint(ctx->tls.ssl, SSL_VALUE_QUIC_IDLE_TIMEOUT, + if(!SSL_set_feature_request_uint(ctx->tls.ossl.ssl, + SSL_VALUE_QUIC_IDLE_TIMEOUT, CURL_QUIC_MAX_IDLE_MS)) { CURL_TRC_CF(data, cf, "error setting idle timeout, "); result = CURLE_FAILED_INIT; @@ -1118,13 +1235,13 @@ static CURLcode cf_osslq_ctx_start(struct Curl_cfilter *cf, } #endif - SSL_set_bio(ctx->tls.ssl, bio, bio); + SSL_set_bio(ctx->tls.ossl.ssl, bio, bio); bio = NULL; - SSL_set_connect_state(ctx->tls.ssl); - SSL_set_incoming_stream_policy(ctx->tls.ssl, + SSL_set_connect_state(ctx->tls.ossl.ssl); + SSL_set_incoming_stream_policy(ctx->tls.ossl.ssl, SSL_INCOMING_STREAM_POLICY_ACCEPT, 0); /* setup the H3 things on top of the QUIC connection */ - result = cf_osslq_h3conn_init(ctx, ctx->tls.ssl, cf); + result = cf_osslq_h3conn_init(ctx, ctx->tls.ossl.ssl, cf); out: if(bio) @@ -1158,7 +1275,7 @@ static ssize_t h3_quic_recv(void *reader_ctx, return -1; } else if(detail == SSL_ERROR_ZERO_RETURN) { - CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] h3_quic_recv -> EOS", + CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRId64 "] h3_quic_recv -> EOS", x->s->id); x->s->recvd_eos = TRUE; return 0; @@ -1167,9 +1284,9 @@ static ssize_t h3_quic_recv(void *reader_ctx, SSL_STREAM_STATE_RESET_REMOTE) { uint64_t app_error_code = NGHTTP3_H3_NO_ERROR; SSL_get_stream_read_error_code(x->s->ssl, &app_error_code); - CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] h3_quic_recv -> RESET, " - "rv=%d, app_err=%" PRIu64, - x->s->id, rv, app_error_code); + CURL_TRC_CF(x->data, x->cf, "[%" FMT_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) { x->s->reset = TRUE; } @@ -1181,10 +1298,6 @@ static ssize_t h3_quic_recv(void *reader_ctx, return -1; } } - else { - /* CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] h3_quic_recv -> %zu bytes", - x->s->id, nread); */ - } return (ssize_t)nread; } @@ -1196,7 +1309,7 @@ static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, CURLcode result = CURLE_OK; ssize_t nread; struct h3_quic_recv_ctx x; - int rv, eagain = FALSE; + bool eagain = FALSE; size_t total_recv_len = 0; DEBUGASSERT(s); @@ -1228,7 +1341,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, "[%" PRId64 "] forward %zu bytes " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] forward %zu bytes " "to nghttp3 -> %zd", s->id, blen, nread); if(nread < 0) { failf(data, "nghttp3_conn_read_stream(len=%zu) error: %s", @@ -1246,6 +1359,7 @@ static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, /* When we forwarded everything, handle RESET/EOS */ if(Curl_bufq_is_empty(&s->recvbuf) && !s->closed) { + int rv; result = CURLE_OK; if(s->reset) { uint64_t app_error; @@ -1267,7 +1381,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, "[%" PRId64 "] close nghttp3 stream -> %d", + CURL_TRC_CF(data, cf, "[%" FMT_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", @@ -1280,7 +1394,7 @@ static CURLcode cf_osslq_stream_recv(struct cf_osslq_stream *s, } out: if(result) - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_osslq_stream_recv -> %d", + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_osslq_stream_recv -> %d", s->id, result); return result; } @@ -1291,22 +1405,23 @@ static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, struct cf_osslq_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; - if(!ctx->tls.ssl) + if(!ctx->tls.ossl.ssl) goto out; ERR_clear_error(); /* 1. Check for new incoming streams */ while(1) { - SSL *snew = SSL_accept_stream(ctx->tls.ssl, SSL_ACCEPT_STREAM_NO_BLOCK); + SSL *snew = SSL_accept_stream(ctx->tls.ossl.ssl, + SSL_ACCEPT_STREAM_NO_BLOCK); if(!snew) break; (void)cf_osslq_h3conn_add_stream(&ctx->h3, snew, cf, data); } - if(!SSL_handle_events(ctx->tls.ssl)) { - int detail = SSL_get_error(ctx->tls.ssl, 0); + if(!SSL_handle_events(ctx->tls.ossl.ssl)) { + int detail = SSL_get_error(ctx->tls.ossl.ssl, 0); result = cf_osslq_ssl_err(cf, data, detail, CURLE_RECV_ERROR); } @@ -1320,13 +1435,14 @@ static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, } if(ctx->h3.conn) { - struct Curl_easy *sdata; + struct Curl_llist_node *e; struct h3_stream_ctx *stream; /* PULL all open streams */ DEBUGASSERT(data->multi); - for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); if(sdata->conn == data->conn && CURL_WANT_RECV(sdata)) { - stream = H3_STREAM_CTX(sdata); + stream = H3_STREAM_CTX(ctx, sdata); if(stream && !stream->closed && !Curl_bufq_is_full(&stream->recvbuf)) { result = cf_osslq_stream_recv(&stream->s, cf, sdata); @@ -1347,13 +1463,14 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; - struct Curl_easy *sdata; struct h3_stream_ctx *stream; if(ctx->h3.conn) { - for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { + struct Curl_llist_node *e; + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); if(sdata->conn == data->conn) { - stream = H3_STREAM_CTX(sdata); + stream = H3_STREAM_CTX(ctx, sdata); if(stream && stream->s.ssl && stream->s.send_blocked && !SSL_want_write(stream->s.ssl)) { nghttp3_conn_unblock_stream(ctx->h3.conn, stream->s.id); @@ -1373,7 +1490,7 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, struct cf_osslq_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; - if(!ctx->tls.ssl || !ctx->h3.conn) + if(!ctx->tls.ossl.ssl || !ctx->h3.conn) goto out; for(;;) { @@ -1402,8 +1519,8 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, /* Get the stream for this data */ s = cf_osslq_get_qstream(cf, data, stream_id); if(!s) { - failf(data, "nghttp3_conn_writev_stream gave unknown stream %" PRId64, - stream_id); + failf(data, "nghttp3_conn_writev_stream gave unknown stream %" + FMT_PRId64, (curl_int64_t)stream_id); result = CURLE_SEND_ERROR; goto out; } @@ -1415,24 +1532,17 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, for(i = 0; (i < n) && !blocked; ++i) { /* Without stream->s.ssl, we closed that already, so * pretend the write did succeed. */ -#ifdef SSL_WRITE_FLAG_CONCLUDE - /* Since OpenSSL v3.3.x, on last chunk set EOS if needed */ - uint64_t flags = (eos && ((i + 1) == n))? SSL_WRITE_FLAG_CONCLUDE : 0; + 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); if(ok && flags & SSL_WRITE_FLAG_CONCLUDE) eos_written = TRUE; -#else - written = vec[i].len; - ok = !s->ssl || SSL_write_ex(s->ssl, vec[i].base, vec[i].len, - &written); -#endif if(ok) { /* As OpenSSL buffers the data, we count this as acknowledged * from nghttp3's point of view */ - CURL_TRC_CF(data, cf, "[%"PRId64"] send %zu bytes to QUIC ok", - s->id, vec[i].len); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send %zu bytes to QUIC ok", + s->id, vec[i].len); acked_len += vec[i].len; } else { @@ -1441,16 +1551,16 @@ 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, "[%"PRId64"] send %zu bytes to QUIC blocked", - s->id, vec[i].len); + CURL_TRC_CF(data, cf, "[%"FMT_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, "[%"PRId64"] send %zu bytes to QUIC, SSL error %d", + failf(data, "[%"FMT_PRId64 "] send %zu bytes to QUIC, SSL error %d", s->id, vec[i].len, detail); - result = cf_osslq_ssl_err(cf, data, detail, CURLE_SEND_ERROR); + result = cf_osslq_ssl_err(cf, data, detail, CURLE_HTTP3); goto out; } } @@ -1474,13 +1584,13 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, result = CURLE_SEND_ERROR; goto out; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] forwarded %zu/%zu h3 bytes " + CURL_TRC_CF(data, cf, "[%" FMT_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, "[%" PRId64 "] closing QUIC stream", s->id); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] closing QUIC stream", s->id); SSL_stream_conclude(s->ssl, 0); } } @@ -1496,7 +1606,7 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, struct cf_osslq_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; - if(!ctx->tls.ssl) + if(!ctx->tls.ossl.ssl) goto out; ERR_clear_error(); @@ -1504,8 +1614,8 @@ static CURLcode cf_progress_egress(struct Curl_cfilter *cf, if(result) goto out; - if(!SSL_handle_events(ctx->tls.ssl)) { - int detail = SSL_get_error(ctx->tls.ssl, 0); + if(!SSL_handle_events(ctx->tls.ossl.ssl)) { + int detail = SSL_get_error(ctx->tls.ossl.ssl, 0); result = cf_osslq_ssl_err(cf, data, detail, CURLE_SEND_ERROR); } @@ -1523,11 +1633,11 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, CURLcode result = CURLE_OK; struct timeval tv; timediff_t timeoutms; - int is_infinite = TRUE; + int is_infinite = 1; - if(ctx->tls.ssl && - SSL_get_event_timeout(ctx->tls.ssl, &tv, &is_infinite) && - !is_infinite) { + if(ctx->tls.ossl.ssl && + SSL_get_event_timeout(ctx->tls.ossl.ssl, &tv, &is_infinite) && + !is_infinite) { timeoutms = curlx_tvtoms(&tv); /* QUIC want to be called again latest at the returned timeout */ if(timeoutms <= 0) { @@ -1537,7 +1647,7 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, result = cf_progress_egress(cf, data); if(result) goto out; - if(SSL_get_event_timeout(ctx->tls.ssl, &tv, &is_infinite)) { + if(SSL_get_event_timeout(ctx->tls.ossl.ssl, &tv, &is_infinite)) { timeoutms = curlx_tvtoms(&tv); } } @@ -1576,13 +1686,7 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, now = Curl_now(); CF_DATA_SAVE(save, cf, data); - if(ctx->reconnect_at.tv_sec && Curl_timediff(now, ctx->reconnect_at) < 0) { - /* Not time yet to attempt the next connect */ - CURL_TRC_CF(data, cf, "waiting for reconnect time"); - goto out; - } - - if(!ctx->tls.ssl) { + if(!ctx->tls.ossl.ssl) { ctx->started_at = now; result = cf_osslq_ctx_start(cf, data); if(result) @@ -1597,8 +1701,16 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, } } + /* Since OpenSSL does its own send/recv internally, we may miss the + * moment to populate the x509 store right before the server response. + * Do it instead before we start the handshake, at the loss of the + * time to set this up. */ + result = Curl_vquic_tls_before_recv(&ctx->tls, cf, data); + if(result) + goto out; + ERR_clear_error(); - err = SSL_do_handshake(ctx->tls.ssl); + err = SSL_do_handshake(ctx->tls.ossl.ssl); if(err == 1) { /* connected */ @@ -1616,12 +1728,11 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, } } else { - int detail = SSL_get_error(ctx->tls.ssl, err); + int detail = SSL_get_error(ctx->tls.ossl.ssl, err); switch(detail) { case SSL_ERROR_WANT_READ: ctx->q.last_io = now; CURL_TRC_CF(data, cf, "QUIC SSL_connect() -> WANT_RECV"); - result = Curl_vquic_tls_before_recv(&ctx->tls, cf, data); goto out; case SSL_ERROR_WANT_WRITE: ctx->q.last_io = now; @@ -1647,7 +1758,8 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, } out: - if(result == CURLE_RECV_ERROR && ctx->tls.ssl && ctx->protocol_shutdown) { + if(result == CURLE_RECV_ERROR && ctx->tls.ossl.ssl && + ctx->protocol_shutdown) { /* When a QUIC server instance is shutting down, it may send us a * CONNECTION_CLOSE right away. Our connection then enters the DRAINING * state. The CONNECT may work in the near future again. Indicate @@ -1657,13 +1769,11 @@ out: #ifndef CURL_DISABLE_VERBOSE_STRINGS if(result) { - const char *r_ip = NULL; - int r_port = 0; + struct ip_quadruple ip; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); infof(data, "QUIC connect to %s port %u failed: %s", - r_ip, r_port, curl_easy_strerror(result)); + ip.remote_ip, ip.remote_port, curl_easy_strerror(result)); } #endif if(!result) @@ -1695,7 +1805,7 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, *err = h3_data_setup(cf, data); if(*err) goto out; - stream = H3_STREAM_CTX(data); + stream = H3_STREAM_CTX(ctx, data); DEBUGASSERT(stream); if(!stream) { *err = CURLE_FAILED_INIT; @@ -1737,10 +1847,10 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, } DEBUGASSERT(stream->s.id == -1); - *err = cf_osslq_stream_open(&stream->s, ctx->tls.ssl, 0, + *err = cf_osslq_stream_open(&stream->s, ctx->tls.ossl.ssl, 0, &ctx->stream_bufcp, data); if(*err) { - failf(data, "can't get bidi streams"); + failf(data, "cannot get bidi streams"); *err = CURLE_SEND_ERROR; goto out; } @@ -1774,11 +1884,11 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, if(rc) { switch(rc) { case NGHTTP3_ERR_CONN_CLOSING: - CURL_TRC_CF(data, cf, "h3sid[%"PRId64"] failed to send, " + CURL_TRC_CF(data, cf, "h3sid[%"FMT_PRId64"] failed to send, " "connection is closing", stream->s.id); break; default: - CURL_TRC_CF(data, cf, "h3sid[%"PRId64"] failed to send -> %d (%s)", + CURL_TRC_CF(data, cf, "h3sid[%"FMT_PRId64 "] failed to send -> %d (%s)", stream->s.id, rc, nghttp3_strerror(rc)); break; } @@ -1788,10 +1898,11 @@ static ssize_t h3_stream_open(struct Curl_cfilter *cf, } if(Curl_trc_is_verbose(data)) { - infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", + infof(data, "[HTTP/3] [%" FMT_PRId64 "] OPENED stream for %s", stream->s.id, data->state.url); for(i = 0; i < nheader; ++i) { - infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->s.id, + infof(data, "[HTTP/3] [%" FMT_PRId64 "] [%.*s: %.*s]", + stream->s.id, (int)nva[i].namelen, nva[i].name, (int)nva[i].valuelen, nva[i].value); } @@ -1804,17 +1915,19 @@ out: } static ssize_t cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); struct cf_call_data save; ssize_t nwritten; CURLcode result; + (void)eos; /* TODO: use to end stream */ CF_DATA_SAVE(save, cf, data); DEBUGASSERT(cf->connected); - DEBUGASSERT(ctx->tls.ssl); + DEBUGASSERT(ctx->tls.ossl.ssl); DEBUGASSERT(ctx->h3.conn); *err = CURLE_OK; @@ -1838,22 +1951,7 @@ static ssize_t cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, CURL_TRC_CF(data, cf, "failed to open stream -> %d", *err); goto out; } - stream = H3_STREAM_CTX(data); - } - else if(stream->upload_blocked_len) { - /* the data in `buf` has already been submitted or added to the - * buffers, but have been EAGAINed on the last invocation. */ - DEBUGASSERT(len >= stream->upload_blocked_len); - if(len < stream->upload_blocked_len) { - /* Did we get called again with a smaller `len`? This should not - * happen. We are not prepared to handle that. */ - failf(data, "HTTP/3 send again with decreased length"); - *err = CURLE_HTTP3; - nwritten = -1; - goto out; - } - nwritten = (ssize_t)stream->upload_blocked_len; - stream->upload_blocked_len = 0; + stream = H3_STREAM_CTX(ctx, data); } else if(stream->closed) { if(stream->resp_hds_complete) { @@ -1862,13 +1960,13 @@ static ssize_t 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, "[%" PRId64 "] discarding data" + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] discarding data" "on closed stream with response", stream->s.id); *err = CURLE_OK; nwritten = (ssize_t)len; goto out; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send_body(len=%zu) " "-> stream closed", stream->s.id, len); *err = CURLE_HTTP3; nwritten = -1; @@ -1876,7 +1974,7 @@ static ssize_t cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, } else { nwritten = Curl_bufq_write(&stream->sendbuf, buf, len, err); - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send, add to " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send, add to " "sendbuf(len=%zu) -> %zd, %d", stream->s.id, len, nwritten, *err); if(nwritten < 0) { @@ -1892,22 +1990,10 @@ static ssize_t cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data, nwritten = -1; } - if(stream && nwritten > 0 && stream->sendbuf_len_in_flight) { - /* We have unacknowledged DATA and cannot report success to our - * caller. Instead we EAGAIN and remember how much we have already - * "written" into our various internal connection buffers. */ - stream->upload_blocked_len = nwritten; - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu), " - "%zu bytes in flight -> EGAIN", stream->s.id, len, - stream->sendbuf_len_in_flight); - *err = CURLE_AGAIN; - nwritten = -1; - } - out: result = check_and_set_expiry(cf, data); - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu) -> %zd, %d", - stream? stream->s.id : -1, len, nwritten, *err); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %zd, %d", + stream ? stream->s.id : -1, len, nwritten, *err); CF_DATA_RESTORE(cf, save); return nwritten; } @@ -1922,13 +2008,15 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf, (void)cf; if(stream->reset) { failf(data, - "HTTP/3 stream %" PRId64 " reset by server", stream->s.id); - *err = stream->resp_hds_complete? CURLE_PARTIAL_FILE : CURLE_HTTP3; + "HTTP/3 stream %" FMT_PRId64 " reset by server", + stream->s.id); + *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; goto out; } else if(!stream->resp_hds_complete) { failf(data, - "HTTP/3 stream %" PRId64 " was closed cleanly, but before getting" + "HTTP/3 stream %" FMT_PRId64 + " was closed cleanly, but before getting" " all response header fields, treated as error", stream->s.id); *err = CURLE_HTTP3; @@ -1945,7 +2033,7 @@ static ssize_t cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err) { struct cf_osslq_ctx *ctx = cf->ctx; - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nread = -1; struct cf_call_data save; CURLcode result; @@ -1954,7 +2042,7 @@ static ssize_t cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, CF_DATA_SAVE(save, cf, data); DEBUGASSERT(cf->connected); DEBUGASSERT(ctx); - DEBUGASSERT(ctx->tls.ssl); + DEBUGASSERT(ctx->tls.ossl.ssl); DEBUGASSERT(ctx->h3.conn); *err = CURLE_OK; @@ -1967,7 +2055,7 @@ static ssize_t cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, nread = Curl_bufq_read(&stream->recvbuf, (unsigned char *)buf, len, err); if(nread < 0) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] read recvbuf(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read recvbuf(len=%zu) " "-> %zd, %d", stream->s.id, len, nread, *err); goto out; } @@ -1985,7 +2073,7 @@ static ssize_t cf_osslq_recv(struct Curl_cfilter *cf, struct Curl_easy *data, nread = Curl_bufq_read(&stream->recvbuf, (unsigned char *)buf, len, err); if(nread < 0) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] read recvbuf(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read recvbuf(len=%zu) " "-> %zd, %d", stream->s.id, len, nread, *err); goto out; } @@ -2015,8 +2103,8 @@ out: nread = -1; } } - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv(len=%zu) -> %zd, %d", - stream? stream->s.id : -1, len, nread, *err); + CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(len=%zu) -> %zd, %d", + stream ? stream->s.id : -1, len, nread, *err); CF_DATA_RESTORE(cf, save); return nread; } @@ -2028,7 +2116,8 @@ out: static bool cf_osslq_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { - const struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_osslq_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); } @@ -2057,16 +2146,17 @@ static CURLcode cf_osslq_data_event(struct Curl_cfilter *cf, h3_data_done(cf, data); break; case CF_CTRL_DATA_DONE_SEND: { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream && !stream->send_closed) { stream->send_closed = TRUE; - stream->upload_left = Curl_bufq_len(&stream->sendbuf); + stream->upload_left = Curl_bufq_len(&stream->sendbuf) - + stream->sendbuf_len_in_flight; (void)nghttp3_conn_resume_stream(ctx->h3.conn, stream->s.id); } break; } case CF_CTRL_DATA_IDLE: { - struct h3_stream_ctx *stream = H3_STREAM_CTX(data); + struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURL_TRC_CF(data, cf, "data idle"); if(stream && !stream->closed) { result = check_and_set_expiry(cf, data); @@ -2090,7 +2180,7 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); *input_pending = FALSE; - if(!ctx->tls.ssl) + if(!ctx->tls.ossl.ssl) goto out; #ifdef SSL_VALUE_QUIC_IDLE_TIMEOUT @@ -2098,7 +2188,8 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf, { timediff_t idletime; uint64_t idle_ms = ctx->max_idle_ms; - if(!SSL_get_value_uint(ctx->tls.ssl, SSL_VALUE_CLASS_FEATURE_NEGOTIATED, + if(!SSL_get_value_uint(ctx->tls.ossl.ssl, + SSL_VALUE_CLASS_FEATURE_NEGOTIATED, SSL_VALUE_QUIC_IDLE_TIMEOUT, &idle_ms)) { CURL_TRC_CF(data, cf, "error getting negotiated idle timeout, " "assume connection is dead."); @@ -2118,13 +2209,13 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf, alive = TRUE; if(*input_pending) { CURLcode result; - /* This happens before we've sent off a request and the connection is - not in use by any other transfer, there shouldn't be any data here, + /* This happens before we have sent off a request and the connection is + not in use by any other transfer, there should not be any data here, only "protocol frames" */ *input_pending = FALSE; result = cf_progress_ingress(cf, data); CURL_TRC_CF(data, cf, "is_alive, progress ingress -> %d", result); - alive = result? FALSE : TRUE; + alive = result ? FALSE : TRUE; } out: @@ -2138,15 +2229,15 @@ static void cf_osslq_adjust_pollset(struct Curl_cfilter *cf, { struct cf_osslq_ctx *ctx = cf->ctx; - if(!ctx->tls.ssl) { + if(!ctx->tls.ossl.ssl) { /* NOP */ } else if(!cf->connected) { /* during handshake, transfer has not started yet. we always * add our socket for polling if SSL wants to send/recv */ Curl_pollset_set(data, ps, ctx->q.sockfd, - SSL_net_read_desired(ctx->tls.ssl), - SSL_net_write_desired(ctx->tls.ssl)); + SSL_net_read_desired(ctx->tls.ossl.ssl), + SSL_net_write_desired(ctx->tls.ossl.ssl)); } else { /* once connected, we only modify the socket if it is present. @@ -2155,8 +2246,12 @@ static void cf_osslq_adjust_pollset(struct Curl_cfilter *cf, Curl_pollset_check(data, ps, ctx->q.sockfd, &want_recv, &want_send); if(want_recv || want_send) { Curl_pollset_set(data, ps, ctx->q.sockfd, - SSL_net_read_desired(ctx->tls.ssl), - SSL_net_write_desired(ctx->tls.ssl)); + SSL_net_read_desired(ctx->tls.ossl.ssl), + SSL_net_write_desired(ctx->tls.ossl.ssl)); + } + else if(ctx->need_recv || ctx->need_send) { + Curl_pollset_set(data, ps, ctx->q.sockfd, + ctx->need_recv, ctx->need_send); } } } @@ -2172,14 +2267,14 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf, #ifdef SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL /* Added in OpenSSL v3.3.x */ uint64_t v; - if(!SSL_get_value_uint(ctx->tls.ssl, SSL_VALUE_CLASS_GENERIC, + if(!SSL_get_value_uint(ctx->tls.ossl.ssl, SSL_VALUE_CLASS_GENERIC, SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL, &v)) { CURL_TRC_CF(data, cf, "error getting available local bidi streams"); return CURLE_HTTP3; } /* we report avail + in_use */ v += CONN_INUSE(cf->conn); - *pres1 = (v > INT_MAX)? INT_MAX : (int)v; + *pres1 = (v > INT_MAX) ? INT_MAX : (int)v; #else *pres1 = 100; #endif @@ -2189,7 +2284,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf, case CF_QUERY_CONNECT_REPLY_MS: if(ctx->got_first_byte) { timediff_t ms = Curl_timediff(ctx->first_byte_at, ctx->started_at); - *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX; + *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else *pres1 = -1; @@ -2209,7 +2304,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf, default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -2221,6 +2316,7 @@ struct Curl_cftype Curl_cft_http3 = { cf_osslq_destroy, cf_osslq_connect, cf_osslq_close, + cf_osslq_shutdown, Curl_cf_def_get_host, cf_osslq_adjust_pollset, cf_osslq_data_pending, @@ -2247,7 +2343,7 @@ CURLcode Curl_cf_osslq_create(struct Curl_cfilter **pcf, result = CURLE_OUT_OF_MEMORY; goto out; } - cf_osslq_ctx_clear(ctx); + cf_osslq_ctx_init(ctx); result = Curl_cf_create(&cf, &Curl_cft_http3, ctx); if(result) @@ -2263,12 +2359,12 @@ CURLcode Curl_cf_osslq_create(struct Curl_cfilter **pcf, cf->next = udp_cf; out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { if(udp_cf) Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE); Curl_safefree(cf); - Curl_safefree(ctx); + cf_osslq_ctx_free(ctx); } return result; } @@ -2277,7 +2373,7 @@ bool Curl_conn_is_osslq(const struct Curl_easy *data, const struct connectdata *conn, int sockindex) { - struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL; + struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; (void)data; for(; cf; cf = cf->next) { diff --git a/deps/curl/lib/vquic/curl_quiche.c b/deps/curl/lib/vquic/curl_quiche.c index fcb0eb8f..30484989 100644 --- a/deps/curl/lib/vquic/curl_quiche.c +++ b/deps/curl/lib/vquic/curl_quiche.c @@ -29,6 +29,7 @@ #include #include #include "bufq.h" +#include "hash.h" #include "urldata.h" #include "cfilters.h" #include "cf-socket.h" @@ -63,11 +64,10 @@ #define H3_STREAM_WINDOW_SIZE (128 * 1024) #define H3_STREAM_CHUNK_SIZE (16 * 1024) -/* The pool keeps spares around and half of a full stream windows - * seems good. More does not seem to improve performance. - * The benefit of the pool is that stream buffer to not keep - * spares. So memory consumption goes down when streams run empty, - * have a large upload done, etc. */ +/* The pool keeps spares around and half of a full stream windows seems good. + * More does not seem to improve performance. The benefit of the pool is that + * 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 /* Receive and Send max number of chunks just follows from the @@ -88,7 +88,7 @@ void Curl_quiche_ver(char *p, size_t len) struct cf_quiche_ctx { struct cf_quic_ctx q; struct ssl_peer peer; - struct quic_tls_ctx tls; + struct curl_tls_ctx tls; quiche_conn *qconn; quiche_config *cfg; quiche_h3_conn *h3c; @@ -96,15 +96,18 @@ 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 curltime reconnect_at; /* time the next attempt should start */ struct bufc_pool stream_bufcp; /* chunk pool for streams */ + struct Curl_hash streams; /* hash `data->mid` to `stream_ctx` */ curl_off_t data_recvd; - uint64_t max_idle_ms; /* max idle time for QUIC conn */ + BIT(initialized); BIT(goaway); /* got GOAWAY from server */ BIT(x509_store_setup); /* if x509 store has been set up */ + BIT(shutdown_started); /* queued shutdown packets */ }; #ifdef DEBUG_QUICHE +/* initialize debug log callback only once */ +static int debug_log_init = 0; static void quiche_debug_log(const char *line, void *argp) { (void)argp; @@ -112,66 +115,102 @@ static void quiche_debug_log(const char *line, void *argp) } #endif -static void cf_quiche_ctx_clear(struct cf_quiche_ctx *ctx) +static void h3_stream_hash_free(void *stream); + +static void cf_quiche_ctx_init(struct cf_quiche_ctx *ctx) { - if(ctx) { - if(ctx->h3c) - quiche_h3_conn_free(ctx->h3c); - if(ctx->h3config) - quiche_h3_config_free(ctx->h3config); - if(ctx->qconn) - quiche_conn_free(ctx->qconn); - if(ctx->cfg) - quiche_config_free(ctx->cfg); - /* quiche just freed ctx->tls.ssl */ - ctx->tls.ssl = NULL; + DEBUGASSERT(!ctx->initialized); +#ifdef DEBUG_QUICHE + if(!debug_log_init) { + quiche_enable_debug_logging(quiche_debug_log, NULL); + debug_log_init = 1; + } +#endif + Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, + H3_STREAM_POOL_SPARES); + Curl_hash_offt_init(&ctx->streams, 63, h3_stream_hash_free); + ctx->data_recvd = 0; + ctx->initialized = TRUE; +} + +static void cf_quiche_ctx_free(struct cf_quiche_ctx *ctx) +{ + if(ctx && ctx->initialized) { + /* quiche just freed it */ + ctx->tls.ossl.ssl = NULL; Curl_vquic_tls_cleanup(&ctx->tls); Curl_ssl_peer_cleanup(&ctx->peer); vquic_ctx_free(&ctx->q); Curl_bufcp_free(&ctx->stream_bufcp); - - memset(ctx, 0, sizeof(*ctx)); + Curl_hash_clean(&ctx->streams); + Curl_hash_destroy(&ctx->streams); } + free(ctx); } +static void cf_quiche_ctx_close(struct cf_quiche_ctx *ctx) +{ + if(ctx->h3c) + quiche_h3_conn_free(ctx->h3c); + if(ctx->h3config) + quiche_h3_config_free(ctx->h3config); + if(ctx->qconn) + quiche_conn_free(ctx->qconn); + if(ctx->cfg) + quiche_config_free(ctx->cfg); +} + +static CURLcode cf_flush_egress(struct Curl_cfilter *cf, + struct Curl_easy *data); + /** * All about the H3 internals of a stream */ struct stream_ctx { - int64_t id; /* HTTP/3 protocol stream identifier */ + curl_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 */ - curl_off_t upload_left; /* number of request bytes left to upload */ - bool closed; /* TRUE on stream close */ - bool reset; /* TRUE on stream reset */ - bool send_closed; /* stream is locally closed */ - bool resp_hds_complete; /* complete, final response has been received */ - bool resp_got_header; /* TRUE when h3 stream has recvd some HEADER */ + curl_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 */ }; -#define H3_STREAM_CTX(d) ((struct stream_ctx *)(((d) && (d)->req.p.http)? \ - ((struct HTTP *)(d)->req.p.http)->h3_ctx \ - : NULL)) -#define H3_STREAM_LCTX(d) ((struct HTTP *)(d)->req.p.http)->h3_ctx -#define H3_STREAM_ID(d) (H3_STREAM_CTX(d)? \ - H3_STREAM_CTX(d)->id : -2) +#define H3_STREAM_CTX(ctx,data) ((struct stream_ctx *)(\ + data? Curl_hash_offt_get(&(ctx)->streams, (data)->mid) : NULL)) + +static void h3_stream_ctx_free(struct stream_ctx *stream) +{ + Curl_bufq_free(&stream->recvbuf); + Curl_h1_req_parse_free(&stream->h1); + free(stream); +} + +static void h3_stream_hash_free(void *stream) +{ + DEBUGASSERT(stream); + h3_stream_ctx_free((struct stream_ctx *)stream); +} static void check_resumes(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct Curl_easy *sdata; - struct stream_ctx *stream; + struct cf_quiche_ctx *ctx = cf->ctx; + struct Curl_llist_node *e; DEBUGASSERT(data->multi); - for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); if(sdata->conn == data->conn) { - stream = H3_STREAM_CTX(sdata); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, sdata); if(stream && stream->quic_flow_blocked) { stream->quic_flow_blocked = FALSE; Curl_expire(data, 0, EXPIRE_RUN_NOW); - CURL_TRC_CF(data, cf, "[%"PRId64"] unblock", stream->id); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] unblock", stream->id); } } } @@ -181,7 +220,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream) return CURLE_OK; @@ -190,22 +229,28 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, if(!stream) return CURLE_OUT_OF_MEMORY; - H3_STREAM_LCTX(data) = stream; 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_hash_offt_set(&ctx->streams, data->mid, stream)) { + h3_stream_ctx_free(stream); + return CURLE_OUT_OF_MEMORY; + } + return CURLE_OK; } static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); + CURLcode result; (void)cf; if(stream) { - CURL_TRC_CF(data, cf, "[%"PRId64"] easy handle is done", stream->id); + CURL_TRC_CF(data, cf, "[%"FMT_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); @@ -215,23 +260,24 @@ static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) 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); } - Curl_bufq_free(&stream->recvbuf); - Curl_h1_req_parse_free(&stream->h1); - free(stream); - H3_STREAM_LCTX(data) = NULL; + Curl_hash_offt_remove(&ctx->streams, data->mid); } } -static void drain_stream(struct Curl_cfilter *cf, - struct Curl_easy *data) +static void h3_drain_stream(struct Curl_cfilter *cf, + struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_quiche_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); unsigned char bits; (void)cf; bits = CURL_CSELECT_IN; - if(stream && !stream->send_closed && stream->upload_left) + if(stream && !stream->send_closed) bits |= CURL_CSELECT_OUT; if(data->state.select_bits != bits) { data->state.select_bits = bits; @@ -241,25 +287,52 @@ static void drain_stream(struct Curl_cfilter *cf, static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, struct Curl_easy *data, - int64_t stream3_id) + curl_uint64_t stream_id, + struct stream_ctx **pstream) { - struct Curl_easy *sdata; + struct cf_quiche_ctx *ctx = cf->ctx; + struct stream_ctx *stream; (void)cf; - if(H3_STREAM_ID(data) == stream3_id) { + stream = H3_STREAM_CTX(ctx, data); + if(stream && stream->id == stream_id) { + *pstream = stream; return data; } else { + struct Curl_llist_node *e; DEBUGASSERT(data->multi); - for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { - if((sdata->conn == data->conn) && H3_STREAM_ID(sdata) == stream3_id) { + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); + if(sdata->conn != data->conn) + continue; + stream = H3_STREAM_CTX(ctx, sdata); + if(stream && stream->id == stream_id) { + *pstream = stream; return sdata; } } } + *pstream = NULL; return NULL; } +static void cf_quiche_expire_conn_closed(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + struct Curl_llist_node *e; + + DEBUGASSERT(data->multi); + CURL_TRC_CF(data, cf, "conn closed, expire all transfers"); + for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { + struct Curl_easy *sdata = Curl_node_elem(e); + if(sdata == data || sdata->conn != data->conn) + continue; + CURL_TRC_CF(sdata, cf, "conn closed, expire transfer"); + Curl_expire(sdata, 0, EXPIRE_RUN_NOW); + } +} + /* * 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 @@ -269,7 +342,8 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf, struct Curl_easy *data, const void *mem, size_t memlen) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_quiche_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result = CURLE_OK; ssize_t nwritten; @@ -299,14 +373,15 @@ static int cb_each_header(uint8_t *name, size_t name_len, void *argp) { struct cb_ctx *x = argp; - struct stream_ctx *stream = H3_STREAM_CTX(x->data); + struct cf_quiche_ctx *ctx = x->cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, x->data); CURLcode result; if(!stream) return CURLE_OK; if((name_len == 7) && !strncmp(HTTP_PSEUDO_STATUS, (char *)name, 7)) { - CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] status: %.*s", + CURL_TRC_CF(x->data, x->cf, "[%" FMT_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) @@ -315,7 +390,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, "[%" PRId64 "] header: %.*s: %.*s", + CURL_TRC_CF(x->data, x->cf, "[%" FMT_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); @@ -327,7 +402,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, "[%"PRId64"] on header error %d", + CURL_TRC_CF(x->data, x->cf, "[%"FMT_PRIu64"] on header error %d", stream->id, result); } return result; @@ -339,7 +414,7 @@ static ssize_t stream_resp_read(void *reader_ctx, { struct cb_ctx *x = reader_ctx; struct cf_quiche_ctx *ctx = x->cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(x->data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, x->data); ssize_t nread; if(!stream) { @@ -362,7 +437,8 @@ static ssize_t stream_resp_read(void *reader_ctx, static CURLcode cf_recv_body(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_quiche_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nwritten; struct cb_ctx cb_ctx; CURLcode result = CURLE_OK; @@ -383,9 +459,9 @@ static CURLcode cf_recv_body(struct Curl_cfilter *cf, stream_resp_read, &cb_ctx, &result); if(nwritten < 0 && result != CURLE_AGAIN) { - CURL_TRC_CF(data, cf, "[%"PRId64"] recv_body error %zd", + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] recv_body error %zd", stream->id, nwritten); - failf(data, "Error %d in HTTP/3 response body for stream[%"PRId64"]", + failf(data, "Error %d in HTTP/3 response body for stream[%"FMT_PRIu64"]", result, stream->id); stream->closed = TRUE; stream->reset = TRUE; @@ -420,17 +496,15 @@ static const char *cf_ev_name(quiche_h3_event *ev) static CURLcode h3_process_event(struct Curl_cfilter *cf, struct Curl_easy *data, - int64_t stream3_id, + struct stream_ctx *stream, quiche_h3_event *ev) { - struct stream_ctx *stream = H3_STREAM_CTX(data); struct cb_ctx cb_ctx; CURLcode result = CURLE_OK; int rc; if(!stream) return CURLE_OK; - DEBUGASSERT(stream3_id == stream->id); switch(quiche_h3_event_type(ev)) { case QUICHE_H3_EVENT_HEADERS: stream->resp_got_header = TRUE; @@ -438,11 +512,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[%"PRId64"]", - rc, stream3_id); + failf(data, "Error %d in HTTP/3 response header for stream[%" + FMT_PRIu64"]", rc, stream->id); return CURLE_RECV_ERROR; } - CURL_TRC_CF(data, cf, "[%"PRId64"] <- [HEADERS]", stream3_id); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] <- [HEADERS]", stream->id); break; case QUICHE_H3_EVENT_DATA: @@ -452,7 +526,7 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, break; case QUICHE_H3_EVENT_RESET: - CURL_TRC_CF(data, cf, "[%"PRId64"] RESET", stream3_id); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] RESET", stream->id); stream->closed = TRUE; stream->reset = TRUE; stream->send_closed = TRUE; @@ -460,7 +534,7 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, break; case QUICHE_H3_EVENT_FINISHED: - CURL_TRC_CF(data, cf, "[%"PRId64"] CLOSED", stream3_id); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] CLOSED", stream->id); if(!stream->resp_hds_complete) { result = write_resp_raw(cf, data, "\r\n", 2); if(result) @@ -472,12 +546,12 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf, break; case QUICHE_H3_EVENT_GOAWAY: - CURL_TRC_CF(data, cf, "[%"PRId64"] <- [GOAWAY]", stream3_id); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] <- [GOAWAY]", stream->id); break; default: - CURL_TRC_CF(data, cf, "[%"PRId64"] recv, unhandled event %d", - stream3_id, quiche_h3_event_type(ev)); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] recv, unhandled event %d", + stream->id, quiche_h3_event_type(ev)); break; } return result; @@ -487,36 +561,33 @@ static CURLcode cf_poll_events(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = NULL; struct Curl_easy *sdata; quiche_h3_event *ev; CURLcode result; /* Take in the events and distribute them to the transfers. */ while(ctx->h3c) { - int64_t stream3_id = quiche_h3_conn_poll(ctx->h3c, ctx->qconn, &ev); + curl_int64_t stream3_id = quiche_h3_conn_poll(ctx->h3c, ctx->qconn, &ev); if(stream3_id == QUICHE_H3_ERR_DONE) { break; } else if(stream3_id < 0) { - CURL_TRC_CF(data, cf, "[%"PRId64"] error poll: %"PRId64, - stream? stream->id : -1, stream3_id); + CURL_TRC_CF(data, cf, "error poll: %"FMT_PRId64, stream3_id); return CURLE_HTTP3; } - sdata = get_stream_easy(cf, data, stream3_id); - if(!sdata) { - CURL_TRC_CF(data, cf, "[%"PRId64"] discard event %s for " - "unknown [%"PRId64"]", - stream? stream->id : -1, cf_ev_name(ev), stream3_id); + sdata = get_stream_easy(cf, data, stream3_id, &stream); + if(!sdata || !stream) { + CURL_TRC_CF(data, cf, "discard event %s for unknown [%"FMT_PRId64"]", + cf_ev_name(ev), stream3_id); } else { - result = h3_process_event(cf, sdata, stream3_id, ev); - drain_stream(cf, sdata); + result = h3_process_event(cf, sdata, stream, ev); + h3_drain_stream(cf, sdata); if(result) { - CURL_TRC_CF(data, cf, "[%"PRId64"] error processing event %s " - "for [%"PRId64"] -> %d", - stream? stream->id : -1, cf_ev_name(ev), + CURL_TRC_CF(data, cf, "error processing event %s " + "for [%"FMT_PRIu64"] -> %d", cf_ev_name(ev), stream3_id, result); if(data == sdata) { /* Only report this error to the caller if it is about the @@ -560,11 +631,19 @@ static CURLcode recv_pkt(const unsigned char *pkt, size_t 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; } else if(QUICHE_ERR_TLS_FAIL == nread) { - long verify_ok = SSL_get_verify_result(ctx->tls.ssl); + 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)); @@ -651,8 +730,8 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, struct cf_quiche_ctx *ctx = cf->ctx; ssize_t nread; CURLcode result; - int64_t expiry_ns; - int64_t timeout_ns; + curl_int64_t expiry_ns; + curl_int64_t timeout_ns; struct read_ctx readx; size_t pkt_count, gsolen; @@ -660,7 +739,13 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf, if(!expiry_ns) { quiche_conn_on_timeout(ctx->qconn); if(quiche_conn_is_closed(ctx->qconn)) { - failf(data, "quiche_conn_on_timeout closed the connection"); + if(quiche_conn_is_timed_out(ctx->qconn)) + failf(data, "connection closed by idle timeout"); + else + failf(data, "connection closed by server"); + /* Connection timed out, expire all transfers belonging to it + * as will not get any more POLL events here. */ + cf_quiche_expire_conn_closed(cf, data); return CURLE_SEND_ERROR; } } @@ -725,25 +810,26 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf, struct Curl_easy *data, CURLcode *err) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_quiche_ctx *ctx = cf->ctx; + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nread = -1; DEBUGASSERT(stream); if(stream->reset) { failf(data, - "HTTP/3 stream %" PRId64 " reset by server", stream->id); - *err = stream->resp_got_header? CURLE_PARTIAL_FILE : CURLE_HTTP3; - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv, was reset -> %d", + "HTTP/3 stream %" FMT_PRIu64 " reset by server", stream->id); + *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3; + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_recv, was reset -> %d", stream->id, *err); } else if(!stream->resp_got_header) { failf(data, - "HTTP/3 stream %" PRId64 " was closed cleanly, but before getting" - " all response header fields, treated as error", + "HTTP/3 stream %" FMT_PRIu64 " was closed cleanly, but before " + "getting all response header fields, treated as error", stream->id); /* *err = CURLE_PARTIAL_FILE; */ *err = CURLE_HTTP3; - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv, closed incomplete" + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_recv, closed incomplete" " -> %d", stream->id, *err); } else { @@ -757,7 +843,7 @@ static ssize_t cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *err) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); ssize_t nread = -1; CURLcode result; @@ -771,7 +857,7 @@ static ssize_t cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(!Curl_bufq_is_empty(&stream->recvbuf)) { nread = Curl_bufq_read(&stream->recvbuf, (unsigned char *)buf, len, err); - CURL_TRC_CF(data, cf, "[%" PRId64 "] read recvbuf(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] read recvbuf(len=%zu) " "-> %zd, %d", stream->id, len, nread, *err); if(nread < 0) goto out; @@ -788,7 +874,7 @@ static ssize_t cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(nread < 0 && !Curl_bufq_is_empty(&stream->recvbuf)) { nread = Curl_bufq_read(&stream->recvbuf, (unsigned char *)buf, len, err); - CURL_TRC_CF(data, cf, "[%" PRId64 "] read recvbuf(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] read recvbuf(len=%zu) " "-> %zd, %d", stream->id, len, nread, *err); if(nread < 0) goto out; @@ -796,7 +882,7 @@ static ssize_t cf_quiche_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(nread > 0) { if(stream->closed) - drain_stream(cf, data); + h3_drain_stream(cf, data); } else { if(stream->closed) { @@ -822,25 +908,76 @@ out: } if(nread > 0) ctx->data_recvd += nread; - CURL_TRC_CF(data, cf, "[%"PRId64"] cf_recv(total=%" - CURL_FORMAT_CURL_OFF_T ") -> %zd, %d", + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] cf_recv(total=%" + FMT_OFF_T ") -> %zd, %d", stream->id, ctx->data_recvd, nread, *err); return nread; } +static ssize_t cf_quiche_send_body(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct stream_ctx *stream, + const void *buf, size_t len, bool eos, + CURLcode *err) +{ + struct cf_quiche_ctx *ctx = cf->ctx; + ssize_t nwritten; + + nwritten = quiche_h3_send_body(ctx->h3c, ctx->qconn, stream->id, + (uint8_t *)buf, len, eos); + if(nwritten == QUICHE_H3_ERR_DONE || (nwritten == 0 && len > 0)) { + /* TODO: we seem to be 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) " + "-> window exhausted", stream->id, len); + stream->quic_flow_blocked = TRUE; + } + *err = CURLE_AGAIN; + return -1; + } + else if(nwritten == QUICHE_H3_TRANSPORT_ERR_INVALID_STREAM_STATE) { + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " + "-> invalid stream state", stream->id, len); + *err = CURLE_HTTP3; + return -1; + } + else if(nwritten == QUICHE_H3_TRANSPORT_ERR_FINAL_SIZE) { + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " + "-> exceeds size", stream->id, len); + *err = CURLE_SEND_ERROR; + return -1; + } + else if(nwritten < 0) { + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " + "-> quiche err %zd", stream->id, len, nwritten); + *err = CURLE_SEND_ERROR; + return -1; + } + else { + if(eos && (len == (size_t)nwritten)) + 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); + *err = CURLE_OK; + return nwritten; + } +} + /* Index where :authority header field will appear in request header field list. */ #define AUTHORITY_DST_IDX 3 static ssize_t h3_open_stream(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, + const char *buf, size_t len, bool eos, CURLcode *err) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); size_t nheader, i; - int64_t stream3_id; + curl_int64_t stream3_id; struct dynhds h2_headers; quiche_h3_header *nva = NULL; ssize_t nwritten; @@ -850,7 +987,7 @@ static ssize_t h3_open_stream(struct Curl_cfilter *cf, if(*err) { return -1; } - stream = H3_STREAM_CTX(data); + stream = H3_STREAM_CTX(ctx, data); DEBUGASSERT(stream); } @@ -890,23 +1027,7 @@ static ssize_t h3_open_stream(struct Curl_cfilter *cf, nva[i].value_len = e->valuelen; } - switch(data->state.httpreq) { - case HTTPREQ_POST: - case HTTPREQ_POST_FORM: - case HTTPREQ_POST_MIME: - case HTTPREQ_PUT: - if(data->state.infilesize != -1) - stream->upload_left = data->state.infilesize; - else - /* data sending without specifying the data amount up front */ - stream->upload_left = -1; /* unknown */ - break; - default: - stream->upload_left = 0; /* no request body */ - break; - } - - if(stream->upload_left == 0) + if(eos && ((size_t)nwritten == len)) stream->send_closed = TRUE; stream3_id = quiche_h3_send_request(ctx->h3c, ctx->qconn, nva, nheader, @@ -915,14 +1036,14 @@ static ssize_t h3_open_stream(struct Curl_cfilter *cf, if(QUICHE_H3_ERR_STREAM_BLOCKED == stream3_id) { /* quiche seems to report this error if the connection window is * exhausted. Which happens frequently and intermittent. */ - CURL_TRC_CF(data, cf, "[%"PRId64"] blocked", stream->id); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] blocked", stream->id); stream->quic_flow_blocked = TRUE; *err = CURLE_AGAIN; nwritten = -1; goto out; } else { - CURL_TRC_CF(data, cf, "send_request(%s) -> %" PRId64, + CURL_TRC_CF(data, cf, "send_request(%s) -> %" FMT_PRIu64, data->state.url, stream3_id); } *err = CURLE_SEND_ERROR; @@ -930,22 +1051,39 @@ static ssize_t h3_open_stream(struct Curl_cfilter *cf, goto out; } - DEBUGASSERT(stream->id == -1); + DEBUGASSERT(!stream->opened); *err = CURLE_OK; stream->id = stream3_id; + stream->opened = TRUE; stream->closed = FALSE; stream->reset = FALSE; if(Curl_trc_is_verbose(data)) { - infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s", + infof(data, "[HTTP/3] [%" FMT_PRIu64 "] OPENED stream for %s", stream->id, data->state.url); for(i = 0; i < nheader; ++i) { - infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->id, + infof(data, "[HTTP/3] [%" FMT_PRIu64 "] [%.*s: %.*s]", stream->id, (int)nva[i].name_len, nva[i].name, (int)nva[i].value_len, nva[i].value); } } + if(nwritten > 0 && ((size_t)nwritten < len)) { + /* after the headers, there was request BODY data */ + size_t hds_len = (size_t)nwritten; + ssize_t bwritten; + + bwritten = cf_quiche_send_body(cf, data, stream, + buf + hds_len, len - hds_len, eos, err); + if((bwritten < 0) && (CURLE_AGAIN != *err)) { + /* real error, fail */ + nwritten = -1; + } + else if(bwritten > 0) { + nwritten += bwritten; + } + } + out: free(nva); Curl_dynhds_free(&h2_headers); @@ -953,10 +1091,11 @@ out: } static ssize_t cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) + const void *buf, size_t len, bool eos, + CURLcode *err) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); CURLcode result; ssize_t nwritten; @@ -968,11 +1107,11 @@ static ssize_t cf_quiche_send(struct Curl_cfilter *cf, struct Curl_easy *data, goto out; } - if(!stream || stream->id < 0) { - nwritten = h3_open_stream(cf, data, buf, len, err); + if(!stream || !stream->opened) { + nwritten = h3_open_stream(cf, data, buf, len, eos, err); if(nwritten < 0) goto out; - stream = H3_STREAM_CTX(data); + stream = H3_STREAM_CTX(ctx, data); } else if(stream->closed) { if(stream->resp_hds_complete) { @@ -984,70 +1123,20 @@ static ssize_t 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, "[%" PRId64 "] discarding data" + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] discarding data" "on closed stream with response", stream->id); *err = CURLE_OK; nwritten = (ssize_t)len; goto out; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] send_body(len=%zu) " "-> stream closed", stream->id, len); *err = CURLE_HTTP3; nwritten = -1; goto out; } else { - bool eof = (stream->upload_left >= 0 && - (curl_off_t)len >= stream->upload_left); - nwritten = quiche_h3_send_body(ctx->h3c, ctx->qconn, stream->id, - (uint8_t *)buf, len, eof); - if(nwritten == QUICHE_H3_ERR_DONE || (nwritten == 0 && len > 0)) { - /* TODO: we seem to be 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, "[%" PRId64 "] send_body(len=%zu) " - "-> window exhausted", stream->id, len); - stream->quic_flow_blocked = TRUE; - } - *err = CURLE_AGAIN; - nwritten = -1; - goto out; - } - else if(nwritten == QUICHE_H3_TRANSPORT_ERR_INVALID_STREAM_STATE) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " - "-> invalid stream state", stream->id, len); - *err = CURLE_HTTP3; - nwritten = -1; - goto out; - } - else if(nwritten == QUICHE_H3_TRANSPORT_ERR_FINAL_SIZE) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " - "-> exceeds size", stream->id, len); - *err = CURLE_SEND_ERROR; - nwritten = -1; - goto out; - } - else if(nwritten < 0) { - CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) " - "-> quiche err %zd", stream->id, len, nwritten); - *err = CURLE_SEND_ERROR; - nwritten = -1; - goto out; - } - else { - /* quiche accepted all or at least a part of the buf */ - if(stream->upload_left > 0) { - stream->upload_left = (nwritten < stream->upload_left)? - (stream->upload_left - nwritten) : 0; - } - if(stream->upload_left == 0) - stream->send_closed = TRUE; - - CURL_TRC_CF(data, cf, "[%" PRId64 "] send body(len=%zu, " - "left=%" CURL_FORMAT_CURL_OFF_T ") -> %zd", - stream->id, len, stream->upload_left, nwritten); - *err = CURLE_OK; - } + nwritten = cf_quiche_send_body(cf, data, stream, buf, len, eos, err); } out: @@ -1056,8 +1145,8 @@ out: *err = result; nwritten = -1; } - CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu) -> %zd, %d", - stream? stream->id : -1, len, nwritten, *err); + CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_send(len=%zu) -> %zd, %d", + stream ? stream->id : (curl_uint64_t)~0, len, nwritten, *err); return nwritten; } @@ -1065,10 +1154,10 @@ static bool stream_is_writeable(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_quiche_ctx *ctx = cf->ctx; - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); - return stream && (quiche_conn_stream_writable(ctx->qconn, - (uint64_t)stream->id, 1) > 0); + return stream && (quiche_conn_stream_writable( + ctx->qconn, (curl_uint64_t)stream->id, 1) > 0); } static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf, @@ -1083,12 +1172,12 @@ static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf, Curl_pollset_check(data, ps, ctx->q.sockfd, &want_recv, &want_send); if(want_recv || want_send) { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); bool c_exhaust, s_exhaust; c_exhaust = FALSE; /* Have not found any call in quiche that tells us if the connection itself is blocked */ - s_exhaust = want_send && stream && stream->id >= 0 && + s_exhaust = want_send && stream && stream->opened && (stream->quic_flow_blocked || !stream_is_writeable(cf, data)); want_recv = (want_recv || c_exhaust || s_exhaust); want_send = (!s_exhaust && want_send) || @@ -1105,7 +1194,8 @@ static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf, static bool cf_quiche_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { - const struct stream_ctx *stream = H3_STREAM_CTX(data); + struct cf_quiche_ctx *ctx = cf->ctx; + const struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); (void)cf; return stream && !Curl_bufq_is_empty(&stream->recvbuf); } @@ -1117,7 +1207,7 @@ static CURLcode h3_data_pause(struct Curl_cfilter *cf, /* TODO: there seems right now no API in quiche to shrink/enlarge * the streams windows. As we do in HTTP/2. */ if(!pause) { - drain_stream(cf, data); + h3_drain_stream(cf, data); Curl_expire(data, 0, EXPIRE_RUN_NOW); } return CURLE_OK; @@ -1127,6 +1217,7 @@ static CURLcode cf_quiche_data_event(struct Curl_cfilter *cf, struct Curl_easy *data, int event, int arg1, void *arg2) { + struct cf_quiche_ctx *ctx = cf->ctx; CURLcode result = CURLE_OK; (void)arg1; @@ -1144,22 +1235,21 @@ static CURLcode cf_quiche_data_event(struct Curl_cfilter *cf, h3_data_done(cf, data); break; case CF_CTRL_DATA_DONE_SEND: { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream && !stream->send_closed) { unsigned char body[1]; ssize_t sent; stream->send_closed = TRUE; - stream->upload_left = 0; body[0] = 'X'; - sent = cf_quiche_send(cf, data, body, 0, &result); - CURL_TRC_CF(data, cf, "[%"PRId64"] DONE_SEND -> %zd, %d", + sent = cf_quiche_send(cf, data, body, 0, TRUE, &result); + CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] DONE_SEND -> %zd, %d", stream->id, sent, result); } break; } case CF_CTRL_DATA_IDLE: { - struct stream_ctx *stream = H3_STREAM_CTX(data); + struct stream_ctx *stream = H3_STREAM_CTX(ctx, data); if(stream && !stream->closed) { result = cf_flush_egress(cf, data); if(result) @@ -1173,8 +1263,8 @@ static CURLcode cf_quiche_data_event(struct Curl_cfilter *cf, return result; } -static CURLcode cf_connect_start(struct Curl_cfilter *cf, - struct Curl_easy *data) +static CURLcode cf_quiche_ctx_open(struct Curl_cfilter *cf, + struct Curl_easy *data) { struct cf_quiche_ctx *ctx = cf->ctx; int rv; @@ -1182,35 +1272,23 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, const struct Curl_sockaddr_ex *sockaddr; DEBUGASSERT(ctx->q.sockfd != CURL_SOCKET_BAD); - -#ifdef DEBUG_QUICHE - /* initialize debug log callback only once */ - static int debug_log_init = 0; - if(!debug_log_init) { - quiche_enable_debug_logging(quiche_debug_log, NULL); - debug_log_init = 1; - } -#endif - ctx->max_idle_ms = CURL_QUIC_MAX_IDLE_MS; - Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, - H3_STREAM_POOL_SPARES); - ctx->data_recvd = 0; + DEBUGASSERT(ctx->initialized); result = vquic_ctx_init(&ctx->q); if(result) return result; - result = Curl_ssl_peer_init(&ctx->peer, cf); + result = Curl_ssl_peer_init(&ctx->peer, cf, TRNSPRT_QUIC); if(result) return result; ctx->cfg = quiche_config_new(QUICHE_PROTOCOL_VERSION); if(!ctx->cfg) { - failf(data, "can't create quiche config"); + failf(data, "cannot create quiche config"); return CURLE_FAILED_INIT; } - quiche_config_enable_pacing(ctx->cfg, false); - quiche_config_set_max_idle_timeout(ctx->cfg, ctx->max_idle_ms * 1000); + quiche_config_enable_pacing(ctx->cfg, FALSE); + quiche_config_set_max_idle_timeout(ctx->cfg, CURL_QUIC_MAX_IDLE_MS); quiche_config_set_initial_max_data(ctx->cfg, (1 * 1024 * 1024) /* (QUIC_MAX_STREAMS/2) * H3_STREAM_WINDOW_SIZE */); quiche_config_set_initial_max_streams_bidi(ctx->cfg, QUIC_MAX_STREAMS); @@ -1235,7 +1313,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, result = Curl_vquic_tls_init(&ctx->tls, cf, data, &ctx->peer, QUICHE_H3_APPLICATION_PROTOCOL, sizeof(QUICHE_H3_APPLICATION_PROTOCOL) - 1, - NULL, cf); + NULL, NULL, cf); if(result) return result; @@ -1243,8 +1321,7 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, if(result) return result; - Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, - &sockaddr, NULL, NULL, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, &sockaddr, NULL); ctx->q.local_addrlen = sizeof(ctx->q.local_addr); rv = getsockname(ctx->q.sockfd, (struct sockaddr *)&ctx->q.local_addr, &ctx->q.local_addrlen); @@ -1252,13 +1329,14 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, return CURLE_QUIC_CONNECT_ERROR; ctx->qconn = quiche_conn_new_with_tls((const uint8_t *)ctx->scid, - sizeof(ctx->scid), NULL, 0, - (struct sockaddr *)&ctx->q.local_addr, - ctx->q.local_addrlen, - &sockaddr->sa_addr, sockaddr->addrlen, - ctx->cfg, ctx->tls.ssl, false); + sizeof(ctx->scid), NULL, 0, + (struct sockaddr *)&ctx->q.local_addr, + ctx->q.local_addrlen, + &sockaddr->curl_sa_addr, + sockaddr->addrlen, + ctx->cfg, ctx->tls.ossl.ssl, FALSE); if(!ctx->qconn) { - failf(data, "can't create quiche connection"); + failf(data, "cannot create quiche connection"); return CURLE_OUT_OF_MEMORY; } @@ -1302,7 +1380,6 @@ static CURLcode cf_quiche_verify_peer(struct Curl_cfilter *cf, cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ cf->conn->httpversion = 30; - cf->conn->bundle->multiuse = BUNDLE_MULTIPLEX; return Curl_vquic_tls_verify_peer(&ctx->tls, cf, data, &ctx->peer); } @@ -1329,15 +1406,8 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf, *done = FALSE; vquic_ctx_update_time(&ctx->q); - if(ctx->reconnect_at.tv_sec && - Curl_timediff(ctx->q.last_op, ctx->reconnect_at) < 0) { - /* Not time yet to attempt the next connect */ - CURL_TRC_CF(data, cf, "waiting for reconnect time"); - goto out; - } - if(!ctx->qconn) { - result = cf_connect_start(cf, data); + result = cf_quiche_ctx_open(cf, data); if(result) goto out; ctx->started_at = ctx->q.last_op; @@ -1390,42 +1460,79 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf, out: #ifndef CURL_DISABLE_VERBOSE_STRINGS if(result && result != CURLE_AGAIN) { - const char *r_ip; - int r_port; + struct ip_quadruple ip; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); infof(data, "connect to %s port %u failed: %s", - r_ip, r_port, curl_easy_strerror(result)); + ip.remote_ip, ip.remote_port, curl_easy_strerror(result)); } #endif return result; } -static void cf_quiche_close(struct Curl_cfilter *cf, struct Curl_easy *data) +static CURLcode cf_quiche_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, bool *done) { struct cf_quiche_ctx *ctx = cf->ctx; + CURLcode result = CURLE_OK; - if(ctx) { - if(ctx->qconn) { - vquic_ctx_update_time(&ctx->q); - (void)quiche_conn_close(ctx->qconn, TRUE, 0, NULL, 0); - /* flushing the egress is not a failsafe way to deliver all the - outstanding packets, but we also don't want to get stuck here... */ - (void)cf_flush_egress(cf, data); + if(cf->shutdown || !ctx || !ctx->qconn) { + *done = TRUE; + return CURLE_OK; + } + + *done = FALSE; + if(!ctx->shutdown_started) { + int err; + + ctx->shutdown_started = TRUE; + vquic_ctx_update_time(&ctx->q); + err = quiche_conn_close(ctx->qconn, TRUE, 0, NULL, 0); + if(err) { + CURL_TRC_CF(data, cf, "error %d adding shutdown packet, " + "aborting shutdown", err); + result = CURLE_SEND_ERROR; + goto out; } - cf_quiche_ctx_clear(ctx); + } + + if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) { + CURL_TRC_CF(data, cf, "shutdown, flushing sendbuf"); + result = cf_flush_egress(cf, data); + if(result) + goto out; + } + + if(Curl_bufq_is_empty(&ctx->q.sendbuf)) { + /* sent everything, quiche does not seem to support a graceful + * shutdown waiting for a reply, so ware done. */ + CURL_TRC_CF(data, cf, "shutdown completely sent off, done"); + *done = TRUE; + } + else { + CURL_TRC_CF(data, cf, "shutdown sending blocked"); + } + +out: + return result; +} + +static void cf_quiche_close(struct Curl_cfilter *cf, struct Curl_easy *data) +{ + if(cf->ctx) { + bool done; + (void)cf_quiche_shutdown(cf, data, &done); + cf_quiche_ctx_close(cf->ctx); } } static void cf_quiche_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) { - struct cf_quiche_ctx *ctx = cf->ctx; - (void)data; - cf_quiche_ctx_clear(ctx); - free(ctx); - cf->ctx = NULL; + if(cf->ctx) { + cf_quiche_ctx_free(cf->ctx); + cf->ctx = NULL; + } } static CURLcode cf_quiche_query(struct Curl_cfilter *cf, @@ -1436,18 +1543,20 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf, switch(query) { case CF_QUERY_MAX_CONCURRENT: { - uint64_t max_streams = CONN_INUSE(cf->conn); + curl_uint64_t max_streams = CONN_INUSE(cf->conn); if(!ctx->goaway) { 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: MAX_CONCURRENT -> %d", *pres1); + *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams; + CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: " + "MAX_CONCURRENT -> %d (%zu in use)", + cf->conn->connection_id, *pres1, CONN_INUSE(cf->conn)); return CURLE_OK; } case CF_QUERY_CONNECT_REPLY_MS: if(ctx->q.got_first_byte) { timediff_t ms = Curl_timediff(ctx->q.first_byte_at, ctx->started_at); - *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX; + *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; } else *pres1 = -1; @@ -1467,7 +1576,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf, default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -1483,31 +1592,20 @@ static bool cf_quiche_conn_is_alive(struct Curl_cfilter *cf, if(!ctx->qconn) return FALSE; - /* Both sides of the QUIC connection announce they max idle times in - * the transport parameters. Look at the minimum of both and if - * we exceed this, regard the connection as dead. The other side - * may have completely purged it and will no longer respond - * to any packets from us. */ - { - quiche_transport_params qpeerparams; - timediff_t idletime; - uint64_t idle_ms = ctx->max_idle_ms; - - if(quiche_conn_peer_transport_params(ctx->qconn, &qpeerparams) && - qpeerparams.peer_max_idle_timeout && - qpeerparams.peer_max_idle_timeout < idle_ms) - idle_ms = qpeerparams.peer_max_idle_timeout; - idletime = Curl_timediff(Curl_now(), cf->conn->lastused); - if(idletime > 0 && (uint64_t)idletime > idle_ms) - return FALSE; + if(quiche_conn_is_closed(ctx->qconn)) { + if(quiche_conn_is_timed_out(ctx->qconn)) + CURL_TRC_CF(data, cf, "connection was closed due to idle timeout"); + else + CURL_TRC_CF(data, cf, "connection is closed"); + return FALSE; } if(!cf->next || !cf->next->cft->is_alive(cf->next, data, input_pending)) return FALSE; if(*input_pending) { - /* This happens before we've sent off a request and the connection is - not in use by any other transfer, there shouldn't be any data here, + /* This happens before we have sent off a request and the connection is + not in use by any other transfer, there should not be any data here, only "protocol frames" */ *input_pending = FALSE; if(cf_process_ingress(cf, data)) @@ -1527,6 +1625,7 @@ struct Curl_cftype Curl_cft_http3 = { cf_quiche_destroy, cf_quiche_connect, cf_quiche_close, + cf_quiche_shutdown, Curl_cf_def_get_host, cf_quiche_adjust_pollset, cf_quiche_data_pending, @@ -1554,6 +1653,7 @@ CURLcode Curl_cf_quiche_create(struct Curl_cfilter **pcf, result = CURLE_OUT_OF_MEMORY; goto out; } + cf_quiche_ctx_init(ctx); result = Curl_cf_create(&cf, &Curl_cft_http3, ctx); if(result) @@ -1568,12 +1668,12 @@ CURLcode Curl_cf_quiche_create(struct Curl_cfilter **pcf, cf->next = udp_cf; out: - *pcf = (!result)? cf : NULL; + *pcf = (!result) ? cf : NULL; if(result) { if(udp_cf) Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE); Curl_safefree(cf); - Curl_safefree(ctx); + cf_quiche_ctx_free(ctx); } return result; @@ -1583,7 +1683,7 @@ bool Curl_conn_is_quiche(const struct Curl_easy *data, const struct connectdata *conn, int sockindex) { - struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL; + struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; (void)data; for(; cf; cf = cf->next) { diff --git a/deps/curl/lib/vquic/vquic-tls.c b/deps/curl/lib/vquic/vquic-tls.c index cc7794e4..580e5707 100644 --- a/deps/curl/lib/vquic/vquic-tls.c +++ b/deps/curl/lib/vquic/vquic-tls.c @@ -24,7 +24,7 @@ #include "curl_setup.h" -#if defined(ENABLE_QUIC) && \ +#if defined(USE_HTTP3) && \ (defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_WOLFSSL)) #ifdef USE_OPENSSL @@ -61,277 +61,12 @@ #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) #endif -#ifdef USE_OPENSSL -#define QUIC_CIPHERS \ - "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_" \ - "POLY1305_SHA256:TLS_AES_128_CCM_SHA256" -#define QUIC_GROUPS "P-256:X25519:P-384:P-521" -#elif defined(USE_GNUTLS) -#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:" \ - "%DISABLE_TLS13_COMPAT_MODE" -#elif defined(USE_WOLFSSL) +#if defined(USE_WOLFSSL) + #define QUIC_CIPHERS \ "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_" \ "POLY1305_SHA256:TLS_AES_128_CCM_SHA256" #define QUIC_GROUPS "P-256:P-384:P-521" -#endif - - -#ifdef USE_OPENSSL - -static void keylog_callback(const SSL *ssl, const char *line) -{ - (void)ssl; - Curl_tls_keylog_write_line(line); -} - -static CURLcode curl_ossl_init_ctx(struct quic_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data, - Curl_vquic_tls_ctx_setup *ctx_setup) -{ - struct ssl_primary_config *conn_config; - CURLcode result = CURLE_FAILED_INIT; - - DEBUGASSERT(!ctx->ssl_ctx); -#ifdef USE_OPENSSL_QUIC - ctx->ssl_ctx = SSL_CTX_new(OSSL_QUIC_client_method()); -#else - ctx->ssl_ctx = SSL_CTX_new(TLS_method()); -#endif - if(!ctx->ssl_ctx) { - result = CURLE_OUT_OF_MEMORY; - goto out; - } - conn_config = Curl_ssl_cf_get_primary_config(cf); - if(!conn_config) { - result = CURLE_FAILED_INIT; - goto out; - } - - if(ctx_setup) { - result = ctx_setup(ctx, cf, data); - if(result) - goto out; - } - - SSL_CTX_set_default_verify_paths(ctx->ssl_ctx); - - { - const char *curves = conn_config->curves ? - conn_config->curves : QUIC_GROUPS; - if(!SSL_CTX_set1_curves_list(ctx->ssl_ctx, curves)) { - failf(data, "failed setting curves list for QUIC: '%s'", curves); - return CURLE_SSL_CIPHER; - } - } - -#ifndef OPENSSL_IS_BORINGSSL - { - const char *ciphers13 = conn_config->cipher_list13 ? - conn_config->cipher_list13 : QUIC_CIPHERS; - if(SSL_CTX_set_ciphersuites(ctx->ssl_ctx, ciphers13) != 1) { - failf(data, "failed setting QUIC cipher suite: %s", ciphers13); - return CURLE_SSL_CIPHER; - } - infof(data, "QUIC cipher selection: %s", ciphers13); - } -#endif - - /* Open the file if a TLS or QUIC backend has not done this before. */ - Curl_tls_keylog_open(); - if(Curl_tls_keylog_enabled()) { - SSL_CTX_set_keylog_callback(ctx->ssl_ctx, keylog_callback); - } - - /* OpenSSL always tries to verify the peer, this only says whether it should - * fail to connect if the verification fails, or if it should continue - * anyway. In the latter case the result of the verification is checked with - * SSL_get_verify_result() below. */ - SSL_CTX_set_verify(ctx->ssl_ctx, conn_config->verifypeer ? - SSL_VERIFY_PEER : SSL_VERIFY_NONE, NULL); - - /* give application a chance to interfere with SSL set up. */ - if(data->set.ssl.fsslctx) { - /* When a user callback is installed to modify the SSL_CTX, - * we need to do the full initialization before calling it. - * See: #11800 */ - if(!ctx->x509_store_setup) { - result = Curl_ssl_setup_x509_store(cf, data, ctx->ssl_ctx); - if(result) - goto out; - ctx->x509_store_setup = TRUE; - } - Curl_set_in_callback(data, true); - result = (*data->set.ssl.fsslctx)(data, ctx->ssl_ctx, - data->set.ssl.fsslctxp); - Curl_set_in_callback(data, false); - if(result) { - failf(data, "error signaled by ssl ctx callback"); - goto out; - } - } - result = CURLE_OK; - -out: - if(result && ctx->ssl_ctx) { - SSL_CTX_free(ctx->ssl_ctx); - ctx->ssl_ctx = NULL; - } - return result; -} - -static CURLcode curl_ossl_set_client_cert(struct quic_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - SSL_CTX *ssl_ctx = ctx->ssl_ctx; - const struct ssl_config_data *ssl_config; - - ssl_config = Curl_ssl_cf_get_config(cf, data); - DEBUGASSERT(ssl_config); - - if(ssl_config->primary.clientcert || - ssl_config->primary.cert_blob || - ssl_config->cert_type) { - return Curl_ossl_set_client_cert( - data, ssl_ctx, ssl_config->primary.clientcert, - ssl_config->primary.cert_blob, ssl_config->cert_type, - ssl_config->key, ssl_config->key_blob, - ssl_config->key_type, ssl_config->key_passwd); - } - - return CURLE_OK; -} - -/** SSL callbacks ***/ - -static CURLcode curl_ossl_init_ssl(struct quic_tls_ctx *ctx, - struct Curl_easy *data, - struct ssl_peer *peer, - const char *alpn, size_t alpn_len, - void *user_data) -{ - DEBUGASSERT(!ctx->ssl); - ctx->ssl = SSL_new(ctx->ssl_ctx); - - SSL_set_app_data(ctx->ssl, user_data); - SSL_set_connect_state(ctx->ssl); -#ifndef USE_OPENSSL_QUIC - SSL_set_quic_use_legacy_codepoint(ctx->ssl, 0); -#endif - - if(alpn) - SSL_set_alpn_protos(ctx->ssl, (const uint8_t *)alpn, (int)alpn_len); - - if(peer->sni) { - if(!SSL_set_tlsext_host_name(ctx->ssl, peer->sni)) { - failf(data, "Failed set SNI"); - SSL_free(ctx->ssl); - ctx->ssl = NULL; - return CURLE_QUIC_CONNECT_ERROR; - } - } - return CURLE_OK; -} - -#elif defined(USE_GNUTLS) -static int keylog_callback(gnutls_session_t session, const char *label, - const gnutls_datum_t *secret) -{ - gnutls_datum_t crandom; - gnutls_datum_t srandom; - - gnutls_session_get_random(session, &crandom, &srandom); - if(crandom.size != 32) { - return -1; - } - - Curl_tls_keylog_write(label, crandom.data, secret->data, secret->size); - return 0; -} - -static CURLcode curl_gtls_init_ctx(struct quic_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data, - struct ssl_peer *peer, - const char *alpn, size_t alpn_len, - Curl_vquic_tls_ctx_setup *ctx_setup, - void *user_data) -{ - struct ssl_primary_config *conn_config; - CURLcode result; - gnutls_datum_t alpns[5]; - /* this will need some attention when HTTPS proxy over QUIC get fixed */ - long * const pverifyresult = &data->set.ssl.certverifyresult; - int rc; - - conn_config = Curl_ssl_cf_get_primary_config(cf); - if(!conn_config) - return CURLE_FAILED_INIT; - - DEBUGASSERT(ctx->gtls == NULL); - ctx->gtls = calloc(1, sizeof(*(ctx->gtls))); - if(!ctx->gtls) - return CURLE_OUT_OF_MEMORY; - - result = gtls_client_init(data, conn_config, &data->set.ssl, - peer, ctx->gtls, pverifyresult); - if(result) - return result; - - gnutls_session_set_ptr(ctx->gtls->session, user_data); - - if(ctx_setup) { - result = ctx_setup(ctx, cf, data); - if(result) - return result; - } - - rc = gnutls_priority_set_direct(ctx->gtls->session, QUIC_PRIORITY, NULL); - if(rc < 0) { - CURL_TRC_CF(data, cf, "gnutls_priority_set_direct failed: %s\n", - gnutls_strerror(rc)); - return CURLE_QUIC_CONNECT_ERROR; - } - - /* Open the file if a TLS or QUIC backend has not done this before. */ - Curl_tls_keylog_open(); - if(Curl_tls_keylog_enabled()) { - gnutls_session_set_keylog_function(ctx->gtls->session, keylog_callback); - } - - /* convert the ALPN string from our arguments to a list of strings - * that gnutls wants and will convert internally back to this very - * string for sending to the server. nice. */ - if(alpn) { - size_t i, alen = alpn_len; - unsigned char *s = (unsigned char *)alpn; - unsigned char slen; - for(i = 0; (i < ARRAYSIZE(alpns)) && alen; ++i) { - slen = s[0]; - if(slen >= alen) - return CURLE_FAILED_INIT; - alpns[i].data = s + 1; - alpns[i].size = slen; - s += slen + 1; - alen -= (size_t)slen + 1; - } - if(alen) /* not all alpn chars used, wrong format or too many */ - return CURLE_FAILED_INIT; - if(i) { - gnutls_alpn_set_protocols(ctx->gtls->session, - alpns, (unsigned int)i, - GNUTLS_ALPN_MANDATORY); - } - } - - return CURLE_OK; -} -#elif defined(USE_WOLFSSL) #if defined(HAVE_SECRET_CALLBACK) static void keylog_callback(const WOLFSSL *ssl, const char *line) @@ -341,10 +76,11 @@ static void keylog_callback(const WOLFSSL *ssl, const char *line) } #endif -static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data, - Curl_vquic_tls_ctx_setup *ctx_setup) +static CURLcode wssl_init_ctx(struct curl_tls_ctx *ctx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + Curl_vquic_tls_ctx_setup *cb_setup, + void *cb_user_data) { struct ssl_primary_config *conn_config; CURLcode result = CURLE_FAILED_INIT; @@ -355,33 +91,35 @@ static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, goto out; } - ctx->ssl_ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method()); - if(!ctx->ssl_ctx) { + ctx->wssl.ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method()); + if(!ctx->wssl.ctx) { result = CURLE_OUT_OF_MEMORY; goto out; } - if(ctx_setup) { - result = ctx_setup(ctx, cf, data); + if(cb_setup) { + result = cb_setup(cf, data, cb_user_data); if(result) goto out; } - wolfSSL_CTX_set_default_verify_paths(ctx->ssl_ctx); + wolfSSL_CTX_set_default_verify_paths(ctx->wssl.ctx); - if(wolfSSL_CTX_set_cipher_list(ctx->ssl_ctx, conn_config->cipher_list13 ? + if(wolfSSL_CTX_set_cipher_list(ctx->wssl.ctx, conn_config->cipher_list13 ? conn_config->cipher_list13 : QUIC_CIPHERS) != 1) { char error_buffer[256]; ERR_error_string_n(ERR_get_error(), error_buffer, sizeof(error_buffer)); failf(data, "wolfSSL failed to set ciphers: %s", error_buffer); + result = CURLE_BAD_FUNCTION_ARGUMENT; goto out; } - if(wolfSSL_CTX_set1_groups_list(ctx->ssl_ctx, conn_config->curves ? + if(wolfSSL_CTX_set1_groups_list(ctx->wssl.ctx, conn_config->curves ? conn_config->curves : (char *)QUIC_GROUPS) != 1) { failf(data, "wolfSSL failed to set curves"); + result = CURLE_BAD_FUNCTION_ARGUMENT; goto out; } @@ -389,9 +127,10 @@ static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, Curl_tls_keylog_open(); if(Curl_tls_keylog_enabled()) { #if defined(HAVE_SECRET_CALLBACK) - wolfSSL_CTX_set_keylog_callback(ctx->ssl_ctx, keylog_callback); + wolfSSL_CTX_set_keylog_callback(ctx->wssl.ctx, keylog_callback); #else failf(data, "wolfSSL was built without keylog callback"); + result = CURLE_NOT_BUILT_IN; goto out; #endif } @@ -400,12 +139,12 @@ static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, const char * const ssl_cafile = conn_config->CAfile; const char * const ssl_capath = conn_config->CApath; - wolfSSL_CTX_set_verify(ctx->ssl_ctx, SSL_VERIFY_PEER, NULL); + wolfSSL_CTX_set_verify(ctx->wssl.ctx, SSL_VERIFY_PEER, NULL); if(ssl_cafile || ssl_capath) { /* tell wolfSSL where to find CA certificates that are used to verify the server's certificate. */ int rc = - wolfSSL_CTX_load_verify_locations_ex(ctx->ssl_ctx, ssl_cafile, + wolfSSL_CTX_load_verify_locations_ex(ctx->wssl.ctx, ssl_cafile, ssl_capath, WOLFSSL_LOAD_FLAG_IGNORE_ERR); if(SSL_SUCCESS != rc) { @@ -414,6 +153,7 @@ static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, " CAfile: %s CApath: %s", ssl_cafile ? ssl_cafile : "none", ssl_capath ? ssl_capath : "none"); + result = CURLE_SSL_CACERT_BADFILE; goto out; } infof(data, " CAfile: %s", ssl_cafile ? ssl_cafile : "none"); @@ -421,22 +161,22 @@ static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, } #ifdef CURL_CA_FALLBACK else { - /* verifying the peer without any CA certificates won't work so - use wolfssl's built-in default as fallback */ - wolfSSL_CTX_set_default_verify_paths(ctx->ssl_ctx); + /* verifying the peer without any CA certificates will not work so + use wolfSSL's built-in default as fallback */ + wolfSSL_CTX_set_default_verify_paths(ctx->wssl.ctx); } #endif } else { - wolfSSL_CTX_set_verify(ctx->ssl_ctx, SSL_VERIFY_NONE, NULL); + wolfSSL_CTX_set_verify(ctx->wssl.ctx, SSL_VERIFY_NONE, NULL); } /* give application a chance to interfere with SSL set up. */ if(data->set.ssl.fsslctx) { - Curl_set_in_callback(data, true); - result = (*data->set.ssl.fsslctx)(data, ctx->ssl_ctx, + Curl_set_in_callback(data, TRUE); + result = (*data->set.ssl.fsslctx)(data, ctx->wssl.ctx, data->set.ssl.fsslctxp); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(result) { failf(data, "error signaled by ssl ctx callback"); goto out; @@ -445,113 +185,123 @@ static CURLcode curl_wssl_init_ctx(struct quic_tls_ctx *ctx, result = CURLE_OK; out: - if(result && ctx->ssl_ctx) { - SSL_CTX_free(ctx->ssl_ctx); - ctx->ssl_ctx = NULL; + if(result && ctx->wssl.ctx) { + SSL_CTX_free(ctx->wssl.ctx); + ctx->wssl.ctx = NULL; } return result; } /** SSL callbacks ***/ -static CURLcode curl_wssl_init_ssl(struct quic_tls_ctx *ctx, - struct Curl_easy *data, - struct ssl_peer *peer, - const char *alpn, size_t alpn_len, - void *user_data) +static CURLcode wssl_init_ssl(struct curl_tls_ctx *ctx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + const char *alpn, size_t alpn_len, + void *user_data) { - (void)data; - DEBUGASSERT(!ctx->ssl); - DEBUGASSERT(ctx->ssl_ctx); - ctx->ssl = wolfSSL_new(ctx->ssl_ctx); + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - wolfSSL_set_app_data(ctx->ssl, user_data); - wolfSSL_set_connect_state(ctx->ssl); - wolfSSL_set_quic_use_legacy_codepoint(ctx->ssl, 0); + DEBUGASSERT(!ctx->wssl.handle); + DEBUGASSERT(ctx->wssl.ctx); + ctx->wssl.handle = wolfSSL_new(ctx->wssl.ctx); + + wolfSSL_set_app_data(ctx->wssl.handle, user_data); + wolfSSL_set_connect_state(ctx->wssl.handle); + wolfSSL_set_quic_use_legacy_codepoint(ctx->wssl.handle, 0); if(alpn) - wolfSSL_set_alpn_protos(ctx->ssl, (const unsigned char *)alpn, - (int)alpn_len); + wolfSSL_set_alpn_protos(ctx->wssl.handle, (const unsigned char *)alpn, + (unsigned int)alpn_len); if(peer->sni) { - wolfSSL_UseSNI(ctx->ssl, WOLFSSL_SNI_HOST_NAME, + wolfSSL_UseSNI(ctx->wssl.handle, WOLFSSL_SNI_HOST_NAME, peer->sni, (unsigned short)strlen(peer->sni)); } + if(ssl_config->primary.cache_session) { + (void)wssl_setup_session(cf, data, &ctx->wssl, peer); + } + return CURLE_OK; } #endif /* defined(USE_WOLFSSL) */ -CURLcode Curl_vquic_tls_init(struct quic_tls_ctx *ctx, +CURLcode Curl_vquic_tls_init(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data, struct ssl_peer *peer, const char *alpn, size_t alpn_len, - Curl_vquic_tls_ctx_setup *ctx_setup, - void *user_data) + Curl_vquic_tls_ctx_setup *cb_setup, + void *cb_user_data, void *ssl_user_data) { CURLcode result; #ifdef USE_OPENSSL - result = curl_ossl_init_ctx(ctx, cf, data, ctx_setup); - if(result) - return result; - - result = curl_ossl_set_client_cert(ctx, cf, data); - if(result) - return result; - - return curl_ossl_init_ssl(ctx, data, peer, alpn, alpn_len, user_data); + (void)result; + return Curl_ossl_ctx_init(&ctx->ossl, cf, data, peer, TRNSPRT_QUIC, + (const unsigned char *)alpn, alpn_len, + cb_setup, cb_user_data, NULL, ssl_user_data); #elif defined(USE_GNUTLS) (void)result; - return curl_gtls_init_ctx(ctx, cf, data, peer, alpn, alpn_len, - ctx_setup, user_data); + return Curl_gtls_ctx_init(&ctx->gtls, cf, data, peer, + (const unsigned char *)alpn, alpn_len, NULL, + cb_setup, cb_user_data, ssl_user_data); #elif defined(USE_WOLFSSL) - result = curl_wssl_init_ctx(ctx, cf, data, ctx_setup); + result = wssl_init_ctx(ctx, cf, data, cb_setup, cb_user_data); if(result) return result; - return curl_wssl_init_ssl(ctx, data, peer, alpn, alpn_len, user_data); + return wssl_init_ssl(ctx, cf, data, peer, alpn, alpn_len, ssl_user_data); #else #error "no TLS lib in used, should not happen" return CURLE_FAILED_INIT; #endif } -void Curl_vquic_tls_cleanup(struct quic_tls_ctx *ctx) +void Curl_vquic_tls_cleanup(struct curl_tls_ctx *ctx) { #ifdef USE_OPENSSL - if(ctx->ssl) - SSL_free(ctx->ssl); - if(ctx->ssl_ctx) - SSL_CTX_free(ctx->ssl_ctx); + if(ctx->ossl.ssl) + SSL_free(ctx->ossl.ssl); + if(ctx->ossl.ssl_ctx) + SSL_CTX_free(ctx->ossl.ssl_ctx); #elif defined(USE_GNUTLS) - if(ctx->gtls) { - if(ctx->gtls->cred) - gnutls_certificate_free_credentials(ctx->gtls->cred); - if(ctx->gtls->session) - gnutls_deinit(ctx->gtls->session); - free(ctx->gtls); - } + if(ctx->gtls.session) + gnutls_deinit(ctx->gtls.session); + Curl_gtls_shared_creds_free(&ctx->gtls.shared_creds); #elif defined(USE_WOLFSSL) - if(ctx->ssl) - wolfSSL_free(ctx->ssl); - if(ctx->ssl_ctx) - wolfSSL_CTX_free(ctx->ssl_ctx); + if(ctx->wssl.handle) + wolfSSL_free(ctx->wssl.handle); + if(ctx->wssl.ctx) + wolfSSL_CTX_free(ctx->wssl.ctx); #endif memset(ctx, 0, sizeof(*ctx)); } -CURLcode Curl_vquic_tls_before_recv(struct quic_tls_ctx *ctx, +CURLcode Curl_vquic_tls_before_recv(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data) { #ifdef USE_OPENSSL - if(!ctx->x509_store_setup) { - CURLcode result = Curl_ssl_setup_x509_store(cf, data, ctx->ssl_ctx); + if(!ctx->ossl.x509_store_setup) { + CURLcode result = Curl_ssl_setup_x509_store(cf, data, ctx->ossl.ssl_ctx); + if(result) + return result; + ctx->ossl.x509_store_setup = TRUE; + } +#elif defined(USE_WOLFSSL) + if(!ctx->wssl.x509_store_setup) { + CURLcode result = Curl_wssl_setup_x509_store(cf, data, &ctx->wssl); + if(result) + return result; + } +#elif defined(USE_GNUTLS) + if(!ctx->gtls.shared_creds->trust_setup) { + CURLcode result = Curl_gtls_client_trust_setup(cf, data, &ctx->gtls); if(result) return result; - ctx->x509_store_setup = TRUE; } #else (void)ctx; (void)cf; (void)data; @@ -559,7 +309,7 @@ CURLcode Curl_vquic_tls_before_recv(struct quic_tls_ctx *ctx, return CURLE_OK; } -CURLcode Curl_vquic_tls_verify_peer(struct quic_tls_ctx *ctx, +CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data, struct ssl_peer *peer) @@ -571,39 +321,33 @@ CURLcode Curl_vquic_tls_verify_peer(struct quic_tls_ctx *ctx, if(!conn_config) return CURLE_FAILED_INIT; - if(conn_config->verifyhost) { #ifdef USE_OPENSSL - X509 *server_cert; - server_cert = SSL_get1_peer_certificate(ctx->ssl); - if(!server_cert) { - return CURLE_PEER_FAILED_VERIFICATION; - } - result = Curl_ossl_verifyhost(data, cf->conn, peer, server_cert); - X509_free(server_cert); - if(result) - return result; + (void)conn_config; + result = Curl_oss_check_peer_cert(cf, data, &ctx->ossl, peer); #elif defined(USE_GNUTLS) - result = Curl_gtls_verifyserver(data, ctx->gtls->session, + if(conn_config->verifyhost) { + result = Curl_gtls_verifyserver(data, ctx->gtls.session, conn_config, &data->set.ssl, peer, data->set.str[STRING_SSL_PINNEDPUBLICKEY]); if(result) return result; -#elif defined(USE_WOLFSSL) - if(!peer->sni || - wolfSSL_check_domain_name(ctx->ssl, peer->sni) == SSL_FAILURE) - return CURLE_PEER_FAILED_VERIFICATION; -#endif - infof(data, "Verified certificate just fine"); } - else - infof(data, "Skipped certificate verification"); -#ifdef USE_OPENSSL - if(data->set.ssl.certinfo) - /* asked to gather certificate info */ - (void)Curl_ossl_certchain(data, ctx->ssl); +#elif defined(USE_WOLFSSL) + (void)data; + if(conn_config->verifyhost) { + if(peer->sni) { + WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(ctx->wssl.handle); + if(wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, NULL) + == WOLFSSL_FAILURE) { + result = CURLE_PEER_FAILED_VERIFICATION; + } + wolfSSL_X509_free(cert); + } + + } #endif return result; } -#endif /* !ENABLE_QUIC && (USE_OPENSSL || USE_GNUTLS || USE_WOLFSSL) */ +#endif /* !USE_HTTP3 && (USE_OPENSSL || USE_GNUTLS || USE_WOLFSSL) */ diff --git a/deps/curl/lib/vquic/vquic-tls.h b/deps/curl/lib/vquic/vquic-tls.h index 9c0dfd8d..969acad4 100644 --- a/deps/curl/lib/vquic/vquic-tls.h +++ b/deps/curl/lib/vquic/vquic-tls.h @@ -26,21 +26,21 @@ #include "curl_setup.h" #include "bufq.h" +#include "vtls/openssl.h" -#if defined(ENABLE_QUIC) && \ +#if defined(USE_HTTP3) && \ (defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_WOLFSSL)) -struct quic_tls_ctx { +#include "vtls/wolfssl.h" + +struct curl_tls_ctx { #ifdef USE_OPENSSL - SSL_CTX *ssl_ctx; - SSL *ssl; + struct ossl_ctx ossl; #elif defined(USE_GNUTLS) - struct gtls_instance *gtls; + struct gtls_ctx gtls; #elif defined(USE_WOLFSSL) - WOLFSSL_CTX *ssl_ctx; - WOLFSSL *ssl; + struct wolfssl_ctx wssl; #endif - BIT(x509_store_setup); /* if x509 store has been set up */ }; /** @@ -50,9 +50,9 @@ struct quic_tls_ctx { * - openssl/wolfssl: SSL_CTX* has just been created * - gnutls: gtls_client_init() has run */ -typedef CURLcode Curl_vquic_tls_ctx_setup(struct quic_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data); +typedef CURLcode Curl_vquic_tls_ctx_setup(struct Curl_cfilter *cf, + struct Curl_easy *data, + void *cb_user_data); /** * Initialize the QUIC TLS instances based of the SSL configurations @@ -64,23 +64,25 @@ typedef CURLcode Curl_vquic_tls_ctx_setup(struct quic_tls_ctx *ctx, * @param alpn the ALPN string in protocol format ((len+bytes+)+), * may be NULL * @param alpn_len the overall number of bytes in `alpn` - * @param ctx_setup optional callback for very early TLS config - * @param user_data optional pointer to set in TLS application context + * @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 */ -CURLcode Curl_vquic_tls_init(struct quic_tls_ctx *ctx, +CURLcode Curl_vquic_tls_init(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data, struct ssl_peer *peer, const char *alpn, size_t alpn_len, - Curl_vquic_tls_ctx_setup *ctx_setup, - void *user_data); + Curl_vquic_tls_ctx_setup *cb_setup, + void *cb_user_data, + void *ssl_user_data); /** * Cleanup all data that has been initialized. */ -void Curl_vquic_tls_cleanup(struct quic_tls_ctx *ctx); +void Curl_vquic_tls_cleanup(struct curl_tls_ctx *ctx); -CURLcode Curl_vquic_tls_before_recv(struct quic_tls_ctx *ctx, +CURLcode Curl_vquic_tls_before_recv(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data); @@ -88,11 +90,11 @@ CURLcode Curl_vquic_tls_before_recv(struct quic_tls_ctx *ctx, * After the QUIC basic handshake has been, verify that the peer * (and its certificate) fulfill our requirements. */ -CURLcode Curl_vquic_tls_verify_peer(struct quic_tls_ctx *ctx, +CURLcode Curl_vquic_tls_verify_peer(struct curl_tls_ctx *ctx, struct Curl_cfilter *cf, struct Curl_easy *data, struct ssl_peer *peer); -#endif /* !ENABLE_QUIC && (USE_OPENSSL || USE_GNUTLS || USE_WOLFSSL) */ +#endif /* !USE_HTTP3 && (USE_OPENSSL || USE_GNUTLS || USE_WOLFSSL) */ #endif /* HEADER_CURL_VQUIC_TLS_H */ diff --git a/deps/curl/lib/vquic/vquic.c b/deps/curl/lib/vquic/vquic.c index 612d25bb..16bfe4cc 100644 --- a/deps/curl/lib/vquic/vquic.c +++ b/deps/curl/lib/vquic/vquic.c @@ -22,20 +22,11 @@ * ***************************************************************************/ -/* WIP, experimental: use recvmmsg() on linux - * we have no configure check, yet - * and also it is only available for _GNU_SOURCE, which - * we do not use otherwise. -#define HAVE_SENDMMSG - */ -#if defined(HAVE_SENDMMSG) -#define _GNU_SOURCE -#include -#undef _GNU_SOURCE -#endif - #include "curl_setup.h" +#ifdef HAVE_NETINET_UDP_H +#include +#endif #ifdef HAVE_FCNTL_H #include #endif @@ -59,7 +50,7 @@ #include "memdebug.h" -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 #ifdef O_BINARY #define QLOGMODE O_WRONLY|O_CREAT|O_BINARY @@ -329,6 +320,36 @@ CURLcode vquic_send_tail_split(struct Curl_cfilter *cf, struct Curl_easy *data, return vquic_flush(cf, data, qctx); } +#if defined(HAVE_SENDMMSG) || defined(HAVE_SENDMSG) +static size_t msghdr_get_udp_gro(struct msghdr *msg) +{ + int gso_size = 0; +#if defined(__linux__) && defined(UDP_GRO) + struct cmsghdr *cmsg; + + /* Workaround musl CMSG_NXTHDR issue */ +#if defined(__clang__) && !defined(__GLIBC__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-compare" +#pragma clang diagnostic ignored "-Wcast-align" +#endif + for(cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) { +#if defined(__clang__) && !defined(__GLIBC__) +#pragma clang diagnostic pop +#endif + if(cmsg->cmsg_level == SOL_UDP && cmsg->cmsg_type == UDP_GRO) { + memcpy(&gso_size, CMSG_DATA(cmsg), sizeof(gso_size)); + + break; + } + } +#endif + (void)msg; + + return (size_t)gso_size; +} +#endif + #ifdef HAVE_SENDMMSG static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -339,12 +360,16 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, #define MMSG_NUM 64 struct iovec msg_iov[MMSG_NUM]; struct mmsghdr mmsg[MMSG_NUM]; + uint8_t msg_ctrl[MMSG_NUM * CMSG_SPACE(sizeof(uint16_t))]; uint8_t bufs[MMSG_NUM][2*1024]; struct sockaddr_storage remote_addr[MMSG_NUM]; size_t total_nread, pkts; int mcount, i, n; char errstr[STRERROR_LEN]; CURLcode result = CURLE_OK; + size_t gso_size; + size_t pktlen; + size_t offset, to; DEBUGASSERT(max_pkts > 0); pkts = 0; @@ -359,6 +384,8 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, mmsg[i].msg_hdr.msg_iovlen = 1; mmsg[i].msg_hdr.msg_name = &remote_addr[i]; mmsg[i].msg_hdr.msg_namelen = sizeof(remote_addr[i]); + mmsg[i].msg_hdr.msg_control = &msg_ctrl[i]; + mmsg[i].msg_hdr.msg_controllen = CMSG_SPACE(sizeof(uint16_t)); } while((mcount = recvmmsg(qctx->sockfd, mmsg, n, 0, NULL)) == -1 && @@ -370,12 +397,10 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, goto out; } if(!cf->connected && SOCKERRNO == ECONNREFUSED) { - const char *r_ip = NULL; - int r_port = 0; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + struct ip_quadruple ip; + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); failf(data, "QUIC: connection to %s port %u refused", - r_ip, r_port); + ip.remote_ip, ip.remote_port); result = CURLE_COULDNT_CONNECT; goto out; } @@ -387,14 +412,30 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, } CURL_TRC_CF(data, cf, "recvmmsg() -> %d packets", mcount); - pkts += mcount; for(i = 0; i < mcount; ++i) { total_nread += mmsg[i].msg_len; - result = recv_cb(bufs[i], mmsg[i].msg_len, - mmsg[i].msg_hdr.msg_name, mmsg[i].msg_hdr.msg_namelen, - 0, userp); - if(result) - goto out; + + gso_size = msghdr_get_udp_gro(&mmsg[i].msg_hdr); + if(gso_size == 0) { + 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; + } } } @@ -420,6 +461,10 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, ssize_t nread; char errstr[STRERROR_LEN]; CURLcode result = CURLE_OK; + uint8_t msg_ctrl[CMSG_SPACE(sizeof(uint16_t))]; + size_t gso_size; + size_t pktlen; + size_t offset, to; msg_iov.iov_base = buf; msg_iov.iov_len = (int)sizeof(buf); @@ -427,11 +472,13 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, memset(&msg, 0, sizeof(msg)); msg.msg_iov = &msg_iov; msg.msg_iovlen = 1; + msg.msg_control = msg_ctrl; DEBUGASSERT(max_pkts > 0); for(pkts = 0, total_nread = 0; pkts < max_pkts;) { msg.msg_name = &remote_addr; msg.msg_namelen = sizeof(remote_addr); + msg.msg_controllen = sizeof(msg_ctrl); while((nread = recvmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == EINTR) ; @@ -440,12 +487,10 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, goto out; } if(!cf->connected && SOCKERRNO == ECONNREFUSED) { - const char *r_ip = NULL; - int r_port = 0; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + struct ip_quadruple ip; + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); failf(data, "QUIC: connection to %s port %u refused", - r_ip, r_port); + ip.remote_ip, ip.remote_port); result = CURLE_COULDNT_CONNECT; goto out; } @@ -456,12 +501,29 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, goto out; } - ++pkts; total_nread += (size_t)nread; - result = recv_cb(buf, (size_t)nread, msg.msg_name, msg.msg_namelen, - 0, userp); - if(result) - goto out; + + gso_size = msghdr_get_udp_gro(&msg); + if(gso_size == 0) { + gso_size = (size_t)nread; + } + + for(offset = 0; offset < (size_t)nread; offset = to) { + ++pkts; + + to = offset + gso_size; + if(to > (size_t)nread) { + pktlen = (size_t)nread - offset; + } + else { + pktlen = gso_size; + } + + result = + recv_cb(buf + offset, pktlen, msg.msg_name, msg.msg_namelen, 0, userp); + if(result) + goto out; + } } out: @@ -500,12 +562,10 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, goto out; } if(!cf->connected && SOCKERRNO == ECONNREFUSED) { - const char *r_ip = NULL; - int r_port = 0; - Curl_cf_socket_peek(cf->next, data, NULL, NULL, - &r_ip, &r_port, NULL, NULL); + struct ip_quadruple ip; + Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); failf(data, "QUIC: connection to %s port %u refused", - r_ip, r_port); + ip.remote_ip, ip.remote_port); result = CURLE_COULDNT_CONNECT; goto out; } @@ -648,7 +708,7 @@ CURLcode Curl_conn_may_http3(struct Curl_easy *data, const struct connectdata *conn) { if(conn->transport == TRNSPRT_UNIX) { - /* cannot do QUIC over a unix domain socket */ + /* cannot do QUIC over a Unix domain socket */ return CURLE_QUIC_CONNECT_ERROR; } if(!(conn->handler->flags & PROTOPT_SSL)) { @@ -661,7 +721,7 @@ CURLcode Curl_conn_may_http3(struct Curl_easy *data, return CURLE_URL_MALFORMAT; } if(conn->bits.httpproxy && conn->bits.tunnel_proxy) { - failf(data, "HTTP/3 is not supported over a HTTP proxy"); + failf(data, "HTTP/3 is not supported over an HTTP proxy"); return CURLE_URL_MALFORMAT; } #endif @@ -669,7 +729,7 @@ CURLcode Curl_conn_may_http3(struct Curl_easy *data, return CURLE_OK; } -#else /* ENABLE_QUIC */ +#else /* USE_HTTP3 */ CURLcode Curl_conn_may_http3(struct Curl_easy *data, const struct connectdata *conn) @@ -680,4 +740,4 @@ CURLcode Curl_conn_may_http3(struct Curl_easy *data, return CURLE_NOT_BUILT_IN; } -#endif /* !ENABLE_QUIC */ +#endif /* !USE_HTTP3 */ diff --git a/deps/curl/lib/vquic/vquic.h b/deps/curl/lib/vquic/vquic.h index dc73957a..c1ca1df6 100644 --- a/deps/curl/lib/vquic/vquic.h +++ b/deps/curl/lib/vquic/vquic.h @@ -26,7 +26,7 @@ #include "curl_setup.h" -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 struct Curl_cfilter; struct Curl_easy; struct connectdata; @@ -52,11 +52,11 @@ bool Curl_conn_is_http3(const struct Curl_easy *data, extern struct Curl_cftype Curl_cft_http3; -#else /* ENABLE_QUIC */ +#else /* USE_HTTP3 */ #define Curl_conn_is_http3(a,b,c) FALSE -#endif /* !ENABLE_QUIC */ +#endif /* !USE_HTTP3 */ CURLcode Curl_conn_may_http3(struct Curl_easy *data, const struct connectdata *conn); diff --git a/deps/curl/lib/vquic/vquic_int.h b/deps/curl/lib/vquic/vquic_int.h index c218a949..754e1f59 100644 --- a/deps/curl/lib/vquic/vquic_int.h +++ b/deps/curl/lib/vquic/vquic_int.h @@ -27,7 +27,7 @@ #include "curl_setup.h" #include "bufq.h" -#ifdef ENABLE_QUIC +#ifdef USE_HTTP3 #define MAX_PKT_BURST 10 #define MAX_UDP_PAYLOAD_SIZE 1452 @@ -88,6 +88,6 @@ CURLcode vquic_recv_packets(struct Curl_cfilter *cf, size_t max_pkts, vquic_recv_pkt_cb *recv_cb, void *userp); -#endif /* !ENABLE_QUIC */ +#endif /* !USE_HTTP3 */ #endif /* HEADER_CURL_VQUIC_QUIC_INT_H */ diff --git a/deps/curl/lib/vssh/.checksrc b/deps/curl/lib/vssh/.checksrc new file mode 100644 index 00000000..9066946c --- /dev/null +++ b/deps/curl/lib/vssh/.checksrc @@ -0,0 +1,2 @@ +enable STRERROR +enable STRNCPY diff --git a/deps/curl/lib/curl_path.c b/deps/curl/lib/vssh/curl_path.c similarity index 83% rename from deps/curl/lib/curl_path.c rename to deps/curl/lib/vssh/curl_path.c index 856423db..61452a42 100644 --- a/deps/curl/lib/curl_path.c +++ b/deps/curl/lib/vssh/curl_path.c @@ -26,9 +26,9 @@ #if defined(USE_SSH) +#include "curl_path.h" #include #include "curl_memory.h" -#include "curl_path.h" #include "escape.h" #include "memdebug.h" @@ -98,8 +98,8 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, return CURLE_OK; } -/* The get_pathname() function is being borrowed from OpenSSH sftp.c - version 4.6p1. */ +/* The original get_pathname() function came from OpenSSH sftp.c version + 4.6p1. */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -115,38 +115,37 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -CURLcode Curl_get_pathname(const char **cpp, char **path, char *homedir) + +#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, j; - size_t fullPathLength, pathLength; - bool relativePath = false; + unsigned int i; static const char WHITESPACE[] = " \t\r\n"; + struct dynbuf out; + CURLcode result; DEBUGASSERT(homedir); - if(!*cp || !homedir) { - *cpp = NULL; - *path = NULL; + *path = NULL; + *cpp = NULL; + if(!*cp || !homedir) return CURLE_QUOTE_ERROR; - } + + Curl_dyn_init(&out, MAX_PATHLENGTH); + /* Ignore leading whitespace */ cp += strspn(cp, WHITESPACE); - /* Allocate enough space for home directory and filename + separator */ - fullPathLength = strlen(cp) + strlen(homedir) + 2; - *path = malloc(fullPathLength); - if(!*path) - return CURLE_OUT_OF_MEMORY; /* Check for quoted filenames */ if(*cp == '\"' || *cp == '\'') { quot = *cp++; /* Search for terminating quote, unescape some chars */ - for(i = j = 0; i <= strlen(cp); i++) { + for(i = 0; i <= strlen(cp); i++) { if(cp[i] == quot) { /* Found quote */ i++; - (*path)[j] = '\0'; break; } if(cp[i] == '\0') { /* End of string */ @@ -159,40 +158,45 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, char *homedir) goto fail; } } - (*path)[j++] = cp[i]; + result = Curl_dyn_addn(&out, &cp[i], 1); + if(result) + return result; } - if(j == 0) { + if(!Curl_dyn_len(&out)) goto fail; - } - *cpp = cp + i + strspn(cp + i, WHITESPACE); + + /* 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); - pathLength = 0; - relativePath = (cp[0] == '/' && cp[1] == '~' && cp[2] == '/'); + /* Handling for relative path - prepend home directory */ - if(relativePath) { - strcpy(*path, homedir); - pathLength = strlen(homedir); - (*path)[pathLength++] = '/'; - (*path)[pathLength] = '\0'; + if(cp[0] == '/' && cp[1] == '~' && cp[2] == '/') { + result = Curl_dyn_add(&out, homedir); + if(!result) + result = Curl_dyn_addn(&out, "/", 1); + if(result) + return result; cp += 3; } /* Copy path name up until first "whitespace" */ - memcpy(&(*path)[pathLength], cp, (int)(end - cp)); - pathLength += (int)(end - cp); - (*path)[pathLength] = '\0'; + result = Curl_dyn_addn(&out, cp, (end - cp)); + if(result) + return result; } + *path = Curl_dyn_ptr(&out); return CURLE_OK; fail: - Curl_safefree(*path); + Curl_dyn_free(&out); return CURLE_QUOTE_ERROR; } diff --git a/deps/curl/lib/curl_path.h b/deps/curl/lib/vssh/curl_path.h similarity index 79% rename from deps/curl/lib/curl_path.h rename to deps/curl/lib/vssh/curl_path.h index cbe51c22..8e984174 100644 --- a/deps/curl/lib/curl_path.h +++ b/deps/curl/lib/vssh/curl_path.h @@ -28,22 +28,9 @@ #include #include "urldata.h" -#ifdef _WIN32 -# undef PATH_MAX -# define PATH_MAX MAX_PATH -# ifndef R_OK -# define R_OK 4 -# endif -#endif - -#ifndef PATH_MAX -#define PATH_MAX 1024 /* just an extra precaution since there are systems that - have their definition hidden well */ -#endif - CURLcode Curl_getworkingpath(struct Curl_easy *data, char *homedir, char **path); -CURLcode Curl_get_pathname(const char **cpp, char **path, char *homedir); +CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir); #endif /* HEADER_CURL_PATH_H */ diff --git a/deps/curl/lib/vssh/libssh.c b/deps/curl/lib/vssh/libssh.c index 7cfc9502..2781365b 100644 --- a/deps/curl/lib/vssh/libssh.c +++ b/deps/curl/lib/vssh/libssh.c @@ -31,11 +31,6 @@ #include -/* in 0.10.0 or later, ignore deprecated warnings */ -#define SSH_SUPPRESS_DEPRECATED -#include -#include - #ifdef HAVE_NETINET_IN_H #include #endif @@ -139,6 +134,7 @@ static void sftp_quote(struct Curl_easy *data); static void sftp_quote_stat(struct Curl_easy *data); static int myssh_getsock(struct Curl_easy *data, struct connectdata *conn, curl_socket_t *sock); +static void myssh_block2waitfor(struct connectdata *conn, bool block); static CURLcode myssh_setup_connection(struct Curl_easy *data, struct connectdata *conn); @@ -162,6 +158,7 @@ const struct Curl_handler Curl_handler_scp = { myssh_getsock, /* perform_getsock */ scp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SSH, /* defport */ @@ -189,6 +186,7 @@ const struct Curl_handler Curl_handler_sftp = { myssh_getsock, /* perform_getsock */ sftp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SSH, /* defport */ @@ -386,28 +384,25 @@ static int myssh_is_known(struct Curl_easy *data) goto cleanup; } - if(data->set.ssl.primary.verifyhost != TRUE) { - rc = SSH_OK; - goto cleanup; - } + if(data->set.str[STRING_SSH_KNOWNHOSTS]) { #if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0,9,0) - /* Get the known_key from the known hosts file */ - vstate = ssh_session_get_known_hosts_entry(sshc->ssh_session, - &knownhostsentry); + /* Get the known_key from the known hosts file */ + vstate = ssh_session_get_known_hosts_entry(sshc->ssh_session, + &knownhostsentry); - /* Case an entry was found in a known hosts file */ - if(knownhostsentry) { - if(knownhostsentry->publickey) { - rc = ssh_pki_export_pubkey_base64(knownhostsentry->publickey, - &known_base64); - if(rc != SSH_OK) { - goto cleanup; - } - knownkey.key = known_base64; - knownkey.len = strlen(known_base64); + /* Case an entry was found in a known hosts file */ + if(knownhostsentry) { + if(knownhostsentry->publickey) { + rc = ssh_pki_export_pubkey_base64(knownhostsentry->publickey, + &known_base64); + if(rc != SSH_OK) { + goto cleanup; + } + knownkey.key = known_base64; + knownkey.len = strlen(known_base64); - switch(ssh_key_type(knownhostsentry->publickey)) { + switch(ssh_key_type(knownhostsentry->publickey)) { case SSH_KEYTYPE_RSA: knownkey.keytype = CURLKHTYPE_RSA; break; @@ -429,12 +424,12 @@ static int myssh_is_known(struct Curl_easy *data) default: rc = SSH_ERROR; goto cleanup; + } + knownkeyp = &knownkey; } - knownkeyp = &knownkey; } - } - switch(vstate) { + switch(vstate) { case SSH_KNOWN_HOSTS_OK: keymatch = CURLKHMATCH_OK; break; @@ -444,14 +439,14 @@ static int myssh_is_known(struct Curl_easy *data) case SSH_KNOWN_HOSTS_ERROR: keymatch = CURLKHMATCH_MISSING; break; - default: + default: keymatch = CURLKHMATCH_MISMATCH; break; - } + } #else - vstate = ssh_is_server_known(sshc->ssh_session); - switch(vstate) { + vstate = ssh_is_server_known(sshc->ssh_session); + switch(vstate) { case SSH_SERVER_KNOWN_OK: keymatch = CURLKHMATCH_OK; break; @@ -459,21 +454,21 @@ static int myssh_is_known(struct Curl_easy *data) case SSH_SERVER_NOT_KNOWN: keymatch = CURLKHMATCH_MISSING; break; - default: + default: keymatch = CURLKHMATCH_MISMATCH; break; - } + } #endif - if(func) { /* use callback to determine action */ - rc = ssh_pki_export_pubkey_base64(pubkey, &found_base64); - if(rc != SSH_OK) - goto cleanup; + if(func) { /* use callback to determine action */ + rc = ssh_pki_export_pubkey_base64(pubkey, &found_base64); + if(rc != SSH_OK) + goto cleanup; - foundkey.key = found_base64; - foundkey.len = strlen(found_base64); + foundkey.key = found_base64; + foundkey.len = strlen(found_base64); - switch(ssh_key_type(pubkey)) { + switch(ssh_key_type(pubkey)) { case SSH_KEYTYPE_RSA: foundkey.keytype = CURLKHTYPE_RSA; break; @@ -499,15 +494,15 @@ static int myssh_is_known(struct Curl_easy *data) default: rc = SSH_ERROR; goto cleanup; - } + } - Curl_set_in_callback(data, true); - rc = func(data, knownkeyp, /* from the knownhosts file */ - &foundkey, /* from the remote host */ - keymatch, data->set.ssh_keyfunc_userp); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, TRUE); + rc = func(data, knownkeyp, /* from the knownhosts file */ + &foundkey, /* from the remote host */ + keymatch, data->set.ssh_keyfunc_userp); + Curl_set_in_callback(data, FALSE); - switch(rc) { + switch(rc) { case CURLKHSTAT_FINE_ADD_TO_FILE: #if LIBSSH_VERSION_INT >= SSH_VERSION_INT(0,8,0) rc = ssh_session_update_known_hosts(sshc->ssh_session); @@ -523,12 +518,13 @@ static int myssh_is_known(struct Curl_easy *data) default: /* REJECT/DEFER */ rc = SSH_ERROR; goto cleanup; + } } - } - else { - if(keymatch != CURLKHMATCH_OK) { - rc = SSH_ERROR; - goto cleanup; + else { + if(keymatch != CURLKHMATCH_OK) { + rc = SSH_ERROR; + goto cleanup; + } } } rc = SSH_OK; @@ -661,7 +657,7 @@ restart: /* * 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 + * blocking and without reaching the end. The data the pointer 'block' points * to will be set to TRUE if the libssh function returns SSH_AGAIN * meaning it wants to be called again when the socket is ready */ @@ -675,7 +671,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) int rc = SSH_NO_ERROR, err; int seekerr = CURL_SEEKFUNC_OK; const char *err_msg; - *block = 0; /* we're not blocking by default */ + *block = 0; /* we are not blocking by default */ do { @@ -698,8 +694,12 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) case SSH_S_STARTUP: rc = ssh_connect(sshc->ssh_session); - if(rc == SSH_AGAIN) + + myssh_block2waitfor(conn, (rc == SSH_AGAIN)); + if(rc == SSH_AGAIN) { + DEBUGF(infof(data, "ssh_connect -> EAGAIN")); break; + } if(rc != SSH_OK) { failf(data, "Failure establishing ssh session"); @@ -740,7 +740,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) break; } - sshc->auth_methods = ssh_userauth_list(sshc->ssh_session, NULL); + sshc->auth_methods = + (unsigned int)ssh_userauth_list(sshc->ssh_session, NULL); if(sshc->auth_methods) infof(data, "SSH authentication methods available: %s%s%s%s", sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY ? @@ -1240,7 +1241,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) if(attrs) { curl_off_t size = attrs->size; if(size < 0) { - failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); + failf(data, "Bad file size (%" FMT_OFF_T ")", size); MOVE_TO_ERROR_STATE(CURLE_BAD_DOWNLOAD_RESUME); break; } @@ -1292,11 +1293,11 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) position. */ if(data->state.resume_from > 0) { /* Let's read off the proper amount of bytes from the input. */ - if(conn->seek_func) { - Curl_set_in_callback(data, true); - seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, - SEEK_SET); - Curl_set_in_callback(data, false); + if(data->set.seek_func) { + Curl_set_in_callback(data, TRUE); + seekerr = data->set.seek_func(data->set.seek_client, + data->state.resume_from, SEEK_SET); + Curl_set_in_callback(data, FALSE); } if(seekerr != CURL_SEEKFUNC_OK) { @@ -1306,7 +1307,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) failf(data, "Could not seek stream"); return CURLE_FTP_COULDNT_USE_REST; } - /* seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ + /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { char scratch[4*1024]; size_t readthisamountnow = @@ -1349,12 +1350,12 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) Curl_pgrsSetUploadSize(data, data->state.infilesize); } /* upload data */ - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->sockfd = conn->writesockfd; - /* store this original bitmask setup to use later on if we can't + /* store this original bitmask setup to use later on if we cannot figure out a "real" bitmask */ sshc->orig_waitfor = data->req.keepon; @@ -1363,7 +1364,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) with both accordingly */ data->state.select_bits = CURL_CSELECT_OUT; - /* since we don't really wait for anything at this point, we want the + /* 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 set a very short timeout here */ Curl_expire(data, 0, EXPIRE_RUN_NOW); @@ -1402,7 +1403,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) ++sshc->slash_pos; if(rc < 0) { /* - * Abort if failure wasn't that the dir already exists or the + * 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 */ @@ -1575,7 +1576,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) sshc->sftp_dir = NULL; /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); state(data, SSH_STOP); break; @@ -1609,9 +1610,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) !(attrs->flags & SSH_FILEXFER_ATTR_SIZE) || (attrs->size == 0)) { /* - * sftp_fstat didn't return an error, so maybe the server - * just doesn't support stat() - * OR the server doesn't return a file size with a stat() + * sftp_fstat did not return an error, so maybe the server + * just does not support stat() + * OR the server does not return a file size with a stat() * OR file size is 0 */ data->req.size = -1; @@ -1625,7 +1626,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) sftp_attributes_free(attrs); if(size < 0) { - failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); + failf(data, "Bad file size (%" FMT_OFF_T ")", size); return CURLE_BAD_DOWNLOAD_RESUME; } if(data->state.use_range) { @@ -1655,9 +1656,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) to = size - 1; } if(from > size) { - failf(data, "Offset (%" - CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" - CURL_FORMAT_CURL_OFF_T ")", from, size); + failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%" + FMT_OFF_T ")", from, size); return CURLE_BAD_DOWNLOAD_RESUME; } if(from > to) { @@ -1684,12 +1684,10 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) /* We can resume if we can seek to the resume position */ if(data->state.resume_from) { if(data->state.resume_from < 0) { - /* We're supposed to download the last abs(from) bytes */ + /* We are supposed to download the last abs(from) bytes */ if((curl_off_t)size < -data->state.resume_from) { - failf(data, "Offset (%" - CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" - CURL_FORMAT_CURL_OFF_T ")", - data->state.resume_from, size); + failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%" + FMT_OFF_T ")", data->state.resume_from, size); return CURLE_BAD_DOWNLOAD_RESUME; } /* download from where? */ @@ -1697,8 +1695,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) } else { if((curl_off_t)size < data->state.resume_from) { - failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T - ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", + failf(data, "Offset (%" FMT_OFF_T + ") was beyond file size (%" FMT_OFF_T ")", data->state.resume_from, size); return CURLE_BAD_DOWNLOAD_RESUME; } @@ -1720,12 +1718,12 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) /* Setup the actual download */ if(data->req.size == 0) { /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); infof(data, "File already completely downloaded"); state(data, SSH_STOP); break; } - Curl_xfer_setup(data, FIRSTSOCKET, data->req.size, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, data->req.size, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->writesockfd = conn->sockfd; @@ -1849,12 +1847,12 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) } /* upload data */ - Curl_xfer_setup(data, -1, data->req.size, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->sockfd = conn->writesockfd; - /* store this original bitmask setup to use later on if we can't + /* store this original bitmask setup to use later on if we cannot figure out a "real" bitmask */ sshc->orig_waitfor = data->req.keepon; @@ -1893,7 +1891,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) /* download data */ bytecount = ssh_scp_request_get_size(sshc->scp_session); data->req.maxdownload = (curl_off_t) bytecount; - Curl_xfer_setup(data, FIRSTSOCKET, bytecount, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, bytecount, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->writesockfd = conn->sockfd; @@ -1944,7 +1942,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) FALLTHROUGH(); case SSH_SESSION_DISCONNECT: - /* during weird times when we've been prematurely aborted, the channel + /* during weird times when we have been prematurely aborted, the channel is still alive when we reach this state and we MUST kill the channel properly first */ if(sshc->scp_session) { @@ -2054,6 +2052,7 @@ static int myssh_getsock(struct Curl_easy *data, if(!conn->waitfor) bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); + DEBUGF(infof(data, "ssh_getsock -> %x", bitmap)); return bitmap; } @@ -2061,19 +2060,18 @@ static void myssh_block2waitfor(struct connectdata *conn, bool block) { struct ssh_conn *sshc = &conn->proto.sshc; - /* If it didn't block, or nothing was returned by ssh_get_poll_flags + /* If it did not block, or nothing was returned by ssh_get_poll_flags * have the original set */ conn->waitfor = sshc->orig_waitfor; if(block) { int dir = ssh_get_poll_flags(sshc->ssh_session); - if(dir & SSH_READ_PENDING) { - /* translate the libssh define bits into our own bit defines */ - conn->waitfor = KEEP_RECV; - } - else if(dir & SSH_WRITE_PENDING) { - conn->waitfor = KEEP_SEND; - } + conn->waitfor = 0; + /* translate the libssh define bits into our own bit defines */ + if(dir & SSH_READ_PENDING) + conn->waitfor |= KEEP_RECV; + if(dir & SSH_WRITE_PENDING) + conn->waitfor |= KEEP_SEND; } } @@ -2087,7 +2085,7 @@ static CURLcode myssh_multi_statemach(struct Curl_easy *data, implementation */ CURLcode result = myssh_statemach_act(data, &block); - *done = (sshc->state == SSH_STOP) ? TRUE : FALSE; + *done = (sshc->state == SSH_STOP); myssh_block2waitfor(conn, block); return result; @@ -2148,7 +2146,7 @@ static CURLcode myssh_setup_connection(struct Curl_easy *data, data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; - Curl_dyn_init(&sshc->readdir_buf, PATH_MAX * 2); + Curl_dyn_init(&sshc->readdir_buf, CURL_PATH_MAX * 2); return CURLE_OK; } @@ -2319,7 +2317,7 @@ CURLcode scp_perform(struct Curl_easy *data, static CURLcode myssh_do_it(struct Curl_easy *data, bool *done) { CURLcode result; - bool connected = 0; + bool connected = FALSE; struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; @@ -2356,7 +2354,7 @@ static CURLcode scp_disconnect(struct Curl_easy *data, (void) dead_connection; if(ssh->ssh_session) { - /* only if there's a session still around to use! */ + /* only if there is a session still around to use! */ state(data, SSH_SESSION_DISCONNECT); @@ -2403,12 +2401,13 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, } static ssize_t scp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, CURLcode *err) + const void *mem, size_t len, bool eos, CURLcode *err) { int rc; struct connectdata *conn = data->conn; (void) sockindex; /* we only support SCP on the fixed known primary socket */ (void) err; + (void)eos; rc = ssh_scp_write(conn->proto.sshc.scp_session, mem, len); @@ -2416,7 +2415,7 @@ static ssize_t scp_send(struct Curl_easy *data, int sockindex, /* The following code is misleading, mostly added as wishful thinking * that libssh at some point will implement non-blocking ssh_scp_write/read. * Currently rc can only be number of bytes read or SSH_ERROR. */ - myssh_block2waitfor(conn, (rc == SSH_AGAIN) ? TRUE : FALSE); + myssh_block2waitfor(conn, (rc == SSH_AGAIN)); if(rc == SSH_AGAIN) { *err = CURLE_AGAIN; @@ -2448,7 +2447,7 @@ static ssize_t scp_recv(struct Curl_easy *data, int sockindex, * that libssh at some point will implement non-blocking ssh_scp_write/read. * Currently rc can only be SSH_OK or SSH_ERROR. */ - myssh_block2waitfor(conn, (nread == SSH_AGAIN) ? TRUE : FALSE); + myssh_block2waitfor(conn, (nread == SSH_AGAIN)); if(nread == SSH_AGAIN) { *err = CURLE_AGAIN; nread = -1; @@ -2521,7 +2520,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, DEBUGF(infof(data, "SSH DISCONNECT starts now")); if(conn->proto.sshc.ssh_session) { - /* only if there's a session still around to use! */ + /* only if there is a session still around to use! */ state(data, SSH_SFTP_SHUTDOWN); result = myssh_block_statemach(data, TRUE); } @@ -2551,11 +2550,13 @@ static CURLcode sftp_done(struct Curl_easy *data, CURLcode status, /* return number of sent bytes */ static ssize_t sftp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, CURLcode *err) + const void *mem, size_t len, bool eos, + CURLcode *err) { ssize_t nwrite; struct connectdata *conn = data->conn; (void)sockindex; + (void)eos; /* limit the writes to the maximum specified in Section 3 of * https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-02 @@ -2611,9 +2612,9 @@ static ssize_t sftp_recv(struct Curl_easy *data, int sockindex, nread = sftp_async_read(conn->proto.sshc.sftp_file, mem, (uint32_t)len, - conn->proto.sshc.sftp_file_index); + (uint32_t)conn->proto.sshc.sftp_file_index); - myssh_block2waitfor(conn, (nread == SSH_AGAIN)?TRUE:FALSE); + myssh_block2waitfor(conn, (nread == SSH_AGAIN)); if(nread == SSH_AGAIN) { *err = CURLE_AGAIN; @@ -2715,7 +2716,7 @@ static void sftp_quote(struct Curl_easy *data) } /* - * SFTP is a binary protocol, so we don't send text commands + * SFTP is a binary protocol, so we do not send text commands * to the server. Instead, we scan for commands used by * OpenSSH's sftp program and call the appropriate libssh * functions. diff --git a/deps/curl/lib/vssh/libssh2.c b/deps/curl/lib/vssh/libssh2.c index 073c6873..e19ffefe 100644 --- a/deps/curl/lib/vssh/libssh2.c +++ b/deps/curl/lib/vssh/libssh2.c @@ -30,9 +30,6 @@ #include -#include -#include - #ifdef HAVE_FCNTL_H #include #endif @@ -139,6 +136,7 @@ const struct Curl_handler Curl_handler_scp = { ssh_getsock, /* perform_getsock */ scp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ssh_attach, /* attach */ PORT_SSH, /* defport */ @@ -168,6 +166,7 @@ const struct Curl_handler Curl_handler_sftp = { ssh_getsock, /* perform_getsock */ sftp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ssh_attach, /* attach */ PORT_SSH, /* defport */ @@ -201,7 +200,8 @@ kbd_callback(const char *name, int name_len, const char *instruction, if(num_prompts == 1) { struct connectdata *conn = data->conn; responses[0].text = strdup(conn->passwd); - responses[0].length = curlx_uztoui(strlen(conn->passwd)); + responses[0].length = + responses[0].text == NULL ? 0 : curlx_uztoui(strlen(conn->passwd)); } (void)prompts; } /* kbd_callback */ @@ -279,23 +279,27 @@ static CURLcode libssh2_session_error_to_CURLE(int err) return CURLE_SSH; } +/* These functions are made to use the libcurl memory functions - NOT the + debugmem functions, as that leads us to trigger on libssh2 memory leaks + that are not ours to care for */ + static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc) { (void)abstract; /* arg not used */ - return malloc(count); + return Curl_cmalloc(count); } static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc) { (void)abstract; /* arg not used */ - return realloc(ptr, count); + return Curl_crealloc(ptr, count); } static LIBSSH2_FREE_FUNC(my_libssh2_free) { (void)abstract; /* arg not used */ if(ptr) /* ssh2 agent sometimes call free with null ptr */ - free(ptr); + Curl_cfree(ptr); } /* @@ -385,7 +389,7 @@ static void state(struct Curl_easy *data, sshstate nowstate) #ifdef HAVE_LIBSSH2_KNOWNHOST_API -static int sshkeycallback(struct Curl_easy *easy, +static int sshkeycallback(CURL *easy, const struct curl_khkey *knownkey, /* known */ const struct curl_khkey *foundkey, /* found */ enum curl_khmatch match, @@ -397,13 +401,13 @@ static int sshkeycallback(struct Curl_easy *easy, (void)clientp; /* we only allow perfect matches, and we reject everything else */ - return (match != CURLKHMATCH_OK)?CURLKHSTAT_REJECT:CURLKHSTAT_FINE; + return (match != CURLKHMATCH_OK) ? CURLKHSTAT_REJECT : CURLKHSTAT_FINE; } #endif /* - * Earlier libssh2 versions didn't have the ability to seek to 64bit positions - * with 32bit size_t. + * Earlier libssh2 versions did not have the ability to seek to 64-bit + * positions with 32-bit size_t. */ #ifdef HAVE_LIBSSH2_SFTP_SEEK64 #define SFTP_SEEK(x,y) libssh2_sftp_seek64(x, (libssh2_uint64_t)y) @@ -412,27 +416,27 @@ static int sshkeycallback(struct Curl_easy *easy, #endif /* - * Earlier libssh2 versions didn't do SCP properly beyond 32bit sizes on 32bit - * architectures so we check of the necessary function is present. + * Earlier libssh2 versions did not do SCP properly beyond 32-bit sizes on + * 32-bit architectures so we check of the necessary function is present. */ #ifndef HAVE_LIBSSH2_SCP_SEND64 #define SCP_SEND(a,b,c,d) libssh2_scp_send_ex(a, b, (int)(c), (size_t)d, 0, 0) #else #define SCP_SEND(a,b,c,d) libssh2_scp_send64(a, b, (int)(c), \ - (libssh2_uint64_t)d, 0, 0) + (libssh2_int64_t)d, 0, 0) #endif /* - * libssh2 1.2.8 fixed the problem with 32bit ints used for sockets on win64. + * libssh2 1.2.8 fixed the problem with 32-bit ints used for sockets on win64. */ #ifdef HAVE_LIBSSH2_SESSION_HANDSHAKE #define session_startup(x,y) libssh2_session_handshake(x, y) #else #define session_startup(x,y) libssh2_session_startup(x, (int)y) #endif -static int convert_ssh2_keytype(int sshkeytype) +static enum curl_khtype convert_ssh2_keytype(int sshkeytype) { - int keytype = CURLKHTYPE_UNKNOWN; + enum curl_khtype keytype = CURLKHTYPE_UNKNOWN; switch(sshkeytype) { case LIBSSH2_HOSTKEY_TYPE_RSA: keytype = CURLKHTYPE_RSA; @@ -473,7 +477,7 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) #ifdef HAVE_LIBSSH2_KNOWNHOST_API if(data->set.str[STRING_SSH_KNOWNHOSTS]) { - /* we're asked to verify the host against a file */ + /* we are asked to verify the host against a file */ struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; struct libssh2_knownhost *host = NULL; @@ -484,8 +488,8 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) if(remotekey) { /* - * A subject to figure out is what host name we need to pass in here. - * What host name does OpenSSH store in its file if an IDN name is + * A subject to figure out is what hostname we need to pass in here. + * What hostname does OpenSSH store in its file if an IDN name is * used? */ enum curl_khmatch keymatch; @@ -523,7 +527,7 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) break; #endif default: - infof(data, "unsupported key type, can't check knownhosts"); + infof(data, "unsupported key type, cannot check knownhosts"); keybit = 0; break; } @@ -534,8 +538,8 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) #ifdef HAVE_LIBSSH2_KNOWNHOST_CHECKP keycheck = libssh2_knownhost_checkp(sshc->kh, conn->host.name, - (conn->remote_port != PORT_SSH)? - conn->remote_port:-1, + (conn->remote_port != PORT_SSH) ? + conn->remote_port : -1, remotekey, keylen, LIBSSH2_KNOWNHOST_TYPE_PLAIN| LIBSSH2_KNOWNHOST_KEYENC_RAW| @@ -552,8 +556,8 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) #endif infof(data, "SSH host check: %d, key: %s", keycheck, - (keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH)? - host->key:""); + (keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH) ? + host->key : ""); /* setup 'knownkey' */ if(keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH) { @@ -576,11 +580,11 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) keymatch = (enum curl_khmatch)keycheck; /* Ask the callback how to behave */ - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); rc = func(data, knownkeyp, /* from the knownhosts file */ &foundkey, /* from the remote host */ keymatch, data->set.ssh_keyfunc_userp); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); } } else @@ -597,7 +601,7 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) result = sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; break; case CURLKHSTAT_FINE_REPLACE: - /* remove old host+key that doesn't match */ + /* remove old host+key that does not match */ if(host) libssh2_knownhost_del(sshc->kh, host); FALLTHROUGH(); @@ -605,7 +609,7 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) case CURLKHSTAT_FINE_ADD_TO_FILE: /* proceed */ if(keycheck != LIBSSH2_KNOWNHOST_CHECK_MATCH) { - /* the found host+key didn't match but has been told to be fine + /* the found host+key did not match but has been told to be fine anyway so we add it in memory */ int addrc = libssh2_knownhost_add(sshc->kh, conn->host.name, NULL, @@ -659,7 +663,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) size_t b64_pos = 0; #ifdef LIBSSH2_HOSTKEY_HASH_SHA256 - /* The fingerprint points to static storage (!), don't free() it. */ + /* The fingerprint points to static storage (!), do not free() it. */ fingerprint = libssh2_hostkey_hash(sshc->ssh_session, LIBSSH2_HOSTKEY_HASH_SHA256); #else @@ -739,7 +743,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) LIBSSH2_HOSTKEY_HASH_MD5); if(fingerprint) { - /* The fingerprint points to static storage (!), don't free() it. */ + /* The fingerprint points to static storage (!), do not free() it. */ int i; for(i = 0; i < 16; i++) { msnprintf(&md5buffer[i*2], 3, "%02x", (unsigned char) fingerprint[i]); @@ -777,11 +781,11 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) const char *remotekey = libssh2_session_hostkey(sshc->ssh_session, &keylen, &sshkeytype); if(remotekey) { - int keytype = convert_ssh2_keytype(sshkeytype); - Curl_set_in_callback(data, true); + enum curl_khtype keytype = convert_ssh2_keytype(sshkeytype); + Curl_set_in_callback(data, TRUE); rc = data->set.ssh_hostkeyfunc(data->set.ssh_hostkeyfunc_userp, - keytype, remotekey, keylen); - Curl_set_in_callback(data, false); + (int)keytype, remotekey, keylen); + Curl_set_in_callback(data, FALSE); if(rc!= CURLKHMATCH_OK) { state(data, SSH_SESSION_FREE); sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; @@ -845,7 +849,7 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data) const char *kh_name_end = NULL; size_t kh_name_size = 0; int port = 0; - bool found = false; + bool found = FALSE; if(sshc->kh && !data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5]) { /* lets try to find our host in the known hosts file */ @@ -866,18 +870,18 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data) kh_name_size = strlen(store->name) - 1 - strlen(kh_name_end); if(strncmp(store->name + 1, conn->host.name, kh_name_size) == 0) { - found = true; + found = TRUE; break; } } } else if(strcmp(store->name, conn->host.name) == 0) { - found = true; + found = TRUE; break; } } else { - found = true; + found = TRUE; break; } } @@ -955,26 +959,745 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data) return result; } +static CURLcode sftp_quote(struct Curl_easy *data, + struct ssh_conn *sshc, + struct SSHPROTO *sshp) +{ + const char *cp; + CURLcode result = CURLE_OK; + + /* + * Support some of the "FTP" commands + * + * 'sshc->quote_item' is already verified to be non-NULL before it + * switched to this state. + */ + char *cmd = sshc->quote_item->data; + sshc->acceptfail = FALSE; + + /* if a command starts with an asterisk, which a legal SFTP command never + can, the command will be allowed to fail without it causing any + aborts or cancels etc. It will cause libcurl to act as if the command + is successful, whatever the server responds. */ + + if(cmd[0] == '*') { + cmd++; + sshc->acceptfail = TRUE; + } + + if(strcasecompare("pwd", cmd)) { + /* output debug output if that is requested */ + char *tmp = aprintf("257 \"%s\" is current directory.\n", sshp->path); + if(!tmp) + return CURLE_OUT_OF_MEMORY; + Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"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 + using ordinary FTP. */ + result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); + free(tmp); + if(!result) + state(data, SSH_SFTP_NEXT_QUOTE); + return result; + } + + /* + * the arguments following the command must be separated from the + * command with a space so we can check for it unconditionally + */ + cp = strchr(cmd, ' '); + if(!cp) { + failf(data, "Syntax error command '%s', missing parameter", cmd); + return result; + } + + /* + * also, every command takes at least one argument so we get that + * first argument right now + */ + result = Curl_get_pathname(&cp, &sshc->quote_path1, sshc->homedir); + if(result) { + if(result != CURLE_OUT_OF_MEMORY) + failf(data, "Syntax error: Bad first parameter to '%s'", cmd); + return result; + } + + /* + * SFTP is a binary protocol, so we do not send text commands to the server. + * Instead, we scan for commands used by OpenSSH's sftp program and call the + * appropriate libssh2 functions. + */ + if(strncasecompare(cmd, "chgrp ", 6) || + strncasecompare(cmd, "chmod ", 6) || + strncasecompare(cmd, "chown ", 6) || + strncasecompare(cmd, "atime ", 6) || + strncasecompare(cmd, "mtime ", 6)) { + /* attribute change */ + + /* sshc->quote_path1 contains the mode to set */ + /* get the destination */ + result = Curl_get_pathname(&cp, &sshc->quote_path2, sshc->homedir); + if(result) { + if(result != CURLE_OUT_OF_MEMORY) + failf(data, "Syntax error in %s: Bad second parameter", cmd); + Curl_safefree(sshc->quote_path1); + return result; + } + memset(&sshp->quote_attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); + state(data, SSH_SFTP_QUOTE_STAT); + return result; + } + if(strncasecompare(cmd, "ln ", 3) || + strncasecompare(cmd, "symlink ", 8)) { + /* symbolic linking */ + /* sshc->quote_path1 is the source */ + /* get the destination */ + result = Curl_get_pathname(&cp, &sshc->quote_path2, sshc->homedir); + if(result) { + if(result != CURLE_OUT_OF_MEMORY) + failf(data, "Syntax error in ln/symlink: Bad second parameter"); + Curl_safefree(sshc->quote_path1); + return result; + } + state(data, SSH_SFTP_QUOTE_SYMLINK); + return result; + } + else if(strncasecompare(cmd, "mkdir ", 6)) { + /* create dir */ + state(data, SSH_SFTP_QUOTE_MKDIR); + return result; + } + else if(strncasecompare(cmd, "rename ", 7)) { + /* rename file */ + /* first param is the source path */ + /* second param is the dest. path */ + result = Curl_get_pathname(&cp, &sshc->quote_path2, sshc->homedir); + if(result) { + if(result != CURLE_OUT_OF_MEMORY) + failf(data, "Syntax error in rename: Bad second parameter"); + Curl_safefree(sshc->quote_path1); + return result; + } + state(data, SSH_SFTP_QUOTE_RENAME); + return result; + } + else if(strncasecompare(cmd, "rmdir ", 6)) { + /* delete dir */ + state(data, SSH_SFTP_QUOTE_RMDIR); + return result; + } + else if(strncasecompare(cmd, "rm ", 3)) { + state(data, SSH_SFTP_QUOTE_UNLINK); + return result; + } +#ifdef HAS_STATVFS_SUPPORT + else if(strncasecompare(cmd, "statvfs ", 8)) { + state(data, SSH_SFTP_QUOTE_STATVFS); + return result; + } +#endif + + failf(data, "Unknown SFTP command"); + Curl_safefree(sshc->quote_path1); + Curl_safefree(sshc->quote_path2); + return CURLE_QUOTE_ERROR; +} + +static CURLcode +sftp_upload_init(struct Curl_easy *data, + struct ssh_conn *sshc, + struct SSHPROTO *sshp, + bool *blockp) +{ + unsigned long flags; + + /* + * NOTE!!! libssh2 requires that the destination path is a full path + * that includes the destination file and name OR ends in a "/" + * If this is not done the destination file will be named the + * same name as the last directory in the path. + */ + + if(data->state.resume_from) { + LIBSSH2_SFTP_ATTRIBUTES attrs; + if(data->state.resume_from < 0) { + int rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, + curlx_uztoui(strlen(sshp->path)), + LIBSSH2_SFTP_STAT, &attrs); + if(rc == LIBSSH2_ERROR_EAGAIN) { + *blockp = TRUE; + return CURLE_OK; + } + if(rc) { + data->state.resume_from = 0; + } + else { + curl_off_t size = attrs.filesize; + if(size < 0) { + failf(data, "Bad file size (%" FMT_OFF_T ")", size); + return CURLE_BAD_DOWNLOAD_RESUME; + } + data->state.resume_from = attrs.filesize; + } + } + } + + if(data->set.remote_append) + /* Try to open for append, but create if nonexisting */ + flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_APPEND; + else if(data->state.resume_from > 0) + /* If we have restart position then open for append */ + flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_APPEND; + else + /* Clear file before writing (normal behavior) */ + flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC; + + sshc->sftp_handle = + libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, + curlx_uztoui(strlen(sshp->path)), + flags, (long)data->set.new_file_perms, + LIBSSH2_SFTP_OPENFILE); + + if(!sshc->sftp_handle) { + unsigned long sftperr; + int rc = libssh2_session_last_errno(sshc->ssh_session); + + if(LIBSSH2_ERROR_EAGAIN == rc) { + *blockp = TRUE; + return CURLE_OK; + } + + if(LIBSSH2_ERROR_SFTP_PROTOCOL == rc) + /* only when there was an SFTP protocol error can we extract + the sftp error! */ + sftperr = libssh2_sftp_last_error(sshc->sftp_session); + else + sftperr = LIBSSH2_FX_OK; /* not an sftp error at all */ + + if(sshc->secondCreateDirs) { + state(data, SSH_SFTP_CLOSE); + sshc->actualcode = sftperr != LIBSSH2_FX_OK ? + sftp_libssh2_error_to_CURLE(sftperr) : CURLE_SSH; + failf(data, "Creating the dir/file failed: %s", + sftp_libssh2_strerror(sftperr)); + return CURLE_OK; + } + if(((sftperr == LIBSSH2_FX_NO_SUCH_FILE) || + (sftperr == LIBSSH2_FX_FAILURE) || + (sftperr == LIBSSH2_FX_NO_SUCH_PATH)) && + (data->set.ftp_create_missing_dirs && + (strlen(sshp->path) > 1))) { + /* try to create the path remotely */ + sshc->secondCreateDirs = 1; + state(data, SSH_SFTP_CREATE_DIRS_INIT); + return CURLE_OK; + } + state(data, SSH_SFTP_CLOSE); + sshc->actualcode = sftperr != LIBSSH2_FX_OK ? + sftp_libssh2_error_to_CURLE(sftperr) : CURLE_SSH; + if(!sshc->actualcode) { + /* Sometimes, for some reason libssh2_sftp_last_error() returns zero + even though libssh2_sftp_open() failed previously! We need to + work around that! */ + sshc->actualcode = CURLE_SSH; + sftperr = LIBSSH2_FX_OK; + } + failf(data, "Upload failed: %s (%lu/%d)", + sftperr != LIBSSH2_FX_OK ? + sftp_libssh2_strerror(sftperr) : "ssh error", + sftperr, rc); + return sshc->actualcode; + } + + /* If we have a restart point then we need to seek to the correct + position. */ + if(data->state.resume_from > 0) { + int seekerr = CURL_SEEKFUNC_OK; + /* Let's read off the proper amount of bytes from the input. */ + if(data->set.seek_func) { + Curl_set_in_callback(data, TRUE); + seekerr = data->set.seek_func(data->set.seek_client, + data->state.resume_from, SEEK_SET); + Curl_set_in_callback(data, FALSE); + } + + if(seekerr != CURL_SEEKFUNC_OK) { + curl_off_t passed = 0; + + if(seekerr != CURL_SEEKFUNC_CANTSEEK) { + failf(data, "Could not seek stream"); + return CURLE_FTP_COULDNT_USE_REST; + } + /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ + do { + char scratch[4*1024]; + size_t readthisamountnow = + (data->state.resume_from - passed > + (curl_off_t)sizeof(scratch)) ? + sizeof(scratch) : curlx_sotouz(data->state.resume_from - passed); + + size_t actuallyread; + Curl_set_in_callback(data, TRUE); + actuallyread = data->state.fread_func(scratch, 1, + readthisamountnow, + data->state.in); + Curl_set_in_callback(data, FALSE); + + passed += actuallyread; + if((actuallyread == 0) || (actuallyread > readthisamountnow)) { + /* this checks for greater-than only to make sure that the + CURL_READFUNC_ABORT return code still aborts */ + failf(data, "Failed to read data"); + return CURLE_FTP_COULDNT_USE_REST; + } + } while(passed < data->state.resume_from); + } + + /* now, decrease the size of the read */ + if(data->state.infilesize > 0) { + data->state.infilesize -= data->state.resume_from; + data->req.size = data->state.infilesize; + Curl_pgrsSetUploadSize(data, data->state.infilesize); + } + + SFTP_SEEK(sshc->sftp_handle, data->state.resume_from); + } + if(data->state.infilesize > 0) { + data->req.size = data->state.infilesize; + Curl_pgrsSetUploadSize(data, data->state.infilesize); + } + /* upload data */ + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); + + /* not set by Curl_xfer_setup to preserve keepon bits */ + data->conn->sockfd = data->conn->writesockfd; + + /* store this original bitmask setup to use later on if we cannot + figure out a "real" bitmask */ + sshc->orig_waitfor = data->req.keepon; + + /* we want to use the _sending_ function even when the socket turns + out readable as the underlying libssh2 sftp send function will deal + with both accordingly */ + data->state.select_bits = CURL_CSELECT_OUT; + + /* 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 set a very short + timeout here */ + Curl_expire(data, 0, EXPIRE_RUN_NOW); + + state(data, SSH_STOP); + return CURLE_OK; +} + +static CURLcode +sftp_pkey_init(struct Curl_easy *data, + struct ssh_conn *sshc) +{ + /* + * Check the supported auth types in the order I feel is most secure + * with the requested type of authentication + */ + sshc->authed = FALSE; + + if((data->set.ssh_auth_types & CURLSSH_AUTH_PUBLICKEY) && + (strstr(sshc->authlist, "publickey") != NULL)) { + bool out_of_memory = FALSE; + + sshc->rsa_pub = sshc->rsa = NULL; + + if(data->set.str[STRING_SSH_PRIVATE_KEY]) + sshc->rsa = 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? */ + char *home = curl_getenv("HOME"); + struct_stat sbuf; + + /* If no private key file is specified, try some common paths. */ + if(home) { + /* Try ~/.ssh first. */ + sshc->rsa = aprintf("%s/.ssh/id_rsa", home); + if(!sshc->rsa) + out_of_memory = TRUE; + else if(stat(sshc->rsa, &sbuf)) { + Curl_safefree(sshc->rsa); + sshc->rsa = aprintf("%s/.ssh/id_dsa", home); + if(!sshc->rsa) + out_of_memory = TRUE; + else if(stat(sshc->rsa, &sbuf)) { + Curl_safefree(sshc->rsa); + } + } + free(home); + } + if(!out_of_memory && !sshc->rsa) { + /* Nothing found; try the current dir. */ + sshc->rsa = strdup("id_rsa"); + if(sshc->rsa && stat(sshc->rsa, &sbuf)) { + Curl_safefree(sshc->rsa); + sshc->rsa = strdup("id_dsa"); + if(sshc->rsa && stat(sshc->rsa, &sbuf)) { + Curl_safefree(sshc->rsa); + /* Out of guesses. Set to the empty string to avoid + * surprising info messages. */ + sshc->rsa = strdup(""); + } + } + } + } + + /* + * Unless the user explicitly specifies a public key file, let + * 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] + /* 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]); + if(!sshc->rsa_pub) + out_of_memory = TRUE; + } + + if(out_of_memory || !sshc->rsa) { + Curl_safefree(sshc->rsa); + Curl_safefree(sshc->rsa_pub); + state(data, SSH_SESSION_FREE); + sshc->actualcode = CURLE_OUT_OF_MEMORY; + return CURLE_OUT_OF_MEMORY; + } + + sshc->passphrase = data->set.ssl.key_passwd; + if(!sshc->passphrase) + sshc->passphrase = ""; + + if(sshc->rsa_pub) + infof(data, "Using SSH public key file '%s'", sshc->rsa_pub); + infof(data, "Using SSH private key file '%s'", sshc->rsa); + + state(data, SSH_AUTH_PKEY); + } + else { + state(data, SSH_AUTH_PASS_INIT); + } + return CURLE_OK; +} + +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; + + /* if a command starts with an asterisk, which a legal SFTP command never + can, the command will be allowed to fail without it causing any aborts or + cancels etc. It will cause libcurl to act as if the command is + successful, whatever the server responds. */ + + if(cmd[0] == '*') { + cmd++; + sshc->acceptfail = TRUE; + } + + if(!strncasecompare(cmd, "chmod", 5)) { + /* Since chown and chgrp only set owner OR group but libssh2 wants to set + * them both at once, we need to obtain the current ownership first. This + * takes an extra protocol round trip. + */ + int rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshc->quote_path2, + curlx_uztoui(strlen(sshc->quote_path2)), + LIBSSH2_SFTP_STAT, + &sshp->quote_attrs); + if(rc == LIBSSH2_ERROR_EAGAIN) { + *blockp = TRUE; + return CURLE_OK; + } + if(rc && !sshc->acceptfail) { /* get those attributes */ + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + failf(data, "Attempt to get SFTP stats failed: %s", + sftp_libssh2_strerror(sftperr)); + goto fail; + } + } + + /* Now set the new attributes... */ + if(strncasecompare(cmd, "chgrp", 5)) { + sshp->quote_attrs.gid = strtoul(sshc->quote_path1, NULL, 10); + sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; + if(sshp->quote_attrs.gid == 0 && !ISDIGIT(sshc->quote_path1[0]) && + !sshc->acceptfail) { + failf(data, "Syntax error: chgrp gid not a number"); + goto fail; + } + } + else if(strncasecompare(cmd, "chmod", 5)) { + sshp->quote_attrs.permissions = strtoul(sshc->quote_path1, NULL, 8); + sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_PERMISSIONS; + /* permissions are octal */ + if(sshp->quote_attrs.permissions == 0 && + !ISDIGIT(sshc->quote_path1[0])) { + failf(data, "Syntax error: chmod permissions not a number"); + goto fail; + } + } + else if(strncasecompare(cmd, "chown", 5)) { + sshp->quote_attrs.uid = strtoul(sshc->quote_path1, NULL, 10); + sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; + if(sshp->quote_attrs.uid == 0 && !ISDIGIT(sshc->quote_path1[0]) && + !sshc->acceptfail) { + failf(data, "Syntax error: chown uid not a number"); + goto fail; + } + } + else if(strncasecompare(cmd, "atime", 5) || + strncasecompare(cmd, "mtime", 5)) { + time_t date = Curl_getdate_capped(sshc->quote_path1); + bool fail = FALSE; + + if(date == -1) { + failf(data, "incorrect date format for %.*s", 5, cmd); + fail = TRUE; + } +#if SIZEOF_TIME_T > SIZEOF_LONG + if(date > 0xffffffff) { + /* if 'long' cannot old >32-bit, this date cannot be sent */ + failf(data, "date overflow"); + fail = TRUE; + } +#endif + if(fail) + goto fail; + if(strncasecompare(cmd, "atime", 5)) + sshp->quote_attrs.atime = (unsigned long)date; + else /* mtime */ + sshp->quote_attrs.mtime = (unsigned long)date; + + sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_ACMODTIME; + } + + /* Now send the completed structure... */ + state(data, SSH_SFTP_QUOTE_SETSTAT); + return CURLE_OK; +fail: + Curl_safefree(sshc->quote_path1); + Curl_safefree(sshc->quote_path2); + return CURLE_QUOTE_ERROR; +} + +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, + curlx_uztoui(strlen(sshp->path)), + LIBSSH2_SFTP_STAT, &attrs); + if(rc == LIBSSH2_ERROR_EAGAIN) { + *blockp = TRUE; + return CURLE_OK; + } + if(rc || + !(attrs.flags & LIBSSH2_SFTP_ATTR_SIZE) || + (attrs.filesize == 0)) { + /* + * libssh2_sftp_open() did not return an error, so maybe the server + * just does not support stat() + * OR the server does not return a file size with a stat() + * OR file size is 0 + */ + data->req.size = -1; + data->req.maxdownload = -1; + Curl_pgrsSetDownloadSize(data, -1); + } + else { + curl_off_t size = attrs.filesize; + + if(size < 0) { + failf(data, "Bad file size (%" FMT_OFF_T ")", size); + return CURLE_BAD_DOWNLOAD_RESUME; + } + if(data->state.use_range) { + curl_off_t from, to; + char *ptr; + char *ptr2; + CURLofft to_t; + CURLofft from_t; + + from_t = curlx_strtoofft(data->state.range, &ptr, 10, &from); + if(from_t == CURL_OFFT_FLOW) + return CURLE_RANGE_ERROR; + while(*ptr && (ISBLANK(*ptr) || (*ptr == '-'))) + ptr++; + to_t = curlx_strtoofft(ptr, &ptr2, 10, &to); + if(to_t == CURL_OFFT_FLOW) + return CURLE_RANGE_ERROR; + if((to_t == CURL_OFFT_INVAL) /* 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; + } + + SFTP_SEEK(sshc->sftp_handle, from); + } + data->req.size = size; + data->req.maxdownload = size; + Curl_pgrsSetDownloadSize(data, size); + } + + /* We can resume if we can seek to the resume position */ + if(data->state.resume_from) { + if(data->state.resume_from < 0) { + /* We are supposed to download the last abs(from) bytes */ + if((curl_off_t)attrs.filesize < -data->state.resume_from) { + failf(data, "Offset (%" FMT_OFF_T ") was beyond file size (%" + FMT_OFF_T ")", + data->state.resume_from, (curl_off_t)attrs.filesize); + return CURLE_BAD_DOWNLOAD_RESUME; + } + /* download from where? */ + data->state.resume_from += attrs.filesize; + } + else { + if((curl_off_t)attrs.filesize < data->state.resume_from) { + failf(data, "Offset (%" FMT_OFF_T + ") was beyond file size (%" FMT_OFF_T ")", + data->state.resume_from, (curl_off_t)attrs.filesize); + return CURLE_BAD_DOWNLOAD_RESUME; + } + } + /* 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); + SFTP_SEEK(sshc->sftp_handle, data->state.resume_from); + } + + /* Setup the actual download */ + if(data->req.size == 0) { + /* no data to transfer */ + Curl_xfer_setup_nop(data); + infof(data, "File already completely downloaded"); + state(data, SSH_STOP); + return CURLE_OK; + } + Curl_xfer_setup1(data, CURL_XFER_RECV, data->req.size, FALSE); + + /* not set by Curl_xfer_setup to preserve keepon bits */ + data->conn->writesockfd = data->conn->sockfd; + + /* we want to use the _receiving_ function even when the socket turns + out writableable as the underlying libssh2 recv function will deal + with both accordingly */ + data->state.select_bits = CURL_CSELECT_IN; + state(data, SSH_STOP); + + return CURLE_OK; +} + +static CURLcode sftp_readdir(struct Curl_easy *data, + struct ssh_conn *sshc, + struct SSHPROTO *sshp, + bool *blockp) +{ + CURLcode result = CURLE_OK; + int rc = libssh2_sftp_readdir_ex(sshc->sftp_handle, + sshp->readdir_filename, CURL_PATH_MAX, + sshp->readdir_longentry, CURL_PATH_MAX, + &sshp->readdir_attrs); + if(rc == LIBSSH2_ERROR_EAGAIN) { + *blockp = TRUE; + return result; + } + if(rc > 0) { + size_t readdir_len = (size_t) rc; + sshp->readdir_filename[readdir_len] = '\0'; + + if(data->set.list_only) { + result = Curl_client_write(data, CLIENTWRITE_BODY, + sshp->readdir_filename, + readdir_len); + if(!result) + result = Curl_client_write(data, CLIENTWRITE_BODY, + (char *)"\n", 1); + if(result) + return result; + } + else { + result = Curl_dyn_add(&sshp->readdir, sshp->readdir_longentry); + + if(!result) { + if((sshp->readdir_attrs.flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) && + ((sshp->readdir_attrs.permissions & LIBSSH2_SFTP_S_IFMT) == + LIBSSH2_SFTP_S_IFLNK)) { + Curl_dyn_init(&sshp->readdir_link, CURL_PATH_MAX); + result = Curl_dyn_addf(&sshp->readdir_link, "%s%s", sshp->path, + sshp->readdir_filename); + state(data, SSH_SFTP_READDIR_LINK); + } + else { + state(data, SSH_SFTP_READDIR_BOTTOM); + } + } + return result; + } + } + else if(rc == 0) { + state(data, SSH_SFTP_READDIR_DONE); + } + else if(rc < 0) { + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); + result = sftp_libssh2_error_to_CURLE(sftperr); + sshc->actualcode = result ? result : CURLE_SSH; + failf(data, "Could not open remote file for reading: %s :: %d", + sftp_libssh2_strerror(sftperr), + libssh2_session_last_errno(sshc->ssh_session)); + state(data, SSH_SFTP_CLOSE); + } + return result; +} /* - * 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 + * ssh_statemachine() runs the SSH state machine as far as it can without + * blocking and without reaching the end. The data the pointer 'block' points * to will be set to TRUE if the libssh2 function returns LIBSSH2_ERROR_EAGAIN * meaning it wants to be called again when the socket is ready */ -static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) +static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block) { CURLcode result = CURLE_OK; struct connectdata *conn = data->conn; struct SSHPROTO *sshp = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; - curl_socket_t sock = conn->sock[FIRSTSOCKET]; + int rc = LIBSSH2_ERROR_NONE; - int ssherr; - unsigned long sftperr; - int seekerr = CURL_SEEKFUNC_OK; - size_t readdir_len; - *block = 0; /* we're not blocking by default */ + *block = 0; /* we are not blocking by default */ do { switch(sshc->state) { @@ -998,7 +1721,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) FALLTHROUGH(); case SSH_S_STARTUP: - rc = session_startup(sshc->ssh_session, sock); + rc = session_startup(sshc->ssh_session, conn->sock[FIRSTSOCKET]); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } @@ -1034,7 +1757,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) * must never change it later. Thus, always specify the correct username * here, even though the libssh2 docs kind of indicate that it should be * possible to get a 'generic' list (not user-specific) of authentication - * methods, presumably with a blank username. That won't work in my + * methods, presumably with a blank username. That will not work in my * experience. * So always specify it here. */ @@ -1049,12 +1772,12 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) state(data, SSH_AUTH_DONE); break; } - ssherr = libssh2_session_last_errno(sshc->ssh_session); - if(ssherr == LIBSSH2_ERROR_EAGAIN) + rc = libssh2_session_last_errno(sshc->ssh_session); + if(rc == LIBSSH2_ERROR_EAGAIN) rc = LIBSSH2_ERROR_EAGAIN; else { state(data, SSH_SESSION_FREE); - sshc->actualcode = libssh2_session_error_to_CURLE(ssherr); + sshc->actualcode = libssh2_session_error_to_CURLE(rc); } break; } @@ -1065,92 +1788,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; case SSH_AUTH_PKEY_INIT: - /* - * Check the supported auth types in the order I feel is most secure - * with the requested type of authentication - */ - sshc->authed = FALSE; - - if((data->set.ssh_auth_types & CURLSSH_AUTH_PUBLICKEY) && - (strstr(sshc->authlist, "publickey") != NULL)) { - bool out_of_memory = FALSE; - - sshc->rsa_pub = sshc->rsa = NULL; - - if(data->set.str[STRING_SSH_PRIVATE_KEY]) - sshc->rsa = 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? */ - char *home = curl_getenv("HOME"); - - /* If no private key file is specified, try some common paths. */ - if(home) { - /* Try ~/.ssh first. */ - sshc->rsa = aprintf("%s/.ssh/id_rsa", home); - if(!sshc->rsa) - out_of_memory = TRUE; - else if(access(sshc->rsa, R_OK) != 0) { - Curl_safefree(sshc->rsa); - sshc->rsa = aprintf("%s/.ssh/id_dsa", home); - if(!sshc->rsa) - out_of_memory = TRUE; - else if(access(sshc->rsa, R_OK) != 0) { - Curl_safefree(sshc->rsa); - } - } - free(home); - } - if(!out_of_memory && !sshc->rsa) { - /* Nothing found; try the current dir. */ - sshc->rsa = strdup("id_rsa"); - if(sshc->rsa && access(sshc->rsa, R_OK) != 0) { - Curl_safefree(sshc->rsa); - sshc->rsa = strdup("id_dsa"); - if(sshc->rsa && access(sshc->rsa, R_OK) != 0) { - Curl_safefree(sshc->rsa); - /* Out of guesses. Set to the empty string to avoid - * surprising info messages. */ - sshc->rsa = strdup(""); - } - } - } - } - - /* - * Unless the user explicitly specifies a public key file, let - * 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] - /* 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]); - if(!sshc->rsa_pub) - out_of_memory = TRUE; - } - - if(out_of_memory || !sshc->rsa) { - Curl_safefree(sshc->rsa); - Curl_safefree(sshc->rsa_pub); - state(data, SSH_SESSION_FREE); - sshc->actualcode = CURLE_OUT_OF_MEMORY; - break; - } - - sshc->passphrase = data->set.ssl.key_passwd; - if(!sshc->passphrase) - sshc->passphrase = ""; - - if(sshc->rsa_pub) - infof(data, "Using SSH public key file '%s'", sshc->rsa_pub); - infof(data, "Using SSH private key file '%s'", sshc->rsa); - - state(data, SSH_AUTH_PKEY); - } - else { - state(data, SSH_AUTH_PASS_INIT); - } + result = sftp_pkey_init(data, sshc); break; case SSH_AUTH_PKEY: @@ -1373,7 +2011,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) Curl_pgrsTime(data, TIMER_APPCONNECT); /* SSH is connected */ - conn->sockfd = sock; + conn->sockfd = conn->sock[FIRSTSOCKET]; conn->writesockfd = CURL_SOCKET_BAD; if(conn->handler->protocol == CURLPROTO_SFTP) { @@ -1408,21 +2046,18 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; case SSH_SFTP_REALPATH: - { - char tempHome[PATH_MAX]; - /* * Get the "home" directory */ rc = sftp_libssh2_realpath(sshc->sftp_session, ".", - tempHome, PATH_MAX-1); + sshp->readdir_filename, CURL_PATH_MAX); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } if(rc > 0) { /* It seems that this string is not always NULL terminated */ - tempHome[rc] = '\0'; - sshc->homedir = strdup(tempHome); + sshp->readdir_filename[rc] = '\0'; + sshc->homedir = strdup(sshp->readdir_filename); if(!sshc->homedir) { state(data, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; @@ -1432,11 +2067,11 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) } else { /* Return the error type */ - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); if(sftperr) result = sftp_libssh2_error_to_CURLE(sftperr); else - /* in this case, the error wasn't in the SFTP level but for example + /* in this case, the error was not in the SFTP level but for example a time-out or similar */ result = CURLE_SSH; sshc->actualcode = result; @@ -1445,7 +2080,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) state(data, SSH_STOP); break; } - } + /* This is the last step in the SFTP connect phase. Do note that while we get the homedir here, we get the "workingpath" in the DO action since the homedir will remain the same between request but the @@ -1485,187 +2120,14 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; case SSH_SFTP_QUOTE: - /* Send any quote commands */ - { - const char *cp; - - /* - * Support some of the "FTP" commands - * - * 'sshc->quote_item' is already verified to be non-NULL before it - * switched to this state. - */ - char *cmd = sshc->quote_item->data; - sshc->acceptfail = FALSE; - - /* if a command starts with an asterisk, which a legal SFTP command never - can, the command will be allowed to fail without it causing any - aborts or cancels etc. It will cause libcurl to act as if the command - is successful, whatever the server responds. */ - - if(cmd[0] == '*') { - cmd++; - sshc->acceptfail = TRUE; - } - - if(strcasecompare("pwd", cmd)) { - /* output debug output if that is requested */ - char *tmp = aprintf("257 \"%s\" is current directory.\n", - sshp->path); - if(!tmp) { - result = CURLE_OUT_OF_MEMORY; - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - break; - } - Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"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 - using ordinary FTP. */ - result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp)); - free(tmp); - if(result) { - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = result; - } - else - state(data, SSH_SFTP_NEXT_QUOTE); - break; - } - - /* - * the arguments following the command must be separated from the - * command with a space so we can check for it unconditionally - */ - cp = strchr(cmd, ' '); - if(!cp) { - failf(data, "Syntax error command '%s', missing parameter", - cmd); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; - break; - } - - /* - * also, every command takes at least one argument so we get that - * first argument right now - */ - result = Curl_get_pathname(&cp, &sshc->quote_path1, sshc->homedir); + /* Send quote commands */ + result = sftp_quote(data, sshc, sshp); if(result) { - if(result == CURLE_OUT_OF_MEMORY) - failf(data, "Out of memory"); - else - failf(data, "Syntax error: Bad first parameter to '%s'", cmd); state(data, SSH_SFTP_CLOSE); sshc->nextstate = SSH_NO_STATE; sshc->actualcode = result; - break; } - - /* - * SFTP is a binary protocol, so we don't send text commands - * to the server. Instead, we scan for commands used by - * OpenSSH's sftp program and call the appropriate libssh2 - * functions. - */ - if(strncasecompare(cmd, "chgrp ", 6) || - strncasecompare(cmd, "chmod ", 6) || - strncasecompare(cmd, "chown ", 6) || - strncasecompare(cmd, "atime ", 6) || - strncasecompare(cmd, "mtime ", 6)) { - /* attribute change */ - - /* sshc->quote_path1 contains the mode to set */ - /* get the destination */ - result = Curl_get_pathname(&cp, &sshc->quote_path2, sshc->homedir); - if(result) { - if(result == CURLE_OUT_OF_MEMORY) - failf(data, "Out of memory"); - else - failf(data, "Syntax error in %s: Bad second parameter", cmd); - Curl_safefree(sshc->quote_path1); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = result; - break; - } - memset(&sshp->quote_attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); - state(data, SSH_SFTP_QUOTE_STAT); - break; - } - if(strncasecompare(cmd, "ln ", 3) || - strncasecompare(cmd, "symlink ", 8)) { - /* symbolic linking */ - /* sshc->quote_path1 is the source */ - /* get the destination */ - result = Curl_get_pathname(&cp, &sshc->quote_path2, sshc->homedir); - if(result) { - if(result == CURLE_OUT_OF_MEMORY) - failf(data, "Out of memory"); - else - failf(data, - "Syntax error in ln/symlink: Bad second parameter"); - Curl_safefree(sshc->quote_path1); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = result; - break; - } - state(data, SSH_SFTP_QUOTE_SYMLINK); - break; - } - else if(strncasecompare(cmd, "mkdir ", 6)) { - /* create dir */ - state(data, SSH_SFTP_QUOTE_MKDIR); - break; - } - else if(strncasecompare(cmd, "rename ", 7)) { - /* rename file */ - /* first param is the source path */ - /* second param is the dest. path */ - result = Curl_get_pathname(&cp, &sshc->quote_path2, sshc->homedir); - if(result) { - if(result == CURLE_OUT_OF_MEMORY) - failf(data, "Out of memory"); - else - failf(data, "Syntax error in rename: Bad second parameter"); - Curl_safefree(sshc->quote_path1); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = result; - break; - } - state(data, SSH_SFTP_QUOTE_RENAME); - break; - } - else if(strncasecompare(cmd, "rmdir ", 6)) { - /* delete dir */ - state(data, SSH_SFTP_QUOTE_RMDIR); - break; - } - else if(strncasecompare(cmd, "rm ", 3)) { - state(data, SSH_SFTP_QUOTE_UNLINK); - break; - } -#ifdef HAS_STATVFS_SUPPORT - else if(strncasecompare(cmd, "statvfs ", 8)) { - state(data, SSH_SFTP_QUOTE_STATVFS); - break; - } -#endif - - failf(data, "Unknown SFTP command"); - Curl_safefree(sshc->quote_path1); - Curl_safefree(sshc->quote_path2); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; break; - } case SSH_SFTP_NEXT_QUOTE: Curl_safefree(sshc->quote_path1); @@ -1688,125 +2150,13 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; case SSH_SFTP_QUOTE_STAT: - { - char *cmd = sshc->quote_item->data; - sshc->acceptfail = FALSE; - - /* if a command starts with an asterisk, which a legal SFTP command never - can, the command will be allowed to fail without it causing any - aborts or cancels etc. It will cause libcurl to act as if the command - is successful, whatever the server responds. */ - - if(cmd[0] == '*') { - cmd++; - sshc->acceptfail = TRUE; + result = sftp_quote_stat(data, sshc, sshp, block); + if(result) { + state(data, SSH_SFTP_CLOSE); + sshc->nextstate = SSH_NO_STATE; + sshc->actualcode = result; } - - if(!strncasecompare(cmd, "chmod", 5)) { - /* Since chown and chgrp only set owner OR group but libssh2 wants to - * set them both at once, we need to obtain the current ownership - * first. This takes an extra protocol round trip. - */ - rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshc->quote_path2, - curlx_uztoui(strlen(sshc->quote_path2)), - LIBSSH2_SFTP_STAT, - &sshp->quote_attrs); - if(rc == LIBSSH2_ERROR_EAGAIN) { - break; - } - if(rc && !sshc->acceptfail) { /* get those attributes */ - sftperr = libssh2_sftp_last_error(sshc->sftp_session); - Curl_safefree(sshc->quote_path1); - Curl_safefree(sshc->quote_path2); - failf(data, "Attempt to get SFTP stats failed: %s", - sftp_libssh2_strerror(sftperr)); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; - break; - } - } - - /* Now set the new attributes... */ - if(strncasecompare(cmd, "chgrp", 5)) { - sshp->quote_attrs.gid = strtoul(sshc->quote_path1, NULL, 10); - sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; - if(sshp->quote_attrs.gid == 0 && !ISDIGIT(sshc->quote_path1[0]) && - !sshc->acceptfail) { - Curl_safefree(sshc->quote_path1); - Curl_safefree(sshc->quote_path2); - failf(data, "Syntax error: chgrp gid not a number"); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; - break; - } - } - else if(strncasecompare(cmd, "chmod", 5)) { - sshp->quote_attrs.permissions = strtoul(sshc->quote_path1, NULL, 8); - sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_PERMISSIONS; - /* permissions are octal */ - if(sshp->quote_attrs.permissions == 0 && - !ISDIGIT(sshc->quote_path1[0])) { - Curl_safefree(sshc->quote_path1); - Curl_safefree(sshc->quote_path2); - failf(data, "Syntax error: chmod permissions not a number"); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; - break; - } - } - else if(strncasecompare(cmd, "chown", 5)) { - sshp->quote_attrs.uid = strtoul(sshc->quote_path1, NULL, 10); - sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; - if(sshp->quote_attrs.uid == 0 && !ISDIGIT(sshc->quote_path1[0]) && - !sshc->acceptfail) { - Curl_safefree(sshc->quote_path1); - Curl_safefree(sshc->quote_path2); - failf(data, "Syntax error: chown uid not a number"); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; - break; - } - } - else if(strncasecompare(cmd, "atime", 5) || - strncasecompare(cmd, "mtime", 5)) { - time_t date = Curl_getdate_capped(sshc->quote_path1); - bool fail = FALSE; - - if(date == -1) { - failf(data, "incorrect date format for %.*s", 5, cmd); - fail = TRUE; - } -#if SIZEOF_TIME_T > SIZEOF_LONG - if(date > 0xffffffff) { - /* if 'long' can't old >32bit, this date cannot be sent */ - failf(data, "date overflow"); - fail = TRUE; - } -#endif - if(fail) { - Curl_safefree(sshc->quote_path1); - Curl_safefree(sshc->quote_path2); - state(data, SSH_SFTP_CLOSE); - sshc->nextstate = SSH_NO_STATE; - sshc->actualcode = CURLE_QUOTE_ERROR; - break; - } - if(strncasecompare(cmd, "atime", 5)) - sshp->quote_attrs.atime = (unsigned long)date; - else /* mtime */ - sshp->quote_attrs.mtime = (unsigned long)date; - - sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_ACMODTIME; - } - - /* Now send the completed structure... */ - state(data, SSH_SFTP_QUOTE_SETSTAT); break; - } case SSH_SFTP_QUOTE_SETSTAT: rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshc->quote_path2, @@ -1817,7 +2167,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "Attempt to set SFTP stats failed: %s", @@ -1840,7 +2190,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "symlink command failed: %s", @@ -1856,12 +2206,12 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) case SSH_SFTP_QUOTE_MKDIR: rc = libssh2_sftp_mkdir_ex(sshc->sftp_session, sshc->quote_path1, curlx_uztoui(strlen(sshc->quote_path1)), - data->set.new_directory_perms); + (long)data->set.new_directory_perms); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "mkdir command failed: %s", sftp_libssh2_strerror(sftperr)); @@ -1886,7 +2236,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); Curl_safefree(sshc->quote_path2); failf(data, "rename command failed: %s", @@ -1906,7 +2256,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "rmdir command failed: %s", sftp_libssh2_strerror(sftperr)); @@ -1925,7 +2275,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "rm command failed: %s", sftp_libssh2_strerror(sftperr)); state(data, SSH_SFTP_CLOSE); @@ -1948,7 +2298,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc && !sshc->acceptfail) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); Curl_safefree(sshc->quote_path1); failf(data, "statvfs command failed: %s", sftp_libssh2_strerror(sftperr)); @@ -1958,11 +2308,11 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } else if(rc == 0) { - #ifdef _MSC_VER - #define CURL_LIBSSH2_VFS_SIZE_MASK "I64u" - #else - #define CURL_LIBSSH2_VFS_SIZE_MASK "llu" - #endif +#ifdef _MSC_VER +#define CURL_LIBSSH2_VFS_SIZE_MASK "I64u" +#else +#define CURL_LIBSSH2_VFS_SIZE_MASK "llu" +#endif char *tmp = aprintf("statvfs:\n" "f_bsize: %" CURL_LIBSSH2_VFS_SIZE_MASK "\n" "f_frsize: %" CURL_LIBSSH2_VFS_SIZE_MASK "\n" @@ -2022,7 +2372,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } if(rc == 0) { - data->info.filetime = attrs.mtime; + data->info.filetime = (time_t)attrs.mtime; } state(data, SSH_SFTP_TRANS_INIT); @@ -2041,188 +2391,13 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; case SSH_SFTP_UPLOAD_INIT: - { - unsigned long flags; - /* - * NOTE!!! libssh2 requires that the destination path is a full path - * that includes the destination file and name OR ends in a "/" - * If this is not done the destination file will be named the - * same name as the last directory in the path. - */ - - if(data->state.resume_from) { - LIBSSH2_SFTP_ATTRIBUTES attrs; - if(data->state.resume_from < 0) { - rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, - curlx_uztoui(strlen(sshp->path)), - LIBSSH2_SFTP_STAT, &attrs); - if(rc == LIBSSH2_ERROR_EAGAIN) { - break; - } - if(rc) { - data->state.resume_from = 0; - } - else { - curl_off_t size = attrs.filesize; - if(size < 0) { - failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); - return CURLE_BAD_DOWNLOAD_RESUME; - } - data->state.resume_from = attrs.filesize; - } - } - } - - if(data->set.remote_append) - /* Try to open for append, but create if nonexisting */ - flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_APPEND; - else if(data->state.resume_from > 0) - /* If we have restart position then open for append */ - flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_APPEND; - else - /* Clear file before writing (normal behavior) */ - flags = LIBSSH2_FXF_WRITE|LIBSSH2_FXF_CREAT|LIBSSH2_FXF_TRUNC; - - sshc->sftp_handle = - libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, - curlx_uztoui(strlen(sshp->path)), - flags, data->set.new_file_perms, - LIBSSH2_SFTP_OPENFILE); - - if(!sshc->sftp_handle) { - rc = libssh2_session_last_errno(sshc->ssh_session); - - if(LIBSSH2_ERROR_EAGAIN == rc) - break; - - if(LIBSSH2_ERROR_SFTP_PROTOCOL == rc) - /* only when there was an SFTP protocol error can we extract - the sftp error! */ - sftperr = libssh2_sftp_last_error(sshc->sftp_session); - else - sftperr = LIBSSH2_FX_OK; /* not an sftp error at all */ - - if(sshc->secondCreateDirs) { - state(data, SSH_SFTP_CLOSE); - sshc->actualcode = sftperr != LIBSSH2_FX_OK ? - sftp_libssh2_error_to_CURLE(sftperr):CURLE_SSH; - failf(data, "Creating the dir/file failed: %s", - sftp_libssh2_strerror(sftperr)); - break; - } - if(((sftperr == LIBSSH2_FX_NO_SUCH_FILE) || - (sftperr == LIBSSH2_FX_FAILURE) || - (sftperr == LIBSSH2_FX_NO_SUCH_PATH)) && - (data->set.ftp_create_missing_dirs && - (strlen(sshp->path) > 1))) { - /* try to create the path remotely */ - rc = 0; /* clear rc and continue */ - sshc->secondCreateDirs = 1; - state(data, SSH_SFTP_CREATE_DIRS_INIT); - break; - } - state(data, SSH_SFTP_CLOSE); - sshc->actualcode = sftperr != LIBSSH2_FX_OK ? - sftp_libssh2_error_to_CURLE(sftperr):CURLE_SSH; - if(!sshc->actualcode) { - /* Sometimes, for some reason libssh2_sftp_last_error() returns zero - even though libssh2_sftp_open() failed previously! We need to - work around that! */ - sshc->actualcode = CURLE_SSH; - sftperr = LIBSSH2_FX_OK; - } - failf(data, "Upload failed: %s (%lu/%d)", - sftperr != LIBSSH2_FX_OK ? - sftp_libssh2_strerror(sftperr):"ssh error", - sftperr, rc); - break; - } - - /* If we have a restart point then we need to seek to the correct - position. */ - if(data->state.resume_from > 0) { - /* Let's read off the proper amount of bytes from the input. */ - if(conn->seek_func) { - Curl_set_in_callback(data, true); - seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, - SEEK_SET); - Curl_set_in_callback(data, false); - } - - if(seekerr != CURL_SEEKFUNC_OK) { - curl_off_t passed = 0; - - if(seekerr != CURL_SEEKFUNC_CANTSEEK) { - failf(data, "Could not seek stream"); - return CURLE_FTP_COULDNT_USE_REST; - } - /* seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ - do { - char scratch[4*1024]; - size_t readthisamountnow = - (data->state.resume_from - passed > - (curl_off_t)sizeof(scratch)) ? - sizeof(scratch) : curlx_sotouz(data->state.resume_from - passed); - - size_t actuallyread; - Curl_set_in_callback(data, true); - actuallyread = data->state.fread_func(scratch, 1, - readthisamountnow, - data->state.in); - Curl_set_in_callback(data, false); - - passed += actuallyread; - if((actuallyread == 0) || (actuallyread > readthisamountnow)) { - /* this checks for greater-than only to make sure that the - CURL_READFUNC_ABORT return code still aborts */ - failf(data, "Failed to read data"); - return CURLE_FTP_COULDNT_USE_REST; - } - } while(passed < data->state.resume_from); - } - - /* now, decrease the size of the read */ - if(data->state.infilesize > 0) { - data->state.infilesize -= data->state.resume_from; - data->req.size = data->state.infilesize; - Curl_pgrsSetUploadSize(data, data->state.infilesize); - } - - SFTP_SEEK(sshc->sftp_handle, data->state.resume_from); - } - if(data->state.infilesize > 0) { - data->req.size = data->state.infilesize; - Curl_pgrsSetUploadSize(data, data->state.infilesize); - } - /* upload data */ - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); - - /* not set by Curl_xfer_setup to preserve keepon bits */ - conn->sockfd = conn->writesockfd; - + result = sftp_upload_init(data, sshc, sshp, block); if(result) { state(data, SSH_SFTP_CLOSE); + sshc->nextstate = SSH_NO_STATE; sshc->actualcode = result; } - else { - /* store this original bitmask setup to use later on if we can't - figure out a "real" bitmask */ - sshc->orig_waitfor = data->req.keepon; - - /* we want to use the _sending_ function even when the socket turns - out readable as the underlying libssh2 sftp send function will deal - with both accordingly */ - data->state.select_bits = CURL_CSELECT_OUT; - - /* since we don't really wait for anything at this point, we want the - state machine to move on as soon as possible so we set a very short - timeout here */ - Curl_expire(data, 0, EXPIRE_RUN_NOW); - - state(data, SSH_STOP); - } break; - } case SSH_SFTP_CREATE_DIRS_INIT: if(strlen(sshp->path) > 1) { @@ -2250,7 +2425,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) /* 'mode' - parameter is preliminary - default to 0644 */ rc = libssh2_sftp_mkdir_ex(sshc->sftp_session, sshp->path, curlx_uztoui(strlen(sshp->path)), - data->set.new_directory_perms); + (long)data->set.new_directory_perms); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } @@ -2258,17 +2433,17 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) ++sshc->slash_pos; if(rc < 0) { /* - * Abort if failure wasn't that the dir already exists or the + * 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 */ - sftperr = libssh2_sftp_last_error(sshc->sftp_session); + unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); if((sftperr != LIBSSH2_FX_FILE_ALREADY_EXISTS) && (sftperr != LIBSSH2_FX_FAILURE) && (sftperr != LIBSSH2_FX_PERMISSION_DENIED)) { result = sftp_libssh2_error_to_CURLE(sftperr); state(data, SSH_SFTP_CLOSE); - sshc->actualcode = result?result:CURLE_SSH; + sshc->actualcode = result ? result : CURLE_SSH; break; } rc = 0; /* clear rc and continue */ @@ -2287,12 +2462,12 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) * This is a directory that we are trying to get, so produce a directory * listing */ - sshc->sftp_handle = libssh2_sftp_open_ex(sshc->sftp_session, - sshp->path, - curlx_uztoui( - strlen(sshp->path)), - 0, 0, LIBSSH2_SFTP_OPENDIR); + sshc->sftp_handle = + libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, + curlx_uztoui(strlen(sshp->path)), + 0, 0, LIBSSH2_SFTP_OPENDIR); if(!sshc->sftp_handle) { + unsigned long sftperr; if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; @@ -2303,94 +2478,18 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) sftp_libssh2_strerror(sftperr)); state(data, SSH_SFTP_CLOSE); result = sftp_libssh2_error_to_CURLE(sftperr); - sshc->actualcode = result?result:CURLE_SSH; + sshc->actualcode = result ? result : CURLE_SSH; break; } - sshp->readdir_filename = malloc(PATH_MAX + 1); - if(!sshp->readdir_filename) { - state(data, SSH_SFTP_CLOSE); - sshc->actualcode = CURLE_OUT_OF_MEMORY; - break; - } - sshp->readdir_longentry = malloc(PATH_MAX + 1); - if(!sshp->readdir_longentry) { - Curl_safefree(sshp->readdir_filename); - state(data, SSH_SFTP_CLOSE); - sshc->actualcode = CURLE_OUT_OF_MEMORY; - break; - } - Curl_dyn_init(&sshp->readdir, PATH_MAX * 2); + Curl_dyn_init(&sshp->readdir, CURL_PATH_MAX * 2); state(data, SSH_SFTP_READDIR); break; case SSH_SFTP_READDIR: - rc = libssh2_sftp_readdir_ex(sshc->sftp_handle, - sshp->readdir_filename, - PATH_MAX, - sshp->readdir_longentry, - PATH_MAX, - &sshp->readdir_attrs); - if(rc == LIBSSH2_ERROR_EAGAIN) { - break; - } - if(rc > 0) { - readdir_len = (size_t) rc; - sshp->readdir_filename[readdir_len] = '\0'; - - if(data->set.list_only) { - result = Curl_client_write(data, CLIENTWRITE_BODY, - sshp->readdir_filename, - readdir_len); - if(!result) - result = Curl_client_write(data, CLIENTWRITE_BODY, - (char *)"\n", 1); - if(result) { - state(data, SSH_STOP); - break; - } - - } - else { - result = Curl_dyn_add(&sshp->readdir, sshp->readdir_longentry); - - if(!result) { - if((sshp->readdir_attrs.flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) && - ((sshp->readdir_attrs.permissions & LIBSSH2_SFTP_S_IFMT) == - LIBSSH2_SFTP_S_IFLNK)) { - Curl_dyn_init(&sshp->readdir_link, PATH_MAX); - result = Curl_dyn_addf(&sshp->readdir_link, "%s%s", sshp->path, - sshp->readdir_filename); - state(data, SSH_SFTP_READDIR_LINK); - if(!result) - break; - } - else { - state(data, SSH_SFTP_READDIR_BOTTOM); - break; - } - } - sshc->actualcode = result; - state(data, SSH_SFTP_CLOSE); - break; - } - } - else if(rc == 0) { - Curl_safefree(sshp->readdir_filename); - Curl_safefree(sshp->readdir_longentry); - state(data, SSH_SFTP_READDIR_DONE); - break; - } - else if(rc < 0) { - sftperr = libssh2_sftp_last_error(sshc->sftp_session); - result = sftp_libssh2_error_to_CURLE(sftperr); - sshc->actualcode = result?result:CURLE_SSH; - failf(data, "Could not open remote file for reading: %s :: %d", - sftp_libssh2_strerror(sftperr), - libssh2_session_last_errno(sshc->ssh_session)); - Curl_safefree(sshp->readdir_filename); - Curl_safefree(sshp->readdir_longentry); + result = sftp_readdir(data, sshc, sshp, block); + if(result) { + sshc->actualcode = result; state(data, SSH_SFTP_CLOSE); - break; } break; @@ -2398,9 +2497,10 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) rc = libssh2_sftp_symlink_ex(sshc->sftp_session, Curl_dyn_ptr(&sshp->readdir_link), - (int)Curl_dyn_len(&sshp->readdir_link), + (unsigned int) + Curl_dyn_len(&sshp->readdir_link), sshp->readdir_filename, - PATH_MAX, LIBSSH2_SFTP_READLINK); + CURL_PATH_MAX, LIBSSH2_SFTP_READLINK); if(rc == LIBSSH2_ERROR_EAGAIN) { break; } @@ -2410,8 +2510,6 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) result = Curl_dyn_addf(&sshp->readdir, " -> %s", sshp->readdir_filename); if(result) { - Curl_safefree(sshp->readdir_filename); - Curl_safefree(sshp->readdir_longentry); state(data, SSH_SFTP_CLOSE); sshc->actualcode = result; break; @@ -2444,11 +2542,9 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; } sshc->sftp_handle = NULL; - Curl_safefree(sshp->readdir_filename); - Curl_safefree(sshp->readdir_longentry); /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); state(data, SSH_STOP); break; @@ -2459,9 +2555,10 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) sshc->sftp_handle = libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, curlx_uztoui(strlen(sshp->path)), - LIBSSH2_FXF_READ, data->set.new_file_perms, + LIBSSH2_FXF_READ, (long)data->set.new_file_perms, LIBSSH2_SFTP_OPENFILE); if(!sshc->sftp_handle) { + unsigned long sftperr; if(libssh2_session_last_errno(sshc->ssh_session) == LIBSSH2_ERROR_EAGAIN) { rc = LIBSSH2_ERROR_EAGAIN; @@ -2472,149 +2569,20 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) sftp_libssh2_strerror(sftperr)); state(data, SSH_SFTP_CLOSE); result = sftp_libssh2_error_to_CURLE(sftperr); - sshc->actualcode = result?result:CURLE_SSH; + sshc->actualcode = result ? result : CURLE_SSH; break; } state(data, SSH_SFTP_DOWNLOAD_STAT); break; case SSH_SFTP_DOWNLOAD_STAT: - { - LIBSSH2_SFTP_ATTRIBUTES attrs; - - rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, - curlx_uztoui(strlen(sshp->path)), - LIBSSH2_SFTP_STAT, &attrs); - if(rc == LIBSSH2_ERROR_EAGAIN) { - break; + result = sftp_download_stat(data, sshc, sshp, block); + if(result) { + state(data, SSH_SFTP_CLOSE); + sshc->nextstate = SSH_NO_STATE; + sshc->actualcode = result; } - if(rc || - !(attrs.flags & LIBSSH2_SFTP_ATTR_SIZE) || - (attrs.filesize == 0)) { - /* - * libssh2_sftp_open() didn't return an error, so maybe the server - * just doesn't support stat() - * OR the server doesn't return a file size with a stat() - * OR file size is 0 - */ - data->req.size = -1; - data->req.maxdownload = -1; - Curl_pgrsSetDownloadSize(data, -1); - } - else { - curl_off_t size = attrs.filesize; - - if(size < 0) { - failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); - return CURLE_BAD_DOWNLOAD_RESUME; - } - if(data->state.use_range) { - curl_off_t from, to; - char *ptr; - char *ptr2; - CURLofft to_t; - CURLofft from_t; - - from_t = curlx_strtoofft(data->state.range, &ptr, 10, &from); - if(from_t == CURL_OFFT_FLOW) - return CURLE_RANGE_ERROR; - while(*ptr && (ISBLANK(*ptr) || (*ptr == '-'))) - ptr++; - to_t = curlx_strtoofft(ptr, &ptr2, 10, &to); - if(to_t == CURL_OFFT_FLOW) - return CURLE_RANGE_ERROR; - if((to_t == CURL_OFFT_INVAL) /* 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 (%" - CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" - CURL_FORMAT_CURL_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; - } - - SFTP_SEEK(sshc->sftp_handle, from); - } - data->req.size = size; - data->req.maxdownload = size; - Curl_pgrsSetDownloadSize(data, size); - } - - /* We can resume if we can seek to the resume position */ - if(data->state.resume_from) { - if(data->state.resume_from < 0) { - /* We're supposed to download the last abs(from) bytes */ - if((curl_off_t)attrs.filesize < -data->state.resume_from) { - failf(data, "Offset (%" - CURL_FORMAT_CURL_OFF_T ") was beyond file size (%" - CURL_FORMAT_CURL_OFF_T ")", - data->state.resume_from, (curl_off_t)attrs.filesize); - return CURLE_BAD_DOWNLOAD_RESUME; - } - /* download from where? */ - data->state.resume_from += attrs.filesize; - } - else { - if((curl_off_t)attrs.filesize < data->state.resume_from) { - failf(data, "Offset (%" CURL_FORMAT_CURL_OFF_T - ") was beyond file size (%" CURL_FORMAT_CURL_OFF_T ")", - data->state.resume_from, (curl_off_t)attrs.filesize); - return CURLE_BAD_DOWNLOAD_RESUME; - } - } - /* 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); - SFTP_SEEK(sshc->sftp_handle, data->state.resume_from); - } - } - - /* Setup the actual download */ - if(data->req.size == 0) { - /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); - infof(data, "File already completely downloaded"); - state(data, SSH_STOP); break; - } - Curl_xfer_setup(data, FIRSTSOCKET, data->req.size, FALSE, -1); - - /* not set by Curl_xfer_setup to preserve keepon bits */ - conn->writesockfd = conn->sockfd; - - /* we want to use the _receiving_ function even when the socket turns - out writableable as the underlying libssh2 recv function will deal - with both accordingly */ - data->state.select_bits = CURL_CSELECT_IN; - - if(result) { - /* this should never occur; the close state should be entered - at the time the error occurs */ - state(data, SSH_SFTP_CLOSE); - sshc->actualcode = result; - } - else { - state(data, SSH_STOP); - } - break; case SSH_SFTP_CLOSE: if(sshc->sftp_handle) { @@ -2709,7 +2677,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) case SSH_SCP_UPLOAD_INIT: /* * libssh2 requires that the destination path is a full path that - * includes the destination file and name OR ends in a "/" . If this is + * includes the destination file and name OR ends in a "/" . If this is * not done the destination file will be named the same name as the last * directory in the path. */ @@ -2741,7 +2709,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) /* upload data */ data->req.size = data->state.infilesize; Curl_pgrsSetUploadSize(data, data->state.infilesize); - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->sockfd = conn->writesockfd; @@ -2751,7 +2719,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) sshc->actualcode = result; } else { - /* store this original bitmask setup to use later on if we can't + /* store this original bitmask setup to use later on if we cannot figure out a "real" bitmask */ sshc->orig_waitfor = data->req.keepon; @@ -2812,7 +2780,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) /* download data */ bytecount = (curl_off_t)sb.st_size; data->req.maxdownload = (curl_off_t)sb.st_size; - Curl_xfer_setup(data, FIRSTSOCKET, bytecount, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, bytecount, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->writesockfd = conn->sockfd; @@ -2911,7 +2879,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) break; case SSH_SESSION_DISCONNECT: - /* during weird times when we've been prematurely aborted, the channel + /* during weird times when we have been prematurely aborted, the channel is still alive when we reach this state and we MUST kill the channel properly first */ if(sshc->ssh_channel) { @@ -3067,7 +3035,7 @@ static int ssh_getsock(struct Curl_easy *data, * When one of the libssh2 functions has returned LIBSSH2_ERROR_EAGAIN this * function is used to figure out in what direction and stores this info so * that the multi interface can take advantage of it. Make sure to call this - * function in all cases so that when it _doesn't_ return EAGAIN we can + * function in all cases so that when it _does not_ return EAGAIN we can * restore the default wait bits. */ static void ssh_block2waitfor(struct Curl_easy *data, bool block) @@ -3079,12 +3047,12 @@ static void ssh_block2waitfor(struct Curl_easy *data, bool 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) | - ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND)?KEEP_SEND:0); + conn->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND) ? KEEP_RECV : 0) | + ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND) ? KEEP_SEND : 0); } } if(!dir) - /* It didn't block or libssh2 didn't reveal in which direction, put back + /* It did not block or libssh2 did not reveal in which direction, put back the original set */ conn->waitfor = sshc->orig_waitfor; } @@ -3098,9 +3066,9 @@ static CURLcode ssh_multi_statemach(struct Curl_easy *data, bool *done) bool block; /* we store the status and use that to provide a ssh_getsock() implementation */ do { - result = ssh_statemach_act(data, &block); - *done = (sshc->state == SSH_STOP) ? TRUE : FALSE; - /* if there's no error, it isn't done and it didn't EWOULDBLOCK, then + result = ssh_statemachine(data, &block); + *done = (sshc->state == SSH_STOP); + /* if there is no error, it is not done and it did not EWOULDBLOCK, then try again */ } while(!result && !*done && !block); ssh_block2waitfor(data, block); @@ -3121,7 +3089,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, timediff_t left = 1000; struct curltime now = Curl_now(); - result = ssh_statemach_act(data, &block); + result = ssh_statemachine(data, &block); if(result) break; @@ -3157,7 +3125,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 > 1000 ? 1000 : left); } } @@ -3224,7 +3192,7 @@ static ssize_t ssh_tls_send(libssh2_socket_t sock, const void *buffer, /* swap in the TLS writer function for this call only, and then swap back the SSH one again */ conn->send[0] = ssh->tls_send; - result = Curl_conn_send(data, socknum, buffer, length, &nwrite); + result = Curl_conn_send(data, socknum, buffer, length, FALSE, &nwrite); conn->send[0] = backup; if(result == CURLE_AGAIN) return -EAGAIN; /* magic return code for libssh2 */ @@ -3282,15 +3250,13 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done) return CURLE_FAILED_INIT; } -#ifdef HAVE_LIBSSH2_VERSION /* Set the packet read timeout if the libssh2 version supports it */ #if LIBSSH2_VERSION_NUM >= 0x010B00 if(data->set.server_response_timeout > 0) { libssh2_session_set_read_timeout(sshc->ssh_session, - data->set.server_response_timeout / 1000); + (long)(data->set.server_response_timeout / 1000)); } #endif -#endif #ifndef CURL_DISABLE_PROXY if(conn->http_proxy.proxytype == CURLPROXY_HTTPS) { @@ -3452,7 +3418,7 @@ static CURLcode scp_doing(struct Curl_easy *data, static CURLcode ssh_do(struct Curl_easy *data, bool *done) { CURLcode result; - bool connected = 0; + bool connected = FALSE; struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; @@ -3489,7 +3455,7 @@ static CURLcode scp_disconnect(struct Curl_easy *data, (void) dead_connection; if(sshc->ssh_session) { - /* only if there's a session still around to use! */ + /* only if there is a session still around to use! */ state(data, SSH_SESSION_DISCONNECT); result = ssh_block_statemach(data, conn, TRUE); } @@ -3512,8 +3478,6 @@ static CURLcode ssh_done(struct Curl_easy *data, CURLcode status) result = status; Curl_safefree(sshp->path); - Curl_safefree(sshp->readdir_filename); - Curl_safefree(sshp->readdir_longentry); Curl_dyn_free(&sshp->readdir); if(Curl_pgrsDone(data)) @@ -3537,17 +3501,18 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, } static ssize_t scp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, CURLcode *err) + const void *mem, size_t len, bool eos, CURLcode *err) { ssize_t nwrite; struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; (void)sockindex; /* we only support SCP on the fixed known primary socket */ + (void)eos; /* libssh2_channel_write() returns int! */ nwrite = (ssize_t) libssh2_channel_write(sshc->ssh_channel, mem, len); - ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); + ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN)); if(nwrite == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; @@ -3572,7 +3537,7 @@ static ssize_t scp_recv(struct Curl_easy *data, int sockindex, /* libssh2_channel_read() returns int */ nread = (ssize_t) libssh2_channel_read(sshc->ssh_channel, mem, len); - ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); + ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN)); if(nread == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; nread = -1; @@ -3645,7 +3610,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, DEBUGF(infof(data, "SSH DISCONNECT starts now")); if(sshc->ssh_session) { - /* only if there's a session still around to use! */ + /* only if there is a session still around to use! */ state(data, SSH_SFTP_SHUTDOWN); result = ssh_block_statemach(data, conn, TRUE); } @@ -3675,16 +3640,17 @@ static CURLcode sftp_done(struct Curl_easy *data, CURLcode status, /* return number of sent bytes */ static ssize_t sftp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, CURLcode *err) + const void *mem, size_t len, bool eos, CURLcode *err) { ssize_t nwrite; struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; (void)sockindex; + (void)eos; nwrite = libssh2_sftp_write(sshc->sftp_handle, mem, len); - ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); + ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN)); if(nwrite == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; @@ -3712,7 +3678,7 @@ static ssize_t sftp_recv(struct Curl_easy *data, int sockindex, nread = libssh2_sftp_read(sshc->sftp_handle, mem, len); - ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE); + ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN)); if(nread == LIBSSH2_ERROR_EAGAIN) { *err = CURLE_AGAIN; diff --git a/deps/curl/lib/vssh/ssh.h b/deps/curl/lib/vssh/ssh.h index ca0533aa..f2d42a3d 100644 --- a/deps/curl/lib/vssh/ssh.h +++ b/deps/curl/lib/vssh/ssh.h @@ -30,6 +30,8 @@ #include #include #elif defined(USE_LIBSSH) +/* in 0.10.0 or later, ignore deprecated warnings */ +#define SSH_SUPPRESS_DEPRECATED #include #include #elif defined(USE_WOLFSSH) @@ -37,6 +39,8 @@ #include #endif +#include "curl_path.h" + /**************************************************************************** * SSH unique setup ***************************************************************************/ @@ -107,6 +111,8 @@ typedef enum { SSH_LAST /* never used */ } sshstate; +#define CURL_PATH_MAX 1024 + /* this struct is used in the HandleData struct which is part of the Curl_easy, which means this is used on a per-easy handle basis. Everything that is strictly related to a connection is banned from this @@ -116,8 +122,8 @@ struct SSHPROTO { #ifdef USE_LIBSSH2 struct dynbuf readdir_link; struct dynbuf readdir; - char *readdir_filename; - char *readdir_longentry; + char readdir_filename[CURL_PATH_MAX + 1]; + char readdir_longentry[CURL_PATH_MAX + 1]; LIBSSH2_SFTP_ATTRIBUTES quote_attrs; /* used by the SFTP_QUOTE state */ @@ -163,7 +169,7 @@ struct ssh_conn { unsigned kbd_state; /* 0 or 1 */ ssh_key privkey; ssh_key pubkey; - int auth_methods; + unsigned int auth_methods; ssh_session ssh_session; ssh_scp scp_session; sftp_session sftp_session; @@ -243,10 +249,10 @@ struct ssh_conn { #endif #ifdef HAVE_LIBSSH2_VERSION -/* get it run-time if possible */ +/* get it runtime if possible */ #define CURL_LIBSSH2_VERSION libssh2_version(0) #else -/* use build-time if run-time not possible */ +/* use build-time if runtime not possible */ #define CURL_LIBSSH2_VERSION LIBSSH2_VERSION #endif diff --git a/deps/curl/lib/vssh/wolfssh.c b/deps/curl/lib/vssh/wolfssh.c index c6b94fd5..54008211 100644 --- a/deps/curl/lib/vssh/wolfssh.c +++ b/deps/curl/lib/vssh/wolfssh.c @@ -28,8 +28,6 @@ #include -#include -#include #include "urldata.h" #include "cfilters.h" #include "connect.h" @@ -94,6 +92,7 @@ const struct Curl_handler Curl_handler_scp = { wssh_getsock, /* perform_getsock */ wscp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SSH, /* defport */ @@ -123,6 +122,7 @@ const struct Curl_handler Curl_handler_sftp = { wssh_getsock, /* perform_getsock */ wsftp_disconnect, /* disconnect */ ZERO_NULL, /* write_resp */ + ZERO_NULL, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_SSH, /* defport */ @@ -218,13 +218,15 @@ static void state(struct Curl_easy *data, sshstate nowstate) } static ssize_t wscp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, CURLcode *err) + const void *mem, size_t len, bool eos, + CURLcode *err) { ssize_t nwrite = 0; (void)data; (void)sockindex; /* we only support SCP on the fixed known primary socket */ (void)mem; (void)len; + (void)eos; (void)err; return nwrite; @@ -245,16 +247,17 @@ static ssize_t wscp_recv(struct Curl_easy *data, int sockindex, /* return number of sent bytes */ static ssize_t wsftp_send(struct Curl_easy *data, int sockindex, - const void *mem, size_t len, CURLcode *err) + const void *mem, size_t len, bool eos, CURLcode *err) { struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; word32 offset[2]; int rc; (void)sockindex; + (void)eos; - offset[0] = (word32)sshc->offset&0xFFFFFFFF; - offset[1] = (word32)(sshc->offset>>32)&0xFFFFFFFF; + offset[0] = (word32)sshc->offset & 0xFFFFFFFF; + offset[1] = (word32)(sshc->offset >> 32) & 0xFFFFFFFF; rc = wolfSSH_SFTP_SendWritePacket(sshc->ssh_session, sshc->handle, sshc->handleSz, @@ -278,7 +281,7 @@ static ssize_t wsftp_send(struct Curl_easy *data, int sockindex, return -1; } DEBUGASSERT(rc == (int)len); - infof(data, "sent %zu bytes SFTP from offset %" CURL_FORMAT_CURL_OFF_T, + infof(data, "sent %zu bytes SFTP from offset %" FMT_OFF_T, len, sshc->offset); sshc->offset += len; return (ssize_t)rc; @@ -297,8 +300,8 @@ static ssize_t wsftp_recv(struct Curl_easy *data, int sockindex, word32 offset[2]; (void)sockindex; - offset[0] = (word32)sshc->offset&0xFFFFFFFF; - offset[1] = (word32)(sshc->offset>>32)&0xFFFFFFFF; + offset[0] = (word32)sshc->offset & 0xFFFFFFFF; + offset[1] = (word32)(sshc->offset >> 32) & 0xFFFFFFFF; rc = wolfSSH_SFTP_SendReadPacket(sshc->ssh_session, sshc->handle, sshc->handleSz, @@ -398,7 +401,7 @@ static CURLcode wssh_connect(struct Curl_easy *data, bool *done) rc = wolfSSH_SetUsername(sshc->ssh_session, conn->user); if(rc != WS_SUCCESS) { - failf(data, "wolfSSH failed to set user name"); + failf(data, "wolfSSH failed to set username"); goto error; } @@ -431,7 +434,7 @@ error: /* * wssh_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 + * blocking and without reaching the end. The data the pointer 'block' points * to will be set to TRUE if the wolfssh function returns EAGAIN meaning it * wants to be called again when the socket is ready */ @@ -444,7 +447,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) struct SSHPROTO *sftp_scp = data->req.p.ssh; WS_SFTPNAME *name; int rc = 0; - *block = FALSE; /* we're not blocking by default */ + *block = FALSE; /* we are not blocking by default */ do { switch(sshc->state) { @@ -575,7 +578,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) else { curl_off_t size = ((curl_off_t)attrs.sz[1] << 32) | attrs.sz[0]; if(size < 0) { - failf(data, "Bad file size (%" CURL_FORMAT_CURL_OFF_T ")", size); + failf(data, "Bad file size (%" FMT_OFF_T ")", size); return CURLE_BAD_DOWNLOAD_RESUME; } data->state.resume_from = size; @@ -625,11 +628,11 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) if(data->state.resume_from > 0) { /* Let's read off the proper amount of bytes from the input. */ int seekerr = CURL_SEEKFUNC_OK; - if(conn->seek_func) { - Curl_set_in_callback(data, true); - seekerr = conn->seek_func(conn->seek_client, data->state.resume_from, - SEEK_SET); - Curl_set_in_callback(data, false); + if(data->set.seek_func) { + Curl_set_in_callback(data, TRUE); + seekerr = data->set.seek_func(data->set.seek_client, + data->state.resume_from, SEEK_SET); + Curl_set_in_callback(data, FALSE); } if(seekerr != CURL_SEEKFUNC_OK) { @@ -639,7 +642,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) failf(data, "Could not seek stream"); return CURLE_FTP_COULDNT_USE_REST; } - /* seekerr == CURL_SEEKFUNC_CANTSEEK (can't seek to offset) */ + /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */ do { char scratch[4*1024]; size_t readthisamountnow = @@ -648,11 +651,11 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) sizeof(scratch) : curlx_sotouz(data->state.resume_from - passed); size_t actuallyread; - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); actuallyread = data->state.fread_func(scratch, 1, readthisamountnow, data->state.in); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); passed += actuallyread; if((actuallyread == 0) || (actuallyread > readthisamountnow)) { @@ -678,7 +681,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) Curl_pgrsSetUploadSize(data, data->state.infilesize); } /* upload data */ - Curl_xfer_setup(data, -1, -1, FALSE, FIRSTSOCKET); + Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->sockfd = conn->writesockfd; @@ -688,7 +691,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) sshc->actualcode = result; } else { - /* store this original bitmask setup to use later on if we can't + /* store this original bitmask setup to use later on if we cannot figure out a "real" bitmask */ sshc->orig_waitfor = data->req.keepon; @@ -697,7 +700,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) with both accordingly */ data->state.select_bits = CURL_CSELECT_OUT; - /* since we don't really wait for anything at this point, we want the + /* 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 set a very short timeout here */ Curl_expire(data, 0, EXPIRE_RUN_NOW); @@ -760,13 +763,13 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) return CURLE_SSH; } - size = ((curl_off_t)attrs.sz[1] <<32) | attrs.sz[0]; + size = ((curl_off_t)attrs.sz[1] << 32) | attrs.sz[0]; data->req.size = size; data->req.maxdownload = size; Curl_pgrsSetDownloadSize(data, size); - infof(data, "SFTP download %" CURL_FORMAT_CURL_OFF_T " bytes", size); + infof(data, "SFTP download %" FMT_OFF_T " bytes", size); /* We cannot seek with wolfSSH so resuming and range requests are not possible */ @@ -778,12 +781,12 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block) /* Setup the actual download */ if(data->req.size == 0) { /* no data to transfer */ - Curl_xfer_setup(data, -1, -1, FALSE, -1); + Curl_xfer_setup_nop(data); infof(data, "File already completely downloaded"); state(data, SSH_STOP); break; } - Curl_xfer_setup(data, FIRSTSOCKET, data->req.size, FALSE, -1); + Curl_xfer_setup1(data, CURL_XFER_RECV, data->req.size, FALSE); /* not set by Curl_xfer_setup to preserve keepon bits */ conn->writesockfd = conn->sockfd; @@ -905,8 +908,8 @@ static CURLcode wssh_multi_statemach(struct Curl_easy *data, bool *done) implementation */ do { result = wssh_statemach_act(data, &block); - *done = (sshc->state == SSH_STOP) ? TRUE : FALSE; - /* if there's no error, it isn't done and it didn't EWOULDBLOCK, then + *done = (sshc->state == SSH_STOP); + /* if there is no error, it is not done and it did not EWOULDBLOCK, then try again */ if(*done) { DEBUGF(infof(data, "wssh_statemach_act says DONE")); @@ -959,7 +962,7 @@ CURLcode wsftp_perform(struct Curl_easy *data, static CURLcode wssh_do(struct Curl_easy *data, bool *done) { CURLcode result; - bool connected = 0; + bool connected = FALSE; struct connectdata *conn = data->conn; struct ssh_conn *sshc = &conn->proto.sshc; @@ -1025,7 +1028,7 @@ static CURLcode wssh_block_statemach(struct Curl_easy *data, /* wait for the socket to become ready */ (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write, - left>1000?1000:left); /* ignore result */ + left > 1000 ? 1000 : left); /* ignore result */ } } @@ -1119,7 +1122,7 @@ static CURLcode wsftp_disconnect(struct Curl_easy *data, DEBUGF(infof(data, "SSH DISCONNECT starts now")); if(conn->proto.sshc.ssh_session) { - /* only if there's a session still around to use! */ + /* only if there is a session still around to use! */ state(data, SSH_SFTP_SHUTDOWN); result = wssh_block_statemach(data, TRUE); } diff --git a/deps/curl/lib/vtls/.checksrc b/deps/curl/lib/vtls/.checksrc new file mode 100644 index 00000000..9066946c --- /dev/null +++ b/deps/curl/lib/vtls/.checksrc @@ -0,0 +1,2 @@ +enable STRERROR +enable STRNCPY diff --git a/deps/curl/lib/vtls/bearssl.c b/deps/curl/lib/vtls/bearssl.c index 16f9c4e9..53fd4a6b 100644 --- a/deps/curl/lib/vtls/bearssl.c +++ b/deps/curl/lib/vtls/bearssl.c @@ -28,6 +28,7 @@ #include #include "bearssl.h" +#include "cipher_suite.h" #include "urldata.h" #include "sendf.h" #include "inet_pton.h" @@ -37,7 +38,6 @@ #include "select.h" #include "multiif.h" #include "curl_printf.h" -#include "strcase.h" /* The last #include files should be: */ #include "curl_memory.h" @@ -63,6 +63,7 @@ struct bearssl_ssl_backend_data { bool active; /* size of pending write, yet to be flushed */ size_t pending_write; + BIT(sent_shutdown); }; struct cafile_parser { @@ -120,9 +121,9 @@ static CURLcode load_cafile(struct cafile_source *source, br_x509_pkey *pkey; FILE *fp = 0; unsigned char buf[BUFSIZ]; - const unsigned char *p; + const unsigned char *p = NULL; const char *name; - size_t n, i, pushed; + size_t n = 0, i, pushed; DEBUGASSERT(source->type == CAFILE_SOURCE_PATH || source->type == CAFILE_SOURCE_BLOB); @@ -327,7 +328,7 @@ static unsigned x509_end_chain(const br_x509_class **ctx) struct x509_context *x509 = (struct x509_context *)ctx; if(!x509->verifypeer) { - return br_x509_decoder_last_error(&x509->decoder); + return (unsigned)br_x509_decoder_last_error(&x509->decoder); } return x509->minimal.vtable->end_chain(&x509->minimal.vtable); @@ -360,219 +361,171 @@ static const br_x509_class x509_vtable = { x509_get_pkey }; -struct st_cipher { - const char *name; /* Cipher suite IANA name. It starts with "TLS_" prefix */ - const char *alias_name; /* Alias name is the same as OpenSSL cipher name */ - uint16_t num; /* BearSSL cipher suite */ -}; +static CURLcode +bearssl_set_ssl_version_min_max(struct Curl_easy *data, + br_ssl_engine_context *ssl_eng, + struct ssl_primary_config *conn_config) +{ + unsigned version_min, version_max; -/* Macro to initialize st_cipher data structure */ -#define CIPHER_DEF(num, alias) { #num, alias, BR_##num } + switch(conn_config->version) { + case CURL_SSLVERSION_DEFAULT: + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + version_min = BR_TLS10; + break; + case CURL_SSLVERSION_TLSv1_1: + version_min = BR_TLS11; + break; + case CURL_SSLVERSION_TLSv1_2: + version_min = BR_TLS12; + break; + case CURL_SSLVERSION_TLSv1_3: + failf(data, "BearSSL: does not support TLS 1.3"); + return CURLE_SSL_CONNECT_ERROR; + default: + failf(data, "BearSSL: unsupported minimum TLS version value"); + return CURLE_SSL_CONNECT_ERROR; + } -static const struct st_cipher ciphertable[] = { + switch(conn_config->version_max) { + case CURL_SSLVERSION_MAX_DEFAULT: + case CURL_SSLVERSION_MAX_NONE: + case CURL_SSLVERSION_MAX_TLSv1_3: + case CURL_SSLVERSION_MAX_TLSv1_2: + version_max = BR_TLS12; + break; + case CURL_SSLVERSION_MAX_TLSv1_1: + version_max = BR_TLS11; + break; + case CURL_SSLVERSION_MAX_TLSv1_0: + version_max = BR_TLS10; + break; + default: + failf(data, "BearSSL: unsupported maximum TLS version value"); + return CURLE_SSL_CONNECT_ERROR; + } + + br_ssl_engine_set_versions(ssl_eng, version_min, version_max); + + return CURLE_OK; +} + +static const uint16_t ciphertable[] = { /* RFC 2246 TLS 1.0 */ - CIPHER_DEF(TLS_RSA_WITH_3DES_EDE_CBC_SHA, /* 0x000A */ - "DES-CBC3-SHA"), + BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA, /* 0x000A */ /* RFC 3268 TLS 1.0 AES */ - CIPHER_DEF(TLS_RSA_WITH_AES_128_CBC_SHA, /* 0x002F */ - "AES128-SHA"), - CIPHER_DEF(TLS_RSA_WITH_AES_256_CBC_SHA, /* 0x0035 */ - "AES256-SHA"), + BR_TLS_RSA_WITH_AES_128_CBC_SHA, /* 0x002F */ + BR_TLS_RSA_WITH_AES_256_CBC_SHA, /* 0x0035 */ /* RFC 5246 TLS 1.2 */ - CIPHER_DEF(TLS_RSA_WITH_AES_128_CBC_SHA256, /* 0x003C */ - "AES128-SHA256"), - CIPHER_DEF(TLS_RSA_WITH_AES_256_CBC_SHA256, /* 0x003D */ - "AES256-SHA256"), + BR_TLS_RSA_WITH_AES_128_CBC_SHA256, /* 0x003C */ + BR_TLS_RSA_WITH_AES_256_CBC_SHA256, /* 0x003D */ /* RFC 5288 TLS 1.2 AES GCM */ - CIPHER_DEF(TLS_RSA_WITH_AES_128_GCM_SHA256, /* 0x009C */ - "AES128-GCM-SHA256"), - CIPHER_DEF(TLS_RSA_WITH_AES_256_GCM_SHA384, /* 0x009D */ - "AES256-GCM-SHA384"), + BR_TLS_RSA_WITH_AES_128_GCM_SHA256, /* 0x009C */ + BR_TLS_RSA_WITH_AES_256_GCM_SHA384, /* 0x009D */ /* RFC 4492 TLS 1.0 ECC */ - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, /* 0xC003 */ - "ECDH-ECDSA-DES-CBC3-SHA"), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC004 */ - "ECDH-ECDSA-AES128-SHA"), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC005 */ - "ECDH-ECDSA-AES256-SHA"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, /* 0xC008 */ - "ECDHE-ECDSA-DES-CBC3-SHA"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC009 */ - "ECDHE-ECDSA-AES128-SHA"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC00A */ - "ECDHE-ECDSA-AES256-SHA"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, /* 0xC00D */ - "ECDH-RSA-DES-CBC3-SHA"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, /* 0xC00E */ - "ECDH-RSA-AES128-SHA"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, /* 0xC00F */ - "ECDH-RSA-AES256-SHA"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, /* 0xC012 */ - "ECDHE-RSA-DES-CBC3-SHA"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, /* 0xC013 */ - "ECDHE-RSA-AES128-SHA"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, /* 0xC014 */ - "ECDHE-RSA-AES256-SHA"), + BR_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, /* 0xC003 */ + BR_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC004 */ + BR_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC005 */ + BR_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, /* 0xC008 */ + BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC009 */ + BR_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC00A */ + BR_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, /* 0xC00D */ + BR_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, /* 0xC00E */ + BR_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, /* 0xC00F */ + BR_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, /* 0xC012 */ + BR_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, /* 0xC013 */ + BR_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, /* 0xC014 */ /* RFC 5289 TLS 1.2 ECC HMAC SHA256/384 */ - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC023 */ - "ECDHE-ECDSA-AES128-SHA256"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC024 */ - "ECDHE-ECDSA-AES256-SHA384"), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC025 */ - "ECDH-ECDSA-AES128-SHA256"), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC026 */ - "ECDH-ECDSA-AES256-SHA384"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, /* 0xC027 */ - "ECDHE-RSA-AES128-SHA256"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, /* 0xC028 */ - "ECDHE-RSA-AES256-SHA384"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, /* 0xC029 */ - "ECDH-RSA-AES128-SHA256"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, /* 0xC02A */ - "ECDH-RSA-AES256-SHA384"), + BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC023 */ + BR_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC024 */ + BR_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC025 */ + BR_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC026 */ + BR_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, /* 0xC027 */ + BR_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, /* 0xC028 */ + BR_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, /* 0xC029 */ + BR_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, /* 0xC02A */ /* RFC 5289 TLS 1.2 GCM */ - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02B */ - "ECDHE-ECDSA-AES128-GCM-SHA256"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02C */ - "ECDHE-ECDSA-AES256-GCM-SHA384"), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02D */ - "ECDH-ECDSA-AES128-GCM-SHA256"), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02E */ - "ECDH-ECDSA-AES256-GCM-SHA384"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, /* 0xC02F */ - "ECDHE-RSA-AES128-GCM-SHA256"), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, /* 0xC030 */ - "ECDHE-RSA-AES256-GCM-SHA384"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, /* 0xC031 */ - "ECDH-RSA-AES128-GCM-SHA256"), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, /* 0xC032 */ - "ECDH-RSA-AES256-GCM-SHA384"), -#ifdef BR_TLS_RSA_WITH_AES_128_CCM + BR_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02B */ + BR_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02C */ + BR_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02D */ + BR_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02E */ + BR_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, /* 0xC02F */ + BR_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, /* 0xC030 */ + BR_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, /* 0xC031 */ + BR_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, /* 0xC032 */ +#ifdef BR_TLS_RSA_WITH_AES_128_CCM /* RFC 6655 TLS 1.2 CCM Supported since BearSSL 0.6 */ - CIPHER_DEF(TLS_RSA_WITH_AES_128_CCM, /* 0xC09C */ - "AES128-CCM"), - CIPHER_DEF(TLS_RSA_WITH_AES_256_CCM, /* 0xC09D */ - "AES256-CCM"), - CIPHER_DEF(TLS_RSA_WITH_AES_128_CCM_8, /* 0xC0A0 */ - "AES128-CCM8"), - CIPHER_DEF(TLS_RSA_WITH_AES_256_CCM_8, /* 0xC0A1 */ - "AES256-CCM8"), + BR_TLS_RSA_WITH_AES_128_CCM, /* 0xC09C */ + BR_TLS_RSA_WITH_AES_256_CCM, /* 0xC09D */ + BR_TLS_RSA_WITH_AES_128_CCM_8, /* 0xC0A0 */ + BR_TLS_RSA_WITH_AES_256_CCM_8, /* 0xC0A1 */ /* RFC 7251 TLS 1.2 ECC CCM Supported since BearSSL 0.6 */ - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_CCM, /* 0xC0AC */ - "ECDHE-ECDSA-AES128-CCM"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_CCM, /* 0xC0AD */ - "ECDHE-ECDSA-AES256-CCM"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, /* 0xC0AE */ - "ECDHE-ECDSA-AES128-CCM8"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8, /* 0xC0AF */ - "ECDHE-ECDSA-AES256-CCM8"), + BR_TLS_ECDHE_ECDSA_WITH_AES_128_CCM, /* 0xC0AC */ + BR_TLS_ECDHE_ECDSA_WITH_AES_256_CCM, /* 0xC0AD */ + BR_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, /* 0xC0AE */ + BR_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8, /* 0xC0AF */ #endif /* RFC 7905 TLS 1.2 ChaCha20-Poly1305 Supported since BearSSL 0.2 */ - CIPHER_DEF(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA8 */ - "ECDHE-RSA-CHACHA20-POLY1305"), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA9 */ - "ECDHE-ECDSA-CHACHA20-POLY1305"), + BR_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA8 */ + BR_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA9 */ }; #define NUM_OF_CIPHERS (sizeof(ciphertable) / sizeof(ciphertable[0])) -#define CIPHER_NAME_BUF_LEN 64 - -static bool is_separator(char c) -{ - /* Return whether character is a cipher list separator. */ - switch(c) { - case ' ': - case '\t': - case ':': - case ',': - case ';': - return true; - } - return false; -} static CURLcode bearssl_set_selected_ciphers(struct Curl_easy *data, br_ssl_engine_context *ssl_eng, const char *ciphers) { - uint16_t selected_ciphers[NUM_OF_CIPHERS]; - size_t selected_count = 0; - const char *cipher_start = ciphers; - const char *cipher_end; - size_t i, j; + uint16_t selected[NUM_OF_CIPHERS]; + size_t count = 0, i; + const char *ptr, *end; - if(!cipher_start) - return CURLE_SSL_CIPHER; + for(ptr = ciphers; ptr[0] != '\0' && count < NUM_OF_CIPHERS; ptr = end) { + uint16_t id = Curl_cipher_suite_walk_str(&ptr, &end); - while(true) { - const char *cipher; - size_t clen; - - /* Extract the next cipher name from the ciphers string */ - while(is_separator(*cipher_start)) - ++cipher_start; - if(!*cipher_start) - break; - cipher_end = cipher_start; - while(*cipher_end && !is_separator(*cipher_end)) - ++cipher_end; - - clen = cipher_end - cipher_start; - cipher = cipher_start; - - cipher_start = cipher_end; - - /* Lookup the cipher name in the table of available ciphers. If the cipher - name starts with "TLS_" we do the lookup by IANA name. Otherwise, we try - to match cipher name by an (OpenSSL) alias. */ - if(strncasecompare(cipher, "TLS_", 4)) { - for(i = 0; i < NUM_OF_CIPHERS && - (strlen(ciphertable[i].name) == clen) && - !strncasecompare(cipher, ciphertable[i].name, clen); ++i); + /* Check if cipher is supported */ + if(id) { + for(i = 0; i < NUM_OF_CIPHERS && ciphertable[i] != id; i++); + if(i == NUM_OF_CIPHERS) + id = 0; } - else { - for(i = 0; i < NUM_OF_CIPHERS && - (strlen(ciphertable[i].alias_name) == clen) && - !strncasecompare(cipher, ciphertable[i].alias_name, clen); ++i); - } - if(i == NUM_OF_CIPHERS) { - infof(data, "BearSSL: unknown cipher in list: %.*s", - (int)clen, cipher); + if(!id) { + if(ptr[0] != '\0') + infof(data, "BearSSL: unknown cipher in list: \"%.*s\"", + (int) (end - ptr), ptr); continue; } /* No duplicates allowed */ - for(j = 0; j < selected_count && - selected_ciphers[j] != ciphertable[i].num; j++); - if(j < selected_count) { - infof(data, "BearSSL: duplicate cipher in list: %.*s", - (int)clen, cipher); + for(i = 0; i < count && selected[i] != id; i++); + if(i < count) { + infof(data, "BearSSL: duplicate cipher in list: \"%.*s\"", + (int) (end - ptr), ptr); continue; } - DEBUGASSERT(selected_count < NUM_OF_CIPHERS); - selected_ciphers[selected_count] = ciphertable[i].num; - ++selected_count; + selected[count++] = id; } - if(selected_count == 0) { + if(count == 0) { failf(data, "BearSSL: no supported cipher in list"); return CURLE_SSL_CIPHER; } - br_ssl_engine_set_suites(ssl_eng, selected_ciphers, selected_count); + br_ssl_engine_set_suites(ssl_eng, selected, count); return CURLE_OK; } @@ -592,41 +545,11 @@ static CURLcode bearssl_connect_step1(struct Curl_cfilter *cf, const bool verifypeer = conn_config->verifypeer; const bool verifyhost = conn_config->verifyhost; CURLcode ret; - unsigned version_min, version_max; int session_set = 0; DEBUGASSERT(backend); CURL_TRC_CF(data, cf, "connect_step1"); - switch(conn_config->version) { - case CURL_SSLVERSION_SSLv2: - failf(data, "BearSSL does not support SSLv2"); - return CURLE_SSL_CONNECT_ERROR; - case CURL_SSLVERSION_SSLv3: - failf(data, "BearSSL does not support SSLv3"); - return CURLE_SSL_CONNECT_ERROR; - case CURL_SSLVERSION_TLSv1_0: - version_min = BR_TLS10; - version_max = BR_TLS10; - break; - case CURL_SSLVERSION_TLSv1_1: - version_min = BR_TLS11; - version_max = BR_TLS11; - break; - case CURL_SSLVERSION_TLSv1_2: - version_min = BR_TLS12; - version_max = BR_TLS12; - break; - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: - version_min = BR_TLS10; - version_max = BR_TLS12; - break; - default: - failf(data, "BearSSL: unknown CURLOPT_SSLVERSION"); - return CURLE_SSL_CONNECT_ERROR; - } - if(verifypeer) { if(ca_info_blob) { struct cafile_source source; @@ -661,7 +584,11 @@ static CURLcode bearssl_connect_step1(struct Curl_cfilter *cf, /* initialize SSL context */ br_ssl_client_init_full(&backend->ctx, &backend->x509.minimal, backend->anchors, backend->anchors_len); - br_ssl_engine_set_versions(&backend->ctx.eng, version_min, version_max); + + ret = bearssl_set_ssl_version_min_max(data, &backend->ctx.eng, conn_config); + if(ret != CURLE_OK) + return ret; + br_ssl_engine_set_buffer(&backend->ctx.eng, backend->buf, sizeof(backend->buf), 1); @@ -681,12 +608,16 @@ static CURLcode bearssl_connect_step1(struct Curl_cfilter *cf, backend->x509.verifyhost = verifyhost; br_ssl_engine_set_x509(&backend->ctx.eng, &backend->x509.vtable); - if(ssl_config->primary.sessionid) { - void *session; + if(ssl_config->primary.cache_session) { + void *sdata; + size_t slen; + const br_ssl_session_parameters *session; CURL_TRC_CF(data, cf, "connect_step1, check session cache"); Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, &session, NULL)) { + if(!Curl_ssl_getsessionid(cf, data, &connssl->peer, &sdata, &slen, NULL) && + slen == sizeof(*session)) { + session = sdata; br_ssl_engine_set_session_parameters(&backend->ctx.eng, session); session_set = 1; infof(data, "BearSSL: reusing session ID"); @@ -726,10 +657,10 @@ static CURLcode bearssl_connect_step1(struct Curl_cfilter *cf, /* give application a chance to interfere with SSL set up. */ if(data->set.ssl.fsslctx) { - Curl_set_in_callback(data, true); + Curl_set_in_callback(data, TRUE); ret = (*data->set.ssl.fsslctx)(data, &backend->ctx, data->set.ssl.fsslctxp); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(ret) { failf(data, "BearSSL: error signaled by ssl ctx callback"); return ret; @@ -745,28 +676,6 @@ static CURLcode bearssl_connect_step1(struct Curl_cfilter *cf, return CURLE_OK; } -static void bearssl_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) -{ - if(!cf->connected) { - curl_socket_t sock = Curl_conn_cf_get_socket(cf->next, data); - if(sock != CURL_SOCKET_BAD) { - struct ssl_connect_data *connssl = cf->ctx; - struct bearssl_ssl_backend_data *backend = - (struct bearssl_ssl_backend_data *)connssl->backend; - unsigned state = br_ssl_engine_current_state(&backend->ctx.eng); - - if(state & BR_SSL_SENDREC) { - Curl_pollset_set_out_only(data, ps, sock); - } - else { - Curl_pollset_set_in_only(data, ps, sock); - } - } - } -} - static CURLcode bearssl_run_until(struct Curl_cfilter *cf, struct Curl_easy *data, unsigned target) @@ -783,6 +692,7 @@ static CURLcode bearssl_run_until(struct Curl_cfilter *cf, DEBUGASSERT(backend); + connssl->io_need = CURL_SSL_IO_NEED_NONE; for(;;) { state = br_ssl_engine_current_state(&backend->ctx.eng); if(state & BR_SSL_CLOSED) { @@ -807,7 +717,9 @@ static CURLcode bearssl_run_until(struct Curl_cfilter *cf, failf(data, "SSL: X.509 verification: " "chain could not be linked to a trust anchor"); return CURLE_PEER_FAILED_VERIFICATION; + default:; } + failf(data, "BearSSL: connection error 0x%04x", err); /* X.509 errors are documented to have the range 32..63 */ if(err >= 32 && err < 64) return CURLE_PEER_FAILED_VERIFICATION; @@ -817,9 +729,12 @@ static CURLcode bearssl_run_until(struct Curl_cfilter *cf, return CURLE_OK; if(state & BR_SSL_SENDREC) { buf = br_ssl_engine_sendrec_buf(&backend->ctx.eng, &len); - ret = Curl_conn_cf_send(cf->next, data, (char *)buf, len, &result); + ret = Curl_conn_cf_send(cf->next, data, (char *)buf, len, FALSE, + &result); CURL_TRC_CF(data, cf, "ssl_send(len=%zu) -> %zd, %d", len, ret, result); if(ret <= 0) { + if(result == CURLE_AGAIN) + connssl->io_need |= CURL_SSL_IO_NEED_SEND; return result; } br_ssl_engine_sendrec_ack(&backend->ctx.eng, ret); @@ -830,9 +745,11 @@ static CURLcode bearssl_run_until(struct Curl_cfilter *cf, CURL_TRC_CF(data, cf, "ssl_recv(len=%zu) -> %zd, %d", len, ret, result); if(ret == 0) { failf(data, "SSL: EOF without close notify"); - return CURLE_READ_ERROR; + return CURLE_RECV_ERROR; } if(ret <= 0) { + if(result == CURLE_AGAIN) + connssl->io_need |= CURL_SSL_IO_NEED_RECV; return result; } br_ssl_engine_recvrec_ack(&backend->ctx.eng, ret); @@ -846,6 +763,8 @@ static CURLcode bearssl_connect_step2(struct Curl_cfilter *cf, struct ssl_connect_data *connssl = cf->ctx; struct bearssl_ssl_backend_data *backend = (struct bearssl_ssl_backend_data *)connssl->backend; + br_ssl_session_parameters session; + char cipher_str[64]; CURLcode ret; DEBUGASSERT(backend); @@ -856,6 +775,8 @@ static CURLcode bearssl_connect_step2(struct Curl_cfilter *cf, return CURLE_OK; if(ret == CURLE_OK) { unsigned int tver; + int subver = 0; + if(br_ssl_engine_current_state(&backend->ctx.eng) == BR_SSL_CLOSED) { failf(data, "SSL: connection closed during handshake"); return CURLE_SSL_CONNECT_ERROR; @@ -863,16 +784,32 @@ static CURLcode bearssl_connect_step2(struct Curl_cfilter *cf, connssl->connecting_state = ssl_connect_3; /* Informational message */ tver = br_ssl_engine_get_version(&backend->ctx.eng); - if(tver == 0x0303) - infof(data, "SSL connection using TLSv1.2"); - else if(tver == 0x0304) - infof(data, "SSL connection using TLSv1.3"); - else - infof(data, "SSL connection using TLS 0x%x", tver); + switch(tver) { + case BR_TLS12: + subver = 2; /* 1.2 */ + break; + case BR_TLS11: + subver = 1; /* 1.1 */ + break; + case BR_TLS10: /* 1.0 */ + default: /* unknown, leave it at zero */ + break; + } + br_ssl_engine_get_session_parameters(&backend->ctx.eng, &session); + Curl_cipher_suite_get_str(session.cipher_suite, cipher_str, + sizeof(cipher_str), TRUE); + infof(data, "BearSSL: TLS v1.%d connection using %s", subver, + cipher_str); } return ret; } +static void bearssl_session_free(void *sessionid, size_t idsize) +{ + (void)idsize; + free(sessionid); +} + static CURLcode bearssl_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) { @@ -890,14 +827,11 @@ static CURLcode bearssl_connect_step3(struct Curl_cfilter *cf, const char *proto; proto = br_ssl_engine_get_selected_protocol(&backend->ctx.eng); - Curl_alpn_set_negotiated(cf, data, (const unsigned char *)proto, - proto? strlen(proto) : 0); + Curl_alpn_set_negotiated(cf, data, connssl, (const unsigned char *)proto, + proto ? strlen(proto) : 0); } - if(ssl_config->primary.sessionid) { - bool incache; - bool added = FALSE; - void *oldsession; + if(ssl_config->primary.cache_session) { br_ssl_session_parameters *session; session = malloc(sizeof(*session)); @@ -905,16 +839,12 @@ static CURLcode bearssl_connect_step3(struct Curl_cfilter *cf, return CURLE_OUT_OF_MEMORY; br_ssl_engine_get_session_parameters(&backend->ctx.eng, session); Curl_ssl_sessionid_lock(data); - incache = !(Curl_ssl_getsessionid(cf, data, &oldsession, NULL)); - if(incache) - Curl_ssl_delsessionid(data, oldsession); - ret = Curl_ssl_addsessionid(cf, data, session, 0, &added); + ret = Curl_ssl_set_sessionid(cf, data, &connssl->peer, NULL, + session, sizeof(*session), + bearssl_session_free); Curl_ssl_sessionid_unlock(data); - if(!added) - free(session); - if(ret) { - return CURLE_OUT_OF_MEMORY; - } + if(ret) + return ret; } connssl->connecting_state = ssl_connect_done; @@ -1007,9 +937,7 @@ static CURLcode bearssl_connect_common(struct Curl_cfilter *cf, return ret; } - while(ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { + while(ssl_connect_2 == connssl->connecting_state) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); @@ -1019,18 +947,16 @@ static CURLcode bearssl_connect_common(struct Curl_cfilter *cf, return CURLE_OPERATION_TIMEDOUT; } - /* if ssl is expecting something, check if it's available. */ - if(ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { - - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; + /* if ssl is expecting something, check if it is available. */ + if(connssl->io_need) { + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; CURL_TRC_CF(data, cf, "connect_common, check socket"); what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, - nonblocking?0:timeout_ms); + nonblocking ? 0 : timeout_ms); CURL_TRC_CF(data, cf, "connect_common, check socket -> %d", what); if(what < 0) { /* fatal error */ @@ -1057,11 +983,9 @@ static CURLcode bearssl_connect_common(struct Curl_cfilter *cf, * before step2 has completed while ensuring that a client using select() * or epoll() will always have a valid fdset to wait on. */ + connssl->io_need = CURL_SSL_IO_NEED_NONE; ret = bearssl_connect_step2(cf, data); - if(ret || (nonblocking && - (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state))) + if(ret || (nonblocking && (ssl_connect_2 == connssl->connecting_state))) return ret; } @@ -1152,6 +1076,43 @@ static void *bearssl_get_internals(struct ssl_connect_data *connssl, return &backend->ctx; } +static CURLcode bearssl_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct bearssl_ssl_backend_data *backend = + (struct bearssl_ssl_backend_data *)connssl->backend; + CURLcode result; + + DEBUGASSERT(backend); + if(!backend->active || cf->shutdown) { + *done = TRUE; + return CURLE_OK; + } + + *done = FALSE; + if(!backend->sent_shutdown) { + (void)send_shutdown; /* unknown how to suppress our close notify */ + br_ssl_engine_close(&backend->ctx.eng); + backend->sent_shutdown = TRUE; + } + + result = bearssl_run_until(cf, data, BR_SSL_CLOSED); + if(result == CURLE_OK) { + *done = TRUE; + } + else if(result == CURLE_AGAIN) { + CURL_TRC_CF(data, cf, "shutdown EAGAIN, io_need=%x", connssl->io_need); + result = CURLE_OK; + } + else + CURL_TRC_CF(data, cf, "shutdown error: %d", result); + + cf->shutdown = (result || *done); + return result; +} + static void bearssl_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; @@ -1159,13 +1120,10 @@ static void bearssl_close(struct Curl_cfilter *cf, struct Curl_easy *data) (struct bearssl_ssl_backend_data *)connssl->backend; size_t i; + (void)data; DEBUGASSERT(backend); - if(backend->active) { - backend->active = FALSE; - br_ssl_engine_close(&backend->ctx.eng); - (void)bearssl_run_until(cf, data, BR_SSL_CLOSED); - } + backend->active = FALSE; if(backend->anchors) { for(i = 0; i < backend->anchors_len; ++i) free(backend->anchors[i].dn.data); @@ -1173,11 +1131,6 @@ static void bearssl_close(struct Curl_cfilter *cf, struct Curl_easy *data) } } -static void bearssl_session_free(void *ptr) -{ - free(ptr); -} - static CURLcode bearssl_sha256sum(const unsigned char *input, size_t inputlen, unsigned char *sha256sum, @@ -1193,24 +1146,28 @@ static CURLcode bearssl_sha256sum(const unsigned char *input, const struct Curl_ssl Curl_ssl_bearssl = { { CURLSSLBACKEND_BEARSSL, "bearssl" }, /* info */ - SSLSUPP_CAINFO_BLOB | SSLSUPP_SSL_CTX | SSLSUPP_HTTPS_PROXY, + + SSLSUPP_CAINFO_BLOB | + SSLSUPP_SSL_CTX | + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CIPHER_LIST, + sizeof(struct bearssl_ssl_backend_data), Curl_none_init, /* init */ Curl_none_cleanup, /* cleanup */ bearssl_version, /* version */ Curl_none_check_cxn, /* check_cxn */ - Curl_none_shutdown, /* shutdown */ + bearssl_shutdown, /* shutdown */ bearssl_data_pending, /* data_pending */ bearssl_random, /* random */ Curl_none_cert_status_request, /* cert_status_request */ bearssl_connect, /* connect */ bearssl_connect_nonblocking, /* connect_nonblocking */ - bearssl_adjust_pollset, /* adjust_pollset */ + Curl_ssl_adjust_pollset, /* adjust_pollset */ bearssl_get_internals, /* get_internals */ bearssl_close, /* close_one */ Curl_none_close_all, /* close_all */ - bearssl_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -1218,9 +1175,9 @@ const struct Curl_ssl Curl_ssl_bearssl = { bearssl_sha256sum, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ bearssl_recv, /* recv decrypted data */ bearssl_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #endif /* USE_BEARSSL */ diff --git a/deps/curl/lib/vtls/cipher_suite.c b/deps/curl/lib/vtls/cipher_suite.c new file mode 100644 index 00000000..a694b146 --- /dev/null +++ b/deps/curl/lib/vtls/cipher_suite.c @@ -0,0 +1,891 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Jan Venekamp, + * + * 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_SECTRANSP) || defined(USE_MBEDTLS) || \ + defined(USE_BEARSSL) || defined(USE_RUSTLS) +#include "cipher_suite.h" +#include "curl_printf.h" +#include "strcase.h" +#include + +/* + * To support the CURLOPT_SSL_CIPHER_LIST option on SSL backends + * that do not support it natively, but do support setting a list of + * IANA ids, we need a list of all supported cipher suite names + * (OpenSSL and IANA) to be able to look up the IANA ids. + * + * To keep the binary size of this list down we compress each entry + * down to 2 + 6 bytes using the C preprocessor. + */ + +/* + * mbedTLS NOTE: mbedTLS has mbedtls_ssl_get_ciphersuite_id() to + * convert a string representation to an IANA id, we do not use that + * because it does not support "standard" OpenSSL cipher suite + * names, nor IANA names. + */ + +/* NOTE: also see tests/unit/unit3205.c */ + +/* Text for cipher suite parts (max 64 entries), + keep indexes below in sync with this! */ +static const char *cs_txt = + "\0" + "TLS" "\0" + "WITH" "\0" + "128" "\0" + "256" "\0" + "3DES" "\0" + "8" "\0" + "AES" "\0" + "AES128" "\0" + "AES256" "\0" + "CBC" "\0" + "CBC3" "\0" + "CCM" "\0" + "CCM8" "\0" + "CHACHA20" "\0" + "DES" "\0" + "DHE" "\0" + "ECDH" "\0" + "ECDHE" "\0" + "ECDSA" "\0" + "EDE" "\0" + "GCM" "\0" + "MD5" "\0" + "NULL" "\0" + "POLY1305" "\0" + "PSK" "\0" + "RSA" "\0" + "SHA" "\0" + "SHA256" "\0" + "SHA384" "\0" +#if defined(USE_MBEDTLS) + "ARIA" "\0" + "ARIA128" "\0" + "ARIA256" "\0" + "CAMELLIA" "\0" + "CAMELLIA128" "\0" + "CAMELLIA256" "\0" +#endif +#if defined(USE_SECTRANSP) + "40" "\0" + "ADH" "\0" + "AECDH" "\0" + "anon" "\0" + "DES40" "\0" + "DH" "\0" + "DSS" "\0" + "EDH" "\0" + "EXP" "\0" + "EXPORT" "\0" + "IDEA" "\0" + "RC2" "\0" + "RC4" "\0" +#endif +; +/* Indexes of above cs_txt */ +enum { + CS_TXT_IDX_, + CS_TXT_IDX_TLS, + CS_TXT_IDX_WITH, + CS_TXT_IDX_128, + CS_TXT_IDX_256, + CS_TXT_IDX_3DES, + CS_TXT_IDX_8, + CS_TXT_IDX_AES, + CS_TXT_IDX_AES128, + CS_TXT_IDX_AES256, + CS_TXT_IDX_CBC, + CS_TXT_IDX_CBC3, + CS_TXT_IDX_CCM, + CS_TXT_IDX_CCM8, + CS_TXT_IDX_CHACHA20, + CS_TXT_IDX_DES, + CS_TXT_IDX_DHE, + CS_TXT_IDX_ECDH, + CS_TXT_IDX_ECDHE, + CS_TXT_IDX_ECDSA, + CS_TXT_IDX_EDE, + CS_TXT_IDX_GCM, + CS_TXT_IDX_MD5, + CS_TXT_IDX_NULL, + CS_TXT_IDX_POLY1305, + CS_TXT_IDX_PSK, + CS_TXT_IDX_RSA, + CS_TXT_IDX_SHA, + CS_TXT_IDX_SHA256, + CS_TXT_IDX_SHA384, +#if defined(USE_MBEDTLS) + CS_TXT_IDX_ARIA, + CS_TXT_IDX_ARIA128, + CS_TXT_IDX_ARIA256, + CS_TXT_IDX_CAMELLIA, + CS_TXT_IDX_CAMELLIA128, + CS_TXT_IDX_CAMELLIA256, +#endif +#if defined(USE_SECTRANSP) + CS_TXT_IDX_40, + CS_TXT_IDX_ADH, + CS_TXT_IDX_AECDH, + CS_TXT_IDX_anon, + CS_TXT_IDX_DES40, + CS_TXT_IDX_DH, + CS_TXT_IDX_DSS, + CS_TXT_IDX_EDH, + CS_TXT_IDX_EXP, + CS_TXT_IDX_EXPORT, + CS_TXT_IDX_IDEA, + CS_TXT_IDX_RC2, + CS_TXT_IDX_RC4, +#endif + CS_TXT_LEN, +}; + +#define CS_ZIP_IDX(a, b, c, d, e, f, g, h) \ +{ \ + (uint8_t) ((((a) << 2) & 0xFF) | ((b) & 0x3F) >> 4), \ + (uint8_t) ((((b) << 4) & 0xFF) | ((c) & 0x3F) >> 2), \ + (uint8_t) ((((c) << 6) & 0xFF) | ((d) & 0x3F)), \ + (uint8_t) ((((e) << 2) & 0xFF) | ((f) & 0x3F) >> 4), \ + (uint8_t) ((((f) << 4) & 0xFF) | ((g) & 0x3F) >> 2), \ + (uint8_t) ((((g) << 6) & 0xFF) | ((h) & 0x3F)) \ +} +#define CS_ENTRY(id, a, b, c, d, e, f, g, h) \ +{ \ + id, \ + CS_ZIP_IDX( \ + CS_TXT_IDX_ ## a, CS_TXT_IDX_ ## b, \ + CS_TXT_IDX_ ## c, CS_TXT_IDX_ ## d, \ + CS_TXT_IDX_ ## e, CS_TXT_IDX_ ## f, \ + CS_TXT_IDX_ ## g, CS_TXT_IDX_ ## h \ + ) \ +} + +struct cs_entry { + uint16_t id; + uint8_t zip[6]; +}; + +/* !checksrc! disable COMMANOSPACE all */ +static const struct cs_entry cs_list [] = { + /* TLS 1.3 ciphers */ +#if defined(USE_SECTRANSP) || defined(USE_MBEDTLS) || defined(USE_RUSTLS) + CS_ENTRY(0x1301, TLS,AES,128,GCM,SHA256,,,), + CS_ENTRY(0x1302, TLS,AES,256,GCM,SHA384,,,), + CS_ENTRY(0x1303, TLS,CHACHA20,POLY1305,SHA256,,,,), + CS_ENTRY(0x1304, TLS,AES,128,CCM,SHA256,,,), + CS_ENTRY(0x1305, TLS,AES,128,CCM,8,SHA256,,), +#endif + /* TLS 1.2 ciphers */ + CS_ENTRY(0xC02B, TLS,ECDHE,ECDSA,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0xC02B, ECDHE,ECDSA,AES128,GCM,SHA256,,,), + CS_ENTRY(0xC02C, TLS,ECDHE,ECDSA,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0xC02C, ECDHE,ECDSA,AES256,GCM,SHA384,,,), + CS_ENTRY(0xC02F, TLS,ECDHE,RSA,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0xC02F, ECDHE,RSA,AES128,GCM,SHA256,,,), + CS_ENTRY(0xC030, TLS,ECDHE,RSA,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0xC030, ECDHE,RSA,AES256,GCM,SHA384,,,), + CS_ENTRY(0xCCA8, TLS,ECDHE,RSA,WITH,CHACHA20,POLY1305,SHA256,), + CS_ENTRY(0xCCA8, ECDHE,RSA,CHACHA20,POLY1305,,,,), + CS_ENTRY(0xCCA9, TLS,ECDHE,ECDSA,WITH,CHACHA20,POLY1305,SHA256,), + CS_ENTRY(0xCCA9, ECDHE,ECDSA,CHACHA20,POLY1305,,,,), +#if defined(USE_SECTRANSP) || defined(USE_MBEDTLS) || defined(USE_BEARSSL) + CS_ENTRY(0x002F, TLS,RSA,WITH,AES,128,CBC,SHA,), + CS_ENTRY(0x002F, AES128,SHA,,,,,,), + CS_ENTRY(0x0035, TLS,RSA,WITH,AES,256,CBC,SHA,), + CS_ENTRY(0x0035, AES256,SHA,,,,,,), + CS_ENTRY(0x003C, TLS,RSA,WITH,AES,128,CBC,SHA256,), + CS_ENTRY(0x003C, AES128,SHA256,,,,,,), + CS_ENTRY(0x003D, TLS,RSA,WITH,AES,256,CBC,SHA256,), + CS_ENTRY(0x003D, AES256,SHA256,,,,,,), + CS_ENTRY(0x009C, TLS,RSA,WITH,AES,128,GCM,SHA256,), + CS_ENTRY(0x009C, AES128,GCM,SHA256,,,,,), + CS_ENTRY(0x009D, TLS,RSA,WITH,AES,256,GCM,SHA384,), + CS_ENTRY(0x009D, AES256,GCM,SHA384,,,,,), + CS_ENTRY(0xC004, TLS,ECDH,ECDSA,WITH,AES,128,CBC,SHA), + CS_ENTRY(0xC004, ECDH,ECDSA,AES128,SHA,,,,), + CS_ENTRY(0xC005, TLS,ECDH,ECDSA,WITH,AES,256,CBC,SHA), + CS_ENTRY(0xC005, ECDH,ECDSA,AES256,SHA,,,,), + CS_ENTRY(0xC009, TLS,ECDHE,ECDSA,WITH,AES,128,CBC,SHA), + CS_ENTRY(0xC009, ECDHE,ECDSA,AES128,SHA,,,,), + CS_ENTRY(0xC00A, TLS,ECDHE,ECDSA,WITH,AES,256,CBC,SHA), + CS_ENTRY(0xC00A, ECDHE,ECDSA,AES256,SHA,,,,), + CS_ENTRY(0xC00E, TLS,ECDH,RSA,WITH,AES,128,CBC,SHA), + CS_ENTRY(0xC00E, ECDH,RSA,AES128,SHA,,,,), + CS_ENTRY(0xC00F, TLS,ECDH,RSA,WITH,AES,256,CBC,SHA), + CS_ENTRY(0xC00F, ECDH,RSA,AES256,SHA,,,,), + CS_ENTRY(0xC013, TLS,ECDHE,RSA,WITH,AES,128,CBC,SHA), + CS_ENTRY(0xC013, ECDHE,RSA,AES128,SHA,,,,), + CS_ENTRY(0xC014, TLS,ECDHE,RSA,WITH,AES,256,CBC,SHA), + CS_ENTRY(0xC014, ECDHE,RSA,AES256,SHA,,,,), + CS_ENTRY(0xC023, TLS,ECDHE,ECDSA,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0xC023, ECDHE,ECDSA,AES128,SHA256,,,,), + CS_ENTRY(0xC024, TLS,ECDHE,ECDSA,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0xC024, ECDHE,ECDSA,AES256,SHA384,,,,), + CS_ENTRY(0xC025, TLS,ECDH,ECDSA,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0xC025, ECDH,ECDSA,AES128,SHA256,,,,), + CS_ENTRY(0xC026, TLS,ECDH,ECDSA,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0xC026, ECDH,ECDSA,AES256,SHA384,,,,), + CS_ENTRY(0xC027, TLS,ECDHE,RSA,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0xC027, ECDHE,RSA,AES128,SHA256,,,,), + CS_ENTRY(0xC028, TLS,ECDHE,RSA,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0xC028, ECDHE,RSA,AES256,SHA384,,,,), + CS_ENTRY(0xC029, TLS,ECDH,RSA,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0xC029, ECDH,RSA,AES128,SHA256,,,,), + CS_ENTRY(0xC02A, TLS,ECDH,RSA,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0xC02A, ECDH,RSA,AES256,SHA384,,,,), + CS_ENTRY(0xC02D, TLS,ECDH,ECDSA,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0xC02D, ECDH,ECDSA,AES128,GCM,SHA256,,,), + CS_ENTRY(0xC02E, TLS,ECDH,ECDSA,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0xC02E, ECDH,ECDSA,AES256,GCM,SHA384,,,), + CS_ENTRY(0xC031, TLS,ECDH,RSA,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0xC031, ECDH,RSA,AES128,GCM,SHA256,,,), + CS_ENTRY(0xC032, TLS,ECDH,RSA,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0xC032, ECDH,RSA,AES256,GCM,SHA384,,,), +#endif +#if defined(USE_SECTRANSP) || defined(USE_MBEDTLS) + CS_ENTRY(0x0001, TLS,RSA,WITH,NULL,MD5,,,), + CS_ENTRY(0x0001, NULL,MD5,,,,,,), + CS_ENTRY(0x0002, TLS,RSA,WITH,NULL,SHA,,,), + CS_ENTRY(0x0002, NULL,SHA,,,,,,), + CS_ENTRY(0x002C, TLS,PSK,WITH,NULL,SHA,,,), + CS_ENTRY(0x002C, PSK,NULL,SHA,,,,,), + CS_ENTRY(0x002D, TLS,DHE,PSK,WITH,NULL,SHA,,), + CS_ENTRY(0x002D, DHE,PSK,NULL,SHA,,,,), + CS_ENTRY(0x002E, TLS,RSA,PSK,WITH,NULL,SHA,,), + CS_ENTRY(0x002E, RSA,PSK,NULL,SHA,,,,), + CS_ENTRY(0x0033, TLS,DHE,RSA,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0033, DHE,RSA,AES128,SHA,,,,), + CS_ENTRY(0x0039, TLS,DHE,RSA,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x0039, DHE,RSA,AES256,SHA,,,,), + CS_ENTRY(0x003B, TLS,RSA,WITH,NULL,SHA256,,,), + CS_ENTRY(0x003B, NULL,SHA256,,,,,,), + CS_ENTRY(0x0067, TLS,DHE,RSA,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x0067, DHE,RSA,AES128,SHA256,,,,), + CS_ENTRY(0x006B, TLS,DHE,RSA,WITH,AES,256,CBC,SHA256), + CS_ENTRY(0x006B, DHE,RSA,AES256,SHA256,,,,), + CS_ENTRY(0x008C, TLS,PSK,WITH,AES,128,CBC,SHA,), + CS_ENTRY(0x008C, PSK,AES128,CBC,SHA,,,,), + CS_ENTRY(0x008D, TLS,PSK,WITH,AES,256,CBC,SHA,), + CS_ENTRY(0x008D, PSK,AES256,CBC,SHA,,,,), + CS_ENTRY(0x0090, TLS,DHE,PSK,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0090, DHE,PSK,AES128,CBC,SHA,,,), + CS_ENTRY(0x0091, TLS,DHE,PSK,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x0091, DHE,PSK,AES256,CBC,SHA,,,), + CS_ENTRY(0x0094, TLS,RSA,PSK,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0094, RSA,PSK,AES128,CBC,SHA,,,), + CS_ENTRY(0x0095, TLS,RSA,PSK,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x0095, RSA,PSK,AES256,CBC,SHA,,,), + CS_ENTRY(0x009E, TLS,DHE,RSA,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x009E, DHE,RSA,AES128,GCM,SHA256,,,), + CS_ENTRY(0x009F, TLS,DHE,RSA,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x009F, DHE,RSA,AES256,GCM,SHA384,,,), + CS_ENTRY(0x00A8, TLS,PSK,WITH,AES,128,GCM,SHA256,), + CS_ENTRY(0x00A8, PSK,AES128,GCM,SHA256,,,,), + CS_ENTRY(0x00A9, TLS,PSK,WITH,AES,256,GCM,SHA384,), + CS_ENTRY(0x00A9, PSK,AES256,GCM,SHA384,,,,), + CS_ENTRY(0x00AA, TLS,DHE,PSK,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x00AA, DHE,PSK,AES128,GCM,SHA256,,,), + CS_ENTRY(0x00AB, TLS,DHE,PSK,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x00AB, DHE,PSK,AES256,GCM,SHA384,,,), + CS_ENTRY(0x00AC, TLS,RSA,PSK,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x00AC, RSA,PSK,AES128,GCM,SHA256,,,), + CS_ENTRY(0x00AD, TLS,RSA,PSK,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x00AD, RSA,PSK,AES256,GCM,SHA384,,,), + CS_ENTRY(0x00AE, TLS,PSK,WITH,AES,128,CBC,SHA256,), + CS_ENTRY(0x00AE, PSK,AES128,CBC,SHA256,,,,), + CS_ENTRY(0x00AF, TLS,PSK,WITH,AES,256,CBC,SHA384,), + CS_ENTRY(0x00AF, PSK,AES256,CBC,SHA384,,,,), + CS_ENTRY(0x00B0, TLS,PSK,WITH,NULL,SHA256,,,), + CS_ENTRY(0x00B0, PSK,NULL,SHA256,,,,,), + CS_ENTRY(0x00B1, TLS,PSK,WITH,NULL,SHA384,,,), + CS_ENTRY(0x00B1, PSK,NULL,SHA384,,,,,), + CS_ENTRY(0x00B2, TLS,DHE,PSK,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x00B2, DHE,PSK,AES128,CBC,SHA256,,,), + CS_ENTRY(0x00B3, TLS,DHE,PSK,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0x00B3, DHE,PSK,AES256,CBC,SHA384,,,), + CS_ENTRY(0x00B4, TLS,DHE,PSK,WITH,NULL,SHA256,,), + CS_ENTRY(0x00B4, DHE,PSK,NULL,SHA256,,,,), + CS_ENTRY(0x00B5, TLS,DHE,PSK,WITH,NULL,SHA384,,), + CS_ENTRY(0x00B5, DHE,PSK,NULL,SHA384,,,,), + CS_ENTRY(0x00B6, TLS,RSA,PSK,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x00B6, RSA,PSK,AES128,CBC,SHA256,,,), + CS_ENTRY(0x00B7, TLS,RSA,PSK,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0x00B7, RSA,PSK,AES256,CBC,SHA384,,,), + CS_ENTRY(0x00B8, TLS,RSA,PSK,WITH,NULL,SHA256,,), + CS_ENTRY(0x00B8, RSA,PSK,NULL,SHA256,,,,), + CS_ENTRY(0x00B9, TLS,RSA,PSK,WITH,NULL,SHA384,,), + CS_ENTRY(0x00B9, RSA,PSK,NULL,SHA384,,,,), + CS_ENTRY(0xC001, TLS,ECDH,ECDSA,WITH,NULL,SHA,,), + CS_ENTRY(0xC001, ECDH,ECDSA,NULL,SHA,,,,), + CS_ENTRY(0xC006, TLS,ECDHE,ECDSA,WITH,NULL,SHA,,), + CS_ENTRY(0xC006, ECDHE,ECDSA,NULL,SHA,,,,), + CS_ENTRY(0xC00B, TLS,ECDH,RSA,WITH,NULL,SHA,,), + CS_ENTRY(0xC00B, ECDH,RSA,NULL,SHA,,,,), + CS_ENTRY(0xC010, TLS,ECDHE,RSA,WITH,NULL,SHA,,), + CS_ENTRY(0xC010, ECDHE,RSA,NULL,SHA,,,,), + CS_ENTRY(0xC035, TLS,ECDHE,PSK,WITH,AES,128,CBC,SHA), + CS_ENTRY(0xC035, ECDHE,PSK,AES128,CBC,SHA,,,), + CS_ENTRY(0xC036, TLS,ECDHE,PSK,WITH,AES,256,CBC,SHA), + CS_ENTRY(0xC036, ECDHE,PSK,AES256,CBC,SHA,,,), + CS_ENTRY(0xCCAB, TLS,PSK,WITH,CHACHA20,POLY1305,SHA256,,), + CS_ENTRY(0xCCAB, PSK,CHACHA20,POLY1305,,,,,), +#endif +#if defined(USE_SECTRANSP) || defined(USE_BEARSSL) + CS_ENTRY(0x000A, TLS,RSA,WITH,3DES,EDE,CBC,SHA,), + CS_ENTRY(0x000A, DES,CBC3,SHA,,,,,), + CS_ENTRY(0xC003, TLS,ECDH,ECDSA,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0xC003, ECDH,ECDSA,DES,CBC3,SHA,,,), + CS_ENTRY(0xC008, TLS,ECDHE,ECDSA,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0xC008, ECDHE,ECDSA,DES,CBC3,SHA,,,), + CS_ENTRY(0xC00D, TLS,ECDH,RSA,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0xC00D, ECDH,RSA,DES,CBC3,SHA,,,), + CS_ENTRY(0xC012, TLS,ECDHE,RSA,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0xC012, ECDHE,RSA,DES,CBC3,SHA,,,), +#endif +#if defined(USE_MBEDTLS) || defined(USE_BEARSSL) + CS_ENTRY(0xC09C, TLS,RSA,WITH,AES,128,CCM,,), + CS_ENTRY(0xC09C, AES128,CCM,,,,,,), + CS_ENTRY(0xC09D, TLS,RSA,WITH,AES,256,CCM,,), + CS_ENTRY(0xC09D, AES256,CCM,,,,,,), + CS_ENTRY(0xC0A0, TLS,RSA,WITH,AES,128,CCM,8,), + CS_ENTRY(0xC0A0, AES128,CCM8,,,,,,), + CS_ENTRY(0xC0A1, TLS,RSA,WITH,AES,256,CCM,8,), + CS_ENTRY(0xC0A1, AES256,CCM8,,,,,,), + CS_ENTRY(0xC0AC, TLS,ECDHE,ECDSA,WITH,AES,128,CCM,), + CS_ENTRY(0xC0AC, ECDHE,ECDSA,AES128,CCM,,,,), + CS_ENTRY(0xC0AD, TLS,ECDHE,ECDSA,WITH,AES,256,CCM,), + CS_ENTRY(0xC0AD, ECDHE,ECDSA,AES256,CCM,,,,), + CS_ENTRY(0xC0AE, TLS,ECDHE,ECDSA,WITH,AES,128,CCM,8), + CS_ENTRY(0xC0AE, ECDHE,ECDSA,AES128,CCM8,,,,), + CS_ENTRY(0xC0AF, TLS,ECDHE,ECDSA,WITH,AES,256,CCM,8), + CS_ENTRY(0xC0AF, ECDHE,ECDSA,AES256,CCM8,,,,), +#endif +#if defined(USE_SECTRANSP) + /* entries marked bc are backward compatible aliases for old OpenSSL names */ + CS_ENTRY(0x0003, TLS,RSA,EXPORT,WITH,RC4,40,MD5,), + CS_ENTRY(0x0003, EXP,RC4,MD5,,,,,), + CS_ENTRY(0x0004, TLS,RSA,WITH,RC4,128,MD5,,), + CS_ENTRY(0x0004, RC4,MD5,,,,,,), + CS_ENTRY(0x0005, TLS,RSA,WITH,RC4,128,SHA,,), + CS_ENTRY(0x0005, RC4,SHA,,,,,,), + CS_ENTRY(0x0006, TLS,RSA,EXPORT,WITH,RC2,CBC,40,MD5), + CS_ENTRY(0x0006, EXP,RC2,CBC,MD5,,,,), + CS_ENTRY(0x0007, TLS,RSA,WITH,IDEA,CBC,SHA,,), + CS_ENTRY(0x0007, IDEA,CBC,SHA,,,,,), + CS_ENTRY(0x0008, TLS,RSA,EXPORT,WITH,DES40,CBC,SHA,), + CS_ENTRY(0x0008, EXP,DES,CBC,SHA,,,,), + CS_ENTRY(0x0009, TLS,RSA,WITH,DES,CBC,SHA,,), + CS_ENTRY(0x0009, DES,CBC,SHA,,,,,), + CS_ENTRY(0x000B, TLS,DH,DSS,EXPORT,WITH,DES40,CBC,SHA), + CS_ENTRY(0x000B, EXP,DH,DSS,DES,CBC,SHA,,), + CS_ENTRY(0x000C, TLS,DH,DSS,WITH,DES,CBC,SHA,), + CS_ENTRY(0x000C, DH,DSS,DES,CBC,SHA,,,), + CS_ENTRY(0x000D, TLS,DH,DSS,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x000D, DH,DSS,DES,CBC3,SHA,,,), + CS_ENTRY(0x000E, TLS,DH,RSA,EXPORT,WITH,DES40,CBC,SHA), + CS_ENTRY(0x000E, EXP,DH,RSA,DES,CBC,SHA,,), + CS_ENTRY(0x000F, TLS,DH,RSA,WITH,DES,CBC,SHA,), + CS_ENTRY(0x000F, DH,RSA,DES,CBC,SHA,,,), + CS_ENTRY(0x0010, TLS,DH,RSA,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x0010, DH,RSA,DES,CBC3,SHA,,,), + CS_ENTRY(0x0011, TLS,DHE,DSS,EXPORT,WITH,DES40,CBC,SHA), + CS_ENTRY(0x0011, EXP,DHE,DSS,DES,CBC,SHA,,), + CS_ENTRY(0x0011, EXP,EDH,DSS,DES,CBC,SHA,,), /* bc */ + CS_ENTRY(0x0012, TLS,DHE,DSS,WITH,DES,CBC,SHA,), + CS_ENTRY(0x0012, DHE,DSS,DES,CBC,SHA,,,), + CS_ENTRY(0x0012, EDH,DSS,DES,CBC,SHA,,,), /* bc */ + CS_ENTRY(0x0013, TLS,DHE,DSS,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x0013, DHE,DSS,DES,CBC3,SHA,,,), + CS_ENTRY(0x0013, EDH,DSS,DES,CBC3,SHA,,,), /* bc */ + CS_ENTRY(0x0014, TLS,DHE,RSA,EXPORT,WITH,DES40,CBC,SHA), + CS_ENTRY(0x0014, EXP,DHE,RSA,DES,CBC,SHA,,), + CS_ENTRY(0x0014, EXP,EDH,RSA,DES,CBC,SHA,,), /* bc */ + CS_ENTRY(0x0015, TLS,DHE,RSA,WITH,DES,CBC,SHA,), + CS_ENTRY(0x0015, DHE,RSA,DES,CBC,SHA,,,), + CS_ENTRY(0x0015, EDH,RSA,DES,CBC,SHA,,,), /* bc */ + CS_ENTRY(0x0016, TLS,DHE,RSA,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x0016, DHE,RSA,DES,CBC3,SHA,,,), + CS_ENTRY(0x0016, EDH,RSA,DES,CBC3,SHA,,,), /* bc */ + CS_ENTRY(0x0017, TLS,DH,anon,EXPORT,WITH,RC4,40,MD5), + CS_ENTRY(0x0017, EXP,ADH,RC4,MD5,,,,), + CS_ENTRY(0x0018, TLS,DH,anon,WITH,RC4,128,MD5,), + CS_ENTRY(0x0018, ADH,RC4,MD5,,,,,), + CS_ENTRY(0x0019, TLS,DH,anon,EXPORT,WITH,DES40,CBC,SHA), + CS_ENTRY(0x0019, EXP,ADH,DES,CBC,SHA,,,), + CS_ENTRY(0x001A, TLS,DH,anon,WITH,DES,CBC,SHA,), + CS_ENTRY(0x001A, ADH,DES,CBC,SHA,,,,), + CS_ENTRY(0x001B, TLS,DH,anon,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x001B, ADH,DES,CBC3,SHA,,,,), + CS_ENTRY(0x0030, TLS,DH,DSS,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0030, DH,DSS,AES128,SHA,,,,), + CS_ENTRY(0x0031, TLS,DH,RSA,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0031, DH,RSA,AES128,SHA,,,,), + CS_ENTRY(0x0032, TLS,DHE,DSS,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0032, DHE,DSS,AES128,SHA,,,,), + CS_ENTRY(0x0034, TLS,DH,anon,WITH,AES,128,CBC,SHA), + CS_ENTRY(0x0034, ADH,AES128,SHA,,,,,), + CS_ENTRY(0x0036, TLS,DH,DSS,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x0036, DH,DSS,AES256,SHA,,,,), + CS_ENTRY(0x0037, TLS,DH,RSA,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x0037, DH,RSA,AES256,SHA,,,,), + CS_ENTRY(0x0038, TLS,DHE,DSS,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x0038, DHE,DSS,AES256,SHA,,,,), + CS_ENTRY(0x003A, TLS,DH,anon,WITH,AES,256,CBC,SHA), + CS_ENTRY(0x003A, ADH,AES256,SHA,,,,,), + CS_ENTRY(0x003E, TLS,DH,DSS,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x003E, DH,DSS,AES128,SHA256,,,,), + CS_ENTRY(0x003F, TLS,DH,RSA,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x003F, DH,RSA,AES128,SHA256,,,,), + CS_ENTRY(0x0040, TLS,DHE,DSS,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x0040, DHE,DSS,AES128,SHA256,,,,), + CS_ENTRY(0x0068, TLS,DH,DSS,WITH,AES,256,CBC,SHA256), + CS_ENTRY(0x0068, DH,DSS,AES256,SHA256,,,,), + CS_ENTRY(0x0069, TLS,DH,RSA,WITH,AES,256,CBC,SHA256), + CS_ENTRY(0x0069, DH,RSA,AES256,SHA256,,,,), + CS_ENTRY(0x006A, TLS,DHE,DSS,WITH,AES,256,CBC,SHA256), + CS_ENTRY(0x006A, DHE,DSS,AES256,SHA256,,,,), + CS_ENTRY(0x006C, TLS,DH,anon,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0x006C, ADH,AES128,SHA256,,,,,), + CS_ENTRY(0x006D, TLS,DH,anon,WITH,AES,256,CBC,SHA256), + CS_ENTRY(0x006D, ADH,AES256,SHA256,,,,,), + CS_ENTRY(0x008A, TLS,PSK,WITH,RC4,128,SHA,,), + CS_ENTRY(0x008A, PSK,RC4,SHA,,,,,), + CS_ENTRY(0x008B, TLS,PSK,WITH,3DES,EDE,CBC,SHA,), + CS_ENTRY(0x008B, PSK,3DES,EDE,CBC,SHA,,,), + CS_ENTRY(0x008E, TLS,DHE,PSK,WITH,RC4,128,SHA,), + CS_ENTRY(0x008E, DHE,PSK,RC4,SHA,,,,), + CS_ENTRY(0x008F, TLS,DHE,PSK,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x008F, DHE,PSK,3DES,EDE,CBC,SHA,,), + CS_ENTRY(0x0092, TLS,RSA,PSK,WITH,RC4,128,SHA,), + CS_ENTRY(0x0092, RSA,PSK,RC4,SHA,,,,), + CS_ENTRY(0x0093, TLS,RSA,PSK,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0x0093, RSA,PSK,3DES,EDE,CBC,SHA,,), + CS_ENTRY(0x00A0, TLS,DH,RSA,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x00A0, DH,RSA,AES128,GCM,SHA256,,,), + CS_ENTRY(0x00A1, TLS,DH,RSA,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x00A1, DH,RSA,AES256,GCM,SHA384,,,), + CS_ENTRY(0x00A2, TLS,DHE,DSS,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x00A2, DHE,DSS,AES128,GCM,SHA256,,,), + CS_ENTRY(0x00A3, TLS,DHE,DSS,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x00A3, DHE,DSS,AES256,GCM,SHA384,,,), + CS_ENTRY(0x00A4, TLS,DH,DSS,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x00A4, DH,DSS,AES128,GCM,SHA256,,,), + CS_ENTRY(0x00A5, TLS,DH,DSS,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x00A5, DH,DSS,AES256,GCM,SHA384,,,), + CS_ENTRY(0x00A6, TLS,DH,anon,WITH,AES,128,GCM,SHA256), + CS_ENTRY(0x00A6, ADH,AES128,GCM,SHA256,,,,), + CS_ENTRY(0x00A7, TLS,DH,anon,WITH,AES,256,GCM,SHA384), + CS_ENTRY(0x00A7, ADH,AES256,GCM,SHA384,,,,), + CS_ENTRY(0xC002, TLS,ECDH,ECDSA,WITH,RC4,128,SHA,), + CS_ENTRY(0xC002, ECDH,ECDSA,RC4,SHA,,,,), + CS_ENTRY(0xC007, TLS,ECDHE,ECDSA,WITH,RC4,128,SHA,), + CS_ENTRY(0xC007, ECDHE,ECDSA,RC4,SHA,,,,), + CS_ENTRY(0xC00C, TLS,ECDH,RSA,WITH,RC4,128,SHA,), + CS_ENTRY(0xC00C, ECDH,RSA,RC4,SHA,,,,), + CS_ENTRY(0xC011, TLS,ECDHE,RSA,WITH,RC4,128,SHA,), + CS_ENTRY(0xC011, ECDHE,RSA,RC4,SHA,,,,), + CS_ENTRY(0xC015, TLS,ECDH,anon,WITH,NULL,SHA,,), + CS_ENTRY(0xC015, AECDH,NULL,SHA,,,,,), + CS_ENTRY(0xC016, TLS,ECDH,anon,WITH,RC4,128,SHA,), + CS_ENTRY(0xC016, AECDH,RC4,SHA,,,,,), + CS_ENTRY(0xC017, TLS,ECDH,anon,WITH,3DES,EDE,CBC,SHA), + CS_ENTRY(0xC017, AECDH,DES,CBC3,SHA,,,,), + CS_ENTRY(0xC018, TLS,ECDH,anon,WITH,AES,128,CBC,SHA), + CS_ENTRY(0xC018, AECDH,AES128,SHA,,,,,), + CS_ENTRY(0xC019, TLS,ECDH,anon,WITH,AES,256,CBC,SHA), + CS_ENTRY(0xC019, AECDH,AES256,SHA,,,,,), +#endif +#if defined(USE_MBEDTLS) + /* entries marked ns are "non-standard", they are not in OpenSSL */ + CS_ENTRY(0x0041, TLS,RSA,WITH,CAMELLIA,128,CBC,SHA,), + CS_ENTRY(0x0041, CAMELLIA128,SHA,,,,,,), + CS_ENTRY(0x0045, TLS,DHE,RSA,WITH,CAMELLIA,128,CBC,SHA), + CS_ENTRY(0x0045, DHE,RSA,CAMELLIA128,SHA,,,,), + CS_ENTRY(0x0084, TLS,RSA,WITH,CAMELLIA,256,CBC,SHA,), + CS_ENTRY(0x0084, CAMELLIA256,SHA,,,,,,), + CS_ENTRY(0x0088, TLS,DHE,RSA,WITH,CAMELLIA,256,CBC,SHA), + CS_ENTRY(0x0088, DHE,RSA,CAMELLIA256,SHA,,,,), + CS_ENTRY(0x00BA, TLS,RSA,WITH,CAMELLIA,128,CBC,SHA256,), + CS_ENTRY(0x00BA, CAMELLIA128,SHA256,,,,,,), + CS_ENTRY(0x00BE, TLS,DHE,RSA,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0x00BE, DHE,RSA,CAMELLIA128,SHA256,,,,), + CS_ENTRY(0x00C0, TLS,RSA,WITH,CAMELLIA,256,CBC,SHA256,), + CS_ENTRY(0x00C0, CAMELLIA256,SHA256,,,,,,), + CS_ENTRY(0x00C4, TLS,DHE,RSA,WITH,CAMELLIA,256,CBC,SHA256), + CS_ENTRY(0x00C4, DHE,RSA,CAMELLIA256,SHA256,,,,), + CS_ENTRY(0xC037, TLS,ECDHE,PSK,WITH,AES,128,CBC,SHA256), + CS_ENTRY(0xC037, ECDHE,PSK,AES128,CBC,SHA256,,,), + CS_ENTRY(0xC038, TLS,ECDHE,PSK,WITH,AES,256,CBC,SHA384), + CS_ENTRY(0xC038, ECDHE,PSK,AES256,CBC,SHA384,,,), + CS_ENTRY(0xC039, TLS,ECDHE,PSK,WITH,NULL,SHA,,), + CS_ENTRY(0xC039, ECDHE,PSK,NULL,SHA,,,,), + CS_ENTRY(0xC03A, TLS,ECDHE,PSK,WITH,NULL,SHA256,,), + CS_ENTRY(0xC03A, ECDHE,PSK,NULL,SHA256,,,,), + CS_ENTRY(0xC03B, TLS,ECDHE,PSK,WITH,NULL,SHA384,,), + CS_ENTRY(0xC03B, ECDHE,PSK,NULL,SHA384,,,,), + CS_ENTRY(0xC03C, TLS,RSA,WITH,ARIA,128,CBC,SHA256,), + CS_ENTRY(0xC03C, ARIA128,SHA256,,,,,,), /* ns */ + CS_ENTRY(0xC03D, TLS,RSA,WITH,ARIA,256,CBC,SHA384,), + CS_ENTRY(0xC03D, ARIA256,SHA384,,,,,,), /* ns */ + CS_ENTRY(0xC044, TLS,DHE,RSA,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC044, DHE,RSA,ARIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC045, TLS,DHE,RSA,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC045, DHE,RSA,ARIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC048, TLS,ECDHE,ECDSA,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC048, ECDHE,ECDSA,ARIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC049, TLS,ECDHE,ECDSA,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC049, ECDHE,ECDSA,ARIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC04A, TLS,ECDH,ECDSA,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC04A, ECDH,ECDSA,ARIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC04B, TLS,ECDH,ECDSA,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC04B, ECDH,ECDSA,ARIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC04C, TLS,ECDHE,RSA,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC04C, ECDHE,ARIA128,SHA256,,,,,), /* ns */ + CS_ENTRY(0xC04D, TLS,ECDHE,RSA,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC04D, ECDHE,ARIA256,SHA384,,,,,), /* ns */ + CS_ENTRY(0xC04E, TLS,ECDH,RSA,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC04E, ECDH,ARIA128,SHA256,,,,,), /* ns */ + CS_ENTRY(0xC04F, TLS,ECDH,RSA,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC04F, ECDH,ARIA256,SHA384,,,,,), /* ns */ + CS_ENTRY(0xC050, TLS,RSA,WITH,ARIA,128,GCM,SHA256,), + CS_ENTRY(0xC050, ARIA128,GCM,SHA256,,,,,), + CS_ENTRY(0xC051, TLS,RSA,WITH,ARIA,256,GCM,SHA384,), + CS_ENTRY(0xC051, ARIA256,GCM,SHA384,,,,,), + CS_ENTRY(0xC052, TLS,DHE,RSA,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC052, DHE,RSA,ARIA128,GCM,SHA256,,,), + CS_ENTRY(0xC053, TLS,DHE,RSA,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC053, DHE,RSA,ARIA256,GCM,SHA384,,,), + CS_ENTRY(0xC05C, TLS,ECDHE,ECDSA,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC05C, ECDHE,ECDSA,ARIA128,GCM,SHA256,,,), + CS_ENTRY(0xC05D, TLS,ECDHE,ECDSA,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC05D, ECDHE,ECDSA,ARIA256,GCM,SHA384,,,), + CS_ENTRY(0xC05E, TLS,ECDH,ECDSA,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC05E, ECDH,ECDSA,ARIA128,GCM,SHA256,,,), /* ns */ + CS_ENTRY(0xC05F, TLS,ECDH,ECDSA,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC05F, ECDH,ECDSA,ARIA256,GCM,SHA384,,,), /* ns */ + CS_ENTRY(0xC060, TLS,ECDHE,RSA,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC060, ECDHE,ARIA128,GCM,SHA256,,,,), + CS_ENTRY(0xC061, TLS,ECDHE,RSA,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC061, ECDHE,ARIA256,GCM,SHA384,,,,), + CS_ENTRY(0xC062, TLS,ECDH,RSA,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC062, ECDH,ARIA128,GCM,SHA256,,,,), /* ns */ + CS_ENTRY(0xC063, TLS,ECDH,RSA,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC063, ECDH,ARIA256,GCM,SHA384,,,,), /* ns */ + CS_ENTRY(0xC064, TLS,PSK,WITH,ARIA,128,CBC,SHA256,), + CS_ENTRY(0xC064, PSK,ARIA128,SHA256,,,,,), /* ns */ + CS_ENTRY(0xC065, TLS,PSK,WITH,ARIA,256,CBC,SHA384,), + CS_ENTRY(0xC065, PSK,ARIA256,SHA384,,,,,), /* ns */ + CS_ENTRY(0xC066, TLS,DHE,PSK,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC066, DHE,PSK,ARIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC067, TLS,DHE,PSK,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC067, DHE,PSK,ARIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC068, TLS,RSA,PSK,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC068, RSA,PSK,ARIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC069, TLS,RSA,PSK,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC069, RSA,PSK,ARIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC06A, TLS,PSK,WITH,ARIA,128,GCM,SHA256,), + CS_ENTRY(0xC06A, PSK,ARIA128,GCM,SHA256,,,,), + CS_ENTRY(0xC06B, TLS,PSK,WITH,ARIA,256,GCM,SHA384,), + CS_ENTRY(0xC06B, PSK,ARIA256,GCM,SHA384,,,,), + CS_ENTRY(0xC06C, TLS,DHE,PSK,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC06C, DHE,PSK,ARIA128,GCM,SHA256,,,), + CS_ENTRY(0xC06D, TLS,DHE,PSK,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC06D, DHE,PSK,ARIA256,GCM,SHA384,,,), + CS_ENTRY(0xC06E, TLS,RSA,PSK,WITH,ARIA,128,GCM,SHA256), + CS_ENTRY(0xC06E, RSA,PSK,ARIA128,GCM,SHA256,,,), + CS_ENTRY(0xC06F, TLS,RSA,PSK,WITH,ARIA,256,GCM,SHA384), + CS_ENTRY(0xC06F, RSA,PSK,ARIA256,GCM,SHA384,,,), + CS_ENTRY(0xC070, TLS,ECDHE,PSK,WITH,ARIA,128,CBC,SHA256), + CS_ENTRY(0xC070, ECDHE,PSK,ARIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC071, TLS,ECDHE,PSK,WITH,ARIA,256,CBC,SHA384), + CS_ENTRY(0xC071, ECDHE,PSK,ARIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC072, TLS,ECDHE,ECDSA,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC072, ECDHE,ECDSA,CAMELLIA128,SHA256,,,,), + CS_ENTRY(0xC073, TLS,ECDHE,ECDSA,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC073, ECDHE,ECDSA,CAMELLIA256,SHA384,,,,), + CS_ENTRY(0xC074, TLS,ECDH,ECDSA,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC074, ECDH,ECDSA,CAMELLIA128,SHA256,,,,), /* ns */ + CS_ENTRY(0xC075, TLS,ECDH,ECDSA,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC075, ECDH,ECDSA,CAMELLIA256,SHA384,,,,), /* ns */ + CS_ENTRY(0xC076, TLS,ECDHE,RSA,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC076, ECDHE,RSA,CAMELLIA128,SHA256,,,,), + CS_ENTRY(0xC077, TLS,ECDHE,RSA,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC077, ECDHE,RSA,CAMELLIA256,SHA384,,,,), + CS_ENTRY(0xC078, TLS,ECDH,RSA,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC078, ECDH,CAMELLIA128,SHA256,,,,,), /* ns */ + CS_ENTRY(0xC079, TLS,ECDH,RSA,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC079, ECDH,CAMELLIA256,SHA384,,,,,), /* ns */ + CS_ENTRY(0xC07A, TLS,RSA,WITH,CAMELLIA,128,GCM,SHA256,), + CS_ENTRY(0xC07A, CAMELLIA128,GCM,SHA256,,,,,), /* ns */ + CS_ENTRY(0xC07B, TLS,RSA,WITH,CAMELLIA,256,GCM,SHA384,), + CS_ENTRY(0xC07B, CAMELLIA256,GCM,SHA384,,,,,), /* ns */ + CS_ENTRY(0xC07C, TLS,DHE,RSA,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC07C, DHE,RSA,CAMELLIA128,GCM,SHA256,,,), /* ns */ + CS_ENTRY(0xC07D, TLS,DHE,RSA,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC07D, DHE,RSA,CAMELLIA256,GCM,SHA384,,,), /* ns */ + CS_ENTRY(0xC086, TLS,ECDHE,ECDSA,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC086, ECDHE,ECDSA,CAMELLIA128,GCM,SHA256,,,), /* ns */ + CS_ENTRY(0xC087, TLS,ECDHE,ECDSA,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC087, ECDHE,ECDSA,CAMELLIA256,GCM,SHA384,,,), /* ns */ + CS_ENTRY(0xC088, TLS,ECDH,ECDSA,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC088, ECDH,ECDSA,CAMELLIA128,GCM,SHA256,,,), /* ns */ + CS_ENTRY(0xC089, TLS,ECDH,ECDSA,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC089, ECDH,ECDSA,CAMELLIA256,GCM,SHA384,,,), /* ns */ + CS_ENTRY(0xC08A, TLS,ECDHE,RSA,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC08A, ECDHE,CAMELLIA128,GCM,SHA256,,,,), /* ns */ + CS_ENTRY(0xC08B, TLS,ECDHE,RSA,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC08B, ECDHE,CAMELLIA256,GCM,SHA384,,,,), /* ns */ + CS_ENTRY(0xC08C, TLS,ECDH,RSA,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC08C, ECDH,CAMELLIA128,GCM,SHA256,,,,), /* ns */ + CS_ENTRY(0xC08D, TLS,ECDH,RSA,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC08D, ECDH,CAMELLIA256,GCM,SHA384,,,,), /* ns */ + CS_ENTRY(0xC08E, TLS,PSK,WITH,CAMELLIA,128,GCM,SHA256,), + CS_ENTRY(0xC08E, PSK,CAMELLIA128,GCM,SHA256,,,,), /* ns */ + CS_ENTRY(0xC08F, TLS,PSK,WITH,CAMELLIA,256,GCM,SHA384,), + CS_ENTRY(0xC08F, PSK,CAMELLIA256,GCM,SHA384,,,,), /* ns */ + CS_ENTRY(0xC090, TLS,DHE,PSK,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC090, DHE,PSK,CAMELLIA128,GCM,SHA256,,,), /* ns */ + CS_ENTRY(0xC091, TLS,DHE,PSK,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC091, DHE,PSK,CAMELLIA256,GCM,SHA384,,,), /* ns */ + CS_ENTRY(0xC092, TLS,RSA,PSK,WITH,CAMELLIA,128,GCM,SHA256), + CS_ENTRY(0xC092, RSA,PSK,CAMELLIA128,GCM,SHA256,,,), /* ns */ + CS_ENTRY(0xC093, TLS,RSA,PSK,WITH,CAMELLIA,256,GCM,SHA384), + CS_ENTRY(0xC093, RSA,PSK,CAMELLIA256,GCM,SHA384,,,), /* ns */ + CS_ENTRY(0xC094, TLS,PSK,WITH,CAMELLIA,128,CBC,SHA256,), + CS_ENTRY(0xC094, PSK,CAMELLIA128,SHA256,,,,,), + CS_ENTRY(0xC095, TLS,PSK,WITH,CAMELLIA,256,CBC,SHA384,), + CS_ENTRY(0xC095, PSK,CAMELLIA256,SHA384,,,,,), + CS_ENTRY(0xC096, TLS,DHE,PSK,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC096, DHE,PSK,CAMELLIA128,SHA256,,,,), + CS_ENTRY(0xC097, TLS,DHE,PSK,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC097, DHE,PSK,CAMELLIA256,SHA384,,,,), + CS_ENTRY(0xC098, TLS,RSA,PSK,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC098, RSA,PSK,CAMELLIA128,SHA256,,,,), + CS_ENTRY(0xC099, TLS,RSA,PSK,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC099, RSA,PSK,CAMELLIA256,SHA384,,,,), + CS_ENTRY(0xC09A, TLS,ECDHE,PSK,WITH,CAMELLIA,128,CBC,SHA256), + CS_ENTRY(0xC09A, ECDHE,PSK,CAMELLIA128,SHA256,,,,), + CS_ENTRY(0xC09B, TLS,ECDHE,PSK,WITH,CAMELLIA,256,CBC,SHA384), + CS_ENTRY(0xC09B, ECDHE,PSK,CAMELLIA256,SHA384,,,,), + CS_ENTRY(0xC09E, TLS,DHE,RSA,WITH,AES,128,CCM,), + CS_ENTRY(0xC09E, DHE,RSA,AES128,CCM,,,,), + CS_ENTRY(0xC09F, TLS,DHE,RSA,WITH,AES,256,CCM,), + CS_ENTRY(0xC09F, DHE,RSA,AES256,CCM,,,,), + CS_ENTRY(0xC0A2, TLS,DHE,RSA,WITH,AES,128,CCM,8), + CS_ENTRY(0xC0A2, DHE,RSA,AES128,CCM8,,,,), + CS_ENTRY(0xC0A3, TLS,DHE,RSA,WITH,AES,256,CCM,8), + CS_ENTRY(0xC0A3, DHE,RSA,AES256,CCM8,,,,), + CS_ENTRY(0xC0A4, TLS,PSK,WITH,AES,128,CCM,,), + CS_ENTRY(0xC0A4, PSK,AES128,CCM,,,,,), + CS_ENTRY(0xC0A5, TLS,PSK,WITH,AES,256,CCM,,), + CS_ENTRY(0xC0A5, PSK,AES256,CCM,,,,,), + CS_ENTRY(0xC0A6, TLS,DHE,PSK,WITH,AES,128,CCM,), + CS_ENTRY(0xC0A6, DHE,PSK,AES128,CCM,,,,), + CS_ENTRY(0xC0A7, TLS,DHE,PSK,WITH,AES,256,CCM,), + CS_ENTRY(0xC0A7, DHE,PSK,AES256,CCM,,,,), + CS_ENTRY(0xC0A8, TLS,PSK,WITH,AES,128,CCM,8,), + CS_ENTRY(0xC0A8, PSK,AES128,CCM8,,,,,), + CS_ENTRY(0xC0A9, TLS,PSK,WITH,AES,256,CCM,8,), + CS_ENTRY(0xC0A9, PSK,AES256,CCM8,,,,,), + CS_ENTRY(0xC0AA, TLS,PSK,DHE,WITH,AES,128,CCM,8), + CS_ENTRY(0xC0AA, DHE,PSK,AES128,CCM8,,,,), + CS_ENTRY(0xC0AB, TLS,PSK,DHE,WITH,AES,256,CCM,8), + CS_ENTRY(0xC0AB, DHE,PSK,AES256,CCM8,,,,), + CS_ENTRY(0xCCAA, TLS,DHE,RSA,WITH,CHACHA20,POLY1305,SHA256,), + CS_ENTRY(0xCCAA, DHE,RSA,CHACHA20,POLY1305,,,,), + CS_ENTRY(0xCCAC, TLS,ECDHE,PSK,WITH,CHACHA20,POLY1305,SHA256,), + CS_ENTRY(0xCCAC, ECDHE,PSK,CHACHA20,POLY1305,,,,), + CS_ENTRY(0xCCAD, TLS,DHE,PSK,WITH,CHACHA20,POLY1305,SHA256,), + CS_ENTRY(0xCCAD, DHE,PSK,CHACHA20,POLY1305,,,,), + CS_ENTRY(0xCCAE, TLS,RSA,PSK,WITH,CHACHA20,POLY1305,SHA256,), + CS_ENTRY(0xCCAE, RSA,PSK,CHACHA20,POLY1305,,,,), +#endif +}; +#define CS_LIST_LEN (sizeof(cs_list) / sizeof(cs_list[0])) + +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; + const char *nxt = cs_str; + const char *end = cs_str + cs_len; + char separator = '-'; + int idx, i = 0; + size_t len; + + /* split the cipher string by '-' or '_' */ + if(strncasecompare(cs_str, "TLS", 3)) + separator = '_'; + + do { + if(i == 8) + return -1; + + /* determine the length of the part */ + cur = nxt; + for(; nxt < end && *nxt != '\0' && *nxt != separator; nxt++); + len = nxt - cur; + + /* lookup index for the part (skip empty string at 0) */ + for(idx = 1, entry = cs_txt + 1; idx < CS_TXT_LEN; idx++) { + size_t elen = strlen(entry); + if(elen == len && strncasecompare(entry, cur, len)) + break; + entry += elen + 1; + } + if(idx == CS_TXT_LEN) + return -1; + + 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)); + + return 0; +} + +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; + char separator = '-'; + int idx, i, r; + size_t len = 0; + + /* unzip the 8 indexes */ + indexes[0] = zip[0] >> 2; + indexes[1] = ((zip[0] << 4) & 0x3F) | zip[1] >> 4; + indexes[2] = ((zip[1] << 2) & 0x3F) | zip[2] >> 6; + indexes[3] = ((zip[2] << 0) & 0x3F); + indexes[4] = zip[3] >> 2; + indexes[5] = ((zip[3] << 4) & 0x3F) | zip[4] >> 4; + indexes[6] = ((zip[4] << 2) & 0x3F) | zip[5] >> 6; + indexes[7] = ((zip[5] << 0) & 0x3F); + + if(indexes[0] == CS_TXT_IDX_TLS) + separator = '_'; + + for(i = 0; i < 8 && indexes[i] != 0 && len < buf_size; i++) { + if(indexes[i] >= CS_TXT_LEN) + return -1; + + /* lookup the part string for the index (skip empty string at 0) */ + for(idx = 1, entry = cs_txt + 1; idx < indexes[i]; idx++) { + size_t elen = strlen(entry); + entry += elen + 1; + } + + /* append the part string to the buffer */ + if(i > 0) + r = msnprintf(&buf[len], buf_size - len, "%c%s", separator, entry); + else + r = msnprintf(&buf[len], buf_size - len, "%s", entry); + + if(r < 0) + return -1; + len += r; + } + + return 0; +} + +uint16_t Curl_cipher_suite_lookup_id(const char *cs_str, size_t cs_len) +{ + size_t i; + uint8_t zip[6]; + + if(cs_len > 0 && cs_str_to_zip(cs_str, cs_len, zip) == 0) { + for(i = 0; i < CS_LIST_LEN; i++) { + if(memcmp(cs_list[i].zip, zip, sizeof(zip)) == 0) + return cs_list[i].id; + } + } + + return 0; +} + +static bool cs_is_separator(char c) +{ + switch(c) { + case ' ': + case '\t': + case ':': + case ',': + case ';': + return TRUE; + default:; + } + return FALSE; +} + +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)++); + + /* move end pointer to next separator or end of string */ + for(*end = *str; *end[0] != '\0' && !cs_is_separator(*end[0]); (*end)++); + + return Curl_cipher_suite_lookup_id(*str, *end - *str); +} + +int Curl_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size, + bool prefer_rfc) +{ + size_t i, j = CS_LIST_LEN; + int r = -1; + + for(i = 0; i < CS_LIST_LEN; i++) { + if(cs_list[i].id != id) + continue; + if((cs_list[i].zip[0] >> 2 != CS_TXT_IDX_TLS) == !prefer_rfc) { + j = i; + break; + } + if(j == CS_LIST_LEN) + j = i; + } + + if(j < CS_LIST_LEN) + r = cs_zip_to_str(cs_list[j].zip, buf, buf_size); + + if(r < 0) + msnprintf(buf, buf_size, "TLS_UNKNOWN_0x%04x", id); + + return r; +} + +#endif /* defined(USE_SECTRANSP) || defined(USE_MBEDTLS) || \ + defined(USE_BEARSSL) || defined(USE_RUSTLS) */ diff --git a/deps/curl/lib/vtls/cipher_suite.h b/deps/curl/lib/vtls/cipher_suite.h new file mode 100644 index 00000000..6d980103 --- /dev/null +++ b/deps/curl/lib/vtls/cipher_suite.h @@ -0,0 +1,48 @@ +#ifndef HEADER_CURL_CIPHER_SUITE_H +#define HEADER_CURL_CIPHER_SUITE_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Jan Venekamp, + * + * 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_SECTRANSP) || defined(USE_MBEDTLS) || \ + defined(USE_BEARSSL) || defined(USE_RUSTLS) +#include + +/* Lookup IANA id for cipher suite string, returns 0 if not recognized */ +uint16_t Curl_cipher_suite_lookup_id(const char *cs_str, size_t cs_len); + +/* Walk over cipher suite string, update str and end pointers to next + cipher suite in string, returns IANA id of that suite if recognized */ +uint16_t Curl_cipher_suite_walk_str(const char **str, const char **end); + +/* Copy openssl or RFC name for cipher suite in supplied buffer. + Caller is responsible to supply sufficiently large buffer (size + of 64 should suffice), excess bytes are silently truncated. */ +int Curl_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size, + bool prefer_rfc); + +#endif /* defined(USE_SECTRANSP) || defined(USE_MBEDTLS) || \ + defined(USE_BEARSSL) || defined(USE_RUSTLS) */ +#endif /* HEADER_CURL_CIPHER_SUITE_H */ diff --git a/deps/curl/lib/vtls/gtls.c b/deps/curl/lib/vtls/gtls.c index b95c5be3..af4f0c34 100644 --- a/deps/curl/lib/vtls/gtls.c +++ b/deps/curl/lib/vtls/gtls.c @@ -26,7 +26,7 @@ * Source file for all GnuTLS-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. * - * Note: don't use the GnuTLS' *_t variable type names in this source code, + * Note: do not use the GnuTLS' *_t variable type names in this source code, * since they were not present in 1.0.X. */ @@ -43,12 +43,14 @@ #include "urldata.h" #include "sendf.h" #include "inet_pton.h" +#include "keylog.h" #include "gtls.h" #include "vtls.h" #include "vtls_int.h" #include "vauth/vauth.h" #include "parsedate.h" #include "connect.h" /* for the connect timeout */ +#include "progress.h" #include "select.h" #include "strcase.h" #include "warnless.h" @@ -59,6 +61,16 @@ /* The last #include file should be: */ #include "memdebug.h" +#ifndef ARRAYSIZE +#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) +#endif + +#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:" \ + "%DISABLE_TLS13_COMPAT_MODE" + /* Enable GnuTLS debugging by defining GTLSDEBUG */ /*#define GTLSDEBUG */ @@ -77,24 +89,27 @@ static bool gtls_inited = FALSE; # include struct gtls_ssl_backend_data { - struct gtls_instance gtls; + struct gtls_ctx gtls; }; static ssize_t gtls_push(void *s, const void *buf, size_t blen) { struct Curl_cfilter *cf = s; struct ssl_connect_data *connssl = cf->ctx; + struct gtls_ssl_backend_data *backend = + (struct gtls_ssl_backend_data *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); ssize_t nwritten; CURLcode result; DEBUGASSERT(data); - nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, &result); + nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &result); + CURL_TRC_CF(data, cf, "gtls_push(len=%zu) -> %zd, err=%d", + blen, nwritten, result); + backend->gtls.io_result = result; if(nwritten < 0) { - struct gtls_ssl_backend_data *backend = - (struct gtls_ssl_backend_data *)connssl->backend; gnutls_transport_set_errno(backend->gtls.session, - (CURLE_AGAIN == result)? EAGAIN : EINVAL); + (CURLE_AGAIN == result) ? EAGAIN : EINVAL); nwritten = -1; } return nwritten; @@ -104,19 +119,33 @@ static ssize_t gtls_pull(void *s, void *buf, size_t blen) { struct Curl_cfilter *cf = s; struct ssl_connect_data *connssl = cf->ctx; + struct gtls_ssl_backend_data *backend = + (struct gtls_ssl_backend_data *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); ssize_t nread; CURLcode result; DEBUGASSERT(data); + if(!backend->gtls.shared_creds->trust_setup) { + result = Curl_gtls_client_trust_setup(cf, data, &backend->gtls); + if(result) { + gnutls_transport_set_errno(backend->gtls.session, EINVAL); + backend->gtls.io_result = result; + return -1; + } + } + nread = Curl_conn_cf_recv(cf->next, data, buf, blen, &result); + CURL_TRC_CF(data, cf, "glts_pull(len=%zu) -> %zd, err=%d", + blen, nread, result); + backend->gtls.io_result = result; if(nread < 0) { - struct gtls_ssl_backend_data *backend = - (struct gtls_ssl_backend_data *)connssl->backend; gnutls_transport_set_errno(backend->gtls.session, - (CURLE_AGAIN == result)? EAGAIN : EINVAL); + (CURLE_AGAIN == result) ? EAGAIN : EINVAL); nread = -1; } + else if(nread == 0) + connssl->peer_closed = TRUE; return nread; } @@ -131,7 +160,7 @@ 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); @@ -165,7 +194,7 @@ static void showtime(struct Curl_easy *data, sizeof(str), " %s: %s, %02d %s %4d %02d:%02d:%02d GMT", text, - 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, @@ -223,6 +252,7 @@ static CURLcode handshake(struct Curl_cfilter *cf, DEBUGASSERT(backend); session = backend->gtls.session; + connssl->connecting_state = ssl_connect_2; for(;;) { timediff_t timeout_ms; @@ -237,18 +267,17 @@ static CURLcode handshake(struct Curl_cfilter *cf, return CURLE_OPERATION_TIMEDOUT; } - /* if ssl is expecting something, check if it's available. */ - if(connssl->connecting_state == ssl_connect_2_reading - || connssl->connecting_state == ssl_connect_2_writing) { + /* if ssl is expecting something, check if it is available. */ + if(connssl->io_need) { int what; - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, - nonblocking?0: - timeout_ms?timeout_ms:1000); + nonblocking ? 0 : + timeout_ms ? timeout_ms : 1000); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); @@ -256,7 +285,7 @@ static CURLcode handshake(struct Curl_cfilter *cf, } else if(0 == what) { if(nonblocking) - return CURLE_OK; + return CURLE_AGAIN; else if(timeout_ms) { /* timeout */ failf(data, "SSL connection timeout at %ld", (long)timeout_ms); @@ -266,19 +295,29 @@ static CURLcode handshake(struct Curl_cfilter *cf, /* socket is readable or writable */ } + connssl->io_need = CURL_SSL_IO_NEED_NONE; + backend->gtls.io_result = CURLE_OK; rc = gnutls_handshake(session); + if(!backend->gtls.shared_creds->trust_setup) { + /* After having send off the ClientHello, we prepare the trust + * store to verify the coming certificate from the server */ + CURLcode result = Curl_gtls_client_trust_setup(cf, data, &backend->gtls); + if(result) + return result; + } + if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) { - connssl->connecting_state = - gnutls_record_get_direction(session)? - ssl_connect_2_writing:ssl_connect_2_reading; + connssl->io_need = + gnutls_record_get_direction(session) ? + CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV; continue; } else if((rc < 0) && !gnutls_error_is_fatal(rc)) { const char *strerr = NULL; if(rc == GNUTLS_E_WARNING_ALERT_RECEIVED) { - int alert = gnutls_alert_get(session); + gnutls_alert_description_t alert = gnutls_alert_get(session); strerr = gnutls_alert_get_name(alert); } @@ -288,18 +327,21 @@ static CURLcode handshake(struct Curl_cfilter *cf, infof(data, "gnutls_handshake() warning: %s", strerr); continue; } + else if((rc < 0) && backend->gtls.io_result) { + return backend->gtls.io_result; + } else if(rc < 0) { const char *strerr = NULL; if(rc == GNUTLS_E_FATAL_ALERT_RECEIVED) { - int alert = gnutls_alert_get(session); + gnutls_alert_description_t alert = gnutls_alert_get(session); strerr = gnutls_alert_get_name(alert); } if(!strerr) strerr = gnutls_strerror(rc); - failf(data, "gnutls_handshake() failed: %s", strerr); + failf(data, "GnuTLS, handshake failed: %s", strerr); return CURLE_SSL_CONNECT_ERROR; } @@ -309,7 +351,7 @@ static CURLcode handshake(struct Curl_cfilter *cf, } } -static gnutls_x509_crt_fmt_t do_file_type(const char *type) +static gnutls_x509_crt_fmt_t gnutls_do_file_type(const char *type) { if(!type || !type[0]) return GNUTLS_X509_FMT_PEM; @@ -327,10 +369,11 @@ static gnutls_x509_crt_fmt_t do_file_type(const char *type) #define GNUTLS_SRP "+SRP" static CURLcode -set_ssl_version_min_max(struct Curl_easy *data, - struct ssl_primary_config *conn_config, - const char **prioritylist, - const char *tls13support) +gnutls_set_ssl_version_min_max(struct Curl_easy *data, + struct ssl_peer *peer, + struct ssl_primary_config *conn_config, + const char **prioritylist, + const char *tls13support) { long ssl_version = conn_config->version; long ssl_version_max = conn_config->version_max; @@ -340,8 +383,19 @@ set_ssl_version_min_max(struct Curl_easy *data, ssl_version = CURL_SSLVERSION_TLSv1_0; if(ssl_version_max == CURL_SSLVERSION_MAX_NONE) ssl_version_max = CURL_SSLVERSION_MAX_DEFAULT; + + if(peer->transport == TRNSPRT_QUIC) { + if((ssl_version_max != CURL_SSLVERSION_MAX_DEFAULT) && + (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; + } + if(!tls13support) { - /* If the running GnuTLS doesn't support TLS 1.3, we must not specify a + /* If the running GnuTLS does not support TLS 1.3, we must not specify a prioritylist involving that since it will make GnuTLS return an en error back at us */ if((ssl_version_max == CURL_SSLVERSION_MAX_TLSv1_3) || @@ -399,13 +453,357 @@ set_ssl_version_min_max(struct Curl_easy *data, return CURLE_SSL_CONNECT_ERROR; } -CURLcode gtls_client_init(struct Curl_easy *data, - struct ssl_primary_config *config, - struct ssl_config_data *ssl_config, - struct ssl_peer *peer, - struct gtls_instance *gtls, - long *pverifyresult) +CURLcode Curl_gtls_shared_creds_create(struct Curl_easy *data, + struct gtls_shared_creds **pcreds) { + struct gtls_shared_creds *shared; + int rc; + + *pcreds = NULL; + shared = 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); + return CURLE_SSL_CONNECT_ERROR; + } + + shared->refcount = 1; + shared->time = Curl_now(); + *pcreds = shared; + return CURLE_OK; +} + +CURLcode Curl_gtls_shared_creds_up_ref(struct gtls_shared_creds *creds) +{ + DEBUGASSERT(creds); + if(creds->refcount < SIZE_T_MAX) { + ++creds->refcount; + return CURLE_OK; + } + return CURLE_BAD_FUNCTION_ARGUMENT; +} + +void Curl_gtls_shared_creds_free(struct gtls_shared_creds **pcreds) +{ + struct gtls_shared_creds *shared = *pcreds; + *pcreds = NULL; + if(shared) { + --shared->refcount; + if(!shared->refcount) { + gnutls_certificate_free_credentials(shared->creds); + free(shared->CAfile); + free(shared); + } + } +} + +static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, + struct Curl_easy *data, + gnutls_certificate_credentials_t creds) +{ + struct ssl_primary_config *config = Curl_ssl_cf_get_primary_config(cf); + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + int rc; + + if(config->verifypeer) { + bool imported_native_ca = FALSE; + + if(ssl_config->native_ca_store) { + rc = gnutls_certificate_set_x509_system_trust(creds); + if(rc < 0) + infof(data, "error reading native ca store (%s), continuing anyway", + gnutls_strerror(rc)); + else { + infof(data, "found %d certificates in native ca store", rc); + if(rc > 0) + imported_native_ca = TRUE; + } + } + + if(config->CAfile) { + /* set the trusted CA cert bundle file */ + gnutls_certificate_set_verify_flags(creds, + GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT); + + rc = gnutls_certificate_set_x509_trust_file(creds, + config->CAfile, + GNUTLS_X509_FMT_PEM); + if(rc < 0) { + infof(data, "error reading ca cert file %s (%s)%s", + config->CAfile, gnutls_strerror(rc), + (imported_native_ca ? ", continuing anyway" : "")); + if(!imported_native_ca) { + ssl_config->certverifyresult = rc; + return CURLE_SSL_CACERT_BADFILE; + } + } + else + infof(data, "found %d certificates in %s", rc, config->CAfile); + } + + if(config->CApath) { + /* set the trusted CA cert directory */ + rc = gnutls_certificate_set_x509_trust_dir(creds, config->CApath, + GNUTLS_X509_FMT_PEM); + if(rc < 0) { + infof(data, "error reading ca cert file %s (%s)%s", + config->CApath, gnutls_strerror(rc), + (imported_native_ca ? ", continuing anyway" : "")); + if(!imported_native_ca) { + ssl_config->certverifyresult = rc; + return CURLE_SSL_CACERT_BADFILE; + } + } + else + infof(data, "found %d certificates in %s", rc, config->CApath); + } + } + + if(config->CRLfile) { + /* set the CRL list file */ + 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)", + config->CRLfile, gnutls_strerror(rc)); + return CURLE_SSL_CRL_BADFILE; + } + else + infof(data, "found %d CRL in %s", rc, config->CRLfile); + } + + return CURLE_OK; +} + +/* key to use at `multi->proto_hash` */ +#define MPROTO_GTLS_X509_KEY "tls:gtls:x509:share" + +static bool gtls_shared_creds_expired(const struct Curl_easy *data, + const struct gtls_shared_creds *sc) +{ + const struct ssl_general_config *cfg = &data->set.general_ssl; + struct curltime now = Curl_now(); + timediff_t elapsed_ms = Curl_timediff(now, sc->time); + timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; + + if(timeout_ms < 0) + return FALSE; + + return elapsed_ms >= timeout_ms; +} + +static bool gtls_shared_creds_different(struct Curl_cfilter *cf, + const struct gtls_shared_creds *sc) +{ + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + if(!sc->CAfile || !conn_config->CAfile) + return sc->CAfile != conn_config->CAfile; + + return strcmp(sc->CAfile, conn_config->CAfile); +} + +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, + (void *)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; + } + } + return NULL; +} + +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(!memcmp(MPROTO_GTLS_X509_KEY, key, key_len)); + (void)key; + (void)key_len; + Curl_gtls_shared_creds_free(&sc); /* down reference */ +} + +static void gtls_set_cached_creds(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct gtls_shared_creds *sc) +{ + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + + DEBUGASSERT(sc); + DEBUGASSERT(sc->creds); + DEBUGASSERT(!sc->CAfile); + DEBUGASSERT(sc->refcount == 1); + if(!data->multi) + return; + + if(conn_config->CAfile) { + sc->CAfile = strdup(conn_config->CAfile); + if(!sc->CAfile) + return; + } + + if(Curl_gtls_shared_creds_up_ref(sc)) + return; + + if(!Curl_hash_add2(&data->multi->proto_hash, + (void *)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; + } +} + +CURLcode Curl_gtls_client_trust_setup(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct gtls_ctx *gtls) +{ + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + struct gtls_shared_creds *cached_creds = NULL; + bool cache_criteria_met; + 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. */ + cache_criteria_met = (data->set.general_ssl.ca_cache_timeout != 0) && + conn_config->verifypeer && + !conn_config->CApath && + !conn_config->ca_info_blob && + !ssl_config->primary.CRLfile && + !ssl_config->native_ca_store && + !conn_config->clientcert; /* GnuTLS adds client cert to its credentials! */ + + if(cache_criteria_met) + cached_creds = gtls_get_cached_creds(cf, data); + + if(cached_creds && !Curl_gtls_shared_creds_up_ref(cached_creds)) { + CURL_TRC_CF(data, cf, "using shared trust anchors and CRLs"); + Curl_gtls_shared_creds_free(>ls->shared_creds); + gtls->shared_creds = cached_creds; + rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_CERTIFICATE, + gtls->shared_creds->creds); + if(rc != GNUTLS_E_SUCCESS) { + failf(data, "gnutls_credentials_set() failed: %s", gnutls_strerror(rc)); + return CURLE_SSL_CONNECT_ERROR; + } + } + else { + CURL_TRC_CF(data, cf, "loading trust anchors and CRLs"); + result = gtls_populate_creds(cf, data, gtls->shared_creds->creds); + if(result) + return result; + gtls->shared_creds->trust_setup = TRUE; + if(cache_criteria_met) + gtls_set_cached_creds(cf, data, gtls->shared_creds); + } + return CURLE_OK; +} + +static void gtls_sessionid_free(void *sessionid, size_t idsize) +{ + (void)idsize; + free(sessionid); +} + +CURLcode Curl_gtls_update_session_id(struct Curl_cfilter *cf, + struct Curl_easy *data, + gnutls_session_t session, + struct ssl_peer *peer, + const char *alpn) +{ + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + void *connect_sessionid; + size_t connect_idsize = 0; + CURLcode result = CURLE_OK; + + if(!ssl_config->primary.cache_session) + return CURLE_OK; + + /* 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 + detect that. */ + + /* get the session ID data size */ + gnutls_session_get_data(session, NULL, &connect_idsize); + if(!connect_idsize) /* gnutls does this for some version combinations */ + return CURLE_OK; + + connect_sessionid = malloc(connect_idsize); /* get a buffer for it */ + if(!connect_sessionid) + return CURLE_OUT_OF_MEMORY; + + /* extract session ID to the allocated buffer */ + gnutls_session_get_data(session, connect_sessionid, &connect_idsize); + + CURL_TRC_CF(data, cf, "get session id (len=%zu, alpn=%s) and store in cache", + connect_idsize, alpn ? alpn : "-"); + Curl_ssl_sessionid_lock(data); + /* store this session id, takes ownership */ + result = Curl_ssl_set_sessionid(cf, data, peer, alpn, + connect_sessionid, connect_idsize, + gtls_sessionid_free); + Curl_ssl_sessionid_unlock(data); + return result; +} + +static CURLcode cf_gtls_update_session_id(struct Curl_cfilter *cf, + struct Curl_easy *data, + gnutls_session_t session) +{ + struct ssl_connect_data *connssl = cf->ctx; + return Curl_gtls_update_session_id(cf, data, session, &connssl->peer, + connssl->alpn_negotiated); +} + +static int gtls_handshake_cb(gnutls_session_t session, unsigned int htype, + unsigned when, unsigned int incoming, + const gnutls_datum_t *msg) +{ + struct Curl_cfilter *cf = gnutls_session_get_ptr(session); + + (void)msg; + (void)incoming; + if(when) { /* after message has been processed */ + struct Curl_easy *data = CF_DATA_CURRENT(cf); + if(data) { + CURL_TRC_CF(data, cf, "handshake: %s message type %d", + incoming ? "incoming" : "outgoing", htype); + switch(htype) { + case GNUTLS_HANDSHAKE_NEW_SESSION_TICKET: { + cf_gtls_update_session_id(cf, data, session); + break; + } + default: + break; + } + } + } + return 0; +} + +static CURLcode gtls_client_init(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + struct gtls_ctx *gtls) +{ + struct ssl_primary_config *config = Curl_ssl_cf_get_primary_config(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 */ @@ -417,8 +815,6 @@ CURLcode gtls_client_init(struct Curl_easy *data, if(!gtls_inited) gtls_init(); - *pverifyresult = 0; - if(config->version == CURL_SSLVERSION_SSLv2) { failf(data, "GnuTLS does not support SSLv2"); return CURLE_SSL_CONNECT_ERROR; @@ -426,12 +822,10 @@ CURLcode gtls_client_init(struct Curl_easy *data, else if(config->version == CURL_SSLVERSION_SSLv3) sni = FALSE; /* SSLv3 has no SNI */ - /* allocate a cred struct */ - rc = gnutls_certificate_allocate_credentials(>ls->cred); - if(rc != GNUTLS_E_SUCCESS) { - failf(data, "gnutls_cert_all_cred() failed: %s", gnutls_strerror(rc)); - return CURLE_SSL_CONNECT_ERROR; - } + /* allocate a shared creds struct */ + result = Curl_gtls_shared_creds_create(data, >ls->shared_creds); + if(result) + return result; #ifdef USE_GNUTLS_SRP if(config->username && Curl_auth_allowed_to_host(data)) { @@ -455,74 +849,7 @@ CURLcode gtls_client_init(struct Curl_easy *data, } #endif - if(config->verifypeer) { - bool imported_native_ca = false; - - if(ssl_config->native_ca_store) { - rc = gnutls_certificate_set_x509_system_trust(gtls->cred); - if(rc < 0) - infof(data, "error reading native ca store (%s), continuing anyway", - gnutls_strerror(rc)); - else { - infof(data, "found %d certificates in native ca store", rc); - if(rc > 0) - imported_native_ca = true; - } - } - - if(config->CAfile) { - /* set the trusted CA cert bundle file */ - gnutls_certificate_set_verify_flags(gtls->cred, - GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT); - - rc = gnutls_certificate_set_x509_trust_file(gtls->cred, - config->CAfile, - GNUTLS_X509_FMT_PEM); - if(rc < 0) { - infof(data, "error reading ca cert file %s (%s)%s", - config->CAfile, gnutls_strerror(rc), - (imported_native_ca ? ", continuing anyway" : "")); - if(!imported_native_ca) { - *pverifyresult = rc; - return CURLE_SSL_CACERT_BADFILE; - } - } - else - infof(data, "found %d certificates in %s", rc, config->CAfile); - } - - if(config->CApath) { - /* set the trusted CA cert directory */ - rc = gnutls_certificate_set_x509_trust_dir(gtls->cred, - config->CApath, - GNUTLS_X509_FMT_PEM); - if(rc < 0) { - infof(data, "error reading ca cert file %s (%s)%s", - config->CApath, gnutls_strerror(rc), - (imported_native_ca ? ", continuing anyway" : "")); - if(!imported_native_ca) { - *pverifyresult = rc; - return CURLE_SSL_CACERT_BADFILE; - } - } - else - infof(data, "found %d certificates in %s", rc, config->CApath); - } - } - - if(config->CRLfile) { - /* set the CRL list file */ - rc = gnutls_certificate_set_x509_crl_file(gtls->cred, - config->CRLfile, - GNUTLS_X509_FMT_PEM); - if(rc < 0) { - failf(data, "error reading crl file %s (%s)", - config->CRLfile, gnutls_strerror(rc)); - return CURLE_SSL_CRL_BADFILE; - } - else - infof(data, "found %d CRL in %s", rc, config->CRLfile); - } + ssl_config->certverifyresult = 0; /* Initialize TLS session as a client */ init_flags = GNUTLS_CLIENT; @@ -531,9 +858,20 @@ CURLcode gtls_client_init(struct Curl_easy *data, init_flags |= GNUTLS_FORCE_CLIENT_CERT; #endif -#if defined(GNUTLS_NO_TICKETS) - /* Disable TLS session tickets */ - init_flags |= GNUTLS_NO_TICKETS; +#if defined(GNUTLS_NO_TICKETS_TLS12) + init_flags |= GNUTLS_NO_TICKETS_TLS12; +#elif defined(GNUTLS_NO_TICKETS) + /* Disable TLS session tickets for non 1.3 connections */ + if((config->version != CURL_SSLVERSION_TLSv1_3) && + (config->version != CURL_SSLVERSION_DEFAULT)) + init_flags |= GNUTLS_NO_TICKETS; +#endif + +#if defined(GNUTLS_NO_STATUS_REQUEST) + if(!config->verifystatus) + /* Disable the "status_request" TLS extension, enabled by default since + GnuTLS 3.8.0. */ + init_flags |= GNUTLS_NO_STATUS_REQUEST; #endif rc = gnutls_init(>ls->session, init_flags); @@ -559,7 +897,7 @@ CURLcode gtls_client_init(struct Curl_easy *data, 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 run-time error indicates that SRP is not supported by this + * removed if a runtime error indicates that SRP is not supported by this * GnuTLS version */ if(config->version == CURL_SSLVERSION_SSLv2 || @@ -576,7 +914,8 @@ CURLcode gtls_client_init(struct Curl_easy *data, } /* At this point we know we have a supported TLS version, so set it */ - result = set_ssl_version_min_max(data, config, &prioritylist, tls13support); + result = gnutls_set_ssl_version_min_max(data, peer, + config, &prioritylist, tls13support); if(result) return result; @@ -609,17 +948,34 @@ CURLcode gtls_client_init(struct Curl_easy *data, } if(config->clientcert) { - if(ssl_config->key_passwd) { + if(!gtls->shared_creds->trust_setup) { + result = Curl_gtls_client_trust_setup(cf, data, gtls); + if(result) + return result; + } + if(ssl_config->cert_type && strcasecompare(ssl_config->cert_type, "P12")) { + rc = gnutls_certificate_set_x509_simple_pkcs12_file( + gtls->shared_creds->creds, config->clientcert, GNUTLS_X509_FMT_DER, + ssl_config->key_passwd ? ssl_config->key_passwd : ""); + if(rc != GNUTLS_E_SUCCESS) { + failf(data, + "error reading X.509 potentially-encrypted key or certificate " + "file: %s", + gnutls_strerror(rc)); + return CURLE_SSL_CONNECT_ERROR; + } + } + else if(ssl_config->key_passwd) { const unsigned int supported_key_encryption_algorithms = GNUTLS_PKCS_USE_PKCS12_3DES | GNUTLS_PKCS_USE_PKCS12_ARCFOUR | GNUTLS_PKCS_USE_PKCS12_RC2_40 | GNUTLS_PKCS_USE_PBES2_3DES | GNUTLS_PKCS_USE_PBES2_AES_128 | GNUTLS_PKCS_USE_PBES2_AES_192 | GNUTLS_PKCS_USE_PBES2_AES_256; rc = gnutls_certificate_set_x509_key_file2( - gtls->cred, + gtls->shared_creds->creds, config->clientcert, ssl_config->key ? ssl_config->key : config->clientcert, - do_file_type(ssl_config->cert_type), + gnutls_do_file_type(ssl_config->cert_type), ssl_config->key_passwd, supported_key_encryption_algorithms); if(rc != GNUTLS_E_SUCCESS) { @@ -631,10 +987,10 @@ CURLcode gtls_client_init(struct Curl_easy *data, } else { if(gnutls_certificate_set_x509_key_file( - gtls->cred, + gtls->shared_creds->creds, config->clientcert, ssl_config->key ? ssl_config->key : config->clientcert, - do_file_type(ssl_config->cert_type) ) != + gnutls_do_file_type(ssl_config->cert_type) ) != GNUTLS_E_SUCCESS) { failf(data, "error reading X.509 key or certificate file"); return CURLE_SSL_CONNECT_ERROR; @@ -656,7 +1012,7 @@ CURLcode gtls_client_init(struct Curl_easy *data, #endif { rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_CERTIFICATE, - gtls->cred); + gtls->shared_creds->creds); if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_credentials_set() failed: %s", gnutls_strerror(rc)); return CURLE_SSL_CONNECT_ERROR; @@ -675,65 +1031,184 @@ CURLcode gtls_client_init(struct Curl_easy *data, return CURLE_OK; } +static int keylog_callback(gnutls_session_t session, const char *label, + const gnutls_datum_t *secret) +{ + gnutls_datum_t crandom; + gnutls_datum_t srandom; + + gnutls_session_get_random(session, &crandom, &srandom); + if(crandom.size != 32) { + return -1; + } + + Curl_tls_keylog_write(label, crandom.data, secret->data, secret->size); + return 0; +} + +CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + const unsigned char *alpn, size_t alpn_len, + struct ssl_connect_data *connssl, + Curl_gtls_ctx_setup_cb *cb_setup, + void *cb_user_data, + void *ssl_user_data) +{ + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + gnutls_datum_t gtls_alpns[5]; + size_t gtls_alpns_count = 0; + CURLcode result; + + DEBUGASSERT(gctx); + + result = gtls_client_init(cf, data, peer, gctx); + if(result) + return result; + + gnutls_session_set_ptr(gctx->session, ssl_user_data); + + if(cb_setup) { + result = cb_setup(cf, data, cb_user_data); + if(result) + return result; + } + + /* Open the file if a TLS or QUIC backend has not done this before. */ + Curl_tls_keylog_open(); + if(Curl_tls_keylog_enabled()) { + gnutls_session_set_keylog_function(gctx->session, keylog_callback); + } + + /* This might be a reconnect, so we check for a session ID in the cache + to speed up things */ + if(conn_config->cache_session) { + void *ssl_sessionid; + size_t ssl_idsize; + char *session_alpn; + Curl_ssl_sessionid_lock(data); + if(!Curl_ssl_getsessionid(cf, data, peer, + &ssl_sessionid, &ssl_idsize, &session_alpn)) { + /* we got a session id, use it! */ + int rc; + + rc = gnutls_session_set_data(gctx->session, ssl_sessionid, ssl_idsize); + if(rc < 0) + infof(data, "SSL failed to set session ID"); + else { + infof(data, "SSL reusing session ID (size=%zu, alpn=%s)", + ssl_idsize, session_alpn ? session_alpn : "-"); +#ifdef DEBUGBUILD + if((ssl_config->earlydata || !!getenv("CURL_USE_EARLYDATA")) && +#else + if(ssl_config->earlydata && +#endif + !cf->conn->connect_only && connssl && + (gnutls_protocol_get_version(gctx->session) == GNUTLS_TLS1_3) && + Curl_alpn_contains_proto(connssl->alpn, session_alpn)) { + connssl->earlydata_max = + gnutls_record_get_max_early_data_size(gctx->session); + if((!connssl->earlydata_max || + connssl->earlydata_max == 0xFFFFFFFFUL)) { + /* Seems to be GnuTLS way to signal no EarlyData in session */ + CURL_TRC_CF(data, cf, "TLS session does not allow earlydata"); + } + else { + CURL_TRC_CF(data, cf, "TLS session allows %zu earlydata bytes, " + "reusing ALPN '%s'", + connssl->earlydata_max, session_alpn); + connssl->earlydata_state = ssl_earlydata_use; + connssl->state = ssl_connection_deferred; + result = Curl_alpn_set_negotiated(cf, data, connssl, + (const unsigned char *)session_alpn, + session_alpn ? strlen(session_alpn) : 0); + if(result) + return result; + /* We only try the ALPN protocol the session used before, + * otherwise we might send early data for the wrong protocol */ + gtls_alpns[0].data = (unsigned char *)session_alpn; + gtls_alpns[0].size = (unsigned)strlen(session_alpn); + gtls_alpns_count = 1; + } + } + } + } + Curl_ssl_sessionid_unlock(data); + } + + /* convert the ALPN string from our arguments to a list of strings that + * gnutls wants and will convert internally back to this string for sending + * to the server. nice. */ + if(!gtls_alpns_count && alpn && alpn_len) { + size_t i, alen = alpn_len; + unsigned char *s = (unsigned char *)alpn; + unsigned char slen; + for(i = 0; (i < ARRAYSIZE(gtls_alpns)) && alen; ++i) { + slen = s[0]; + if(slen >= alen) + return CURLE_FAILED_INIT; + gtls_alpns[i].data = s + 1; + gtls_alpns[i].size = slen; + s += slen + 1; + alen -= (size_t)slen + 1; + } + if(alen) /* not all alpn chars used, wrong format or too many */ + return CURLE_FAILED_INIT; + gtls_alpns_count = i; + } + + if(gtls_alpns_count && + gnutls_alpn_set_protocols(gctx->session, + gtls_alpns, (unsigned int)gtls_alpns_count, + GNUTLS_ALPN_MANDATORY)) { + failf(data, "failed setting ALPN"); + return CURLE_SSL_CONNECT_ERROR; + } + + return CURLE_OK; +} + 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 = (struct gtls_ssl_backend_data *)connssl->backend; - struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - long * const pverifyresult = &ssl_config->certverifyresult; + struct alpn_proto_buf proto; CURLcode result; DEBUGASSERT(backend); + DEBUGASSERT(ssl_connect_1 == connssl->connecting_state); if(connssl->state == ssl_connection_complete) /* to make us tolerant against being called more than once for the same connection */ return CURLE_OK; - result = gtls_client_init(data, conn_config, ssl_config, - &connssl->peer, - &backend->gtls, pverifyresult); + memset(&proto, 0, sizeof(proto)); + if(connssl->alpn) { + result = Curl_alpn_to_proto_buf(&proto, connssl->alpn); + if(result) { + failf(data, "Error determining ALPN"); + return CURLE_SSL_CONNECT_ERROR; + } + } + + result = Curl_gtls_ctx_init(&backend->gtls, cf, data, &connssl->peer, + proto.data, proto.len, connssl, NULL, NULL, cf); if(result) return result; - if(connssl->alpn) { - struct alpn_proto_buf proto; - gnutls_datum_t alpn[ALPN_ENTRIES_MAX]; - size_t i; - - for(i = 0; i < connssl->alpn->count; ++i) { - alpn[i].data = (unsigned char *)connssl->alpn->entries[i]; - alpn[i].size = (unsigned)strlen(connssl->alpn->entries[i]); - } - if(gnutls_alpn_set_protocols(backend->gtls.session, alpn, - (unsigned)connssl->alpn->count, 0)) { - failf(data, "failed setting ALPN"); - return CURLE_SSL_CONNECT_ERROR; - } + if(connssl->alpn && (connssl->state != ssl_connection_deferred)) { Curl_alpn_to_proto_str(&proto, connssl->alpn); infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data); } - /* This might be a reconnect, so we check for a session ID in the cache - to speed up things */ - if(conn_config->sessionid) { - void *ssl_sessionid; - size_t ssl_idsize; - - Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, &ssl_sessionid, &ssl_idsize)) { - /* we got a session id, use it! */ - gnutls_session_set_data(backend->gtls.session, - ssl_sessionid, ssl_idsize); - - /* Informational message */ - infof(data, "SSL reusing session ID"); - } - Curl_ssl_sessionid_unlock(data); - } + gnutls_handshake_set_hook_function(backend->gtls.session, + GNUTLS_HANDSHAKE_ANY, GNUTLS_HOOK_POST, + gtls_handshake_cb); /* register callback functions and handle to send and receive data. */ gnutls_transport_set_ptr(backend->gtls.session, cf); @@ -756,7 +1231,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, /* Result is returned to caller */ CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH; - /* if a path wasn't specified, don't pin */ + /* if a path was not specified, do not pin */ if(!pinnedpubkey) return CURLE_OK; @@ -822,7 +1297,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data, CURLcode result = CURLE_OK; #ifndef CURL_DISABLE_VERBOSE_STRINGS const char *ptr; - unsigned int algo; + int algo; unsigned int bits; gnutls_protocol_t version = gnutls_protocol_get_version(session); #endif @@ -864,13 +1339,13 @@ Curl_gtls_verifyserver(struct Curl_easy *data, } #endif } - infof(data, " common name: WARNING couldn't obtain"); + infof(data, " common name: WARNING could not obtain"); } if(data->set.ssl.certinfo && chainp) { unsigned int i; - result = Curl_ssl_init_certinfo(data, cert_list_size); + result = Curl_ssl_init_certinfo(data, (int)cert_list_size); if(result) return result; @@ -878,7 +1353,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data, const char *beg = (const char *) chainp[i].data; const char *end = beg + chainp[i].size; - result = Curl_extract_certinfo(data, i, beg, end); + result = Curl_extract_certinfo(data, (int)i, beg, end); if(result) return result; } @@ -904,9 +1379,18 @@ Curl_gtls_verifyserver(struct Curl_easy *data, /* verify_status is a bitmask of gnutls_certificate_status bits */ if(verify_status & GNUTLS_CERT_INVALID) { if(config->verifypeer) { - failf(data, "server certificate verification failed. CAfile: %s " - "CRLfile: %s", config->CAfile ? config->CAfile: - "none", + const char *cause = "certificate error, no details available"; + if(verify_status & GNUTLS_CERT_EXPIRED) + cause = "certificate has expired"; + else if(verify_status & GNUTLS_CERT_SIGNER_NOT_FOUND) + cause = "certificate signer not trusted"; + else if(verify_status & GNUTLS_CERT_INSECURE_ALGORITHM) + cause = "certificate uses insecure algorithm"; + else if(verify_status & GNUTLS_CERT_INVALID_OCSP_STATUS) + cause = "attached OCSP status response is invalid"; + failf(data, "server verification failed: %s. (CAfile: %s " + "CRLfile: %s)", cause, + config->CAfile ? config->CAfile : "none", ssl_config->primary.CRLfile ? ssl_config->primary.CRLfile : "none"); return CURLE_PEER_FAILED_VERIFICATION; @@ -921,104 +1405,97 @@ Curl_gtls_verifyserver(struct Curl_easy *data, infof(data, " server certificate verification SKIPPED"); if(config->verifystatus) { - if(gnutls_ocsp_status_request_is_checked(session, 0) == 0) { - gnutls_datum_t status_request; - gnutls_ocsp_resp_t ocsp_resp; + gnutls_datum_t status_request; + gnutls_ocsp_resp_t ocsp_resp; + gnutls_ocsp_cert_status_t status; + gnutls_x509_crl_reason_t reason; - gnutls_ocsp_cert_status_t status; - gnutls_x509_crl_reason_t reason; - - rc = gnutls_ocsp_status_request_get(session, &status_request); - - infof(data, " server certificate status verification FAILED"); - - if(rc == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { - failf(data, "No OCSP response received"); - return CURLE_SSL_INVALIDCERTSTATUS; - } - - if(rc < 0) { - failf(data, "Invalid OCSP response received"); - return CURLE_SSL_INVALIDCERTSTATUS; - } - - gnutls_ocsp_resp_init(&ocsp_resp); - - rc = gnutls_ocsp_resp_import(ocsp_resp, &status_request); - if(rc < 0) { - failf(data, "Invalid OCSP response received"); - return CURLE_SSL_INVALIDCERTSTATUS; - } - - (void)gnutls_ocsp_resp_get_single(ocsp_resp, 0, NULL, NULL, NULL, NULL, - &status, NULL, NULL, NULL, &reason); - - switch(status) { - case GNUTLS_OCSP_CERT_GOOD: - break; - - case GNUTLS_OCSP_CERT_REVOKED: { - const char *crl_reason; - - switch(reason) { - default: - case GNUTLS_X509_CRLREASON_UNSPECIFIED: - crl_reason = "unspecified reason"; - break; - - case GNUTLS_X509_CRLREASON_KEYCOMPROMISE: - crl_reason = "private key compromised"; - break; - - case GNUTLS_X509_CRLREASON_CACOMPROMISE: - crl_reason = "CA compromised"; - break; - - case GNUTLS_X509_CRLREASON_AFFILIATIONCHANGED: - crl_reason = "affiliation has changed"; - break; - - case GNUTLS_X509_CRLREASON_SUPERSEDED: - crl_reason = "certificate superseded"; - break; - - case GNUTLS_X509_CRLREASON_CESSATIONOFOPERATION: - crl_reason = "operation has ceased"; - break; - - case GNUTLS_X509_CRLREASON_CERTIFICATEHOLD: - crl_reason = "certificate is on hold"; - break; - - case GNUTLS_X509_CRLREASON_REMOVEFROMCRL: - crl_reason = "will be removed from delta CRL"; - break; - - case GNUTLS_X509_CRLREASON_PRIVILEGEWITHDRAWN: - crl_reason = "privilege withdrawn"; - break; - - case GNUTLS_X509_CRLREASON_AACOMPROMISE: - crl_reason = "AA compromised"; - break; - } - - failf(data, "Server certificate was revoked: %s", crl_reason); - break; - } - - default: - case GNUTLS_OCSP_CERT_UNKNOWN: - failf(data, "Server certificate status is unknown"); - break; - } - - gnutls_ocsp_resp_deinit(ocsp_resp); + rc = gnutls_ocsp_status_request_get(session, &status_request); + if(rc == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { + failf(data, "No OCSP response received"); return CURLE_SSL_INVALIDCERTSTATUS; } - else - infof(data, " server certificate status verification OK"); + + if(rc < 0) { + failf(data, "Invalid OCSP response received"); + return CURLE_SSL_INVALIDCERTSTATUS; + } + + gnutls_ocsp_resp_init(&ocsp_resp); + + rc = gnutls_ocsp_resp_import(ocsp_resp, &status_request); + if(rc < 0) { + failf(data, "Invalid OCSP response received"); + return CURLE_SSL_INVALIDCERTSTATUS; + } + + (void)gnutls_ocsp_resp_get_single(ocsp_resp, 0, NULL, NULL, NULL, NULL, + &status, NULL, NULL, NULL, &reason); + + switch(status) { + case GNUTLS_OCSP_CERT_GOOD: + break; + + case GNUTLS_OCSP_CERT_REVOKED: { + const char *crl_reason; + + switch(reason) { + default: + case GNUTLS_X509_CRLREASON_UNSPECIFIED: + crl_reason = "unspecified reason"; + break; + + case GNUTLS_X509_CRLREASON_KEYCOMPROMISE: + crl_reason = "private key compromised"; + break; + + case GNUTLS_X509_CRLREASON_CACOMPROMISE: + crl_reason = "CA compromised"; + break; + + case GNUTLS_X509_CRLREASON_AFFILIATIONCHANGED: + crl_reason = "affiliation has changed"; + break; + + case GNUTLS_X509_CRLREASON_SUPERSEDED: + crl_reason = "certificate superseded"; + break; + + case GNUTLS_X509_CRLREASON_CESSATIONOFOPERATION: + crl_reason = "operation has ceased"; + break; + + case GNUTLS_X509_CRLREASON_CERTIFICATEHOLD: + crl_reason = "certificate is on hold"; + break; + + case GNUTLS_X509_CRLREASON_REMOVEFROMCRL: + crl_reason = "will be removed from delta CRL"; + break; + + case GNUTLS_X509_CRLREASON_PRIVILEGEWITHDRAWN: + crl_reason = "privilege withdrawn"; + break; + + case GNUTLS_X509_CRLREASON_AACOMPROMISE: + crl_reason = "AA compromised"; + break; + } + + failf(data, "Server certificate was revoked: %s", crl_reason); + break; + } + + default: + case GNUTLS_OCSP_CERT_UNKNOWN: + failf(data, "Server certificate status is unknown"); + break; + } + + gnutls_ocsp_resp_deinit(ocsp_resp); + if(status != GNUTLS_OCSP_CERT_GOOD) + return CURLE_SSL_INVALIDCERTSTATUS; } else infof(data, " server certificate status verification SKIPPED"); @@ -1035,17 +1512,17 @@ Curl_gtls_verifyserver(struct Curl_easy *data, gnutls_x509_crt_init(&x509_issuer); issuerp = load_file(config->issuercert); gnutls_x509_crt_import(x509_issuer, &issuerp, GNUTLS_X509_FMT_PEM); - rc = gnutls_x509_crt_check_issuer(x509_cert, x509_issuer); + rc = (int)gnutls_x509_crt_check_issuer(x509_cert, x509_issuer); gnutls_x509_crt_deinit(x509_issuer); unload_file(issuerp); if(rc <= 0) { failf(data, "server certificate issuer check failed (IssuerCert: %s)", - config->issuercert?config->issuercert:"none"); + config->issuercert ? config->issuercert : "none"); gnutls_x509_crt_deinit(x509_cert); return CURLE_SSL_ISSUER_ERROR; } infof(data, " server certificate issuer check OK (Issuer Cert: %s)", - config->issuercert?config->issuercert:"none"); + config->issuercert ? config->issuercert : "none"); } size = sizeof(certname); @@ -1064,12 +1541,18 @@ Curl_gtls_verifyserver(struct Curl_easy *data, in RFC2818 (HTTPS), which takes into account wildcards, and the subject alternative name PKIX extension. Returns non zero on success, and zero on failure. */ - rc = gnutls_x509_crt_check_hostname(x509_cert, peer->hostname); + + /* This function does not handle trailing dots, so if we have an SNI name + use that and fallback to the hostname only if there is no SNI (like for + IP addresses) */ + 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() didn't check IP + /* Before 3.3.6, gnutls_x509_crt_check_hostname() did not check IP addresses. */ if(!rc) { -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 #define use_addr in6_addr #else #define use_addr in_addr @@ -1079,7 +1562,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data, if(Curl_inet_pton(AF_INET, peer->hostname, addrbuf) > 0) addrlen = 4; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else if(Curl_inet_pton(AF_INET6, peer->hostname, addrbuf) > 0) addrlen = 16; #endif @@ -1092,7 +1575,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data, size_t certaddrlen = sizeof(certaddr); int ret = gnutls_x509_crt_get_subject_alt_name(x509_cert, i, certaddr, &certaddrlen, NULL); - /* If this happens, it wasn't an IP address. */ + /* If this happens, it was not an IP address. */ if(ret == GNUTLS_E_SHORT_MEMORY_BUFFER) continue; if(ret < 0) @@ -1110,7 +1593,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data, if(!rc) { if(config->verifyhost) { failf(data, "SSL: certificate subject name (%s) does not match " - "target host name '%s'", certname, peer->dispname); + "target hostname '%s'", certname, peer->dispname); gnutls_x509_crt_deinit(x509_cert); return CURLE_PEER_FAILED_VERIFICATION; } @@ -1199,7 +1682,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data, /* public key algorithm's parameters */ algo = gnutls_x509_crt_get_pk_algorithm(x509_cert, &bits); infof(data, " certificate public key: %s", - gnutls_pk_algorithm_get_name(algo)); + gnutls_pk_algorithm_get_name((gnutls_pk_algorithm_t)algo)); /* version of the X.509 certificate. */ infof(data, " certificate version: #%d", @@ -1243,9 +1726,13 @@ static CURLcode gtls_verifyserver(struct Curl_cfilter *cf, struct ssl_connect_data *connssl = cf->ctx; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - const char *pinned_key = Curl_ssl_cf_is_proxy(cf)? - data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]: +#ifndef CURL_DISABLE_PROXY + const char *pinned_key = Curl_ssl_cf_is_proxy(cf) ? + data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#else + const char *pinned_key = data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#endif CURLcode result; result = Curl_gtls_verifyserver(data, session, conn_config, ssl_config, @@ -1253,59 +1740,75 @@ static CURLcode gtls_verifyserver(struct Curl_cfilter *cf, if(result) goto out; - if(connssl->alpn) { - gnutls_datum_t proto; - int rc; + /* Only on TLSv1.2 or lower do we have the session id now. For + * TLSv1.3 we get it via a SESSION_TICKET message that arrives later. */ + if(gnutls_protocol_get_version(session) < GNUTLS_TLS1_3) + result = cf_gtls_update_session_id(cf, data, session); - rc = gnutls_alpn_get_selected_protocol(session, &proto); - if(rc == 0) - Curl_alpn_set_negotiated(cf, data, proto.data, proto.size); - else - Curl_alpn_set_negotiated(cf, data, NULL, 0); +out: + return result; +} + +static CURLcode gtls_set_earlydata(struct Curl_cfilter *cf, + struct Curl_easy *data, + const void *buf, size_t blen) +{ + struct ssl_connect_data *connssl = cf->ctx; + ssize_t nwritten = 0; + CURLcode result = CURLE_OK; + + DEBUGASSERT(connssl->earlydata_state == ssl_earlydata_use); + DEBUGASSERT(Curl_bufq_is_empty(&connssl->earlydata)); + if(blen) { + if(blen > connssl->earlydata_max) + blen = connssl->earlydata_max; + nwritten = Curl_bufq_write(&connssl->earlydata, buf, blen, &result); + CURL_TRC_CF(data, cf, "gtls_set_earlydata(len=%zu) -> %zd", + blen, nwritten); + if(nwritten < 0) + return result; } + connssl->earlydata_state = ssl_earlydata_sending; + connssl->earlydata_skip = Curl_bufq_len(&connssl->earlydata); + return CURLE_OK; +} - if(ssl_config->primary.sessionid) { - /* 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 - detect that. */ - void *connect_sessionid; - size_t connect_idsize = 0; +static CURLcode gtls_send_earlydata(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct gtls_ssl_backend_data *backend = + (struct gtls_ssl_backend_data *)connssl->backend; + CURLcode result = CURLE_OK; + const unsigned char *buf; + size_t blen; + ssize_t n; - /* get the session ID data size */ - gnutls_session_get_data(session, NULL, &connect_idsize); - connect_sessionid = malloc(connect_idsize); /* get a buffer for it */ - - if(connect_sessionid) { - bool incache; - bool added = FALSE; - void *ssl_sessionid; - - /* extract session ID to the allocated buffer */ - gnutls_session_get_data(session, connect_sessionid, &connect_idsize); - - Curl_ssl_sessionid_lock(data); - incache = !(Curl_ssl_getsessionid(cf, data, &ssl_sessionid, NULL)); - if(incache) { - /* there was one before in the cache, so instead of risking that the - previous one was rejected, we just kill that and store the new */ - Curl_ssl_delsessionid(data, ssl_sessionid); - } - - /* store this session id */ - result = Curl_ssl_addsessionid(cf, data, connect_sessionid, - connect_idsize, &added); - Curl_ssl_sessionid_unlock(data); - if(!added) - free(connect_sessionid); - if(result) { - result = CURLE_OUT_OF_MEMORY; - } + DEBUGASSERT(connssl->earlydata_state == ssl_earlydata_sending); + 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); + if(n < 0) { + if(n == GNUTLS_E_AGAIN) + result = CURLE_AGAIN; + else + result = backend->gtls.io_result ? + backend->gtls.io_result : CURLE_SEND_ERROR; + goto out; + } + else if(!n) { + /* gnutls is buggy, it *SHOULD* return the amount of bytes it took in. + * Instead it returns 0 if everything was written. */ + n = (ssize_t)blen; } - else - result = CURLE_OUT_OF_MEMORY; - } + Curl_bufq_skip(&connssl->earlydata, (size_t)n); + } + /* sent everything there was */ + infof(data, "SSL sending %" FMT_OFF_T " bytes of early data", + connssl->earlydata_skip); out: return result; } @@ -1316,53 +1819,96 @@ out: */ /* We use connssl->connecting_state to keep track of the connection status; there are three states: 'ssl_connect_1' (not started yet or complete), - 'ssl_connect_2_reading' (waiting for data from server), and - 'ssl_connect_2_writing' (waiting to be able to write). + 'ssl_connect_2' (doing handshake with the server), and + 'ssl_connect_3' (verifying and getting stats). */ static CURLcode gtls_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, bool nonblocking, - bool *done) -{ + bool *done) { struct ssl_connect_data *connssl = cf->ctx; - int rc; + struct gtls_ssl_backend_data *backend = + (struct gtls_ssl_backend_data *)connssl->backend; CURLcode result = CURLE_OK; + DEBUGASSERT(backend); + /* Initiate the connection, if not already done */ - if(ssl_connect_1 == connssl->connecting_state) { - rc = gtls_connect_step1(cf, data); - if(rc) { - result = rc; + if(connssl->connecting_state == ssl_connect_1) { + result = gtls_connect_step1(cf, data); + if(result) goto out; - } + connssl->connecting_state = ssl_connect_2; } - rc = handshake(cf, data, TRUE, nonblocking); - if(rc) { - /* handshake() sets its own error message with failf() */ - result = rc; - goto out; + if(connssl->connecting_state == ssl_connect_2) { + if(connssl->earlydata_state == ssl_earlydata_use) { + goto out; + } + else if(connssl->earlydata_state == ssl_earlydata_sending) { + result = gtls_send_earlydata(cf, data); + if(result) + goto out; + connssl->earlydata_state = ssl_earlydata_sent; + if(!Curl_ssl_cf_is_proxy(cf)) + Curl_pgrsEarlyData(data, (curl_off_t)connssl->earlydata_skip); + } + DEBUGASSERT((connssl->earlydata_state == ssl_earlydata_none) || + (connssl->earlydata_state == ssl_earlydata_sent)); + + result = handshake(cf, data, TRUE, nonblocking); + if(result) + goto out; + connssl->connecting_state = ssl_connect_3; } /* Finish connecting once the handshake is done */ - if(ssl_connect_1 == connssl->connecting_state) { - struct gtls_ssl_backend_data *backend = - (struct gtls_ssl_backend_data *)connssl->backend; - gnutls_session_t session; - DEBUGASSERT(backend); - session = backend->gtls.session; - rc = gtls_verifyserver(cf, data, session); - if(rc) { - result = rc; + if(connssl->connecting_state == ssl_connect_3) { + gnutls_datum_t proto; + int rc; + result = gtls_verifyserver(cf, data, backend->gtls.session); + if(result) goto out; - } + connssl->state = ssl_connection_complete; + connssl->connecting_state = ssl_connect_1; + + rc = gnutls_alpn_get_selected_protocol(backend->gtls.session, &proto); + if(rc) { /* No ALPN from server */ + proto.data = NULL; + proto.size = 0; + } + + result = Curl_alpn_set_negotiated(cf, data, connssl, + proto.data, proto.size); + if(result) + goto out; + + if(connssl->earlydata_state == ssl_earlydata_sent) { + if(gnutls_session_get_flags(backend->gtls.session) & + GNUTLS_SFLAGS_EARLY_DATA) { + connssl->earlydata_state = ssl_earlydata_accepted; + infof(data, "Server accepted %zu bytes of TLS early data.", + connssl->earlydata_skip); + } + else { + connssl->earlydata_state = ssl_earlydata_rejected; + if(!Curl_ssl_cf_is_proxy(cf)) + Curl_pgrsEarlyData(data, -(curl_off_t)connssl->earlydata_skip); + infof(data, "Server rejected TLS early data."); + connssl->earlydata_skip = 0; + } + } } out: - *done = ssl_connect_1 == connssl->connecting_state; - + if(result == CURLE_AGAIN) { + *done = FALSE; + return CURLE_OK; + } + *done = ((connssl->connecting_state == ssl_connect_1) || + (connssl->state == ssl_connection_deferred)); return result; } @@ -1370,6 +1916,12 @@ static CURLcode gtls_connect_nonblocking(struct Curl_cfilter *cf, struct Curl_easy *data, bool *done) { + struct ssl_connect_data *connssl = cf->ctx; + if(connssl->state == ssl_connection_deferred) { + /* We refuse to be pushed, we are waiting for someone to send/recv. */ + *done = TRUE; + return CURLE_OK; + } return gtls_connect_common(cf, data, TRUE, done); } @@ -1388,6 +1940,26 @@ static CURLcode gtls_connect(struct Curl_cfilter *cf, return CURLE_OK; } +static CURLcode gtls_connect_deferred(struct Curl_cfilter *cf, + struct Curl_easy *data, + const void *buf, + size_t blen, + bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + CURLcode result = CURLE_OK; + + DEBUGASSERT(connssl->state == ssl_connection_deferred); + *done = FALSE; + if(connssl->earlydata_state == ssl_earlydata_use) { + result = gtls_set_earlydata(cf, data, buf, blen); + if(result) + return result; + } + + return gtls_connect_common(cf, data, TRUE, done); +} + static bool gtls_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { @@ -1405,30 +1977,155 @@ static bool gtls_data_pending(struct Curl_cfilter *cf, static ssize_t gtls_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *mem, - size_t len, + const void *buf, + size_t blen, CURLcode *curlcode) { struct ssl_connect_data *connssl = cf->ctx; struct gtls_ssl_backend_data *backend = (struct gtls_ssl_backend_data *)connssl->backend; ssize_t rc; + size_t nwritten, total_written = 0; - (void)data; DEBUGASSERT(backend); - rc = gnutls_record_send(backend->gtls.session, mem, len); - if(rc < 0) { - *curlcode = (rc == GNUTLS_E_AGAIN) - ? CURLE_AGAIN - : CURLE_SEND_ERROR; - - rc = -1; + if(connssl->state == ssl_connection_deferred) { + bool done = FALSE; + *curlcode = gtls_connect_deferred(cf, data, buf, blen, &done); + if(*curlcode) { + rc = -1; + goto out; + } + else if(!done) { + *curlcode = CURLE_AGAIN; + rc = -1; + goto out; + } + DEBUGASSERT(connssl->state == ssl_connection_complete); } + if(connssl->earlydata_skip) { + if(connssl->earlydata_skip >= blen) { + connssl->earlydata_skip -= blen; + *curlcode = CURLE_OK; + rc = (ssize_t)blen; + goto out; + } + else { + total_written += connssl->earlydata_skip; + buf = ((const char *)buf) + connssl->earlydata_skip; + blen -= connssl->earlydata_skip; + connssl->earlydata_skip = 0; + } + } + + while(blen) { + backend->gtls.io_result = CURLE_OK; + rc = gnutls_record_send(backend->gtls.session, buf, blen); + + if(rc < 0) { + if(total_written && (rc == GNUTLS_E_AGAIN)) { + *curlcode = CURLE_OK; + rc = (ssize_t)total_written; + goto out; + } + *curlcode = (rc == GNUTLS_E_AGAIN) ? + CURLE_AGAIN : + (backend->gtls.io_result ? backend->gtls.io_result : CURLE_SEND_ERROR); + + rc = -1; + goto out; + } + nwritten = (size_t)rc; + total_written += nwritten; + DEBUGASSERT(nwritten <= blen); + buf = (char *)buf + nwritten; + blen -= nwritten; + } + rc = total_written; + +out: return rc; } +/* + * This function is called to shut down the SSL layer but keep the + * socket open (CCC - Clear Command Channel) + */ +static CURLcode gtls_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct gtls_ssl_backend_data *backend = + (struct gtls_ssl_backend_data *)connssl->backend; + char buf[1024]; + CURLcode result = CURLE_OK; + ssize_t nread; + size_t i; + + DEBUGASSERT(backend); + /* If we have no handshaked connection or already shut down */ + if(!backend->gtls.session || cf->shutdown || + connssl->state != ssl_connection_complete) { + *done = TRUE; + goto out; + } + + connssl->io_need = CURL_SSL_IO_NEED_NONE; + *done = FALSE; + + if(!backend->gtls.sent_shutdown) { + /* do this only once */ + backend->gtls.sent_shutdown = TRUE; + if(send_shutdown) { + int ret = gnutls_bye(backend->gtls.session, GNUTLS_SHUT_RDWR); + if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) { + CURL_TRC_CF(data, cf, "SSL shutdown, gnutls_bye EAGAIN"); + connssl->io_need = gnutls_record_get_direction(backend->gtls.session) ? + CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV; + backend->gtls.sent_shutdown = FALSE; + result = CURLE_OK; + goto out; + } + if(ret != GNUTLS_E_SUCCESS) { + CURL_TRC_CF(data, cf, "SSL shutdown, gnutls_bye error: '%s'(%d)", + gnutls_strerror((int)ret), (int)ret); + result = CURLE_RECV_ERROR; + goto out; + } + } + } + + /* SSL should now have started the shutdown from our side. Since it + * was not complete, we are lacking the close notify from the server. */ + for(i = 0; i < 10; ++i) { + nread = gnutls_record_recv(backend->gtls.session, buf, sizeof(buf)); + if(nread <= 0) + break; + } + if(nread > 0) { + /* still data coming in? */ + } + else if(nread == 0) { + /* We got the close notify alert and are done. */ + *done = TRUE; + } + else if((nread == GNUTLS_E_AGAIN) || (nread == GNUTLS_E_INTERRUPTED)) { + connssl->io_need = gnutls_record_get_direction(backend->gtls.session) ? + CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV; + } + else { + CURL_TRC_CF(data, cf, "SSL shutdown, error: '%s'(%d)", + gnutls_strerror((int)nread), (int)nread); + result = CURLE_RECV_ERROR; + } + +out: + cf->shutdown = (result || *done); + return result; +} + static void gtls_close(struct Curl_cfilter *cf, struct Curl_easy *data) { @@ -1438,19 +2135,13 @@ static void gtls_close(struct Curl_cfilter *cf, (void) data; DEBUGASSERT(backend); - + CURL_TRC_CF(data, cf, "close"); if(backend->gtls.session) { - char buf[32]; - /* Maybe the server has already sent a close notify alert. - Read it to avoid an RST on the TCP connection. */ - (void)gnutls_record_recv(backend->gtls.session, buf, sizeof(buf)); - gnutls_bye(backend->gtls.session, GNUTLS_SHUT_WR); gnutls_deinit(backend->gtls.session); backend->gtls.session = NULL; } - if(backend->gtls.cred) { - gnutls_certificate_free_credentials(backend->gtls.cred); - backend->gtls.cred = NULL; + if(backend->gtls.shared_creds) { + Curl_gtls_shared_creds_free(&backend->gtls.shared_creds); } #ifdef USE_GNUTLS_SRP if(backend->gtls.srp_client_cred) { @@ -1460,89 +2151,6 @@ static void gtls_close(struct Curl_cfilter *cf, #endif } -/* - * This function is called to shut down the SSL layer but keep the - * socket open (CCC - Clear Command Channel) - */ -static int gtls_shutdown(struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - struct ssl_connect_data *connssl = cf->ctx; - struct gtls_ssl_backend_data *backend = - (struct gtls_ssl_backend_data *)connssl->backend; - int retval = 0; - - DEBUGASSERT(backend); - -#ifndef CURL_DISABLE_FTP - /* This has only been tested on the proftpd server, and the mod_tls code - sends a close notify alert without waiting for a close notify alert in - response. Thus we wait for a close notify alert from the server, but - we do not send one. Let's hope other servers do the same... */ - - if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) - gnutls_bye(backend->gtls.session, GNUTLS_SHUT_WR); -#endif - - if(backend->gtls.session) { - ssize_t result; - bool done = FALSE; - char buf[120]; - - while(!done) { - int what = SOCKET_READABLE(Curl_conn_cf_get_socket(cf, data), - SSL_SHUTDOWN_TIMEOUT); - if(what > 0) { - /* Something to read, let's do it and hope that it is the close - notify alert from the server */ - result = gnutls_record_recv(backend->gtls.session, - buf, sizeof(buf)); - switch(result) { - case 0: - /* This is the expected response. There was no data but only - the close notify alert */ - done = TRUE; - break; - case GNUTLS_E_AGAIN: - case GNUTLS_E_INTERRUPTED: - infof(data, "GNUTLS_E_AGAIN || GNUTLS_E_INTERRUPTED"); - break; - default: - retval = -1; - done = TRUE; - break; - } - } - else if(0 == what) { - /* timeout */ - failf(data, "SSL shutdown timeout"); - done = TRUE; - } - else { - /* anything that gets here is fatally bad */ - failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); - retval = -1; - done = TRUE; - } - } - gnutls_deinit(backend->gtls.session); - } - gnutls_certificate_free_credentials(backend->gtls.cred); - -#ifdef USE_GNUTLS_SRP - { - struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - if(ssl_config->primary.username) - gnutls_srp_free_client_credentials(backend->gtls.srp_client_cred); - } -#endif - - backend->gtls.cred = NULL; - backend->gtls.session = NULL; - - return retval; -} - static ssize_t gtls_recv(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, @@ -1557,6 +2165,21 @@ static ssize_t gtls_recv(struct Curl_cfilter *cf, (void)data; DEBUGASSERT(backend); + if(connssl->state == ssl_connection_deferred) { + bool done = FALSE; + *curlcode = gtls_connect_deferred(cf, data, NULL, 0, &done); + if(*curlcode) { + ret = -1; + goto out; + } + else if(!done) { + *curlcode = CURLE_AGAIN; + ret = -1; + goto out; + } + DEBUGASSERT(connssl->state == ssl_connection_complete); + } + ret = gnutls_record_recv(backend->gtls.session, buf, buffersize); if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) { *curlcode = CURLE_AGAIN; @@ -1579,9 +2202,9 @@ static ssize_t gtls_recv(struct Curl_cfilter *cf, if(ret < 0) { failf(data, "GnuTLS recv error (%d): %s", - (int)ret, gnutls_strerror((int)ret)); - *curlcode = CURLE_RECV_ERROR; + *curlcode = backend->gtls.io_result ? + backend->gtls.io_result : CURLE_RECV_ERROR; ret = -1; goto out; } @@ -1590,11 +2213,6 @@ out: return ret; } -static void gtls_session_free(void *ptr) -{ - free(ptr); -} - static size_t gtls_version(char *buffer, size_t size) { return msnprintf(buffer, size, "GnuTLS/%s", gnutls_check_version(NULL)); @@ -1607,7 +2225,7 @@ static CURLcode gtls_random(struct Curl_easy *data, int rc; (void)data; rc = gnutls_rnd(GNUTLS_RND_RANDOM, entropy, length); - return rc?CURLE_FAILED_INIT:CURLE_OK; + return rc ? CURLE_FAILED_INIT : CURLE_OK; } static CURLcode gtls_sha256sum(const unsigned char *tmp, /* input */ @@ -1643,7 +2261,8 @@ const struct Curl_ssl Curl_ssl_gnutls = { SSLSUPP_CA_PATH | SSLSUPP_CERTINFO | SSLSUPP_PINNEDPUBKEY | - SSLSUPP_HTTPS_PROXY, + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CA_CACHE, sizeof(struct gtls_ssl_backend_data), @@ -1661,7 +2280,6 @@ const struct Curl_ssl Curl_ssl_gnutls = { gtls_get_internals, /* get_internals */ gtls_close, /* close_one */ Curl_none_close_all, /* close_all */ - gtls_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -1669,9 +2287,9 @@ const struct Curl_ssl Curl_ssl_gnutls = { gtls_sha256sum, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ gtls_recv, /* recv decrypted data */ gtls_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #endif /* USE_GNUTLS */ diff --git a/deps/curl/lib/vtls/gtls.h b/deps/curl/lib/vtls/gtls.h index 1a81c01e..4f9c540e 100644 --- a/deps/curl/lib/vtls/gtls.h +++ b/deps/curl/lib/vtls/gtls.h @@ -30,6 +30,7 @@ #ifdef USE_GNUTLS #include +#include "timeval.h" #ifdef HAVE_GNUTLS_SRP /* the function exists */ @@ -44,30 +45,62 @@ struct Curl_cfilter; struct ssl_primary_config; struct ssl_config_data; struct ssl_peer; +struct ssl_connect_data; -struct gtls_instance { +struct gtls_shared_creds { + gnutls_certificate_credentials_t creds; + char *CAfile; /* CAfile path used to generate X509 store */ + struct curltime time; /* when the shared creds was created */ + size_t refcount; + BIT(trust_setup); /* x509 anchors + CRLs have been set up */ +}; + +CURLcode Curl_gtls_shared_creds_create(struct Curl_easy *data, + struct gtls_shared_creds **pcreds); +CURLcode Curl_gtls_shared_creds_up_ref(struct gtls_shared_creds *creds); +void Curl_gtls_shared_creds_free(struct gtls_shared_creds **pcreds); + +struct gtls_ctx { gnutls_session_t session; - gnutls_certificate_credentials_t cred; + struct gtls_shared_creds *shared_creds; #ifdef USE_GNUTLS_SRP gnutls_srp_client_credentials_t srp_client_cred; #endif + CURLcode io_result; /* result of last IO cfilter operation */ + BIT(sent_shutdown); }; -CURLcode -gtls_client_init(struct Curl_easy *data, - struct ssl_primary_config *config, - struct ssl_config_data *ssl_config, - struct ssl_peer *peer, - struct gtls_instance *gtls, - long *pverifyresult); +typedef CURLcode Curl_gtls_ctx_setup_cb(struct Curl_cfilter *cf, + struct Curl_easy *data, + void *user_data); -CURLcode -Curl_gtls_verifyserver(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_ctx_init(struct gtls_ctx *gctx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + const unsigned char *alpn, size_t alpn_len, + struct ssl_connect_data *connssl, + Curl_gtls_ctx_setup_cb *cb_setup, + void *cb_user_data, + void *ssl_user_data); + +CURLcode Curl_gtls_client_trust_setup(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct gtls_ctx *gtls); + +CURLcode Curl_gtls_verifyserver(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); + +/* Extract TLS session and place in cache, if configured. */ +CURLcode Curl_gtls_update_session_id(struct Curl_cfilter *cf, + struct Curl_easy *data, + gnutls_session_t session, + struct ssl_peer *peer, + const char *alpn); extern const struct Curl_ssl Curl_ssl_gnutls; diff --git a/deps/curl/lib/vtls/hostcheck.c b/deps/curl/lib/vtls/hostcheck.c index 2726dca7..e46439a5 100644 --- a/deps/curl/lib/vtls/hostcheck.c +++ b/deps/curl/lib/vtls/hostcheck.c @@ -62,7 +62,7 @@ static bool pmatch(const char *hostname, size_t hostlen, * We use the matching rule described in RFC6125, section 6.4.3. * https://datatracker.ietf.org/doc/html/rfc6125#section-6.4.3 * - * In addition: ignore trailing dots in the host names and wildcards, so that + * In addition: ignore trailing dots in the hostnames and wildcards, so that * the names are used normalized. This is what the browsers do. * * Do not allow wildcard matching on IP numbers. There are apparently diff --git a/deps/curl/lib/vtls/hostcheck.h b/deps/curl/lib/vtls/hostcheck.h index 22a1ac2e..6b4e3796 100644 --- a/deps/curl/lib/vtls/hostcheck.h +++ b/deps/curl/lib/vtls/hostcheck.h @@ -26,7 +26,7 @@ #include -/* returns TRUE if there's a match */ +/* returns TRUE if there is a match */ bool Curl_cert_hostcheck(const char *match_pattern, size_t matchlen, const char *hostname, size_t hostlen); diff --git a/deps/curl/lib/vtls/keylog.c b/deps/curl/lib/vtls/keylog.c index fbcb25cf..ca86c156 100644 --- a/deps/curl/lib/vtls/keylog.c +++ b/deps/curl/lib/vtls/keylog.c @@ -24,6 +24,7 @@ #include "curl_setup.h" #if defined(USE_OPENSSL) || \ + defined(USE_GNUTLS) || \ defined(USE_WOLFSSL) || \ (defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || \ defined(USE_QUICHE) @@ -98,13 +99,13 @@ Curl_tls_keylog_write_line(const char *line) char buf[256]; if(!keylog_file_fp || !line) { - return false; + return FALSE; } linelen = strlen(line); if(linelen == 0 || linelen > sizeof(buf) - 2) { /* Empty line or too big to fit in a LF and NUL. */ - return false; + return FALSE; } memcpy(buf, line, linelen); @@ -116,7 +117,7 @@ Curl_tls_keylog_write_line(const char *line) /* Using fputs here instead of fprintf since libcurl's fprintf replacement may not be thread-safe. */ fputs(buf, keylog_file_fp); - return true; + return TRUE; } bool @@ -130,13 +131,13 @@ Curl_tls_keylog_write(const char *label, 2 * SECRET_MAXLEN + 1 + 1]; if(!keylog_file_fp) { - return false; + return FALSE; } pos = strlen(label); if(pos > KEYLOG_LABEL_MAXLEN || !secretlen || secretlen > SECRET_MAXLEN) { /* Should never happen - sanity check anyway. */ - return false; + return FALSE; } memcpy(line, label, pos); @@ -160,7 +161,7 @@ Curl_tls_keylog_write(const char *label, /* Using fputs here instead of fprintf since libcurl's fprintf replacement may not be thread-safe. */ fputs(line, keylog_file_fp); - return true; + return TRUE; } #endif /* TLS or QUIC backend */ diff --git a/deps/curl/lib/vtls/mbedtls.c b/deps/curl/lib/vtls/mbedtls.c index 0ef6df0f..e24def89 100644 --- a/deps/curl/lib/vtls/mbedtls.c +++ b/deps/curl/lib/vtls/mbedtls.c @@ -36,13 +36,6 @@ /* Define this to enable lots of debugging for mbedTLS */ /* #define MBEDTLS_DEBUG */ -#ifdef __GNUC__ -#pragma GCC diagnostic push -/* mbedTLS (as of v3.5.1) has a duplicate function declaration - in its public headers. Disable the warning that detects it. */ -#pragma GCC diagnostic ignored "-Wredundant-decls" -#endif - #include #if MBEDTLS_VERSION_NUMBER >= 0x02040000 #include @@ -63,16 +56,15 @@ # endif #endif -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - +#include "cipher_suite.h" +#include "strcase.h" #include "urldata.h" #include "sendf.h" #include "inet_pton.h" #include "mbedtls.h" #include "vtls.h" #include "vtls_int.h" +#include "x509asn1.h" #include "parsedate.h" #include "connect.h" /* for the connect timeout */ #include "select.h" @@ -107,10 +99,14 @@ struct mbed_ssl_backend_data { #ifdef HAS_ALPN const char *protocols[3]; #endif + int *ciphersuites; + BIT(initialized); /* mbedtls_ssl_context is initialized */ + BIT(sent_shutdown); }; /* apply threading? */ -#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) +#if (defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || \ + defined(_WIN32) #define THREADING_SUPPORT #endif @@ -118,12 +114,19 @@ struct mbed_ssl_backend_data { #define mbedtls_strerror(a,b,c) b[0] = 0 #endif +#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && MBEDTLS_VERSION_NUMBER >= 0x03060000 +#define TLS13_SUPPORT +#endif + +#if defined(TLS13_SUPPORT) && defined(MBEDTLS_SSL_SESSION_TICKETS) +#define HAS_SESSION_TICKETS +#endif + #if defined(THREADING_SUPPORT) static mbedtls_entropy_context ts_entropy; static int entropy_init_initialized = 0; -/* start of entropy_init_mutex() */ static void entropy_init_mutex(mbedtls_entropy_context *ctx) { /* lock 0 = entropy_init_mutex() */ @@ -134,9 +137,18 @@ static void entropy_init_mutex(mbedtls_entropy_context *ctx) } Curl_mbedtlsthreadlock_unlock_function(0); } -/* end of entropy_init_mutex() */ -/* start of entropy_func_mutex() */ +static void entropy_cleanup_mutex(mbedtls_entropy_context *ctx) +{ + /* lock 0 = use same lock as init */ + Curl_mbedtlsthreadlock_lock_function(0); + if(entropy_init_initialized == 1) { + mbedtls_entropy_free(ctx); + entropy_init_initialized = 0; + } + Curl_mbedtlsthreadlock_unlock_function(0); +} + static int entropy_func_mutex(void *data, unsigned char *output, size_t len) { int ret; @@ -147,7 +159,6 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len) return ret; } -/* end of entropy_func_mutex() */ #endif /* THREADING_SUPPORT */ @@ -155,15 +166,18 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len) static void mbed_debug(void *context, int level, const char *f_name, int line_nb, const char *line) { - struct Curl_easy *data = NULL; - - if(!context) - return; - - data = (struct Curl_easy *)context; - - infof(data, "%s", line); + struct Curl_easy *data = (struct Curl_easy *)context; (void) level; + (void) line_nb; + (void) f_name; + + if(data) { + size_t len = strlen(line); + if(len && (line[len - 1] == '\n')) + /* discount any trailing newline */ + len--; + infof(data, "%.*s", (int)len, line); + } } #endif @@ -179,7 +193,8 @@ static int mbedtls_bio_cf_write(void *bio, if(!data) return 0; - nwritten = Curl_conn_cf_send(cf->next, data, (char *)buf, blen, &result); + nwritten = Curl_conn_cf_send(cf->next, data, (char *)buf, blen, FALSE, + &result); CURL_TRC_CF(data, cf, "mbedtls_bio_cf_out_write(len=%zu) -> %zd, err=%d", blen, nwritten, result); if(nwritten < 0 && CURLE_AGAIN == result) { @@ -228,8 +243,8 @@ static const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr = 1024, /* RSA min key len */ }; -/* See https://tls.mbed.org/discussions/generic/ - howto-determine-exact-buffer-len-for-mbedtls_pk_write_pubkey_der +/* See https://web.archive.org/web/20200921194007/tls.mbed.org/discussions/ + generic/howto-determine-exact-buffer-len-for-mbedtls_pk_write_pubkey_der */ #define RSA_PUB_DER_MAX_BYTES (38 + 2 * MBEDTLS_MPI_MAX_SIZE) #define ECP_PUB_DER_MAX_BYTES (30 + 2 * MBEDTLS_ECP_MAX_BYTES) @@ -237,114 +252,307 @@ static const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr = #define PUB_DER_MAX_BYTES (RSA_PUB_DER_MAX_BYTES > ECP_PUB_DER_MAX_BYTES ? \ RSA_PUB_DER_MAX_BYTES : ECP_PUB_DER_MAX_BYTES) -#if MBEDTLS_VERSION_NUMBER >= 0x03020000 -static CURLcode mbedtls_version_from_curl( - mbedtls_ssl_protocol_version* mbedver, long version) +static CURLcode +mbed_set_ssl_version_min_max(struct Curl_easy *data, + struct mbed_ssl_backend_data *backend, + struct ssl_primary_config *conn_config) { - switch(version) { - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1_1: - case CURL_SSLVERSION_TLSv1_2: - *mbedver = MBEDTLS_SSL_VERSION_TLS1_2; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_3: - break; - } + /* TLS 1.0 and TLS 1.1 were dropped with mbedTLS 3.0.0 (2021). So, since + * then, and before the introduction of TLS 1.3 in 3.6.0 (2024), this + * function basically always sets TLS 1.2 as min/max, unless given + * unsupported option values. */ - return CURLE_SSL_CONNECT_ERROR; -} +#if MBEDTLS_VERSION_NUMBER < 0x03020000 + int ver_min = MBEDTLS_SSL_MINOR_VERSION_3; /* TLS 1.2 */ + int ver_max = MBEDTLS_SSL_MINOR_VERSION_3; /* TLS 1.2 */ #else -static CURLcode mbedtls_version_from_curl(int *mbedver, long version) -{ -#if MBEDTLS_VERSION_NUMBER >= 0x03000000 - switch(version) { - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1_1: - case CURL_SSLVERSION_TLSv1_2: - *mbedver = MBEDTLS_SSL_MINOR_VERSION_3; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_3: - break; - } -#else - switch(version) { - case CURL_SSLVERSION_TLSv1_0: - *mbedver = MBEDTLS_SSL_MINOR_VERSION_1; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_1: - *mbedver = MBEDTLS_SSL_MINOR_VERSION_2; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_2: - *mbedver = MBEDTLS_SSL_MINOR_VERSION_3; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_3: - break; - } + /* mbedTLS 3.2.0 (2022) introduced new methods for setting TLS version */ + mbedtls_ssl_protocol_version ver_min = MBEDTLS_SSL_VERSION_TLS1_2; + mbedtls_ssl_protocol_version ver_max = MBEDTLS_SSL_VERSION_TLS1_2; #endif - return CURLE_SSL_CONNECT_ERROR; + switch(conn_config->version) { + case CURL_SSLVERSION_DEFAULT: +#if MBEDTLS_VERSION_NUMBER < 0x03000000 + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + ver_min = MBEDTLS_SSL_MINOR_VERSION_1; + break; + case CURL_SSLVERSION_TLSv1_1: + ver_min = MBEDTLS_SSL_MINOR_VERSION_2; + break; +#else + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + case CURL_SSLVERSION_TLSv1_1: +#endif + case CURL_SSLVERSION_TLSv1_2: + /* ver_min = MBEDTLS_SSL_VERSION_TLS1_2; */ + break; + case CURL_SSLVERSION_TLSv1_3: +#ifdef TLS13_SUPPORT + ver_min = MBEDTLS_SSL_VERSION_TLS1_3; + break; +#endif + default: + failf(data, "mbedTLS: unsupported minimum TLS version value: %x", + conn_config->version); + return CURLE_SSL_CONNECT_ERROR; + } + + switch(conn_config->version_max) { + case CURL_SSLVERSION_MAX_DEFAULT: + case CURL_SSLVERSION_MAX_NONE: + case CURL_SSLVERSION_MAX_TLSv1_3: +#ifdef TLS13_SUPPORT + ver_max = MBEDTLS_SSL_VERSION_TLS1_3; + break; +#endif + case CURL_SSLVERSION_MAX_TLSv1_2: + /* ver_max = MBEDTLS_SSL_VERSION_TLS1_2; */ + break; +#if MBEDTLS_VERSION_NUMBER < 0x03000000 + case CURL_SSLVERSION_MAX_TLSv1_1: + ver_max = MBEDTLS_SSL_MINOR_VERSION_2; + break; + case CURL_SSLVERSION_MAX_TLSv1_0: + ver_max = MBEDTLS_SSL_MINOR_VERSION_1; + break; +#else + case CURL_SSLVERSION_MAX_TLSv1_1: + case CURL_SSLVERSION_MAX_TLSv1_0: +#endif + default: + failf(data, "mbedTLS: unsupported maximum TLS version value"); + return CURLE_SSL_CONNECT_ERROR; + } + +#if MBEDTLS_VERSION_NUMBER < 0x03020000 + mbedtls_ssl_conf_min_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, + ver_min); + mbedtls_ssl_conf_max_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, + ver_max); +#else + mbedtls_ssl_conf_min_tls_version(&backend->config, ver_min); + mbedtls_ssl_conf_max_tls_version(&backend->config, ver_max); +#endif + + return CURLE_OK; } + +/* TLS_ECJPAKE_WITH_AES_128_CCM_8 (0xC0FF) is marked experimental + in mbedTLS. The number is not reserved by IANA nor is the + 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 +#if MBEDTLS_VERSION_NUMBER >= 0x03020000 +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) + msnprintf(buf, buf_size, "%s", "TLS_ECJPAKE_WITH_AES_128_CCM_8"); + else + return Curl_cipher_suite_get_str(id, buf, buf_size, prefer_rfc); + return 0; +} +#endif + +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; + + if(!id) { + if(strncasecompare("TLS_ECJPAKE_WITH_AES_128_CCM_8", *str, len)) + id = MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8; + } + return id; +} +#else +#define mbed_cipher_suite_get_str Curl_cipher_suite_get_str +#define mbed_cipher_suite_walk_str Curl_cipher_suite_walk_str #endif static CURLcode -set_ssl_version_min_max(struct Curl_cfilter *cf, struct Curl_easy *data) +mbed_set_selected_ciphers(struct Curl_easy *data, + struct mbed_ssl_backend_data *backend, + const char *ciphers12, + const char *ciphers13) { - struct ssl_connect_data *connssl = cf->ctx; - struct mbed_ssl_backend_data *backend = - (struct mbed_ssl_backend_data *)connssl->backend; + const char *ciphers = ciphers12; + const int *supported; + int *selected; + size_t supported_len, count = 0, default13_count = 0, i, j; + const char *ptr, *end; + + supported = mbedtls_ssl_list_ciphersuites(); + for(i = 0; supported[i] != 0; i++); + supported_len = i; + + selected = malloc(sizeof(int) * (supported_len + 1)); + if(!selected) + return CURLE_OUT_OF_MEMORY; + +#ifndef TLS13_SUPPORT + (void) ciphers13, (void) j; +#else + if(!ciphers13) { + /* Add default TLSv1.3 ciphers to selection */ + for(j = 0; j < supported_len; j++) { + uint16_t id = (uint16_t) supported[j]; + if(strncmp(mbedtls_ssl_get_ciphersuite_name(id), "TLS1-3", 6) != 0) + continue; + + selected[count++] = id; + } + + default13_count = count; + } + else + ciphers = ciphers13; + +add_ciphers: +#endif + for(ptr = ciphers; ptr[0] != '\0' && count < supported_len; ptr = end) { + uint16_t id = mbed_cipher_suite_walk_str(&ptr, &end); + + /* Check if cipher is supported */ + if(id) { + 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); + continue; + } + + /* No duplicates allowed (so selected cannot overflow) */ + 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); + continue; + } + + selected[count++] = id; + } + +#ifdef TLS13_SUPPORT + if(ciphers == ciphers13 && ciphers12) { + ciphers = ciphers12; + goto add_ciphers; + } + + if(!ciphers12) { + /* Add default TLSv1.2 ciphers to selection */ + for(j = 0; j < supported_len; 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++); + if(i < count) + continue; + + selected[count++] = id; + } + } +#endif + + selected[count] = 0; + + if(count == 0) { + free(selected); + failf(data, "mbedTLS: no supported cipher in list"); + return CURLE_SSL_CIPHER; + } + + /* mbedtls_ssl_conf_ciphersuites(): The ciphersuites array is not copied. + It must remain valid for the lifetime of the SSL configuration */ + backend->ciphersuites = selected; + mbedtls_ssl_conf_ciphersuites(&backend->config, backend->ciphersuites); + return CURLE_OK; +} + +static void +mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) +{ +#if defined(CURL_DISABLE_VERBOSE_STRINGS) || \ + (MBEDTLS_VERSION_NUMBER >= 0x03000000 && defined(MBEDTLS_X509_REMOVE_INFO)) + (void) data, (void) crt; +#else + const size_t bufsize = 16384; + char *p, *buffer = malloc(bufsize); + + if(buffer && mbedtls_x509_crt_info(buffer, bufsize, " ", crt) > 0) { + infof(data, "Server certificate:"); + for(p = buffer; *p; p += *p != '\0') { + size_t s = strcspn(p, "\n"); + infof(data, "%.*s", (int) s, p); + p += s; + } + } + else + infof(data, "Unable to dump certificate information"); + + free(buffer); +#endif +} + +static void +mbed_extract_certinfo(struct Curl_easy *data, const mbedtls_x509_crt *crt) +{ + CURLcode result; + const mbedtls_x509_crt *cur; + int i; + + for(i = 0, cur = crt; cur; ++i, cur = cur->next); + result = Curl_ssl_init_certinfo(data, i); + + for(i = 0, cur = crt; result == CURLE_OK && cur; ++i, cur = cur->next) { + const char *beg = (const char *) cur->raw.p; + const char *end = beg + cur->raw.len; + result = Curl_extract_certinfo(data, i, beg, end); + } +} + +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 ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); -#if MBEDTLS_VERSION_NUMBER >= 0x03020000 - mbedtls_ssl_protocol_version mbedtls_ver_min = MBEDTLS_SSL_VERSION_TLS1_2; - mbedtls_ssl_protocol_version mbedtls_ver_max = MBEDTLS_SSL_VERSION_TLS1_2; -#elif MBEDTLS_VERSION_NUMBER >= 0x03000000 - int mbedtls_ver_min = MBEDTLS_SSL_MINOR_VERSION_3; - int mbedtls_ver_max = MBEDTLS_SSL_MINOR_VERSION_3; + struct Curl_easy *data = CF_DATA_CURRENT(cf); + + if(depth == 0) { + if(data->set.verbose) + mbed_dump_cert_info(data, crt); + if(data->set.ssl.certinfo) + mbed_extract_certinfo(data, crt); + } + + if(!conn_config->verifypeer) + *flags = 0; + else if(!conn_config->verifyhost) + *flags &= ~MBEDTLS_X509_BADCERT_CN_MISMATCH; + + if(*flags) { +#if MBEDTLS_VERSION_NUMBER < 0x03000000 || !defined(MBEDTLS_X509_REMOVE_INFO) + char buf[128]; + mbedtls_x509_crt_verify_info(buf, sizeof(buf), "", *flags); + failf(data, "mbedTLS: %s", buf); #else - int mbedtls_ver_min = MBEDTLS_SSL_MINOR_VERSION_1; - int mbedtls_ver_max = MBEDTLS_SSL_MINOR_VERSION_1; + failf(data, "mbedTLS: certificate verification error 0x%08x", *flags); #endif - long ssl_version = conn_config->version; - long ssl_version_max = conn_config->version_max; - CURLcode result = CURLE_OK; - - DEBUGASSERT(backend); - - switch(ssl_version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: - ssl_version = CURL_SSLVERSION_TLSv1_0; - break; } - switch(ssl_version_max) { - case CURL_SSLVERSION_MAX_NONE: - case CURL_SSLVERSION_MAX_DEFAULT: - ssl_version_max = CURL_SSLVERSION_MAX_TLSv1_2; - break; - } - - result = mbedtls_version_from_curl(&mbedtls_ver_min, ssl_version); - if(result) { - failf(data, "unsupported min version passed via CURLOPT_SSLVERSION"); - return result; - } - result = mbedtls_version_from_curl(&mbedtls_ver_max, ssl_version_max >> 16); - if(result) { - failf(data, "unsupported max version passed via CURLOPT_SSLVERSION"); - return result; - } - -#if MBEDTLS_VERSION_NUMBER >= 0x03020000 - mbedtls_ssl_conf_min_tls_version(&backend->config, mbedtls_ver_min); - mbedtls_ssl_conf_max_tls_version(&backend->config, mbedtls_ver_max); -#else - mbedtls_ssl_conf_min_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, - mbedtls_ver_min); - mbedtls_ssl_conf_max_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, - mbedtls_ver_max); -#endif - - return result; + return 0; } static CURLcode @@ -369,6 +577,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) char errorbuf[128]; DEBUGASSERT(backend); + DEBUGASSERT(!backend->initialized); if((conn_config->version == CURL_SSLVERSION_SSLv2) || (conn_config->version == CURL_SSLVERSION_SSLv3)) { @@ -376,8 +585,17 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_NOT_BUILT_IN; } +#ifdef TLS13_SUPPORT + ret = psa_crypto_init(); + if(ret != PSA_SUCCESS) { + mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); + failf(data, "mbedTLS psa_crypto_init returned (-0x%04X) %s", + -ret, errorbuf); + return CURLE_SSL_CONNECT_ERROR; + } +#endif /* TLS13_SUPPORT */ + #ifdef THREADING_SUPPORT - entropy_init_mutex(&ts_entropy); mbedtls_ctr_drbg_init(&backend->ctr_drbg); ret = mbedtls_ctr_drbg_seed(&backend->ctr_drbg, entropy_func_mutex, @@ -416,7 +634,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) ret = mbedtls_x509_crt_parse(&backend->cacert, newblob, ca_info_blob->len + 1); free(newblob); - if(ret<0) { + if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); failf(data, "Error importing ca cert blob - mbedTLS: (-0x%04X) %s", -ret, errorbuf); @@ -428,7 +646,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) #ifdef MBEDTLS_FS_IO ret = mbedtls_x509_crt_parse_file(&backend->cacert, ssl_cafile); - if(ret<0) { + if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); failf(data, "Error reading ca cert file %s - mbedTLS: (-0x%04X) %s", ssl_cafile, -ret, errorbuf); @@ -444,7 +662,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) #ifdef MBEDTLS_FS_IO ret = mbedtls_x509_crt_parse_path(&backend->cacert, ssl_capath); - if(ret<0) { + if(ret < 0) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); failf(data, "Error reading ca cert path %s - mbedTLS: (-0x%04X) %s", ssl_capath, -ret, errorbuf); @@ -492,7 +710,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) if(ret) { mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "Error reading private key %s - mbedTLS: (-0x%04X) %s", + failf(data, "Error reading client cert data %s - mbedTLS: (-0x%04X) %s", ssl_config->key, -ret, errorbuf); return CURLE_SSL_CERTPROBLEM; } @@ -582,7 +800,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } #endif - infof(data, "mbedTLS: Connecting to %s:%d", hostname, connssl->port); + infof(data, "mbedTLS: Connecting to %s:%d", hostname, connssl->peer.port); mbedtls_ssl_config_init(&backend->config); ret = mbedtls_ssl_config_defaults(&backend->config, @@ -594,51 +812,66 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_SSL_CONNECT_ERROR; } +#ifdef MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED + /* New in mbedTLS 3.6.1, need to enable, default is now disabled */ + mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config, + MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED); +#endif + + /* Always let mbedTLS verify certificates, if verifypeer or verifyhost are + * disabled we clear the corresponding error flags in the verify callback + * function. That is also where we log verification errors. */ + mbedtls_ssl_conf_verify(&backend->config, mbed_verify_cb, cf); + mbedtls_ssl_conf_authmode(&backend->config, MBEDTLS_SSL_VERIFY_REQUIRED); + mbedtls_ssl_init(&backend->ssl); - if(mbedtls_ssl_setup(&backend->ssl, &backend->config)) { - failf(data, "mbedTLS: ssl_init failed"); - return CURLE_SSL_CONNECT_ERROR; - } + backend->initialized = TRUE; /* new profile with RSA min key len = 1024 ... */ mbedtls_ssl_conf_cert_profile(&backend->config, &mbedtls_x509_crt_profile_fr); - switch(conn_config->version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: -#if MBEDTLS_VERSION_NUMBER < 0x03000000 - mbedtls_ssl_conf_min_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, - MBEDTLS_SSL_MINOR_VERSION_1); - infof(data, "mbedTLS: Set min SSL version to TLS 1.0"); - break; -#endif - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1_1: - case CURL_SSLVERSION_TLSv1_2: - case CURL_SSLVERSION_TLSv1_3: - { - CURLcode result = set_ssl_version_min_max(cf, data); - if(result != CURLE_OK) - return result; - break; - } - default: - failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); - return CURLE_SSL_CONNECT_ERROR; - } - - mbedtls_ssl_conf_authmode(&backend->config, MBEDTLS_SSL_VERIFY_OPTIONAL); + ret = mbed_set_ssl_version_min_max(data, backend, conn_config); + if(ret != CURLE_OK) + return ret; mbedtls_ssl_conf_rng(&backend->config, mbedtls_ctr_drbg_random, &backend->ctr_drbg); + + 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", + -ret, errorbuf); + return CURLE_SSL_CONNECT_ERROR; + } + mbedtls_ssl_set_bio(&backend->ssl, cf, mbedtls_bio_cf_write, mbedtls_bio_cf_read, NULL /* rev_timeout() */); - mbedtls_ssl_conf_ciphersuites(&backend->config, - mbedtls_ssl_list_ciphersuites()); +#ifndef TLS13_SUPPORT + if(conn_config->cipher_list) { + CURLcode result = mbed_set_selected_ciphers(data, backend, + conn_config->cipher_list, + NULL); +#else + if(conn_config->cipher_list || conn_config->cipher_list13) { + CURLcode result = mbed_set_selected_ciphers(data, backend, + conn_config->cipher_list, + conn_config->cipher_list13); +#endif + if(result != CURLE_OK) { + failf(data, "mbedTLS: failed to set cipher suites"); + return result; + } + } + else { + mbedtls_ssl_conf_ciphersuites(&backend->config, + mbedtls_ssl_list_ciphersuites()); + } + #if defined(MBEDTLS_SSL_RENEGOTIATION) mbedtls_ssl_conf_renegotiation(&backend->config, @@ -650,19 +883,29 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) MBEDTLS_SSL_SESSION_TICKETS_DISABLED); #endif - /* Check if there's a cached ID we can/should use here! */ - if(ssl_config->primary.sessionid) { - void *old_session = NULL; + /* Check if there is a cached ID we can/should use here! */ + if(ssl_config->primary.cache_session) { + void *sdata = NULL; + size_t slen = 0; Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, &old_session, NULL)) { - ret = mbedtls_ssl_set_session(&backend->ssl, old_session); + if(!Curl_ssl_getsessionid(cf, data, &connssl->peer, + &sdata, &slen, NULL) && slen) { + mbedtls_ssl_session session; + + mbedtls_ssl_session_init(&session); + ret = mbedtls_ssl_session_load(&session, sdata, slen); if(ret) { - Curl_ssl_sessionid_unlock(data); - failf(data, "mbedtls_ssl_set_session returned -0x%x", -ret); - return CURLE_SSL_CONNECT_ERROR; + failf(data, "error loading cached session: -0x%x", -ret); } - infof(data, "mbedTLS reusing session"); + else { + ret = mbedtls_ssl_set_session(&backend->ssl, &session); + if(ret) + failf(data, "error setting session: -0x%x", -ret); + else + infof(data, "SSL reusing session ID"); + } + mbedtls_ssl_session_free(&session); } Curl_ssl_sessionid_unlock(data); } @@ -680,14 +923,13 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) &backend->clicert, &backend->pk); } - if(connssl->peer.sni) { - if(mbedtls_ssl_set_hostname(&backend->ssl, connssl->peer.sni)) { - /* mbedtls_ssl_set_hostname() sets the name to use in CN/SAN checks and - the name to set in the SNI extension. So even if curl connects to a - host specified as an IP address, this function must be used. */ - failf(data, "Failed to set SNI"); - return CURLE_SSL_CONNECT_ERROR; - } + if(mbedtls_ssl_set_hostname(&backend->ssl, connssl->peer.sni ? + connssl->peer.sni : connssl->peer.hostname)) { + /* mbedtls_ssl_set_hostname() sets the name to use in CN/SAN checks and + the name to set in the SNI extension. So even if curl connects to a + host specified as an IP address, this function must be used. */ + failf(data, "Failed to set SNI"); + return CURLE_SSL_CONNECT_ERROR; } #ifdef HAS_ALPN @@ -698,7 +940,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) for(i = 0; i < connssl->alpn->count; ++i) { backend->protocols[i] = connssl->alpn->entries[i]; } - /* this function doesn't clone the protocols array, which is why we need + /* this function does not clone the protocols array, which is why we need to keep it around */ if(mbedtls_ssl_conf_alpn_protocols(&backend->config, &backend->protocols[0])) { @@ -724,11 +966,11 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* give application a chance to interfere with mbedTLS set up. */ if(data->set.ssl.fsslctx) { - ret = (*data->set.ssl.fsslctx)(data, &backend->config, - data->set.ssl.fsslctxp); - if(ret) { + CURLcode result = (*data->set.ssl.fsslctx)(data, &backend->config, + data->set.ssl.fsslctxp); + if(result != CURLE_OK) { failf(data, "error signaled by ssl ctx callback"); - return ret; + return result; } } @@ -744,87 +986,65 @@ mbed_connect_step2(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_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - const mbedtls_x509_crt *peercert; - const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf)? - data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]: +#ifndef CURL_DISABLE_PROXY + const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf) ? + data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#else + const char * const pinnedpubkey = data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#endif DEBUGASSERT(backend); ret = mbedtls_ssl_handshake(&backend->ssl); if(ret == MBEDTLS_ERR_SSL_WANT_READ) { - connssl->connecting_state = ssl_connect_2_reading; + connssl->io_need = CURL_SSL_IO_NEED_RECV; return CURLE_OK; } else if(ret == MBEDTLS_ERR_SSL_WANT_WRITE) { - connssl->connecting_state = ssl_connect_2_writing; + connssl->io_need = CURL_SSL_IO_NEED_SEND; return CURLE_OK; } + else if(ret == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED) { + failf(data, "peer certificate could not be verified"); + return CURLE_PEER_FAILED_VERIFICATION; + } else if(ret) { char errorbuf[128]; +#if MBEDTLS_VERSION_NUMBER >= 0x03020000 + CURL_TRC_CF(data, cf, "TLS version %04X", + mbedtls_ssl_get_version_number(&backend->ssl)); +#endif mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); - failf(data, "ssl_handshake returned - mbedTLS: (-0x%04X) %s", + failf(data, "ssl_handshake returned: (-0x%04X) %s", -ret, errorbuf); return CURLE_SSL_CONNECT_ERROR; } - infof(data, "mbedTLS: Handshake complete, cipher is %s", - mbedtls_ssl_get_ciphersuite(&backend->ssl)); - - ret = mbedtls_ssl_get_verify_result(&backend->ssl); - - if(!conn_config->verifyhost) - /* Ignore hostname errors if verifyhost is disabled */ - ret &= ~MBEDTLS_X509_BADCERT_CN_MISMATCH; - - if(ret && conn_config->verifypeer) { - if(ret & MBEDTLS_X509_BADCERT_EXPIRED) - failf(data, "Cert verify failed: BADCERT_EXPIRED"); - - else if(ret & MBEDTLS_X509_BADCERT_REVOKED) - failf(data, "Cert verify failed: BADCERT_REVOKED"); - - else if(ret & MBEDTLS_X509_BADCERT_CN_MISMATCH) - failf(data, "Cert verify failed: BADCERT_CN_MISMATCH"); - - else if(ret & MBEDTLS_X509_BADCERT_NOT_TRUSTED) - failf(data, "Cert verify failed: BADCERT_NOT_TRUSTED"); - - else if(ret & MBEDTLS_X509_BADCERT_FUTURE) - failf(data, "Cert verify failed: BADCERT_FUTURE"); - - return CURLE_PEER_FAILED_VERIFICATION; +#if MBEDTLS_VERSION_NUMBER >= 0x03020000 + { + char cipher_str[64]; + uint16_t cipher_id; + 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); } - - peercert = mbedtls_ssl_get_peer_cert(&backend->ssl); - - if(peercert && data->set.verbose) { -#ifndef MBEDTLS_X509_REMOVE_INFO - const size_t bufsize = 16384; - char *buffer = malloc(bufsize); - - if(!buffer) - return CURLE_OUT_OF_MEMORY; - - if(mbedtls_x509_crt_info(buffer, bufsize, "* ", peercert) > 0) - infof(data, "Dumping cert info: %s", buffer); - else - infof(data, "Unable to dump certificate information"); - - free(buffer); #else - infof(data, "Unable to dump certificate information"); + infof(data, "mbedTLS: %s Handshake complete", + mbedtls_ssl_get_version(&backend->ssl)); #endif - } if(pinnedpubkey) { int size; CURLcode result; + const mbedtls_x509_crt *peercert; mbedtls_x509_crt *p = NULL; unsigned char *pubkey = NULL; + peercert = mbedtls_ssl_get_peer_cert(&backend->ssl); #if MBEDTLS_VERSION_NUMBER == 0x03000000 if(!peercert || !peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(p) || !peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(len)) { @@ -851,7 +1071,7 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* Make a copy of our const peercert because mbedtls_pk_write_pubkey_der needs a non-const key, for now. - https://github.com/ARMmbed/mbedtls/issues/396 */ + https://github.com/Mbed-TLS/mbedtls/issues/396 */ #if MBEDTLS_VERSION_NUMBER == 0x03000000 if(mbedtls_x509_crt_parse_der(p, peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(p), @@ -894,8 +1114,8 @@ pinnedpubkey_error: if(connssl->alpn) { const char *proto = mbedtls_ssl_get_alpn_protocol(&backend->ssl); - Curl_alpn_set_negotiated(cf, data, (const unsigned char *)proto, - proto? strlen(proto) : 0); + Curl_alpn_set_negotiated(cf, data, connssl, (const unsigned char *)proto, + proto ? strlen(proto) : 0); } #endif @@ -905,60 +1125,62 @@ pinnedpubkey_error: return CURLE_OK; } -static CURLcode -mbed_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) +static void mbedtls_session_free(void *session, size_t slen) +{ + (void)slen; + free(session); +} + +static CURLcode +mbed_new_session(struct Curl_cfilter *cf, struct Curl_easy *data) { - CURLcode retcode = CURLE_OK; 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); + CURLcode result = CURLE_OK; - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); DEBUGASSERT(backend); - - if(ssl_config->primary.sessionid) { + if(ssl_config->primary.cache_session) { int ret; - mbedtls_ssl_session *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; - bool added = FALSE; + mbedtls_ssl_session session; + unsigned char *sdata = NULL; + size_t slen = 0; - our_ssl_sessionid = malloc(sizeof(mbedtls_ssl_session)); - if(!our_ssl_sessionid) - return CURLE_OUT_OF_MEMORY; - - mbedtls_ssl_session_init(our_ssl_sessionid); - - ret = mbedtls_ssl_get_session(&backend->ssl, our_ssl_sessionid); + mbedtls_ssl_session_init(&session); + ret = mbedtls_ssl_get_session(&backend->ssl, &session); if(ret) { if(ret != MBEDTLS_ERR_SSL_ALLOC_FAILED) - mbedtls_ssl_session_free(our_ssl_sessionid); - free(our_ssl_sessionid); + mbedtls_ssl_session_free(&session); failf(data, "mbedtls_ssl_get_session returned -0x%x", -ret); return CURLE_SSL_CONNECT_ERROR; } - /* If there's already a matching session in the cache, delete it */ - Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, &old_ssl_sessionid, NULL)) - Curl_ssl_delsessionid(data, old_ssl_sessionid); - - retcode = Curl_ssl_addsessionid(cf, data, our_ssl_sessionid, - 0, &added); - Curl_ssl_sessionid_unlock(data); - if(!added) { - mbedtls_ssl_session_free(our_ssl_sessionid); - free(our_ssl_sessionid); + mbedtls_ssl_session_save(&session, NULL, 0, &slen); + if(!slen) { + failf(data, "failed to serialize session: length is 0"); } - if(retcode) { - failf(data, "failed to store ssl session"); - return retcode; + else { + sdata = malloc(slen); + if(sdata) { + ret = mbedtls_ssl_session_save(&session, sdata, slen, &slen); + if(ret) { + failf(data, "failed to serialize session: -0x%x", -ret); + } + else { + Curl_ssl_sessionid_lock(data); + result = Curl_ssl_set_sessionid(cf, data, &connssl->peer, NULL, + sdata, slen, mbedtls_session_free); + Curl_ssl_sessionid_unlock(data); + if(!result) + sdata = NULL; + } + } } + mbedtls_ssl_session_free(&session); + free(sdata); } - - connssl->connecting_state = ssl_connect_done; - - return CURLE_OK; + return result; } static ssize_t mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -975,8 +1197,13 @@ static ssize_t mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data, ret = mbedtls_ssl_write(&backend->ssl, (unsigned char *)mem, len); if(ret < 0) { - *curlcode = (ret == MBEDTLS_ERR_SSL_WANT_WRITE) ? - CURLE_AGAIN : CURLE_SEND_ERROR; + CURL_TRC_CF(data, cf, "mbedtls_ssl_write(len=%zu) -> -0x%04X", + len, -ret); + *curlcode = ((ret == MBEDTLS_ERR_SSL_WANT_WRITE) +#ifdef TLS13_SUPPORT + || (ret == MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET) +#endif + ) ? CURLE_AGAIN : CURLE_SEND_ERROR; ret = -1; } @@ -988,32 +1215,120 @@ static void mbedtls_close_all(struct Curl_easy *data) (void)data; } +static CURLcode mbedtls_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct mbed_ssl_backend_data *backend = + (struct mbed_ssl_backend_data *)connssl->backend; + unsigned char buf[1024]; + CURLcode result = CURLE_OK; + int ret; + size_t i; + + DEBUGASSERT(backend); + + if(!backend->initialized || cf->shutdown) { + *done = TRUE; + return CURLE_OK; + } + + connssl->io_need = CURL_SSL_IO_NEED_NONE; + *done = FALSE; + + if(!backend->sent_shutdown) { + /* do this only once */ + backend->sent_shutdown = TRUE; + if(send_shutdown) { + ret = mbedtls_ssl_close_notify(&backend->ssl); + switch(ret) { + case 0: /* we sent it, receive from the server */ + break; + case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY: /* server also closed */ + *done = TRUE; + goto out; + case MBEDTLS_ERR_SSL_WANT_READ: + connssl->io_need = CURL_SSL_IO_NEED_RECV; + goto out; + case MBEDTLS_ERR_SSL_WANT_WRITE: + connssl->io_need = CURL_SSL_IO_NEED_SEND; + goto out; + default: + CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X", -ret); + result = CURLE_RECV_ERROR; + goto out; + } + } + } + + /* SSL should now have started the shutdown from our side. Since it + * was not complete, we are lacking the close notify from the server. */ + for(i = 0; i < 10; ++i) { + ret = mbedtls_ssl_read(&backend->ssl, buf, sizeof(buf)); + /* This seems to be a bug in mbedTLS TLSv1.3 where it reports + * WANT_READ, but has not encountered an EAGAIN. */ + if(ret == MBEDTLS_ERR_SSL_WANT_READ) + ret = mbedtls_ssl_read(&backend->ssl, buf, sizeof(buf)); +#ifdef TLS13_SUPPORT + if(ret == MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET) + continue; +#endif + if(ret <= 0) + break; + } + + if(ret > 0) { + /* still data coming in? */ + CURL_TRC_CF(data, cf, "mbedtls_shutdown, still getting data"); + } + else if(ret == 0 || (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY)) { + /* We got the close notify alert and are done. */ + CURL_TRC_CF(data, cf, "mbedtls_shutdown done"); + *done = TRUE; + } + else if(ret == MBEDTLS_ERR_SSL_WANT_READ) { + CURL_TRC_CF(data, cf, "mbedtls_shutdown, need RECV"); + connssl->io_need = CURL_SSL_IO_NEED_RECV; + } + else if(ret == MBEDTLS_ERR_SSL_WANT_WRITE) { + CURL_TRC_CF(data, cf, "mbedtls_shutdown, need SEND"); + connssl->io_need = CURL_SSL_IO_NEED_SEND; + } + else { + CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X", -ret); + result = CURLE_RECV_ERROR; + } + +out: + cf->shutdown = (result || *done); + return result; +} + static void mbedtls_close(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; - char buf[32]; (void)data; DEBUGASSERT(backend); - - /* Maybe the server has already sent a close notify alert. - Read it to avoid an RST on the TCP connection. */ - (void)mbedtls_ssl_read(&backend->ssl, (unsigned char *)buf, sizeof(buf)); - - mbedtls_pk_free(&backend->pk); - mbedtls_x509_crt_free(&backend->clicert); - mbedtls_x509_crt_free(&backend->cacert); + if(backend->initialized) { + mbedtls_pk_free(&backend->pk); + mbedtls_x509_crt_free(&backend->clicert); + mbedtls_x509_crt_free(&backend->cacert); #ifdef MBEDTLS_X509_CRL_PARSE_C - mbedtls_x509_crl_free(&backend->crl); + mbedtls_x509_crl_free(&backend->crl); #endif - mbedtls_ssl_config_free(&backend->config); - mbedtls_ssl_free(&backend->ssl); - mbedtls_ctr_drbg_free(&backend->ctr_drbg); + Curl_safefree(backend->ciphersuites); + mbedtls_ssl_config_free(&backend->config); + mbedtls_ssl_free(&backend->ssl); + mbedtls_ctr_drbg_free(&backend->ctr_drbg); #ifndef THREADING_SUPPORT - mbedtls_entropy_free(&backend->entropy); + mbedtls_entropy_free(&backend->entropy); #endif /* THREADING_SUPPORT */ + backend->initialized = FALSE; + } } static ssize_t mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -1024,32 +1339,40 @@ static ssize_t mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data, struct mbed_ssl_backend_data *backend = (struct mbed_ssl_backend_data *)connssl->backend; int ret = -1; - ssize_t len = -1; (void)data; DEBUGASSERT(backend); ret = mbedtls_ssl_read(&backend->ssl, (unsigned char *)buf, buffersize); - if(ret <= 0) { - if(ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) - return 0; - - *curlcode = (ret == MBEDTLS_ERR_SSL_WANT_READ) ? - CURLE_AGAIN : CURLE_RECV_ERROR; - return -1; + CURL_TRC_CF(data, cf, "mbedtls_ssl_read(len=%zu) -> -0x%04X", + buffersize, -ret); + switch(ret) { +#ifdef HAS_SESSION_TICKETS + case MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET: + mbed_new_session(cf, data); + FALLTHROUGH(); +#endif + case MBEDTLS_ERR_SSL_WANT_READ: + *curlcode = CURLE_AGAIN; + ret = -1; + break; + case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY: + *curlcode = CURLE_OK; + ret = 0; + break; + default: { + char errorbuf[128]; + mbedtls_strerror(ret, errorbuf, sizeof(errorbuf)); + failf(data, "ssl_read returned: (-0x%04X) %s", -ret, errorbuf); + *curlcode = CURLE_RECV_ERROR; + ret = -1; + break; + } + } } - - len = ret; - - return len; -} - -static void mbedtls_session_free(void *ptr) -{ - mbedtls_ssl_session_free(ptr); - free(ptr); + return (ssize_t)ret; } static size_t mbedtls_version(char *buffer, size_t size) @@ -1057,8 +1380,8 @@ static size_t mbedtls_version(char *buffer, size_t size) #ifdef MBEDTLS_VERSION_C /* if mbedtls_version_get_number() is available it is better */ unsigned int version = mbedtls_version_get_number(); - return msnprintf(buffer, size, "mbedTLS/%u.%u.%u", version>>24, - (version>>16)&0xff, (version>>8)&0xff); + return msnprintf(buffer, size, "mbedTLS/%u.%u.%u", version >> 24, + (version >> 16) & 0xff, (version >> 8) & 0xff); #else return msnprintf(buffer, size, "mbedTLS/%s", MBEDTLS_VERSION_STRING); #endif @@ -1126,7 +1449,7 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, } if(ssl_connect_1 == connssl->connecting_state) { - /* Find out how much more time we're allowed */ + /* Find out how much more time we are allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { @@ -1139,9 +1462,7 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, return retcode; } - while(ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { + while(ssl_connect_2 == connssl->connecting_state) { /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); @@ -1152,14 +1473,12 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, return CURLE_OPERATION_TIMEDOUT; } - /* if ssl is expecting something, check if it's available. */ - if(connssl->connecting_state == ssl_connect_2_reading - || connssl->connecting_state == ssl_connect_2_writing) { - - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; + /* if ssl is expecting something, check if it is available. */ + if(connssl->io_need) { + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, nonblocking ? 0 : timeout_ms); @@ -1189,19 +1508,31 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, * ensuring that a client using select() or epoll() will always * have a valid fdset to wait on. */ + connssl->io_need = CURL_SSL_IO_NEED_NONE; retcode = mbed_connect_step2(cf, data); - if(retcode || (nonblocking && - (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state))) + if(retcode || + (nonblocking && (ssl_connect_2 == connssl->connecting_state))) return retcode; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3 == connssl->connecting_state) { - retcode = mbed_connect_step3(cf, data); - if(retcode) - return retcode; + /* For tls1.3 we get notified about new sessions */ +#if MBEDTLS_VERSION_NUMBER >= 0x03020000 + struct ssl_connect_data *ctx = cf->ctx; + struct mbed_ssl_backend_data *backend = + (struct mbed_ssl_backend_data *)ctx->backend; + + if(mbedtls_ssl_get_version_number(&backend->ssl) <= + MBEDTLS_SSL_VERSION_TLS1_2) { +#else + { /* no TLSv1.3 supported here */ +#endif + retcode = mbed_new_session(cf, data); + if(retcode) + return retcode; + } + connssl->connecting_state = ssl_connect_done; } if(ssl_connect_done == connssl->connecting_state) { @@ -1246,14 +1577,19 @@ static CURLcode mbedtls_connect(struct Curl_cfilter *cf, */ static int mbedtls_init(void) { - return Curl_mbedtlsthreadlock_thread_setup(); + if(!Curl_mbedtlsthreadlock_thread_setup()) + return 0; +#ifdef THREADING_SUPPORT + entropy_init_mutex(&ts_entropy); +#endif + return 1; } static void mbedtls_cleanup(void) { #ifdef THREADING_SUPPORT - mbedtls_entropy_free(&ts_entropy); -#endif /* THREADING_SUPPORT */ + entropy_cleanup_mutex(&ts_entropy); +#endif (void)Curl_mbedtlsthreadlock_thread_cleanup(); } @@ -1305,9 +1641,14 @@ const struct Curl_ssl Curl_ssl_mbedtls = { SSLSUPP_CA_PATH | SSLSUPP_CAINFO_BLOB | + SSLSUPP_CERTINFO | SSLSUPP_PINNEDPUBKEY | SSLSUPP_SSL_CTX | - SSLSUPP_HTTPS_PROXY, +#ifdef TLS13_SUPPORT + SSLSUPP_TLS13_CIPHERSUITES | +#endif + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CIPHER_LIST, sizeof(struct mbed_ssl_backend_data), @@ -1315,7 +1656,7 @@ const struct Curl_ssl Curl_ssl_mbedtls = { mbedtls_cleanup, /* cleanup */ mbedtls_version, /* version */ Curl_none_check_cxn, /* check_cxn */ - Curl_none_shutdown, /* shutdown */ + mbedtls_shutdown, /* shutdown */ mbedtls_data_pending, /* data_pending */ mbedtls_random, /* random */ Curl_none_cert_status_request, /* cert_status_request */ @@ -1325,7 +1666,6 @@ const struct Curl_ssl Curl_ssl_mbedtls = { mbedtls_get_internals, /* get_internals */ mbedtls_close, /* close_one */ mbedtls_close_all, /* close_all */ - mbedtls_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -1333,9 +1673,9 @@ const struct Curl_ssl Curl_ssl_mbedtls = { mbedtls_sha256sum, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ mbed_recv, /* recv decrypted data */ mbed_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #endif /* USE_MBEDTLS */ diff --git a/deps/curl/lib/vtls/mbedtls_threadlock.c b/deps/curl/lib/vtls/mbedtls_threadlock.c index 22b1b221..b96a904f 100644 --- a/deps/curl/lib/vtls/mbedtls_threadlock.c +++ b/deps/curl/lib/vtls/mbedtls_threadlock.c @@ -26,12 +26,12 @@ #if defined(USE_MBEDTLS) && \ ((defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || \ - defined(USE_THREADS_WIN32)) + defined(_WIN32)) #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) # include # define MBEDTLS_MUTEX_T pthread_mutex_t -#elif defined(USE_THREADS_WIN32) +#elif defined(_WIN32) # define MBEDTLS_MUTEX_T HANDLE #endif @@ -59,7 +59,7 @@ int Curl_mbedtlsthreadlock_thread_setup(void) #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_init(&mutex_buf[i], NULL)) return 0; /* pthread_mutex_init failed */ -#elif defined(USE_THREADS_WIN32) +#elif defined(_WIN32) mutex_buf[i] = CreateMutex(0, FALSE, 0); if(mutex_buf[i] == 0) return 0; /* CreateMutex failed */ @@ -80,7 +80,7 @@ int Curl_mbedtlsthreadlock_thread_cleanup(void) #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) if(pthread_mutex_destroy(&mutex_buf[i])) return 0; /* pthread_mutex_destroy failed */ -#elif defined(USE_THREADS_WIN32) +#elif defined(_WIN32) if(!CloseHandle(mutex_buf[i])) return 0; /* CloseHandle failed */ #endif /* USE_THREADS_POSIX && HAVE_PTHREAD_H */ @@ -100,7 +100,7 @@ int Curl_mbedtlsthreadlock_lock_function(int n) "Error: mbedtlsthreadlock_lock_function failed\n")); return 0; /* pthread_mutex_lock failed */ } -#elif defined(USE_THREADS_WIN32) +#elif defined(_WIN32) if(WaitForSingleObject(mutex_buf[n], INFINITE) == WAIT_FAILED) { DEBUGF(fprintf(stderr, "Error: mbedtlsthreadlock_lock_function failed\n")); @@ -120,7 +120,7 @@ int Curl_mbedtlsthreadlock_unlock_function(int n) "Error: mbedtlsthreadlock_unlock_function failed\n")); return 0; /* pthread_mutex_unlock failed */ } -#elif defined(USE_THREADS_WIN32) +#elif defined(_WIN32) if(!ReleaseMutex(mutex_buf[n])) { DEBUGF(fprintf(stderr, "Error: mbedtlsthreadlock_unlock_function failed\n")); diff --git a/deps/curl/lib/vtls/mbedtls_threadlock.h b/deps/curl/lib/vtls/mbedtls_threadlock.h index 2b0bd41c..48462685 100644 --- a/deps/curl/lib/vtls/mbedtls_threadlock.h +++ b/deps/curl/lib/vtls/mbedtls_threadlock.h @@ -29,7 +29,7 @@ #ifdef USE_MBEDTLS #if (defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || \ - defined(USE_THREADS_WIN32) + defined(_WIN32) int Curl_mbedtlsthreadlock_thread_setup(void); int Curl_mbedtlsthreadlock_thread_cleanup(void); @@ -43,7 +43,7 @@ int Curl_mbedtlsthreadlock_unlock_function(int n); #define Curl_mbedtlsthreadlock_lock_function(x) 1 #define Curl_mbedtlsthreadlock_unlock_function(x) 1 -#endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */ +#endif /* (USE_THREADS_POSIX && HAVE_PTHREAD_H) || _WIN32 */ #endif /* USE_MBEDTLS */ diff --git a/deps/curl/lib/vtls/openssl.c b/deps/curl/lib/vtls/openssl.c index eda36606..b60869dd 100644 --- a/deps/curl/lib/vtls/openssl.c +++ b/deps/curl/lib/vtls/openssl.c @@ -82,6 +82,17 @@ #include #include +#ifdef USE_ECH +# ifndef OPENSSL_IS_BORINGSSL +# include +# endif +# include "curl_base64.h" +# define ECH_ENABLED(__data__) \ + (__data__->set.tls_ech && \ + !(__data__->set.tls_ech & CURLECH_DISABLE)\ + ) +#endif /* USE_ECH */ + #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_OCSP) #include #endif @@ -193,12 +204,10 @@ * Whether SSL_CTX_set_keylog_callback is available. * OpenSSL: supported since 1.1.1 https://github.com/openssl/openssl/pull/2287 * BoringSSL: supported since d28f59c27bac (committed 2015-11-19) - * LibreSSL: supported since 3.5.0 (released 2022-02-24) + * LibreSSL: not supported. 3.5.0+ has a stub function that does nothing. */ #if (OPENSSL_VERSION_NUMBER >= 0x10101000L && \ !defined(LIBRESSL_VERSION_NUMBER)) || \ - (defined(LIBRESSL_VERSION_NUMBER) && \ - LIBRESSL_VERSION_NUMBER >= 0x3050000fL) || \ defined(OPENSSL_IS_BORINGSSL) #define HAVE_KEYLOG_CALLBACK #endif @@ -222,7 +231,7 @@ /* * Whether SSL_CTX_set1_curves_list is available. * OpenSSL: supported since 1.0.2, see - * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html + * https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/ * BoringSSL: supported since 5fd1807d95f7 (committed 2016-09-30) * LibreSSL: since 2.5.3 (April 12, 2017) */ @@ -238,20 +247,27 @@ #elif defined(OPENSSL_IS_AWSLC) #define OSSL_PACKAGE "AWS-LC" #else -# if defined(USE_NGTCP2) && defined(USE_NGHTTP3) +# if (defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || defined(USE_MSH3) # define OSSL_PACKAGE "quictls" # else # define OSSL_PACKAGE "OpenSSL" #endif #endif +#if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC) +typedef size_t numcert_t; +#else +typedef int numcert_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 -/* ... but it is not the case with old versions of OpenSSL */ +/* not the case with old versions of OpenSSL */ #define DEFAULT_CIPHER_SELECTION \ "ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH" #endif @@ -298,51 +314,36 @@ typedef unsigned long sslerr_t; #define USE_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L) #endif /* !LIBRESSL_VERSION_NUMBER */ -struct ossl_ssl_backend_data { - /* these ones requires specific SSL-types */ - SSL_CTX* ctx; - SSL* handle; - X509* server_cert; - BIO_METHOD *bio_method; - CURLcode io_result; /* result of last BIO cfilter operation */ -#ifndef HAVE_KEYLOG_CALLBACK - /* Set to true once a valid keylog entry has been created to avoid dupes. */ - bool keylog_done; -#endif - bool x509_store_setup; /* x509 store has been set up */ -}; +static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl); -#if defined(HAVE_SSL_X509_STORE_SHARE) -struct multi_ssl_backend_data { - char *CAfile; /* CAfile path used to generate X509 store */ - X509_STORE *store; /* cached X509 store or NULL if none */ - struct curltime time; /* when the cached store was created */ -}; -#endif /* HAVE_SSL_X509_STORE_SHARE */ +static CURLcode push_certinfo(struct Curl_easy *data, + BIO *mem, const char *label, int num) + WARN_UNUSED_RESULT; -#define push_certinfo(_label, _num) \ -do { \ - long info_len = BIO_get_mem_data(mem, &ptr); \ - Curl_ssl_push_certinfo_len(data, _num, _label, ptr, info_len); \ - if(1 != BIO_reset(mem)) \ - break; \ -} while(0) - -static void pubkey_show(struct Curl_easy *data, - BIO *mem, - int num, - const char *type, - const char *name, - const BIGNUM *bn) +static CURLcode push_certinfo(struct Curl_easy *data, + BIO *mem, const char *label, int num) { char *ptr; + long len = BIO_get_mem_data(mem, &ptr); + CURLcode result = Curl_ssl_push_certinfo_len(data, num, label, ptr, len); + (void)BIO_reset(mem); + return result; +} + +static CURLcode pubkey_show(struct Curl_easy *data, + BIO *mem, + int num, + const char *type, + const char *name, + const BIGNUM *bn) +{ char namebuf[32]; msnprintf(namebuf, sizeof(namebuf), "%s(%s)", type, name); if(bn) BN_print(mem, bn); - push_certinfo(namebuf, num); + return push_certinfo(data, mem, namebuf, num); } #ifdef HAVE_OPAQUE_RSA_DSA_DH @@ -374,25 +375,26 @@ static int asn1_object_dump(ASN1_OBJECT *a, char *buf, size_t len) return 0; } -static void X509V3_ext(struct Curl_easy *data, - int certnum, - CONST_EXTS STACK_OF(X509_EXTENSION) *exts) +static CURLcode X509V3_ext(struct Curl_easy *data, + int certnum, + CONST_EXTS STACK_OF(X509_EXTENSION) *exts) { int i; + CURLcode result = CURLE_OK; if((int)sk_X509_EXTENSION_num(exts) <= 0) /* no extensions, bail out */ - return; + return result; for(i = 0; i < (int)sk_X509_EXTENSION_num(exts); i++) { ASN1_OBJECT *obj; - X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i); + X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, (ossl_valsize_t)i); BUF_MEM *biomem; char namebuf[128]; BIO *bio_out = BIO_new(BIO_s_mem()); if(!bio_out) - return; + return result; obj = X509_EXTENSION_get_object(ext); @@ -402,19 +404,16 @@ static void X509V3_ext(struct Curl_easy *data, ASN1_STRING_print(bio_out, (ASN1_STRING *)X509_EXTENSION_get_data(ext)); BIO_get_mem_ptr(bio_out, &biomem); - Curl_ssl_push_certinfo_len(data, certnum, namebuf, biomem->data, - biomem->length); + result = Curl_ssl_push_certinfo_len(data, certnum, namebuf, biomem->data, + biomem->length); BIO_free(bio_out); + if(result) + break; } + return result; } -#if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC) -typedef size_t numcert_t; -#else -typedef int numcert_t; -#endif - -CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) +static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) { CURLcode result; STACK_OF(X509) *sk; @@ -432,38 +431,43 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) numcerts = sk_X509_num(sk); result = Curl_ssl_init_certinfo(data, (int)numcerts); - if(result) { + if(result) return result; - } mem = BIO_new(BIO_s_mem()); - if(!mem) { - return CURLE_OUT_OF_MEMORY; - } + if(!mem) + result = CURLE_OUT_OF_MEMORY; - for(i = 0; i < (int)numcerts; i++) { + for(i = 0; !result && (i < (int)numcerts); i++) { ASN1_INTEGER *num; - X509 *x = sk_X509_value(sk, i); + X509 *x = sk_X509_value(sk, (ossl_valsize_t)i); EVP_PKEY *pubkey = NULL; int j; - char *ptr; const ASN1_BIT_STRING *psig = NULL; X509_NAME_print_ex(mem, X509_get_subject_name(x), 0, XN_FLAG_ONELINE); - push_certinfo("Subject", i); + result = push_certinfo(data, mem, "Subject", i); + if(result) + break; X509_NAME_print_ex(mem, X509_get_issuer_name(x), 0, XN_FLAG_ONELINE); - push_certinfo("Issuer", i); + result = push_certinfo(data, mem, "Issuer", i); + if(result) + break; BIO_printf(mem, "%lx", X509_get_version(x)); - push_certinfo("Version", i); + result = push_certinfo(data, mem, "Version", i); + if(result) + break; num = X509_get_serialNumber(x); if(num->type == V_ASN1_NEG_INTEGER) BIO_puts(mem, "-"); for(j = 0; j < num->length; j++) BIO_printf(mem, "%02x", num->data[j]); - push_certinfo("Serial Number", i); + result = push_certinfo(data, mem, "Serial Number", i); + if(result) + break; #if defined(HAVE_X509_GET0_SIGNATURE) && defined(HAVE_X509_GET0_EXTENSIONS) { @@ -476,7 +480,9 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) const ASN1_OBJECT *sigalgoid = NULL; X509_ALGOR_get0(&sigalgoid, NULL, NULL, sigalg); i2a_ASN1_OBJECT(mem, sigalgoid); - push_certinfo("Signature Algorithm", i); + result = push_certinfo(data, mem, "Signature Algorithm", i); + if(result) + break; } xpubkey = X509_get_X509_PUBKEY(x); @@ -484,11 +490,15 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) X509_PUBKEY_get0_param(&pubkeyoid, NULL, NULL, NULL, xpubkey); if(pubkeyoid) { i2a_ASN1_OBJECT(mem, pubkeyoid); - push_certinfo("Public Key Algorithm", i); + result = push_certinfo(data, mem, "Public Key Algorithm", i); + if(result) + break; } } - X509V3_ext(data, i, X509_get0_extensions(x)); + result = X509V3_ext(data, i, X509_get0_extensions(x)); + if(result) + break; } #else { @@ -496,22 +506,32 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) X509_CINF *cinf = x->cert_info; i2a_ASN1_OBJECT(mem, cinf->signature->algorithm); - push_certinfo("Signature Algorithm", i); + result = push_certinfo(data, mem, "Signature Algorithm", i); - i2a_ASN1_OBJECT(mem, cinf->key->algor->algorithm); - push_certinfo("Public Key Algorithm", i); + if(!result) { + i2a_ASN1_OBJECT(mem, cinf->key->algor->algorithm); + result = push_certinfo(data, mem, "Public Key Algorithm", i); + } - X509V3_ext(data, i, cinf->extensions); + if(!result) + result = X509V3_ext(data, i, cinf->extensions); + + if(result) + break; psig = x->signature; } #endif ASN1_TIME_print(mem, X509_get0_notBefore(x)); - push_certinfo("Start date", i); + result = push_certinfo(data, mem, "Start date", i); + if(result) + break; ASN1_TIME_print(mem, X509_get0_notAfter(x)); - push_certinfo("Expire date", i); + result = push_certinfo(data, mem, "Expire date", i); + if(result) + break; pubkey = X509_get_pubkey(x); if(!pubkey) @@ -524,8 +544,7 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) pktype = pubkey->type; #endif switch(pktype) { - case EVP_PKEY_RSA: - { + case EVP_PKEY_RSA: { #ifndef HAVE_EVP_PKEY_GET_PARAMS RSA *rsa; #ifdef HAVE_OPAQUE_EVP_PKEY @@ -549,7 +568,9 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) #else BIO_printf(mem, "%d", rsa->n ? BN_num_bits(rsa->n) : 0); #endif /* HAVE_OPAQUE_RSA_DSA_DH */ - push_certinfo("RSA Public Key", i); + 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); @@ -597,8 +618,7 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) #endif /* !OPENSSL_NO_DSA */ break; } - case EVP_PKEY_DH: - { + case EVP_PKEY_DH: { #ifndef HAVE_EVP_PKEY_GET_PARAMS DH *dh; #ifdef HAVE_OPAQUE_EVP_PKEY @@ -641,19 +661,25 @@ CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl) EVP_PKEY_free(pubkey); } - if(psig) { + if(!result && psig) { for(j = 0; j < psig->length; j++) BIO_printf(mem, "%02x:", psig->data[j]); - push_certinfo("Signature", i); + result = push_certinfo(data, mem, "Signature", i); } - PEM_write_bio_X509(mem, x); - push_certinfo("Cert", i); + if(!result) { + PEM_write_bio_X509(mem, x); + result = push_certinfo(data, mem, "Cert", i); + } } BIO_free(mem); - return CURLE_OK; + if(result) + /* cleanup all leftovers */ + Curl_ssl_free_certinfo(data); + + return result; } #endif /* quiche or OpenSSL */ @@ -726,18 +752,21 @@ static int ossl_bio_cf_out_write(BIO *bio, const char *buf, int blen) { struct Curl_cfilter *cf = BIO_get_data(bio); struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); ssize_t nwritten; CURLcode result = CURLE_SEND_ERROR; DEBUGASSERT(data); - nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, &result); + if(blen < 0) + return 0; + + nwritten = Curl_conn_cf_send(cf->next, data, buf, (size_t)blen, FALSE, + &result); CURL_TRC_CF(data, cf, "ossl_bio_cf_out_write(len=%d) -> %d, err=%d", blen, (int)nwritten, result); BIO_clear_retry_flags(bio); - backend->io_result = result; + octx->io_result = result; if(nwritten < 0) { if(CURLE_AGAIN == result) BIO_set_retry_write(bio); @@ -749,8 +778,7 @@ static int ossl_bio_cf_in_read(BIO *bio, char *buf, int blen) { struct Curl_cfilter *cf = BIO_get_data(bio); struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); ssize_t nread; CURLcode result = CURLE_RECV_ERROR; @@ -759,26 +787,31 @@ static int ossl_bio_cf_in_read(BIO *bio, char *buf, int blen) /* OpenSSL catches this case, so should we. */ if(!buf) return 0; + if(blen < 0) + return 0; - nread = Curl_conn_cf_recv(cf->next, data, buf, blen, &result); + nread = Curl_conn_cf_recv(cf->next, data, buf, (size_t)blen, &result); CURL_TRC_CF(data, cf, "ossl_bio_cf_in_read(len=%d) -> %d, err=%d", blen, (int)nread, result); BIO_clear_retry_flags(bio); - backend->io_result = result; + octx->io_result = result; if(nread < 0) { if(CURLE_AGAIN == result) BIO_set_retry_read(bio); } + else if(nread == 0) { + connssl->peer_closed = TRUE; + } /* Before returning server replies to the SSL instance, we need * to have setup the x509 store or verification will fail. */ - if(!backend->x509_store_setup) { - result = Curl_ssl_setup_x509_store(cf, data, backend->ctx); + if(!octx->x509_store_setup) { + result = Curl_ssl_setup_x509_store(cf, data, octx->ssl_ctx); if(result) { - backend->io_result = result; + octx->io_result = result; return -1; } - backend->x509_store_setup = TRUE; + octx->x509_store_setup = TRUE; } return (int)nread; @@ -848,7 +881,7 @@ static void ossl_keylog_callback(const SSL *ssl, const char *line) #else /* * ossl_log_tls12_secret is called by libcurl to make the CLIENT_RANDOMs if the - * OpenSSL being used doesn't have native support for doing that. + * OpenSSL being used does not have native support for doing that. */ static void ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done) @@ -864,7 +897,7 @@ ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done) #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ !(defined(LIBRESSL_VERSION_NUMBER) && \ LIBRESSL_VERSION_NUMBER < 0x20700000L) - /* ssl->s3 is not checked in openssl 1.1.0-pre6, but let's assume that + /* 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) @@ -883,7 +916,7 @@ ossl_log_tls12_secret(const SSL *ssl, bool *keylog_done) if(master_key_length <= 0) return; - *keylog_done = true; + *keylog_done = TRUE; Curl_tls_keylog_write("CLIENT_RANDOM", client_random, master_key, master_key_length); } @@ -967,7 +1000,7 @@ static int passwd_callback(char *buf, int num, int encrypting, { DEBUGASSERT(0 == encrypting); - if(!encrypting) { + if(!encrypting && num >= 0) { int klen = curlx_uztosi(strlen((char *)global_passwd)); if(num > klen) { memcpy(buf, global_passwd, klen + 1); @@ -982,7 +1015,7 @@ static int passwd_callback(char *buf, int num, int encrypting, */ static bool rand_enough(void) { - return (0 != RAND_status()) ? TRUE : FALSE; + return (0 != RAND_status()); } static CURLcode ossl_seed(struct Curl_easy *data) @@ -1003,12 +1036,6 @@ static CURLcode ossl_seed(struct Curl_easy *data) return CURLE_SSL_CONNECT_ERROR; #else -#ifdef RANDOM_FILE - RAND_load_file(RANDOM_FILE, RAND_LOAD_LENGTH); - if(rand_enough()) - return CURLE_OK; -#endif - /* fallback to a custom seeding of the PRNG using a hash based on a current time */ do { @@ -1018,13 +1045,12 @@ static CURLcode ossl_seed(struct Curl_easy *data) for(i = 0, i_max = len / sizeof(struct curltime); i < i_max; ++i) { struct curltime tv = Curl_now(); Curl_wait_ms(1); - tv.tv_sec *= i + 1; - tv.tv_usec *= (unsigned int)i + 2; - tv.tv_sec ^= ((Curl_now().tv_sec + Curl_now().tv_usec) * - (i + 3)) << 8; - tv.tv_usec ^= (unsigned int) ((Curl_now().tv_sec + - Curl_now().tv_usec) * - (i + 4)) << 16; + tv.tv_sec *= (time_t)i + 1; + tv.tv_usec *= (int)i + 2; + tv.tv_sec ^= ((Curl_now().tv_sec + (time_t)Curl_now().tv_usec) * + (time_t)(i + 3)) << 8; + tv.tv_usec ^= (int) ((Curl_now().tv_sec + (time_t)Curl_now().tv_usec) * + (time_t)(i + 4)) << 16; memcpy(&randb[i * sizeof(struct curltime)], &tv, sizeof(struct curltime)); } @@ -1037,7 +1063,7 @@ static CURLcode ossl_seed(struct Curl_easy *data) fname[0] = 0; /* blank it first */ RAND_file_name(fname, sizeof(fname)); if(fname[0]) { - /* we got a file name to try */ + /* we got a filename to try */ RAND_load_file(fname, RAND_LOAD_LENGTH); if(rand_enough()) return CURLE_OK; @@ -1056,7 +1082,7 @@ static CURLcode ossl_seed(struct Curl_easy *data) #ifndef SSL_FILETYPE_PKCS12 #define SSL_FILETYPE_PKCS12 43 #endif -static int do_file_type(const char *type) +static int ossl_do_file_type(const char *type) { if(!type || !type[0]) return SSL_FILETYPE_PEM; @@ -1278,7 +1304,7 @@ int cert_stuff(struct Curl_easy *data, char error_buffer[256]; bool check_privkey = TRUE; - int file_type = do_file_type(cert_type); + int file_type = ossl_do_file_type(cert_type); if(cert_file || cert_blob || (file_type == SSL_FILETYPE_ENGINE)) { SSL *ssl; @@ -1373,7 +1399,7 @@ int cert_stuff(struct Curl_easy *data, } if(!params.cert) { - failf(data, "ssl engine didn't initialized the certificate " + failf(data, "ssl engine did not initialized the certificate " "properly."); return 0; } @@ -1384,10 +1410,10 @@ int cert_stuff(struct Curl_easy *data, sizeof(error_buffer))); return 0; } - X509_free(params.cert); /* we don't need the handle any more... */ + X509_free(params.cert); /* we do not need the handle any more... */ } else { - failf(data, "crypto engine not set, can't load certificate"); + failf(data, "crypto engine not set, cannot load certificate"); return 0; } } @@ -1483,7 +1509,7 @@ int cert_stuff(struct Curl_easy *data, * Note that sk_X509_pop() is used below to make sure the cert is * removed from the stack properly before getting passed to * SSL_CTX_add_extra_chain_cert(), which takes ownership. Previously - * we used sk_X509_value() instead, but then we'd clean it in the + * we used sk_X509_value() instead, but then we would clean it in the * subsequent sk_X509_pop_free() call. */ X509 *x = sk_X509_pop(ca); @@ -1519,7 +1545,7 @@ fail: key_blob = cert_blob; } else - file_type = do_file_type(key_type); + file_type = ossl_do_file_type(key_type); switch(file_type) { case SSL_FILETYPE_PEM: @@ -1532,7 +1558,8 @@ fail: SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type); if(cert_use_result != 1) { failf(data, "unable to set private key file: '%s' type %s", - key_file?key_file:"(memory blob)", key_type?key_type:"PEM"); + key_file ? key_file : "(memory blob)", + key_type ? key_type : "PEM"); return 0; } break; @@ -1576,10 +1603,10 @@ fail: EVP_PKEY_free(priv_key); return 0; } - EVP_PKEY_free(priv_key); /* we don't need the handle any more... */ + EVP_PKEY_free(priv_key); /* we do not need the handle any more... */ } else { - failf(data, "crypto engine not set, can't load private key"); + failf(data, "crypto engine not set, cannot load private key"); return 0; } } @@ -1618,8 +1645,8 @@ fail: #if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_IS_BORINGSSL) && \ !defined(OPENSSL_NO_DEPRECATED_3_0) { - /* If RSA is used, don't check the private key if its flags indicate - * it doesn't support it. */ + /* 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 @@ -1653,46 +1680,24 @@ fail: return 1; } -CURLcode Curl_ossl_set_client_cert(struct Curl_easy *data, SSL_CTX *ctx, - char *cert_file, - const struct curl_blob *cert_blob, - const char *cert_type, char *key_file, - const struct curl_blob *key_blob, - const char *key_type, char *key_passwd) -{ - int rv = cert_stuff(data, ctx, cert_file, cert_blob, cert_type, key_file, - key_blob, key_type, key_passwd); - if(rv != 1) { - return CURLE_SSL_CERTPROBLEM; - } - - return CURLE_OK; -} - /* returns non-zero on failure */ -static int x509_name_oneline(X509_NAME *a, char *buf, size_t size) +static CURLcode x509_name_oneline(X509_NAME *a, struct dynbuf *d) { BIO *bio_out = BIO_new(BIO_s_mem()); BUF_MEM *biomem; int rc; + CURLcode result = CURLE_OUT_OF_MEMORY; - if(!bio_out) - return 1; /* alloc failed! */ - - rc = X509_NAME_print_ex(bio_out, a, 0, XN_FLAG_SEP_SPLUS_SPC); - BIO_get_mem_ptr(bio_out, &biomem); - - if((size_t)biomem->length < size) - size = biomem->length; - else - size--; /* don't overwrite the buffer end */ - - memcpy(buf, biomem->data, size); - buf[size] = 0; - - BIO_free(bio_out); - - return !rc; + if(bio_out) { + Curl_dyn_reset(d); + rc = X509_NAME_print_ex(bio_out, a, 0, XN_FLAG_SEP_SPLUS_SPC); + if(rc != -1) { + BIO_get_mem_ptr(bio_out, &biomem); + result = Curl_dyn_addn(d, biomem->data, biomem->length); + BIO_free(bio_out); + } + } + return result; } /** @@ -1877,186 +1882,150 @@ static struct curl_slist *ossl_engines_list(struct Curl_easy *data) return list; } +static CURLcode ossl_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; + CURLcode result = CURLE_OK; + char buf[1024]; + int nread = -1, err; + unsigned long sslerr; + size_t i; + + DEBUGASSERT(octx); + if(!octx->ssl || cf->shutdown) { + *done = TRUE; + goto out; + } + + connssl->io_need = CURL_SSL_IO_NEED_NONE; + *done = FALSE; + if(!(SSL_get_shutdown(octx->ssl) & SSL_SENT_SHUTDOWN)) { + /* We have not started the shutdown from our side yet. Check + * if the server already sent us one. */ + ERR_clear_error(); + for(i = 0; i < 10; ++i) { + nread = SSL_read(octx->ssl, buf, (int)sizeof(buf)); + CURL_TRC_CF(data, cf, "SSL shutdown not sent, read -> %d", nread); + if(nread <= 0) + break; + } + err = SSL_get_error(octx->ssl, nread); + if(!nread && err == SSL_ERROR_ZERO_RETURN) { + bool input_pending; + /* Yes, it did. */ + if(!send_shutdown) { + CURL_TRC_CF(data, cf, "SSL shutdown received, not sending"); + *done = TRUE; + goto out; + } + else if(!cf->next->cft->is_alive(cf->next, data, &input_pending)) { + /* Server closed the connection after its closy notify. It + * seems not interested to see our close notify, so do not + * send it. We are done. */ + connssl->peer_closed = TRUE; + CURL_TRC_CF(data, cf, "peer closed connection"); + *done = TRUE; + goto out; + } + } + } + + /* SSL should now have started the shutdown from our side. Since it + * was not complete, we are lacking the close notify from the server. */ + if(send_shutdown && !(SSL_get_shutdown(octx->ssl) & SSL_SENT_SHUTDOWN)) { + ERR_clear_error(); + CURL_TRC_CF(data, cf, "send SSL close notify"); + if(SSL_shutdown(octx->ssl) == 1) { + CURL_TRC_CF(data, cf, "SSL shutdown finished"); + *done = TRUE; + goto out; + } + if(SSL_ERROR_WANT_WRITE == SSL_get_error(octx->ssl, nread)) { + CURL_TRC_CF(data, cf, "SSL shutdown still wants to send"); + connssl->io_need = CURL_SSL_IO_NEED_SEND; + goto out; + } + /* Having sent the close notify, we use SSL_read() to get the + * missing close notify from the server. */ + } + + for(i = 0; i < 10; ++i) { + ERR_clear_error(); + nread = SSL_read(octx->ssl, buf, (int)sizeof(buf)); + CURL_TRC_CF(data, cf, "SSL shutdown read -> %d", nread); + if(nread <= 0) + break; + } + err = SSL_get_error(octx->ssl, nread); + switch(err) { + case SSL_ERROR_ZERO_RETURN: /* no more data */ + if(SSL_shutdown(octx->ssl) == 1) + CURL_TRC_CF(data, cf, "SSL shutdown finished"); + else + CURL_TRC_CF(data, cf, "SSL shutdown not received, but closed"); + *done = TRUE; + break; + case SSL_ERROR_NONE: /* just did not get anything */ + case SSL_ERROR_WANT_READ: + /* SSL has send its notify and now wants to read the reply + * from the server. We are not really interested in that. */ + CURL_TRC_CF(data, cf, "SSL shutdown sent, want receive"); + connssl->io_need = CURL_SSL_IO_NEED_RECV; + break; + case SSL_ERROR_WANT_WRITE: + CURL_TRC_CF(data, cf, "SSL shutdown send blocked"); + connssl->io_need = CURL_SSL_IO_NEED_SEND; + break; + default: + /* Server seems to have closed the connection without sending us + * a close notify. */ + sslerr = ERR_get_error(); + CURL_TRC_CF(data, cf, "SSL shutdown, ignore recv error: '%s', errno %d", + (sslerr ? + ossl_strerror(sslerr, buf, sizeof(buf)) : + SSL_ERROR_to_str(err)), + SOCKERRNO); + *done = TRUE; + result = CURLE_OK; + break; + } + +out: + cf->shutdown = (result || *done); + return result; +} + static void ossl_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; (void)data; - DEBUGASSERT(backend); + DEBUGASSERT(octx); - if(backend->handle) { - if(cf->next && cf->next->connected) { - char buf[1024]; - int nread, err; - long sslerr; - - /* Maybe the server has already sent a close notify alert. - Read it to avoid an RST on the TCP connection. */ - (void)SSL_read(backend->handle, buf, (int)sizeof(buf)); - ERR_clear_error(); - if(SSL_shutdown(backend->handle) == 1) { - CURL_TRC_CF(data, cf, "SSL shutdown finished"); - } - else { - nread = SSL_read(backend->handle, buf, (int)sizeof(buf)); - err = SSL_get_error(backend->handle, nread); - switch(err) { - case SSL_ERROR_NONE: /* this is not an error */ - case SSL_ERROR_ZERO_RETURN: /* no more data */ - CURL_TRC_CF(data, cf, "SSL shutdown, EOF from server"); - break; - case SSL_ERROR_WANT_READ: - /* SSL has send its notify and now wants to read the reply - * from the server. We are not really interested in that. */ - CURL_TRC_CF(data, cf, "SSL shutdown sent"); - break; - case SSL_ERROR_WANT_WRITE: - CURL_TRC_CF(data, cf, "SSL shutdown send blocked"); - break; - default: - sslerr = ERR_get_error(); - CURL_TRC_CF(data, cf, "SSL shutdown, error: '%s', errno %d", - (sslerr ? - ossl_strerror(sslerr, buf, sizeof(buf)) : - SSL_ERROR_to_str(err)), - SOCKERRNO); - break; - } - } - - ERR_clear_error(); - SSL_set_connect_state(backend->handle); - } - - SSL_free(backend->handle); - backend->handle = NULL; + if(octx->ssl) { + SSL_free(octx->ssl); + octx->ssl = NULL; } - if(backend->ctx) { - SSL_CTX_free(backend->ctx); - backend->ctx = NULL; - backend->x509_store_setup = FALSE; + if(octx->ssl_ctx) { + SSL_CTX_free(octx->ssl_ctx); + octx->ssl_ctx = NULL; + octx->x509_store_setup = FALSE; } - if(backend->bio_method) { - ossl_bio_cf_method_free(backend->bio_method); - backend->bio_method = NULL; + if(octx->bio_method) { + ossl_bio_cf_method_free(octx->bio_method); + octx->bio_method = NULL; } } -/* - * This function is called to shut down the SSL layer but keep the - * socket open (CCC - Clear Command Channel) - */ -static int ossl_shutdown(struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - int retval = 0; - struct ssl_connect_data *connssl = cf->ctx; - char buf[256]; /* We will use this for the OpenSSL error buffer, so it has - to be at least 256 bytes long. */ - unsigned long sslerror; - int nread; - int buffsize; - int err; - bool done = FALSE; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; - int loop = 10; - - DEBUGASSERT(backend); - -#ifndef CURL_DISABLE_FTP - /* This has only been tested on the proftpd server, and the mod_tls code - sends a close notify alert without waiting for a close notify alert in - response. Thus we wait for a close notify alert from the server, but - we do not send one. Let's hope other servers do the same... */ - - if(data->set.ftp_ccc == CURLFTPSSL_CCC_ACTIVE) - (void)SSL_shutdown(backend->handle); -#endif - - if(backend->handle) { - buffsize = (int)sizeof(buf); - while(!done && loop--) { - int what = SOCKET_READABLE(Curl_conn_cf_get_socket(cf, data), - SSL_SHUTDOWN_TIMEOUT); - if(what > 0) { - ERR_clear_error(); - - /* Something to read, let's do it and hope that it is the close - notify alert from the server */ - nread = SSL_read(backend->handle, buf, buffsize); - err = SSL_get_error(backend->handle, nread); - - switch(err) { - case SSL_ERROR_NONE: /* this is not an error */ - case SSL_ERROR_ZERO_RETURN: /* no more data */ - /* This is the expected response. There was no data but only - the close notify alert */ - done = TRUE; - break; - case SSL_ERROR_WANT_READ: - /* there's data pending, re-invoke SSL_read() */ - infof(data, "SSL_ERROR_WANT_READ"); - break; - case SSL_ERROR_WANT_WRITE: - /* SSL wants a write. Really odd. Let's bail out. */ - infof(data, "SSL_ERROR_WANT_WRITE"); - done = TRUE; - break; - default: - /* openssl/ssl.h says "look at error stack/return value/errno" */ - sslerror = ERR_get_error(); - failf(data, OSSL_PACKAGE " SSL_read on shutdown: %s, errno %d", - (sslerror ? - ossl_strerror(sslerror, buf, sizeof(buf)) : - SSL_ERROR_to_str(err)), - SOCKERRNO); - done = TRUE; - break; - } - } - else if(0 == what) { - /* timeout */ - failf(data, "SSL shutdown timeout"); - done = TRUE; - } - else { - /* anything that gets here is fatally bad */ - failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); - retval = -1; - done = TRUE; - } - } /* while()-loop for the select() */ - - if(data->set.verbose) { -#ifdef HAVE_SSL_GET_SHUTDOWN - switch(SSL_get_shutdown(backend->handle)) { - case SSL_SENT_SHUTDOWN: - infof(data, "SSL_get_shutdown() returned SSL_SENT_SHUTDOWN"); - break; - case SSL_RECEIVED_SHUTDOWN: - infof(data, "SSL_get_shutdown() returned SSL_RECEIVED_SHUTDOWN"); - break; - case SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN: - infof(data, "SSL_get_shutdown() returned SSL_SENT_SHUTDOWN|" - "SSL_RECEIVED__SHUTDOWN"); - break; - } -#endif - } - - SSL_free(backend->handle); - backend->handle = NULL; - } - return retval; -} - -static void ossl_session_free(void *ptr) +static void ossl_session_free(void *sessionid, size_t idsize) { /* free the ID */ - SSL_SESSION_free(ptr); + (void)idsize; + free(sessionid); } /* @@ -2087,7 +2056,7 @@ static void ossl_close_all(struct Curl_easy *data) /* ====================================================== */ /* - * Match subjectAltName against the host name. + * Match subjectAltName against the hostname. */ static bool subj_alt_hostcheck(struct Curl_easy *data, const char *match_pattern, @@ -2117,7 +2086,7 @@ static bool subj_alt_hostcheck(struct Curl_easy *data, Certification Authorities are encouraged to use the dNSName instead. Matching is performed using the matching rules specified by - [RFC2459]. If more than one identity of a given type is present in + [RFC2459]. If more than one identity of a given type is present in the certificate (e.g., more than one dNSName name, a match in any one of the set is considered acceptable.) Names may contain the wildcard character * which is considered to match any single domain name @@ -2130,21 +2099,22 @@ static bool subj_alt_hostcheck(struct Curl_easy *data, This function is now used from ngtcp2 (QUIC) as well. */ -CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, - struct ssl_peer *peer, X509 *server_cert) +static CURLcode ossl_verifyhost(struct Curl_easy *data, + struct connectdata *conn, + struct ssl_peer *peer, X509 *server_cert) { bool matched = FALSE; int target; /* target type, GEN_DNS or GEN_IPADD */ size_t addrlen = 0; STACK_OF(GENERAL_NAME) *altnames; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif CURLcode result = CURLE_OK; bool dNSName = FALSE; /* if a dNSName field exists in the cert */ - bool iPAddress = FALSE; /* if a iPAddress field exists in the cert */ + bool iPAddress = FALSE; /* if an iPAddress field exists in the cert */ size_t hostlen; (void)conn; @@ -2156,7 +2126,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, target = GEN_IPADD; addrlen = sizeof(struct in_addr); break; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 case CURL_SSL_PEER_IPV6: if(!Curl_inet_pton(AF_INET6, peer->hostname, &addr)) return CURLE_PEER_FAILED_VERIFICATION; @@ -2188,7 +2158,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, bool ipmatched = FALSE; /* get amount of alternatives, RFC2459 claims there MUST be at least - one, but we don't depend on it... */ + one, but we do not depend on it... */ numalts = sk_GENERAL_NAME_num(altnames); /* loop through all alternatives - until a dnsmatch */ @@ -2209,7 +2179,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, switch(target) { case GEN_DNS: /* name/pattern comparison */ - /* The OpenSSL man page explicitly says: "In general it cannot be + /* The OpenSSL manpage 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 @@ -2219,7 +2189,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, is always null-terminated. */ if((altlen == strlen(altptr)) && - /* if this isn't true, there was an embedded zero in the name + /* if this is not true, there was an embedded zero in the name string and we cannot match it. */ subj_alt_hostcheck(data, altptr, altlen, peer->hostname, hostlen, @@ -2251,7 +2221,7 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, /* an alternative name matched */ ; else if(dNSName || iPAddress) { - const char *tname = (peer->type == CURL_SSL_PEER_DNS) ? "host name" : + const char *tname = (peer->type == CURL_SSL_PEER_DNS) ? "hostname" : (peer->type == CURL_SSL_PEER_IPV4) ? "ipv4 address" : "ipv6 address"; infof(data, " subjectAltName does not match %s %s", tname, peer->dispname); @@ -2263,8 +2233,9 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, /* we have to look to the last occurrence of a commonName in the distinguished one to get the most significant one. */ int i = -1; - unsigned char *peer_CN = NULL; - int peerlen = 0; + unsigned char *cn = NULL; + int cnlen = 0; + bool free_cn = FALSE; /* The following is done because of a bug in 0.9.6b */ X509_NAME *name = X509_get_subject_name(server_cert); @@ -2288,21 +2259,17 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, conditional in the future when OpenSSL has been fixed. */ if(tmp) { if(ASN1_STRING_type(tmp) == V_ASN1_UTF8STRING) { - peerlen = ASN1_STRING_length(tmp); - if(peerlen >= 0) { - peer_CN = OPENSSL_malloc(peerlen + 1); - if(peer_CN) { - memcpy(peer_CN, ASN1_STRING_get0_data(tmp), peerlen); - peer_CN[peerlen] = '\0'; - } - else - result = CURLE_OUT_OF_MEMORY; - } + cnlen = ASN1_STRING_length(tmp); + cn = (unsigned char *) ASN1_STRING_get0_data(tmp); + } + else { /* not a UTF8 name */ + cnlen = ASN1_STRING_to_UTF8(&cn, tmp); + free_cn = TRUE; } - else /* not a UTF8 name */ - peerlen = ASN1_STRING_to_UTF8(&peer_CN, tmp); - if(peer_CN && (curlx_uztosi(strlen((char *)peer_CN)) != peerlen)) { + if((cnlen <= 0) || !cn) + result = CURLE_OUT_OF_MEMORY; + else if((size_t)cnlen != strlen((char *)cn)) { /* there was a terminating zero before the end of string, this cannot match and we return failure! */ failf(data, "SSL: illegal cert name field"); @@ -2314,22 +2281,22 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, if(result) /* error already detected, pass through */ ; - else if(!peer_CN) { + else if(!cn) { failf(data, "SSL: unable to obtain common name from peer certificate"); result = CURLE_PEER_FAILED_VERIFICATION; } - else if(!Curl_cert_hostcheck((const char *)peer_CN, - peerlen, peer->hostname, hostlen)) { + else if(!Curl_cert_hostcheck((const char *)cn, cnlen, + peer->hostname, hostlen)) { failf(data, "SSL: certificate subject name '%s' does not match " - "target host name '%s'", peer_CN, peer->dispname); + "target hostname '%s'", cn, peer->dispname); result = CURLE_PEER_FAILED_VERIFICATION; } else { - infof(data, " common name: %s (matched)", peer_CN); + infof(data, " common name: %s (matched)", cn); } - if(peer_CN) - OPENSSL_free(peer_CN); + if(free_cn) + OPENSSL_free(cn); } return result; @@ -2338,9 +2305,9 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_TLSEXT) && \ !defined(OPENSSL_NO_OCSP) static CURLcode verifystatus(struct Curl_cfilter *cf, - struct Curl_easy *data) + struct Curl_easy *data, + struct ossl_ctx *octx) { - struct ssl_connect_data *connssl = cf->ctx; int i, ocsp_status; #if defined(OPENSSL_IS_AWSLC) const uint8_t *status; @@ -2353,8 +2320,6 @@ static CURLcode verifystatus(struct Curl_cfilter *cf, OCSP_BASICRESP *br = NULL; X509_STORE *st = NULL; STACK_OF(X509) *ch = NULL; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; X509 *cert; OCSP_CERTID *id = NULL; int cert_status, crl_reason; @@ -2362,9 +2327,10 @@ static CURLcode verifystatus(struct Curl_cfilter *cf, int ret; long len; - DEBUGASSERT(backend); + (void)cf; + DEBUGASSERT(octx); - len = SSL_get_tlsext_status_ocsp_resp(backend->handle, &status); + len = (long)SSL_get_tlsext_status_ocsp_resp(octx->ssl, &status); if(!status) { failf(data, "No OCSP response received"); @@ -2394,20 +2360,20 @@ static CURLcode verifystatus(struct Curl_cfilter *cf, goto end; } - ch = SSL_get_peer_cert_chain(backend->handle); + ch = SSL_get_peer_cert_chain(octx->ssl); if(!ch) { failf(data, "Could not get peer certificate chain"); result = CURLE_SSL_INVALIDCERTSTATUS; goto end; } - st = SSL_CTX_get_cert_store(backend->ctx); + st = SSL_CTX_get_cert_store(octx->ssl_ctx); #if ((OPENSSL_VERSION_NUMBER <= 0x1000201fL) /* Fixed after 1.0.2a */ || \ (defined(LIBRESSL_VERSION_NUMBER) && \ LIBRESSL_VERSION_NUMBER <= 0x2040200fL)) /* The authorized responder cert in the OCSP response MUST be signed by the - peer cert's issuer (see RFC6960 section 4.2.2.2). If that's a root cert, - no problem, but if it's an intermediate cert OpenSSL has a bug where it + peer cert's issuer (see RFC6960 section 4.2.2.2). If that is a root cert, + no problem, but if it is an intermediate cert OpenSSL has a bug where it expects this issuer to be present in the chain embedded in the OCSP response. So we add it if necessary. */ @@ -2437,7 +2403,7 @@ static CURLcode verifystatus(struct Curl_cfilter *cf, } /* Compute the certificate's ID */ - cert = SSL_get1_peer_certificate(backend->handle); + cert = SSL_get1_peer_certificate(octx->ssl); if(!cert) { failf(data, "Error getting peer certificate"); result = CURLE_SSL_INVALIDCERTSTATUS; @@ -2445,7 +2411,7 @@ static CURLcode verifystatus(struct Curl_cfilter *cf, } for(i = 0; i < (int)sk_X509_num(ch); i++) { - X509 *issuer = sk_X509_value(ch, i); + X509 *issuer = sk_X509_value(ch, (ossl_valsize_t)i); if(X509_check_issued(issuer, cert) == X509_V_OK) { id = OCSP_cert_to_id(EVP_sha1(), cert, issuer); break; @@ -2506,7 +2472,7 @@ end: #endif /* USE_OPENSSL */ -/* The SSL_CTRL_SET_MSG_CALLBACK doesn't exist in ancient OpenSSL versions +/* The SSL_CTRL_SET_MSG_CALLBACK does not exist in ancient OpenSSL versions and thus this cannot be done there. */ #ifdef SSL_CTRL_SET_MSG_CALLBACK @@ -2691,7 +2657,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, ssl_ver >>= 8; /* check the upper 8 bits only below */ - /* SSLv2 doesn't seem to have TLS record-type headers, so OpenSSL + /* SSLv2 does not seem to have TLS record-type headers, so OpenSSL * always pass-up content-type as 0. But the interesting message-type * is at 'buf[0]'. */ @@ -2715,11 +2681,9 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, txt_len = msnprintf(ssl_buf, sizeof(ssl_buf), "%s (%s), %s, %s (%d):\n", - verstr, direction?"OUT":"IN", + verstr, direction ? "OUT" : "IN", tls_rt_name, msg_name, msg_type); - if(0 <= txt_len && (unsigned)txt_len < sizeof(ssl_buf)) { - Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len); - } + Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len); } Curl_debug(data, (direction == 1) ? CURLINFO_SSL_DATA_OUT : @@ -2778,7 +2742,7 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx) } /* CURL_SSLVERSION_DEFAULT means that no option was selected. - We don't want to pass 0 to SSL_CTX_set_min_proto_version as + 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 @@ -2790,7 +2754,7 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx) } /* ... then, TLS max version */ - curl_ssl_version_max = conn_config->version_max; + curl_ssl_version_max = (long)conn_config->version_max; /* convert curl max SSL version option to OpenSSL constant */ switch(curl_ssl_version_max) { @@ -2831,6 +2795,9 @@ ossl_set_ssl_version_min_max(struct Curl_cfilter *cf, SSL_CTX *ctx) typedef uint32_t ctx_option_t; #elif OPENSSL_VERSION_NUMBER >= 0x30000000L typedef uint64_t ctx_option_t; +#elif OPENSSL_VERSION_NUMBER >= 0x10100000L && \ + !defined(LIBRESSL_VERSION_NUMBER) +typedef unsigned long ctx_option_t; #else typedef long ctx_option_t; #endif @@ -2838,24 +2805,23 @@ typedef long ctx_option_t; #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 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's unused. */ + (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_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; - DEBUGASSERT(backend); - SSL_CTX_set_max_proto_version(backend->ctx, TLS1_3_VERSION); + 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 @@ -2913,61 +2879,66 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, } #endif +CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, + struct Curl_easy *data, + const struct ssl_peer *peer, + SSL_SESSION *session) +{ + const struct ssl_config_data *config; + CURLcode result = CURLE_OK; + size_t der_session_size; + unsigned char *der_session_buf; + unsigned char *der_session_ptr; + + if(!cf || !data) + goto out; + + config = Curl_ssl_cf_get_config(cf, data); + if(config->primary.cache_session) { + + der_session_size = i2d_SSL_SESSION(session, NULL); + if(der_session_size == 0) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } + + der_session_buf = der_session_ptr = malloc(der_session_size); + if(!der_session_buf) { + result = CURLE_OUT_OF_MEMORY; + goto out; + } + + der_session_size = i2d_SSL_SESSION(session, &der_session_ptr); + if(der_session_size == 0) { + result = CURLE_OUT_OF_MEMORY; + free(der_session_buf); + goto out; + } + + Curl_ssl_sessionid_lock(data); + result = Curl_ssl_set_sessionid(cf, data, peer, NULL, der_session_buf, + der_session_size, ossl_session_free); + Curl_ssl_sessionid_unlock(data); + } + +out: + return result; +} + /* The "new session" callback must return zero if the session can be removed * or non-zero if the session has been put into the session cache. */ static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) { - int res = 0; - struct Curl_easy *data; struct Curl_cfilter *cf; - const struct ssl_config_data *config; + struct Curl_easy *data; struct ssl_connect_data *connssl; - bool isproxy; cf = (struct Curl_cfilter*) SSL_get_app_data(ssl); - connssl = cf? cf->ctx : NULL; - data = connssl? CF_DATA_CURRENT(cf) : NULL; - /* The sockindex has been stored as a pointer to an array element */ - if(!cf || !data) - return 0; - - isproxy = Curl_ssl_cf_is_proxy(cf); - - config = Curl_ssl_cf_get_config(cf, data); - if(config->primary.sessionid) { - bool incache; - bool added = FALSE; - void *old_ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(data); - if(isproxy) - incache = FALSE; - else - incache = !(Curl_ssl_getsessionid(cf, data, &old_ssl_sessionid, NULL)); - if(incache) { - if(old_ssl_sessionid != ssl_sessionid) { - infof(data, "old SSL session ID is stale, removing"); - Curl_ssl_delsessionid(data, old_ssl_sessionid); - incache = FALSE; - } - } - - if(!incache) { - if(!Curl_ssl_addsessionid(cf, data, ssl_sessionid, - 0 /* unknown size */, &added)) { - if(added) { - /* the session has been put into the session cache */ - res = 1; - } - } - else - failf(data, "failed to store ssl session"); - } - Curl_ssl_sessionid_unlock(data); - } - - return res; + connssl = cf ? cf->ctx : NULL; + data = connssl ? CF_DATA_CURRENT(cf) : NULL; + Curl_ossl_add_session(cf, data, &connssl->peer, ssl_sessionid); + return 0; } static CURLcode load_cacert_from_memory(X509_STORE *store, @@ -2996,7 +2967,7 @@ static CURLcode load_cacert_from_memory(X509_STORE *store, /* add each entry from PEM file to x509_store */ for(i = 0; i < (int)sk_X509_INFO_num(inf); ++i) { - itmp = sk_X509_INFO_value(inf, i); + itmp = sk_X509_INFO_value(inf, (ossl_valsize_t)i); if(itmp->x509) { if(X509_STORE_add_cert(store, itmp->x509)) { ++count; @@ -3022,7 +2993,7 @@ static CURLcode load_cacert_from_memory(X509_STORE *store, sk_X509_INFO_pop_free(inf, X509_INFO_free); BIO_free(cbio); - /* if we didn't end up importing anything, treat that as an error */ + /* if we did not end up importing anything, treat that as an error */ return (count > 0) ? CURLE_OK : CURLE_SSL_CACERT_BADFILE; } @@ -3035,7 +3006,7 @@ static CURLcode import_windows_cert_store(struct Curl_easy *data, CURLcode result = CURLE_OK; HCERTSTORE hStore; - *imported = false; + *imported = FALSE; hStore = CertOpenSystemStoreA(0, name); if(hStore) { @@ -3057,20 +3028,19 @@ static CURLcode import_windows_cert_store(struct Curl_easy *data, BYTE key_usage[2]; DWORD req_size; const unsigned char *encoded_cert; -#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - char cert_name[256]; -#endif - pContext = CertEnumCertificatesInStore(hStore, pContext); if(!pContext) break; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - if(!CertGetNameStringA(pContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, - NULL, cert_name, sizeof(cert_name))) { - strcpy(cert_name, "Unknown"); + else { + char cert_name[256]; + if(!CertGetNameStringA(pContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, + NULL, cert_name, sizeof(cert_name))) + infof(data, "SSL: unknown cert name"); + else + infof(data, "SSL: Checking cert \"%s\"", cert_name); } - infof(data, "SSL: Checking cert \"%s\"", cert_name); #endif encoded_cert = (const unsigned char *)pContext->pbCertEncoded; if(!encoded_cert) @@ -3123,12 +3093,12 @@ static CURLcode import_windows_cert_store(struct Curl_easy *data, } else { DWORD i; - bool found = false; + bool found = FALSE; for(i = 0; i < enhkey_usage->cUsageIdentifier; ++i) { if(!strcmp("1.3.6.1.5.5.7.3.1" /* OID server auth */, enhkey_usage->rgpszUsageIdentifier[i])) { - found = true; + found = TRUE; break; } } @@ -3143,7 +3113,7 @@ static CURLcode import_windows_cert_store(struct Curl_easy *data, else continue; - x509 = d2i_X509(NULL, &encoded_cert, pContext->cbCertEncoded); + x509 = d2i_X509(NULL, &encoded_cert, (long)pContext->cbCertEncoded); if(!x509) continue; @@ -3152,9 +3122,9 @@ static CURLcode import_windows_cert_store(struct Curl_easy *data, not OpenSSL. */ if(X509_STORE_add_cert(store, x509) == 1) { #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) - infof(data, "SSL: Imported cert \"%s\"", cert_name); + infof(data, "SSL: Imported cert"); #endif - *imported = true; + *imported = TRUE; } X509_free(x509); } @@ -3186,11 +3156,11 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf, const char * const ssl_capath = conn_config->CApath; const char * const ssl_crlfile = ssl_config->primary.CRLfile; const bool verifypeer = conn_config->verifypeer; - bool imported_native_ca = false; - bool imported_ca_info_blob = false; + bool imported_native_ca = FALSE; + bool imported_ca_info_blob = FALSE; CURL_TRC_CF(data, cf, "populate_x509_store, path=%s, blob=%d", - ssl_cafile? ssl_cafile : "none", !!ca_info_blob); + ssl_cafile ? ssl_cafile : "none", !!ca_info_blob); if(!store) return CURLE_OUT_OF_MEMORY; @@ -3208,14 +3178,14 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf, }; size_t i; for(i = 0; i < ARRAYSIZE(storeNames); ++i) { - bool imported = false; + bool imported = FALSE; result = import_windows_cert_store(data, storeNames[i], store, &imported); if(result) return result; if(imported) { infof(data, "successfully imported Windows %s store", storeNames[i]); - imported_native_ca = true; + imported_native_ca = TRUE; } else infof(data, "error importing Windows %s store, continuing anyway", @@ -3230,7 +3200,7 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf, return result; } else { - imported_ca_info_blob = true; + imported_ca_info_blob = TRUE; infof(data, "successfully imported CA certificate blob"); } } @@ -3281,8 +3251,8 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf, #ifdef CURL_CA_FALLBACK if(!ssl_cafile && !ssl_capath && !imported_native_ca && !imported_ca_info_blob) { - /* verifying the peer without any CA certificates won't - work so use openssl's built-in default as fallback */ + /* verifying the peer without any CA certificates will not + work so use OpenSSL's built-in default as fallback */ X509_STORE_set_default_paths(store); } #endif @@ -3307,10 +3277,11 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf, if(verifypeer) { /* Try building a chain using issuers in the trusted store first to avoid - problems with server-sent legacy intermediates. Newer versions of + problems with server-sent legacy intermediates. Newer versions of OpenSSL do alternate chain checking by default but we do not know how to determine that in a reliable manner. - https://rt.openssl.org/Ticket/Display.html?id=3621&user=guest&pass=guest + https://web.archive.org/web/20190422050538/ + rt.openssl.org/Ticket/Display.html?id=3621 */ #if defined(X509_V_FLAG_TRUSTED_FIRST) X509_STORE_set_flags(store, X509_V_FLAG_TRUSTED_FIRST); @@ -3334,23 +3305,49 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf, } #if defined(HAVE_SSL_X509_STORE_SHARE) -static bool cached_x509_store_expired(const struct Curl_easy *data, - const struct multi_ssl_backend_data *mb) + +/* key to use at `multi->proto_hash` */ +#define MPROTO_OSSL_X509_KEY "tls:ossl:x509:share" + +struct ossl_x509_share { + char *CAfile; /* CAfile path used to generate X509 store */ + X509_STORE *store; /* cached X509 store or NULL if none */ + struct curltime time; /* when the cached store was created */ +}; + +static void oss_x509_share_free(void *key, size_t key_len, void *p) { - const struct ssl_general_config *cfg = &data->set.general_ssl; - struct curltime now = Curl_now(); - timediff_t elapsed_ms = Curl_timediff(now, mb->time); - timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; - - if(timeout_ms < 0) - return false; - - return elapsed_ms >= timeout_ms; + struct ossl_x509_share *share = p; + DEBUGASSERT(key_len == (sizeof(MPROTO_OSSL_X509_KEY)-1)); + DEBUGASSERT(!memcmp(MPROTO_OSSL_X509_KEY, key, key_len)); + (void)key; + (void)key_len; + if(share->store) { + X509_STORE_free(share->store); + } + free(share->CAfile); + free(share); } -static bool cached_x509_store_different( - struct Curl_cfilter *cf, - const struct multi_ssl_backend_data *mb) +static bool +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) + return FALSE; + else { + struct curltime now = Curl_now(); + timediff_t elapsed_ms = Curl_timediff(now, mb->time); + timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; + + return elapsed_ms >= timeout_ms; + } +} + +static bool +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) @@ -3362,16 +3359,18 @@ static bool cached_x509_store_different( static X509_STORE *get_cached_x509_store(struct Curl_cfilter *cf, const struct Curl_easy *data) { - struct Curl_multi *multi = data->multi_easy ? data->multi_easy : data->multi; + struct Curl_multi *multi = data->multi; + struct ossl_x509_share *share; X509_STORE *store = NULL; DEBUGASSERT(multi); - if(multi && - multi->ssl_backend_data && - multi->ssl_backend_data->store && - !cached_x509_store_expired(data, multi->ssl_backend_data) && - !cached_x509_store_different(cf, multi->ssl_backend_data)) { - store = multi->ssl_backend_data->store; + share = multi ? Curl_hash_pick(&multi->proto_hash, + (void *)MPROTO_OSSL_X509_KEY, + sizeof(MPROTO_OSSL_X509_KEY)-1) : NULL; + if(share && share->store && + !cached_x509_store_expired(data, share) && + !cached_x509_store_different(cf, share)) { + store = share->store; } return store; @@ -3382,21 +3381,29 @@ static void set_cached_x509_store(struct Curl_cfilter *cf, X509_STORE *store) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - struct Curl_multi *multi = data->multi_easy ? data->multi_easy : data->multi; - struct multi_ssl_backend_data *mbackend; + struct Curl_multi *multi = data->multi; + struct ossl_x509_share *share; DEBUGASSERT(multi); if(!multi) return; + share = Curl_hash_pick(&multi->proto_hash, + (void *)MPROTO_OSSL_X509_KEY, + sizeof(MPROTO_OSSL_X509_KEY)-1); - if(!multi->ssl_backend_data) { - multi->ssl_backend_data = calloc(1, sizeof(struct multi_ssl_backend_data)); - if(!multi->ssl_backend_data) + if(!share) { + share = calloc(1, sizeof(*share)); + if(!share) return; + if(!Curl_hash_add2(&multi->proto_hash, + (void *)MPROTO_OSSL_X509_KEY, + sizeof(MPROTO_OSSL_X509_KEY)-1, + share, oss_x509_share_free)) { + free(share); + return; + } } - mbackend = multi->ssl_backend_data; - if(X509_STORE_up_ref(store)) { char *CAfile = NULL; @@ -3408,14 +3415,14 @@ static void set_cached_x509_store(struct Curl_cfilter *cf, } } - if(mbackend->store) { - X509_STORE_free(mbackend->store); - free(mbackend->CAfile); + if(share->store) { + X509_STORE_free(share->store); + free(share->CAfile); } - mbackend->time = Curl_now(); - mbackend->store = store; - mbackend->CAfile = CAfile; + share->time = Curl_now(); + share->store = store; + share->CAfile = CAfile; } } @@ -3430,7 +3437,7 @@ CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf, bool cache_criteria_met; /* 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 + or no source is provided and we are falling back to OpenSSL's built-in default. */ cache_criteria_met = (data->set.general_ssl.ca_cache_timeout != 0) && conn_config->verifypeer && @@ -3465,29 +3472,32 @@ CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf, } #endif /* HAVE_SSL_X509_STORE_SHARE */ -static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, - struct Curl_easy *data) +CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + int transport, /* TCP or QUIC */ + const unsigned char *alpn, size_t alpn_len, + Curl_ossl_ctx_setup_cb *cb_setup, + void *cb_user_data, + Curl_ossl_new_session_cb *cb_new_session, + void *ssl_user_data) { CURLcode result = CURLE_OK; - char *ciphers; + const char *ciphers; SSL_METHOD_QUAL SSL_METHOD *req_method = NULL; - struct ssl_connect_data *connssl = cf->ctx; ctx_option_t ctx_options = 0; - void *ssl_sessionid = NULL; + SSL_SESSION *ssl_session = NULL; + const unsigned char *der_sessionid = NULL; + size_t der_sessionid_size = 0; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - BIO *bio; - const long int ssl_version = conn_config->version; + const long int ssl_version_min = conn_config->version; char * const ssl_cert = ssl_config->primary.clientcert; const struct curl_blob *ssl_cert_blob = ssl_config->primary.cert_blob; const char * const ssl_cert_type = ssl_config->cert_type; const bool verifypeer = conn_config->verifypeer; char error_buffer[256]; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; - - DEBUGASSERT(ssl_connect_1 == connssl->connecting_state); - DEBUGASSERT(backend); /* Make funny stuff to get random input */ result = ossl_seed(data); @@ -3496,67 +3506,86 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, ssl_config->certverifyresult = !X509_V_OK; - /* check to see if we've been told to use an explicit SSL/TLS version */ + switch(transport) { + case TRNSPRT_TCP: + /* check to see if we have been told to use an explicit SSL/TLS version */ + switch(ssl_version_min) { + case CURL_SSLVERSION_DEFAULT: + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + case CURL_SSLVERSION_TLSv1_1: + case CURL_SSLVERSION_TLSv1_2: + case CURL_SSLVERSION_TLSv1_3: + /* it will be handled later with the context options */ + #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + req_method = TLS_client_method(); + #else + req_method = SSLv23_client_method(); + #endif + break; + case CURL_SSLVERSION_SSLv2: + failf(data, "No SSLv2 support"); + return CURLE_NOT_BUILT_IN; + case CURL_SSLVERSION_SSLv3: + failf(data, "No SSLv3 support"); + return CURLE_NOT_BUILT_IN; + default: + failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); + return CURLE_SSL_CONNECT_ERROR; + } + break; + case TRNSPRT_QUIC: + if(conn_config->version_max && + (conn_config->version_max != CURL_SSLVERSION_MAX_TLSv1_3)) { + failf(data, "QUIC needs at least TLS version 1.3"); + return CURLE_SSL_CONNECT_ERROR; + } - switch(ssl_version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1_1: - case CURL_SSLVERSION_TLSv1_2: - case CURL_SSLVERSION_TLSv1_3: - /* it will be handled later with the context options */ -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) - req_method = TLS_client_method(); +#ifdef USE_OPENSSL_QUIC + req_method = OSSL_QUIC_client_method(); +#elif (OPENSSL_VERSION_NUMBER >= 0x10100000L) + req_method = TLS_method(); #else req_method = SSLv23_client_method(); #endif break; - case CURL_SSLVERSION_SSLv2: - failf(data, "No SSLv2 support"); - return CURLE_NOT_BUILT_IN; - case CURL_SSLVERSION_SSLv3: - failf(data, "No SSLv3 support"); - return CURLE_NOT_BUILT_IN; default: - failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); + failf(data, "unsupported transport %d in SSL init", transport); return CURLE_SSL_CONNECT_ERROR; } - if(backend->ctx) { - /* This happens when an error was encountered before in this - * step and we are called to do it again. Get rid of any leftover - * from the previous call. */ - ossl_close(cf, data); - } - backend->ctx = SSL_CTX_new(req_method); - if(!backend->ctx) { - failf(data, "SSL: couldn't create a context: %s", + DEBUGASSERT(!octx->ssl_ctx); + octx->ssl_ctx = SSL_CTX_new(req_method); + + if(!octx->ssl_ctx) { + failf(data, "SSL: could not create a context: %s", ossl_strerror(ERR_peek_error(), error_buffer, sizeof(error_buffer))); return CURLE_OUT_OF_MEMORY; } -#ifdef SSL_MODE_RELEASE_BUFFERS - SSL_CTX_set_mode(backend->ctx, SSL_MODE_RELEASE_BUFFERS); -#endif + if(cb_setup) { + result = cb_setup(cf, data, cb_user_data); + if(result) + return result; + } #ifdef SSL_CTRL_SET_MSG_CALLBACK if(data->set.fdebug && data->set.verbose) { /* the SSL trace callback is only used for verbose logging */ - SSL_CTX_set_msg_callback(backend->ctx, ossl_trace); - SSL_CTX_set_msg_callback_arg(backend->ctx, cf); + SSL_CTX_set_msg_callback(octx->ssl_ctx, ossl_trace); + SSL_CTX_set_msg_callback_arg(octx->ssl_ctx, cf); } #endif /* 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 man page for this option states that SSL_OP_ALL enables + work-arounds. The manpage 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." - The "-no_ticket" option was introduced in OpenSSL 0.9.8j. It's a flag to + The "-no_ticket" option was introduced in OpenSSL 0.9.8j. it is a flag to disable "rfc4507bis session ticket support". rfc4507bis was later turned into the proper RFC5077: https://datatracker.ietf.org/doc/html/rfc5077 @@ -3577,12 +3606,12 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, CVE-2010-4180 when using previous OpenSSL versions we no longer enable this option regardless of OpenSSL version and SSL_OP_ALL definition. - OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability - (https://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit to - SSL_OP_ALL that _disables_ that work-around despite the fact that - SSL_OP_ALL is documented to do "rather harmless" workarounds. In order to - keep the secure work-around, the SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit - must not be set. + OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability: + https://web.archive.org/web/20240114184648/openssl.org/~bodo/tls-cbc.txt. + In 0.9.6e they added a bit to SSL_OP_ALL that _disables_ that work-around + despite the fact that SSL_OP_ALL is documented to do "rather harmless" + workarounds. In order to keep the secure work-around, the + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set. */ ctx_options = SSL_OP_ALL; @@ -3597,17 +3626,17 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, #ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG /* mitigate CVE-2010-4180 */ - ctx_options &= ~SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG; + ctx_options &= ~(ctx_option_t)SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG; #endif #ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS /* unless the user explicitly asks to allow the protocol vulnerability we use the work-around */ if(!ssl_config->enable_beast) - ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; + ctx_options &= ~(ctx_option_t)SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; #endif - switch(ssl_version) { + switch(ssl_version_min) { case CURL_SSLVERSION_SSLv2: case CURL_SSLVERSION_SSLv3: return CURLE_NOT_BUILT_IN; @@ -3625,7 +3654,7 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, ctx_options |= SSL_OP_NO_SSLv3; #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) /* 1.1.0 */ - result = ossl_set_ssl_version_min_max(cf, backend->ctx); + result = ossl_set_ssl_version_min_max(cf, octx->ssl_ctx); #else result = ossl_set_ssl_version_min_max_legacy(&ctx_options, cf, data); #endif @@ -3638,26 +3667,25 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, return CURLE_SSL_CONNECT_ERROR; } - SSL_CTX_set_options(backend->ctx, ctx_options); + SSL_CTX_set_options(octx->ssl_ctx, ctx_options); + +#ifdef SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER + /* We do retry writes sometimes from another buffer address */ + SSL_CTX_set_mode(octx->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); +#endif #ifdef HAS_ALPN - if(connssl->alpn) { - struct alpn_proto_buf proto; - - result = Curl_alpn_to_proto_buf(&proto, connssl->alpn); - if(result || - SSL_CTX_set_alpn_protos(backend->ctx, proto.data, proto.len)) { + if(alpn && alpn_len) { + if(SSL_CTX_set_alpn_protos(octx->ssl_ctx, alpn, (int)alpn_len)) { failf(data, "Error setting ALPN"); return CURLE_SSL_CONNECT_ERROR; } - Curl_alpn_to_proto_str(&proto, connssl->alpn); - infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data); } #endif if(ssl_cert || ssl_cert_blob || ssl_cert_type) { if(!result && - !cert_stuff(data, backend->ctx, + !cert_stuff(data, octx->ssl_ctx, ssl_cert, ssl_cert_blob, ssl_cert_type, ssl_config->key, ssl_config->key_blob, ssl_config->key_type, ssl_config->key_passwd)) @@ -3668,10 +3696,10 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, } ciphers = conn_config->cipher_list; - if(!ciphers) - ciphers = (char *)DEFAULT_CIPHER_SELECTION; + if(!ciphers && (peer->transport != TRNSPRT_QUIC)) + ciphers = DEFAULT_CIPHER_SELECTION; if(ciphers) { - if(!SSL_CTX_set_cipher_list(backend->ctx, ciphers)) { + if(!SSL_CTX_set_cipher_list(octx->ssl_ctx, ciphers)) { failf(data, "failed setting cipher list: %s", ciphers); return CURLE_SSL_CIPHER; } @@ -3680,9 +3708,9 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, #ifdef HAVE_SSL_CTX_SET_CIPHERSUITES { - char *ciphers13 = conn_config->cipher_list13; + const char *ciphers13 = conn_config->cipher_list13; if(ciphers13) { - if(!SSL_CTX_set_ciphersuites(backend->ctx, ciphers13)) { + if(!SSL_CTX_set_ciphersuites(octx->ssl_ctx, ciphers13)) { failf(data, "failed setting TLS 1.3 cipher suite: %s", ciphers13); return CURLE_SSL_CIPHER; } @@ -3693,14 +3721,14 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, #ifdef HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH /* OpenSSL 1.1.1 requires clients to opt-in for PHA */ - SSL_CTX_set_post_handshake_auth(backend->ctx, 1); + SSL_CTX_set_post_handshake_auth(octx->ssl_ctx, 1); #endif #ifdef HAVE_SSL_CTX_SET_EC_CURVES { - char *curves = conn_config->curves; + const char *curves = conn_config->curves; if(curves) { - if(!SSL_CTX_set1_curves_list(backend->ctx, curves)) { + if(!SSL_CTX_set1_curves_list(octx->ssl_ctx, curves)) { failf(data, "failed setting curves list: '%s'", curves); return CURLE_SSL_CIPHER; } @@ -3714,18 +3742,18 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, char * const ssl_password = ssl_config->primary.password; infof(data, "Using TLS-SRP username: %s", ssl_username); - if(!SSL_CTX_set_srp_username(backend->ctx, ssl_username)) { - failf(data, "Unable to set SRP user name"); + if(!SSL_CTX_set_srp_username(octx->ssl_ctx, ssl_username)) { + failf(data, "Unable to set SRP username"); return CURLE_BAD_FUNCTION_ARGUMENT; } - if(!SSL_CTX_set_srp_password(backend->ctx, ssl_password)) { + if(!SSL_CTX_set_srp_password(octx->ssl_ctx, ssl_password)) { failf(data, "failed setting SRP password"); return CURLE_BAD_FUNCTION_ARGUMENT; } if(!conn_config->cipher_list) { infof(data, "Setting cipher list SRP"); - if(!SSL_CTX_set_cipher_list(backend->ctx, "SRP")) { + if(!SSL_CTX_set_cipher_list(octx->ssl_ctx, "SRP")) { failf(data, "failed setting SRP cipher list"); return CURLE_SSL_CIPHER; } @@ -3737,40 +3765,42 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, * fail to connect if the verification fails, or if it should continue * anyway. In the latter case the result of the verification is checked with * SSL_get_verify_result() below. */ - SSL_CTX_set_verify(backend->ctx, + SSL_CTX_set_verify(octx->ssl_ctx, verifypeer ? SSL_VERIFY_PEER : SSL_VERIFY_NONE, NULL); /* Enable logging of secrets to the file specified in env SSLKEYLOGFILE. */ #ifdef HAVE_KEYLOG_CALLBACK if(Curl_tls_keylog_enabled()) { - SSL_CTX_set_keylog_callback(backend->ctx, ossl_keylog_callback); + SSL_CTX_set_keylog_callback(octx->ssl_ctx, ossl_keylog_callback); } #endif - /* Enable the session cache because it's a prerequisite for the "new session" - * callback. Use the "external storage" mode to prevent OpenSSL from creating - * an internal session cache. - */ - SSL_CTX_set_session_cache_mode(backend->ctx, - SSL_SESS_CACHE_CLIENT | - SSL_SESS_CACHE_NO_INTERNAL); - SSL_CTX_sess_set_new_cb(backend->ctx, ossl_new_session_cb); + if(cb_new_session) { + /* 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. + */ + SSL_CTX_set_session_cache_mode(octx->ssl_ctx, + SSL_SESS_CACHE_CLIENT | + SSL_SESS_CACHE_NO_INTERNAL); + SSL_CTX_sess_set_new_cb(octx->ssl_ctx, cb_new_session); + } /* give application a chance to interfere with SSL set up. */ if(data->set.ssl.fsslctx) { /* When a user callback is installed to modify the SSL_CTX, * we need to do the full initialization before calling it. * See: #11800 */ - if(!backend->x509_store_setup) { - result = Curl_ssl_setup_x509_store(cf, data, backend->ctx); + if(!octx->x509_store_setup) { + result = Curl_ssl_setup_x509_store(cf, data, octx->ssl_ctx); if(result) return result; - backend->x509_store_setup = TRUE; + octx->x509_store_setup = TRUE; } - Curl_set_in_callback(data, true); - result = (*data->set.ssl.fsslctx)(data, backend->ctx, + Curl_set_in_callback(data, TRUE); + result = (*data->set.ssl.fsslctx)(data, octx->ssl_ctx, data->set.ssl.fsslctxp); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, FALSE); if(result) { failf(data, "error signaled by ssl ctx callback"); return result; @@ -3778,64 +3808,234 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, } /* Let's make an SSL structure */ - if(backend->handle) - SSL_free(backend->handle); - backend->handle = SSL_new(backend->ctx); - if(!backend->handle) { - failf(data, "SSL: couldn't create a context (handle)"); + if(octx->ssl) + SSL_free(octx->ssl); + octx->ssl = SSL_new(octx->ssl_ctx); + if(!octx->ssl) { + failf(data, "SSL: could not create a context (handle)"); return CURLE_OUT_OF_MEMORY; } - SSL_set_app_data(backend->handle, cf); + SSL_set_app_data(octx->ssl, ssl_user_data); #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_TLSEXT) && \ !defined(OPENSSL_NO_OCSP) if(conn_config->verifystatus) - SSL_set_tlsext_status_type(backend->handle, TLSEXT_STATUSTYPE_ocsp); + SSL_set_tlsext_status_type(octx->ssl, TLSEXT_STATUSTYPE_ocsp); #endif #if (defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC)) && \ defined(ALLOW_RENEG) - SSL_set_renegotiate_mode(backend->handle, ssl_renegotiate_freely); + SSL_set_renegotiate_mode(octx->ssl, ssl_renegotiate_freely); #endif - SSL_set_connect_state(backend->handle); + SSL_set_connect_state(octx->ssl); - backend->server_cert = 0x0; + octx->server_cert = 0x0; #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME - if(connssl->peer.sni) { - if(!SSL_set_tlsext_host_name(backend->handle, connssl->peer.sni)) { + if(peer->sni) { + if(!SSL_set_tlsext_host_name(octx->ssl, peer->sni)) { failf(data, "Failed set SNI"); return CURLE_SSL_CONNECT_ERROR; } } + +#ifdef USE_ECH + if(ECH_ENABLED(data)) { + unsigned char *ech_config = NULL; + size_t ech_config_len = 0; + char *outername = data->set.str[STRING_ECH_PUBLIC]; + int trying_ech_now = 0; + + if(data->set.tls_ech & CURLECH_GREASE) { + infof(data, "ECH: will GREASE ClientHello"); +# ifdef OPENSSL_IS_BORINGSSL + SSL_set_enable_ech_grease(octx->ssl, 1); +# else + SSL_set_options(octx->ssl, SSL_OP_ECH_GREASE); +# endif + } + else if(data->set.tls_ech & CURLECH_CLA_CFG) { +# ifdef OPENSSL_IS_BORINGSSL + /* have to do base64 decode here for boring */ + const char *b64 = data->set.str[STRING_ECH_CONFIG]; + + if(!b64) { + infof(data, "ECH: ECHConfig from command line empty"); + return CURLE_SSL_CONNECT_ERROR; + } + ech_config_len = 2 * strlen(b64); + result = Curl_base64_decode(b64, &ech_config, &ech_config_len); + if(result || !ech_config) { + infof(data, "ECH: cannot base64 decode ECHConfig from command line"); + if(data->set.tls_ech & CURLECH_HARD) + return result; + } + if(SSL_set1_ech_config_list(octx->ssl, ech_config, + ech_config_len) != 1) { + infof(data, "ECH: SSL_ECH_set1_echconfig failed"); + if(data->set.tls_ech & CURLECH_HARD) { + free(ech_config); + return CURLE_SSL_CONNECT_ERROR; + } + } + free(ech_config); + trying_ech_now = 1; +# else + 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_ech_set1_echconfig(octx->ssl, ech_config, ech_config_len) != 1) { + infof(data, "ECH: SSL_ECH_set1_echconfig failed"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + else + trying_ech_now = 1; +# endif + infof(data, "ECH: ECHConfig from command line"); + } + else { + struct Curl_dns_entry *dns = NULL; + + if(peer->hostname) + dns = Curl_fetch_addr(data, peer->hostname, peer->port); + if(!dns) { + infof(data, "ECH: requested but no DNS info available"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + else { + struct Curl_https_rrinfo *rinfo = NULL; + + rinfo = dns->hinfo; + if(rinfo && rinfo->echconfiglist) { + unsigned char *ecl = rinfo->echconfiglist; + size_t elen = rinfo->echconfiglist_len; + + infof(data, "ECH: ECHConfig from DoH HTTPS RR"); +# ifndef OPENSSL_IS_BORINGSSL + if(SSL_ech_set1_echconfig(octx->ssl, ecl, elen) != 1) { + infof(data, "ECH: SSL_ECH_set1_echconfig failed"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } +# else + if(SSL_set1_ech_config_list(octx->ssl, ecl, elen) != 1) { + infof(data, "ECH: SSL_set1_ech_config_list failed (boring)"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } +# endif + else { + trying_ech_now = 1; + infof(data, "ECH: imported ECHConfigList of length %zu", elen); + } + } + else { + infof(data, "ECH: requested but no ECHConfig available"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + Curl_resolv_unlink(data, &dns); + } + } +# ifdef OPENSSL_IS_BORINGSSL + if(trying_ech_now && outername) { + infof(data, "ECH: setting public_name not supported with BoringSSL"); + return CURLE_SSL_CONNECT_ERROR; + } +# else + if(trying_ech_now && outername) { + infof(data, "ECH: inner: '%s', outer: '%s'", + peer->hostname ? peer->hostname : "NULL", outername); + result = SSL_ech_set_server_names(octx->ssl, + 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 /* not BORING */ + 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; + } + } +#endif /* USE_ECH */ + +#endif + + octx->reused_session = FALSE; + if(ssl_config->primary.cache_session) { + Curl_ssl_sessionid_lock(data); + if(!Curl_ssl_getsessionid(cf, data, peer, (void **)&der_sessionid, + &der_sessionid_size, NULL)) { + /* we got a session id, use it! */ + ssl_session = d2i_SSL_SESSION(NULL, &der_sessionid, + (long)der_sessionid_size); + if(ssl_session) { + if(!SSL_set_session(octx->ssl, ssl_session)) { + Curl_ssl_sessionid_unlock(data); + SSL_SESSION_free(ssl_session); + failf(data, "SSL: SSL_set_session failed: %s", + ossl_strerror(ERR_get_error(), error_buffer, + sizeof(error_buffer))); + return CURLE_SSL_CONNECT_ERROR; + } + SSL_SESSION_free(ssl_session); + /* Informational message */ + infof(data, "SSL reusing session ID"); + octx->reused_session = TRUE; + } + else { + Curl_ssl_sessionid_unlock(data); + return CURLE_SSL_CONNECT_ERROR; + } + } + Curl_ssl_sessionid_unlock(data); + } + + return CURLE_OK; +} + +static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, + struct Curl_easy *data) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; + struct alpn_proto_buf proto; + BIO *bio; + CURLcode result; + + DEBUGASSERT(ssl_connect_1 == connssl->connecting_state); + DEBUGASSERT(octx); + memset(&proto, 0, sizeof(proto)); +#ifdef HAS_ALPN + if(connssl->alpn) { + result = Curl_alpn_to_proto_buf(&proto, connssl->alpn); + if(result) { + failf(data, "Error determining ALPN"); + return CURLE_SSL_CONNECT_ERROR; + } + } #endif - SSL_set_app_data(backend->handle, cf); + result = Curl_ossl_ctx_init(octx, cf, data, &connssl->peer, TRNSPRT_TCP, + proto.data, proto.len, NULL, NULL, + ossl_new_session_cb, cf); + if(result) + return result; - connssl->reused_session = FALSE; - if(ssl_config->primary.sessionid) { - Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, &ssl_sessionid, NULL)) { - /* we got a session id, use it! */ - if(!SSL_set_session(backend->handle, ssl_sessionid)) { - Curl_ssl_sessionid_unlock(data); - failf(data, "SSL: SSL_set_session failed: %s", - ossl_strerror(ERR_get_error(), error_buffer, - sizeof(error_buffer))); - return CURLE_SSL_CONNECT_ERROR; - } - /* Informational message */ - infof(data, "SSL reusing session ID"); - connssl->reused_session = TRUE; - } - Curl_ssl_sessionid_unlock(data); - } - - backend->bio_method = ossl_bio_cf_method_create(); - if(!backend->bio_method) + octx->bio_method = ossl_bio_cf_method_create(); + if(!octx->bio_method) return CURLE_OUT_OF_MEMORY; - bio = BIO_new(backend->bio_method); + bio = BIO_new(octx->bio_method); if(!bio) return CURLE_OUT_OF_MEMORY; @@ -3844,83 +4044,154 @@ static CURLcode ossl_connect_step1(struct Curl_cfilter *cf, /* with OpenSSL v1.1.1 we get an alternative to SSL_set_bio() that works * without backward compat quirks. Every call takes one reference, so we * up it and pass. SSL* then owns it and will free. - * We check on the function in configure, since libressl and friends + * We check on the function in configure, since LibreSSL and friends * each have their own versions to add support for this. */ BIO_up_ref(bio); - SSL_set0_rbio(backend->handle, bio); - SSL_set0_wbio(backend->handle, bio); + SSL_set0_rbio(octx->ssl, bio); + SSL_set0_wbio(octx->ssl, bio); #else - SSL_set_bio(backend->handle, bio, bio); + SSL_set_bio(octx->ssl, bio, bio); +#endif + +#ifdef HAS_ALPN + if(connssl->alpn) { + Curl_alpn_to_proto_str(&proto, connssl->alpn); + infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data); + } #endif connssl->connecting_state = ssl_connect_2; - return CURLE_OK; } +#ifdef USE_ECH +/* If we have retry configs, then trace those out */ +static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL* ssl, + int reason) +{ + CURLcode result = CURLE_OK; + size_t rcl = 0; + int rv = 1; +# ifndef OPENSSL_IS_BORINGSSL + char *inner = NULL; + unsigned char *rcs = NULL; + char *outer = NULL; +# else + const char *inner = NULL; + const uint8_t *rcs = NULL; + const char *outer = NULL; + size_t out_name_len = 0; + int servername_type = 0; +# endif + + /* nothing to trace if not doing ECH */ + if(!ECH_ENABLED(data)) + return; +# ifndef OPENSSL_IS_BORINGSSL + rv = SSL_ech_get_retry_config(ssl, &rcs, &rcl); +# else + SSL_get0_ech_retry_configs(ssl, &rcs, &rcl); + rv = (int)rcl; +# endif + + if(rv && rcs) { +# define HEXSTR_MAX 800 + char *b64str = NULL; + size_t blen = 0; + + result = Curl_base64_encode((const char *)rcs, rcl, + &b64str, &blen); + if(!result && b64str) + infof(data, "ECH: retry_configs %s", b64str); + free(b64str); +# ifndef OPENSSL_IS_BORINGSSL + rv = SSL_ech_get_status(ssl, &inner, &outer); + infof(data, "ECH: retry_configs for %s from %s, %d %d", + inner ? inner : "NULL", outer ? outer : "NULL", reason, rv); +#else + rv = SSL_ech_accepted(ssl); + servername_type = SSL_get_servername_type(ssl); + inner = SSL_get_servername(ssl, servername_type); + SSL_get0_ech_name_override(ssl, &outer, &out_name_len); + /* TODO: get the inner from boring */ + infof(data, "ECH: retry_configs for %s from %s, %d %d", + inner ? inner : "NULL", outer ? outer : "NULL", reason, rv); +#endif + } + else + infof(data, "ECH: no retry_configs (rv = %d)", rv); +# ifndef OPENSSL_IS_BORINGSSL + OPENSSL_free((void *)rcs); +# endif + return; +} + +#endif + static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) { int err; struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - DEBUGASSERT(ssl_connect_2 == connssl->connecting_state - || ssl_connect_2_reading == connssl->connecting_state - || ssl_connect_2_writing == connssl->connecting_state); - DEBUGASSERT(backend); + DEBUGASSERT(ssl_connect_2 == connssl->connecting_state); + DEBUGASSERT(octx); + connssl->io_need = CURL_SSL_IO_NEED_NONE; ERR_clear_error(); - err = SSL_connect(backend->handle); + err = SSL_connect(octx->ssl); - if(!backend->x509_store_setup) { + if(!octx->x509_store_setup) { /* After having send off the ClientHello, we prepare the x509 * store to verify the coming certificate from the server */ - CURLcode result = Curl_ssl_setup_x509_store(cf, data, backend->ctx); + CURLcode result = Curl_ssl_setup_x509_store(cf, data, octx->ssl_ctx); if(result) return result; - backend->x509_store_setup = TRUE; + octx->x509_store_setup = TRUE; } #ifndef HAVE_KEYLOG_CALLBACK - if(Curl_tls_keylog_enabled()) { - /* If key logging is enabled, wait for the handshake to complete and then - * proceed with logging secrets (for TLS 1.2 or older). - */ - ossl_log_tls12_secret(backend->handle, &backend->keylog_done); - } + /* If key logging is enabled, wait for the handshake to complete and then + * proceed with logging secrets (for TLS 1.2 or older). + */ + if(Curl_tls_keylog_enabled() && !octx->keylog_done) + ossl_log_tls12_secret(octx->ssl, &octx->keylog_done); #endif /* 1 is fine 0 is "not successful but was shut down controlled" <0 is "handshake was not successful, because a fatal error occurred" */ if(1 != err) { - int detail = SSL_get_error(backend->handle, err); + int detail = SSL_get_error(octx->ssl, err); + CURL_TRC_CF(data, cf, "SSL_connect() -> err=%d, detail=%d", err, detail); if(SSL_ERROR_WANT_READ == detail) { - connssl->connecting_state = ssl_connect_2_reading; + CURL_TRC_CF(data, cf, "SSL_connect() -> want recv"); + connssl->io_need = CURL_SSL_IO_NEED_RECV; return CURLE_OK; } if(SSL_ERROR_WANT_WRITE == detail) { - connssl->connecting_state = ssl_connect_2_writing; + CURL_TRC_CF(data, cf, "SSL_connect() -> want send"); + connssl->io_need = CURL_SSL_IO_NEED_SEND; return CURLE_OK; } #ifdef SSL_ERROR_WANT_ASYNC if(SSL_ERROR_WANT_ASYNC == detail) { + CURL_TRC_CF(data, cf, "SSL_connect() -> want async"); + connssl->io_need = CURL_SSL_IO_NEED_RECV; connssl->connecting_state = ssl_connect_2; return CURLE_OK; } #endif #ifdef SSL_ERROR_WANT_RETRY_VERIFY if(SSL_ERROR_WANT_RETRY_VERIFY == detail) { + CURL_TRC_CF(data, cf, "SSL_connect() -> want retry_verify"); + connssl->io_need = CURL_SSL_IO_NEED_RECV; connssl->connecting_state = ssl_connect_2; return CURLE_OK; } #endif - if(backend->io_result == CURLE_AGAIN) { - return CURLE_OK; - } else { /* untreated error */ sslerr_t errdetail; @@ -3930,7 +4201,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, int lib; int reason; - /* the connection failed, we're not waiting for anything else. */ + /* the connection failed, we are not waiting for anything else. */ connssl->connecting_state = ssl_connect_2; /* Get the earliest error code from the thread's error queue and remove @@ -3946,17 +4217,17 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, (reason == SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED))) { result = CURLE_PEER_FAILED_VERIFICATION; - lerr = SSL_get_verify_result(backend->handle); + lerr = SSL_get_verify_result(octx->ssl); if(lerr != X509_V_OK) { ssl_config->certverifyresult = lerr; msnprintf(error_buffer, sizeof(error_buffer), "SSL certificate problem: %s", X509_verify_cert_error_string(lerr)); } - else - /* strcpy() is fine here as long as the string fits within - error_buffer */ - strcpy(error_buffer, "SSL certificate verification failed"); + else { + failf(data, "%s", "SSL certificate verification failed"); + return result; + } } #if defined(SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED) /* SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED is only available on @@ -3968,6 +4239,21 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, result = CURLE_SSL_CLIENTCERT; ossl_strerror(errdetail, error_buffer, sizeof(error_buffer)); } +#endif +#ifdef USE_ECH + else if((lib == ERR_LIB_SSL) && +# ifndef OPENSSL_IS_BORINGSSL + (reason == SSL_R_ECH_REQUIRED)) { +# else + (reason == SSL_R_ECH_REJECTED)) { +# endif + + /* trace retry_configs if we got some */ + ossl_trace_ech_retry_configs(data, octx->ssl, reason); + + result = CURLE_ECH_REQUIRED; + ossl_strerror(errdetail, error_buffer, sizeof(error_buffer)); + } #endif else { result = CURLE_SSL_CONNECT_ERROR; @@ -3976,7 +4262,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, /* detail is already set to the SSL error above */ - /* If we e.g. use SSLv2 request-method and the server doesn't like us + /* If we e.g. use SSLv2 request-method and the server does not like us * (RST connection, etc.), OpenSSL gives no explanation whatsoever and * the SO_ERROR is also lost. */ @@ -3988,7 +4274,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, Curl_strerror(sockerr, extramsg, sizeof(extramsg)); failf(data, OSSL_PACKAGE " SSL_connect: %s in connection to %s:%d ", extramsg[0] ? extramsg : SSL_ERROR_to_str(detail), - connssl->peer.hostname, connssl->port); + connssl->peer.hostname, connssl->peer.port); return result; } @@ -4002,26 +4288,88 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, int psigtype_nid = NID_undef; const char *negotiated_group_name = NULL; - /* we connected fine, we're not waiting for anything else. */ + /* we connected fine, we are not waiting for anything else. */ connssl->connecting_state = ssl_connect_3; #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) - SSL_get_peer_signature_type_nid(backend->handle, &psigtype_nid); + SSL_get_peer_signature_type_nid(octx->ssl, &psigtype_nid); #if (OPENSSL_VERSION_NUMBER >= 0x30200000L) - negotiated_group_name = SSL_get0_group_name(backend->handle); + negotiated_group_name = SSL_get0_group_name(octx->ssl); #else negotiated_group_name = - OBJ_nid2sn(SSL_get_negotiated_group(backend->handle) & 0x0000FFFF); + OBJ_nid2sn(SSL_get_negotiated_group(octx->ssl) & 0x0000FFFF); #endif #endif /* Informational message */ infof(data, "SSL connection using %s / %s / %s / %s", - SSL_get_version(backend->handle), - SSL_get_cipher(backend->handle), - negotiated_group_name? negotiated_group_name : "[blank]", + SSL_get_version(octx->ssl), + SSL_get_cipher(octx->ssl), + negotiated_group_name ? negotiated_group_name : "[blank]", OBJ_nid2sn(psigtype_nid)); +#ifdef USE_ECH +# ifndef OPENSSL_IS_BORINGSSL + if(ECH_ENABLED(data)) { + char *inner = NULL, *outer = NULL; + const char *status = NULL; + int rv; + + rv = SSL_ech_get_status(octx->ssl, &inner, &outer); + switch(rv) { + case SSL_ECH_STATUS_SUCCESS: + status = "succeeded"; + break; + case SSL_ECH_STATUS_GREASE_ECH: + status = "sent GREASE, got retry-configs"; + break; + case SSL_ECH_STATUS_GREASE: + status = "sent GREASE"; + break; + case SSL_ECH_STATUS_NOT_TRIED: + status = "not attempted"; + break; + case SSL_ECH_STATUS_NOT_CONFIGURED: + status = "not configured"; + break; + case SSL_ECH_STATUS_BACKEND: + status = "backend (unexpected)"; + break; + case SSL_ECH_STATUS_FAILED: + status = "failed"; + break; + case SSL_ECH_STATUS_BAD_CALL: + status = "bad call (unexpected)"; + break; + case SSL_ECH_STATUS_BAD_NAME: + status = "bad name (unexpected)"; + break; + default: + status = "unexpected status"; + infof(data, "ECH: unexpected status %d",rv); + } + infof(data, "ECH: result: status is %s, inner is %s, outer is %s", + (status ? status : "NULL"), + (inner ? inner : "NULL"), + (outer ? outer : "NULL")); + OPENSSL_free(inner); + OPENSSL_free(outer); + if(rv == SSL_ECH_STATUS_GREASE_ECH) { + /* trace retry_configs if we got some */ + ossl_trace_ech_retry_configs(data, octx->ssl, 0); + } + if(rv != SSL_ECH_STATUS_SUCCESS + && data->set.tls_ech & CURLECH_HARD) { + infof(data, "ECH: ech-hard failed"); + return CURLE_SSL_CONNECT_ERROR; + } + } + else { + infof(data, "ECH: result: status is not attempted"); + } +# endif /* BORING */ +#endif /* USE_ECH */ + #ifdef HAS_ALPN /* Sets data and len to negotiated protocol, len is 0 if no protocol was * negotiated @@ -4029,9 +4377,9 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf, if(connssl->alpn) { const unsigned char *neg_protocol; unsigned int len; - SSL_get0_alpn_selected(backend->handle, &neg_protocol, &len); + SSL_get0_alpn_selected(octx->ssl, &neg_protocol, &len); - return Curl_alpn_set_negotiated(cf, data, neg_protocol, len); + return Curl_alpn_set_negotiated(cf, data, connssl, neg_protocol, len); } #endif @@ -4053,7 +4401,7 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert, /* Result is returned to caller */ CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH; - /* if a path wasn't specified, don't pin */ + /* if a path was not specified, do not pin */ if(!pinnedpubkey) return CURLE_OK; @@ -4074,12 +4422,12 @@ static CURLcode ossl_pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert, if(!buff1) break; /* failed */ - /* https://www.openssl.org/docs/crypto/d2i_X509.html */ + /* https://docs.openssl.org/master/man3/d2i_X509/ */ len2 = i2d_X509_PUBKEY(X509_get_X509_PUBKEY(cert), &temp); /* * These checks are verifying we got back the same values as when we - * sized the buffer. It's pretty weak since they should always be the + * sized the buffer. it is pretty weak since they should always be the * same. But it gives us something to test. */ if((len1 != len2) || !temp || ((temp - buff1) != len1)) @@ -4166,35 +4514,29 @@ static void infof_certstack(struct Curl_easy *data, const SSL *ssl) #define infof_certstack(data, ssl) #endif -/* - * Get the server cert, verify it and show it, etc., only call failf() if the - * 'strict' argument is TRUE as otherwise all this is for informational - * purposes only! - * - * We check certificates to authenticate the server; otherwise we risk - * man-in-the-middle attack. - */ -static CURLcode servercert(struct Curl_cfilter *cf, - struct Curl_easy *data, - bool strict) +#define MAX_CERT_NAME_LENGTH 2048 + +CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ossl_ctx *octx, + struct ssl_peer *peer) { struct connectdata *conn = cf->conn; - struct ssl_connect_data *connssl = cf->ctx; struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); CURLcode result = CURLE_OK; - int rc; long lerr; X509 *issuer; BIO *fp = NULL; char error_buffer[256]=""; - char buffer[2048]; const char *ptr; BIO *mem = BIO_new(BIO_s_mem()); - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + bool strict = (conn_config->verifypeer || conn_config->verifyhost); + struct dynbuf dname; - DEBUGASSERT(backend); + DEBUGASSERT(octx); + + Curl_dyn_init(&dname, MAX_CERT_NAME_LENGTH); if(!mem) { failf(data, @@ -4207,34 +4549,34 @@ static CURLcode servercert(struct Curl_cfilter *cf, if(data->set.ssl.certinfo) /* asked to gather certificate info */ - (void)Curl_ossl_certchain(data, backend->handle); + (void)ossl_certchain(data, octx->ssl); - backend->server_cert = SSL_get1_peer_certificate(backend->handle); - if(!backend->server_cert) { + octx->server_cert = SSL_get1_peer_certificate(octx->ssl); + if(!octx->server_cert) { BIO_free(mem); if(!strict) return CURLE_OK; - failf(data, "SSL: couldn't get peer certificate"); + failf(data, "SSL: could not get peer certificate"); return CURLE_PEER_FAILED_VERIFICATION; } infof(data, "%s certificate:", - Curl_ssl_cf_is_proxy(cf)? "Proxy" : "Server"); + Curl_ssl_cf_is_proxy(cf) ? "Proxy" : "Server"); - rc = x509_name_oneline(X509_get_subject_name(backend->server_cert), - buffer, sizeof(buffer)); - infof(data, " subject: %s", rc?"[NONE]":buffer); + result = x509_name_oneline(X509_get_subject_name(octx->server_cert), + &dname); + infof(data, " subject: %s", result ? "[NONE]" : Curl_dyn_ptr(&dname)); #ifndef CURL_DISABLE_VERBOSE_STRINGS { long len; - ASN1_TIME_print(mem, X509_get0_notBefore(backend->server_cert)); + ASN1_TIME_print(mem, X509_get0_notBefore(octx->server_cert)); len = BIO_get_mem_data(mem, (char **) &ptr); infof(data, " start date: %.*s", (int)len, ptr); (void)BIO_reset(mem); - ASN1_TIME_print(mem, X509_get0_notAfter(backend->server_cert)); + ASN1_TIME_print(mem, X509_get0_notAfter(octx->server_cert)); len = BIO_get_mem_data(mem, (char **) &ptr); infof(data, " expire date: %.*s", (int)len, ptr); (void)BIO_reset(mem); @@ -4244,24 +4586,25 @@ static CURLcode servercert(struct Curl_cfilter *cf, BIO_free(mem); if(conn_config->verifyhost) { - result = Curl_ossl_verifyhost(data, conn, &connssl->peer, - backend->server_cert); + result = ossl_verifyhost(data, conn, peer, octx->server_cert); if(result) { - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; + Curl_dyn_free(&dname); return result; } } - rc = x509_name_oneline(X509_get_issuer_name(backend->server_cert), - buffer, sizeof(buffer)); - if(rc) { + result = x509_name_oneline(X509_get_issuer_name(octx->server_cert), + &dname); + if(result) { if(strict) - failf(data, "SSL: couldn't get X509-issuer name"); + failf(data, "SSL: could not get X509-issuer name"); result = CURLE_PEER_FAILED_VERIFICATION; } else { - infof(data, " issuer: %s", buffer); + infof(data, " issuer: %s", Curl_dyn_ptr(&dname)); + Curl_dyn_free(&dname); /* We could do all sorts of certificate verification stuff here before deallocating the certificate. */ @@ -4277,8 +4620,8 @@ static CURLcode servercert(struct Curl_cfilter *cf, " error %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)) ); - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; return CURLE_OUT_OF_MEMORY; } } @@ -4290,8 +4633,8 @@ static CURLcode servercert(struct Curl_cfilter *cf, " error %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)) ); - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; return CURLE_OUT_OF_MEMORY; } @@ -4300,8 +4643,8 @@ static CURLcode servercert(struct Curl_cfilter *cf, failf(data, "SSL: Unable to open issuer cert (%s)", conn_config->issuercert); BIO_free(fp); - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; return CURLE_SSL_ISSUER_ERROR; } } @@ -4313,19 +4656,19 @@ static CURLcode servercert(struct Curl_cfilter *cf, conn_config->issuercert); BIO_free(fp); X509_free(issuer); - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; return CURLE_SSL_ISSUER_ERROR; } - if(X509_check_issued(issuer, backend->server_cert) != X509_V_OK) { + if(X509_check_issued(issuer, octx->server_cert) != X509_V_OK) { if(strict) failf(data, "SSL: Certificate issuer check failed (%s)", conn_config->issuercert); BIO_free(fp); X509_free(issuer); - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; return CURLE_SSL_ISSUER_ERROR; } @@ -4335,7 +4678,7 @@ static CURLcode servercert(struct Curl_cfilter *cf, X509_free(issuer); } - lerr = SSL_get_verify_result(backend->handle); + lerr = SSL_get_verify_result(octx->ssl); ssl_config->certverifyresult = lerr; if(lerr != X509_V_OK) { if(conn_config->verifypeer) { @@ -4354,14 +4697,13 @@ static CURLcode servercert(struct Curl_cfilter *cf, else infof(data, " SSL certificate verify ok."); } - - infof_certstack(data, backend->handle); + infof_certstack(data, octx->ssl); #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_TLSEXT) && \ !defined(OPENSSL_NO_OCSP) - if(conn_config->verifystatus && !connssl->reused_session) { - /* don't do this after Session ID reuse */ - result = verifystatus(cf, data); + if(conn_config->verifystatus && !octx->reused_session) { + /* do not do this after Session ID reuse */ + result = verifystatus(cf, data, octx); if(result) { /* when verifystatus failed, remove the session id from the cache again if present */ @@ -4369,7 +4711,8 @@ static CURLcode servercert(struct Curl_cfilter *cf, void *old_ssl_sessionid = NULL; bool incache; Curl_ssl_sessionid_lock(data); - incache = !(Curl_ssl_getsessionid(cf, data, &old_ssl_sessionid, NULL)); + incache = !(Curl_ssl_getsessionid(cf, data, peer, + &old_ssl_sessionid, NULL, NULL)); if(incache) { infof(data, "Remove session ID again from cache"); Curl_ssl_delsessionid(data, old_ssl_sessionid); @@ -4377,29 +4720,32 @@ static CURLcode servercert(struct Curl_cfilter *cf, Curl_ssl_sessionid_unlock(data); } - X509_free(backend->server_cert); - backend->server_cert = NULL; + X509_free(octx->server_cert); + octx->server_cert = NULL; return result; } } #endif if(!strict) - /* when not strict, we don't bother about the verify cert problems */ + /* when not strict, we do not bother about the verify cert problems */ result = CURLE_OK; - ptr = Curl_ssl_cf_is_proxy(cf)? - data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]: +#ifndef CURL_DISABLE_PROXY + ptr = Curl_ssl_cf_is_proxy(cf) ? + data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#else + ptr = data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#endif if(!result && ptr) { - result = ossl_pkp_pin_peer_pubkey(data, backend->server_cert, ptr); + result = ossl_pkp_pin_peer_pubkey(data, octx->server_cert, ptr); if(result) failf(data, "SSL: public key does not match pinned public key"); } - X509_free(backend->server_cert); - backend->server_cert = NULL; - connssl->connecting_state = ssl_connect_done; + X509_free(octx->server_cert); + octx->server_cert = NULL; return result; } @@ -4409,20 +4755,18 @@ static CURLcode ossl_connect_step3(struct Curl_cfilter *cf, { CURLcode result = CURLE_OK; struct ssl_connect_data *connssl = cf->ctx; - struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); /* * We check certificates to authenticate the server; otherwise we risk - * man-in-the-middle attack; NEVERTHELESS, if we're told explicitly not to + * man-in-the-middle attack; NEVERTHELESS, if we are told explicitly not to * verify the peer, ignore faults and failures from the server cert * operations. */ - result = servercert(cf, data, conn_config->verifypeer || - conn_config->verifyhost); - + result = Curl_oss_check_peer_cert(cf, data, octx, &connssl->peer); if(!result) connssl->connecting_state = ssl_connect_done; @@ -4439,6 +4783,7 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf, curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); int what; + connssl->io_need = CURL_SSL_IO_NEED_NONE; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { *done = TRUE; @@ -4446,7 +4791,7 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf, } if(ssl_connect_1 == connssl->connecting_state) { - /* Find out how much more time we're allowed */ + /* Find out how much more time we are allowed */ const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { @@ -4460,9 +4805,7 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf, goto out; } - while(ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { + while(ssl_connect_2 == connssl->connecting_state) { /* check allowed time left */ const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); @@ -4474,15 +4817,12 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf, goto out; } - /* if ssl is expecting something, check if it's available. */ - if(!nonblocking && - (connssl->connecting_state == ssl_connect_2_reading || - connssl->connecting_state == ssl_connect_2_writing)) { - - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; + /* if ssl is expecting something, check if it is available. */ + if(!nonblocking && connssl->io_need) { + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, timeout_ms); @@ -4508,10 +4848,7 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf, * or epoll() will always have a valid fdset to wait on. */ result = ossl_connect_step2(cf, data); - if(result || (nonblocking && - (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state))) + if(result || (nonblocking && (ssl_connect_2 == connssl->connecting_state))) goto out; } /* repeat step2 until all transactions are done. */ @@ -4562,12 +4899,11 @@ static bool ossl_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; (void)data; - DEBUGASSERT(connssl && backend); - if(backend->handle && SSL_pending(backend->handle)) + DEBUGASSERT(connssl && octx); + if(octx->ssl && SSL_pending(octx->ssl)) return TRUE; return FALSE; } @@ -4586,26 +4922,27 @@ static ssize_t ossl_send(struct Curl_cfilter *cf, int memlen; int rc; struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; (void)data; - DEBUGASSERT(backend); + DEBUGASSERT(octx); ERR_clear_error(); + connssl->io_need = CURL_SSL_IO_NEED_NONE; memlen = (len > (size_t)INT_MAX) ? INT_MAX : (int)len; - rc = SSL_write(backend->handle, mem, memlen); + rc = SSL_write(octx->ssl, mem, memlen); if(rc <= 0) { - err = SSL_get_error(backend->handle, rc); + err = SSL_get_error(octx->ssl, rc); switch(err) { case SSL_ERROR_WANT_READ: + connssl->io_need = CURL_SSL_IO_NEED_RECV; + *curlcode = CURLE_AGAIN; + rc = -1; + goto out; case SSL_ERROR_WANT_WRITE: - /* The operation did not complete; the same TLS/SSL I/O function - should be called again later. This is basically an EWOULDBLOCK - equivalent. */ *curlcode = CURLE_AGAIN; rc = -1; goto out; @@ -4613,7 +4950,7 @@ static ssize_t ossl_send(struct Curl_cfilter *cf, { int sockerr = SOCKERRNO; - if(backend->io_result == CURLE_AGAIN) { + if(octx->io_result == CURLE_AGAIN) { *curlcode = CURLE_AGAIN; rc = -1; goto out; @@ -4670,20 +5007,20 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf, int buffsize; struct connectdata *conn = cf->conn; struct ssl_connect_data *connssl = cf->ctx; - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; (void)data; - DEBUGASSERT(backend); + DEBUGASSERT(octx); ERR_clear_error(); + connssl->io_need = CURL_SSL_IO_NEED_NONE; buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize; - nread = (ssize_t)SSL_read(backend->handle, buf, buffsize); + nread = (ssize_t)SSL_read(octx->ssl, buf, buffsize); if(nread <= 0) { /* failed SSL_read */ - int err = SSL_get_error(backend->handle, (int)nread); + int err = SSL_get_error(octx->ssl, (int)nread); switch(err) { case SSL_ERROR_NONE: /* this is not an error */ @@ -4696,16 +5033,19 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf, connclose(conn, "TLS close_notify"); break; case SSL_ERROR_WANT_READ: + *curlcode = CURLE_AGAIN; + nread = -1; + goto out; case SSL_ERROR_WANT_WRITE: - /* there's data pending, re-invoke SSL_read() */ + connssl->io_need = CURL_SSL_IO_NEED_SEND; *curlcode = CURLE_AGAIN; nread = -1; goto out; default: /* openssl/ssl.h for SSL_ERROR_SYSCALL says "look at error stack/return value/errno" */ - /* https://www.openssl.org/docs/crypto/ERR_get_error.html */ - if(backend->io_result == CURLE_AGAIN) { + /* https://docs.openssl.org/master/man3/ERR_get_error/ */ + if(octx->io_result == CURLE_AGAIN) { *curlcode = CURLE_AGAIN; nread = -1; goto out; @@ -4731,7 +5071,7 @@ static ssize_t ossl_recv(struct Curl_cfilter *cf, /* For debug builds be a little stricter and error on any SSL_ERROR_SYSCALL. For example a server may have closed the connection abruptly without a close_notify alert. For compatibility with older - peers we don't do this by default. #4624 + peers we do not do this by default. #4624 We can use this to gauge how many users may be affected, and if it goes ok eventually transition to allow in dev and release with @@ -4760,12 +5100,96 @@ out: return nread; } +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; + const char *algo_name; + unsigned int length; + unsigned char buf[EVP_MAX_MD_SIZE]; + + const char prefix[] = "tls-server-end-point:"; + struct connectdata *conn = data->conn; + struct Curl_cfilter *cf = conn->cfilter[sockindex]; + struct ossl_ctx *octx = NULL; + + do { + const struct Curl_cftype *cft = cf->cft; + struct ssl_connect_data *connssl = cf->ctx; + + if(cft->name && !strcmp(cft->name, "SSL")) { + octx = (struct ossl_ctx *)connssl->backend; + break; + } + + if(cf->next) + cf = cf->next; + + } while(cf->next); + + if(!octx) { + failf(data, "Failed to find the SSL filter"); + return CURLE_BAD_FUNCTION_ARGUMENT; + } + + cert = SSL_get1_peer_certificate(octx->ssl); + if(!cert) { + /* No server certificate, don't do channel binding */ + return CURLE_OK; + } + + if(!OBJ_find_sigid_algs(X509_get_signature_nid(cert), &algo_nid, NULL)) { + failf(data, + "Unable to find digest NID for certificate signature algorithm"); + return CURLE_SSL_INVALIDCERTSTATUS; + } + + /* https://datatracker.ietf.org/doc/html/rfc5929#section-4.1 */ + if(algo_nid == NID_md5 || algo_nid == NID_sha1) { + algo_type = EVP_sha256(); + } + else { + algo_type = EVP_get_digestbynid(algo_nid); + if(!algo_type) { + algo_name = OBJ_nid2sn(algo_nid); + failf(data, "Could not find digest algorithm %s (NID %d)", + algo_name ? algo_name : "(null)", algo_nid); + return CURLE_SSL_INVALIDCERTSTATUS; + } + } + + if(!X509_digest(cert, algo_type, buf, &length)) { + failf(data, "X509_digest() failed"); + return CURLE_SSL_INVALIDCERTSTATUS; + } + + /* Append "tls-server-end-point:" */ + if(Curl_dyn_addn(binding, prefix, sizeof(prefix) - 1) != CURLE_OK) + return CURLE_OUT_OF_MEMORY; + /* Append digest */ + if(Curl_dyn_addn(binding, buf, length)) + return CURLE_OUT_OF_MEMORY; + + return CURLE_OK; +#else + /* No X509_get_signature_nid support */ + (void)data; /* unused */ + (void)sockindex; /* unused */ + (void)binding; /* unused */ + return CURLE_OK; +#endif +} + static size_t ossl_version(char *buffer, size_t size) { #ifdef LIBRESSL_VERSION_NUMBER #ifdef HAVE_OPENSSL_VERSION char *p; - int count; + size_t count; const char *ver = OpenSSL_version(OPENSSL_VERSION); const char expected[] = OSSL_PACKAGE " "; /* ie "LibreSSL " */ if(strncasecompare(ver, expected, sizeof(expected) - 1)) { @@ -4780,9 +5204,9 @@ static size_t ossl_version(char *buffer, size_t size) #else return msnprintf(buffer, size, "%s/%lx.%lx.%lx", OSSL_PACKAGE, - (LIBRESSL_VERSION_NUMBER>>28)&0xf, - (LIBRESSL_VERSION_NUMBER>>20)&0xff, - (LIBRESSL_VERSION_NUMBER>>12)&0xff); + (LIBRESSL_VERSION_NUMBER >> 28) & 0xf, + (LIBRESSL_VERSION_NUMBER >> 20) & 0xff, + (LIBRESSL_VERSION_NUMBER >> 12) & 0xff); #endif #elif defined(OPENSSL_IS_BORINGSSL) #ifdef CURL_BORINGSSL_VERSION @@ -4833,9 +5257,9 @@ static size_t ossl_version(char *buffer, size_t size) #endif , OSSL_PACKAGE, - (ssleay_value>>28)&0xf, - (ssleay_value>>20)&0xff, - (ssleay_value>>12)&0xff, + (ssleay_value >> 28) & 0xf, + (ssleay_value >> 20) & 0xff, + (ssleay_value >> 12) & 0xff, sub); #endif /* OPENSSL_IS_BORINGSSL */ } @@ -4847,14 +5271,14 @@ static CURLcode ossl_random(struct Curl_easy *data, int rc; if(data) { if(ossl_seed(data)) /* Initiate the seed if not already done */ - return CURLE_FAILED_INIT; /* couldn't seed for some reason */ + return CURLE_FAILED_INIT; /* could not seed for some reason */ } else { if(!rand_enough()) return CURLE_FAILED_INIT; } /* RAND_bytes() returns 1 on success, 0 otherwise. */ - rc = RAND_bytes(entropy, curlx_uztosi(length)); + rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length)); return (rc == 1 ? CURLE_OK : CURLE_FAILED_INIT); } @@ -4896,25 +5320,10 @@ static void *ossl_get_internals(struct ssl_connect_data *connssl, CURLINFO info) { /* Legacy: CURLINFO_TLS_SESSION must return an SSL_CTX pointer. */ - struct ossl_ssl_backend_data *backend = - (struct ossl_ssl_backend_data *)connssl->backend; - DEBUGASSERT(backend); + struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend; + DEBUGASSERT(octx); return info == CURLINFO_TLS_SESSION ? - (void *)backend->ctx : (void *)backend->handle; -} - -static void ossl_free_multi_ssl_backend_data( - struct multi_ssl_backend_data *mbackend) -{ -#if defined(HAVE_SSL_X509_STORE_SHARE) - if(mbackend->store) { - X509_STORE_free(mbackend->store); - } - free(mbackend->CAfile); - free(mbackend); -#else /* HAVE_SSL_X509_STORE_SHARE */ - (void)mbackend; -#endif /* HAVE_SSL_X509_STORE_SHARE */ + (void *)octx->ssl_ctx : (void *)octx->ssl; } const struct Curl_ssl Curl_ssl_openssl = { @@ -4928,9 +5337,14 @@ const struct Curl_ssl Curl_ssl_openssl = { #ifdef HAVE_SSL_CTX_SET_CIPHERSUITES SSLSUPP_TLS13_CIPHERSUITES | #endif - SSLSUPP_HTTPS_PROXY, +#ifdef USE_ECH + SSLSUPP_ECH | +#endif + SSLSUPP_CA_CACHE | + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CIPHER_LIST, - sizeof(struct ossl_ssl_backend_data), + sizeof(struct ossl_ctx), ossl_init, /* init */ ossl_cleanup, /* cleanup */ @@ -4946,7 +5360,6 @@ const struct Curl_ssl Curl_ssl_openssl = { ossl_get_internals, /* get_internals */ ossl_close, /* close_one */ ossl_close_all, /* close_all */ - ossl_session_free, /* session_free */ ossl_set_engine, /* set_engine */ ossl_set_engine_default, /* set_engine_default */ ossl_engines_list, /* engines_list */ @@ -4958,9 +5371,9 @@ const struct Curl_ssl Curl_ssl_openssl = { #endif NULL, /* use of data in this connection */ NULL, /* remote of data from this connection */ - ossl_free_multi_ssl_backend_data, /* free_multi_ssl_backend_data */ ossl_recv, /* recv decrypted data */ ossl_send, /* send data to encrypt */ + ossl_get_channel_binding /* get_channel_binding */ }; #endif /* USE_OPENSSL */ diff --git a/deps/curl/lib/vtls/openssl.h b/deps/curl/lib/vtls/openssl.h index e802363a..7aba947d 100644 --- a/deps/curl/lib/vtls/openssl.h +++ b/deps/curl/lib/vtls/openssl.h @@ -36,23 +36,46 @@ #include "urldata.h" +/* Struct to hold a Curl OpenSSL instance */ +struct ossl_ctx { + /* these ones requires specific SSL-types */ + SSL_CTX* ssl_ctx; + SSL* ssl; + X509* server_cert; + BIO_METHOD *bio_method; + CURLcode io_result; /* result of last BIO cfilter operation */ +#ifndef HAVE_KEYLOG_CALLBACK + /* Set to true once a valid keylog entry has been created to avoid dupes. + This is a bool and not a bitfield because it is passed by address. */ + bool keylog_done; +#endif + BIT(x509_store_setup); /* x509 store has been set up */ + BIT(reused_session); /* session-ID was reused for this */ +}; + +typedef CURLcode Curl_ossl_ctx_setup_cb(struct Curl_cfilter *cf, + struct Curl_easy *data, + void *user_data); + +typedef int Curl_ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid); + +CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + int transport, /* TCP or QUIC */ + const unsigned char *alpn, size_t alpn_len, + Curl_ossl_ctx_setup_cb *cb_setup, + void *cb_user_data, + Curl_ossl_new_session_cb *cb_new_session, + void *ssl_user_data); + #if (OPENSSL_VERSION_NUMBER < 0x30000000L) #define SSL_get1_peer_certificate SSL_get_peer_certificate #endif -CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, - struct ssl_peer *peer, X509 *server_cert); extern const struct Curl_ssl Curl_ssl_openssl; -CURLcode Curl_ossl_set_client_cert(struct Curl_easy *data, - SSL_CTX *ctx, char *cert_file, - const struct curl_blob *cert_blob, - const char *cert_type, char *key_file, - const struct curl_blob *key_blob, - const char *key_type, char *key_passwd); - -CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl); - /** * Setup the OpenSSL X509_STORE in `ssl_ctx` for the cfilter `cf` and * easy handle `data`. Will allow reuse of a shared cache if suitable @@ -66,5 +89,23 @@ CURLcode Curl_ossl_ctx_configure(struct Curl_cfilter *cf, struct Curl_easy *data, SSL_CTX *ssl_ctx); +/* + * Add a new session to the cache. Takes ownership of the session. + */ +CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, + struct Curl_easy *data, + const struct ssl_peer *peer, + SSL_SESSION *ssl_sessionid); + +/* + * Get the server cert, verify it and show it, etc., only call failf() if + * ssl config verifypeer or -host is set. Otherwise all this is for + * informational purposes only! + */ +CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ossl_ctx *octx, + struct ssl_peer *peer); + #endif /* USE_OPENSSL */ #endif /* HEADER_CURL_SSLUSE_H */ diff --git a/deps/curl/lib/vtls/rustls.c b/deps/curl/lib/vtls/rustls.c index 367d7a5f..f0ef2670 100644 --- a/deps/curl/lib/vtls/rustls.c +++ b/deps/curl/lib/vtls/rustls.c @@ -41,12 +41,16 @@ #include "strerror.h" #include "multiif.h" #include "connect.h" /* for the connect timeout */ +#include "cipher_suite.h" +#include "rand.h" struct rustls_ssl_backend_data { const struct rustls_client_config *config; struct rustls_connection *conn; - bool data_pending; + size_t plain_out_buffered; + BIT(data_in_pending); + BIT(sent_shutdown); }; /* For a given rustls_result error code, return the best-matching CURLcode. */ @@ -61,7 +65,7 @@ static CURLcode map_error(rustls_result r) case RUSTLS_RESULT_NULL_PARAMETER: return CURLE_BAD_FUNCTION_ARGUMENT; default: - return CURLE_READ_ERROR; + return CURLE_RECV_ERROR; } } @@ -74,7 +78,7 @@ cr_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) (void)data; DEBUGASSERT(ctx && ctx->backend); backend = (struct rustls_ssl_backend_data *)ctx->backend; - return backend->data_pending; + return backend->data_in_pending; } struct io_ctx { @@ -86,6 +90,7 @@ static int read_cb(void *userdata, uint8_t *buf, uintptr_t len, uintptr_t *out_n) { struct io_ctx *io_ctx = userdata; + struct ssl_connect_data *const connssl = io_ctx->cf->ctx; CURLcode result; int ret = 0; ssize_t nread = Curl_conn_cf_recv(io_ctx->cf->next, io_ctx->data, @@ -97,7 +102,11 @@ read_cb(void *userdata, uint8_t *buf, uintptr_t len, uintptr_t *out_n) else ret = EINVAL; } - *out_n = (int)nread; + else if(nread == 0) + connssl->peer_closed = TRUE; + *out_n = (uintptr_t)nread; + CURL_TRC_CF(io_ctx->data, io_ctx->cf, "cf->next recv(len=%zu) -> %zd, %d", + len, nread, result); return ret; } @@ -108,7 +117,8 @@ write_cb(void *userdata, const uint8_t *buf, uintptr_t len, uintptr_t *out_n) CURLcode result; int ret = 0; ssize_t nwritten = Curl_conn_cf_send(io_ctx->cf->next, io_ctx->data, - (const char *)buf, len, &result); + (const char *)buf, len, FALSE, + &result); if(nwritten < 0) { nwritten = 0; if(CURLE_AGAIN == result) @@ -116,11 +126,9 @@ write_cb(void *userdata, const uint8_t *buf, uintptr_t len, uintptr_t *out_n) else ret = EINVAL; } - *out_n = (int)nwritten; - /* - CURL_TRC_CFX(io_ctx->data, io_ctx->cf, "cf->next send(len=%zu) -> %zd, %d", - len, nwritten, result)); - */ + *out_n = (uintptr_t)nwritten; + CURL_TRC_CF(io_ctx->data, io_ctx->cf, "cf->next send(len=%zu) -> %zd, %d", + len, nwritten, result); return ret; } @@ -147,7 +155,7 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf, char buffer[STRERROR_LEN]; failf(data, "reading from socket: %s", Curl_strerror(io_error, buffer, sizeof(buffer))); - *err = CURLE_READ_ERROR; + *err = CURLE_RECV_ERROR; return -1; } @@ -162,22 +170,22 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf, return -1; } - backend->data_pending = TRUE; + backend->data_in_pending = TRUE; *err = CURLE_OK; return (ssize_t)tls_bytes_read; } /* * On each run: - * - Read a chunk of bytes from the socket into rustls' TLS input buffer. - * - Tell rustls to process any new packets. - * - Read out as many plaintext bytes from rustls as possible, until hitting + * - Read a chunk of bytes from the socket into Rustls' TLS input buffer. + * - Tell Rustls to process any new packets. + * - Read out as many plaintext bytes from Rustls as possible, until hitting * error, EOF, or EAGAIN/EWOULDBLOCK, or plainbuf/plainlen is filled up. * - * It's okay to call this function with plainbuf == NULL and plainlen == 0. - * In that case, it will copy bytes from the socket into rustls' TLS input - * buffer, and process packets, but won't consume bytes from rustls' plaintext - * output buffer. + * it is okay to call this function with plainbuf == NULL and plainlen == 0. In + * that case, it will copy bytes from the socket into Rustls' TLS input + * buffer, and process packets, but will not consume bytes from Rustls' + * plaintext output buffer. */ static ssize_t cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -197,7 +205,7 @@ cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, rconn = backend->conn; while(plain_bytes_copied < plainlen) { - if(!backend->data_pending) { + if(!backend->data_in_pending) { if(tls_recv_more(cf, data, err) < 0) { if(*err != CURLE_AGAIN) { nread = -1; @@ -208,26 +216,26 @@ cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, } rresult = rustls_connection_read(rconn, - (uint8_t *)plainbuf + plain_bytes_copied, - plainlen - plain_bytes_copied, - &n); + (uint8_t *)plainbuf + plain_bytes_copied, + plainlen - plain_bytes_copied, + &n); if(rresult == RUSTLS_RESULT_PLAINTEXT_EMPTY) { - backend->data_pending = FALSE; + backend->data_in_pending = FALSE; } else if(rresult == RUSTLS_RESULT_UNEXPECTED_EOF) { failf(data, "rustls: peer closed TCP connection " - "without first closing TLS connection"); - *err = CURLE_READ_ERROR; + "without first closing TLS connection"); + *err = CURLE_RECV_ERROR; nread = -1; goto out; } else if(rresult != RUSTLS_RESULT_OK) { - /* n always equals 0 in this case, don't need to check it */ + /* n always equals 0 in this case, do not need to check it */ char errorbuf[255]; size_t errorlen; rustls_error(rresult, errorbuf, sizeof(errorbuf), &errorlen); failf(data, "rustls_connection_read: %.*s", (int)errorlen, errorbuf); - *err = CURLE_READ_ERROR; + *err = CURLE_RECV_ERROR; nread = -1; goto out; } @@ -262,15 +270,51 @@ out: return nread; } +static CURLcode cr_flush_out(struct Curl_cfilter *cf, struct Curl_easy *data, + struct rustls_connection *rconn) +{ + struct io_ctx io_ctx; + rustls_io_result io_error; + size_t tlswritten = 0; + size_t tlswritten_total = 0; + CURLcode result = CURLE_OK; + + io_ctx.cf = cf; + io_ctx.data = data; + + while(rustls_connection_wants_write(rconn)) { + io_error = rustls_connection_write_tls(rconn, write_cb, &io_ctx, + &tlswritten); + if(io_error == EAGAIN || io_error == EWOULDBLOCK) { + CURL_TRC_CF(data, cf, "cf_send: EAGAIN after %zu bytes", + tlswritten_total); + return CURLE_AGAIN; + } + else if(io_error) { + char buffer[STRERROR_LEN]; + failf(data, "writing to socket: %s", + Curl_strerror(io_error, buffer, sizeof(buffer))); + return CURLE_SEND_ERROR; + } + if(tlswritten == 0) { + failf(data, "EOF in swrite"); + return CURLE_SEND_ERROR; + } + CURL_TRC_CF(data, cf, "cf_send: wrote %zu TLS bytes", tlswritten); + tlswritten_total += tlswritten; + } + return result; +} + /* * On each call: - * - Copy `plainlen` bytes into rustls' plaintext input buffer (if > 0). - * - Fully drain rustls' plaintext output buffer into the socket until + * - Copy `plainlen` bytes into Rustls' plaintext input buffer (if > 0). + * - Fully drain Rustls' plaintext output buffer into the socket until * we get either an error or EAGAIN/EWOULDBLOCK. * - * It's okay to call this function with plainbuf == NULL and plainlen == 0. - * In that case, it won't read anything into rustls' plaintext input buffer. - * It will only drain rustls' plaintext output buffer into the socket. + * it is okay to call this function with plainbuf == NULL and plainlen == 0. + * 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 ssize_t cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -280,26 +324,43 @@ cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, struct rustls_ssl_backend_data *const backend = (struct rustls_ssl_backend_data *)connssl->backend; struct rustls_connection *rconn = NULL; - struct io_ctx io_ctx; size_t plainwritten = 0; - size_t tlswritten = 0; - size_t tlswritten_total = 0; rustls_result rresult; - rustls_io_result io_error; char errorbuf[256]; size_t errorlen; + const unsigned char *buf = plainbuf; + size_t blen = plainlen; + ssize_t nwritten = 0; DEBUGASSERT(backend); rconn = backend->conn; + DEBUGASSERT(rconn); - CURL_TRC_CF(data, cf, "cf_send: %zu plain bytes", plainlen); + CURL_TRC_CF(data, cf, "cf_send(len=%zu)", plainlen); - io_ctx.cf = cf; - io_ctx.data = data; + /* If a previous send blocked, we already added its plain bytes + * to rustsls and must not do that again. Flush the TLS bytes and, + * if successful, deduct the previous plain bytes from the current + * send. */ + if(backend->plain_out_buffered) { + *err = cr_flush_out(cf, data, rconn); + CURL_TRC_CF(data, cf, "cf_send: flushing %zu previously added bytes -> %d", + backend->plain_out_buffered, *err); + if(*err) + return -1; + if(blen > backend->plain_out_buffered) { + blen -= backend->plain_out_buffered; + buf += backend->plain_out_buffered; + } + else + blen = 0; + nwritten += (ssize_t)backend->plain_out_buffered; + backend->plain_out_buffered = 0; + } - if(plainlen > 0) { - rresult = rustls_connection_write(rconn, plainbuf, plainlen, - &plainwritten); + if(blen > 0) { + CURL_TRC_CF(data, cf, "cf_send: adding %zu plain bytes to Rustls", blen); + rresult = rustls_connection_write(rconn, buf, blen, &plainwritten); if(rresult != RUSTLS_RESULT_OK) { rustls_error(rresult, errorbuf, sizeof(errorbuf), &errorlen); failf(data, "rustls_connection_write: %.*s", (int)errorlen, errorbuf); @@ -313,35 +374,30 @@ cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, } } - while(rustls_connection_wants_write(rconn)) { - io_error = rustls_connection_write_tls(rconn, write_cb, &io_ctx, - &tlswritten); - if(io_error == EAGAIN || io_error == EWOULDBLOCK) { - CURL_TRC_CF(data, cf, "cf_send: EAGAIN after %zu bytes", - tlswritten_total); - *err = CURLE_AGAIN; - return -1; + *err = cr_flush_out(cf, data, rconn); + if(*err) { + if(CURLE_AGAIN == *err) { + /* The TLS bytes may have been partially written, but we fail the + * complete send() and remember how much we already added to Rustls. */ + CURL_TRC_CF(data, cf, "cf_send: EAGAIN, remember we added %zu plain" + " bytes already to Rustls", blen); + backend->plain_out_buffered = plainwritten; + if(nwritten) { + *err = CURLE_OK; + return (ssize_t)nwritten; + } } - else if(io_error) { - char buffer[STRERROR_LEN]; - failf(data, "writing to socket: %s", - Curl_strerror(io_error, buffer, sizeof(buffer))); - *err = CURLE_WRITE_ERROR; - return -1; - } - if(tlswritten == 0) { - failf(data, "EOF in swrite"); - *err = CURLE_WRITE_ERROR; - return -1; - } - CURL_TRC_CF(data, cf, "cf_send: wrote %zu TLS bytes", tlswritten); - tlswritten_total += tlswritten; + return -1; } + else + nwritten += (ssize_t)plainwritten; - return plainwritten; + CURL_TRC_CF(data, cf, "cf_send(len=%zu) -> %d, %zd", + plainlen, *err, nwritten); + return nwritten; } -/* A server certificate verify callback for rustls that always returns +/* 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 UNUSED_PARAM, @@ -350,20 +406,119 @@ cr_verify_none(void *userdata UNUSED_PARAM, return RUSTLS_RESULT_OK; } -static bool -cr_hostname_is_ip(const char *hostname) +static int +read_file_into(const char *filename, + struct dynbuf *out) { - struct in_addr in; -#ifdef ENABLE_IPV6 - struct in6_addr in6; - if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0) { - return true; + FILE *f = fopen(filename, FOPEN_READTEXT); + if(!f) { + return 0; } -#endif /* ENABLE_IPV6 */ - if(Curl_inet_pton(AF_INET, hostname, &in) > 0) { - return true; + + while(!feof(f)) { + uint8_t buf[256]; + size_t rr = fread(buf, 1, sizeof(buf), f); + if(rr == 0 || + CURLE_OK != Curl_dyn_addn(out, buf, rr)) { + fclose(f); + return 0; + } } - return false; + + return fclose(f) == 0; +} + +static void +cr_get_selected_ciphers(struct Curl_easy *data, + const char *ciphers12, + const char *ciphers13, + const struct rustls_supported_ciphersuite **selected, + size_t *selected_size) +{ + size_t supported_len = *selected_size; + size_t default_len = rustls_default_crypto_provider_ciphersuites_len(); + const struct rustls_supported_ciphersuite *entry; + const char *ciphers = ciphers12; + size_t count = 0, default13_count = 0, i, j; + const char *ptr, *end; + + DEBUGASSERT(default_len <= supported_len); + + if(!ciphers13) { + /* Add default TLSv1.3 ciphers to selection */ + 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) + continue; + + selected[count++] = entry; + } + + default13_count = count; + + if(!ciphers) + ciphers = ""; + } + else + ciphers = ciphers13; + +add_ciphers: + for(ptr = ciphers; ptr[0] != '\0' && count < supported_len; ptr = end) { + uint16_t id = Curl_cipher_suite_walk_str(&ptr, &end); + + /* Check if cipher is supported */ + if(id) { + for(i = 0; i < supported_len; i++) { + entry = rustls_default_crypto_provider_ciphersuites_get(i); + if(rustls_supported_ciphersuite_get_suite(entry) == id) + break; + } + if(i == supported_len) + id = 0; + } + if(!id) { + if(ptr[0] != '\0') + infof(data, "rustls: unknown cipher in list: \"%.*s\"", + (int) (end - ptr), ptr); + continue; + } + + /* No duplicates allowed (so selected cannot overflow) */ + 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); + continue; + } + + selected[count++] = entry; + } + + if(ciphers == ciphers13 && ciphers12) { + ciphers = ciphers12; + goto add_ciphers; + } + + if(!ciphers12) { + /* Add default TLSv1.2 ciphers to selection */ + 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) + continue; + + /* No duplicates allowed (so selected cannot overflow) */ + for(i = 0; i < count && selected[i] != entry; i++); + if(i < count) + continue; + + selected[count++] = entry; + } + } + + *selected_size = count; } static CURLcode @@ -372,6 +527,8 @@ cr_init_backend(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); + struct rustls_crypto_provider_builder *custom_provider_builder = NULL; + const struct rustls_crypto_provider *custom_provider = NULL; struct rustls_connection *rconn = NULL; struct rustls_client_config_builder *config_builder = NULL; const struct rustls_root_cert_store *roots = NULL; @@ -383,15 +540,113 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, /* CURLOPT_CAINFO_BLOB overrides CURLOPT_CAINFO */ (ca_info_blob ? NULL : conn_config->CAfile); const bool verifypeer = conn_config->verifypeer; - const char *hostname = connssl->peer.hostname; char errorbuf[256]; size_t errorlen; - int result; + rustls_result result; DEBUGASSERT(backend); rconn = backend->conn; - config_builder = rustls_client_config_builder_new(); + { + uint16_t tls_versions[2] = { + RUSTLS_TLS_VERSION_TLSV1_2, + RUSTLS_TLS_VERSION_TLSV1_3, + }; + size_t tls_versions_len = 2; + const struct rustls_supported_ciphersuite **cipher_suites; + size_t cipher_suites_len = + rustls_default_crypto_provider_ciphersuites_len(); + + switch(conn_config->version) { + case CURL_SSLVERSION_DEFAULT: + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + case CURL_SSLVERSION_TLSv1_1: + case CURL_SSLVERSION_TLSv1_2: + break; + case CURL_SSLVERSION_TLSv1_3: + tls_versions[0] = RUSTLS_TLS_VERSION_TLSV1_3; + tls_versions_len = 1; + break; + default: + failf(data, "rustls: unsupported minimum TLS version value"); + return CURLE_BAD_FUNCTION_ARGUMENT; + } + + switch(conn_config->version_max) { + case CURL_SSLVERSION_MAX_DEFAULT: + case CURL_SSLVERSION_MAX_NONE: + case CURL_SSLVERSION_MAX_TLSv1_3: + break; + case CURL_SSLVERSION_MAX_TLSv1_2: + if(tls_versions[0] == RUSTLS_TLS_VERSION_TLSV1_2) { + tls_versions_len = 1; + break; + } + FALLTHROUGH(); + case CURL_SSLVERSION_MAX_TLSv1_1: + case CURL_SSLVERSION_MAX_TLSv1_0: + default: + failf(data, "rustls: unsupported maximum TLS version value"); + return CURLE_BAD_FUNCTION_ARGUMENT; + } + + cipher_suites = malloc(sizeof(cipher_suites) * (cipher_suites_len)); + if(!cipher_suites) + return CURLE_OUT_OF_MEMORY; + + cr_get_selected_ciphers(data, + conn_config->cipher_list, + conn_config->cipher_list13, + cipher_suites, &cipher_suites_len); + if(cipher_suites_len == 0) { + failf(data, "rustls: no supported cipher in list"); + free(cipher_suites); + return CURLE_SSL_CIPHER; + } + + result = rustls_crypto_provider_builder_new_from_default( + &custom_provider_builder); + if(result != RUSTLS_RESULT_OK) { + failf(data, + "rustls: failed to create crypto provider builder from default"); + return CURLE_SSL_CIPHER; + } + + result = + rustls_crypto_provider_builder_set_cipher_suites( + custom_provider_builder, + cipher_suites, + cipher_suites_len); + if(result != RUSTLS_RESULT_OK) { + failf(data, + "rustls: failed to set ciphersuites for crypto provider builder"); + rustls_crypto_provider_builder_free(custom_provider_builder); + return CURLE_SSL_CIPHER; + } + + result = rustls_crypto_provider_builder_build( + custom_provider_builder, &custom_provider); + if(result != RUSTLS_RESULT_OK) { + failf(data, "rustls: failed to build custom crypto provider"); + rustls_crypto_provider_builder_free(custom_provider_builder); + return CURLE_SSL_CIPHER; + } + + result = rustls_client_config_builder_new_custom(custom_provider, + tls_versions, + tls_versions_len, + &config_builder); + free(cipher_suites); + if(result != RUSTLS_RESULT_OK) { + failf(data, "rustls: failed to create client config"); + return CURLE_SSL_CIPHER; + } + } + + rustls_crypto_provider_builder_free(custom_provider_builder); + rustls_crypto_provider_free(custom_provider); + if(connssl->alpn) { struct alpn_proto_buf proto; rustls_slice_bytes alpn[ALPN_ENTRIES_MAX]; @@ -409,20 +664,12 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, if(!verifypeer) { rustls_client_config_builder_dangerous_set_certificate_verifier( config_builder, cr_verify_none); - /* rustls doesn't support IP addresses (as of 0.19.0), and will reject - * connections created with an IP address, even when certificate - * verification is turned off. Set a placeholder hostname and disable - * SNI. */ - if(cr_hostname_is_ip(hostname)) { - rustls_client_config_builder_set_enable_sni(config_builder, false); - hostname = "example.invalid"; - } } else if(ca_info_blob || ssl_cafile) { roots_builder = rustls_root_cert_store_builder_new(); if(ca_info_blob) { - /* Enable strict parsing only if verification isn't disabled. */ + /* Enable strict parsing only if verification is not disabled. */ result = rustls_root_cert_store_builder_add_pem(roots_builder, ca_info_blob->data, ca_info_blob->len, @@ -430,20 +677,18 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, if(result != RUSTLS_RESULT_OK) { failf(data, "rustls: failed to parse trusted certificates from blob"); rustls_root_cert_store_builder_free(roots_builder); - rustls_client_config_free( - rustls_client_config_builder_build(config_builder)); + rustls_client_config_builder_free(config_builder); return CURLE_SSL_CACERT_BADFILE; } } else if(ssl_cafile) { - /* Enable strict parsing only if verification isn't disabled. */ + /* Enable strict parsing only if verification is not disabled. */ result = rustls_root_cert_store_builder_load_roots_from_file( roots_builder, ssl_cafile, verifypeer); if(result != RUSTLS_RESULT_OK) { failf(data, "rustls: failed to load trusted certificates"); rustls_root_cert_store_builder_free(roots_builder); - rustls_client_config_free( - rustls_client_config_builder_build(config_builder)); + rustls_client_config_builder_free(config_builder); return CURLE_SSL_CACERT_BADFILE; } } @@ -451,43 +696,69 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, result = rustls_root_cert_store_builder_build(roots_builder, &roots); rustls_root_cert_store_builder_free(roots_builder); if(result != RUSTLS_RESULT_OK) { - failf(data, "rustls: failed to load trusted certificates"); - rustls_client_config_free( - rustls_client_config_builder_build(config_builder)); + failf(data, "rustls: failed to build trusted root certificate store"); + rustls_client_config_builder_free(config_builder); return CURLE_SSL_CACERT_BADFILE; } verifier_builder = rustls_web_pki_server_cert_verifier_builder_new(roots); + rustls_root_cert_store_free(roots); + + if(conn_config->CRLfile) { + struct dynbuf crl_contents; + Curl_dyn_init(&crl_contents, SIZE_MAX); + if(!read_file_into(conn_config->CRLfile, &crl_contents)) { + failf(data, "rustls: failed to read revocation list file"); + Curl_dyn_free(&crl_contents); + rustls_web_pki_server_cert_verifier_builder_free(verifier_builder); + return CURLE_SSL_CRL_BADFILE; + } + + result = rustls_web_pki_server_cert_verifier_builder_add_crl( + verifier_builder, + Curl_dyn_uptr(&crl_contents), + Curl_dyn_len(&crl_contents)); + Curl_dyn_free(&crl_contents); + if(result != RUSTLS_RESULT_OK) { + failf(data, "rustls: failed to parse revocation list"); + rustls_web_pki_server_cert_verifier_builder_free(verifier_builder); + return CURLE_SSL_CRL_BADFILE; + } + } result = rustls_web_pki_server_cert_verifier_builder_build( verifier_builder, &server_cert_verifier); rustls_web_pki_server_cert_verifier_builder_free(verifier_builder); if(result != RUSTLS_RESULT_OK) { - failf(data, "rustls: failed to load trusted certificates"); + failf(data, "rustls: failed to build certificate verifier"); rustls_server_cert_verifier_free(server_cert_verifier); - rustls_client_config_free( - rustls_client_config_builder_build(config_builder)); + rustls_client_config_builder_free(config_builder); return CURLE_SSL_CACERT_BADFILE; } rustls_client_config_builder_set_server_verifier(config_builder, server_cert_verifier); + rustls_server_cert_verifier_free(server_cert_verifier); } - backend->config = rustls_client_config_builder_build(config_builder); - DEBUGASSERT(rconn == NULL); - { - /* rustls claims to manage ip address hostnames as well here. So, - * if we have an SNI, we use it, otherwise we pass the hostname */ - char *server = connssl->peer.sni? - connssl->peer.sni : connssl->peer.hostname; - result = rustls_client_connection_new(backend->config, server, &rconn); + result = rustls_client_config_builder_build( + config_builder, + &backend->config); + if(result != RUSTLS_RESULT_OK) { + failf(data, "rustls: failed to build client config"); + rustls_client_config_free(backend->config); + return CURLE_SSL_CONNECT_ERROR; } + + DEBUGASSERT(rconn == NULL); + result = rustls_client_connection_new(backend->config, + connssl->peer.hostname, &rconn); if(result != RUSTLS_RESULT_OK) { rustls_error(result, errorbuf, sizeof(errorbuf), &errorlen); failf(data, "rustls_client_connection_new: %.*s", (int)errorlen, errorbuf); return CURLE_COULDNT_CONNECT; } + DEBUGASSERT(rconn); rustls_connection_set_userdata(rconn, backend); backend->conn = rconn; return CURLE_OK; @@ -497,11 +768,12 @@ 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; const uint8_t *protocol = NULL; size_t len = 0; rustls_connection_get_alpn_protocol(rconn, &protocol, &len); - Curl_alpn_set_negotiated(cf, data, protocol, len); + Curl_alpn_set_negotiated(cf, data, connssl, protocol, len); } /* Given an established network connection, do a TLS handshake. @@ -536,9 +808,12 @@ cr_connect_common(struct Curl_cfilter *cf, DEBUGASSERT(backend); - if(ssl_connection_none == connssl->state) { + CURL_TRC_CF(data, cf, "cr_connect_common, state=%d", connssl->state); + *done = FALSE; + if(!backend->conn) { result = cr_init_backend(cf, data, (struct rustls_ssl_backend_data *)connssl->backend); + CURL_TRC_CF(data, cf, "cr_connect_common, init backend -> %d", result); if(result != CURLE_OK) { return result; } @@ -550,25 +825,50 @@ cr_connect_common(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 + * 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)) { - infof(data, "Done handshaking"); - /* Done with the handshake. Set up callbacks to send/receive data. */ - connssl->state = ssl_connection_complete; - + /* Rustls claims it is no longer handshaking *before* it has + * send its FINISHED message off. We attempt to let it write + * one more time. Oh my. + */ cr_set_negotiated_alpn(cf, data, rconn); - + cr_send(cf, data, NULL, 0, &tmperr); + if(tmperr == CURLE_AGAIN) { + connssl->io_need = CURL_SSL_IO_NEED_SEND; + return CURLE_OK; + } + else if(tmperr != CURLE_OK) { + return tmperr; + } + /* REALLY Done with the handshake. */ + { + uint16_t proto = rustls_connection_get_protocol_version(rconn); + uint16_t cipher = rustls_connection_get_negotiated_ciphersuite(rconn); + char buf[64] = ""; + const char *ver = "TLS version unknown"; + if(proto == RUSTLS_TLS_VERSION_TLSV1_3) + ver = "TLSv1.3"; + if(proto == RUSTLS_TLS_VERSION_TLSV1_2) + ver = "TLSv1.2"; + Curl_cipher_suite_get_str(cipher, buf, sizeof(buf), TRUE); + infof(data, "rustls: handshake complete, %s, cipher: %s", + ver, buf); + } + connssl->state = ssl_connection_complete; *done = TRUE; return CURLE_OK; } + connssl->connecting_state = ssl_connect_2; wants_read = rustls_connection_wants_read(rconn); - wants_write = rustls_connection_wants_write(rconn); + wants_write = rustls_connection_wants_write(rconn) || + backend->plain_out_buffered; DEBUGASSERT(wants_read || wants_write); - writefd = wants_write?sockfd:CURL_SOCKET_BAD; - readfd = wants_read?sockfd:CURL_SOCKET_BAD; + writefd = wants_write ? sockfd : CURL_SOCKET_BAD; + readfd = wants_read ? sockfd : CURL_SOCKET_BAD; /* check allowed time left */ timeout_ms = Curl_timeleft(data, NULL, TRUE); @@ -579,34 +879,37 @@ cr_connect_common(struct Curl_cfilter *cf, return CURLE_OPERATION_TIMEDOUT; } - socket_check_timeout = blocking?timeout_ms:0; + socket_check_timeout = blocking ? timeout_ms : 0; - what = Curl_socket_check( - readfd, CURL_SOCKET_BAD, writefd, socket_check_timeout); + what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, + socket_check_timeout); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); return CURLE_SSL_CONNECT_ERROR; } if(blocking && 0 == what) { - failf(data, "rustls connection timeout after %" - CURL_FORMAT_TIMEDIFF_T " ms", socket_check_timeout); + failf(data, "rustls: connection timeout after %" FMT_TIMEDIFF_T " ms", + socket_check_timeout); return CURLE_OPERATION_TIMEDOUT; } if(0 == what) { - infof(data, "Curl_socket_check: %s would block", - wants_read&&wants_write ? "writing and reading" : + CURL_TRC_CF(data, cf, "Curl_socket_check: %s would block", + wants_read && wants_write ? "writing and reading" : wants_write ? "writing" : "reading"); - *done = FALSE; + if(wants_write) + connssl->io_need |= CURL_SSL_IO_NEED_SEND; + if(wants_read) + connssl->io_need |= CURL_SSL_IO_NEED_RECV; return CURLE_OK; } /* socket is readable or writable */ if(wants_write) { - infof(data, "rustls_connection wants us to write_tls."); + CURL_TRC_CF(data, cf, "rustls_connection wants us to write_tls."); cr_send(cf, data, NULL, 0, &tmperr); if(tmperr == CURLE_AGAIN) { - infof(data, "writing would block"); + CURL_TRC_CF(data, cf, "writing would block"); /* fall through */ } else if(tmperr != CURLE_OK) { @@ -615,14 +918,13 @@ cr_connect_common(struct Curl_cfilter *cf, } if(wants_read) { - infof(data, "rustls_connection wants us to read_tls."); - + CURL_TRC_CF(data, cf, "rustls_connection wants us to read_tls."); if(tls_recv_more(cf, data, &tmperr) < 0) { if(tmperr == CURLE_AGAIN) { - infof(data, "reading would block"); + CURL_TRC_CF(data, cf, "reading would block"); /* fall through */ } - else if(tmperr == CURLE_READ_ERROR) { + else if(tmperr == CURLE_RECV_ERROR) { return CURLE_SSL_CONNECT_ERROR; } else { @@ -633,8 +935,8 @@ cr_connect_common(struct Curl_cfilter *cf, } /* We should never fall through the loop. We should return either because - the handshake is done or because we can't read/write without blocking. */ - DEBUGASSERT(false); + the handshake is done or because we cannot read/write without blocking. */ + DEBUGASSERT(FALSE); } static CURLcode @@ -645,37 +947,12 @@ cr_connect_nonblocking(struct Curl_cfilter *cf, } static CURLcode -cr_connect_blocking(struct Curl_cfilter *cf UNUSED_PARAM, - struct Curl_easy *data UNUSED_PARAM) +cr_connect_blocking(struct Curl_cfilter *cf, struct Curl_easy *data) { bool done; /* unused */ return cr_connect_common(cf, data, true, &done); } -static void cr_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) -{ - if(!cf->connected) { - curl_socket_t sock = Curl_conn_cf_get_socket(cf->next, data); - 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; - - (void)data; - DEBUGASSERT(backend); - rconn = backend->conn; - - if(rustls_connection_wants_write(rconn)) { - Curl_pollset_add_out(data, ps, sock); - } - if(rustls_connection_wants_read(rconn)) { - Curl_pollset_add_in(data, ps, sock); - } - } -} - static void * cr_get_internals(struct ssl_connect_data *connssl, CURLINFO info UNUSED_PARAM) @@ -686,24 +963,85 @@ cr_get_internals(struct ssl_connect_data *connssl, return &backend->conn; } +static CURLcode +cr_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct rustls_ssl_backend_data *backend = + (struct rustls_ssl_backend_data *)connssl->backend; + CURLcode result = CURLE_OK; + ssize_t nwritten, nread; + char buf[1024]; + size_t i; + + DEBUGASSERT(backend); + if(!backend->conn || cf->shutdown) { + *done = TRUE; + goto out; + } + + connssl->io_need = CURL_SSL_IO_NEED_NONE; + *done = FALSE; + + if(!backend->sent_shutdown) { + /* do this only once */ + backend->sent_shutdown = TRUE; + if(send_shutdown) { + rustls_connection_send_close_notify(backend->conn); + } + } + + nwritten = cr_send(cf, data, NULL, 0, &result); + if(nwritten < 0) { + if(result == CURLE_AGAIN) { + connssl->io_need = CURL_SSL_IO_NEED_SEND; + result = CURLE_OK; + goto out; + } + DEBUGASSERT(result); + CURL_TRC_CF(data, cf, "shutdown send failed: %d", result); + goto out; + } + + for(i = 0; i < 10; ++i) { + nread = cr_recv(cf, data, buf, (int)sizeof(buf), &result); + if(nread <= 0) + break; + } + + if(nread > 0) { + /* still data coming in? */ + } + else if(nread == 0) { + /* We got the close notify alert and are done. */ + *done = TRUE; + } + else if(result == CURLE_AGAIN) { + connssl->io_need = CURL_SSL_IO_NEED_RECV; + result = CURLE_OK; + } + else { + DEBUGASSERT(result); + CURL_TRC_CF(data, cf, "shutdown, error: %d", result); + } + +out: + cf->shutdown = (result || *done); + return result; +} + static void cr_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; struct rustls_ssl_backend_data *backend = (struct rustls_ssl_backend_data *)connssl->backend; - CURLcode tmperr = CURLE_OK; - ssize_t n = 0; + (void)data; DEBUGASSERT(backend); - if(backend->conn) { - rustls_connection_send_close_notify(backend->conn); - n = cr_send(cf, data, NULL, 0, &tmperr); - if(n < 0) { - failf(data, "rustls: error sending close_notify: %d", tmperr); - } - rustls_connection_free(backend->conn); backend->conn = NULL; } @@ -719,28 +1057,38 @@ static size_t cr_version(char *buffer, size_t size) return msnprintf(buffer, size, "%.*s", (int)ver.len, ver.data); } +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); + return map_error(rresult); +} + const struct Curl_ssl Curl_ssl_rustls = { { CURLSSLBACKEND_RUSTLS, "rustls" }, SSLSUPP_CAINFO_BLOB | /* supports */ - SSLSUPP_TLS13_CIPHERSUITES | - SSLSUPP_HTTPS_PROXY, + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CIPHER_LIST | + SSLSUPP_TLS13_CIPHERSUITES, sizeof(struct rustls_ssl_backend_data), Curl_none_init, /* init */ Curl_none_cleanup, /* cleanup */ cr_version, /* version */ Curl_none_check_cxn, /* check_cxn */ - Curl_none_shutdown, /* shutdown */ + cr_shutdown, /* shutdown */ cr_data_pending, /* data_pending */ - Curl_none_random, /* random */ + cr_random, /* random */ Curl_none_cert_status_request, /* cert_status_request */ cr_connect_blocking, /* connect */ cr_connect_nonblocking, /* connect_nonblocking */ - cr_adjust_pollset, /* adjust_pollset */ + Curl_ssl_adjust_pollset, /* adjust_pollset */ cr_get_internals, /* get_internals */ cr_close, /* close_one */ Curl_none_close_all, /* close_all */ - Curl_none_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -748,9 +1096,9 @@ const struct Curl_ssl Curl_ssl_rustls = { NULL, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ cr_recv, /* recv decrypted data */ cr_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #endif /* USE_RUSTLS */ diff --git a/deps/curl/lib/vtls/schannel.c b/deps/curl/lib/vtls/schannel.c index 8736b9e2..2085f709 100644 --- a/deps/curl/lib/vtls/schannel.c +++ b/deps/curl/lib/vtls/schannel.c @@ -34,7 +34,7 @@ #ifdef USE_SCHANNEL #ifndef USE_WINDOWS_SSPI -# error "Can't compile SCHANNEL support without SSPI." +# error "cannot compile SCHANNEL support without SSPI." #endif #include "schannel.h" @@ -59,6 +59,17 @@ #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 + * Schannel recv decryption. + */ +#ifdef CURL_SCHANNEL_DEV_DEBUG +#define SCH_DEV(x) x +#else +#define SCH_DEV(x) do { } while(0) +#endif + /* ALPN requires version 8.1 of the Windows SDK, which was shipped with Visual Studio 2013, aka _MSC_VER 1800: @@ -171,7 +182,7 @@ schannel_set_ssl_version_min_max(DWORD *enabled_protocols, { 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; + long ssl_version_max = (long)conn_config->version_max; long i = ssl_version; switch(ssl_version_max) { @@ -364,7 +375,7 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, if(!alg) alg = get_alg_id_by_name(startCur); if(alg) - algIds[algCount++] = alg; + algIds[algCount++] = (ALG_ID)alg; else if(!strncmp(startCur, "USE_STRONG_CRYPTO", sizeof("USE_STRONG_CRYPTO") - 1) || !strncmp(startCur, "SCH_USE_STRONG_CRYPTO", @@ -377,7 +388,7 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, startCur++; } schannel_cred->palgSupportedAlgs = algIds; - schannel_cred->cSupportedAlgs = algCount; + schannel_cred->cSupportedAlgs = (DWORD)algCount; return CURLE_OK; } @@ -513,7 +524,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, } if(!ssl_config->auto_client_cert) { - flags &= ~SCH_CRED_USE_DEFAULT_CREDS; + flags &= ~(DWORD)SCH_CRED_USE_DEFAULT_CREDS; flags |= SCH_CRED_NO_DEFAULT_CREDS; infof(data, "schannel: disabled automatic use of client certificate"); } @@ -950,7 +961,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, tls_parameters.pDisabledCrypto = crypto_settings; /* The number of blocked suites */ - tls_parameters.cDisabledCrypto = crypto_settings_idx; + tls_parameters.cDisabledCrypto = (DWORD)crypto_settings_idx; credentials.pTlsParameters = &tls_parameters; credentials.cTlsParameters = 1; @@ -968,7 +979,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, #endif sspi_status = - s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR*)UNISP_NAME, + Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR*)UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &credentials, NULL, NULL, &backend->cred->cred_handle, @@ -976,7 +987,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, } else { /* Pre-Windows 10 1809 or the user set a legacy algorithm list. Although MS - doesn't document it, currently Schannel will not negotiate TLS 1.3 when + does not document it, currently Schannel will not negotiate TLS 1.3 when SCHANNEL_CRED is used. */ ALG_ID algIds[NUM_CIPHERS]; char *ciphers = conn_config->cipher_list; @@ -1015,7 +1026,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, #endif sspi_status = - s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR*)UNISP_NAME, + Curl_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR*)UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &schannel_cred, NULL, NULL, &backend->cred->cred_handle, @@ -1071,7 +1082,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) DEBUGASSERT(backend); DEBUGF(infof(data, "schannel: SSL/TLS connection with %s port %d (step 1/3)", - connssl->peer.hostname, connssl->port)); + connssl->peer.hostname, connssl->peer.port)); if(curlx_verify_windows_version(5, 1, 0, PLATFORM_WINNT, VERSION_LESS_THAN_EQUAL)) { @@ -1083,30 +1094,30 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) #ifdef HAS_ALPN /* ALPN is only supported on Windows 8.1 / Server 2012 R2 and above. - Also it doesn't seem to be supported for Wine, see curl bug #983. */ + Also it does not seem to be supported for WINE, see curl bug #983. */ backend->use_alpn = connssl->alpn && !GetProcAddress(GetModuleHandle(TEXT("ntdll")), "wine_get_version") && curlx_verify_windows_version(6, 3, 0, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL); #else - backend->use_alpn = false; + backend->use_alpn = FALSE; #endif #ifdef _WIN32_WCE #ifdef HAS_MANUAL_VERIFY_API - /* certificate validation on CE doesn't seem to work right; we'll + /* certificate validation on CE does not seem to work right; we will * do it following a more manual process. */ - backend->use_manual_cred_validation = true; + backend->use_manual_cred_validation = TRUE; #else -#error "compiler too old to support requisite manual cert verify for Win CE" +#error "compiler too old to support Windows CE requisite manual cert verify" #endif #else #ifdef HAS_MANUAL_VERIFY_API if(conn_config->CAfile || conn_config->ca_info_blob) { if(curlx_verify_windows_version(6, 1, 0, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL)) { - backend->use_manual_cred_validation = true; + backend->use_manual_cred_validation = TRUE; } else { failf(data, "schannel: this version of Windows is too old to support " @@ -1115,7 +1126,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } } else - backend->use_manual_cred_validation = false; + backend->use_manual_cred_validation = FALSE; #else if(conn_config->CAfile || conn_config->ca_info_blob) { failf(data, "schannel: CA cert support not built in"); @@ -1127,9 +1138,10 @@ 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.sessionid) { + if(ssl_config->primary.cache_session) { Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, (void **)&old_cred, NULL)) { + if(!Curl_ssl_getsessionid(cf, data, &connssl->peer, + (void **)&old_cred, NULL, NULL)) { backend->cred = old_cred; DEBUGF(infof(data, "schannel: reusing existing credential handle")); @@ -1152,7 +1164,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* A hostname associated with the credential is needed by InitializeSecurityContext for SNI and other reasons. */ - snihost = connssl->peer.sni? connssl->peer.sni : connssl->peer.hostname; + snihost = connssl->peer.sni ? connssl->peer.sni : connssl->peer.hostname; backend->cred->sni_hostname = curlx_convert_UTF8_to_tchar(snihost); if(!backend->cred->sni_hostname) return CURLE_OUT_OF_MEMORY; @@ -1240,11 +1252,11 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* Schannel InitializeSecurityContext: https://msdn.microsoft.com/en-us/library/windows/desktop/aa375924.aspx - At the moment we don't pass inbuf unless we're using ALPN since we only - use it for that, and Wine (for which we currently disable ALPN) is giving + At the moment we do not pass inbuf unless we are using ALPN since we only + use it for that, and WINE (for which we currently disable ALPN) is giving us problems with inbuf regardless. https://github.com/curl/curl/issues/983 */ - sspi_status = s_pSecFn->InitializeSecurityContext( + sspi_status = Curl_pSecFn->InitializeSecurityContext( &backend->cred->cred_handle, NULL, backend->cred->sni_hostname, backend->req_flags, 0, 0, (backend->use_alpn ? &inbuf_desc : NULL), @@ -1286,9 +1298,9 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* send initial handshake data which is now stored in output buffer */ written = Curl_conn_cf_send(cf->next, data, - outbuf.pvBuffer, outbuf.cbBuffer, + outbuf.pvBuffer, outbuf.cbBuffer, FALSE, &result); - s_pSecFn->FreeContextBuffer(outbuf.pvBuffer); + Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer); if((result != CURLE_OK) || (outbuf.cbBuffer != (size_t) written)) { failf(data, "schannel: failed to send initial handshake data: " "sent %zd of %lu bytes", written, outbuf.cbBuffer); @@ -1299,10 +1311,10 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) "sent %zd bytes", written)); backend->recv_unrecoverable_err = CURLE_OK; - backend->recv_sspi_close_notify = false; - backend->recv_connection_closed = false; - backend->recv_renegotiating = false; - backend->encdata_is_incomplete = false; + backend->recv_sspi_close_notify = FALSE; + backend->recv_connection_closed = FALSE; + backend->recv_renegotiating = FALSE; + backend->encdata_is_incomplete = FALSE; /* continue to second handshake step */ connssl->connecting_state = ssl_connect_2; @@ -1331,11 +1343,12 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) DEBUGASSERT(backend); - doread = (connssl->connecting_state != ssl_connect_2_writing) ? TRUE : FALSE; + 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)", - connssl->peer.hostname, connssl->port)); + connssl->peer.hostname, connssl->peer.port)); if(!backend->cred || !backend->ctxt) return CURLE_SSL_CONNECT_ERROR; @@ -1353,7 +1366,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* buffer to store previously received and encrypted data */ if(!backend->encdata_buffer) { - backend->encdata_is_incomplete = false; + backend->encdata_is_incomplete = FALSE; backend->encdata_offset = 0; backend->encdata_length = CURL_SCHANNEL_BUFFER_INIT_SIZE; backend->encdata_buffer = malloc(backend->encdata_length); @@ -1392,8 +1405,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) backend->encdata_offset, &result); if(result == CURLE_AGAIN) { - if(connssl->connecting_state != ssl_connect_2_writing) - connssl->connecting_state = ssl_connect_2_reading; + connssl->io_need = CURL_SSL_IO_NEED_RECV; DEBUGF(infof(data, "schannel: failed to receive handshake, " "need more data")); return CURLE_OK; @@ -1406,13 +1418,13 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* increase encrypted data buffer offset */ backend->encdata_offset += nread; - backend->encdata_is_incomplete = false; - DEBUGF(infof(data, "schannel: encrypted data got %zd", nread)); + backend->encdata_is_incomplete = FALSE; + SCH_DEV(infof(data, "schannel: encrypted data got %zd", nread)); } - DEBUGF(infof(data, - "schannel: encrypted data buffer: offset %zu length %zu", - backend->encdata_offset, backend->encdata_length)); + SCH_DEV(infof(data, + "schannel: encrypted data buffer: offset %zu length %zu", + backend->encdata_offset, backend->encdata_length)); /* setup input buffers */ InitSecBuffer(&inbuf[0], SECBUFFER_TOKEN, malloc(backend->encdata_offset), @@ -1435,7 +1447,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) memcpy(inbuf[0].pvBuffer, backend->encdata_buffer, backend->encdata_offset); - sspi_status = s_pSecFn->InitializeSecurityContext( + sspi_status = Curl_pSecFn->InitializeSecurityContext( &backend->cred->cred_handle, &backend->ctxt->ctxt_handle, backend->cred->sni_hostname, backend->req_flags, 0, 0, &inbuf_desc, 0, NULL, @@ -1446,8 +1458,8 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* check if the handshake was incomplete */ if(sspi_status == SEC_E_INCOMPLETE_MESSAGE) { - backend->encdata_is_incomplete = true; - connssl->connecting_state = ssl_connect_2_reading; + 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; @@ -1459,7 +1471,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) if(sspi_status == SEC_I_INCOMPLETE_CREDENTIALS && !(backend->req_flags & ISC_REQ_USE_SUPPLIED_CREDS)) { backend->req_flags |= ISC_REQ_USE_SUPPLIED_CREDS; - connssl->connecting_state = ssl_connect_2_writing; + connssl->io_need = CURL_SSL_IO_NEED_SEND; DEBUGF(infof(data, "schannel: a client certificate has been requested")); return CURLE_OK; @@ -1476,7 +1488,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* send handshake token to server */ written = Curl_conn_cf_send(cf->next, data, outbuf[i].pvBuffer, outbuf[i].cbBuffer, - &result); + FALSE, &result); if((result != CURLE_OK) || (outbuf[i].cbBuffer != (size_t) written)) { failf(data, "schannel: failed to send next handshake data: " @@ -1487,7 +1499,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* free obsolete buffer */ if(outbuf[i].pvBuffer) { - s_pSecFn->FreeContextBuffer(outbuf[i].pvBuffer); + Curl_pSecFn->FreeContextBuffer(outbuf[i].pvBuffer); } } } @@ -1526,11 +1538,11 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* check if there was additional remaining encrypted data */ if(inbuf[1].BufferType == SECBUFFER_EXTRA && inbuf[1].cbBuffer > 0) { - DEBUGF(infof(data, "schannel: encrypted data length: %lu", - inbuf[1].cbBuffer)); + SCH_DEV(infof(data, "schannel: encrypted data length: %lu", + inbuf[1].cbBuffer)); /* There are two cases where we could be getting extra data here: - 1) If we're renegotiating a connection and the handshake is already + 1) If we are renegotiating a connection and the handshake is already complete (from the server perspective), it can encrypted app data (not handshake data) in an extra buffer at this point. 2) (sspi_status == SEC_I_CONTINUE_NEEDED) We are negotiating a @@ -1559,7 +1571,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* check if the handshake needs to be continued */ if(sspi_status == SEC_I_CONTINUE_NEEDED) { - connssl->connecting_state = ssl_connect_2_reading; + connssl->io_need = CURL_SSL_IO_NEED_RECV; return CURLE_OK; } @@ -1569,9 +1581,13 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) DEBUGF(infof(data, "schannel: SSL/TLS handshake complete")); } - pubkey_ptr = Curl_ssl_cf_is_proxy(cf)? - data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]: +#ifndef CURL_DISABLE_PROXY + pubkey_ptr = Curl_ssl_cf_is_proxy(cf) ? + data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#else + pubkey_ptr = data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#endif if(pubkey_ptr) { result = schannel_pkp_pin_peer_pubkey(cf, data, pubkey_ptr); if(result) { @@ -1588,7 +1604,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) #endif /* Verify the hostname manually when certificate verification is disabled, - because in that case Schannel won't verify it. */ + because in that case Schannel will not verify it. */ if(!conn_config->verifypeer && conn_config->verifyhost) return Curl_verify_host(cf, data); @@ -1612,9 +1628,9 @@ traverse_cert_store(const CERT_CONTEXT *context, Read_crt_func func, void *arg) { const CERT_CONTEXT *current_context = NULL; - bool should_continue = true; - bool first = true; - bool reverse_order = false; + bool should_continue = TRUE; + bool first = TRUE; + bool reverse_order = FALSE; while(should_continue && (current_context = CertEnumCertificatesInStore( context->hCertStore, @@ -1625,9 +1641,9 @@ traverse_cert_store(const CERT_CONTEXT *context, Read_crt_func func, by comparing SECPKG_ATTR_REMOTE_CERT_CONTEXT's pbCertContext with the first certificate's pbCertContext. */ if(first && context->pbCertEncoded != current_context->pbCertEncoded) - reverse_order = true; + reverse_order = TRUE; should_continue = func(current_context, reverse_order, arg); - first = false; + first = FALSE; } if(current_context) @@ -1641,7 +1657,7 @@ cert_counter_callback(const CERT_CONTEXT *ccert_context, bool reverse_order, (void)reverse_order; /* unused */ if(valid_cert_encoding(ccert_context)) (*(int *)certs_count)++; - return true; + return TRUE; } struct Adder_args @@ -1670,6 +1686,28 @@ add_cert_to_certinfo(const CERT_CONTEXT *ccert_context, bool reverse_order, return args->result == CURLE_OK; } +static void schannel_session_free(void *sessionid, size_t idsize) +{ + /* this is expected to be called under sessionid lock */ + struct Curl_schannel_cred *cred = sessionid; + + (void)idsize; + if(cred) { + cred->refcount--; + if(cred->refcount == 0) { + Curl_pSecFn->FreeCredentialsHandle(&cred->cred_handle); + curlx_unicodefree(cred->sni_hostname); +#ifdef HAS_CLIENT_CERT_PATH + if(cred->client_cert_store) { + CertCloseStore(cred->client_cert_store, 0); + cred->client_cert_store = NULL; + } +#endif + Curl_safefree(cred); + } + } +} + static CURLcode schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) { @@ -1689,7 +1727,7 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) DEBUGF(infof(data, "schannel: SSL/TLS connection with %s port %d (step 3/3)", - connssl->peer.hostname, connssl->port)); + connssl->peer.hostname, connssl->peer.port)); if(!backend->cred) return CURLE_SSL_CONNECT_ERROR; @@ -1712,7 +1750,7 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) #ifdef HAS_ALPN if(backend->use_alpn) { sspi_status = - s_pSecFn->QueryContextAttributes(&backend->ctxt->ctxt_handle, + Curl_pSecFn->QueryContextAttributes(&backend->ctxt->ctxt_handle, SECPKG_ATTR_APPLICATION_PROTOCOL, &alpn_result); @@ -1725,7 +1763,7 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) SecApplicationProtocolNegotiationStatus_Success) { unsigned char prev_alpn = cf->conn->alpn; - Curl_alpn_set_negotiated(cf, data, alpn_result.ProtocolId, + Curl_alpn_set_negotiated(cf, data, connssl, alpn_result.ProtocolId, alpn_result.ProtocolIdSize); if(backend->recv_renegotiating) { if(prev_alpn != cf->conn->alpn && @@ -1739,51 +1777,29 @@ schannel_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) } else { if(!backend->recv_renegotiating) - Curl_alpn_set_negotiated(cf, data, NULL, 0); + Curl_alpn_set_negotiated(cf, data, connssl, NULL, 0); } } #endif /* save the current session data for possible reuse */ - if(ssl_config->primary.sessionid) { - bool incache; - bool added = FALSE; - struct Curl_schannel_cred *old_cred = NULL; - + if(ssl_config->primary.cache_session) { Curl_ssl_sessionid_lock(data); - incache = !(Curl_ssl_getsessionid(cf, data, (void **)&old_cred, NULL)); - if(incache) { - if(old_cred != backend->cred) { - DEBUGF(infof(data, - "schannel: old credential handle is stale, removing")); - /* we're not taking old_cred ownership here, no refcount++ is needed */ - Curl_ssl_delsessionid(data, (void *)old_cred); - incache = FALSE; - } - } - if(!incache) { - result = Curl_ssl_addsessionid(cf, data, backend->cred, - sizeof(struct Curl_schannel_cred), - &added); - if(result) { - Curl_ssl_sessionid_unlock(data); - failf(data, "schannel: failed to store credential handle"); - return result; - } - else if(added) { - /* this cred session is now also referenced by sessionid cache */ - backend->cred->refcount++; - DEBUGF(infof(data, - "schannel: stored credential handle in session cache")); - } - } + /* Up ref count since call takes ownership */ + backend->cred->refcount++; + result = Curl_ssl_set_sessionid(cf, data, &connssl->peer, NULL, + backend->cred, + sizeof(struct Curl_schannel_cred), + schannel_session_free); Curl_ssl_sessionid_unlock(data); + if(result) + return result; } if(data->set.ssl.certinfo) { int certs_count = 0; sspi_status = - s_pSecFn->QueryContextAttributes(&backend->ctxt->ctxt_handle, + Curl_pSecFn->QueryContextAttributes(&backend->ctxt->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &ccert_context); @@ -1831,7 +1847,7 @@ schannel_connect_common(struct Curl_cfilter *cf, } if(ssl_connect_1 == connssl->connecting_state) { - /* check out how much more time we're allowed */ + /* check out how much more time we are allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { @@ -1845,11 +1861,9 @@ schannel_connect_common(struct Curl_cfilter *cf, return result; } - while(ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { + while(ssl_connect_2 == connssl->connecting_state) { - /* check out how much more time we're allowed */ + /* check out how much more time we are allowed */ timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { @@ -1858,14 +1872,13 @@ schannel_connect_common(struct Curl_cfilter *cf, return CURLE_OPERATION_TIMEDOUT; } - /* if ssl is expecting something, check if it's available. */ - if(connssl->connecting_state == ssl_connect_2_reading - || connssl->connecting_state == ssl_connect_2_writing) { + /* if ssl is expecting something, check if it is available. */ + if(connssl->io_need) { - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state ? sockfd : CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state ? sockfd : CURL_SOCKET_BAD; + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, nonblocking ? 0 : timeout_ms); @@ -1896,10 +1909,7 @@ schannel_connect_common(struct Curl_cfilter *cf, * have a valid fdset to wait on. */ result = schannel_connect_step2(cf, data); - if(result || (nonblocking && - (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state))) + if(result || (nonblocking && (ssl_connect_2 == connssl->connecting_state))) return result; } /* repeat step2 until all transactions are done. */ @@ -1957,7 +1967,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* check if the maximum stream sizes were queried */ if(backend->stream_sizes.cbMaximumMessage == 0) { - sspi_status = s_pSecFn->QueryContextAttributes( + sspi_status = Curl_pSecFn->QueryContextAttributes( &backend->ctxt->ctxt_handle, SECPKG_ATTR_STREAM_SIZES, &backend->stream_sizes); @@ -1996,7 +2006,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, memcpy(outbuf[1].pvBuffer, buf, len); /* https://msdn.microsoft.com/en-us/library/windows/desktop/aa375390.aspx */ - sspi_status = s_pSecFn->EncryptMessage(&backend->ctxt->ctxt_handle, 0, + sspi_status = Curl_pSecFn->EncryptMessage(&backend->ctxt->ctxt_handle, 0, &outbuf_desc, 0); /* check if the message was encrypted */ @@ -2007,10 +2017,10 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, len = outbuf[0].cbBuffer + outbuf[1].cbBuffer + outbuf[2].cbBuffer; /* - It's important to send the full message which includes the header, - encrypted payload, and trailer. Until the client receives all the + it is important to send the full message which includes the header, + encrypted payload, and trailer. Until the client receives all the data a coherent message has not been delivered and the client - can't read any of it. + cannot read any of it. If we wanted to buffer the unwritten encrypted bytes, we would tell the client that all data it has requested to be sent has been @@ -2056,7 +2066,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, this_write = Curl_conn_cf_send(cf->next, data, ptr + written, len - written, - &result); + FALSE, &result); if(result == CURLE_AGAIN) continue; else if(result != CURLE_OK) { @@ -2107,8 +2117,14 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, DEBUGASSERT(backend); /**************************************************************************** - * Don't return or set backend->recv_unrecoverable_err unless in the cleanup. - * The pattern for return error is set *err, optional infof, goto cleanup. + * Do not return or set backend->recv_unrecoverable_err unless in the + * cleanup. The pattern for return error is set *err, optional infof, goto + * cleanup. + * + * 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 + * Schannel recv decryption. * * Our priority is to always return as much decrypted data to the caller as * possible, even if an error occurs. The state of the decrypted buffer must @@ -2116,11 +2132,12 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, * handled in the cleanup. */ - DEBUGF(infof(data, "schannel: client wants to read %zu bytes", len)); + SCH_DEV(infof(data, "schannel: client wants to read %zu bytes", len)); *err = CURLE_OK; if(len && len <= backend->decdata_offset) { - infof(data, "schannel: enough decrypted data is already available"); + SCH_DEV(infof(data, + "schannel: enough decrypted data is already available")); goto cleanup; } else if(backend->recv_unrecoverable_err) { @@ -2133,7 +2150,7 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, infof(data, "schannel: server indicated shutdown in a prior call"); goto cleanup; } - /* It's debatable what to return when !len. Regardless we can't return + /* it is debatable what to return when !len. Regardless we cannot return immediately because there may be data to decrypt (in the case we want to decrypt all encrypted cached data) so handle !len later in cleanup. */ @@ -2158,13 +2175,13 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, backend->encdata_buffer = reallocated_buffer; backend->encdata_length = reallocated_length; size = backend->encdata_length - backend->encdata_offset; - DEBUGF(infof(data, "schannel: encdata_buffer resized %zu", - backend->encdata_length)); + SCH_DEV(infof(data, "schannel: encdata_buffer resized %zu", + backend->encdata_length)); } - DEBUGF(infof(data, - "schannel: encrypted data buffer: offset %zu length %zu", - backend->encdata_offset, backend->encdata_length)); + SCH_DEV(infof(data, + "schannel: encrypted data buffer: offset %zu length %zu", + backend->encdata_offset, backend->encdata_length)); /* read encrypted data from socket */ nread = Curl_conn_cf_recv(cf->next, data, @@ -2174,27 +2191,25 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(*err) { nread = -1; if(*err == CURLE_AGAIN) - DEBUGF(infof(data, - "schannel: recv returned CURLE_AGAIN")); + SCH_DEV(infof(data, "schannel: recv returned CURLE_AGAIN")); else if(*err == CURLE_RECV_ERROR) infof(data, "schannel: recv returned CURLE_RECV_ERROR"); else infof(data, "schannel: recv returned error %d", *err); } else if(nread == 0) { - backend->recv_connection_closed = true; + backend->recv_connection_closed = TRUE; DEBUGF(infof(data, "schannel: server closed the connection")); } else if(nread > 0) { backend->encdata_offset += (size_t)nread; - backend->encdata_is_incomplete = false; - DEBUGF(infof(data, "schannel: encrypted data got %zd", nread)); + backend->encdata_is_incomplete = FALSE; + SCH_DEV(infof(data, "schannel: encrypted data got %zd", nread)); } } - DEBUGF(infof(data, - "schannel: encrypted data buffer: offset %zu length %zu", - backend->encdata_offset, backend->encdata_length)); + SCH_DEV(infof(data, "schannel: encrypted data buffer: offset %zu length %zu", + backend->encdata_offset, backend->encdata_length)); /* decrypt loop */ while(backend->encdata_offset > 0 && sspi_status == SEC_E_OK && @@ -2212,7 +2227,7 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, /* https://msdn.microsoft.com/en-us/library/windows/desktop/aa375348.aspx */ - sspi_status = s_pSecFn->DecryptMessage(&backend->ctxt->ctxt_handle, + sspi_status = Curl_pSecFn->DecryptMessage(&backend->ctxt->ctxt_handle, &inbuf_desc, 0, NULL); /* check if everything went fine (server may want to renegotiate @@ -2222,8 +2237,8 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, /* check for successfully decrypted data, even before actual renegotiation or shutdown of the connection context */ if(inbuf[1].BufferType == SECBUFFER_DATA) { - DEBUGF(infof(data, "schannel: decrypted data length: %lu", - inbuf[1].cbBuffer)); + SCH_DEV(infof(data, "schannel: decrypted data length: %lu", + inbuf[1].cbBuffer)); /* increase buffer in order to fit the received amount of data */ size = inbuf[1].cbBuffer > CURL_SCHANNEL_BUFFER_FREE_SIZE ? @@ -2255,16 +2270,16 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, backend->decdata_offset += size; } - DEBUGF(infof(data, "schannel: decrypted data added: %zu", size)); - DEBUGF(infof(data, - "schannel: decrypted cached: offset %zu length %zu", - backend->decdata_offset, backend->decdata_length)); + SCH_DEV(infof(data, "schannel: decrypted data added: %zu", size)); + SCH_DEV(infof(data, + "schannel: decrypted cached: offset %zu length %zu", + backend->decdata_offset, backend->decdata_length)); } /* check for remaining encrypted data */ if(inbuf[3].BufferType == SECBUFFER_EXTRA && inbuf[3].cbBuffer > 0) { - DEBUGF(infof(data, "schannel: encrypted data length: %lu", - inbuf[3].cbBuffer)); + SCH_DEV(infof(data, "schannel: encrypted data length: %lu", + inbuf[3].cbBuffer)); /* check if the remaining data is less than the total amount * and therefore begins after the already processed data @@ -2278,9 +2293,9 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, backend->encdata_offset = inbuf[3].cbBuffer; } - DEBUGF(infof(data, - "schannel: encrypted cached: offset %zu length %zu", - backend->encdata_offset, backend->encdata_length)); + SCH_DEV(infof(data, + "schannel: encrypted cached: offset %zu length %zu", + backend->encdata_offset, backend->encdata_length)); } else { /* reset encrypted buffer offset, because there is no data remaining */ @@ -2291,17 +2306,18 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(sspi_status == SEC_I_RENEGOTIATE) { infof(data, "schannel: remote party requests renegotiation"); if(*err && *err != CURLE_AGAIN) { - infof(data, "schannel: can't renegotiate, an error is pending"); + infof(data, "schannel: cannot renegotiate, an error is pending"); goto cleanup; } /* begin renegotiation */ infof(data, "schannel: renegotiating SSL/TLS connection"); connssl->state = ssl_connection_negotiating; - connssl->connecting_state = ssl_connect_2_writing; - backend->recv_renegotiating = true; + connssl->connecting_state = ssl_connect_2; + connssl->io_need = CURL_SSL_IO_NEED_SEND; + backend->recv_renegotiating = TRUE; *err = schannel_connect_common(cf, data, FALSE, &done); - backend->recv_renegotiating = false; + backend->recv_renegotiating = FALSE; if(*err) { infof(data, "schannel: renegotiation failed"); goto cleanup; @@ -2315,25 +2331,30 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, else if(sspi_status == SEC_I_CONTEXT_EXPIRED) { /* In Windows 2000 SEC_I_CONTEXT_EXPIRED (close_notify) is not returned so we have to work around that in cleanup. */ - backend->recv_sspi_close_notify = true; + backend->recv_sspi_close_notify = TRUE; if(!backend->recv_connection_closed) - backend->recv_connection_closed = true; + backend->recv_connection_closed = TRUE; + /* We received the close notify just fine, any error we got + * from the lower filters afterwards (e.g. the socket), is not + * an error on the TLS data stream. That one ended here. */ + if(*err == CURLE_RECV_ERROR) + *err = CURLE_OK; infof(data, "schannel: server close notification received (close_notify)"); goto cleanup; } } else if(sspi_status == SEC_E_INCOMPLETE_MESSAGE) { - backend->encdata_is_incomplete = true; + backend->encdata_is_incomplete = TRUE; if(!*err) *err = CURLE_AGAIN; - infof(data, "schannel: failed to decrypt data, need more data"); + SCH_DEV(infof(data, "schannel: failed to decrypt data, need more data")); goto cleanup; } else { #ifndef CURL_DISABLE_VERBOSE_STRINGS char buffer[STRERROR_LEN]; - infof(data, "schannel: failed to read data from server: %s", + failf(data, "schannel: failed to read data from server: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); #endif *err = CURLE_RECV_ERROR; @@ -2341,27 +2362,25 @@ schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, } } - DEBUGF(infof(data, - "schannel: encrypted data buffer: offset %zu length %zu", - backend->encdata_offset, backend->encdata_length)); + SCH_DEV(infof(data, "schannel: encrypted data buffer: offset %zu length %zu", + backend->encdata_offset, backend->encdata_length)); - DEBUGF(infof(data, - "schannel: decrypted data buffer: offset %zu length %zu", - backend->decdata_offset, backend->decdata_length)); + SCH_DEV(infof(data, "schannel: decrypted data buffer: offset %zu length %zu", + backend->decdata_offset, backend->decdata_length)); cleanup: /* Warning- there is no guarantee the encdata state is valid at this point */ - DEBUGF(infof(data, "schannel: schannel_recv cleanup")); + SCH_DEV(infof(data, "schannel: schannel_recv cleanup")); /* Error if the connection has closed without a close_notify. - The behavior here is a matter of debate. We don't want to be vulnerable - to a truncation attack however there's some browser precedent for + The behavior here is a matter of debate. We do not want to be vulnerable + to a truncation attack however there is some browser precedent for ignoring the close_notify for compatibility reasons. Additionally, Windows 2000 (v5.0) is a special case since it seems it - doesn't return close_notify. In that case if the connection was closed we - assume it was graceful (close_notify) since there doesn't seem to be a + does not return close_notify. In that case if the connection was closed we + assume it was graceful (close_notify) since there does not seem to be a way to tell. */ if(len && !backend->decdata_offset && backend->recv_connection_closed && @@ -2370,10 +2389,10 @@ cleanup: VERSION_EQUAL); if(isWin2k && sspi_status == SEC_E_OK) - backend->recv_sspi_close_notify = true; + backend->recv_sspi_close_notify = TRUE; else { *err = CURLE_RECV_ERROR; - infof(data, "schannel: server closed abruptly (missing close_notify)"); + failf(data, "schannel: server closed abruptly (missing close_notify)"); } } @@ -2387,10 +2406,10 @@ cleanup: memmove(backend->decdata_buffer, backend->decdata_buffer + size, backend->decdata_offset - size); backend->decdata_offset -= size; - DEBUGF(infof(data, "schannel: decrypted data returned %zu", size)); - DEBUGF(infof(data, - "schannel: decrypted data buffer: offset %zu length %zu", - backend->decdata_offset, backend->decdata_length)); + SCH_DEV(infof(data, "schannel: decrypted data returned %zu", size)); + SCH_DEV(infof(data, + "schannel: decrypted data buffer: offset %zu length %zu", + backend->decdata_offset, backend->decdata_length)); *err = CURLE_OK; return (ssize_t)size; } @@ -2398,7 +2417,7 @@ cleanup: if(!*err && !backend->recv_connection_closed) *err = CURLE_AGAIN; - /* It's debatable what to return when !len. We could return whatever error + /* it is debatable what to return when !len. We could return whatever error we got from decryption but instead we override here so the return is consistent. */ @@ -2450,32 +2469,12 @@ static bool schannel_data_pending(struct Curl_cfilter *cf, return FALSE; } -static void schannel_session_free(void *ptr) -{ - /* this is expected to be called under sessionid lock */ - struct Curl_schannel_cred *cred = ptr; - - if(cred) { - cred->refcount--; - if(cred->refcount == 0) { - s_pSecFn->FreeCredentialsHandle(&cred->cred_handle); - curlx_unicodefree(cred->sni_hostname); -#ifdef HAS_CLIENT_CERT_PATH - if(cred->client_cert_store) { - CertCloseStore(cred->client_cert_store, 0); - cred->client_cert_store = NULL; - } -#endif - Curl_safefree(cred); - } - } -} - /* shut down the SSL connection and clean up related memory. this function can be called multiple times on the same connection including if the SSL connection failed (eg connection made but failed handshake). */ -static int schannel_shutdown(struct Curl_cfilter *cf, - struct Curl_easy *data) +static CURLcode schannel_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) { /* See https://msdn.microsoft.com/en-us/library/windows/desktop/aa380138.aspx * Shutting Down an Schannel Connection @@ -2483,41 +2482,57 @@ static int schannel_shutdown(struct Curl_cfilter *cf, struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = (struct schannel_ssl_backend_data *)connssl->backend; + CURLcode result = CURLE_OK; + + if(cf->shutdown) { + *done = TRUE; + return CURLE_OK; + } DEBUGASSERT(data); DEBUGASSERT(backend); + /* Not supported in schannel */ + (void)send_shutdown; + + *done = FALSE; if(backend->ctxt) { infof(data, "schannel: shutting down SSL/TLS connection with %s port %d", - connssl->peer.hostname, connssl->port); + connssl->peer.hostname, connssl->peer.port); } - if(backend->cred && backend->ctxt) { + if(!backend->ctxt || cf->shutdown) { + *done = TRUE; + goto out; + } + + if(backend->cred && backend->ctxt && !backend->sent_shutdown) { SecBufferDesc BuffDesc; SecBuffer Buffer; SECURITY_STATUS sspi_status; SecBuffer outbuf; SecBufferDesc outbuf_desc; - CURLcode result; DWORD dwshut = SCHANNEL_SHUTDOWN; InitSecBuffer(&Buffer, SECBUFFER_TOKEN, &dwshut, sizeof(dwshut)); InitSecBufferDesc(&BuffDesc, &Buffer, 1); - sspi_status = s_pSecFn->ApplyControlToken(&backend->ctxt->ctxt_handle, + sspi_status = Curl_pSecFn->ApplyControlToken(&backend->ctxt->ctxt_handle, &BuffDesc); if(sspi_status != SEC_E_OK) { char buffer[STRERROR_LEN]; failf(data, "schannel: ApplyControlToken failure: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); + result = CURLE_SEND_ERROR; + goto out; } /* setup output buffer */ InitSecBuffer(&outbuf, SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&outbuf_desc, &outbuf, 1); - sspi_status = s_pSecFn->InitializeSecurityContext( + sspi_status = Curl_pSecFn->InitializeSecurityContext( &backend->cred->cred_handle, &backend->ctxt->ctxt_handle, backend->cred->sni_hostname, @@ -2535,26 +2550,88 @@ static int schannel_shutdown(struct Curl_cfilter *cf, /* send close message which is in output buffer */ ssize_t written = Curl_conn_cf_send(cf->next, data, outbuf.pvBuffer, outbuf.cbBuffer, - &result); - s_pSecFn->FreeContextBuffer(outbuf.pvBuffer); - if((result != CURLE_OK) || (outbuf.cbBuffer != (size_t) written)) { - infof(data, "schannel: failed to send close msg: %s" - " (bytes written: %zd)", curl_easy_strerror(result), written); + FALSE, &result); + Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer); + if(!result) { + if(written < (ssize_t)outbuf.cbBuffer) { + /* TODO: handle partial sends */ + failf(data, "schannel: failed to send close msg: %s" + " (bytes written: %zd)", curl_easy_strerror(result), written); + result = CURLE_SEND_ERROR; + goto out; + } + backend->sent_shutdown = TRUE; + *done = TRUE; + } + else if(result == CURLE_AGAIN) { + connssl->io_need = CURL_SSL_IO_NEED_SEND; + result = CURLE_OK; + goto out; + } + else { + if(!backend->recv_connection_closed) { + failf(data, "schannel: error sending close msg: %d", result); + result = CURLE_SEND_ERROR; + goto out; + } + /* Looks like server already closed the connection. + * An error to send our close notify is not a failure. */ + *done = TRUE; + result = CURLE_OK; } } } + /* If the connection seems open and we have not seen the close notify + * from the server yet, try to receive it. */ + if(backend->cred && backend->ctxt && + !backend->recv_sspi_close_notify && !backend->recv_connection_closed) { + char buffer[1024]; + ssize_t nread; + + nread = schannel_recv(cf, data, buffer, sizeof(buffer), &result); + if(nread > 0) { + /* still data coming in? */ + } + else if(nread == 0) { + /* We got the close notify alert and are done. */ + backend->recv_connection_closed = TRUE; + *done = TRUE; + } + else if(nread < 0 && result == CURLE_AGAIN) { + connssl->io_need = CURL_SSL_IO_NEED_RECV; + } + else { + CURL_TRC_CF(data, cf, "SSL shutdown, error %d", result); + result = CURLE_RECV_ERROR; + } + } + +out: + cf->shutdown = (result || *done); + return result; +} + +static void schannel_close(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; + + DEBUGASSERT(data); + DEBUGASSERT(backend); + /* free SSPI Schannel API security context handle */ if(backend->ctxt) { DEBUGF(infof(data, "schannel: clear security context handle")); - s_pSecFn->DeleteSecurityContext(&backend->ctxt->ctxt_handle); + Curl_pSecFn->DeleteSecurityContext(&backend->ctxt->ctxt_handle); Curl_safefree(backend->ctxt); } /* free SSPI Schannel API credential handle */ if(backend->cred) { Curl_ssl_sessionid_lock(data); - schannel_session_free(backend->cred); + schannel_session_free(backend->cred, 0); Curl_ssl_sessionid_unlock(data); backend->cred = NULL; } @@ -2564,7 +2641,7 @@ static int schannel_shutdown(struct Curl_cfilter *cf, Curl_safefree(backend->encdata_buffer); backend->encdata_length = 0; backend->encdata_offset = 0; - backend->encdata_is_incomplete = false; + backend->encdata_is_incomplete = FALSE; } /* free internal buffer for received decrypted data */ @@ -2573,13 +2650,6 @@ static int schannel_shutdown(struct Curl_cfilter *cf, backend->decdata_length = 0; backend->decdata_offset = 0; } - - return CURLE_OK; -} - -static void schannel_close(struct Curl_cfilter *cf, struct Curl_easy *data) -{ - schannel_shutdown(cf, data); } static int schannel_init(void) @@ -2594,9 +2664,7 @@ static void schannel_cleanup(void) static size_t schannel_version(char *buffer, size_t size) { - size = msnprintf(buffer, size, "Schannel"); - - return size; + return msnprintf(buffer, size, "Schannel"); } static CURLcode schannel_random(struct Curl_easy *data UNUSED_PARAM, @@ -2621,7 +2689,7 @@ static CURLcode schannel_pkp_pin_peer_pubkey(struct Curl_cfilter *cf, DEBUGASSERT(backend); - /* if a path wasn't specified, don't pin */ + /* if a path was not specified, do not pin */ if(!pinnedpubkey) return CURLE_OK; @@ -2633,7 +2701,7 @@ static CURLcode schannel_pkp_pin_peer_pubkey(struct Curl_cfilter *cf, struct Curl_asn1Element *pubkey; sspi_status = - s_pSecFn->QueryContextAttributes(&backend->ctxt->ctxt_handle, + Curl_pSecFn->QueryContextAttributes(&backend->ctxt->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pCertContextServer); @@ -2683,6 +2751,13 @@ static void schannel_checksum(const unsigned char *input, DWORD provType, const unsigned int algId) { +#ifdef CURL_WINDOWS_UWP + (void)input; + (void)inputlen; + (void)provType; + (void)algId; + memset(checksum, 0, checksumlen); +#else HCRYPTPROV hProv = 0; HCRYPTHASH hHash = 0; DWORD cbHashSize = 0; @@ -2723,6 +2798,7 @@ static void schannel_checksum(const unsigned char *input, if(hProv) CryptReleaseContext(hProv, 0); +#endif } static CURLcode schannel_sha256sum(const unsigned char *input, @@ -2749,9 +2825,9 @@ HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf, const struct Curl_easy *data) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - struct Curl_multi *multi = data->multi_easy ? data->multi_easy : data->multi; + struct Curl_multi *multi = data->multi; const struct curl_blob *ca_info_blob = conn_config->ca_info_blob; - struct schannel_multi_ssl_backend_data *mbackend; + struct schannel_cert_share *share; const struct ssl_general_config *cfg = &data->set.general_ssl; timediff_t timeout_ms; timediff_t elapsed_ms; @@ -2760,12 +2836,14 @@ HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf, DEBUGASSERT(multi); - if(!multi || !multi->ssl_backend_data) { + if(!multi) { return NULL; } - mbackend = (struct schannel_multi_ssl_backend_data *)multi->ssl_backend_data; - if(!mbackend->cert_store) { + share = Curl_hash_pick(&multi->proto_hash, + (void *)MPROTO_SCHANNEL_CERT_SHARE_KEY, + sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1); + if(!share || !share->cert_store) { return NULL; } @@ -2780,37 +2858,47 @@ 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 = Curl_now(); - elapsed_ms = Curl_timediff(now, mbackend->time); + elapsed_ms = Curl_timediff(now, share->time); if(elapsed_ms >= timeout_ms) { return NULL; } } if(ca_info_blob) { - if(!mbackend->CAinfo_blob_digest) { - return NULL; - } - if(mbackend->CAinfo_blob_size != ca_info_blob->len) { + if(share->CAinfo_blob_size != ca_info_blob->len) { return NULL; } schannel_sha256sum((const unsigned char *)ca_info_blob->data, ca_info_blob->len, info_blob_digest, CURL_SHA256_DIGEST_LENGTH); - if(memcmp(mbackend->CAinfo_blob_digest, - info_blob_digest, + if(memcmp(share->CAinfo_blob_digest, info_blob_digest, CURL_SHA256_DIGEST_LENGTH)) { - return NULL; + return NULL; } } else { - if(!conn_config->CAfile || !mbackend->CAfile || - strcmp(mbackend->CAfile, conn_config->CAfile)) { + if(!conn_config->CAfile || !share->CAfile || + strcmp(share->CAfile, conn_config->CAfile)) { return NULL; } } - return mbackend->cert_store; + return share->cert_store; +} + +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(!memcmp(MPROTO_SCHANNEL_CERT_SHARE_KEY, key, key_len)); + (void)key; + (void)key_len; + if(share->cert_store) { + CertCloseStore(share->cert_store, 0); + } + free(share->CAfile); + free(share); } bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, @@ -2818,38 +2906,39 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, HCERTSTORE cert_store) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - struct Curl_multi *multi = data->multi_easy ? data->multi_easy : data->multi; + struct Curl_multi *multi = data->multi; const struct curl_blob *ca_info_blob = conn_config->ca_info_blob; - struct schannel_multi_ssl_backend_data *mbackend; - unsigned char *CAinfo_blob_digest = NULL; + struct schannel_cert_share *share; size_t CAinfo_blob_size = 0; char *CAfile = NULL; DEBUGASSERT(multi); if(!multi) { - return false; + return FALSE; } - if(!multi->ssl_backend_data) { - multi->ssl_backend_data = - calloc(1, sizeof(struct schannel_multi_ssl_backend_data)); - if(!multi->ssl_backend_data) { - return false; + share = Curl_hash_pick(&multi->proto_hash, + (void *)MPROTO_SCHANNEL_CERT_SHARE_KEY, + sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1); + if(!share) { + share = calloc(1, sizeof(*share)); + if(!share) { + return FALSE; + } + if(!Curl_hash_add2(&multi->proto_hash, + (void *)MPROTO_SCHANNEL_CERT_SHARE_KEY, + sizeof(MPROTO_SCHANNEL_CERT_SHARE_KEY)-1, + share, schannel_cert_share_free)) { + free(share); + return FALSE; } } - mbackend = (struct schannel_multi_ssl_backend_data *)multi->ssl_backend_data; - - if(ca_info_blob) { - CAinfo_blob_digest = malloc(CURL_SHA256_DIGEST_LENGTH); - if(!CAinfo_blob_digest) { - return false; - } schannel_sha256sum((const unsigned char *)ca_info_blob->data, ca_info_blob->len, - CAinfo_blob_digest, + share->CAinfo_blob_digest, CURL_SHA256_DIGEST_LENGTH); CAinfo_blob_size = ca_info_blob->len; } @@ -2857,37 +2946,22 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, if(conn_config->CAfile) { CAfile = strdup(conn_config->CAfile); if(!CAfile) { - return false; + return FALSE; } } } /* free old cache data */ - if(mbackend->cert_store) { - CertCloseStore(mbackend->cert_store, 0); + if(share->cert_store) { + CertCloseStore(share->cert_store, 0); } - free(mbackend->CAinfo_blob_digest); - free(mbackend->CAfile); + free(share->CAfile); - mbackend->time = Curl_now(); - mbackend->cert_store = cert_store; - mbackend->CAinfo_blob_digest = CAinfo_blob_digest; - mbackend->CAinfo_blob_size = CAinfo_blob_size; - mbackend->CAfile = CAfile; - return true; -} - -static void schannel_free_multi_ssl_backend_data( - struct multi_ssl_backend_data *msbd) -{ - struct schannel_multi_ssl_backend_data *mbackend = - (struct schannel_multi_ssl_backend_data*)msbd; - if(mbackend->cert_store) { - CertCloseStore(mbackend->cert_store, 0); - } - free(mbackend->CAinfo_blob_digest); - free(mbackend->CAfile); - free(mbackend); + share->time = Curl_now(); + share->cert_store = cert_store; + share->CAinfo_blob_size = CAinfo_blob_size; + share->CAfile = CAfile; + return TRUE; } const struct Curl_ssl Curl_ssl_schannel = { @@ -2897,9 +2971,13 @@ const struct Curl_ssl Curl_ssl_schannel = { #ifdef HAS_MANUAL_VERIFY_API SSLSUPP_CAINFO_BLOB | #endif +#ifndef CURL_WINDOWS_UWP SSLSUPP_PINNEDPUBKEY | +#endif SSLSUPP_TLS13_CIPHERSUITES | - SSLSUPP_HTTPS_PROXY, + SSLSUPP_CA_CACHE | + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CIPHER_LIST, sizeof(struct schannel_ssl_backend_data), @@ -2917,7 +2995,6 @@ const struct Curl_ssl Curl_ssl_schannel = { schannel_get_internals, /* get_internals */ schannel_close, /* close_one */ Curl_none_close_all, /* close_all */ - schannel_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -2925,9 +3002,9 @@ const struct Curl_ssl Curl_ssl_schannel = { schannel_sha256sum, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - schannel_free_multi_ssl_backend_data, /* free_multi_ssl_backend_data */ schannel_recv, /* recv decrypted data */ schannel_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #endif /* USE_SCHANNEL */ diff --git a/deps/curl/lib/vtls/schannel_int.h b/deps/curl/lib/vtls/schannel_int.h index fe7450d4..026a1dba 100644 --- a/deps/curl/lib/vtls/schannel_int.h +++ b/deps/curl/lib/vtls/schannel_int.h @@ -28,7 +28,10 @@ #ifdef USE_SCHANNEL -#if defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN) +#include "vtls.h" + +#if (defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN)) \ + && !defined(CURL_WINDOWS_UWP) #define HAS_MANUAL_VERIFY_API #endif @@ -53,6 +56,16 @@ #define CERT_ALT_NAME_IP_ADDRESS 8 #endif +#if defined(_MSC_VER) && (_MSC_VER <= 1600) +/* Workaround for warning: + 'type cast' : conversion from 'int' to 'LPCSTR' of greater size */ +#undef CERT_STORE_PROV_MEMORY +#undef CERT_STORE_PROV_SYSTEM_A +#undef CERT_STORE_PROV_SYSTEM_W +#define CERT_STORE_PROV_MEMORY ((LPCSTR)(size_t)2) +#define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)(size_t)9) +#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)(size_t)10) +#endif #ifndef SCH_CREDENTIALS_VERSION @@ -134,7 +147,7 @@ struct schannel_ssl_backend_data { size_t encdata_offset, decdata_offset; unsigned char *encdata_buffer, *decdata_buffer; /* encdata_is_incomplete: if encdata contains only a partial record that - can't be decrypted without another recv() (that is, status is + cannot be decrypted without another recv() (that is, status is SEC_E_INCOMPLETE_MESSAGE) then set this true. after an recv() adds more bytes into encdata then set this back to false. */ bool encdata_is_incomplete; @@ -147,10 +160,14 @@ struct schannel_ssl_backend_data { #ifdef HAS_MANUAL_VERIFY_API bool use_manual_cred_validation; /* true if manual cred validation is used */ #endif + BIT(sent_shutdown); }; -struct schannel_multi_ssl_backend_data { - unsigned char *CAinfo_blob_digest; /* CA info blob digest */ +/* key to use at `multi->proto_hash` */ +#define MPROTO_SCHANNEL_CERT_SHARE_KEY "tls:schannel:cert:share" + +struct schannel_cert_share { + unsigned char CAinfo_blob_digest[CURL_SHA256_DIGEST_LENGTH]; size_t CAinfo_blob_size; /* CA info blob size */ char *CAfile; /* CAfile path used to generate certificate store */ diff --git a/deps/curl/lib/vtls/schannel_verify.c b/deps/curl/lib/vtls/schannel_verify.c index 24146d0b..9a166c28 100644 --- a/deps/curl/lib/vtls/schannel_verify.c +++ b/deps/curl/lib/vtls/schannel_verify.c @@ -33,7 +33,7 @@ #ifdef USE_SCHANNEL #ifndef USE_WINDOWS_SSPI -# error "Can't compile SCHANNEL support without SSPI." +# error "cannot compile SCHANNEL support without SSPI." #endif #include "schannel.h" @@ -82,8 +82,8 @@ static int is_cr_or_lf(char c) } /* Search the substring needle,needlelen into string haystack,haystacklen - * Strings don't need to be terminated by a '\0'. - * Similar of OSX/Linux memmem (not available on Visual Studio). + * Strings do not need to be terminated by a '\0'. + * Similar of macOS/Linux memmem (not available on Visual Studio). * Return position of beginning of first occurrence or NULL if not found */ static const char *c_memmem(const void *haystack, size_t haystacklen, @@ -116,7 +116,7 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, const char *current_ca_file_ptr = ca_buffer; const char *ca_buffer_limit = ca_buffer + ca_buffer_size; - while(more_certs && (current_ca_file_ptr length) { - failf(data, "schannel: Not enough memory to list all host names."); + failf(data, "schannel: Not enough memory to list all hostnames."); break; } dns_w = entry->pwszDNSName; - /* pwszDNSName is in ia5 string format and hence doesn't contain any - * non-ascii characters. */ + /* pwszDNSName is in ia5 string format and hence does not contain any + * non-ASCII characters. */ while(*dns_w != '\0') { - *current_pos++ = (char)(*dns_w++); + *current_pos++ = (TCHAR)(*dns_w++); } *current_pos++ = '\0'; actual_length += (DWORD)current_length; @@ -457,6 +463,7 @@ static DWORD cert_get_name_string(struct Curl_easy *data, /* Last string has double null-terminator. */ *current_pos = '\0'; } +#endif return actual_length; } @@ -476,7 +483,7 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, DWORD actual_len = 0; sspi_status = - s_pSecFn->QueryContextAttributes(&BACKEND->ctxt->ctxt_handle, + Curl_pSecFn->QueryContextAttributes(&BACKEND->ctxt->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pCertContextServer); @@ -605,7 +612,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, DEBUGASSERT(BACKEND); sspi_status = - s_pSecFn->QueryContextAttributes(&BACKEND->ctxt->ctxt_handle, + Curl_pSecFn->QueryContextAttributes(&BACKEND->ctxt->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pCertContextServer); diff --git a/deps/curl/lib/vtls/sectransp.c b/deps/curl/lib/vtls/sectransp.c index 67f534c6..022c467f 100644 --- a/deps/curl/lib/vtls/sectransp.c +++ b/deps/curl/lib/vtls/sectransp.c @@ -24,12 +24,14 @@ ***************************************************************************/ /* - * Source file for all iOS and macOS SecureTransport-specific code for the + * Source file for all iOS and macOS Secure Transport-specific code for the * TLS/SSL layer. No code but vtls.c should ever call or use these functions. */ #include "curl_setup.h" +#ifdef USE_SECTRANSP + #include "urldata.h" /* for the Curl_easy definition */ #include "curl_base64.h" #include "strtok.h" @@ -37,19 +39,16 @@ #include "strcase.h" #include "x509asn1.h" #include "strerror.h" - -#ifdef USE_SECTRANSP +#include "cipher_suite.h" #ifdef __clang__ #pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wtautological-pointer-compare" +#pragma clang diagnostic ignored "-Wunreachable-code" #endif /* __clang__ */ #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Waddress" -#pragma GCC diagnostic ignored "-Wundef" -#pragma GCC diagnostic ignored "-Wunreachable-code" #endif #include @@ -72,7 +71,7 @@ #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) #if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 -#error "The Secure Transport back-end requires Leopard or later." +#error "The Secure Transport backend requires Leopard or later." #endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1050 */ #define CURL_BUILD_IOS 0 @@ -122,7 +121,7 @@ #define CURL_SUPPORT_MAC_10_9 0 #else -#error "The Secure Transport back-end requires iOS or macOS." +#error "The Secure Transport backend requires iOS or macOS." #endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */ #if CURL_BUILD_MAC @@ -144,7 +143,8 @@ #include "memdebug.h" -/* From MacTypes.h (which we can't include because it isn't present in iOS: */ +/* From MacTypes.h (which we cannot include because it is not present in + iOS: */ #define ioErr -36 #define paramErr -50 @@ -152,636 +152,60 @@ struct st_ssl_backend_data { SSLContextRef ssl_ctx; bool ssl_direction; /* true if writing, false if reading */ size_t ssl_write_buffered_length; + BIT(sent_shutdown); }; -struct st_cipher { - const char *name; /* Cipher suite IANA name. It starts with "TLS_" prefix */ - const char *alias_name; /* Alias name is the same as OpenSSL cipher name */ - SSLCipherSuite num; /* Cipher suite code/number defined in IANA registry */ - bool weak; /* Flag to mark cipher as weak based on previous implementation - of Secure Transport back-end by CURL */ -}; - -/* Macro to initialize st_cipher data structure: stringify id to name, cipher - number/id, 'weak' suite flag +/* Create the list of default ciphers to use by making an intersection of the + * ciphers supported by Secure Transport and the list below, using the order + * of the former. + * This list is based on TLS recommendations by Mozilla, balancing between + * security and wide compatibility: "Most ciphers that are not clearly broken + * and dangerous to use are supported" */ -#define CIPHER_DEF(num, alias, weak) \ - { #num, alias, num, weak } - -/* - Macro to initialize st_cipher data structure with name, code (IANA cipher - number/id value), and 'weak' suite flag. The first 28 cipher suite numbers - have the same IANA code for both SSL and TLS standards: numbers 0x0000 to - 0x001B. They have different names though. The first 4 letters of the cipher - suite name are the protocol name: "SSL_" or "TLS_", rest of the IANA name is - the same for both SSL and TLS cipher suite name. - The second part of the problem is that macOS/iOS SDKs don't define all TLS - codes but only 12 of them. The SDK defines all SSL codes though, i.e. SSL_NUM - constant is always defined for those 28 ciphers while TLS_NUM is defined only - for 12 of the first 28 ciphers. Those 12 TLS cipher codes match to - corresponding SSL enum value and represent the same cipher suite. Therefore - we'll use the SSL enum value for those cipher suites because it is defined - for all 28 of them. - We make internal data consistent and based on TLS names, i.e. all st_cipher - item names start with the "TLS_" prefix. - Summarizing all the above, those 28 first ciphers are presented in our table - with both TLS and SSL names. Their cipher numbers are assigned based on the - SDK enum value for the SSL cipher, which matches to IANA TLS number. - */ -#define CIPHER_DEF_SSLTLS(num_wo_prefix, alias, weak) \ - { "TLS_" #num_wo_prefix, alias, SSL_##num_wo_prefix, weak } - -/* - Cipher suites were marked as weak based on the following: - RC4 encryption - rfc7465, the document contains a list of deprecated ciphers. - Marked in the code below as weak. - RC2 encryption - many mentions, was found vulnerable to a relatively easy - attack https://link.springer.com/chapter/10.1007%2F3-540-69710-1_14 - Marked in the code below as weak. - DES and IDEA encryption - rfc5469, has a list of deprecated ciphers. - Marked in the code below as weak. - Anonymous Diffie-Hellman authentication and anonymous elliptic curve - Diffie-Hellman - vulnerable to a man-in-the-middle attack. Deprecated by - RFC 4346 aka TLS 1.1 (section A.5, page 60) - Null bulk encryption suites - not encrypted communication - Export ciphers, i.e. ciphers with restrictions to be used outside the US for - software exported to some countries, they were excluded from TLS 1.1 - version. More precisely, they were noted as ciphers which MUST NOT be - negotiated in RFC 4346 aka TLS 1.1 (section A.5, pages 60 and 61). - All of those filters were considered weak because they contain a weak - algorithm like DES, RC2 or RC4, and already considered weak by other - criteria. - 3DES - NIST deprecated it and is going to retire it by 2023 - https://csrc.nist.gov/News/2017/Update-to-Current-Use-and-Deprecation-of-TDEA - OpenSSL https://www.openssl.org/blog/blog/2016/08/24/sweet32/ also - deprecated those ciphers. Some other libraries also consider it - vulnerable or at least not strong enough. - - CBC ciphers are vulnerable with SSL3.0 and TLS1.0: - https://www.cisco.com/c/en/us/support/docs/security/email-security-appliance - /118518-technote-esa-00.html - We don't take care of this issue because it is resolved by later TLS - versions and for us, it requires more complicated checks, we need to - check a protocol version also. Vulnerability doesn't look very critical - and we do not filter out those cipher suites. - */ - -#define CIPHER_WEAK_NOT_ENCRYPTED TRUE -#define CIPHER_WEAK_RC_ENCRYPTION TRUE -#define CIPHER_WEAK_DES_ENCRYPTION TRUE -#define CIPHER_WEAK_IDEA_ENCRYPTION TRUE -#define CIPHER_WEAK_ANON_AUTH TRUE -#define CIPHER_WEAK_3DES_ENCRYPTION TRUE -#define CIPHER_STRONG_ENOUGH FALSE - -/* Please do not change the order of the first ciphers available for SSL. - Do not insert and do not delete any of them. Code below - depends on their order and continuity. - If you add a new cipher, please maintain order by number, i.e. - insert in between existing items to appropriate place based on - cipher suite IANA number -*/ -static const struct st_cipher ciphertable[] = { - /* SSL version 3.0 and initial TLS 1.0 cipher suites. - Defined since SDK 10.2.8 */ - CIPHER_DEF_SSLTLS(NULL_WITH_NULL_NULL, /* 0x0000 */ - NULL, - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF_SSLTLS(RSA_WITH_NULL_MD5, /* 0x0001 */ - "NULL-MD5", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF_SSLTLS(RSA_WITH_NULL_SHA, /* 0x0002 */ - "NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF_SSLTLS(RSA_EXPORT_WITH_RC4_40_MD5, /* 0x0003 */ - "EXP-RC4-MD5", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_WITH_RC4_128_MD5, /* 0x0004 */ - "RC4-MD5", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_WITH_RC4_128_SHA, /* 0x0005 */ - "RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_EXPORT_WITH_RC2_CBC_40_MD5, /* 0x0006 */ - "EXP-RC2-CBC-MD5", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_WITH_IDEA_CBC_SHA, /* 0x0007 */ - "IDEA-CBC-SHA", - CIPHER_WEAK_IDEA_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_EXPORT_WITH_DES40_CBC_SHA, /* 0x0008 */ - "EXP-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_WITH_DES_CBC_SHA, /* 0x0009 */ - "DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(RSA_WITH_3DES_EDE_CBC_SHA, /* 0x000A */ - "DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_DSS_EXPORT_WITH_DES40_CBC_SHA, /* 0x000B */ - "EXP-DH-DSS-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_DSS_WITH_DES_CBC_SHA, /* 0x000C */ - "DH-DSS-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_DSS_WITH_3DES_EDE_CBC_SHA, /* 0x000D */ - "DH-DSS-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_RSA_EXPORT_WITH_DES40_CBC_SHA, /* 0x000E */ - "EXP-DH-RSA-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_RSA_WITH_DES_CBC_SHA, /* 0x000F */ - "DH-RSA-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_RSA_WITH_3DES_EDE_CBC_SHA, /* 0x0010 */ - "DH-RSA-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, /* 0x0011 */ - "EXP-EDH-DSS-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DHE_DSS_WITH_DES_CBC_SHA, /* 0x0012 */ - "EDH-DSS-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DHE_DSS_WITH_3DES_EDE_CBC_SHA, /* 0x0013 */ - "DHE-DSS-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, /* 0x0014 */ - "EXP-EDH-RSA-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DHE_RSA_WITH_DES_CBC_SHA, /* 0x0015 */ - "EDH-RSA-DES-CBC-SHA", - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DHE_RSA_WITH_3DES_EDE_CBC_SHA, /* 0x0016 */ - "DHE-RSA-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF_SSLTLS(DH_anon_EXPORT_WITH_RC4_40_MD5, /* 0x0017 */ - "EXP-ADH-RC4-MD5", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF_SSLTLS(DH_anon_WITH_RC4_128_MD5, /* 0x0018 */ - "ADH-RC4-MD5", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF_SSLTLS(DH_anon_EXPORT_WITH_DES40_CBC_SHA, /* 0x0019 */ - "EXP-ADH-DES-CBC-SHA", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF_SSLTLS(DH_anon_WITH_DES_CBC_SHA, /* 0x001A */ - "ADH-DES-CBC-SHA", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF_SSLTLS(DH_anon_WITH_3DES_EDE_CBC_SHA, /* 0x001B */ - "ADH-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(SSL_FORTEZZA_DMS_WITH_NULL_SHA, /* 0x001C */ - NULL, - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA, /* 0x001D */ - NULL, - CIPHER_STRONG_ENOUGH), - -#if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 - /* RFC 4785 - Pre-Shared Key (PSK) Ciphersuites with NULL Encryption */ - CIPHER_DEF(TLS_PSK_WITH_NULL_SHA, /* 0x002C */ - "PSK-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_DHE_PSK_WITH_NULL_SHA, /* 0x002D */ - "DHE-PSK-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_RSA_PSK_WITH_NULL_SHA, /* 0x002E */ - "RSA-PSK-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), -#endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ - - /* TLS addenda using AES, per RFC 3268. Defined since SDK 10.4u */ - CIPHER_DEF(TLS_RSA_WITH_AES_128_CBC_SHA, /* 0x002F */ - "AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_DSS_WITH_AES_128_CBC_SHA, /* 0x0030 */ - "DH-DSS-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_RSA_WITH_AES_128_CBC_SHA, /* 0x0031 */ - "DH-RSA-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_DSS_WITH_AES_128_CBC_SHA, /* 0x0032 */ - "DHE-DSS-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_RSA_WITH_AES_128_CBC_SHA, /* 0x0033 */ - "DHE-RSA-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_anon_WITH_AES_128_CBC_SHA, /* 0x0034 */ - "ADH-AES128-SHA", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF(TLS_RSA_WITH_AES_256_CBC_SHA, /* 0x0035 */ - "AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_DSS_WITH_AES_256_CBC_SHA, /* 0x0036 */ - "DH-DSS-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_RSA_WITH_AES_256_CBC_SHA, /* 0x0037 */ - "DH-RSA-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_DSS_WITH_AES_256_CBC_SHA, /* 0x0038 */ - "DHE-DSS-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_RSA_WITH_AES_256_CBC_SHA, /* 0x0039 */ - "DHE-RSA-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_anon_WITH_AES_256_CBC_SHA, /* 0x003A */ - "ADH-AES256-SHA", - CIPHER_WEAK_ANON_AUTH), - -#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - /* TLS 1.2 addenda, RFC 5246 */ - /* Server provided RSA certificate for key exchange. */ - CIPHER_DEF(TLS_RSA_WITH_NULL_SHA256, /* 0x003B */ - "NULL-SHA256", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_RSA_WITH_AES_128_CBC_SHA256, /* 0x003C */ - "AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_WITH_AES_256_CBC_SHA256, /* 0x003D */ - "AES256-SHA256", - CIPHER_STRONG_ENOUGH), - /* Server-authenticated (and optionally client-authenticated) - Diffie-Hellman. */ - CIPHER_DEF(TLS_DH_DSS_WITH_AES_128_CBC_SHA256, /* 0x003E */ - "DH-DSS-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_RSA_WITH_AES_128_CBC_SHA256, /* 0x003F */ - "DH-RSA-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, /* 0x0040 */ - "DHE-DSS-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - - /* TLS 1.2 addenda, RFC 5246 */ - CIPHER_DEF(TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, /* 0x0067 */ - "DHE-RSA-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_DSS_WITH_AES_256_CBC_SHA256, /* 0x0068 */ - "DH-DSS-AES256-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_RSA_WITH_AES_256_CBC_SHA256, /* 0x0069 */ - "DH-RSA-AES256-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, /* 0x006A */ - "DHE-DSS-AES256-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, /* 0x006B */ - "DHE-RSA-AES256-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_anon_WITH_AES_128_CBC_SHA256, /* 0x006C */ - "ADH-AES128-SHA256", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF(TLS_DH_anon_WITH_AES_256_CBC_SHA256, /* 0x006D */ - "ADH-AES256-SHA256", - CIPHER_WEAK_ANON_AUTH), -#endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ - -#if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 - /* Addendum from RFC 4279, TLS PSK */ - CIPHER_DEF(TLS_PSK_WITH_RC4_128_SHA, /* 0x008A */ - "PSK-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_PSK_WITH_3DES_EDE_CBC_SHA, /* 0x008B */ - "PSK-3DES-EDE-CBC-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_PSK_WITH_AES_128_CBC_SHA, /* 0x008C */ - "PSK-AES128-CBC-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_PSK_WITH_AES_256_CBC_SHA, /* 0x008D */ - "PSK-AES256-CBC-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_PSK_WITH_RC4_128_SHA, /* 0x008E */ - "DHE-PSK-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, /* 0x008F */ - "DHE-PSK-3DES-EDE-CBC-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_DHE_PSK_WITH_AES_128_CBC_SHA, /* 0x0090 */ - "DHE-PSK-AES128-CBC-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_PSK_WITH_AES_256_CBC_SHA, /* 0x0091 */ - "DHE-PSK-AES256-CBC-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_PSK_WITH_RC4_128_SHA, /* 0x0092 */ - "RSA-PSK-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, /* 0x0093 */ - "RSA-PSK-3DES-EDE-CBC-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_RSA_PSK_WITH_AES_128_CBC_SHA, /* 0x0094 */ - "RSA-PSK-AES128-CBC-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_PSK_WITH_AES_256_CBC_SHA, /* 0x0095 */ - "RSA-PSK-AES256-CBC-SHA", - CIPHER_STRONG_ENOUGH), -#endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ - -#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - /* Addenda from rfc 5288 AES Galois Counter Mode (GCM) Cipher Suites - for TLS. */ - CIPHER_DEF(TLS_RSA_WITH_AES_128_GCM_SHA256, /* 0x009C */ - "AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_WITH_AES_256_GCM_SHA384, /* 0x009D */ - "AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, /* 0x009E */ - "DHE-RSA-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, /* 0x009F */ - "DHE-RSA-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_RSA_WITH_AES_128_GCM_SHA256, /* 0x00A0 */ - "DH-RSA-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_RSA_WITH_AES_256_GCM_SHA384, /* 0x00A1 */ - "DH-RSA-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, /* 0x00A2 */ - "DHE-DSS-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, /* 0x00A3 */ - "DHE-DSS-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_DSS_WITH_AES_128_GCM_SHA256, /* 0x00A4 */ - "DH-DSS-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_DSS_WITH_AES_256_GCM_SHA384, /* 0x00A5 */ - "DH-DSS-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DH_anon_WITH_AES_128_GCM_SHA256, /* 0x00A6 */ - "ADH-AES128-GCM-SHA256", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF(TLS_DH_anon_WITH_AES_256_GCM_SHA384, /* 0x00A7 */ - "ADH-AES256-GCM-SHA384", - CIPHER_WEAK_ANON_AUTH), -#endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ - -#if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 - /* RFC 5487 - PSK with SHA-256/384 and AES GCM */ - CIPHER_DEF(TLS_PSK_WITH_AES_128_GCM_SHA256, /* 0x00A8 */ - "PSK-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_PSK_WITH_AES_256_GCM_SHA384, /* 0x00A9 */ - "PSK-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, /* 0x00AA */ - "DHE-PSK-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_PSK_WITH_AES_256_GCM_SHA384, /* 0x00AB */ - "DHE-PSK-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, /* 0x00AC */ - "RSA-PSK-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, /* 0x00AD */ - "RSA-PSK-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_PSK_WITH_AES_128_CBC_SHA256, /* 0x00AE */ - "PSK-AES128-CBC-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_PSK_WITH_AES_256_CBC_SHA384, /* 0x00AF */ - "PSK-AES256-CBC-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_PSK_WITH_NULL_SHA256, /* 0x00B0 */ - "PSK-NULL-SHA256", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_PSK_WITH_NULL_SHA384, /* 0x00B1 */ - "PSK-NULL-SHA384", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, /* 0x00B2 */ - "DHE-PSK-AES128-CBC-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, /* 0x00B3 */ - "DHE-PSK-AES256-CBC-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_DHE_PSK_WITH_NULL_SHA256, /* 0x00B4 */ - "DHE-PSK-NULL-SHA256", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_DHE_PSK_WITH_NULL_SHA384, /* 0x00B5 */ - "DHE-PSK-NULL-SHA384", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, /* 0x00B6 */ - "RSA-PSK-AES128-CBC-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, /* 0x00B7 */ - "RSA-PSK-AES256-CBC-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_RSA_PSK_WITH_NULL_SHA256, /* 0x00B8 */ - "RSA-PSK-NULL-SHA256", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_RSA_PSK_WITH_NULL_SHA384, /* 0x00B9 */ - "RSA-PSK-NULL-SHA384", - CIPHER_WEAK_NOT_ENCRYPTED), -#endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ - - /* RFC 5746 - Secure Renegotiation. This is not a real suite, - it is a response to initiate negotiation again */ - CIPHER_DEF(TLS_EMPTY_RENEGOTIATION_INFO_SCSV, /* 0x00FF */ - NULL, - CIPHER_STRONG_ENOUGH), - -#if CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 - /* TLS 1.3 standard cipher suites for ChaCha20+Poly1305. - Note: TLS 1.3 ciphersuites do not specify the key exchange - algorithm -- they only specify the symmetric ciphers. - Cipher alias name matches to OpenSSL cipher name, and for - TLS 1.3 ciphers */ - CIPHER_DEF(TLS_AES_128_GCM_SHA256, /* 0x1301 */ - NULL, /* The OpenSSL cipher name matches to the IANA name */ - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_AES_256_GCM_SHA384, /* 0x1302 */ - NULL, /* The OpenSSL cipher name matches to the IANA name */ - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_CHACHA20_POLY1305_SHA256, /* 0x1303 */ - NULL, /* The OpenSSL cipher name matches to the IANA name */ - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_AES_128_CCM_SHA256, /* 0x1304 */ - NULL, /* The OpenSSL cipher name matches to the IANA name */ - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_AES_128_CCM_8_SHA256, /* 0x1305 */ - NULL, /* The OpenSSL cipher name matches to the IANA name */ - CIPHER_STRONG_ENOUGH), -#endif /* CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 */ +static const uint16_t default_ciphers[] = { + TLS_RSA_WITH_3DES_EDE_CBC_SHA, /* 0x000A */ + TLS_RSA_WITH_AES_128_CBC_SHA, /* 0x002F */ + TLS_RSA_WITH_AES_256_CBC_SHA, /* 0x0035 */ #if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS - /* ECDSA addenda, RFC 4492 */ - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_NULL_SHA, /* 0xC001 */ - "ECDH-ECDSA-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_RC4_128_SHA, /* 0xC002 */ - "ECDH-ECDSA-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, /* 0xC003 */ - "ECDH-ECDSA-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC004 */ - "ECDH-ECDSA-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC005 */ - "ECDH-ECDSA-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_NULL_SHA, /* 0xC006 */ - "ECDHE-ECDSA-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, /* 0xC007 */ - "ECDHE-ECDSA-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, /* 0xC008 */ - "ECDHE-ECDSA-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC009 */ - "ECDHE-ECDSA-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC00A */ - "ECDHE-ECDSA-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_RSA_WITH_NULL_SHA, /* 0xC00B */ - "ECDH-RSA-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_ECDH_RSA_WITH_RC4_128_SHA, /* 0xC00C */ - "ECDH-RSA-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, /* 0xC00D */ - "ECDH-RSA-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, /* 0xC00E */ - "ECDH-RSA-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, /* 0xC00F */ - "ECDH-RSA-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_NULL_SHA, /* 0xC010 */ - "ECDHE-RSA-NULL-SHA", - CIPHER_WEAK_NOT_ENCRYPTED), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_RC4_128_SHA, /* 0xC011 */ - "ECDHE-RSA-RC4-SHA", - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, /* 0xC012 */ - "ECDHE-RSA-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, /* 0xC013 */ - "ECDHE-RSA-AES128-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, /* 0xC014 */ - "ECDHE-RSA-AES256-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_anon_WITH_NULL_SHA, /* 0xC015 */ - "AECDH-NULL-SHA", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF(TLS_ECDH_anon_WITH_RC4_128_SHA, /* 0xC016 */ - "AECDH-RC4-SHA", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF(TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, /* 0xC017 */ - "AECDH-DES-CBC3-SHA", - CIPHER_WEAK_3DES_ENCRYPTION), - CIPHER_DEF(TLS_ECDH_anon_WITH_AES_128_CBC_SHA, /* 0xC018 */ - "AECDH-AES128-SHA", - CIPHER_WEAK_ANON_AUTH), - CIPHER_DEF(TLS_ECDH_anon_WITH_AES_256_CBC_SHA, /* 0xC019 */ - "AECDH-AES256-SHA", - CIPHER_WEAK_ANON_AUTH), + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, /* 0xC009 */ + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, /* 0xC00A */ + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, /* 0xC013 */ + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, /* 0xC014 */ #endif /* CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS */ #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - /* Addenda from rfc 5289 Elliptic Curve Cipher Suites with - HMAC SHA-256/384. */ - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC023 */ - "ECDHE-ECDSA-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC024 */ - "ECDHE-ECDSA-AES256-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC025 */ - "ECDH-ECDSA-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC026 */ - "ECDH-ECDSA-AES256-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, /* 0xC027 */ - "ECDHE-RSA-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, /* 0xC028 */ - "ECDHE-RSA-AES256-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, /* 0xC029 */ - "ECDH-RSA-AES128-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, /* 0xC02A */ - "ECDH-RSA-AES256-SHA384", - CIPHER_STRONG_ENOUGH), - /* Addenda from rfc 5289 Elliptic Curve Cipher Suites with - SHA-256/384 and AES Galois Counter Mode (GCM) */ - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02B */ - "ECDHE-ECDSA-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02C */ - "ECDHE-ECDSA-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02D */ - "ECDH-ECDSA-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02E */ - "ECDH-ECDSA-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, /* 0xC02F */ - "ECDHE-RSA-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, /* 0xC030 */ - "ECDHE-RSA-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, /* 0xC031 */ - "ECDH-RSA-AES128-GCM-SHA256", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, /* 0xC032 */ - "ECDH-RSA-AES256-GCM-SHA384", - CIPHER_STRONG_ENOUGH), + TLS_RSA_WITH_AES_128_CBC_SHA256, /* 0x003C */ + TLS_RSA_WITH_AES_256_CBC_SHA256, /* 0x003D */ + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, /* 0x0067 */ + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, /* 0x006B */ + TLS_RSA_WITH_AES_128_GCM_SHA256, /* 0x009C */ + TLS_RSA_WITH_AES_256_GCM_SHA384, /* 0x009D */ + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, /* 0x009E */ + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, /* 0x009F */ + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, /* 0xC023 */ + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, /* 0xC024 */ + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, /* 0xC027 */ + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, /* 0xC028 */ + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, /* 0xC02B */ + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, /* 0xC02C */ + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, /* 0xC02F */ + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, /* 0xC030 */ #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ -#if CURL_BUILD_MAC_10_15 || CURL_BUILD_IOS_13 - /* ECDHE_PSK Cipher Suites for Transport Layer Security (TLS), RFC 5489 */ - CIPHER_DEF(TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, /* 0xC035 */ - "ECDHE-PSK-AES128-CBC-SHA", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, /* 0xC036 */ - "ECDHE-PSK-AES256-CBC-SHA", - CIPHER_STRONG_ENOUGH), -#endif /* CURL_BUILD_MAC_10_15 || CURL_BUILD_IOS_13 */ - #if CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 - /* Addenda from rfc 7905 ChaCha20-Poly1305 Cipher Suites for - Transport Layer Security (TLS). */ - CIPHER_DEF(TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA8 */ - "ECDHE-RSA-CHACHA20-POLY1305", - CIPHER_STRONG_ENOUGH), - CIPHER_DEF(TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA9 */ - "ECDHE-ECDSA-CHACHA20-POLY1305", - CIPHER_STRONG_ENOUGH), + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA8 */ + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCA9 */ + + /* TLSv1.3 is not supported by Secure Transport, but there is also other + * code referencing TLSv1.3, like: kTLSProtocol13 ? */ + TLS_AES_128_GCM_SHA256, /* 0x1301 */ + TLS_AES_256_GCM_SHA384, /* 0x1302 */ + TLS_CHACHA20_POLY1305_SHA256, /* 0x1303 */ #endif /* CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 */ - -#if CURL_BUILD_MAC_10_15 || CURL_BUILD_IOS_13 - /* ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS), - RFC 7905 */ - CIPHER_DEF(TLS_PSK_WITH_CHACHA20_POLY1305_SHA256, /* 0xCCAB */ - "PSK-CHACHA20-POLY1305", - CIPHER_STRONG_ENOUGH), -#endif /* CURL_BUILD_MAC_10_15 || CURL_BUILD_IOS_13 */ - - /* Tags for SSL 2 cipher kinds which are not specified for SSL 3. - Defined since SDK 10.2.8 */ - CIPHER_DEF(SSL_RSA_WITH_RC2_CBC_MD5, /* 0xFF80 */ - NULL, - CIPHER_WEAK_RC_ENCRYPTION), - CIPHER_DEF(SSL_RSA_WITH_IDEA_CBC_MD5, /* 0xFF81 */ - NULL, - CIPHER_WEAK_IDEA_ENCRYPTION), - CIPHER_DEF(SSL_RSA_WITH_DES_CBC_MD5, /* 0xFF82 */ - NULL, - CIPHER_WEAK_DES_ENCRYPTION), - CIPHER_DEF(SSL_RSA_WITH_3DES_EDE_CBC_MD5, /* 0xFF83 */ - NULL, - CIPHER_WEAK_3DES_ENCRYPTION), }; -#define NUM_OF_CIPHERS sizeof(ciphertable)/sizeof(ciphertable[0]) +#define DEFAULT_CIPHERS_LEN sizeof(default_ciphers)/sizeof(default_ciphers[0]) /* pinned public key support tests */ @@ -792,7 +216,7 @@ static const struct st_cipher ciphertable[] = { #define SECTRANSP_PINNEDPUBKEY_V1 1 #endif -/* version 2 supports MacOSX 10.7+ */ +/* version 2 supports macOS 10.7+ */ #if (!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) #define SECTRANSP_PINNEDPUBKEY_V2 1 #endif @@ -816,7 +240,7 @@ static const unsigned char rsa2048SpkiHeader[] = { 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00}; #ifdef SECTRANSP_PINNEDPUBKEY_V1 -/* the *new* version doesn't return DER encoded ecdsa certs like the old... */ +/* the *new* version does not return DER encoded ecdsa certs like the old... */ static const unsigned char ecDsaSecp256r1SpkiHeader[] = { 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, @@ -854,7 +278,7 @@ static OSStatus sectransp_bio_cf_in_read(SSLConnectionRef connection, case CURLE_OK: case CURLE_AGAIN: rtn = errSSLWouldBlock; - backend->ssl_direction = false; + backend->ssl_direction = FALSE; break; default: rtn = ioErr; @@ -886,13 +310,14 @@ static OSStatus sectransp_bio_cf_out_write(SSLConnectionRef connection, OSStatus rtn = noErr; DEBUGASSERT(data); - nwritten = Curl_conn_cf_send(cf->next, data, buf, *dataLength, &result); + nwritten = Curl_conn_cf_send(cf->next, data, buf, *dataLength, FALSE, + &result); CURL_TRC_CF(data, cf, "bio_send(len=%zu) -> %zd, result=%d", *dataLength, nwritten, result); if(nwritten <= 0) { if(result == CURLE_AGAIN) { rtn = errSSLWouldBlock; - backend->ssl_direction = true; + backend->ssl_direction = TRUE; } else { rtn = ioErr; @@ -906,25 +331,6 @@ static OSStatus sectransp_bio_cf_out_write(SSLConnectionRef connection, return rtn; } -CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher) -{ - /* The first ciphers in the ciphertable are continuous. Here we do small - optimization and instead of loop directly get SSL name by cipher number. - */ - size_t i; - if(cipher <= SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA) { - return ciphertable[cipher].name; - } - /* Iterate through the rest of the ciphers */ - for(i = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA + 1; i < NUM_OF_CIPHERS; - ++i) { - if(ciphertable[i].num == cipher) { - return ciphertable[i].name; - } - } - return ciphertable[SSL_NULL_WITH_NULL_NULL].name; -} - #if CURL_BUILD_MAC CF_INLINE void GetDarwinVersionNumber(int *major, int *minor) { @@ -957,27 +363,27 @@ CF_INLINE void GetDarwinVersionNumber(int *major, int *minor) #endif /* CURL_BUILD_MAC */ /* Apple provides a myriad of ways of getting information about a certificate - into a string. Some aren't available under iOS or newer cats. So here's - a unified function for getting a string describing the certificate that - ought to work in all cats starting with Leopard. */ + into a string. Some are not available under iOS or newer cats. Here's a + unified function for getting a string describing the certificate that ought + to work in all cats starting with Leopard. */ CF_INLINE CFStringRef getsubject(SecCertificateRef cert) { CFStringRef server_cert_summary = CFSTR("(null)"); #if CURL_BUILD_IOS - /* iOS: There's only one way to do this. */ + /* iOS: There is only one way to do this. */ server_cert_summary = SecCertificateCopySubjectSummary(cert); #else #if CURL_BUILD_MAC_10_7 /* Lion & later: Get the long description if we can. */ - if(SecCertificateCopyLongDescription) + if(&SecCertificateCopyLongDescription) server_cert_summary = SecCertificateCopyLongDescription(NULL, cert, NULL); else #endif /* CURL_BUILD_MAC_10_7 */ #if CURL_BUILD_MAC_10_6 /* Snow Leopard: Get the certificate summary. */ - if(SecCertificateCopySubjectSummary) + if(&SecCertificateCopySubjectSummary) server_cert_summary = SecCertificateCopySubjectSummary(cert); else #endif /* CURL_BUILD_MAC_10_6 */ @@ -1015,7 +421,7 @@ static CURLcode CopyCertSubject(struct Curl_easy *data, size_t cbuf_size = ((size_t)CFStringGetLength(c) * 4) + 1; cbuf = calloc(1, cbuf_size); if(cbuf) { - if(!CFStringGetCString(c, cbuf, cbuf_size, + if(!CFStringGetCString(c, cbuf, (CFIndex)cbuf_size, kCFStringEncodingUTF8)) { failf(data, "SSL: invalid CA certificate subject"); result = CURLE_PEER_FAILED_VERIFICATION; @@ -1025,7 +431,7 @@ static CURLcode CopyCertSubject(struct Curl_easy *data, *certp = cbuf; } else { - failf(data, "SSL: couldn't allocate %zu bytes of memory", cbuf_size); + failf(data, "SSL: could not allocate %zu bytes of memory", cbuf_size); result = CURLE_OUT_OF_MEMORY; } } @@ -1037,7 +443,7 @@ static CURLcode CopyCertSubject(struct Curl_easy *data, #if CURL_SUPPORT_MAC_10_6 /* The SecKeychainSearch API was deprecated in Lion, and using it will raise - deprecation warnings, so let's not compile this unless it's necessary: */ + deprecation warnings, so let's not compile this unless it is necessary: */ static OSStatus CopyIdentityWithLabelOldSchool(char *label, SecIdentityRef *out_c_a_k) { @@ -1090,7 +496,7 @@ static OSStatus CopyIdentityWithLabel(char *label, /* SecItemCopyMatching() was introduced in iOS and Snow Leopard. kSecClassIdentity was introduced in Lion. If both exist, let's use them to find the certificate. */ - if(SecItemCopyMatching && kSecClassIdentity) { + if(&SecItemCopyMatching && kSecClassIdentity) { CFTypeRef keys[5]; CFTypeRef values[5]; CFDictionaryRef query_dict; @@ -1106,9 +512,9 @@ static OSStatus CopyIdentityWithLabel(char *label, * label matching below worked correctly */ keys[2] = kSecMatchLimit; /* identity searches need a SecPolicyRef in order to work */ - values[3] = SecPolicyCreateSSL(false, NULL); + values[3] = SecPolicyCreateSSL(FALSE, NULL); keys[3] = kSecMatchPolicy; - /* match the name of the certificate (doesn't work in macOS 10.12.1) */ + /* match the name of the certificate (does not work in macOS 10.12.1) */ values[4] = label_cf; keys[4] = kSecAttrLabel; query_dict = CFDictionaryCreate(NULL, (const void **)keys, @@ -1120,13 +526,13 @@ static OSStatus CopyIdentityWithLabel(char *label, /* Do we have a match? */ status = SecItemCopyMatching(query_dict, (CFTypeRef *) &keys_list); - /* Because kSecAttrLabel matching doesn't work with kSecClassIdentity, + /* Because kSecAttrLabel matching does not work with kSecClassIdentity, * we need to find the correct identity ourselves */ if(status == noErr) { keys_list_count = CFArrayGetCount(keys_list); *out_cert_and_key = NULL; status = 1; - for(i = 0; idata, blob->len); + (const unsigned char *)blob->data, + (CFIndex)blob->len); status = (pkcs_data != NULL) ? errSecSuccess : errSecAllocate; resource_imported = (pkcs_data != NULL); } @@ -1202,7 +609,7 @@ static OSStatus CopyIdentityFromPKCS12File(const char *cPath, pkcs_url = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8 *)cPath, - strlen(cPath), false); + (CFIndex)strlen(cPath), FALSE); resource_imported = CFURLCreateDataAndPropertiesFromResource(NULL, pkcs_url, &pkcs_data, @@ -1231,7 +638,7 @@ static OSStatus CopyIdentityFromPKCS12File(const char *cPath, /* On macOS SecPKCS12Import will always add the client certificate to * the Keychain. * - * As this doesn't match iOS, and apps may not want to see their client + * As this does not match iOS, and apps may not want to see their client * certificate saved in the user's keychain, we use SecItemImport * with a NULL keychain to avoid importing it. * @@ -1304,336 +711,320 @@ CF_INLINE bool is_file(const char *filename) struct_stat st; if(!filename) - return false; + return FALSE; if(stat(filename, &st) == 0) return S_ISREG(st.st_mode); - return false; + return FALSE; } -#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS -static CURLcode sectransp_version_from_curl(SSLProtocol *darwinver, - long ssl_version) +static CURLcode +sectransp_set_ssl_version_min_max(struct Curl_easy *data, + struct st_ssl_backend_data *backend, + struct ssl_primary_config *conn_config) { - switch(ssl_version) { - case CURL_SSLVERSION_TLSv1_0: - *darwinver = kTLSProtocol1; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_1: - *darwinver = kTLSProtocol11; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_2: - *darwinver = kTLSProtocol12; - return CURLE_OK; - case CURL_SSLVERSION_TLSv1_3: - /* TLS 1.3 support first appeared in iOS 11 and macOS 10.13 */ -#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 - if(__builtin_available(macOS 10.13, iOS 11.0, *)) { - *darwinver = kTLSProtocol13; - return CURLE_OK; - } -#endif /* (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && - HAVE_BUILTIN_AVAILABLE == 1 */ - break; - } - return CURLE_SSL_CONNECT_ERROR; -} +#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS + OSStatus err; + SSLProtocol ver_min; + SSLProtocol ver_max; + +#if CURL_SUPPORT_MAC_10_7 + if(!&SSLSetProtocolVersionMax) + goto legacy; #endif -static CURLcode set_ssl_version_min_max(struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - struct ssl_connect_data *connssl = cf->ctx; - struct st_ssl_backend_data *backend = - (struct st_ssl_backend_data *)connssl->backend; - 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; - long max_supported_version_by_os; - - DEBUGASSERT(backend); - - /* macOS 10.5-10.7 supported TLS 1.0 only. - macOS 10.8 and later, and iOS 5 and later, added TLS 1.1 and 1.2. - macOS 10.13 and later, and iOS 11 and later, added TLS 1.3. */ -#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 - if(__builtin_available(macOS 10.13, iOS 11.0, *)) { - max_supported_version_by_os = CURL_SSLVERSION_MAX_TLSv1_3; - } - else { - max_supported_version_by_os = CURL_SSLVERSION_MAX_TLSv1_2; - } -#else - max_supported_version_by_os = CURL_SSLVERSION_MAX_TLSv1_2; -#endif /* (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && - HAVE_BUILTIN_AVAILABLE == 1 */ - - switch(ssl_version) { + switch(conn_config->version) { case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: - ssl_version = CURL_SSLVERSION_TLSv1_0; + case CURL_SSLVERSION_TLSv1_0: + ver_min = kTLSProtocol1; break; + case CURL_SSLVERSION_TLSv1_1: + ver_min = kTLSProtocol11; + break; + case CURL_SSLVERSION_TLSv1_2: + ver_min = kTLSProtocol12; + break; + case CURL_SSLVERSION_TLSv1_3: + default: + failf(data, "SSL: unsupported minimum TLS version value"); + return CURLE_SSL_CONNECT_ERROR; } - switch(ssl_version_max) { - case CURL_SSLVERSION_MAX_NONE: + switch(conn_config->version_max) { case CURL_SSLVERSION_MAX_DEFAULT: - ssl_version_max = max_supported_version_by_os; + case CURL_SSLVERSION_MAX_NONE: + case CURL_SSLVERSION_MAX_TLSv1_3: + case CURL_SSLVERSION_MAX_TLSv1_2: + ver_max = kTLSProtocol12; break; + case CURL_SSLVERSION_MAX_TLSv1_1: + ver_max = kTLSProtocol11; + break; + case CURL_SSLVERSION_MAX_TLSv1_0: + ver_max = kTLSProtocol1; + break; + default: + failf(data, "SSL: unsupported maximum TLS version value"); + return CURLE_SSL_CONNECT_ERROR; } -#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - if(SSLSetProtocolVersionMax) { - SSLProtocol darwin_ver_min = kTLSProtocol1; - SSLProtocol darwin_ver_max = kTLSProtocol1; - CURLcode result = sectransp_version_from_curl(&darwin_ver_min, - ssl_version); - if(result) { - failf(data, "unsupported min version passed via CURLOPT_SSLVERSION"); - return result; - } - result = sectransp_version_from_curl(&darwin_ver_max, - ssl_version_max >> 16); - if(result) { - failf(data, "unsupported max version passed via CURLOPT_SSLVERSION"); - return result; - } - - (void)SSLSetProtocolVersionMin(backend->ssl_ctx, darwin_ver_min); - (void)SSLSetProtocolVersionMax(backend->ssl_ctx, darwin_ver_max); - return result; + err = SSLSetProtocolVersionMin(backend->ssl_ctx, ver_min); + if(err != noErr) { + failf(data, "SSL: failed to set minimum TLS version"); + return CURLE_SSL_CONNECT_ERROR; } - else { -#if CURL_SUPPORT_MAC_10_8 - long i = ssl_version; - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kSSLProtocolAll, - false); - for(; i <= (ssl_version_max >> 16); i++) { - switch(i) { - case CURL_SSLVERSION_TLSv1_0: - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol1, - true); - break; - case CURL_SSLVERSION_TLSv1_1: - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol11, - true); - break; - case CURL_SSLVERSION_TLSv1_2: - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol12, - true); - break; - case CURL_SSLVERSION_TLSv1_3: - failf(data, "Your version of the OS does not support TLSv1.3"); - return CURLE_SSL_CONNECT_ERROR; + err = SSLSetProtocolVersionMax(backend->ssl_ctx, ver_max); + if(err != noErr) { + failf(data, "SSL: failed to set maximum TLS version"); + return CURLE_SSL_CONNECT_ERROR; + } + + return CURLE_OK; +#endif +#if CURL_SUPPORT_MAC_10_7 + goto legacy; +legacy: + switch(conn_config->version) { + case CURL_SSLVERSION_DEFAULT: + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + break; + default: + failf(data, "SSL: unsupported minimum TLS version value"); + return CURLE_SSL_CONNECT_ERROR; + } + + /* only TLS 1.0 is supported, disable SSL 3.0 and SSL 2.0 */ + SSLSetProtocolVersionEnabled(backend->ssl_ctx, kSSLProtocolAll, FALSE); + SSLSetProtocolVersionEnabled(backend->ssl_ctx, kTLSProtocol1, TRUE); + + return CURLE_OK; +#endif +} + +static int sectransp_cipher_suite_get_str(uint16_t id, char *buf, + size_t buf_size, bool prefer_rfc) +{ + /* are these fortezza suites even supported ? */ + if(id == SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA) + msnprintf(buf, buf_size, "%s", "SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA"); + else if(id == SSL_FORTEZZA_DMS_WITH_NULL_SHA) + msnprintf(buf, buf_size, "%s", "SSL_FORTEZZA_DMS_WITH_NULL_SHA"); + /* can TLS_EMPTY_RENEGOTIATION_INFO_SCSV even be set ? */ + else if(id == TLS_EMPTY_RENEGOTIATION_INFO_SCSV) + msnprintf(buf, buf_size, "%s", "TLS_EMPTY_RENEGOTIATION_INFO_SCSV"); + /* do we still need to support these SSL2-only ciphers ? */ + else if(id == SSL_RSA_WITH_RC2_CBC_MD5) + msnprintf(buf, buf_size, "%s", "SSL_RSA_WITH_RC2_CBC_MD5"); + else if(id == SSL_RSA_WITH_IDEA_CBC_MD5) + msnprintf(buf, buf_size, "%s", "SSL_RSA_WITH_IDEA_CBC_MD5"); + else if(id == SSL_RSA_WITH_DES_CBC_MD5) + msnprintf(buf, buf_size, "%s", "SSL_RSA_WITH_DES_CBC_MD5"); + else if(id == SSL_RSA_WITH_3DES_EDE_CBC_MD5) + msnprintf(buf, buf_size, "%s", "SSL_RSA_WITH_3DES_EDE_CBC_MD5"); + else + return Curl_cipher_suite_get_str(id, buf, buf_size, prefer_rfc); + return 0; +} + +static uint16_t sectransp_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; + + if(!id) { + /* are these fortezza suites even supported ? */ + if(strncasecompare("SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA", *str, len)) + id = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA; + else if(strncasecompare("SSL_FORTEZZA_DMS_WITH_NULL_SHA", *str, len)) + id = SSL_FORTEZZA_DMS_WITH_NULL_SHA; + /* can TLS_EMPTY_RENEGOTIATION_INFO_SCSV even be set ? */ + else if(strncasecompare("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", *str, len)) + id = TLS_EMPTY_RENEGOTIATION_INFO_SCSV; + /* do we still need to support these SSL2-only ciphers ? */ + else if(strncasecompare("SSL_RSA_WITH_RC2_CBC_MD5", *str, len)) + id = SSL_RSA_WITH_RC2_CBC_MD5; + else if(strncasecompare("SSL_RSA_WITH_IDEA_CBC_MD5", *str, len)) + id = SSL_RSA_WITH_IDEA_CBC_MD5; + else if(strncasecompare("SSL_RSA_WITH_DES_CBC_MD5", *str, len)) + id = SSL_RSA_WITH_DES_CBC_MD5; + else if(strncasecompare("SSL_RSA_WITH_3DES_EDE_CBC_MD5", *str, len)) + id = SSL_RSA_WITH_3DES_EDE_CBC_MD5; + } + return id; +} + +/* allocated memory must be freed */ +static SSLCipherSuite * sectransp_get_supported_ciphers(SSLContextRef ssl_ctx, + size_t *len) +{ + SSLCipherSuite *ciphers = NULL; + OSStatus err = noErr; + *len = 0; + + err = SSLGetNumberSupportedCiphers(ssl_ctx, len); + if(err != noErr) + goto failed; + + ciphers = malloc(*len * sizeof(SSLCipherSuite)); + if(!ciphers) + goto failed; + + err = SSLGetSupportedCiphers(ssl_ctx, ciphers, len); + if(err != noErr) + goto failed; + +#if CURL_BUILD_MAC + { + int maj = 0, min = 0; + GetDarwinVersionNumber(&maj, &min); + /* There is a known bug in early versions of Mountain Lion where ST's ECC + ciphers (cipher suite 0xC001 through 0xC032) simply do not work. + Work around the problem here by disabling those ciphers if we are + running in an affected version of macOS. */ + if(maj == 12 && min <= 3) { + size_t i = 0, j = 0; + for(; i < *len; i++) { + if(ciphers[i] >= 0xC001 && ciphers[i] <= 0xC032) + continue; + ciphers[j++] = ciphers[i]; } - } - return CURLE_OK; -#endif /* CURL_SUPPORT_MAC_10_8 */ - } -#endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ - failf(data, "Secure Transport: cannot set SSL protocol"); - return CURLE_SSL_CONNECT_ERROR; -} - -static bool is_cipher_suite_strong(SSLCipherSuite suite_num) -{ - size_t i; - for(i = 0; i < NUM_OF_CIPHERS; ++i) { - if(ciphertable[i].num == suite_num) { - return !ciphertable[i].weak; + *len = j; } } - /* If the cipher is not in our list, assume it is a new one - and therefore strong. Previous implementation was the same, - if cipher suite is not in the list, it was considered strong enough */ - return true; -} +#endif -static bool is_separator(char c) -{ - /* Return whether character is a cipher list separator. */ - switch(c) { - case ' ': - case '\t': - case ':': - case ',': - case ';': - return true; - } - return false; + return ciphers; +failed: + *len = 0; + Curl_safefree(ciphers); + return NULL; } static CURLcode sectransp_set_default_ciphers(struct Curl_easy *data, SSLContextRef ssl_ctx) { - size_t all_ciphers_count = 0UL, allowed_ciphers_count = 0UL, i; - SSLCipherSuite *all_ciphers = NULL, *allowed_ciphers = NULL; - OSStatus err = noErr; + CURLcode ret = CURLE_SSL_CIPHER; + size_t count = 0, i, j; + OSStatus err; + size_t supported_len; + SSLCipherSuite *ciphers = NULL; -#if CURL_BUILD_MAC - int darwinver_maj = 0, darwinver_min = 0; + ciphers = sectransp_get_supported_ciphers(ssl_ctx, &supported_len); + if(!ciphers) { + failf(data, "SSL: Failed to get supported ciphers"); + goto failed; + } - GetDarwinVersionNumber(&darwinver_maj, &darwinver_min); -#endif /* CURL_BUILD_MAC */ - - /* Disable cipher suites that ST supports but are not safe. These ciphers - are unlikely to be used in any case since ST gives other ciphers a much - higher priority, but it's probably better that we not connect at all than - to give the user a false sense of security if the server only supports - insecure ciphers. (Note: We don't care about SSLv2-only ciphers.) */ - err = SSLGetNumberSupportedCiphers(ssl_ctx, &all_ciphers_count); - if(err != noErr) { - failf(data, "SSL: SSLGetNumberSupportedCiphers() failed: OSStatus %d", - err); - return CURLE_SSL_CIPHER; - } - all_ciphers = malloc(all_ciphers_count*sizeof(SSLCipherSuite)); - if(!all_ciphers) { - failf(data, "SSL: Failed to allocate memory for all ciphers"); - return CURLE_OUT_OF_MEMORY; - } - allowed_ciphers = malloc(all_ciphers_count*sizeof(SSLCipherSuite)); - if(!allowed_ciphers) { - Curl_safefree(all_ciphers); - failf(data, "SSL: Failed to allocate memory for allowed ciphers"); - return CURLE_OUT_OF_MEMORY; - } - err = SSLGetSupportedCiphers(ssl_ctx, all_ciphers, - &all_ciphers_count); - if(err != noErr) { - Curl_safefree(all_ciphers); - Curl_safefree(allowed_ciphers); - return CURLE_SSL_CIPHER; - } - for(i = 0UL ; i < all_ciphers_count ; i++) { -#if CURL_BUILD_MAC - /* There's a known bug in early versions of Mountain Lion where ST's ECC - ciphers (cipher suite 0xC001 through 0xC032) simply do not work. - Work around the problem here by disabling those ciphers if we are - running in an affected version of OS X. */ - if(darwinver_maj == 12 && darwinver_min <= 3 && - all_ciphers[i] >= 0xC001 && all_ciphers[i] <= 0xC032) { - continue; - } -#endif /* CURL_BUILD_MAC */ - if(is_cipher_suite_strong(all_ciphers[i])) { - allowed_ciphers[allowed_ciphers_count++] = all_ciphers[i]; + /* Intersect the ciphers supported by Secure Transport with the default + * ciphers, using the order of the former. */ + for(i = 0; i < supported_len; i++) { + for(j = 0; j < DEFAULT_CIPHERS_LEN; j++) { + if(default_ciphers[j] == ciphers[i]) { + ciphers[count++] = ciphers[i]; + break; + } } } - err = SSLSetEnabledCiphers(ssl_ctx, allowed_ciphers, - allowed_ciphers_count); - Curl_safefree(all_ciphers); - Curl_safefree(allowed_ciphers); + + if(count == 0) { + failf(data, "SSL: no supported default ciphers"); + goto failed; + } + + err = SSLSetEnabledCiphers(ssl_ctx, ciphers, count); if(err != noErr) { failf(data, "SSL: SSLSetEnabledCiphers() failed: OSStatus %d", err); - return CURLE_SSL_CIPHER; + goto failed; } - return CURLE_OK; + + ret = CURLE_OK; +failed: + Curl_safefree(ciphers); + return ret; } static CURLcode sectransp_set_selected_ciphers(struct Curl_easy *data, SSLContextRef ssl_ctx, const char *ciphers) { - size_t ciphers_count = 0; - const char *cipher_start = ciphers; - OSStatus err = noErr; - SSLCipherSuite selected_ciphers[NUM_OF_CIPHERS]; + CURLcode ret = CURLE_SSL_CIPHER; + size_t count = 0, i; + const char *ptr, *end; + OSStatus err; + size_t supported_len; + SSLCipherSuite *supported = NULL; + SSLCipherSuite *selected = NULL; - if(!ciphers) - return CURLE_OK; - - while(is_separator(*ciphers)) /* Skip initial separators. */ - ciphers++; - if(!*ciphers) - return CURLE_OK; - - cipher_start = ciphers; - while(*cipher_start && ciphers_count < NUM_OF_CIPHERS) { - bool cipher_found = FALSE; - size_t cipher_len = 0; - const char *cipher_end = NULL; - bool tls_name = FALSE; - size_t i; - - /* Skip separators */ - while(is_separator(*cipher_start)) - cipher_start++; - if(*cipher_start == '\0') { - break; - } - /* Find last position of a cipher in the ciphers string */ - cipher_end = cipher_start; - while(*cipher_end != '\0' && !is_separator(*cipher_end)) { - ++cipher_end; - } - - /* IANA cipher names start with the TLS_ or SSL_ prefix. - If the 4th symbol of the cipher is '_' we look for a cipher in the - table by its (TLS) name. - Otherwise, we try to match cipher by an alias. */ - if(cipher_start[3] == '_') { - tls_name = TRUE; - } - /* Iterate through the cipher table and look for the cipher, starting - the cipher number 0x01 because the 0x00 is not the real cipher */ - cipher_len = cipher_end - cipher_start; - for(i = 1; i < NUM_OF_CIPHERS; ++i) { - const char *table_cipher_name = NULL; - if(tls_name) { - table_cipher_name = ciphertable[i].name; - } - else if(ciphertable[i].alias_name) { - table_cipher_name = ciphertable[i].alias_name; - } - else { - continue; - } - /* Compare a part of the string between separators with a cipher name - in the table and make sure we matched the whole cipher name */ - if(strncmp(cipher_start, table_cipher_name, cipher_len) == 0 - && table_cipher_name[cipher_len] == '\0') { - selected_ciphers[ciphers_count] = ciphertable[i].num; - ++ciphers_count; - cipher_found = TRUE; - break; - } - } - if(!cipher_found) { - /* It would be more human-readable if we print the wrong cipher name - but we don't want to allocate any additional memory and copy the name - into it, then add it into logs. - Also, we do not modify an original cipher list string. We just point - to positions where cipher starts and ends in the cipher list string. - The message is a bit cryptic and longer than necessary but can be - understood by humans. */ - failf(data, "SSL: cipher string \"%s\" contains unsupported cipher name" - " starting position %zd and ending position %zd", - ciphers, - cipher_start - ciphers, - cipher_end - ciphers); - return CURLE_SSL_CIPHER; - } - if(*cipher_end) { - cipher_start = cipher_end + 1; - } - else { - break; - } + supported = sectransp_get_supported_ciphers(ssl_ctx, &supported_len); + if(!supported) { + failf(data, "SSL: Failed to get supported ciphers"); + goto failed; } - /* All cipher suites in the list are found. Report to logs as-is */ - infof(data, "SSL: Setting cipher suites list \"%s\"", ciphers); - err = SSLSetEnabledCiphers(ssl_ctx, selected_ciphers, ciphers_count); + selected = malloc(supported_len * sizeof(SSLCipherSuite)); + if(!selected) { + failf(data, "SSL: Failed to allocate memory"); + goto failed; + } + + for(ptr = ciphers; ptr[0] != '\0' && count < supported_len; ptr = end) { + uint16_t id = sectransp_cipher_suite_walk_str(&ptr, &end); + + /* Check if cipher is supported */ + if(id) { + for(i = 0; i < supported_len && supported[i] != id; i++); + if(i == supported_len) + id = 0; + } + if(!id) { + if(ptr[0] != '\0') + infof(data, "SSL: unknown cipher in list: \"%.*s\"", (int) (end - ptr), + ptr); + continue; + } + + /* No duplicates allowed (so selected cannot overflow) */ + for(i = 0; i < count && selected[i] != id; i++); + if(i < count) { + infof(data, "SSL: duplicate cipher in list: \"%.*s\"", (int) (end - ptr), + ptr); + continue; + } + + selected[count++] = id; + } + + if(count == 0) { + failf(data, "SSL: no supported cipher in list"); + goto failed; + } + + err = SSLSetEnabledCiphers(ssl_ctx, selected, count); if(err != noErr) { failf(data, "SSL: SSLSetEnabledCiphers() failed: OSStatus %d", err); - return CURLE_SSL_CIPHER; + goto failed; } - return CURLE_OK; + + ret = CURLE_OK; +failed: + Curl_safefree(supported); + Curl_safefree(selected); + return ret; +} + +static void sectransp_session_free(void *sessionid, size_t idsize) +{ + /* ST, as of iOS 5 and Mountain Lion, has no public method of deleting a + cached session ID inside the Security framework. There is a private + function that does this, but I do not want to have to explain to you why I + got your application rejected from the App Store due to the use of a + private API, so the best we can do is free up our own char array that we + created way back in sectransp_connect_step1... */ + (void)idsize; + Curl_safefree(sessionid); } static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, @@ -1653,6 +1044,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, const struct curl_blob *ssl_cert_blob = ssl_config->primary.cert_blob; char *ciphers; OSStatus err = noErr; + CURLcode result; #if CURL_BUILD_MAC int darwinver_maj = 0, darwinver_min = 0; @@ -1663,23 +1055,23 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, #endif /* CURL_BUILD_MAC */ #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - if(SSLCreateContext) { /* use the newer API if available */ + if(&SSLCreateContext) { /* use the newer API if available */ if(backend->ssl_ctx) CFRelease(backend->ssl_ctx); backend->ssl_ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType); if(!backend->ssl_ctx) { - failf(data, "SSL: couldn't create a context"); + failf(data, "SSL: could not create a context"); return CURLE_OUT_OF_MEMORY; } } else { - /* The old ST API does not exist under iOS, so don't compile it: */ + /* The old ST API does not exist under iOS, so do not compile it: */ #if CURL_SUPPORT_MAC_10_8 if(backend->ssl_ctx) (void)SSLDisposeContext(backend->ssl_ctx); - err = SSLNewContext(false, &(backend->ssl_ctx)); + err = SSLNewContext(FALSE, &(backend->ssl_ctx)); if(err != noErr) { - failf(data, "SSL: couldn't create a context: OSStatus %d", err); + failf(data, "SSL: could not create a context: OSStatus %d", err); return CURLE_OUT_OF_MEMORY; } #endif /* CURL_SUPPORT_MAC_10_8 */ @@ -1687,125 +1079,20 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, #else if(backend->ssl_ctx) (void)SSLDisposeContext(backend->ssl_ctx); - err = SSLNewContext(false, &(backend->ssl_ctx)); + err = SSLNewContext(FALSE, &(backend->ssl_ctx)); if(err != noErr) { - failf(data, "SSL: couldn't create a context: OSStatus %d", err); + failf(data, "SSL: could not create a context: OSStatus %d", err); return CURLE_OUT_OF_MEMORY; } #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ backend->ssl_write_buffered_length = 0UL; /* reset buffered write length */ - /* check to see if we've been told to use an explicit SSL/TLS version */ -#if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - if(SSLSetProtocolVersionMax) { - switch(conn_config->version) { - case CURL_SSLVERSION_TLSv1: - (void)SSLSetProtocolVersionMin(backend->ssl_ctx, kTLSProtocol1); -#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 - if(__builtin_available(macOS 10.13, iOS 11.0, *)) { - (void)SSLSetProtocolVersionMax(backend->ssl_ctx, kTLSProtocol13); - } - else { - (void)SSLSetProtocolVersionMax(backend->ssl_ctx, kTLSProtocol12); - } -#else - (void)SSLSetProtocolVersionMax(backend->ssl_ctx, kTLSProtocol12); -#endif /* (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && - HAVE_BUILTIN_AVAILABLE == 1 */ - break; - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1_1: - case CURL_SSLVERSION_TLSv1_2: - case CURL_SSLVERSION_TLSv1_3: - { - CURLcode result = set_ssl_version_min_max(cf, data); - if(result != CURLE_OK) - return result; - break; - } - case CURL_SSLVERSION_SSLv3: - case CURL_SSLVERSION_SSLv2: - failf(data, "SSL versions not supported"); - return CURLE_NOT_BUILT_IN; - default: - failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); - return CURLE_SSL_CONNECT_ERROR; - } - } - else { -#if CURL_SUPPORT_MAC_10_8 - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kSSLProtocolAll, - false); - switch(conn_config->version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol1, - true); - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol11, - true); - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol12, - true); - break; - case CURL_SSLVERSION_TLSv1_0: - case CURL_SSLVERSION_TLSv1_1: - case CURL_SSLVERSION_TLSv1_2: - case CURL_SSLVERSION_TLSv1_3: - { - CURLcode result = set_ssl_version_min_max(cf, data); - if(result != CURLE_OK) - return result; - break; - } - case CURL_SSLVERSION_SSLv3: - case CURL_SSLVERSION_SSLv2: - failf(data, "SSL versions not supported"); - return CURLE_NOT_BUILT_IN; - default: - failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); - return CURLE_SSL_CONNECT_ERROR; - } -#endif /* CURL_SUPPORT_MAC_10_8 */ - } -#else - if(conn_config->version_max != CURL_SSLVERSION_MAX_NONE) { - failf(data, "Your version of the OS does not support to set maximum" - " SSL/TLS version"); - return CURLE_SSL_CONNECT_ERROR; - } - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, kSSLProtocolAll, false); - switch(conn_config->version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: - case CURL_SSLVERSION_TLSv1_0: - (void)SSLSetProtocolVersionEnabled(backend->ssl_ctx, - kTLSProtocol1, - true); - break; - case CURL_SSLVERSION_TLSv1_1: - failf(data, "Your version of the OS does not support TLSv1.1"); - return CURLE_SSL_CONNECT_ERROR; - case CURL_SSLVERSION_TLSv1_2: - failf(data, "Your version of the OS does not support TLSv1.2"); - return CURLE_SSL_CONNECT_ERROR; - case CURL_SSLVERSION_TLSv1_3: - failf(data, "Your version of the OS does not support TLSv1.3"); - return CURLE_SSL_CONNECT_ERROR; - case CURL_SSLVERSION_SSLv2: - case CURL_SSLVERSION_SSLv3: - failf(data, "SSL versions not supported"); - return CURLE_NOT_BUILT_IN; - default: - failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); - return CURLE_SSL_CONNECT_ERROR; - } -#endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ + result = sectransp_set_ssl_version_min_max(data, backend, conn_config); + if(result != CURLE_OK) + return result; -#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 +#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \ + defined(HAVE_BUILTIN_AVAILABLE) if(connssl->alpn) { if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) { struct alpn_proto_buf proto; @@ -1874,7 +1161,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, err = SecIdentityCopyCertificate(cert_and_key, &cert); if(err == noErr) { char *certp; - CURLcode result = CopyCertSubject(data, cert, &certp); + result = CopyCertSubject(data, cert, &certp); if(!result) { infof(data, "Client certificate: %s", certp); free(certp); @@ -1917,11 +1204,11 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, cert_showfilename_error); break; case errSecItemNotFound: - failf(data, "SSL: Can't find the certificate \"%s\" and its private " + failf(data, "SSL: cannot find the certificate \"%s\" and its private " "key in the Keychain.", cert_showfilename_error); break; default: - failf(data, "SSL: Can't load the certificate \"%s\" and its private " + failf(data, "SSL: cannot load the certificate \"%s\" and its private " "key: OSStatus %d", cert_showfilename_error, err); break; } @@ -1936,12 +1223,11 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, #if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS /* Snow Leopard introduced the SSLSetSessionOption() function, but due to a library bug with the way the kSSLSessionOptionBreakOnServerAuth flag - works, it doesn't work as expected under Snow Leopard, Lion or + works, it does not work as expected under Snow Leopard, Lion or Mountain Lion. So we need to call SSLSetEnableCertVerify() on those older cats in order to disable certificate validation if the user turned that off. - (SecureTransport will always validate the certificate chain by - default.) + (Secure Transport always validates the certificate chain by default.) Note: Darwin 11.x.x is Lion (10.7) Darwin 12.x.x is Mountain Lion (10.8) @@ -1950,9 +1236,9 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, Darwin 15.x.x is El Capitan (10.11) */ #if CURL_BUILD_MAC - if(SSLSetSessionOption && darwinver_maj >= 13) { + if(&SSLSetSessionOption && darwinver_maj >= 13) { #else - if(SSLSetSessionOption) { + if(&SSLSetSessionOption) { #endif /* CURL_BUILD_MAC */ bool break_on_auth = !conn_config->verifypeer || ssl_cafile || ssl_cablob; @@ -1967,7 +1253,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, else { #if CURL_SUPPORT_MAC_10_8 err = SSLSetEnableCertVerify(backend->ssl_ctx, - conn_config->verifypeer?true:false); + conn_config->verifypeer ? true : FALSE); if(err != noErr) { failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; @@ -1976,7 +1262,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, } #else err = SSLSetEnableCertVerify(backend->ssl_ctx, - conn_config->verifypeer?true:false); + conn_config->verifypeer ? true : FALSE); if(err != noErr) { failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err); return CURLE_SSL_CONNECT_ERROR; @@ -1988,7 +1274,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, bool is_cert_file = (!is_cert_data) && is_file(ssl_cafile); if(!(is_cert_file || is_cert_data)) { - failf(data, "SSL: can't load CA certificate file %s", + failf(data, "SSL: cannot load CA certificate file %s", ssl_cafile ? ssl_cafile : "(blob memory)"); return CURLE_SSL_CACERT_BADFILE; } @@ -1998,8 +1284,8 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, * Both hostname check and SNI require SSLSetPeerDomainName(). * Also: the verifyhost setting influences SNI usage */ if(conn_config->verifyhost) { - char *server = connssl->peer.sni? - connssl->peer.sni : connssl->peer.hostname; + char *server = connssl->peer.sni ? + connssl->peer.sni : connssl->peer.hostname; err = SSLSetPeerDomainName(backend->ssl_ctx, server, strlen(server)); if(err != noErr) { @@ -2019,21 +1305,21 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, ciphers = conn_config->cipher_list; if(ciphers) { - err = sectransp_set_selected_ciphers(data, backend->ssl_ctx, ciphers); + result = sectransp_set_selected_ciphers(data, backend->ssl_ctx, ciphers); } else { - err = sectransp_set_default_ciphers(data, backend->ssl_ctx); + result = sectransp_set_default_ciphers(data, backend->ssl_ctx); } - if(err != noErr) { + if(result != CURLE_OK) { failf(data, "SSL: Unable to set ciphers for SSL/TLS handshake. " - "Error code: %d", err); + "Error code: %d", (int)result); return CURLE_SSL_CIPHER; } #if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 /* We want to enable 1/n-1 when using a CBC cipher unless the user - specifically doesn't want us doing that: */ - if(SSLSetSessionOption) { + specifically does not want us doing that: */ + if(&SSLSetSessionOption) { SSLSetSessionOption(backend->ssl_ctx, kSSLSessionOptionSendOneByteRecord, !ssl_config->enable_beast); SSLSetSessionOption(backend->ssl_ctx, kSSLSessionOptionFalseStart, @@ -2041,14 +1327,15 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, } #endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ - /* Check if there's a cached ID we can/should use here! */ - if(ssl_config->primary.sessionid) { + /* Check if there is a cached ID we can/should use here! */ + if(ssl_config->primary.cache_session) { char *ssl_sessionid; size_t ssl_sessionid_len; Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, (void **)&ssl_sessionid, - &ssl_sessionid_len)) { + if(!Curl_ssl_getsessionid(cf, data, &connssl->peer, + (void **)&ssl_sessionid, &ssl_sessionid_len, + NULL)) { /* we got a session id, use it! */ err = SSLSetPeerID(backend->ssl_ctx, ssl_sessionid, ssl_sessionid_len); Curl_ssl_sessionid_unlock(data); @@ -2059,15 +1346,14 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, /* Informational message */ infof(data, "SSL reusing session ID"); } - /* If there isn't one, then let's make one up! This has to be done prior + /* If there is not one, then let's make one up! This has to be done prior to starting the handshake. */ else { - CURLcode result; ssl_sessionid = aprintf("%s:%d:%d:%s:%d", ssl_cafile ? ssl_cafile : "(blob memory)", verifypeer, conn_config->verifyhost, connssl->peer.hostname, - connssl->port); + connssl->peer.port); ssl_sessionid_len = strlen(ssl_sessionid); err = SSLSetPeerID(backend->ssl_ctx, ssl_sessionid, ssl_sessionid_len); @@ -2077,13 +1363,12 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf, return CURLE_SSL_CONNECT_ERROR; } - result = Curl_ssl_addsessionid(cf, data, ssl_sessionid, - ssl_sessionid_len, NULL); + result = Curl_ssl_set_sessionid(cf, data, &connssl->peer, NULL, + ssl_sessionid, ssl_sessionid_len, + sectransp_session_free); Curl_ssl_sessionid_unlock(data); - if(result) { - failf(data, "failed to store ssl session"); + if(result) return result; - } } } @@ -2110,7 +1395,7 @@ static long pem_to_der(const char *in, unsigned char **out, size_t *outlen) char *sep_start, *sep_end, *cert_start, *cert_end; size_t i, j, err; size_t len; - unsigned char *b64; + char *b64; /* Jump through the separators at the beginning of the certificate. */ sep_start = strstr(in, "-----"); @@ -2191,16 +1476,16 @@ static int read_cert(const char *file, unsigned char **out, size_t *outlen) return 0; } -static int append_cert_to_array(struct Curl_easy *data, - const unsigned char *buf, size_t buflen, - CFMutableArrayRef array) +static CURLcode append_cert_to_array(struct Curl_easy *data, + const unsigned char *buf, size_t buflen, + CFMutableArrayRef array) { char *certp; CURLcode result; SecCertificateRef cacert; CFDataRef certdata; - certdata = CFDataCreate(kCFAllocatorDefault, buf, buflen); + certdata = CFDataCreate(kCFAllocatorDefault, buf, (CFIndex)buflen); if(!certdata) { failf(data, "SSL: failed to allocate array for CA certificate"); return CURLE_OUT_OF_MEMORY; @@ -2237,7 +1522,8 @@ static CURLcode verify_cert_buf(struct Curl_cfilter *cf, const unsigned char *certbuf, size_t buflen, SSLContextRef ctx) { - int n = 0, rc; + int n = 0; + CURLcode rc; long res; unsigned char *der; size_t derlen, offset = 0; @@ -2319,7 +1605,7 @@ static CURLcode verify_cert_buf(struct Curl_cfilter *cf, failf(data, "SecTrustSetAnchorCertificates() returned error %d", ret); goto out; } - ret = SecTrustSetAnchorCertificatesOnly(trust, true); + ret = SecTrustSetAnchorCertificatesOnly(trust, TRUE); if(ret != noErr) { failf(data, "SecTrustSetAnchorCertificatesOnly() returned error %d", ret); goto out; @@ -2408,7 +1694,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, /* Result is returned to caller */ CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH; - /* if a path wasn't specified, don't pin */ + /* if a path was not specified, do not pin */ if(!pinnedpubkey) return CURLE_OK; @@ -2440,17 +1726,17 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, #elif SECTRANSP_PINNEDPUBKEY_V2 { - OSStatus success; - success = SecItemExport(keyRef, kSecFormatOpenSSL, 0, NULL, - &publicKeyBits); - CFRelease(keyRef); - if(success != errSecSuccess || !publicKeyBits) - break; + OSStatus success; + success = SecItemExport(keyRef, kSecFormatOpenSSL, 0, NULL, + &publicKeyBits); + CFRelease(keyRef); + if(success != errSecSuccess || !publicKeyBits) + break; } #endif /* SECTRANSP_PINNEDPUBKEY_V2 */ - pubkeylen = CFDataGetLength(publicKeyBits); + pubkeylen = (size_t)CFDataGetLength(publicKeyBits); pubkey = (unsigned char *)CFDataGetBytePtr(publicKeyBits); switch(pubkeylen) { @@ -2519,24 +1805,23 @@ static CURLcode sectransp_connect_step2(struct Curl_cfilter *cf, SSLCipherSuite cipher; SSLProtocol protocol = 0; - DEBUGASSERT(ssl_connect_2 == connssl->connecting_state - || ssl_connect_2_reading == connssl->connecting_state - || ssl_connect_2_writing == connssl->connecting_state); + DEBUGASSERT(ssl_connect_2 == connssl->connecting_state); DEBUGASSERT(backend); CURL_TRC_CF(data, cf, "connect_step2"); /* Here goes nothing: */ check_handshake: + connssl->io_need = CURL_SSL_IO_NEED_NONE; err = SSLHandshake(backend->ssl_ctx); if(err != noErr) { switch(err) { - case errSSLWouldBlock: /* they're not done with us yet */ - connssl->connecting_state = backend->ssl_direction ? - ssl_connect_2_writing : ssl_connect_2_reading; + case errSSLWouldBlock: /* they are not done with us yet */ + connssl->io_need = backend->ssl_direction ? + CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV; return CURLE_OK; - /* The below is errSSLServerAuthCompleted; it's not defined in + /* The below is errSSLServerAuthCompleted; it is not defined in Leopard's headers */ case -9841: if((conn_config->CAfile || conn_config->ca_info_blob) && @@ -2646,8 +1931,8 @@ check_handshake: "authority"); break; - /* This error is raised if the server's cert didn't match the server's - host name: */ + /* This error is raised if the server's cert did not match the server's + hostname: */ case errSSLHostNameMismatch: failf(data, "SSL certificate peer verification failed, the " "certificate did not match \"%s\"\n", connssl->peer.dispname); @@ -2748,7 +2033,8 @@ check_handshake: return CURLE_SSL_CONNECT_ERROR; } else { - /* we have been connected fine, we're not waiting for anything else. */ + char cipher_str[64]; + /* we have been connected fine, we are not waiting for anything else. */ connssl->connecting_state = ssl_connect_3; #ifdef SECTRANSP_PINNEDPUBKEY @@ -2766,33 +2052,30 @@ check_handshake: /* Informational message */ (void)SSLGetNegotiatedCipher(backend->ssl_ctx, &cipher); (void)SSLGetNegotiatedProtocolVersion(backend->ssl_ctx, &protocol); + + sectransp_cipher_suite_get_str((uint16_t) cipher, cipher_str, + sizeof(cipher_str), TRUE); switch(protocol) { case kSSLProtocol2: - infof(data, "SSL 2.0 connection using %s", - TLSCipherNameForNumber(cipher)); + infof(data, "SSL 2.0 connection using %s", cipher_str); break; case kSSLProtocol3: - infof(data, "SSL 3.0 connection using %s", - TLSCipherNameForNumber(cipher)); + infof(data, "SSL 3.0 connection using %s", cipher_str); break; case kTLSProtocol1: - infof(data, "TLS 1.0 connection using %s", - TLSCipherNameForNumber(cipher)); + infof(data, "TLS 1.0 connection using %s", cipher_str); break; #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS case kTLSProtocol11: - infof(data, "TLS 1.1 connection using %s", - TLSCipherNameForNumber(cipher)); + infof(data, "TLS 1.1 connection using %s", cipher_str); break; case kTLSProtocol12: - infof(data, "TLS 1.2 connection using %s", - TLSCipherNameForNumber(cipher)); + infof(data, "TLS 1.2 connection using %s", cipher_str); break; #endif /* CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS */ #if CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 case kTLSProtocol13: - infof(data, "TLS 1.3 connection using %s", - TLSCipherNameForNumber(cipher)); + infof(data, "TLS 1.3 connection using %s", cipher_str); break; #endif /* CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 */ default: @@ -2800,7 +2083,8 @@ check_handshake: break; } -#if(CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && HAVE_BUILTIN_AVAILABLE == 1 +#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \ + defined(HAVE_BUILTIN_AVAILABLE) if(connssl->alpn) { if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) { CFArrayRef alpnArr = NULL; @@ -2824,11 +2108,8 @@ check_handshake: else infof(data, VTLS_INFOF_NO_ALPN); - Curl_multiuse_state(data, cf->conn->alpn == CURL_HTTP_VERSION_2 ? - BUNDLE_MULTIPLEX : BUNDLE_NO_MULTIUSE); - /* chosenProtocol is a reference to the string within alpnArr - and doesn't need to be freed separately */ + and does not need to be freed separately */ if(alpnArr) CFRelease(alpnArr); } @@ -2888,7 +2169,7 @@ static CURLcode collect_server_cert(struct Curl_cfilter *cf, #ifndef CURL_DISABLE_VERBOSE_STRINGS const bool show_verbose_server_cert = data->set.verbose; #else - const bool show_verbose_server_cert = false; + const bool show_verbose_server_cert = FALSE; #endif struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); CURLcode result = ssl_config->certinfo ? @@ -2930,10 +2211,10 @@ static CURLcode collect_server_cert(struct Curl_cfilter *cf, /* SSLCopyPeerCertificates() is deprecated as of Mountain Lion. The function SecTrustGetCertificateAtIndex() is officially present in Lion, but it is unfortunately also present in Snow Leopard as - private API and doesn't work as expected. So we have to look for + private API and does not work as expected. So we have to look for a different symbol to make sure this code is only executed under Lion or later. */ - if(SecTrustCopyPublicKey) { + if(&SecTrustCopyPublicKey) { #pragma unused(server_certs) err = SSLCopyPeerTrust(backend->ssl_ctx, &trust); /* For some reason, SSLCopyPeerTrust() can return noErr and yet return @@ -3019,7 +2300,7 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, } if(ssl_connect_1 == connssl->connecting_state) { - /* Find out how much more time we're allowed */ + /* Find out how much more time we are allowed */ const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { @@ -3033,9 +2314,7 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, return result; } - while(ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { + while(ssl_connect_2 == connssl->connecting_state) { /* check allowed time left */ const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); @@ -3046,14 +2325,13 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, return CURLE_OPERATION_TIMEDOUT; } - /* if ssl is expecting something, check if it's available. */ - if(connssl->connecting_state == ssl_connect_2_reading || - connssl->connecting_state == ssl_connect_2_writing) { + /* if ssl is expecting something, check if it is available. */ + if(connssl->io_need) { - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, nonblocking ? 0 : timeout_ms); @@ -3083,10 +2361,7 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, * or epoll() will always have a valid fdset to wait on. */ result = sectransp_connect_step2(cf, data); - if(result || (nonblocking && - (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state))) + if(result || (nonblocking && (ssl_connect_2 == connssl->connecting_state))) return result; } /* repeat step2 until all transactions are done. */ @@ -3135,6 +2410,92 @@ static CURLcode sectransp_connect(struct Curl_cfilter *cf, return CURLE_OK; } +static ssize_t sectransp_recv(struct Curl_cfilter *cf, + struct Curl_easy *data, + char *buf, + size_t buffersize, + CURLcode *curlcode); + +static CURLcode sectransp_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct st_ssl_backend_data *backend = + (struct st_ssl_backend_data *)connssl->backend; + CURLcode result = CURLE_OK; + ssize_t nread; + char buf[1024]; + size_t i; + + DEBUGASSERT(backend); + if(!backend->ssl_ctx || cf->shutdown) { + *done = TRUE; + goto out; + } + + connssl->io_need = CURL_SSL_IO_NEED_NONE; + *done = FALSE; + + if(send_shutdown && !backend->sent_shutdown) { + OSStatus err; + + CURL_TRC_CF(data, cf, "shutdown, send close notify"); + err = SSLClose(backend->ssl_ctx); + switch(err) { + case noErr: + backend->sent_shutdown = TRUE; + break; + case errSSLWouldBlock: + connssl->io_need = CURL_SSL_IO_NEED_SEND; + result = CURLE_OK; + goto out; + default: + CURL_TRC_CF(data, cf, "shutdown, error: %d", (int)err); + result = CURLE_SEND_ERROR; + goto out; + } + } + + for(i = 0; i < 10; ++i) { + if(!backend->sent_shutdown) { + nread = sectransp_recv(cf, data, buf, (int)sizeof(buf), &result); + } + else { + /* We would like to read the close notify from the server using + * Secure Transport, however SSLRead() no longer works after we + * sent the notify from our side. So, we just read from the + * underlying filter and hope it will end. */ + nread = Curl_conn_cf_recv(cf->next, data, buf, sizeof(buf), &result); + } + CURL_TRC_CF(data, cf, "shutdown read -> %zd, %d", nread, result); + if(nread <= 0) + break; + } + + if(nread > 0) { + /* still data coming in? */ + connssl->io_need = CURL_SSL_IO_NEED_RECV; + } + else if(nread == 0) { + /* We got the close notify alert and are done. */ + CURL_TRC_CF(data, cf, "shutdown done"); + *done = TRUE; + } + else if(result == CURLE_AGAIN) { + connssl->io_need = CURL_SSL_IO_NEED_RECV; + result = CURLE_OK; + } + else { + DEBUGASSERT(result); + CURL_TRC_CF(data, cf, "shutdown, error: %d", result); + } + +out: + cf->shutdown = (result || *done); + return result; +} + static void sectransp_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; @@ -3147,9 +2508,8 @@ static void sectransp_close(struct Curl_cfilter *cf, struct Curl_easy *data) if(backend->ssl_ctx) { CURL_TRC_CF(data, cf, "close"); - (void)SSLClose(backend->ssl_ctx); #if CURL_BUILD_MAC_10_8 || CURL_BUILD_IOS - if(SSLCreateContext) + if(&SSLCreateContext) CFRelease(backend->ssl_ctx); #if CURL_SUPPORT_MAC_10_8 else @@ -3162,80 +2522,6 @@ static void sectransp_close(struct Curl_cfilter *cf, struct Curl_easy *data) } } -static int sectransp_shutdown(struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - struct ssl_connect_data *connssl = cf->ctx; - struct st_ssl_backend_data *backend = - (struct st_ssl_backend_data *)connssl->backend; - ssize_t nread; - int what; - int rc; - char buf[120]; - int loop = 10; /* avoid getting stuck */ - CURLcode result; - - DEBUGASSERT(backend); - - if(!backend->ssl_ctx) - return 0; - -#ifndef CURL_DISABLE_FTP - if(data->set.ftp_ccc != CURLFTPSSL_CCC_ACTIVE) - return 0; -#endif - - sectransp_close(cf, data); - - rc = 0; - - what = SOCKET_READABLE(Curl_conn_cf_get_socket(cf, data), - SSL_SHUTDOWN_TIMEOUT); - - CURL_TRC_CF(data, cf, "shutdown"); - while(loop--) { - if(what < 0) { - /* anything that gets here is fatally bad */ - failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); - rc = -1; - break; - } - - if(!what) { /* timeout */ - failf(data, "SSL shutdown timeout"); - break; - } - - /* Something to read, let's do it and hope that it is the close - notify alert from the server. No way to SSL_Read now, so use read(). */ - - nread = Curl_conn_cf_recv(cf->next, data, buf, sizeof(buf), &result); - - if(nread < 0) { - failf(data, "read: %s", curl_easy_strerror(result)); - rc = -1; - } - - if(nread <= 0) - break; - - what = SOCKET_READABLE(Curl_conn_cf_get_socket(cf, data), 0); - } - - return rc; -} - -static void sectransp_session_free(void *ptr) -{ - /* ST, as of iOS 5 and Mountain Lion, has no public method of deleting a - cached session ID inside the Security framework. There is a private - function that does this, but I don't want to have to explain to you why I - got your application rejected from the App Store due to the use of a - private API, so the best we can do is free up our own char array that we - created way back in sectransp_connect_step1... */ - Curl_safefree(ptr); -} - static size_t sectransp_version(char *buffer, size_t size) { return msnprintf(buffer, size, "SecureTransport"); @@ -3258,16 +2544,16 @@ static bool sectransp_data_pending(struct Curl_cfilter *cf, err = SSLGetBufferedReadSize(backend->ssl_ctx, &buffer); if(err == noErr) return buffer > 0UL; - return false; + return FALSE; } else - return false; + return FALSE; } static CURLcode sectransp_random(struct Curl_easy *data UNUSED_PARAM, unsigned char *entropy, size_t length) { - /* arc4random_buf() isn't available on cats older than Lion, so let's + /* arc4random_buf() is not available on cats older than Lion, so let's do this manually for the benefit of the older cats. */ size_t i; u_int32_t random_number = 0; @@ -3298,7 +2584,7 @@ static CURLcode sectransp_sha256sum(const unsigned char *tmp, /* input */ static bool sectransp_false_start(void) { #if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 - if(SSLSetSessionOption) + if(&SSLSetSessionOption) return TRUE; #endif return FALSE; @@ -3325,7 +2611,7 @@ static ssize_t sectransp_send(struct Curl_cfilter *cf, Now, one could interpret that as "written to the socket," but actually, it returns the amount of data that was written to a buffer internal to - the SSLContextRef instead. So it's possible for SSLWrite() to return + the SSLContextRef instead. So it is possible for SSLWrite() to return errSSLWouldBlock and a number of bytes "written" because those bytes were encrypted and written to a buffer, not to the socket. @@ -3338,7 +2624,7 @@ static ssize_t sectransp_send(struct Curl_cfilter *cf, err = SSLWrite(backend->ssl_ctx, NULL, 0UL, &processed); switch(err) { case noErr: - /* processed is always going to be 0 because we didn't write to + /* processed is always going to be 0 because we did not write to the buffer, so return how much was written to the socket */ processed = backend->ssl_write_buffered_length; backend->ssl_write_buffered_length = 0UL; @@ -3353,7 +2639,7 @@ static ssize_t sectransp_send(struct Curl_cfilter *cf, } } else { - /* We've got new data to write: */ + /* We have got new data to write: */ err = SSLWrite(backend->ssl_ctx, mem, len, &processed); if(err != noErr) { switch(err) { @@ -3410,7 +2696,7 @@ again: *curlcode = CURLE_OK; return 0; - /* The below is errSSLPeerAuthCompleted; it's not defined in + /* The below is errSSLPeerAuthCompleted; it is not defined in Leopard's headers */ case -9841: if((conn_config->CAfile || conn_config->ca_info_blob) && @@ -3451,7 +2737,8 @@ const struct Curl_ssl Curl_ssl_sectransp = { #ifdef SECTRANSP_PINNEDPUBKEY SSLSUPP_PINNEDPUBKEY | #endif /* SECTRANSP_PINNEDPUBKEY */ - SSLSUPP_HTTPS_PROXY, + SSLSUPP_HTTPS_PROXY | + SSLSUPP_CIPHER_LIST, sizeof(struct st_ssl_backend_data), @@ -3469,7 +2756,6 @@ const struct Curl_ssl Curl_ssl_sectransp = { sectransp_get_internals, /* get_internals */ sectransp_close, /* close_one */ Curl_none_close_all, /* close_all */ - sectransp_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -3477,9 +2763,9 @@ const struct Curl_ssl Curl_ssl_sectransp = { sectransp_sha256sum, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ sectransp_recv, /* recv decrypted data */ sectransp_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #ifdef __GNUC__ diff --git a/deps/curl/lib/vtls/vtls.c b/deps/curl/lib/vtls/vtls.c index d13a3cb1..6d12dfd7 100644 --- a/deps/curl/lib/vtls/vtls.c +++ b/deps/curl/lib/vtls/vtls.c @@ -68,7 +68,10 @@ #include "curl_base64.h" #include "curl_printf.h" #include "inet_pton.h" +#include "connect.h" +#include "select.h" #include "strdup.h" +#include "rand.h" /* The last #include files should be: */ #include "curl_memory.h" @@ -103,7 +106,7 @@ static CURLcode blobdup(struct curl_blob **dest, DEBUGASSERT(dest); DEBUGASSERT(!*dest); if(src) { - /* only if there's data to dupe! */ + /* only if there is data to dupe! */ struct curl_blob *d; d = malloc(sizeof(struct curl_blob) + src->len); if(!d) @@ -136,6 +139,9 @@ static const struct alpn_spec ALPN_SPEC_H11 = { { ALPN_HTTP_1_1 }, 1 }; #ifdef USE_HTTP2 +static const struct alpn_spec ALPN_SPEC_H2 = { + { ALPN_H2 }, 1 +}; static const struct alpn_spec ALPN_SPEC_H2_H11 = { { ALPN_H2, ALPN_HTTP_1_1 }, 2 }; @@ -146,13 +152,15 @@ static const struct alpn_spec *alpn_get_spec(int httpwant, bool use_alpn) if(!use_alpn) return NULL; #ifdef USE_HTTP2 + if(httpwant == CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE) + return &ALPN_SPEC_H2; if(httpwant >= CURL_HTTP_VERSION_2) return &ALPN_SPEC_H2_H11; #else (void)httpwant; #endif /* Use the ALPN protocol "http/1.1" for HTTP/1.x. - Avoid "http/1.0" because some servers don't support it. */ + Avoid "http/1.0" because some servers do not support it. */ return &ALPN_SPEC_H11; } #endif /* USE_SSL */ @@ -166,7 +174,7 @@ void Curl_ssl_easy_config_init(struct Curl_easy *data) */ data->set.ssl.primary.verifypeer = TRUE; data->set.ssl.primary.verifyhost = TRUE; - data->set.ssl.primary.sessionid = TRUE; /* session ID caching by default */ + data->set.ssl.primary.cache_session = TRUE; /* caching by default */ #ifndef CURL_DISABLE_PROXY data->set.proxy_ssl = data->set.ssl; #endif @@ -228,7 +236,7 @@ static bool clone_ssl_primary_config(struct ssl_primary_config *source, dest->verifypeer = source->verifypeer; dest->verifyhost = source->verifyhost; dest->verifystatus = source->verifystatus; - dest->sessionid = source->sessionid; + dest->cache_session = source->cache_session; dest->ssl_options = source->ssl_options; CLONE_BLOB(cert_blob); @@ -251,7 +259,7 @@ static bool clone_ssl_primary_config(struct ssl_primary_config *source, return TRUE; } -static void Curl_free_primary_ssl_config(struct ssl_primary_config *sslc) +static void free_primary_ssl_config(struct ssl_primary_config *sslc) { Curl_safefree(sslc->CApath); Curl_safefree(sslc->CAfile); @@ -351,9 +359,9 @@ CURLcode Curl_ssl_conn_config_init(struct Curl_easy *data, void Curl_ssl_conn_config_cleanup(struct connectdata *conn) { - Curl_free_primary_ssl_config(&conn->ssl_config); + free_primary_ssl_config(&conn->ssl_config); #ifndef CURL_DISABLE_PROXY - Curl_free_primary_ssl_config(&conn->proxy_ssl_config); + free_primary_ssl_config(&conn->proxy_ssl_config); #endif } @@ -363,8 +371,8 @@ void Curl_ssl_conn_config_update(struct Curl_easy *data, bool for_proxy) if(data->conn) { struct ssl_primary_config *src, *dest; #ifndef CURL_DISABLE_PROXY - src = for_proxy? &data->set.proxy_ssl.primary : &data->set.ssl.primary; - dest = for_proxy? &data->conn->proxy_ssl_config : &data->conn->ssl_config; + src = for_proxy ? &data->set.proxy_ssl.primary : &data->set.ssl.primary; + dest = for_proxy ? &data->conn->proxy_ssl_config : &data->conn->ssl_config; #else (void)for_proxy; src = &data->set.ssl.primary; @@ -411,23 +419,6 @@ int Curl_ssl_init(void) return Curl_ssl->init(); } -#if defined(CURL_WITH_MULTI_SSL) -static const struct Curl_ssl Curl_ssl_multi; -#endif - -/* Global cleanup */ -void Curl_ssl_cleanup(void) -{ - if(init_ssl) { - /* only cleanup if we did a previous init */ - Curl_ssl->cleanup(); -#if defined(CURL_WITH_MULTI_SSL) - Curl_ssl = &Curl_ssl_multi; -#endif - init_ssl = FALSE; - } -} - static bool ssl_prefs_check(struct Curl_easy *data) { /* check for CURLOPT_SSLVERSION invalid parameter value */ @@ -453,7 +444,7 @@ static bool ssl_prefs_check(struct Curl_easy *data) } static struct ssl_connect_data *cf_ctx_new(struct Curl_easy *data, - const struct alpn_spec *alpn) + const struct alpn_spec *alpn) { struct ssl_connect_data *ctx; @@ -463,6 +454,7 @@ static struct ssl_connect_data *cf_ctx_new(struct Curl_easy *data, return NULL; ctx->alpn = alpn; + Curl_bufq_init2(&ctx->earlydata, CURL_SSL_EARLY_MAX, 1, BUFQ_OPT_NO_SPARES); ctx->backend = calloc(1, Curl_ssl->sizeof_ssl_backend_data); if(!ctx->backend) { free(ctx); @@ -474,6 +466,8 @@ static struct ssl_connect_data *cf_ctx_new(struct Curl_easy *data, static void cf_ctx_free(struct ssl_connect_data *ctx) { if(ctx) { + Curl_safefree(ctx->alpn_negotiated); + Curl_bufq_free(&ctx->earlydata); free(ctx->backend); free(ctx); } @@ -529,15 +523,16 @@ void Curl_ssl_sessionid_unlock(struct Curl_easy *data) } /* - * Check if there's a session ID for the given connection in the cache, and if - * there's one suitable, it is provided. Returns TRUE when no entry matched. + * Check if there is a session ID for the given connection in the cache, and if + * there is one suitable, it is provided. Returns TRUE when no entry matched. */ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf, struct Curl_easy *data, + const struct ssl_peer *peer, void **ssl_sessionid, - size_t *idsize) /* set 0 if unknown */ + size_t *idsize, /* set 0 if unknown */ + char **palpn) { - struct ssl_connect_data *connssl = cf->ctx; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); struct Curl_ssl_session *check; @@ -546,12 +541,14 @@ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf, bool no_match = TRUE; *ssl_sessionid = NULL; + if(palpn) + *palpn = NULL; if(!ssl_config) return TRUE; - DEBUGASSERT(ssl_config->primary.sessionid); + DEBUGASSERT(ssl_config->primary.cache_session); - if(!ssl_config->primary.sessionid || !data->state.session) + if(!ssl_config->primary.cache_session || !data->state.session) /* session ID reuse is disabled or the session cache has not been setup */ return TRUE; @@ -567,14 +564,15 @@ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf, if(!check->sessionid) /* not session ID means blank entry */ continue; - if(strcasecompare(connssl->peer.hostname, check->name) && + if(strcasecompare(peer->hostname, check->name) && ((!cf->conn->bits.conn_to_host && !check->conn_to_host) || (cf->conn->bits.conn_to_host && check->conn_to_host && strcasecompare(cf->conn->conn_to_host.name, check->conn_to_host))) && ((!cf->conn->bits.conn_to_port && check->conn_to_port == -1) || (cf->conn->bits.conn_to_port && check->conn_to_port != -1 && cf->conn->conn_to_port == check->conn_to_port)) && - (connssl->port == check->remote_port) && + (peer->port == check->remote_port) && + (peer->transport == check->transport) && strcasecompare(cf->conn->handler->scheme, check->scheme) && match_ssl_primary_config(data, conn_config, &check->ssl_config)) { /* yes, we have a session ID! */ @@ -583,16 +581,16 @@ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf, *ssl_sessionid = check->sessionid; if(idsize) *idsize = check->idsize; + if(palpn) + *palpn = check->alpn; no_match = FALSE; break; } } - DEBUGF(infof(data, "%s Session ID in cache for %s %s://%s:%d", - no_match? "Didn't find": "Found", - Curl_ssl_cf_is_proxy(cf) ? "proxy" : "host", - cf->conn->handler->scheme, connssl->peer.hostname, - connssl->port)); + CURL_TRC_CF(data, cf, "%s cached session ID for %s://%s:%d", + no_match ? "No" : "Found", + cf->conn->handler->scheme, peer->hostname, peer->port); return no_match; } @@ -605,15 +603,17 @@ void Curl_ssl_kill_session(struct Curl_ssl_session *session) /* defensive check */ /* free the ID the SSL-layer specific way */ - Curl_ssl->session_free(session->sessionid); + session->sessionid_free(session->sessionid, session->idsize); session->sessionid = NULL; + session->sessionid_free = NULL; session->age = 0; /* fresh */ - Curl_free_primary_ssl_config(&session->ssl_config); + free_primary_ssl_config(&session->ssl_config); Curl_safefree(session->name); Curl_safefree(session->conn_to_host); + Curl_safefree(session->alpn); } } @@ -634,60 +634,72 @@ void Curl_ssl_delsessionid(struct Curl_easy *data, void *ssl_sessionid) } } -/* - * Store session id in the session cache. The ID passed on to this function - * must already have been extracted and allocated the proper way for the SSL - * layer. Curl_XXXX_session_free() will be called to free/kill the session ID - * later on. - */ -CURLcode Curl_ssl_addsessionid(struct Curl_cfilter *cf, - struct Curl_easy *data, - void *ssl_sessionid, - size_t idsize, - bool *added) +CURLcode Curl_ssl_set_sessionid(struct Curl_cfilter *cf, + struct Curl_easy *data, + const struct ssl_peer *peer, + const char *alpn, + void *ssl_sessionid, + size_t idsize, + Curl_ssl_sessionid_dtor *sessionid_free_cb) { - struct ssl_connect_data *connssl = cf->ctx; struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); size_t i; struct Curl_ssl_session *store; long oldest_age; - char *clone_host; - char *clone_conn_to_host; + char *clone_host = NULL; + char *clone_conn_to_host = NULL; + char *clone_alpn = NULL; int conn_to_port; long *general_age; + void *old_sessionid; + size_t old_size; + CURLcode result = CURLE_OUT_OF_MEMORY; - if(added) - *added = FALSE; + DEBUGASSERT(ssl_sessionid); + DEBUGASSERT(sessionid_free_cb); - if(!data->state.session) + if(!data->state.session) { + sessionid_free_cb(ssl_sessionid, idsize); return CURLE_OK; + } + + if(!Curl_ssl_getsessionid(cf, data, peer, &old_sessionid, &old_size, NULL)) { + if((old_size == idsize) && + ((old_sessionid == ssl_sessionid) || + (idsize && !memcmp(old_sessionid, ssl_sessionid, idsize)))) { + /* the very same */ + sessionid_free_cb(ssl_sessionid, idsize); + return CURLE_OK; + } + Curl_ssl_delsessionid(data, old_sessionid); + } store = &data->state.session[0]; oldest_age = data->state.session[0].age; /* zero if unused */ + DEBUGASSERT(ssl_config->primary.cache_session); (void)ssl_config; - DEBUGASSERT(ssl_config->primary.sessionid); - clone_host = strdup(connssl->peer.hostname); + clone_host = strdup(peer->hostname); if(!clone_host) - return CURLE_OUT_OF_MEMORY; /* bail out */ + goto out; if(cf->conn->bits.conn_to_host) { clone_conn_to_host = strdup(cf->conn->conn_to_host.name); - if(!clone_conn_to_host) { - free(clone_host); - return CURLE_OUT_OF_MEMORY; /* bail out */ - } + if(!clone_conn_to_host) + goto out; } - else - clone_conn_to_host = NULL; + + clone_alpn = alpn ? strdup(alpn) : NULL; + if(alpn && !clone_alpn) + goto out; if(cf->conn->bits.conn_to_port) conn_to_port = cf->conn->conn_to_port; else conn_to_port = -1; - /* Now we should add the session ID and the host name to the cache, (remove + /* Now we should add the session ID and the hostname to the cache, (remove the oldest if necessary) */ /* If using shared SSL session, lock! */ @@ -713,40 +725,55 @@ CURLcode Curl_ssl_addsessionid(struct Curl_cfilter *cf, store = &data->state.session[i]; /* use this slot */ /* now init the session struct wisely */ + if(!clone_ssl_primary_config(conn_config, &store->ssl_config)) { + free_primary_ssl_config(&store->ssl_config); + store->sessionid = NULL; /* let caller free sessionid */ + goto out; + } store->sessionid = ssl_sessionid; store->idsize = idsize; + store->sessionid_free = sessionid_free_cb; store->age = *general_age; /* set current age */ - /* free it if there's one already present */ + /* free it if there is one already present */ free(store->name); free(store->conn_to_host); - store->name = clone_host; /* clone host name */ - store->conn_to_host = clone_conn_to_host; /* clone connect to host name */ + store->name = clone_host; /* clone hostname */ + clone_host = NULL; + store->conn_to_host = clone_conn_to_host; /* clone connect to hostname */ + clone_conn_to_host = NULL; store->conn_to_port = conn_to_port; /* connect to port number */ + store->alpn = clone_alpn; + clone_alpn = NULL; /* port number */ - store->remote_port = connssl->port; + store->remote_port = peer->port; store->scheme = cf->conn->handler->scheme; + store->transport = peer->transport; - if(!clone_ssl_primary_config(conn_config, &store->ssl_config)) { - Curl_free_primary_ssl_config(&store->ssl_config); - store->sessionid = NULL; /* let caller free sessionid */ - free(clone_host); - free(clone_conn_to_host); - return CURLE_OUT_OF_MEMORY; + result = CURLE_OK; + +out: + free(clone_host); + free(clone_conn_to_host); + free(clone_alpn); + if(result) { + failf(data, "Failed to add Session ID to cache for %s://%s:%d [%s]", + store->scheme, store->name, store->remote_port, + Curl_ssl_cf_is_proxy(cf) ? "PROXY" : "server"); + sessionid_free_cb(ssl_sessionid, idsize); + return result; } - - if(added) - *added = TRUE; - - DEBUGF(infof(data, "Added Session ID to cache for %s://%s:%d [%s]", - store->scheme, store->name, store->remote_port, - Curl_ssl_cf_is_proxy(cf) ? "PROXY" : "server")); + CURL_TRC_CF(data, cf, "Added Session ID to cache for %s://%s:%d [%s]", + store->scheme, store->name, store->remote_port, + Curl_ssl_cf_is_proxy(cf) ? "PROXY" : "server"); return CURLE_OK; } -void Curl_free_multi_ssl_backend_data(struct multi_ssl_backend_data *mbackend) +CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int sockindex, + struct dynbuf *binding) { - if(Curl_ssl->free_multi_ssl_backend_data && mbackend) - Curl_ssl->free_multi_ssl_backend_data(mbackend); + if(Curl_ssl->get_channel_binding) + return Curl_ssl->get_channel_binding(data, sockindex, binding); + return CURLE_OK; } void Curl_ssl_close_all(struct Curl_easy *data) @@ -768,19 +795,20 @@ void Curl_ssl_close_all(struct Curl_easy *data) void Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, struct easy_pollset *ps) { - if(!cf->connected) { - struct ssl_connect_data *connssl = cf->ctx; + struct ssl_connect_data *connssl = cf->ctx; + + if(connssl->io_need) { curl_socket_t sock = Curl_conn_cf_get_socket(cf->next, data); if(sock != CURL_SOCKET_BAD) { - if(connssl->connecting_state == ssl_connect_2_writing) { + if(connssl->io_need & CURL_SSL_IO_NEED_SEND) { Curl_pollset_set_out_only(data, ps, sock); - CURL_TRC_CF(data, cf, "adjust_pollset, POLLOUT fd=%" - CURL_FORMAT_SOCKET_T, sock); + CURL_TRC_CF(data, cf, "adjust_pollset, POLLOUT fd=%" FMT_SOCKET_T, + sock); } else { Curl_pollset_set_in_only(data, ps, sock); - CURL_TRC_CF(data, cf, "adjust_pollset, POLLIN fd=%" - CURL_FORMAT_SOCKET_T, sock); + CURL_TRC_CF(data, cf, "adjust_pollset, POLLIN fd=%" FMT_SOCKET_T, + sock); } } } @@ -847,7 +875,7 @@ void Curl_ssl_free_certinfo(struct Curl_easy *data) if(ci->num_of_certs) { /* free all individual lists used */ int i; - for(i = 0; inum_of_certs; i++) { + for(i = 0; i < ci->num_of_certs; i++) { curl_slist_free_all(ci->certinfo[i]); ci->certinfo[i] = NULL; } @@ -891,7 +919,9 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, CURLcode result = CURLE_OK; struct dynbuf build; - Curl_dyn_init(&build, 10000); + DEBUGASSERT(certnum < ci->num_of_certs); + + Curl_dyn_init(&build, CURL_X509_STR_MAX); if(Curl_dyn_add(&build, label) || Curl_dyn_addn(&build, ":", 1) || @@ -910,11 +940,16 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, return result; } +/* get 32 bits of random */ CURLcode Curl_ssl_random(struct Curl_easy *data, unsigned char *entropy, size_t length) { - return Curl_ssl->random(data, entropy, length); + DEBUGASSERT(length == sizeof(int)); + if(Curl_ssl->random) + return Curl_ssl->random(data, entropy, length); + else + return CURLE_NOT_BUILT_IN; } /* @@ -924,14 +959,17 @@ CURLcode Curl_ssl_random(struct Curl_easy *data, static CURLcode pubkey_pem_to_der(const char *pem, unsigned char **der, size_t *der_len) { - char *stripped_pem, *begin_pos, *end_pos; - size_t pem_count, stripped_pem_count = 0, pem_len; + char *begin_pos, *end_pos; + size_t pem_count, pem_len; CURLcode result; + struct dynbuf pbuf; /* if no pem, exit. */ if(!pem) return CURLE_BAD_CONTENT_ENCODING; + Curl_dyn_init(&pbuf, MAX_PINNED_PUBKEY_SIZE); + begin_pos = strstr(pem, "-----BEGIN PUBLIC KEY-----"); if(!begin_pos) return CURLE_BAD_CONTENT_ENCODING; @@ -951,26 +989,23 @@ static CURLcode pubkey_pem_to_der(const char *pem, pem_len = end_pos - pem; - stripped_pem = malloc(pem_len - pem_count + 1); - if(!stripped_pem) - return CURLE_OUT_OF_MEMORY; - /* * Here we loop through the pem array one character at a time between the * correct indices, and place each character that is not '\n' or '\r' * into the stripped_pem array, which should represent the raw base64 string */ while(pem_count < pem_len) { - if('\n' != pem[pem_count] && '\r' != pem[pem_count]) - stripped_pem[stripped_pem_count++] = pem[pem_count]; + if('\n' != pem[pem_count] && '\r' != pem[pem_count]) { + result = Curl_dyn_addn(&pbuf, &pem[pem_count], 1); + if(result) + return result; + } ++pem_count; } - /* Place the null terminator in the correct place */ - stripped_pem[stripped_pem_count] = '\0'; - result = Curl_base64_decode(stripped_pem, der, der_len); + result = Curl_base64_decode(Curl_dyn_ptr(&pbuf), der, der_len); - Curl_safefree(stripped_pem); + Curl_dyn_free(&pbuf); return result; } @@ -983,21 +1018,19 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, const char *pinnedpubkey, const unsigned char *pubkey, size_t pubkeylen) { - FILE *fp; - unsigned char *buf = NULL, *pem_ptr = NULL; CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH; #ifdef CURL_DISABLE_VERBOSE_STRINGS (void)data; #endif - /* if a path wasn't specified, don't pin */ + /* if a path was not specified, do not pin */ if(!pinnedpubkey) return CURLE_OK; if(!pubkey || !pubkeylen) return result; /* only do this if pinnedpubkey starts with "sha256//", length 8 */ - if(strncmp(pinnedpubkey, "sha256//", 8) == 0) { + if(!strncmp(pinnedpubkey, "sha256//", 8)) { CURLcode encode; size_t encodedlen = 0; char *encoded = NULL, *pinkeycopy, *begin_pos, *end_pos; @@ -1038,7 +1071,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, end_pos = strstr(begin_pos, ";sha256//"); /* * if there is an end_pos, null terminate, - * otherwise it'll go to the end of the original string + * otherwise it will go to the end of the original string */ if(end_pos) end_pos[0] = '\0'; @@ -1061,75 +1094,78 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, } while(end_pos && begin_pos); Curl_safefree(encoded); Curl_safefree(pinkeycopy); - return result; } - - fp = fopen(pinnedpubkey, "rb"); - if(!fp) - return result; - - do { + else { long filesize; size_t size, pem_len; CURLcode pem_read; + struct dynbuf buf; + char unsigned *pem_ptr = NULL; + size_t left; + FILE *fp = fopen(pinnedpubkey, "rb"); + if(!fp) + return result; + + Curl_dyn_init(&buf, MAX_PINNED_PUBKEY_SIZE); /* Determine the file's size */ if(fseek(fp, 0, SEEK_END)) - break; + goto end; filesize = ftell(fp); if(fseek(fp, 0, SEEK_SET)) - break; + goto end; if(filesize < 0 || filesize > MAX_PINNED_PUBKEY_SIZE) - break; + goto end; /* * if the size of our certificate is bigger than the file - * size then it can't match + * size then it cannot match */ size = curlx_sotouz((curl_off_t) filesize); if(pubkeylen > size) - break; + goto end; /* - * Allocate buffer for the pinned key - * With 1 additional byte for null terminator in case of PEM key + * Read the file into the dynbuf */ - buf = malloc(size + 1); - if(!buf) - break; + left = size; + do { + char buffer[1024]; + size_t want = left > sizeof(buffer) ? sizeof(buffer) : left; + if(want != fread(buffer, 1, want, fp)) + goto end; + if(Curl_dyn_addn(&buf, buffer, want)) + goto end; + left -= want; + } while(left); - /* Returns number of elements read, which should be 1 */ - if((int) fread(buf, size, 1, fp) != 1) - break; - - /* If the sizes are the same, it can't be base64 encoded, must be der */ + /* If the sizes are the same, it cannot be base64 encoded, must be der */ if(pubkeylen == size) { - if(!memcmp(pubkey, buf, pubkeylen)) + if(!memcmp(pubkey, Curl_dyn_ptr(&buf), pubkeylen)) result = CURLE_OK; - break; + goto end; } /* - * Otherwise we will assume it's PEM and try to decode it + * Otherwise we will assume it is PEM and try to decode it * after placing null terminator */ - buf[size] = '\0'; - pem_read = pubkey_pem_to_der((const char *)buf, &pem_ptr, &pem_len); - /* if it wasn't read successfully, exit */ + pem_read = pubkey_pem_to_der(Curl_dyn_ptr(&buf), &pem_ptr, &pem_len); + /* if it was not read successfully, exit */ if(pem_read) - break; + goto end; /* - * if the size of our certificate doesn't match the size of - * the decoded file, they can't be the same, otherwise compare + * if the size of our certificate does not match the size of + * the decoded file, they cannot be the same, otherwise compare */ if(pubkeylen == pem_len && !memcmp(pubkey, pem_ptr, pubkeylen)) result = CURLE_OK; - } while(0); - - Curl_safefree(buf); - Curl_safefree(pem_ptr); - fclose(fp); +end: + Curl_dyn_free(&buf); + Curl_safefree(pem_ptr); + fclose(fp); + } return result; } @@ -1163,12 +1199,18 @@ int Curl_none_init(void) void Curl_none_cleanup(void) { } -int Curl_none_shutdown(struct Curl_cfilter *cf UNUSED_PARAM, - struct Curl_easy *data UNUSED_PARAM) +CURLcode Curl_none_shutdown(struct Curl_cfilter *cf UNUSED_PARAM, + struct Curl_easy *data UNUSED_PARAM, + bool send_shutdown UNUSED_PARAM, + bool *done) { (void)data; (void)cf; - return 0; + (void)send_shutdown; + /* Every SSL backend should have a shutdown implementation. Until we + * have implemented that, we put this fake in place. */ + *done = TRUE; + return CURLE_OK; } int Curl_none_check_cxn(struct Curl_cfilter *cf, struct Curl_easy *data) @@ -1178,16 +1220,6 @@ int Curl_none_check_cxn(struct Curl_cfilter *cf, struct Curl_easy *data) return -1; } -CURLcode Curl_none_random(struct Curl_easy *data UNUSED_PARAM, - unsigned char *entropy UNUSED_PARAM, - size_t length UNUSED_PARAM) -{ - (void)data; - (void)entropy; - (void)length; - return CURLE_NOT_BUILT_IN; -} - void Curl_none_close_all(struct Curl_easy *data UNUSED_PARAM) { (void)data; @@ -1314,7 +1346,7 @@ static const struct Curl_ssl Curl_ssl_multi = { Curl_none_check_cxn, /* check_cxn */ Curl_none_shutdown, /* shutdown */ Curl_none_data_pending, /* data_pending */ - Curl_none_random, /* random */ + NULL, /* random */ Curl_none_cert_status_request, /* cert_status_request */ multissl_connect, /* connect */ multissl_connect_nonblocking, /* connect_nonblocking */ @@ -1322,7 +1354,6 @@ static const struct Curl_ssl Curl_ssl_multi = { multissl_get_internals, /* get_internals */ multissl_close, /* close_one */ Curl_none_close_all, /* close_all */ - Curl_none_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -1330,9 +1361,9 @@ static const struct Curl_ssl Curl_ssl_multi = { NULL, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ multissl_recv_plain, /* recv decrypted data */ multissl_send_plain, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; const struct Curl_ssl *Curl_ssl = @@ -1340,8 +1371,6 @@ const struct Curl_ssl *Curl_ssl = &Curl_ssl_multi; #elif defined(USE_WOLFSSL) &Curl_ssl_wolfssl; -#elif defined(USE_SECTRANSP) - &Curl_ssl_sectransp; #elif defined(USE_GNUTLS) &Curl_ssl_gnutls; #elif defined(USE_MBEDTLS) @@ -1350,6 +1379,8 @@ const struct Curl_ssl *Curl_ssl = &Curl_ssl_rustls; #elif defined(USE_OPENSSL) &Curl_ssl_openssl; +#elif defined(USE_SECTRANSP) + &Curl_ssl_sectransp; #elif defined(USE_SCHANNEL) &Curl_ssl_schannel; #elif defined(USE_BEARSSL) @@ -1362,9 +1393,6 @@ static const struct Curl_ssl *available_backends[] = { #if defined(USE_WOLFSSL) &Curl_ssl_wolfssl, #endif -#if defined(USE_SECTRANSP) - &Curl_ssl_sectransp, -#endif #if defined(USE_GNUTLS) &Curl_ssl_gnutls, #endif @@ -1374,6 +1402,9 @@ static const struct Curl_ssl *available_backends[] = { #if defined(USE_OPENSSL) &Curl_ssl_openssl, #endif +#if defined(USE_SECTRANSP) + &Curl_ssl_sectransp, +#endif #if defined(USE_SCHANNEL) &Curl_ssl_schannel, #endif @@ -1386,6 +1417,19 @@ static const struct Curl_ssl *available_backends[] = { NULL }; +/* Global cleanup */ +void Curl_ssl_cleanup(void) +{ + if(init_ssl) { + /* only cleanup if we did a previous init */ + Curl_ssl->cleanup(); +#if defined(CURL_WITH_MULTI_SSL) + Curl_ssl = &Curl_ssl_multi; +#endif + init_ssl = FALSE; + } +} + static size_t multissl_version(char *buffer, size_t size) { static const struct Curl_ssl *selected; @@ -1533,14 +1577,14 @@ static void cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) static ssl_peer_type get_peer_type(const char *hostname) { if(hostname && hostname[0]) { -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif if(Curl_inet_pton(AF_INET, hostname, &addr)) return CURL_SSL_PEER_IPV4; -#ifdef ENABLE_IPV6 +#ifdef USE_IPV6 else if(Curl_inet_pton(AF_INET6, hostname, &addr)) { return CURL_SSL_PEER_IPV6; } @@ -1549,73 +1593,74 @@ static ssl_peer_type get_peer_type(const char *hostname) return CURL_SSL_PEER_DNS; } -CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, struct Curl_cfilter *cf) +CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, struct Curl_cfilter *cf, + int transport) { - struct ssl_connect_data *connssl = cf->ctx; const char *ehostname, *edispname; - int eport; + CURLcode result = CURLE_OUT_OF_MEMORY; - /* We need the hostname for SNI negotiation. Once handshaked, this - * remains the SNI hostname for the TLS connection. But when the - * connection is reused, the settings in cf->conn might change. - * So we keep a copy of the hostname we use for SNI. + /* We expect a clean struct, e.g. called only ONCE */ + DEBUGASSERT(peer); + DEBUGASSERT(!peer->hostname); + DEBUGASSERT(!peer->dispname); + DEBUGASSERT(!peer->sni); + /* We need the hostname for SNI negotiation. Once handshaked, this remains + * the SNI hostname for the TLS connection. When the connection is reused, + * the settings in cf->conn might change. We keep a copy of the hostname we + * use for SNI. */ + peer->transport = transport; #ifndef CURL_DISABLE_PROXY if(Curl_ssl_cf_is_proxy(cf)) { ehostname = cf->conn->http_proxy.host.name; edispname = cf->conn->http_proxy.host.dispname; - eport = cf->conn->http_proxy.port; + peer->port = cf->conn->http_proxy.port; } else #endif { ehostname = cf->conn->host.name; edispname = cf->conn->host.dispname; - eport = cf->conn->remote_port; + peer->port = cf->conn->remote_port; } - /* change if ehostname changed */ - DEBUGASSERT(!ehostname || ehostname[0]); - if(ehostname && (!peer->hostname - || strcmp(ehostname, peer->hostname))) { + /* hostname MUST exist and not be empty */ + if(!ehostname || !ehostname[0]) { + result = CURLE_FAILED_INIT; + goto out; + } + + peer->hostname = strdup(ehostname); + if(!peer->hostname) + goto out; + if(!edispname || !strcmp(ehostname, edispname)) + peer->dispname = peer->hostname; + else { + peer->dispname = strdup(edispname); + if(!peer->dispname) + goto out; + } + peer->type = get_peer_type(peer->hostname); + if(peer->type == CURL_SSL_PEER_DNS) { + /* 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] == '.')) + len--; + if(len < USHRT_MAX) { + peer->sni = calloc(1, len + 1); + if(!peer->sni) + goto out; + Curl_strntolower(peer->sni, peer->hostname, len); + peer->sni[len] = 0; + } + } + result = CURLE_OK; + +out: + if(result) Curl_ssl_peer_cleanup(peer); - peer->hostname = strdup(ehostname); - if(!peer->hostname) { - Curl_ssl_peer_cleanup(peer); - return CURLE_OUT_OF_MEMORY; - } - if(!edispname || !strcmp(ehostname, edispname)) - peer->dispname = peer->hostname; - else { - peer->dispname = strdup(edispname); - if(!peer->dispname) { - Curl_ssl_peer_cleanup(peer); - return CURLE_OUT_OF_MEMORY; - } - } - - peer->sni = NULL; - peer->type = get_peer_type(peer->hostname); - if(peer->type == CURL_SSL_PEER_DNS && peer->hostname[0]) { - /* 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] == '.')) - len--; - if(len < USHRT_MAX) { - peer->sni = calloc(1, len + 1); - if(!peer->sni) { - Curl_ssl_peer_cleanup(peer); - return CURLE_OUT_OF_MEMORY; - } - Curl_strntolower(peer->sni, peer->hostname, len); - peer->sni[len] = 0; - } - } - - } - connssl->port = eport; - return CURLE_OK; + return result; } static void ssl_cf_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) @@ -1654,22 +1699,29 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, return CURLE_OK; } + if(!cf->next) { + *done = FALSE; + return CURLE_FAILED_INIT; + } + + if(!cf->next->connected) { + result = cf->next->cft->do_connect(cf->next, data, blocking, done); + if(result || !*done) + return result; + } + CF_DATA_SAVE(save, cf, data); CURL_TRC_CF(data, cf, "cf_connect()"); - (void)connssl; DEBUGASSERT(data->conn); DEBUGASSERT(data->conn == cf->conn); DEBUGASSERT(connssl); - DEBUGASSERT(cf->conn->host.name); - - result = cf->next->cft->do_connect(cf->next, data, blocking, done); - if(result || !*done) - goto out; *done = FALSE; - result = Curl_ssl_peer_init(&connssl->peer, cf); - if(result) - goto out; + if(!connssl->peer.hostname) { + result = Curl_ssl_peer_init(&connssl->peer, cf, TRNSPRT_TCP); + if(result) + goto out; + } if(blocking) { result = ssl_connect(cf, data); @@ -1682,7 +1734,9 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, if(!result && *done) { cf->connected = TRUE; connssl->handshake_done = Curl_now(); - DEBUGASSERT(connssl->state == ssl_connection_complete); + /* Connection can be deferred when sending early data */ + DEBUGASSERT(connssl->state == ssl_connection_complete || + connssl->state == ssl_connection_deferred); } out: CURL_TRC_CF(data, cf, "cf_connect() -> %d, done=%d", result, *done); @@ -1707,15 +1761,19 @@ static bool ssl_cf_data_pending(struct Curl_cfilter *cf, static ssize_t ssl_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, const void *buf, size_t len, - CURLcode *err) + bool eos, CURLcode *err) { struct cf_call_data save; - ssize_t nwritten; + ssize_t nwritten = 0; - CF_DATA_SAVE(save, cf, data); + (void)eos; + /* OpenSSL and maybe other TLS libs do not like 0-length writes. Skip. */ *err = CURLE_OK; - nwritten = Curl_ssl->send_plain(cf, data, buf, len, err); - CF_DATA_RESTORE(cf, save); + if(len > 0) { + CF_DATA_SAVE(save, cf, data); + nwritten = Curl_ssl->send_plain(cf, data, buf, len, err); + CF_DATA_RESTORE(cf, save); + } return nwritten; } @@ -1742,17 +1800,34 @@ static ssize_t ssl_cf_recv(struct Curl_cfilter *cf, return nread; } +static CURLcode ssl_cf_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool *done) +{ + CURLcode result = CURLE_OK; + + *done = TRUE; + if(!cf->shutdown) { + struct cf_call_data save; + + CF_DATA_SAVE(save, cf, data); + result = Curl_ssl->shut_down(cf, data, TRUE, done); + CURL_TRC_CF(data, cf, "cf_shutdown -> %d, done=%d", result, *done); + CF_DATA_RESTORE(cf, save); + cf->shutdown = (result || *done); + } + return result; +} + static void ssl_cf_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { struct cf_call_data save; - if(!cf->connected) { - CF_DATA_SAVE(save, cf, data); - Curl_ssl->adjust_pollset(cf, data, ps); - CF_DATA_RESTORE(cf, save); - } + CF_DATA_SAVE(save, cf, data); + Curl_ssl->adjust_pollset(cf, data, ps); + CF_DATA_RESTORE(cf, save); } static CURLcode ssl_cf_cntrl(struct Curl_cfilter *cf, @@ -1800,7 +1875,7 @@ static CURLcode ssl_cf_query(struct Curl_cfilter *cf, default: break; } - return cf->next? + return cf->next ? cf->next->cft->query(cf->next, data, query, pres1, pres2) : CURLE_UNKNOWN_OPTION; } @@ -1830,7 +1905,7 @@ static bool cf_ssl_is_alive(struct Curl_cfilter *cf, struct Curl_easy *data, return FALSE; } /* ssl backend does not know */ - return cf->next? + return cf->next ? cf->next->cft->is_alive(cf->next, data, input_pending) : FALSE; /* pessimistic in absence of data */ } @@ -1842,6 +1917,7 @@ struct Curl_cftype Curl_cft_ssl = { ssl_cf_destroy, ssl_cf_connect, ssl_cf_close, + ssl_cf_shutdown, Curl_cf_def_get_host, ssl_cf_adjust_pollset, ssl_cf_data_pending, @@ -1857,11 +1933,12 @@ struct Curl_cftype Curl_cft_ssl = { struct Curl_cftype Curl_cft_ssl_proxy = { "SSL-PROXY", - CF_TYPE_SSL, + CF_TYPE_SSL|CF_TYPE_PROXY, CURL_LOG_LVL_NONE, ssl_cf_destroy, ssl_cf_connect, ssl_cf_close, + ssl_cf_shutdown, Curl_cf_def_get_host, ssl_cf_adjust_pollset, ssl_cf_data_pending, @@ -1897,7 +1974,7 @@ static CURLcode cf_ssl_create(struct Curl_cfilter **pcf, out: if(result) cf_ctx_free(ctx); - *pcf = result? NULL : cf; + *pcf = result ? NULL : cf; return result; } @@ -1955,7 +2032,7 @@ static CURLcode cf_ssl_proxy_create(struct Curl_cfilter **pcf, out: if(result) cf_ctx_free(ctx); - *pcf = result? NULL : cf; + *pcf = result ? NULL : cf; return result; } @@ -1973,10 +2050,10 @@ CURLcode Curl_cf_ssl_proxy_insert_after(struct Curl_cfilter *cf_at, #endif /* !CURL_DISABLE_PROXY */ -bool Curl_ssl_supports(struct Curl_easy *data, int option) +bool Curl_ssl_supports(struct Curl_easy *data, unsigned int ssl_option) { (void)data; - return (Curl_ssl->supports & option)? TRUE : FALSE; + return (Curl_ssl->supports & ssl_option); } static struct Curl_cfilter *get_ssl_filter(struct Curl_cfilter *cf) @@ -2012,19 +2089,77 @@ void *Curl_ssl_get_internals(struct Curl_easy *data, int sockindex, return result; } +static CURLcode vtls_shutdown_blocking(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct cf_call_data save; + CURLcode result = CURLE_OK; + timediff_t timeout_ms; + int what, loop = 10; + + if(cf->shutdown) { + *done = TRUE; + return CURLE_OK; + } + CF_DATA_SAVE(save, cf, data); + + *done = FALSE; + while(!result && !*done && loop--) { + timeout_ms = Curl_shutdown_timeleft(cf->conn, cf->sockindex, NULL); + + if(timeout_ms < 0) { + /* no need to continue if time is already up */ + failf(data, "SSL shutdown timeout"); + return CURLE_OPERATION_TIMEDOUT; + } + + result = Curl_ssl->shut_down(cf, data, send_shutdown, done); + if(result ||*done) + goto out; + + if(connssl->io_need) { + what = Curl_conn_cf_poll(cf, data, timeout_ms); + if(what < 0) { + /* fatal error */ + failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); + result = CURLE_RECV_ERROR; + goto out; + } + else if(0 == what) { + /* timeout */ + failf(data, "SSL shutdown timeout"); + result = CURLE_OPERATION_TIMEDOUT; + goto out; + } + /* socket is readable or writable */ + } + } +out: + CF_DATA_RESTORE(cf, save); + cf->shutdown = (result || *done); + return result; +} + CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data, - int sockindex) + int sockindex, bool send_shutdown) { struct Curl_cfilter *cf, *head; CURLcode result = CURLE_OK; - (void)data; - head = data->conn? data->conn->cfilter[sockindex] : NULL; + head = data->conn ? data->conn->cfilter[sockindex] : NULL; for(cf = head; cf; cf = cf->next) { if(cf->cft == &Curl_cft_ssl) { - if(Curl_ssl->shut_down(cf, data)) + bool done; + CURL_TRC_CF(data, cf, "shutdown and remove SSL, start"); + Curl_shutdown_start(data, sockindex, NULL); + result = vtls_shutdown_blocking(cf, data, send_shutdown, &done); + Curl_shutdown_clear(data, sockindex); + if(!result && !done) /* blocking failed? */ result = CURLE_SSL_SHUTDOWN_FAILED; Curl_conn_cf_discard_sub(head, cf, data, FALSE); + CURL_TRC_CF(data, cf, "shutdown and remove SSL, done -> %d", result); break; } } @@ -2033,12 +2168,7 @@ CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data, bool Curl_ssl_cf_is_proxy(struct Curl_cfilter *cf) { -#ifndef CURL_DISABLE_PROXY - return (cf->cft == &Curl_cft_ssl_proxy); -#else - (void)cf; - return FALSE; -#endif + return (cf->cft->flags & CF_TYPE_SSL) && (cf->cft->flags & CF_TYPE_PROXY); } struct ssl_config_data * @@ -2048,7 +2178,7 @@ Curl_ssl_cf_get_config(struct Curl_cfilter *cf, struct Curl_easy *data) (void)cf; return &data->set.ssl; #else - return Curl_ssl_cf_is_proxy(cf)? &data->set.proxy_ssl : &data->set.ssl; + return Curl_ssl_cf_is_proxy(cf) ? &data->set.proxy_ssl : &data->set.ssl; #endif } @@ -2058,7 +2188,7 @@ Curl_ssl_cf_get_primary_config(struct Curl_cfilter *cf) #ifdef CURL_DISABLE_PROXY return &cf->conn->ssl_config; #else - return Curl_ssl_cf_is_proxy(cf)? + return Curl_ssl_cf_is_proxy(cf) ? &cf->conn->proxy_ssl_config : &cf->conn->ssl_config; #endif } @@ -2109,21 +2239,73 @@ CURLcode Curl_alpn_to_proto_str(struct alpn_proto_buf *buf, return CURLE_OK; } +bool Curl_alpn_contains_proto(const struct alpn_spec *spec, + const char *proto) +{ + size_t i, plen = proto ? strlen(proto) : 0; + for(i = 0; spec && plen && i < spec->count; ++i) { + size_t slen = strlen(spec->entries[i]); + if((slen == plen) && !memcmp(proto, spec->entries[i], plen)) + return TRUE; + } + return FALSE; +} + CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, struct Curl_easy *data, + struct ssl_connect_data *connssl, const unsigned char *proto, size_t proto_len) { - int can_multi = 0; + CURLcode result = CURLE_OK; unsigned char *palpn = #ifndef CURL_DISABLE_PROXY - (cf->conn->bits.tunnel_proxy && Curl_ssl_cf_is_proxy(cf))? + (cf->conn->bits.tunnel_proxy && Curl_ssl_cf_is_proxy(cf)) ? &cf->conn->proxy_alpn : &cf->conn->alpn #else &cf->conn->alpn #endif ; + if(connssl->alpn_negotiated) { + /* When we ask for a specific ALPN protocol, we need the confirmation + * of it by the server, as we have installed protocol handler and + * connection filter chain for exactly this protocol. */ + if(!proto_len) { + failf(data, "ALPN: asked for '%s' from previous session, " + "but server did not confirm it. Refusing to continue.", + connssl->alpn_negotiated); + result = CURLE_SSL_CONNECT_ERROR; + goto out; + } + else if((strlen(connssl->alpn_negotiated) != proto_len) || + memcmp(connssl->alpn_negotiated, proto, proto_len)) { + failf(data, "ALPN: asked for '%s' from previous session, but server " + "selected '%.*s'. Refusing to continue.", + connssl->alpn_negotiated, (int)proto_len, proto); + result = CURLE_SSL_CONNECT_ERROR; + goto out; + } + /* ALPN is exactly what we asked for, done. */ + infof(data, "ALPN: server confirmed to use '%s'", + connssl->alpn_negotiated); + goto out; + } + + if(proto && proto_len) { + if(memchr(proto, '\0', proto_len)) { + failf(data, "ALPN: server selected protocol contains NUL. " + "Refusing to continue."); + result = CURLE_SSL_CONNECT_ERROR; + goto out; + } + connssl->alpn_negotiated = malloc(proto_len + 1); + if(!connssl->alpn_negotiated) + return CURLE_OUT_OF_MEMORY; + memcpy(connssl->alpn_negotiated, proto, proto_len); + connssl->alpn_negotiated[proto_len] = 0; + } + if(proto && proto_len) { if(proto_len == ALPN_HTTP_1_1_LENGTH && !memcmp(ALPN_HTTP_1_1, proto, ALPN_HTTP_1_1_LENGTH)) { @@ -2133,14 +2315,12 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, else if(proto_len == ALPN_H2_LENGTH && !memcmp(ALPN_H2, proto, ALPN_H2_LENGTH)) { *palpn = CURL_HTTP_VERSION_2; - can_multi = 1; } #endif #ifdef USE_HTTP3 else if(proto_len == ALPN_H3_LENGTH && !memcmp(ALPN_H3, proto, ALPN_H3_LENGTH)) { *palpn = CURL_HTTP_VERSION_3; - can_multi = 1; } #endif else { @@ -2151,18 +2331,22 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, /* return CURLE_NOT_BUILT_IN; */ goto out; } - infof(data, VTLS_INFOF_ALPN_ACCEPTED_LEN_1STR, (int)proto_len, proto); + + if(connssl->state == ssl_connection_deferred) + infof(data, VTLS_INFOF_ALPN_DEFERRED, (int)proto_len, proto); + else + infof(data, VTLS_INFOF_ALPN_ACCEPTED, (int)proto_len, proto); } else { *palpn = CURL_HTTP_VERSION_NONE; - infof(data, VTLS_INFOF_NO_ALPN); + if(connssl->state == ssl_connection_deferred) + infof(data, VTLS_INFOF_NO_ALPN_DEFERRED); + else + infof(data, VTLS_INFOF_NO_ALPN); } out: - if(!Curl_ssl_cf_is_proxy(cf)) - Curl_multiuse_state(data, can_multi? - BUNDLE_MULTIPLEX : BUNDLE_NO_MULTIUSE); - return CURLE_OK; + return result; } #endif /* USE_SSL */ diff --git a/deps/curl/lib/vtls/vtls.h b/deps/curl/lib/vtls/vtls.h index 744bbf8f..7a223f6f 100644 --- a/deps/curl/lib/vtls/vtls.h +++ b/deps/curl/lib/vtls/vtls.h @@ -37,21 +37,26 @@ struct Curl_ssl_session; #define SSLSUPP_HTTPS_PROXY (1<<4) /* supports access via HTTPS proxies */ #define SSLSUPP_TLS13_CIPHERSUITES (1<<5) /* supports TLS 1.3 ciphersuites */ #define SSLSUPP_CAINFO_BLOB (1<<6) +#define SSLSUPP_ECH (1<<7) +#define SSLSUPP_CA_CACHE (1<<8) +#define SSLSUPP_CIPHER_LIST (1<<9) /* supports TLS 1.0-1.2 ciphersuites */ #define ALPN_ACCEPTED "ALPN: server accepted " -#define VTLS_INFOF_NO_ALPN \ +#define VTLS_INFOF_NO_ALPN \ "ALPN: server did not agree on a protocol. Uses default." -#define VTLS_INFOF_ALPN_OFFER_1STR \ +#define VTLS_INFOF_ALPN_OFFER_1STR \ "ALPN: curl offers %s" -#define VTLS_INFOF_ALPN_ACCEPTED_1STR \ - ALPN_ACCEPTED "%s" -#define VTLS_INFOF_ALPN_ACCEPTED_LEN_1STR \ +#define VTLS_INFOF_ALPN_ACCEPTED \ ALPN_ACCEPTED "%.*s" +#define VTLS_INFOF_NO_ALPN_DEFERRED \ + "ALPN: deferred handshake for early data without specific protocol." +#define VTLS_INFOF_ALPN_DEFERRED \ + "ALPN: deferred handshake for early data using '%.*s'." + /* Curl_multi SSL backend-specific data; declared differently by each SSL backend */ -struct multi_ssl_backend_data; struct Curl_cfilter; CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name, @@ -91,7 +96,7 @@ CURLcode Curl_ssl_conn_config_init(struct Curl_easy *data, void Curl_ssl_conn_config_cleanup(struct connectdata *conn); /** - * Return TRUE iff SSL configuration from `conn` is functionally the + * Return TRUE iff SSL configuration from `data` is functionally the * same as the one on `candidate`. * @param proxy match the proxy SSL config or the main one */ @@ -107,7 +112,8 @@ void Curl_ssl_conn_config_update(struct Curl_easy *data, bool for_proxy); /** * Init SSL peer information for filter. Can be called repeatedly. */ -CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, struct Curl_cfilter *cf); +CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, + struct Curl_cfilter *cf, int transport); /** * Free all allocated data and reset peer information. */ @@ -129,6 +135,7 @@ CURLcode Curl_ssl_initsessions(struct Curl_easy *, size_t); void Curl_ssl_version(char *buffer, size_t size); /* Certificate information list handling. */ +#define CURL_X509_STR_MAX 100000 void Curl_ssl_free_certinfo(struct Curl_easy *data); CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num); @@ -179,7 +186,24 @@ bool Curl_ssl_cert_status_request(void); bool Curl_ssl_false_start(struct Curl_easy *data); -void Curl_free_multi_ssl_backend_data(struct multi_ssl_backend_data *mbackend); +/* The maximum size of the SSL channel binding is 85 bytes, as defined in + * RFC 5929, Section 4.1. The 'tls-server-end-point:' prefix is 21 bytes long, + * and SHA-512 is the longest supported hash algorithm, with a digest length of + * 64 bytes. + * The maximum size of the channel binding is therefore 21 + 64 = 85 bytes. + */ +#define SSL_CB_MAX_SIZE 85 + +/* Return the tls-server-end-point channel binding, including the + * 'tls-server-end-point:' prefix. + * If successful, the data is written to the dynbuf, and CURLE_OK is returned. + * The dynbuf MUST HAVE a minimum toobig size of SSL_CB_MAX_SIZE. + * If the dynbuf is too small, CURLE_OUT_OF_MEMORY is returned. + * If channel binding is not supported, binding stays empty and CURLE_OK is + * returned. + */ +CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int sockindex, + struct dynbuf *binding); #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */ @@ -191,7 +215,7 @@ CURLcode Curl_cf_ssl_insert_after(struct Curl_cfilter *cf_at, struct Curl_easy *data); CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data, - int sockindex); + int sockindex, bool send_shutdown); #ifndef CURL_DISABLE_PROXY CURLcode Curl_cf_ssl_proxy_insert_after(struct Curl_cfilter *cf_at, @@ -203,7 +227,7 @@ CURLcode Curl_cf_ssl_proxy_insert_after(struct Curl_cfilter *cf_at, * Option is one of the defined SSLSUPP_* values. * `data` maybe NULL for the features of the default implementation. */ -bool Curl_ssl_supports(struct Curl_easy *data, int ssl_option); +bool Curl_ssl_supports(struct Curl_easy *data, unsigned int ssl_option); /** * Get the internal ssl instance (like OpenSSL's SSL*) from the filter @@ -250,7 +274,7 @@ extern struct Curl_cftype Curl_cft_ssl_proxy; #define Curl_ssl_get_internals(a,b,c,d) 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) CURLE_OK +#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/deps/curl/lib/vtls/vtls_int.h b/deps/curl/lib/vtls/vtls_int.h index af7ae552..660c3379 100644 --- a/deps/curl/lib/vtls/vtls_int.h +++ b/deps/curl/lib/vtls/vtls_int.h @@ -29,6 +29,8 @@ #ifdef USE_SSL +struct ssl_connect_data; + /* see https://www.iana.org/assignments/tls-extensiontype-values/ */ #define ALPN_HTTP_1_1_LENGTH 8 #define ALPN_HTTP_1_1 "http/1.1" @@ -61,21 +63,62 @@ CURLcode Curl_alpn_to_proto_str(struct alpn_proto_buf *buf, CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, struct Curl_easy *data, + struct ssl_connect_data *connssl, const unsigned char *proto, size_t proto_len); +bool Curl_alpn_contains_proto(const struct alpn_spec *spec, + const char *proto); + +/* enum for the nonblocking SSL connection state machine */ +typedef enum { + ssl_connect_1, + ssl_connect_2, + ssl_connect_3, + ssl_connect_done +} ssl_connect_state; + +typedef enum { + ssl_connection_none, + ssl_connection_deferred, + ssl_connection_negotiating, + ssl_connection_complete +} ssl_connection_state; + +typedef enum { + ssl_earlydata_none, + ssl_earlydata_use, + ssl_earlydata_sending, + ssl_earlydata_sent, + ssl_earlydata_accepted, + ssl_earlydata_rejected +} 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) + +/* Max earlydata payload we want to send */ +#define CURL_SSL_EARLY_MAX (64*1024) + /* Information in each SSL cfilter context: cf->ctx */ struct ssl_connect_data { - ssl_connection_state state; - ssl_connect_state connecting_state; struct ssl_peer peer; const struct alpn_spec *alpn; /* ALPN to use or NULL for none */ void *backend; /* vtls backend specific props */ struct cf_call_data call_data; /* data handle used in current call */ struct curltime handshake_done; /* time when handshake finished */ - int port; /* remote port at origin */ + char *alpn_negotiated; /* negotiated ALPN value or NULL */ + struct bufq earlydata; /* earlydata to be send to peer */ + size_t earlydata_max; /* max earlydata allowed by peer */ + size_t earlydata_skip; /* sending bytes to skip when earlydata + * is accepted by peer */ + ssl_connection_state state; + ssl_connect_state connecting_state; + ssl_earlydata_state earlydata_state; + int io_need; /* TLS signals special SEND/RECV needs */ BIT(use_alpn); /* if ALPN shall be used in handshake */ - BIT(reused_session); /* session-ID was reused for this */ + BIT(peer_closed); /* peer has closed connection */ }; @@ -100,8 +143,8 @@ struct Curl_ssl { size_t (*version)(char *buffer, size_t size); int (*check_cxn)(struct Curl_cfilter *cf, struct Curl_easy *data); - int (*shut_down)(struct Curl_cfilter *cf, - struct Curl_easy *data); + CURLcode (*shut_down)(struct Curl_cfilter *cf, struct Curl_easy *data, + bool send_shutdown, bool *done); bool (*data_pending)(struct Curl_cfilter *cf, const struct Curl_easy *data); @@ -116,15 +159,13 @@ struct Curl_ssl { struct Curl_easy *data, bool *done); - /* During handshake, adjust the pollset to include the socket - * for POLLOUT or POLLIN as needed. - * Mandatory. */ + /* During handshake/shutdown, adjust the pollset to include the socket + * for POLLOUT or POLLIN as needed. Mandatory. */ void (*adjust_pollset)(struct Curl_cfilter *cf, struct Curl_easy *data, struct easy_pollset *ps); void *(*get_internals)(struct ssl_connect_data *connssl, CURLINFO info); void (*close)(struct Curl_cfilter *cf, struct Curl_easy *data); void (*close_all)(struct Curl_easy *data); - void (*session_free)(void *ptr); CURLcode (*set_engine)(struct Curl_easy *data, const char *engine); CURLcode (*set_engine_default)(struct Curl_easy *data); @@ -137,13 +178,14 @@ struct Curl_ssl { bool (*attach_data)(struct Curl_cfilter *cf, struct Curl_easy *data); void (*detach_data)(struct Curl_cfilter *cf, struct Curl_easy *data); - void (*free_multi_ssl_backend_data)(struct multi_ssl_backend_data *mbackend); - ssize_t (*recv_plain)(struct Curl_cfilter *cf, struct Curl_easy *data, char *buf, size_t len, CURLcode *code); ssize_t (*send_plain)(struct Curl_cfilter *cf, struct Curl_easy *data, const void *mem, size_t len, CURLcode *code); + CURLcode (*get_channel_binding)(struct Curl_easy *data, int sockindex, + struct dynbuf *binding); + }; extern const struct Curl_ssl *Curl_ssl; @@ -151,10 +193,9 @@ extern const struct Curl_ssl *Curl_ssl; int Curl_none_init(void); void Curl_none_cleanup(void); -int Curl_none_shutdown(struct Curl_cfilter *cf, struct Curl_easy *data); +CURLcode Curl_none_shutdown(struct Curl_cfilter *cf, struct Curl_easy *data, + bool send_shutdown, bool *done); int Curl_none_check_cxn(struct Curl_cfilter *cf, struct Curl_easy *data); -CURLcode Curl_none_random(struct Curl_easy *data, unsigned char *entropy, - size_t length); void Curl_none_close_all(struct Curl_easy *data); void Curl_none_session_free(void *ptr); bool Curl_none_data_pending(struct Curl_cfilter *cf, @@ -177,30 +218,46 @@ bool Curl_ssl_cf_is_proxy(struct Curl_cfilter *cf); * Caller must make sure that the ownership of returned sessionid object * is properly taken (e.g. its refcount is incremented * under sessionid mutex). + * @param cf the connection filter wanting to use it + * @param data the transfer involved + * @param peer the peer the filter wants to talk to + * @param sessionid on return the TLS session + * @param idsize on return the size of the TLS session data + * @param palpn on return the ALPN string used by the session, + * set to NULL when not interested */ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf, struct Curl_easy *data, + const struct ssl_peer *peer, void **ssl_sessionid, - size_t *idsize); /* set 0 if unknown */ -/* add a new session ID + size_t *idsize, /* set 0 if unknown */ + char **palpn); + +/* Set a TLS session ID for `peer`. Replaces an existing session ID if + * not already the same. * Sessionid mutex must be locked (see Curl_ssl_sessionid_lock). + * Call takes ownership of `ssl_sessionid`, using `sessionid_free_cb` + * to deallocate it. Is called in all outcomes, either right away or + * later when the session cache is cleaned up. * Caller must ensure that it has properly shared ownership of this sessionid * object with cache (e.g. incrementing refcount on success) */ -CURLcode Curl_ssl_addsessionid(struct Curl_cfilter *cf, - struct Curl_easy *data, - void *ssl_sessionid, - size_t idsize, - bool *added); +CURLcode Curl_ssl_set_sessionid(struct Curl_cfilter *cf, + struct Curl_easy *data, + const struct ssl_peer *peer, + const char *alpn, + void *sessionid, + size_t sessionid_size, + Curl_ssl_sessionid_dtor *sessionid_free_cb); #include "openssl.h" /* OpenSSL versions */ #include "gtls.h" /* GnuTLS versions */ #include "wolfssl.h" /* wolfSSL versions */ #include "schannel.h" /* Schannel SSPI version */ -#include "sectransp.h" /* SecureTransport (Darwin) version */ +#include "sectransp.h" /* Secure Transport (Darwin) version */ #include "mbedtls.h" /* mbedTLS versions */ #include "bearssl.h" /* BearSSL versions */ -#include "rustls.h" /* rustls versions */ +#include "rustls.h" /* Rustls versions */ #endif /* USE_SSL */ diff --git a/deps/curl/lib/vtls/wolfssl.c b/deps/curl/lib/vtls/wolfssl.c index a3c017ce..bc383ec5 100644 --- a/deps/curl/lib/vtls/wolfssl.c +++ b/deps/curl/lib/vtls/wolfssl.c @@ -36,6 +36,10 @@ #include #include +#if LIBWOLFSSL_VERSION_HEX < 0x03004006 /* wolfSSL 3.4.6 (2015) */ +#error "wolfSSL version should be at least 3.4.6" +#endif + /* To determine what functions are available we rely on one or both of: - the user's options.h generated by wolfSSL - the symbols detected by curl's configure @@ -74,6 +78,14 @@ #include "curl_memory.h" #include "memdebug.h" +#ifdef USE_ECH +# include "curl_base64.h" +# define ECH_ENABLED(__data__) \ + (__data__->set.tls_ech && \ + !(__data__->set.tls_ech & CURLECH_DISABLE)\ + ) +#endif /* USE_ECH */ + /* 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 @@ -91,17 +103,11 @@ #undef USE_BIO_CHAIN #endif -struct wolfssl_ssl_backend_data { - WOLFSSL_CTX *ctx; - WOLFSSL *handle; - CURLcode io_result; /* result of last BIO cfilter operation */ -}; - #ifdef OPENSSL_EXTRA /* * Availability note: * The TLS 1.3 secret callback (wolfSSL_set_tls13_secret_cb) was added in - * WolfSSL 4.4.0, but requires the -DHAVE_SECRET_CALLBACK build option. If that + * wolfSSL 4.4.0, but requires the -DHAVE_SECRET_CALLBACK build option. If that * option is not set, then TLS 1.3 will not be logged. * For TLS 1.2 and before, we use wolfSSL_get_keys(). * SSL_get_client_random and wolfSSL_get_keys require OPENSSL_EXTRA @@ -199,7 +205,7 @@ wolfssl_log_tls12_secret(SSL *ssl) } #endif /* OPENSSL_EXTRA */ -static int do_file_type(const char *type) +static int wolfssl_do_file_type(const char *type) { if(!type || !type[0]) return SSL_FILETYPE_PEM; @@ -210,7 +216,7 @@ static int do_file_type(const char *type) return -1; } -#ifdef HAVE_LIBOQS +#ifdef WOLFSSL_HAVE_KYBER struct group_name_map { const word16 group; const char *name; @@ -232,7 +238,6 @@ static const struct group_name_map gnm[] = { static int wolfssl_bio_cf_create(WOLFSSL_BIO *bio) { wolfSSL_BIO_set_shutdown(bio, 1); - wolfSSL_BIO_set_init(bio, 1); wolfSSL_BIO_set_data(bio, NULL); return 1; } @@ -283,20 +288,35 @@ static int wolfssl_bio_cf_out_write(WOLFSSL_BIO *bio, { struct Curl_cfilter *cf = wolfSSL_BIO_get_data(bio); struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); - ssize_t nwritten; + ssize_t nwritten, skiplen = 0; CURLcode result = CURLE_OK; DEBUGASSERT(data); - nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, &result); + if(backend->shutting_down && backend->io_send_blocked_len && + (backend->io_send_blocked_len < blen)) { + /* bug in wolfSSL: + * It adds the close notify message again every time we retry + * sending during shutdown. */ + CURL_TRC_CF(data, cf, "bio_write, shutdown restrict send of %d" + " to %d bytes", blen, backend->io_send_blocked_len); + skiplen = (ssize_t)(blen - backend->io_send_blocked_len); + blen = backend->io_send_blocked_len; + } + nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &result); backend->io_result = result; CURL_TRC_CF(data, cf, "bio_write(len=%d) -> %zd, %d", blen, nwritten, result); wolfSSL_BIO_clear_retry_flags(bio); - if(nwritten < 0 && CURLE_AGAIN == result) + if(nwritten < 0 && CURLE_AGAIN == result) { BIO_set_retry_write(bio); + if(backend->shutting_down && !backend->io_send_blocked_len) + backend->io_send_blocked_len = blen; + } + else if(!result && skiplen) + nwritten += skiplen; return (int)nwritten; } @@ -304,8 +324,8 @@ static int wolfssl_bio_cf_in_read(WOLFSSL_BIO *bio, char *buf, int blen) { struct Curl_cfilter *cf = wolfSSL_BIO_get_data(bio); struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; struct Curl_easy *data = CF_DATA_CURRENT(cf); ssize_t nread; CURLcode result = CURLE_OK; @@ -321,6 +341,8 @@ static int wolfssl_bio_cf_in_read(WOLFSSL_BIO *bio, char *buf, int blen) wolfSSL_BIO_clear_retry_flags(bio); if(nread < 0 && CURLE_AGAIN == result) BIO_set_retry_read(bio); + else if(nread == 0) + connssl->peer_closed = TRUE; return (int)nread; } @@ -348,189 +370,143 @@ static void wolfssl_bio_cf_free_methods(void) #endif /* !USE_BIO_CHAIN */ -/* - * This function loads all the client/CA certificates and CRLs. Setup the TLS - * layer and do all necessary magic. - */ -static CURLcode -wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) +static void wolfssl_session_free(void *sdata, size_t slen) +{ + (void)slen; + free(sdata); +} + +CURLcode wssl_cache_session(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + WOLFSSL_SESSION *session) +{ + CURLcode result = CURLE_OK; + unsigned char *sdata = NULL; + unsigned int slen; + + if(!session) + goto out; + + slen = wolfSSL_i2d_SSL_SESSION(session, NULL); + if(slen <= 0) { + CURL_TRC_CF(data, cf, "fail to assess session length: %u", slen); + result = CURLE_FAILED_INIT; + goto out; + } + sdata = calloc(1, slen); + if(!sdata) { + failf(data, "unable to allocate session buffer of %u bytes", slen); + result = CURLE_OUT_OF_MEMORY; + goto out; + } + slen = wolfSSL_i2d_SSL_SESSION(session, &sdata); + if(slen <= 0) { + CURL_TRC_CF(data, cf, "fail to serialize session: %u", slen); + result = CURLE_FAILED_INIT; + goto out; + } + + Curl_ssl_sessionid_lock(data); + result = Curl_ssl_set_sessionid(cf, data, peer, NULL, + sdata, slen, wolfssl_session_free); + Curl_ssl_sessionid_unlock(data); + if(result) + failf(data, "failed to add new ssl session to cache (%d)", result); + else { + CURL_TRC_CF(data, cf, "added new session to cache"); + sdata = NULL; + } + +out: + free(sdata); + return 0; +} + +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); + DEBUGASSERT(cf != NULL); + if(cf && session) { + struct ssl_connect_data *connssl = cf->ctx; + struct Curl_easy *data = CF_DATA_CURRENT(cf); + DEBUGASSERT(connssl); + DEBUGASSERT(data); + if(connssl && data) { + (void)wssl_cache_session(cf, data, &connssl->peer, session); + } + } + return 0; +} + +CURLcode wssl_setup_session(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct wolfssl_ctx *wss, + struct ssl_peer *peer) +{ + void *psdata; + const unsigned char *sdata = NULL; + size_t slen = 0; + CURLcode result = CURLE_OK; + + Curl_ssl_sessionid_lock(data); + if(!Curl_ssl_getsessionid(cf, data, peer, &psdata, &slen, NULL)) { + WOLFSSL_SESSION *session; + sdata = psdata; + session = wolfSSL_d2i_SSL_SESSION(NULL, &sdata, (long)slen); + if(session) { + int ret = wolfSSL_set_session(wss->handle, session); + if(ret != WOLFSSL_SUCCESS) { + Curl_ssl_delsessionid(data, psdata); + infof(data, "previous session not accepted (%d), " + "removing from cache", ret); + } + else + infof(data, "SSL reusing session ID"); + wolfSSL_SESSION_free(session); + } + else { + failf(data, "could not decode previous session"); + } + } + Curl_ssl_sessionid_unlock(data); + return result; +} + +static CURLcode populate_x509_store(struct Curl_cfilter *cf, + struct Curl_easy *data, + X509_STORE *store, + struct wolfssl_ctx *wssl) { - char *ciphers, *curves; - struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); const struct curl_blob *ca_info_blob = conn_config->ca_info_blob; - const struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); const char * const ssl_cafile = /* CURLOPT_CAINFO_BLOB overrides CURLOPT_CAINFO */ (ca_info_blob ? NULL : conn_config->CAfile); const char * const ssl_capath = conn_config->CApath; - WOLFSSL_METHOD* req_method = NULL; -#ifdef HAVE_LIBOQS - word16 oqsAlg = 0; - size_t idx = 0; -#endif -#ifdef HAVE_SNI - bool sni = FALSE; -#define use_sni(x) sni = (x) -#else -#define use_sni(x) Curl_nop_stmt -#endif - bool imported_native_ca = false; - bool imported_ca_info_blob = false; - - DEBUGASSERT(backend); - - if(connssl->state == ssl_connection_complete) - return CURLE_OK; - - if(conn_config->version_max != CURL_SSLVERSION_MAX_NONE) { - failf(data, "wolfSSL does not support to set maximum SSL/TLS version"); - return CURLE_SSL_CONNECT_ERROR; - } - - /* check to see if we've been told to use an explicit SSL/TLS version */ - switch(conn_config->version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: -#if LIBWOLFSSL_VERSION_HEX >= 0x03003000 /* >= 3.3.0 */ - /* minimum protocol version is set later after the CTX object is created */ - req_method = SSLv23_client_method(); -#else - infof(data, "wolfSSL <3.3.0 cannot be configured to use TLS 1.0-1.2, " - "TLS 1.0 is used exclusively"); - req_method = TLSv1_client_method(); -#endif - use_sni(TRUE); - break; - case CURL_SSLVERSION_TLSv1_0: -#if defined(WOLFSSL_ALLOW_TLSV10) && !defined(NO_OLD_TLS) - req_method = TLSv1_client_method(); - use_sni(TRUE); -#else - failf(data, "wolfSSL does not support TLS 1.0"); - return CURLE_NOT_BUILT_IN; -#endif - break; - case CURL_SSLVERSION_TLSv1_1: -#ifndef NO_OLD_TLS - req_method = TLSv1_1_client_method(); - use_sni(TRUE); -#else - failf(data, "wolfSSL does not support TLS 1.1"); - return CURLE_NOT_BUILT_IN; -#endif - break; - case CURL_SSLVERSION_TLSv1_2: -#ifndef WOLFSSL_NO_TLS12 - req_method = TLSv1_2_client_method(); - use_sni(TRUE); -#else - failf(data, "wolfSSL does not support TLS 1.2"); - return CURLE_NOT_BUILT_IN; -#endif - break; - case CURL_SSLVERSION_TLSv1_3: -#ifdef WOLFSSL_TLS13 - req_method = wolfTLSv1_3_client_method(); - use_sni(TRUE); - break; -#else - failf(data, "wolfSSL: TLS 1.3 is not yet supported"); - return CURLE_SSL_CONNECT_ERROR; -#endif - default: - failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); - return CURLE_SSL_CONNECT_ERROR; - } - - if(!req_method) { - failf(data, "SSL: couldn't create a method"); - return CURLE_OUT_OF_MEMORY; - } - - if(backend->ctx) - wolfSSL_CTX_free(backend->ctx); - backend->ctx = wolfSSL_CTX_new(req_method); - - if(!backend->ctx) { - failf(data, "SSL: couldn't create a context"); - return CURLE_OUT_OF_MEMORY; - } - - switch(conn_config->version) { - case CURL_SSLVERSION_DEFAULT: - case CURL_SSLVERSION_TLSv1: -#if LIBWOLFSSL_VERSION_HEX > 0x03004006 /* > 3.4.6 */ - /* Versions 3.3.0 to 3.4.6 we know the minimum protocol version is - * whatever minimum version of TLS was built in and at least TLS 1.0. For - * later library versions that could change (eg TLS 1.0 built in but - * defaults to TLS 1.1) so we have this short circuit evaluation to find - * the minimum supported TLS version. - */ - if((wolfSSL_CTX_SetMinVersion(backend->ctx, WOLFSSL_TLSV1) != 1) && - (wolfSSL_CTX_SetMinVersion(backend->ctx, WOLFSSL_TLSV1_1) != 1) && - (wolfSSL_CTX_SetMinVersion(backend->ctx, WOLFSSL_TLSV1_2) != 1) -#ifdef WOLFSSL_TLS13 - && (wolfSSL_CTX_SetMinVersion(backend->ctx, WOLFSSL_TLSV1_3) != 1) -#endif - ) { - failf(data, "SSL: couldn't set the minimum protocol version"); - return CURLE_SSL_CONNECT_ERROR; - } -#endif - default: - break; - } - - ciphers = conn_config->cipher_list; - if(ciphers) { - if(!SSL_CTX_set_cipher_list(backend->ctx, ciphers)) { - failf(data, "failed setting cipher list: %s", ciphers); - return CURLE_SSL_CIPHER; - } - infof(data, "Cipher selection: %s", ciphers); - } - - curves = conn_config->curves; - if(curves) { - -#ifdef HAVE_LIBOQS - for(idx = 0; gnm[idx].name != NULL; idx++) { - if(strncmp(curves, gnm[idx].name, strlen(gnm[idx].name)) == 0) { - oqsAlg = gnm[idx].group; - break; - } - } - - if(oqsAlg == 0) -#endif - { - if(!SSL_CTX_set1_curves_list(backend->ctx, curves)) { - failf(data, "failed setting curves list: '%s'", curves); - return CURLE_SSL_CIPHER; - } - } - } + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + bool imported_native_ca = FALSE; #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_SYS_CA_CERTS) /* load native CA certificates */ if(ssl_config->native_ca_store) { - if(wolfSSL_CTX_load_system_CA_certs(backend->ctx) != WOLFSSL_SUCCESS) { + if(wolfSSL_CTX_load_system_CA_certs(wssl->ctx) != WOLFSSL_SUCCESS) { infof(data, "error importing native CA store, continuing anyway"); } else { - imported_native_ca = true; + imported_native_ca = TRUE; infof(data, "successfully imported native CA store"); + wssl->x509_store_setup = TRUE; } } #endif /* !NO_FILESYSTEM */ /* load certificate blob */ if(ca_info_blob) { - if(wolfSSL_CTX_load_verify_buffer(backend->ctx, ca_info_blob->data, - ca_info_blob->len, + if(wolfSSL_CTX_load_verify_buffer(wssl->ctx, ca_info_blob->data, + (long)ca_info_blob->len, SSL_FILETYPE_PEM) != SSL_SUCCESS) { if(imported_native_ca) { infof(data, "error importing CA certificate blob, continuing anyway"); @@ -541,22 +517,27 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } } else { - imported_ca_info_blob = true; infof(data, "successfully imported CA certificate blob"); + wssl->x509_store_setup = TRUE; } } #ifndef NO_FILESYSTEM /* load trusted cacert from file if not blob */ - if(ssl_cafile || ssl_capath) { + + CURL_TRC_CF(data, cf, "populate_x509_store, path=%s, blob=%d", + ssl_cafile ? ssl_cafile : "none", !!ca_info_blob); + if(!store) + return CURLE_OUT_OF_MEMORY; + + if((ssl_cafile || ssl_capath) && (!wssl->x509_store_setup)) { int rc = - wolfSSL_CTX_load_verify_locations_ex(backend->ctx, + wolfSSL_CTX_load_verify_locations_ex(wssl->ctx, ssl_cafile, ssl_capath, WOLFSSL_LOAD_FLAG_IGNORE_ERR); if(SSL_SUCCESS != rc) { - if(conn_config->verifypeer && !imported_ca_info_blob && - !imported_native_ca) { + if(conn_config->verifypeer) { /* Fail if we insist on successfully verifying the server. */ failf(data, "error setting certificate verify locations:" " CAfile: %s CApath: %s", @@ -578,35 +559,500 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) infof(data, " CAfile: %s", ssl_cafile ? ssl_cafile : "none"); infof(data, " CApath: %s", ssl_capath ? ssl_capath : "none"); } +#endif + (void)store; + wssl->x509_store_setup = TRUE; + return CURLE_OK; +} + +/* key to use at `multi->proto_hash` */ +#define MPROTO_WSSL_X509_KEY "tls:wssl:x509:share" + +struct wssl_x509_share { + 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 */ +}; + +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(!memcmp(MPROTO_WSSL_X509_KEY, key, key_len)); + (void)key; + (void)key_len; + if(share->store) { + wolfSSL_X509_STORE_free(share->store); + } + free(share->CAfile); + free(share); +} + +static bool +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 = Curl_now(); + timediff_t elapsed_ms = Curl_timediff(now, mb->time); + timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; + + if(timeout_ms < 0) + return FALSE; + + return elapsed_ms >= timeout_ms; +} + +static bool +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) + return mb->CAfile != conn_config->CAfile; + + return strcmp(mb->CAfile, conn_config->CAfile); +} + +static X509_STORE *get_cached_x509_store(struct Curl_cfilter *cf, + const struct Curl_easy *data) +{ + struct Curl_multi *multi = data->multi; + struct wssl_x509_share *share; + WOLFSSL_X509_STORE *store = NULL; + + DEBUGASSERT(multi); + share = multi ? Curl_hash_pick(&multi->proto_hash, + (void *)MPROTO_WSSL_X509_KEY, + sizeof(MPROTO_WSSL_X509_KEY)-1) : NULL; + if(share && share->store && + !cached_x509_store_expired(data, share) && + !cached_x509_store_different(cf, share)) { + store = share->store; + } + + return store; +} + +static void set_cached_x509_store(struct Curl_cfilter *cf, + const struct Curl_easy *data, + X509_STORE *store) +{ + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + struct Curl_multi *multi = data->multi; + struct wssl_x509_share *share; + + DEBUGASSERT(multi); + if(!multi) + return; + share = Curl_hash_pick(&multi->proto_hash, + (void *)MPROTO_WSSL_X509_KEY, + sizeof(MPROTO_WSSL_X509_KEY)-1); + + if(!share) { + share = calloc(1, sizeof(*share)); + if(!share) + return; + if(!Curl_hash_add2(&multi->proto_hash, + (void *)MPROTO_WSSL_X509_KEY, + sizeof(MPROTO_WSSL_X509_KEY)-1, + share, wssl_x509_share_free)) { + free(share); + return; + } + } + + if(wolfSSL_X509_STORE_up_ref(store)) { + char *CAfile = NULL; + + if(conn_config->CAfile) { + CAfile = strdup(conn_config->CAfile); + if(!CAfile) { + X509_STORE_free(store); + return; + } + } + + if(share->store) { + X509_STORE_free(share->store); + free(share->CAfile); + } + + share->time = Curl_now(); + share->store = store; + share->CAfile = CAfile; + } +} + +CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct wolfssl_ctx *wssl) +{ + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + CURLcode result = CURLE_OK; + WOLFSSL_X509_STORE *cached_store; + bool cache_criteria_met; + + /* Consider the X509 store cacheable if it comes exclusively from a CAfile, + or no source is provided and we are falling back to wolfSSL's built-in + default. */ + cache_criteria_met = (data->set.general_ssl.ca_cache_timeout != 0) && + conn_config->verifypeer && + !conn_config->CApath && + !conn_config->ca_info_blob && + !ssl_config->primary.CRLfile && + !ssl_config->native_ca_store; + + cached_store = cache_criteria_met ? get_cached_x509_store(cf, data) : NULL; + if(cached_store && wolfSSL_CTX_get_cert_store(wssl->ctx) == cached_store) { + /* The cached store is already in use, do nothing. */ + } + else if(cached_store && wolfSSL_X509_STORE_up_ref(cached_store)) { + wolfSSL_CTX_set_cert_store(wssl->ctx, cached_store); + } + else if(cache_criteria_met) { + /* wolfSSL's initial store in CTX is not shareable by default. + * Make a new one, suitable for adding to the cache. See #14278 */ + X509_STORE *store = wolfSSL_X509_STORE_new(); + if(!store) { + failf(data, "SSL: could not create a X509 store"); + return CURLE_OUT_OF_MEMORY; + } + wolfSSL_CTX_set_cert_store(wssl->ctx, store); + + result = populate_x509_store(cf, data, store, wssl); + if(!result) { + set_cached_x509_store(cf, data, store); + } + } + else { + /* We never share the CTX's store, use it. */ + X509_STORE *store = wolfSSL_CTX_get_cert_store(wssl->ctx); + result = populate_x509_store(cf, data, store, wssl); + } + + return result; +} + +#ifdef WOLFSSL_TLS13 +static CURLcode +wssl_add_default_ciphers(bool tls13, struct dynbuf *buf) +{ + int i; + char *str; + + for(i = 0; (str = wolfSSL_get_cipher_list(i)); i++) { + size_t n; + if((strncmp(str, "TLS13", 5) == 0) != tls13) + continue; + + /* if there already is data in the string, add colon separator */ + if(Curl_dyn_len(buf)) { + CURLcode result = Curl_dyn_addn(buf, ":", 1); + if(result) + return result; + } + + n = strlen(str); + if(Curl_dyn_addn(buf, str, n)) + return CURLE_OUT_OF_MEMORY; + } + + return CURLE_OK; +} +#endif + +/* 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) +{ + int res; + switch(version) { + default: + case TLS1_VERSION: + res = wolfSSL_CTX_SetMinVersion(ctx, WOLFSSL_TLSV1); + if(res == WOLFSSL_SUCCESS) + return res; + FALLTHROUGH(); + case TLS1_1_VERSION: + res = wolfSSL_CTX_SetMinVersion(ctx, WOLFSSL_TLSV1_1); + if(res == WOLFSSL_SUCCESS) + return res; + FALLTHROUGH(); + case TLS1_2_VERSION: + res = wolfSSL_CTX_SetMinVersion(ctx, WOLFSSL_TLSV1_2); +#ifdef WOLFSSL_TLS13 + if(res == WOLFSSL_SUCCESS) + return res; + FALLTHROUGH(); + case TLS1_3_VERSION: + res = wolfSSL_CTX_SetMinVersion(ctx, WOLFSSL_TLSV1_3); +#endif + } + return res; +} +static int +wssl_legacy_CTX_set_max_proto_version(WOLFSSL_CTX* ctx, int version) +{ + (void) ctx, (void) version; + return WOLFSSL_NOT_IMPLEMENTED; +} +#define wolfSSL_CTX_set_min_proto_version wssl_legacy_CTX_set_min_proto_version +#define wolfSSL_CTX_set_max_proto_version wssl_legacy_CTX_set_max_proto_version +#endif + +/* + * This function loads all the client/CA certificates and CRLs. Setup the TLS + * layer and do all necessary magic. + */ +static CURLcode +wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) +{ + int res; + char *curves; + struct ssl_connect_data *connssl = cf->ctx; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; + struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); + const struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); + WOLFSSL_METHOD* req_method = NULL; +#ifdef WOLFSSL_HAVE_KYBER + word16 pqkem = 0; + size_t idx = 0; +#endif + + DEBUGASSERT(backend); + + if(connssl->state == ssl_connection_complete) + return CURLE_OK; + +#if LIBWOLFSSL_VERSION_HEX < 0x04002000 /* 4.2.0 (2019) */ + req_method = wolfSSLv23_client_method(); +#else + req_method = wolfTLS_client_method(); +#endif + if(!req_method) { + failf(data, "wolfSSL: could not create a client method"); + return CURLE_OUT_OF_MEMORY; + } + + if(backend->ctx) + wolfSSL_CTX_free(backend->ctx); + + backend->ctx = wolfSSL_CTX_new(req_method); + if(!backend->ctx) { + failf(data, "wolfSSL: could not create a context"); + return CURLE_OUT_OF_MEMORY; + } + + switch(conn_config->version) { + case CURL_SSLVERSION_DEFAULT: + case CURL_SSLVERSION_TLSv1: + case CURL_SSLVERSION_TLSv1_0: + res = wolfSSL_CTX_set_min_proto_version(backend->ctx, TLS1_VERSION); + break; + case CURL_SSLVERSION_TLSv1_1: + res = wolfSSL_CTX_set_min_proto_version(backend->ctx, TLS1_1_VERSION); + break; + case CURL_SSLVERSION_TLSv1_2: + res = wolfSSL_CTX_set_min_proto_version(backend->ctx, TLS1_2_VERSION); + break; +#ifdef WOLFSSL_TLS13 + case CURL_SSLVERSION_TLSv1_3: + res = wolfSSL_CTX_set_min_proto_version(backend->ctx, 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(backend->ctx, TLS1_3_VERSION); + break; +#endif + case CURL_SSLVERSION_MAX_TLSv1_2: + res = wolfSSL_CTX_set_max_proto_version(backend->ctx, TLS1_2_VERSION); + break; + case CURL_SSLVERSION_MAX_TLSv1_1: + res = wolfSSL_CTX_set_max_proto_version(backend->ctx, TLS1_1_VERSION); + break; + case CURL_SSLVERSION_MAX_TLSv1_0: + res = wolfSSL_CTX_set_max_proto_version(backend->ctx, 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; + } + if(res != WOLFSSL_SUCCESS) { + failf(data, "wolfSSL: failed set the maximum TLS version"); + return CURLE_SSL_CONNECT_ERROR; + } + +#ifndef WOLFSSL_TLS13 + { + char *ciphers = conn_config->cipher_list; + if(ciphers) { + if(!SSL_CTX_set_cipher_list(backend->ctx, ciphers)) { + failf(data, "failed setting cipher list: %s", ciphers); + return CURLE_SSL_CIPHER; + } + infof(data, "Cipher selection: %s", ciphers); + } + } +#else +#define MAX_CIPHER_LEN 4096 + if(conn_config->cipher_list || conn_config->cipher_list13) { + const char *ciphers12 = conn_config->cipher_list; + const char *ciphers13 = conn_config->cipher_list13; + struct dynbuf c; + CURLcode result; + Curl_dyn_init(&c, MAX_CIPHER_LEN); + + if(ciphers13) + result = Curl_dyn_add(&c, ciphers13); + else + result = wssl_add_default_ciphers(TRUE, &c); + + if(!result) { + if(ciphers12) { + if(Curl_dyn_len(&c)) + result = Curl_dyn_addn(&c, ":", 1); + if(!result) + result = Curl_dyn_add(&c, ciphers12); + } + else + result = wssl_add_default_ciphers(FALSE, &c); + } + if(result) + return result; + + if(!SSL_CTX_set_cipher_list(backend->ctx, Curl_dyn_ptr(&c))) { + failf(data, "failed setting cipher list: %s", Curl_dyn_ptr(&c)); + Curl_dyn_free(&c); + return CURLE_SSL_CIPHER; + } + infof(data, "Cipher selection: %s", Curl_dyn_ptr(&c)); + Curl_dyn_free(&c); + } +#endif + + curves = conn_config->curves; + if(curves) { + +#ifdef WOLFSSL_HAVE_KYBER + for(idx = 0; gnm[idx].name != NULL; idx++) { + if(strncmp(curves, gnm[idx].name, strlen(gnm[idx].name)) == 0) { + pqkem = gnm[idx].group; + break; + } + } + + if(pqkem == 0) +#endif + { + if(!SSL_CTX_set1_curves_list(backend->ctx, curves)) { + failf(data, "failed setting curves list: '%s'", curves); + return CURLE_SSL_CIPHER; + } + } + } /* Load the client certificate, and private key */ - if(ssl_config->primary.clientcert && ssl_config->key) { - int file_type = do_file_type(ssl_config->cert_type); +#ifndef NO_FILESYSTEM + if(ssl_config->primary.cert_blob || ssl_config->primary.clientcert) { + const char *cert_file = ssl_config->primary.clientcert; + const char *key_file = ssl_config->key; + const struct curl_blob *cert_blob = ssl_config->primary.cert_blob; + const struct curl_blob *key_blob = ssl_config->key_blob; + int file_type = wolfssl_do_file_type(ssl_config->cert_type); + int rc; - if(file_type == WOLFSSL_FILETYPE_PEM) { - if(wolfSSL_CTX_use_certificate_chain_file(backend->ctx, - ssl_config->primary.clientcert) - != 1) { - failf(data, "unable to use client certificate"); - return CURLE_SSL_CONNECT_ERROR; - } - } - else if(file_type == WOLFSSL_FILETYPE_ASN1) { - if(wolfSSL_CTX_use_certificate_file(backend->ctx, - ssl_config->primary.clientcert, - file_type) != 1) { - failf(data, "unable to use client certificate"); - return CURLE_SSL_CONNECT_ERROR; - } - } - else { + switch(file_type) { + case WOLFSSL_FILETYPE_PEM: + rc = cert_blob ? + wolfSSL_CTX_use_certificate_chain_buffer(backend->ctx, + cert_blob->data, + (long)cert_blob->len) : + wolfSSL_CTX_use_certificate_chain_file(backend->ctx, cert_file); + break; + case WOLFSSL_FILETYPE_ASN1: + rc = cert_blob ? + wolfSSL_CTX_use_certificate_buffer(backend->ctx, cert_blob->data, + (long)cert_blob->len, file_type) : + wolfSSL_CTX_use_certificate_file(backend->ctx, cert_file, file_type); + break; + default: failf(data, "unknown cert type"); return CURLE_BAD_FUNCTION_ARGUMENT; } + if(rc != 1) { + failf(data, "unable to use client certificate"); + return CURLE_SSL_CONNECT_ERROR; + } - file_type = do_file_type(ssl_config->key_type); - if(wolfSSL_CTX_use_PrivateKey_file(backend->ctx, ssl_config->key, - file_type) != 1) { + if(!key_blob && !key_file) { + key_blob = cert_blob; + key_file = cert_file; + } + else + file_type = wolfssl_do_file_type(ssl_config->key_type); + + rc = key_blob ? + wolfSSL_CTX_use_PrivateKey_buffer(backend->ctx, key_blob->data, + (long)key_blob->len, file_type) : + wolfSSL_CTX_use_PrivateKey_file(backend->ctx, key_file, file_type); + if(rc != 1) { + failf(data, "unable to set private key"); + return CURLE_SSL_CONNECT_ERROR; + } + } +#else /* NO_FILESYSTEM */ + if(ssl_config->primary.cert_blob) { + const struct curl_blob *cert_blob = ssl_config->primary.cert_blob; + const struct curl_blob *key_blob = ssl_config->key_blob; + int file_type = wolfssl_do_file_type(ssl_config->cert_type); + int rc; + + switch(file_type) { + case WOLFSSL_FILETYPE_PEM: + rc = wolfSSL_CTX_use_certificate_chain_buffer(backend->ctx, + cert_blob->data, + (long)cert_blob->len); + break; + case WOLFSSL_FILETYPE_ASN1: + rc = wolfSSL_CTX_use_certificate_buffer(backend->ctx, cert_blob->data, + (long)cert_blob->len, file_type); + break; + default: + failf(data, "unknown cert type"); + return CURLE_BAD_FUNCTION_ARGUMENT; + } + if(rc != 1) { + failf(data, "unable to use client certificate"); + return CURLE_SSL_CONNECT_ERROR; + } + + if(!key_blob) + key_blob = cert_blob; + else + file_type = wolfssl_do_file_type(ssl_config->key_type); + + if(wolfSSL_CTX_use_PrivateKey_buffer(backend->ctx, key_blob->data, + (long)key_blob->len, + file_type) != 1) { failf(data, "unable to set private key"); return CURLE_SSL_CONNECT_ERROR; } @@ -618,11 +1064,11 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) * anyway. In the latter case the result of the verification is checked with * SSL_get_verify_result() below. */ wolfSSL_CTX_set_verify(backend->ctx, - conn_config->verifypeer?SSL_VERIFY_PEER: + conn_config->verifypeer ? SSL_VERIFY_PEER : SSL_VERIFY_NONE, NULL); #ifdef HAVE_SNI - if(sni && connssl->peer.sni) { + if(connssl->peer.sni) { size_t sni_len = strlen(connssl->peer.sni); if((sni_len < USHRT_MAX)) { if(wolfSSL_CTX_UseSNI(backend->ctx, WOLFSSL_SNI_HOST_NAME, @@ -637,8 +1083,14 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* give application a chance to interfere with SSL set up. */ if(data->set.ssl.fsslctx) { - CURLcode result = (*data->set.ssl.fsslctx)(data, backend->ctx, - data->set.ssl.fsslctxp); + CURLcode result; + if(!backend->x509_store_setup) { + result = Curl_wssl_setup_x509_store(cf, data, backend); + if(result) + return result; + } + result = (*data->set.ssl.fsslctx)(data, backend->ctx, + data->set.ssl.fsslctxp); if(result) { failf(data, "error signaled by ssl ctx callback"); return result; @@ -646,7 +1098,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } #ifdef NO_FILESYSTEM else if(conn_config->verifypeer) { - failf(data, "SSL: Certificates can't be loaded because wolfSSL was built" + failf(data, "SSL: Certificates cannot be loaded because wolfSSL was built" " with \"no filesystem\". Either disable peer verification" " (insecure) or if you are building an application with libcurl you" " can load certificates via CURLOPT_SSL_CTX_FUNCTION."); @@ -659,14 +1111,14 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) wolfSSL_free(backend->handle); backend->handle = wolfSSL_new(backend->ctx); if(!backend->handle) { - failf(data, "SSL: couldn't create a handle"); + failf(data, "SSL: could not create a handle"); return CURLE_OUT_OF_MEMORY; } -#ifdef HAVE_LIBOQS - if(oqsAlg) { - if(wolfSSL_UseKeyShare(backend->handle, oqsAlg) != WOLFSSL_SUCCESS) { - failf(data, "unable to use oqs KEM"); +#ifdef WOLFSSL_HAVE_KYBER + if(pqkem) { + if(wolfSSL_UseKeyShare(backend->handle, pqkem) != WOLFSSL_SUCCESS) { + failf(data, "unable to use PQ KEM"); } } #endif @@ -678,7 +1130,8 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) result = Curl_alpn_to_proto_str(&proto, connssl->alpn); if(result || - wolfSSL_UseALPN(backend->handle, (char *)proto.data, proto.len, + wolfSSL_UseALPN(backend->handle, + (char *)proto.data, (unsigned int)proto.len, WOLFSSL_ALPN_CONTINUE_ON_MISMATCH) != SSL_SUCCESS) { failf(data, "SSL: failed setting ALPN protocols"); return CURLE_SSL_CONNECT_ERROR; @@ -705,23 +1158,91 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } #endif /* HAVE_SECURE_RENEGOTIATION */ - /* Check if there's a cached ID we can/should use here! */ - if(ssl_config->primary.sessionid) { - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(data); - if(!Curl_ssl_getsessionid(cf, data, &ssl_sessionid, NULL)) { - /* we got a session id, use it! */ - if(!SSL_set_session(backend->handle, ssl_sessionid)) { - Curl_ssl_delsessionid(data, ssl_sessionid); - infof(data, "Can't use session ID, going on without"); - } - else - infof(data, "SSL reusing session ID"); - } - Curl_ssl_sessionid_unlock(data); + /* Check if there is a cached ID we can/should use here! */ + if(ssl_config->primary.cache_session) { + /* Set session from cache if there is one */ + (void)wssl_setup_session(cf, data, backend, &connssl->peer); + /* Register to get notified when a new session is received */ + wolfSSL_set_app_data(backend->handle, cf); + wolfSSL_CTX_sess_set_new_cb(backend->ctx, wssl_vtls_new_session_cb); } +#ifdef USE_ECH + if(ECH_ENABLED(data)) { + int trying_ech_now = 0; + + if(data->set.str[STRING_ECH_PUBLIC]) { + infof(data, "ECH: outername not (yet) supported with wolfSSL"); + return CURLE_SSL_CONNECT_ERROR; + } + if(data->set.tls_ech == CURLECH_GREASE) { + infof(data, "ECH: GREASE'd ECH not yet supported for wolfSSL"); + return CURLE_SSL_CONNECT_ERROR; + } + 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(backend->handle, b64val, b64len) + != WOLFSSL_SUCCESS) { + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + else { + trying_ech_now = 1; + infof(data, "ECH: ECHConfig from command line"); + } + } + else { + struct Curl_dns_entry *dns = NULL; + + dns = Curl_fetch_addr(data, connssl->peer.hostname, connssl->peer.port); + if(!dns) { + infof(data, "ECH: requested but no DNS info available"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + else { + struct Curl_https_rrinfo *rinfo = NULL; + + rinfo = dns->hinfo; + if(rinfo && rinfo->echconfiglist) { + unsigned char *ecl = rinfo->echconfiglist; + size_t elen = rinfo->echconfiglist_len; + + infof(data, "ECH: ECHConfig from DoH HTTPS RR"); + if(wolfSSL_SetEchConfigs(backend->handle, ecl, (word32) elen) != + WOLFSSL_SUCCESS) { + infof(data, "ECH: wolfSSL_SetEchConfigs failed"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + else { + trying_ech_now = 1; + infof(data, "ECH: imported ECHConfigList of length %ld", elen); + } + } + else { + infof(data, "ECH: requested but no ECHConfig available"); + if(data->set.tls_ech & CURLECH_HARD) + return CURLE_SSL_CONNECT_ERROR; + } + Curl_resolv_unlink(data, &dns); + } + } + + if(trying_ech_now + && SSL_set_min_proto_version(backend->handle, TLS1_3_VERSION) != 1) { + infof(data, "ECH: cannot force TLSv1.3 [ERROR]"); + return CURLE_SSL_CONNECT_ERROR; + } + + } +#endif /* USE_ECH */ + #ifdef USE_BIO_CHAIN { WOLFSSL_BIO *bio; @@ -747,17 +1268,39 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } +static char *wolfssl_strerror(unsigned long error, char *buf, + unsigned long size) +{ + DEBUGASSERT(size > 40); + *buf = '\0'; + + wolfSSL_ERR_error_string_n(error, buf, size); + + if(!*buf) { + const char *msg = error ? "Unknown error" : "No error"; + /* the string fits because the assert above assures this */ + strcpy(buf, msg); + } + + return buf; +} + + static CURLcode wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) { int ret = -1; struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); - const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf)? - data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]: +#ifndef CURL_DISABLE_PROXY + const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf) ? + data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] : data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#else + const char * const pinnedpubkey = data->set.str[STRING_SSL_PINNEDPUBLICKEY]; +#endif DEBUGASSERT(backend); @@ -765,12 +1308,22 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) /* Enable RFC2818 checks */ if(conn_config->verifyhost) { - char *snihost = connssl->peer.sni? - connssl->peer.sni : connssl->peer.hostname; + char *snihost = connssl->peer.sni ? + connssl->peer.sni : connssl->peer.hostname; if(wolfSSL_check_domain_name(backend->handle, snihost) == SSL_FAILURE) return CURLE_SSL_CONNECT_ERROR; } + if(!backend->x509_store_setup) { + /* After having send off the ClientHello, we prepare the x509 + * store to verify the coming certificate from the server */ + CURLcode result; + result = Curl_wssl_setup_x509_store(cf, data, backend); + if(result) + return result; + } + + connssl->io_need = CURL_SSL_IO_NEED_NONE; ret = wolfSSL_connect(backend->handle); #ifdef OPENSSL_EXTRA @@ -798,15 +1351,14 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) #endif /* OPENSSL_EXTRA */ if(ret != 1) { - char error_buffer[WOLFSSL_MAX_ERROR_SZ]; - int detail = wolfSSL_get_error(backend->handle, ret); + int detail = wolfSSL_get_error(backend->handle, ret); if(SSL_ERROR_WANT_READ == detail) { - connssl->connecting_state = ssl_connect_2_reading; + connssl->io_need = CURL_SSL_IO_NEED_RECV; return CURLE_OK; } else if(SSL_ERROR_WANT_WRITE == detail) { - connssl->connecting_state = ssl_connect_2_writing; + connssl->io_need = CURL_SSL_IO_NEED_SEND; return CURLE_OK; } /* There is no easy way to override only the CN matching. @@ -838,7 +1390,6 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) } #endif } -#if LIBWOLFSSL_VERSION_HEX >= 0x02007000 /* 2.7.0 */ else if(ASN_NO_SIGNER_E == detail) { if(conn_config->verifypeer) { failf(data, " CA signer not available for verification"); @@ -851,13 +1402,47 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) "continuing anyway"); } } + else if(ASN_AFTER_DATE_E == detail) { + failf(data, "server verification failed: certificate has expired."); + return CURLE_PEER_FAILED_VERIFICATION; + } + else if(ASN_BEFORE_DATE_E == detail) { + failf(data, "server verification failed: certificate not valid yet."); + return CURLE_PEER_FAILED_VERIFICATION; + } +#ifdef USE_ECH + else if(-1 == detail) { + /* try access a retry_config ECHConfigList for tracing */ + byte echConfigs[1000]; + word32 echConfigsLen = 1000; + int rv = 0; + + /* this currently does not produce the retry_configs */ + rv = wolfSSL_GetEchConfigs(backend->handle, echConfigs, + &echConfigsLen); + if(rv != WOLFSSL_SUCCESS) { + infof(data, "Failed to get ECHConfigs"); + } + else { + char *b64str = NULL; + size_t blen = 0; + + rv = Curl_base64_encode((const char *)echConfigs, echConfigsLen, + &b64str, &blen); + if(!rv && b64str) + infof(data, "ECH: (not yet) retry_configs %s", b64str); + free(b64str); + } + } #endif else if(backend->io_result == CURLE_AGAIN) { return CURLE_OK; } else { + char error_buffer[256]; failf(data, "SSL_connect failed with error %d: %s", detail, - wolfSSL_ERR_error_string(detail, error_buffer)); + wolfssl_strerror((unsigned long)detail, error_buffer, + sizeof(error_buffer))); return CURLE_SSL_CONNECT_ERROR; } } @@ -897,6 +1482,7 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) pinnedpubkey, (const unsigned char *)pubkey->header, (size_t)(pubkey->end - pubkey->header)); + wolfSSL_FreeX509(x509); if(result) { failf(data, "SSL: public key does not match pinned public key"); return result; @@ -916,11 +1502,11 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) rc = wolfSSL_ALPN_GetProtocol(backend->handle, &protocol, &protocol_len); if(rc == SSL_SUCCESS) { - Curl_alpn_set_negotiated(cf, data, (const unsigned char *)protocol, - protocol_len); + Curl_alpn_set_negotiated(cf, data, connssl, + (const unsigned char *)protocol, protocol_len); } else if(rc == SSL_ALPN_NOT_FOUND) - Curl_alpn_set_negotiated(cf, data, NULL, 0); + Curl_alpn_set_negotiated(cf, data, connssl, NULL, 0); else { failf(data, "ALPN, failure getting protocol, error %d", rc); return CURLE_SSL_CONNECT_ERROR; @@ -940,64 +1526,6 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data) return CURLE_OK; } - -static CURLcode -wolfssl_connect_step3(struct Curl_cfilter *cf, struct Curl_easy *data) -{ - CURLcode result = CURLE_OK; - struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; - const struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - DEBUGASSERT(backend); - - if(ssl_config->primary.sessionid) { - bool incache; - bool added = FALSE; - void *old_ssl_sessionid = NULL; - /* wolfSSL_get1_session allocates memory that has to be freed. */ - WOLFSSL_SESSION *our_ssl_sessionid = wolfSSL_get1_session(backend->handle); - - if(our_ssl_sessionid) { - Curl_ssl_sessionid_lock(data); - incache = !(Curl_ssl_getsessionid(cf, data, &old_ssl_sessionid, NULL)); - if(incache) { - if(old_ssl_sessionid != our_ssl_sessionid) { - infof(data, "old SSL session ID is stale, removing"); - Curl_ssl_delsessionid(data, old_ssl_sessionid); - incache = FALSE; - } - } - - if(!incache) { - result = Curl_ssl_addsessionid(cf, data, our_ssl_sessionid, 0, NULL); - if(result) { - Curl_ssl_sessionid_unlock(data); - wolfSSL_SESSION_free(our_ssl_sessionid); - failf(data, "failed to store ssl session"); - return result; - } - else { - added = TRUE; - } - } - Curl_ssl_sessionid_unlock(data); - - if(!added) { - /* If the session info wasn't added to the cache, free our copy. */ - wolfSSL_SESSION_free(our_ssl_sessionid); - } - } - } - - connssl->connecting_state = ssl_connect_done; - - return result; -} - - static ssize_t wolfssl_send(struct Curl_cfilter *cf, struct Curl_easy *data, const void *mem, @@ -1005,9 +1533,8 @@ static ssize_t wolfssl_send(struct Curl_cfilter *cf, CURLcode *curlcode) { struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; - char error_buffer[WOLFSSL_MAX_ERROR_SZ]; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; int memlen = (len > (size_t)INT_MAX) ? INT_MAX : (int)len; int rc; @@ -1022,7 +1549,7 @@ static ssize_t wolfssl_send(struct Curl_cfilter *cf, switch(err) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: - /* there's data pending, re-invoke SSL_write() */ + /* there is data pending, re-invoke SSL_write() */ CURL_TRC_CF(data, cf, "wolfssl_send(len=%zu) -> AGAIN", len); *curlcode = CURLE_AGAIN; return -1; @@ -1033,9 +1560,13 @@ static ssize_t wolfssl_send(struct Curl_cfilter *cf, return -1; } CURL_TRC_CF(data, cf, "wolfssl_send(len=%zu) -> %d, %d", len, rc, err); - failf(data, "SSL write: %s, errno %d", - wolfSSL_ERR_error_string(err, error_buffer), - SOCKERRNO); + { + char error_buffer[256]; + failf(data, "SSL write: %s, errno %d", + wolfssl_strerror((unsigned long)err, error_buffer, + sizeof(error_buffer)), + SOCKERRNO); + } *curlcode = CURLE_SEND_ERROR; return -1; } @@ -1044,22 +1575,122 @@ static ssize_t wolfssl_send(struct Curl_cfilter *cf, return rc; } +static CURLcode wolfssl_shutdown(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool send_shutdown, bool *done) +{ + struct ssl_connect_data *connssl = cf->ctx; + struct wolfssl_ctx *wctx = (struct wolfssl_ctx *)connssl->backend; + CURLcode result = CURLE_OK; + char buf[1024]; + char error_buffer[256]; + int nread = -1, err; + size_t i; + int detail; + + DEBUGASSERT(wctx); + if(!wctx->handle || cf->shutdown) { + *done = TRUE; + goto out; + } + + wctx->shutting_down = TRUE; + connssl->io_need = CURL_SSL_IO_NEED_NONE; + *done = FALSE; + if(!(wolfSSL_get_shutdown(wctx->handle) & SSL_SENT_SHUTDOWN)) { + /* We have not started the shutdown from our side yet. Check + * if the server already sent us one. */ + ERR_clear_error(); + nread = wolfSSL_read(wctx->handle, buf, (int)sizeof(buf)); + err = wolfSSL_get_error(wctx->handle, nread); + CURL_TRC_CF(data, cf, "wolfSSL_read, nread=%d, err=%d", nread, err); + if(!nread && err == SSL_ERROR_ZERO_RETURN) { + bool input_pending; + /* Yes, it did. */ + if(!send_shutdown) { + CURL_TRC_CF(data, cf, "SSL shutdown received, not sending"); + *done = TRUE; + goto out; + } + else if(!cf->next->cft->is_alive(cf->next, data, &input_pending)) { + /* Server closed the connection after its closy notify. It + * seems not interested to see our close notify, so do not + * send it. We are done. */ + CURL_TRC_CF(data, cf, "peer closed connection"); + connssl->peer_closed = TRUE; + *done = TRUE; + goto out; + } + } + } + + /* SSL should now have started the shutdown from our side. Since it + * was not complete, we are lacking the close notify from the server. */ + if(send_shutdown) { + ERR_clear_error(); + if(wolfSSL_shutdown(wctx->handle) == 1) { + CURL_TRC_CF(data, cf, "SSL shutdown finished"); + *done = TRUE; + goto out; + } + if(SSL_ERROR_WANT_WRITE == wolfSSL_get_error(wctx->handle, nread)) { + CURL_TRC_CF(data, cf, "SSL shutdown still wants to send"); + connssl->io_need = CURL_SSL_IO_NEED_SEND; + goto out; + } + /* Having sent the close notify, we use wolfSSL_read() to get the + * missing close notify from the server. */ + } + + for(i = 0; i < 10; ++i) { + ERR_clear_error(); + nread = wolfSSL_read(wctx->handle, buf, (int)sizeof(buf)); + if(nread <= 0) + break; + } + err = wolfSSL_get_error(wctx->handle, nread); + switch(err) { + case SSL_ERROR_ZERO_RETURN: /* no more data */ + CURL_TRC_CF(data, cf, "SSL shutdown received"); + *done = TRUE; + break; + case SSL_ERROR_NONE: /* just did not get anything */ + case SSL_ERROR_WANT_READ: + /* SSL has send its notify and now wants to read the reply + * from the server. We are not really interested in that. */ + CURL_TRC_CF(data, cf, "SSL shutdown sent, want receive"); + connssl->io_need = CURL_SSL_IO_NEED_RECV; + break; + case SSL_ERROR_WANT_WRITE: + CURL_TRC_CF(data, cf, "SSL shutdown send blocked"); + connssl->io_need = CURL_SSL_IO_NEED_SEND; + break; + default: + detail = wolfSSL_get_error(wctx->handle, err); + CURL_TRC_CF(data, cf, "SSL shutdown, error: '%s'(%d)", + wolfssl_strerror((unsigned long)err, error_buffer, + sizeof(error_buffer)), + detail); + result = CURLE_RECV_ERROR; + break; + } + +out: + cf->shutdown = (result || *done); + return result; +} + static void wolfssl_close(struct Curl_cfilter *cf, struct Curl_easy *data) { struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; (void) data; DEBUGASSERT(backend); if(backend->handle) { - char buf[32]; - /* Maybe the server has already sent a close notify alert. - Read it to avoid an RST on the TCP connection. */ - (void)wolfSSL_read(backend->handle, buf, (int)sizeof(buf)); - (void)wolfSSL_shutdown(backend->handle); wolfSSL_free(backend->handle); backend->handle = NULL; } @@ -1075,9 +1706,8 @@ static ssize_t wolfssl_recv(struct Curl_cfilter *cf, CURLcode *curlcode) { struct ssl_connect_data *connssl = cf->ctx; - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; - char error_buffer[WOLFSSL_MAX_ERROR_SZ]; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; int buffsize = (blen > (size_t)INT_MAX) ? INT_MAX : (int)blen; int nread; @@ -1099,7 +1729,7 @@ static ssize_t wolfssl_recv(struct Curl_cfilter *cf, case SSL_ERROR_NONE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: - /* there's data pending, re-invoke wolfSSL_read() */ + /* there is data pending, re-invoke wolfSSL_read() */ CURL_TRC_CF(data, cf, "wolfssl_recv(len=%zu) -> AGAIN", blen); *curlcode = CURLE_AGAIN; return -1; @@ -1109,8 +1739,13 @@ static ssize_t wolfssl_recv(struct Curl_cfilter *cf, *curlcode = CURLE_AGAIN; return -1; } - failf(data, "SSL read: %s, errno %d", - wolfSSL_ERR_error_string(err, error_buffer), SOCKERRNO); + { + char error_buffer[256]; + failf(data, "SSL read: %s, errno %d", + wolfssl_strerror((unsigned long)err, error_buffer, + sizeof(error_buffer)), + SOCKERRNO); + } *curlcode = CURLE_RECV_ERROR; return -1; } @@ -1120,12 +1755,6 @@ static ssize_t wolfssl_recv(struct Curl_cfilter *cf, } -static void wolfssl_session_free(void *ptr) -{ - wolfSSL_SESSION_free(ptr); -} - - static size_t wolfssl_version(char *buffer, size_t size) { #if LIBWOLFSSL_VERSION_HEX >= 0x03006000 @@ -1163,43 +1792,18 @@ static bool wolfssl_data_pending(struct Curl_cfilter *cf, const struct Curl_easy *data) { struct ssl_connect_data *ctx = cf->ctx; - struct wolfssl_ssl_backend_data *backend; + struct wolfssl_ctx *backend; (void)data; DEBUGASSERT(ctx && ctx->backend); - backend = (struct wolfssl_ssl_backend_data *)ctx->backend; + backend = (struct wolfssl_ctx *)ctx->backend; if(backend->handle) /* SSL is in use */ - return (0 != wolfSSL_pending(backend->handle)) ? TRUE : FALSE; + return wolfSSL_pending(backend->handle); else return FALSE; } - -/* - * This function is called to shut down the SSL layer but keep the - * socket open (CCC - Clear Command Channel) - */ -static int wolfssl_shutdown(struct Curl_cfilter *cf, - struct Curl_easy *data) -{ - struct ssl_connect_data *ctx = cf->ctx; - struct wolfssl_ssl_backend_data *backend; - int retval = 0; - - (void)data; - DEBUGASSERT(ctx && ctx->backend); - - backend = (struct wolfssl_ssl_backend_data *)ctx->backend; - if(backend->handle) { - wolfSSL_ERR_clear_error(); - wolfSSL_free(backend->handle); - backend->handle = NULL; - } - return retval; -} - - static CURLcode wolfssl_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -1209,7 +1813,6 @@ wolfssl_connect_common(struct Curl_cfilter *cf, CURLcode result; struct ssl_connect_data *connssl = cf->ctx; curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); - int what; /* check if the connection has already been established */ if(ssl_connection_complete == connssl->state) { @@ -1218,7 +1821,7 @@ wolfssl_connect_common(struct Curl_cfilter *cf, } if(ssl_connect_1 == connssl->connecting_state) { - /* Find out how much more time we're allowed */ + /* Find out how much more time we are allowed */ const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); if(timeout_ms < 0) { @@ -1232,9 +1835,7 @@ wolfssl_connect_common(struct Curl_cfilter *cf, return result; } - while(ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state) { + while(ssl_connect_2 == connssl->connecting_state) { /* check allowed time left */ const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); @@ -1245,17 +1846,14 @@ wolfssl_connect_common(struct Curl_cfilter *cf, return CURLE_OPERATION_TIMEDOUT; } - /* if ssl is expecting something, check if it's available. */ - if(connssl->connecting_state == ssl_connect_2_reading - || connssl->connecting_state == ssl_connect_2_writing) { - - curl_socket_t writefd = ssl_connect_2_writing == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - curl_socket_t readfd = ssl_connect_2_reading == - connssl->connecting_state?sockfd:CURL_SOCKET_BAD; - - what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, - nonblocking?0:timeout_ms); + /* if ssl is expecting something, check if it is available. */ + if(connssl->io_need) { + curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? + sockfd : CURL_SOCKET_BAD; + curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ? + sockfd : CURL_SOCKET_BAD; + int what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd, + nonblocking ? 0 : timeout_ms); if(what < 0) { /* fatal error */ failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO); @@ -1283,17 +1881,14 @@ wolfssl_connect_common(struct Curl_cfilter *cf, * have a valid fdset to wait on. */ result = wolfssl_connect_step2(cf, data); - if(result || (nonblocking && - (ssl_connect_2 == connssl->connecting_state || - ssl_connect_2_reading == connssl->connecting_state || - ssl_connect_2_writing == connssl->connecting_state))) + if(result || (nonblocking && (ssl_connect_2 == connssl->connecting_state))) return result; } /* repeat step2 until all transactions are done. */ if(ssl_connect_3 == connssl->connecting_state) { - result = wolfssl_connect_step3(cf, data); - if(result) - return result; + /* In other backends, this is where we verify the certificate, but + * wolfSSL already does that as part of the handshake. */ + connssl->connecting_state = ssl_connect_done; } if(ssl_connect_done == connssl->connecting_state) { @@ -1366,15 +1961,15 @@ static CURLcode wolfssl_sha256sum(const unsigned char *tmp, /* input */ static void *wolfssl_get_internals(struct ssl_connect_data *connssl, CURLINFO info UNUSED_PARAM) { - struct wolfssl_ssl_backend_data *backend = - (struct wolfssl_ssl_backend_data *)connssl->backend; + struct wolfssl_ctx *backend = + (struct wolfssl_ctx *)connssl->backend; (void)info; DEBUGASSERT(backend); return backend->handle; } const struct Curl_ssl Curl_ssl_wolfssl = { - { CURLSSLBACKEND_WOLFSSL, "WolfSSL" }, /* info */ + { CURLSSLBACKEND_WOLFSSL, "wolfssl" }, /* info */ #ifdef KEEP_PEER_CERT SSLSUPP_PINNEDPUBKEY | @@ -1384,9 +1979,17 @@ const struct Curl_ssl Curl_ssl_wolfssl = { #endif SSLSUPP_CA_PATH | SSLSUPP_CAINFO_BLOB | - SSLSUPP_SSL_CTX, +#ifdef USE_ECH + SSLSUPP_ECH | +#endif + SSLSUPP_SSL_CTX | +#ifdef WOLFSSL_TLS13 + SSLSUPP_TLS13_CIPHERSUITES | +#endif + SSLSUPP_CA_CACHE | + SSLSUPP_CIPHER_LIST, - sizeof(struct wolfssl_ssl_backend_data), + sizeof(struct wolfssl_ctx), wolfssl_init, /* init */ wolfssl_cleanup, /* cleanup */ @@ -1402,7 +2005,6 @@ const struct Curl_ssl Curl_ssl_wolfssl = { wolfssl_get_internals, /* get_internals */ wolfssl_close, /* close_one */ Curl_none_close_all, /* close_all */ - wolfssl_session_free, /* session_free */ Curl_none_set_engine, /* set_engine */ Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ @@ -1410,9 +2012,9 @@ const struct Curl_ssl Curl_ssl_wolfssl = { wolfssl_sha256sum, /* sha256sum */ NULL, /* associate_connection */ NULL, /* disassociate_connection */ - NULL, /* free_multi_ssl_backend_data */ wolfssl_recv, /* recv decrypted data */ wolfssl_send, /* send data to encrypt */ + NULL, /* get_channel_binding */ }; #endif diff --git a/deps/curl/lib/vtls/wolfssl.h b/deps/curl/lib/vtls/wolfssl.h index a5ed8480..e39fa88a 100644 --- a/deps/curl/lib/vtls/wolfssl.h +++ b/deps/curl/lib/vtls/wolfssl.h @@ -26,8 +26,38 @@ #include "curl_setup.h" #ifdef USE_WOLFSSL +#include +#include +#include +#include + +#include "urldata.h" extern const struct Curl_ssl Curl_ssl_wolfssl; +struct wolfssl_ctx { + WOLFSSL_CTX *ctx; + WOLFSSL *handle; + CURLcode io_result; /* result of last BIO cfilter operation */ + int io_send_blocked_len; /* length of last BIO write that EAGAINed */ + BIT(x509_store_setup); /* x509 store has been set up */ + BIT(shutting_down); /* TLS is being shut down */ +}; + +CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct wolfssl_ctx *wssl); + +CURLcode wssl_setup_session(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct wolfssl_ctx *wss, + struct ssl_peer *peer); + +CURLcode wssl_cache_session(struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + WOLFSSL_SESSION *session); + + #endif /* USE_WOLFSSL */ #endif /* HEADER_CURL_WOLFSSL_H */ diff --git a/deps/curl/lib/vtls/x509asn1.c b/deps/curl/lib/vtls/x509asn1.c index da079361..fe4a38b8 100644 --- a/deps/curl/lib/vtls/x509asn1.c +++ b/deps/curl/lib/vtls/x509asn1.c @@ -25,13 +25,15 @@ #include "curl_setup.h" #if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || \ - defined(USE_SCHANNEL) || defined(USE_SECTRANSP) + defined(USE_SCHANNEL) || defined(USE_SECTRANSP) || \ + defined(USE_MBEDTLS) #if defined(USE_WOLFSSL) || defined(USE_SCHANNEL) #define WANT_PARSEX509 /* uses Curl_parseX509() */ #endif -#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_SECTRANSP) +#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_SECTRANSP) || \ + defined(USE_MBEDTLS) #define WANT_EXTRACT_CERTINFO /* uses Curl_extract_certinfo() */ #define WANT_PARSEX509 /* ... uses Curl_parseX509() */ #endif @@ -97,10 +99,6 @@ #define CURL_ASN1_CHARACTER_STRING 29 #define CURL_ASN1_BMP_STRING 30 -/* Max sixes */ - -#define MAX_X509_STR 10000 -#define MAX_X509_CERT 100000 #ifdef WANT_EXTRACT_CERTINFO /* ASN.1 OID table entry. */ @@ -110,15 +108,16 @@ struct Curl_OID { }; /* ASN.1 OIDs. */ -static const char cnOID[] = "2.5.4.3"; /* Common name. */ -static const char sanOID[] = "2.5.29.17"; /* Subject alternative name. */ - static const struct Curl_OID OIDtable[] = { { "1.2.840.10040.4.1", "dsa" }, { "1.2.840.10040.4.3", "dsa-with-sha1" }, { "1.2.840.10045.2.1", "ecPublicKey" }, { "1.2.840.10045.3.0.1", "c2pnb163v1" }, { "1.2.840.10045.4.1", "ecdsa-with-SHA1" }, + { "1.2.840.10045.4.3.1", "ecdsa-with-SHA224" }, + { "1.2.840.10045.4.3.2", "ecdsa-with-SHA256" }, + { "1.2.840.10045.4.3.3", "ecdsa-with-SHA384" }, + { "1.2.840.10045.4.3.4", "ecdsa-with-SHA512" }, { "1.2.840.10046.2.1", "dhpublicnumber" }, { "1.2.840.113549.1.1.1", "rsaEncryption" }, { "1.2.840.113549.1.1.2", "md2WithRSAEncryption" }, @@ -132,7 +131,7 @@ static const struct Curl_OID OIDtable[] = { { "1.2.840.113549.2.2", "md2" }, { "1.2.840.113549.2.5", "md5" }, { "1.3.14.3.2.26", "sha1" }, - { cnOID, "CN" }, + { "2.5.4.3", "CN" }, { "2.5.4.4", "SN" }, { "2.5.4.5", "serialNumber" }, { "2.5.4.6", "C" }, @@ -153,13 +152,14 @@ static const struct Curl_OID OIDtable[] = { { "2.5.4.65", "pseudonym" }, { "1.2.840.113549.1.9.1", "emailAddress" }, { "2.5.4.72", "role" }, - { sanOID, "subjectAltName" }, + { "2.5.29.17", "subjectAltName" }, { "2.5.29.18", "issuerAltName" }, { "2.5.29.19", "basicConstraints" }, { "2.16.840.1.101.3.4.2.4", "sha224" }, { "2.16.840.1.101.3.4.2.1", "sha256" }, { "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 } }; @@ -270,7 +270,7 @@ static CURLcode bool2str(struct dynbuf *store, { if(end - beg != 1) return CURLE_BAD_FUNCTION_ARGUMENT; - return Curl_dyn_add(store, *beg? "TRUE": "FALSE"); + return Curl_dyn_add(store, *beg ? "TRUE": "FALSE"); } /* @@ -323,7 +323,7 @@ static CURLcode int2str(struct dynbuf *store, do val = (val << 8) | *(const unsigned char *) beg++; while(beg < end); - return Curl_dyn_addf(store, "%s%x", val >= 10? "0x": "", val); + return Curl_dyn_addf(store, "%s%x", val >= 10 ? "0x" : "", val); } /* @@ -371,7 +371,7 @@ utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) else { while(!result && (from < end)) { char buf[4]; /* decode buffer */ - int charsize = 1; + size_t charsize = 1; unsigned int wc = 0; switch(size) { @@ -389,7 +389,6 @@ utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) if(wc >= 0x00000800) { if(wc >= 0x00010000) { if(wc >= 0x00200000) { - free(buf); /* Invalid char. size for target encoding. */ return CURLE_WEIRD_SERVER_REPLY; } @@ -460,13 +459,15 @@ static CURLcode OID2str(struct dynbuf *store, if(beg < end) { if(symbolic) { struct dynbuf buf; - Curl_dyn_init(&buf, MAX_X509_STR); + Curl_dyn_init(&buf, CURL_X509_STR_MAX); result = encodeOID(&buf, beg, end); if(!result) { const struct Curl_OID *op = searchOID(Curl_dyn_ptr(&buf)); if(op) result = Curl_dyn_add(store, op->textoid); + else + result = Curl_dyn_add(store, Curl_dyn_ptr(&buf)); Curl_dyn_free(&buf); } } @@ -489,7 +490,7 @@ static CURLcode GTime2str(struct dynbuf *store, /* Convert an ASN.1 Generalized time to a printable string. Return the dynamically allocated string, or NULL if an error occurs. */ - for(fracp = beg; fracp < end && *fracp >= '0' && *fracp <= '9'; fracp++) + for(fracp = beg; fracp < end && ISDIGIT(*fracp); fracp++) ; /* Get seconds digits. */ @@ -508,40 +509,61 @@ static CURLcode GTime2str(struct dynbuf *store, return CURLE_BAD_FUNCTION_ARGUMENT; } - /* Scan for timezone, measure fractional seconds. */ + /* timezone follows optional fractional seconds. */ tzp = fracp; - fracl = 0; + fracl = 0; /* no fractional seconds detected so far */ if(fracp < end && (*fracp == '.' || *fracp == ',')) { - fracp++; - do + /* Have fractional seconds, e.g. "[.,]\d+". How many? */ + fracp++; /* should be a digit char or BAD ARGUMENT */ + tzp = fracp; + while(tzp < end && ISDIGIT(*tzp)) tzp++; - while(tzp < end && *tzp >= '0' && *tzp <= '9'); - /* Strip leading zeroes in fractional seconds. */ - for(fracl = tzp - fracp - 1; fracl && fracp[fracl - 1] == '0'; fracl--) - ; + if(tzp == fracp) /* never looped, no digit after [.,] */ + return CURLE_BAD_FUNCTION_ARGUMENT; + fracl = tzp - fracp; /* number of fractional sec digits */ + DEBUGASSERT(fracl > 0); + /* Strip trailing zeroes in fractional seconds. + * May reduce fracl to 0 if only '0's are present. */ + while(fracl && fracp[fracl - 1] == '0') + fracl--; } /* Process timezone. */ - if(tzp >= end) - ; /* Nothing to do. */ + if(tzp >= end) { + tzp = ""; + tzl = 0; + } else if(*tzp == 'Z') { - tzp = " GMT"; - end = tzp + 4; + sep = " "; + tzp = "GMT"; + tzl = 3; + } + else if((*tzp == '+') || (*tzp == '-')) { + sep = " UTC"; + tzl = end - tzp; } else { sep = " "; - tzp++; + tzl = end - tzp; } - tzl = end - tzp; return Curl_dyn_addf(store, "%.4s-%.2s-%.2s %.2s:%.2s:%c%c%s%.*s%s%.*s", beg, beg + 4, beg + 6, beg + 8, beg + 10, sec1, sec2, - fracl? ".": "", (int)fracl, fracp, + fracl ? ".": "", (int)fracl, fracp, sep, (int)tzl, tzp); } +#ifdef UNITTESTS +/* used by unit1656.c */ +CURLcode Curl_x509_GTime2str(struct dynbuf *store, + const char *beg, const char *end) +{ + return GTime2str(store, beg, end); +} +#endif + /* * Convert an ASN.1 UTC time to a printable string. * @@ -595,7 +617,7 @@ static CURLcode ASN1tostr(struct dynbuf *store, { CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT; if(elem->constructed) - return CURLE_OK; /* No conversion of structured elements. */ + return result; /* No conversion of structured elements. */ if(!type) type = elem->tag; /* Type not forced: use element tag as type. */ @@ -659,7 +681,7 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) CURLcode result = CURLE_OK; bool added = FALSE; struct dynbuf temp; - Curl_dyn_init(&temp, MAX_X509_STR); + Curl_dyn_init(&temp, CURL_X509_STR_MAX); for(p1 = dn->beg; p1 < dn->end;) { p1 = getASN1Element(&rdn, p1, dn->end); @@ -689,6 +711,11 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) str = Curl_dyn_ptr(&temp); + if(!str) { + result = CURLE_BAD_FUNCTION_ARGUMENT; + goto error; + } + /* Encode delimiter. If attribute has a short uppercase name, delimiter is ", ". */ for(p3 = str; ISUPPER(*p3); p3++) @@ -918,7 +945,7 @@ static CURLcode do_pubkey_field(struct Curl_easy *data, int certnum, CURLcode result; struct dynbuf out; - Curl_dyn_init(&out, MAX_X509_STR); + Curl_dyn_init(&out, CURL_X509_STR_MAX); /* Generate a certificate information record for the public key. */ @@ -956,7 +983,8 @@ static int do_pubkey(struct Curl_easy *data, int certnum, if(ssl_push_certinfo(data, certnum, "ECC Public Key", q)) return 1; } - return do_pubkey_field(data, certnum, "ecPublicKey", pubkey); + return do_pubkey_field(data, certnum, "ecPublicKey", pubkey) == CURLE_OK + ? 0 : 1; } /* Get the public key (single element). */ @@ -1061,7 +1089,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, if(certnum) return CURLE_OK; - Curl_dyn_init(&out, MAX_X509_STR); + Curl_dyn_init(&out, CURL_X509_STR_MAX); /* Prepare the certificate information for curl_easy_getinfo(). */ /* Extract the certificate ASN.1 elements. */ @@ -1220,6 +1248,8 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, result = ssl_push_certinfo_dyn(data, certnum, "Cert", &out); done: + if(result) + failf(data, "Failed extracting certificate chain"); Curl_dyn_free(&out); return result; } diff --git a/deps/curl/lib/vtls/x509asn1.h b/deps/curl/lib/vtls/x509asn1.h index 23a67b82..5b48596c 100644 --- a/deps/curl/lib/vtls/x509asn1.h +++ b/deps/curl/lib/vtls/x509asn1.h @@ -28,7 +28,8 @@ #include "curl_setup.h" #if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || \ - defined(USE_SCHANNEL) || defined(USE_SECTRANSP) + defined(USE_SCHANNEL) || defined(USE_SECTRANSP) || \ + defined(USE_MBEDTLS) #include "cfilters.h" #include "urldata.h" @@ -76,5 +77,16 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, int certnum, const char *beg, const char *end); CURLcode Curl_verifyhost(struct Curl_cfilter *cf, struct Curl_easy *data, const char *beg, const char *end); + +#ifdef UNITTESTS +#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_SECTRANSP) || \ + defined(USE_MBEDTLS) + +/* used by unit1656.c */ +CURLcode Curl_x509_GTime2str(struct dynbuf *store, + const char *beg, const char *end); +#endif +#endif + #endif /* USE_GNUTLS or USE_WOLFSSL or USE_SCHANNEL or USE_SECTRANSP */ #endif /* HEADER_CURL_X509ASN1_H */ diff --git a/deps/curl/lib/warnless.c b/deps/curl/lib/warnless.c index c80937b8..8da3be3a 100644 --- a/deps/curl/lib/warnless.c +++ b/deps/curl/lib/warnless.c @@ -345,28 +345,6 @@ size_t curlx_sitouz(int sinum) #endif } -#ifdef USE_WINSOCK - -/* -** curl_socket_t to signed int -*/ - -int curlx_sktosi(curl_socket_t s) -{ - return (int)((ssize_t) s); -} - -/* -** signed int to curl_socket_t -*/ - -curl_socket_t curlx_sitosk(int i) -{ - return (curl_socket_t)((ssize_t) i); -} - -#endif /* USE_WINSOCK */ - #if defined(_WIN32) ssize_t curlx_read(int fd, void *buf, size_t count) diff --git a/deps/curl/lib/warnless.h b/deps/curl/lib/warnless.h index e5a02c8d..972c7a9c 100644 --- a/deps/curl/lib/warnless.h +++ b/deps/curl/lib/warnless.h @@ -61,14 +61,6 @@ unsigned short curlx_uitous(unsigned int uinum); size_t curlx_sitouz(int sinum); -#ifdef USE_WINSOCK - -int curlx_sktosi(curl_socket_t s); - -curl_socket_t curlx_sitosk(int i); - -#endif /* USE_WINSOCK */ - #if defined(_WIN32) ssize_t curlx_read(int fd, void *buf, size_t count); @@ -77,20 +69,6 @@ ssize_t curlx_write(int fd, const void *buf, size_t count); #endif /* _WIN32 */ -#if defined(__INTEL_COMPILER) && defined(__unix__) - -int curlx_FD_ISSET(int fd, fd_set *fdset); - -void curlx_FD_SET(int fd, fd_set *fdset); - -void curlx_FD_ZERO(fd_set *fdset); - -unsigned short curlx_htons(unsigned short usnum); - -unsigned short curlx_ntohs(unsigned short usnum); - -#endif /* __INTEL_COMPILER && __unix__ */ - #endif /* HEADER_CURL_WARNLESS_H */ #ifndef HEADER_CURL_WARNLESS_H_REDEFS diff --git a/deps/curl/lib/ws.c b/deps/curl/lib/ws.c index 26329976..3d739a53 100644 --- a/deps/curl/lib/ws.c +++ b/deps/curl/lib/ws.c @@ -24,7 +24,7 @@ #include "curl_setup.h" #include -#if defined(USE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) #include "urldata.h" #include "bufq.h" @@ -37,6 +37,7 @@ #include "ws.h" #include "easyif.h" #include "transfer.h" +#include "select.h" #include "nonblock.h" /* The last 3 #include files should be in this order */ @@ -102,7 +103,7 @@ static unsigned char ws_frame_flags2op(int flags) size_t i; for(i = 0; i < sizeof(WS_FRAMES)/sizeof(WS_FRAMES[0]); ++i) { if(WS_FRAMES[i].flags & flags) - return WS_FRAMES[i].proto_opcode; + return (unsigned char)WS_FRAMES[i].proto_opcode; } return 0; } @@ -114,28 +115,31 @@ static void ws_dec_info(struct ws_decoder *dec, struct Curl_easy *data, case 0: break; case 1: - infof(data, "WS-DEC: %s [%s%s]", msg, - ws_frame_name_of_op(dec->head[0]), - (dec->head[0] & WSBIT_FIN)? "" : " NON-FINAL"); + CURL_TRC_WRITE(data, "websocket, decoded %s [%s%s]", msg, + ws_frame_name_of_op(dec->head[0]), + (dec->head[0] & WSBIT_FIN) ? "" : " NON-FINAL"); break; default: if(dec->head_len < dec->head_total) { - infof(data, "WS-DEC: %s [%s%s](%d/%d)", msg, - ws_frame_name_of_op(dec->head[0]), - (dec->head[0] & WSBIT_FIN)? "" : " NON-FINAL", - dec->head_len, dec->head_total); + CURL_TRC_WRITE(data, "websocket, decoded %s [%s%s](%d/%d)", msg, + ws_frame_name_of_op(dec->head[0]), + (dec->head[0] & WSBIT_FIN) ? "" : " NON-FINAL", + dec->head_len, dec->head_total); } else { - infof(data, "WS-DEC: %s [%s%s payload=%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T "]", - msg, ws_frame_name_of_op(dec->head[0]), - (dec->head[0] & WSBIT_FIN)? "" : " NON-FINAL", - dec->payload_offset, dec->payload_len); + CURL_TRC_WRITE(data, "websocket, decoded %s [%s%s payload=%" + FMT_OFF_T "/%" FMT_OFF_T "]", + msg, ws_frame_name_of_op(dec->head[0]), + (dec->head[0] & WSBIT_FIN) ? "" : " NON-FINAL", + dec->payload_offset, dec->payload_len); } break; } } +static CURLcode ws_send_raw_blocking(CURL *data, struct websocket *ws, + const char *buffer, size_t buflen); + typedef ssize_t ws_write_payload(const unsigned char *buf, size_t buflen, int frame_age, int frame_flags, curl_off_t payload_offset, @@ -171,7 +175,7 @@ static CURLcode ws_dec_read_head(struct ws_decoder *dec, dec->head[0] = *inbuf; Curl_bufq_skip(inraw, 1); - dec->frame_flags = ws_frame_op2flags(dec->head[0]); + dec->frame_flags = ws_frame_op2flags(dec->head[0]); if(!dec->frame_flags) { failf(data, "WS: unknown opcode: %x", dec->head[0]); ws_dec_reset(dec); @@ -277,12 +281,11 @@ static CURLcode ws_dec_pass_payload(struct ws_decoder *dec, Curl_bufq_skip(inraw, (size_t)nwritten); dec->payload_offset += (curl_off_t)nwritten; remain = dec->payload_len - dec->payload_offset; - /* infof(data, "WS-DEC: passed %zd bytes payload, %" - CURL_FORMAT_CURL_OFF_T " remain", - nwritten, remain); */ + CURL_TRC_WRITE(data, "websocket, passed %zd bytes payload, %" + FMT_OFF_T " remain", nwritten, remain); } - return remain? CURLE_AGAIN : CURLE_OK; + return remain ? CURLE_AGAIN : CURLE_OK; } static CURLcode ws_dec_pass(struct ws_decoder *dec, @@ -454,10 +457,12 @@ static CURLcode ws_cw_write(struct Curl_easy *data, pass_ctx.cw_type = type; result = ws_dec_pass(&ws->dec, data, &ctx->buf, ws_cw_dec_next, &pass_ctx); - if(result == CURLE_AGAIN) + if(result == CURLE_AGAIN) { /* insufficient amount of data, keep it for later. * we pretend to have written all since we have a copy */ + CURL_TRC_WRITE(data, "websocket, buffered incomplete frame head"); return CURLE_OK; + } else if(result) { infof(data, "WS: decode error %d", (int)result); return result; @@ -487,12 +492,11 @@ static const struct Curl_cwtype ws_cw_decode = { static void ws_enc_info(struct ws_encoder *enc, struct Curl_easy *data, const char *msg) { - infof(data, "WS-ENC: %s [%s%s%s payload=%" CURL_FORMAT_CURL_OFF_T - "/%" CURL_FORMAT_CURL_OFF_T "]", + infof(data, "WS-ENC: %s [%s%s%s payload=%" FMT_OFF_T "/%" FMT_OFF_T "]", msg, ws_frame_name_of_op(enc->firstbyte), (enc->firstbyte & WSBIT_OPCODE_MASK) == WSBIT_OPCODE_CONT ? " CONT" : "", - (enc->firstbyte & WSBIT_FIN)? "" : " NON-FIN", + (enc->firstbyte & WSBIT_FIN) ? "" : " NON-FIN", enc->payload_len - enc->payload_remain, enc->payload_len); } @@ -546,20 +550,20 @@ static ssize_t ws_enc_write_head(struct Curl_easy *data, if(payload_len < 0) { failf(data, "WS: starting new frame with negative payload length %" - CURL_FORMAT_CURL_OFF_T, payload_len); + FMT_OFF_T, payload_len); *err = CURLE_SEND_ERROR; return -1; } if(enc->payload_remain > 0) { /* trying to write a new frame before the previous one is finished */ - failf(data, "WS: starting new frame with %zd bytes from last one" + failf(data, "WS: starting new frame with %zd bytes from last one " "remaining to be sent", (ssize_t)enc->payload_remain); *err = CURLE_SEND_ERROR; return -1; } - opcode = ws_frame_flags2op(flags); + opcode = ws_frame_flags2op((int)flags & ~CURLWS_CONT); if(!opcode) { failf(data, "WS: provided flags not recognized '%x'", flags); *err = CURLE_SEND_ERROR; @@ -578,7 +582,7 @@ static ssize_t ws_enc_write_head(struct Curl_easy *data, enc->contfragment = FALSE; } else if(enc->contfragment) { - /* the previous fragment was not a final one and this isn't either, keep a + /* the previous fragment was not a final one and this is not either, keep a CONT opcode and no FIN bit */ firstbyte |= WSBIT_OPCODE_CONT; } @@ -717,8 +721,10 @@ CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req) if(result) return result; DEBUGASSERT(randlen < sizeof(keyval)); - if(randlen >= sizeof(keyval)) + if(randlen >= sizeof(keyval)) { + free(randstr); return CURLE_FAILED_INIT; + } strcpy(keyval, randstr); free(randstr); for(i = 0; !result && (i < sizeof(heads)/sizeof(heads[0])); i++) { @@ -770,7 +776,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data, } } #endif - DEBUGF(infof(data, "WS, using chunk size %zu", chunk_size)); + CURL_TRC_WS(data, "WS, using chunk size %zu", chunk_size); Curl_bufq_init2(&ws->recvbuf, chunk_size, WS_CHUNK_COUNT, BUFQ_OPT_SOFT_LIMIT); Curl_bufq_init2(&ws->sendbuf, chunk_size, WS_CHUNK_COUNT, @@ -918,15 +924,17 @@ static ssize_t nw_in_recv(void *reader_ctx, return (ssize_t)nread; } -CURL_EXTERN CURLcode curl_ws_recv(struct Curl_easy *data, void *buffer, +CURL_EXTERN CURLcode curl_ws_recv(CURL *d, void *buffer, size_t buflen, size_t *nread, const struct curl_ws_frame **metap) { + struct Curl_easy *data = d; struct connectdata *conn = data->conn; struct websocket *ws; - bool done = FALSE; /* not filled passed buffer yet */ struct ws_collect ctx; - CURLcode result; + + *nread = 0; + *metap = NULL; if(!conn) { /* Unhappy hack with lifetimes of transfers and connection */ @@ -947,19 +955,15 @@ CURL_EXTERN CURLcode curl_ws_recv(struct Curl_easy *data, void *buffer, return CURLE_BAD_FUNCTION_ARGUMENT; } - *nread = 0; - *metap = NULL; - /* get a download buffer */ - result = Curl_preconnect(data); - if(result) - return result; memset(&ctx, 0, sizeof(ctx)); ctx.data = data; ctx.buffer = buffer; ctx.buflen = buflen; - while(!done) { + while(1) { + CURLcode result; + /* receive more when our buffer is empty */ if(Curl_bufq_is_empty(&ws->recvbuf)) { ssize_t n = Curl_bufq_slurp(&ws->recvbuf, nw_in_recv, data, &result); @@ -971,8 +975,8 @@ CURL_EXTERN CURLcode curl_ws_recv(struct Curl_easy *data, void *buffer, infof(data, "connection expectedly closed?"); return CURLE_GOT_NOTHING; } - DEBUGF(infof(data, "curl_ws_recv, added %zu bytes from network", - Curl_bufq_len(&ws->recvbuf))); + CURL_TRC_WS(data, "curl_ws_recv, added %zu bytes from network", + Curl_bufq_len(&ws->recvbuf)); } result = ws_dec_pass(&ws->dec, data, &ws->recvbuf, @@ -982,7 +986,6 @@ CURL_EXTERN CURLcode curl_ws_recv(struct Curl_easy *data, void *buffer, ws_dec_info(&ws->dec, data, "need more input"); continue; /* nothing written, try more input */ } - done = TRUE; break; } else if(result) { @@ -992,7 +995,6 @@ CURL_EXTERN CURLcode curl_ws_recv(struct Curl_easy *data, void *buffer, /* The decoded frame is passed back to our caller. * There are frames like PING were we auto-respond to and * that we do not return. For these `ctx.written` is not set. */ - done = TRUE; break; } } @@ -1002,14 +1004,14 @@ CURL_EXTERN CURLcode curl_ws_recv(struct Curl_easy *data, void *buffer, ctx.payload_len, ctx.bufidx); *metap = &ws->frame; *nread = ws->frame.len; - /* infof(data, "curl_ws_recv(len=%zu) -> %zu bytes (frame at %" - CURL_FORMAT_CURL_OFF_T ", %" CURL_FORMAT_CURL_OFF_T " left)", - buflen, *nread, ws->frame.offset, ws->frame.bytesleft); */ + CURL_TRC_WS(data, "curl_ws_recv(len=%zu) -> %zu bytes (frame at %" + FMT_OFF_T ", %" FMT_OFF_T " left)", + buflen, *nread, ws->frame.offset, ws->frame.bytesleft); return CURLE_OK; } static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, - bool complete) + bool blocking) { if(!Curl_bufq_is_empty(&ws->sendbuf)) { CURLcode result; @@ -1017,30 +1019,26 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, size_t outlen, n; while(Curl_bufq_peek(&ws->sendbuf, &out, &outlen)) { - if(data->set.connect_only) + if(blocking) { + result = ws_send_raw_blocking(data, ws, (char *)out, outlen); + n = result ? 0 : outlen; + } + else if(data->set.connect_only || Curl_is_in_callback(data)) result = Curl_senddata(data, out, outlen, &n); else { - result = Curl_xfer_send(data, out, outlen, &n); + result = Curl_xfer_send(data, out, outlen, FALSE, &n); if(!result && !n && outlen) result = CURLE_AGAIN; } - if(result) { - if(result == CURLE_AGAIN) { - if(!complete) { - infof(data, "WS: flush EAGAIN, %zu bytes remain in buffer", - Curl_bufq_len(&ws->sendbuf)); - return result; - } - /* TODO: the current design does not allow for buffered writes. - * We need to flush the buffer now. There is no ws_flush() later */ - n = 0; - continue; - } - else if(result) { - failf(data, "WS: flush, write error %d", result); - return result; - } + if(result == CURLE_AGAIN) { + CURL_TRC_WS(data, "flush EAGAIN, %zu bytes remain in buffer", + Curl_bufq_len(&ws->sendbuf)); + return result; + } + else if(result) { + failf(data, "WS: flush, write error %d", result); + return result; } else { infof(data, "WS: flushed %zu bytes", n); @@ -1051,67 +1049,139 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, return CURLE_OK; } -CURL_EXTERN CURLcode curl_ws_send(CURL *data, const void *buffer, +static CURLcode ws_send_raw_blocking(CURL *d, struct websocket *ws, + const char *buffer, size_t buflen) +{ + CURLcode result = CURLE_OK; + size_t nwritten; + struct Curl_easy *data = d; + + (void)ws; + while(buflen) { + result = Curl_xfer_send(data, buffer, buflen, FALSE, &nwritten); + if(result) + return result; + DEBUGASSERT(nwritten <= buflen); + buffer += nwritten; + buflen -= nwritten; + if(buflen) { + curl_socket_t sock = data->conn->sock[FIRSTSOCKET]; + timediff_t left_ms; + int ev; + + CURL_TRC_WS(data, "ws_send_raw_blocking() partial, %zu left to send", + buflen); + left_ms = Curl_timeleft(data, NULL, FALSE); + if(left_ms < 0) { + failf(data, "Timeout waiting for socket becoming writable"); + return CURLE_SEND_ERROR; + } + + /* POLLOUT socket */ + if(sock == CURL_SOCKET_BAD) + return CURLE_SEND_ERROR; + ev = Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, sock, + left_ms ? left_ms : 500); + if(ev < 0) { + failf(data, "Error while waiting for socket becoming writable"); + return CURLE_SEND_ERROR; + } + } + } + return result; +} + +static CURLcode ws_send_raw(struct Curl_easy *data, const void *buffer, + size_t buflen, size_t *pnwritten) +{ + struct websocket *ws = data->conn->proto.ws; + CURLcode result; + + if(!ws) { + failf(data, "Not a websocket transfer"); + return CURLE_SEND_ERROR; + } + if(!buflen) + return CURLE_OK; + + if(Curl_is_in_callback(data)) { + /* When invoked from inside callbacks, we do a blocking send as the + * callback will probably not implement partial writes that may then + * mess up the ws framing subsequently. + * We need any pending data to be flushed before sending. */ + result = ws_flush(data, ws, TRUE); + if(result) + return result; + result = ws_send_raw_blocking(data, ws, buffer, buflen); + } + else { + /* We need any pending data to be sent or EAGAIN this call. */ + result = ws_flush(data, ws, FALSE); + if(result) + return result; + result = Curl_senddata(data, buffer, buflen, pnwritten); + } + + CURL_TRC_WS(data, "ws_send_raw(len=%zu) -> %d, %zu", + buflen, result, *pnwritten); + return result; +} + +CURL_EXTERN CURLcode curl_ws_send(CURL *d, const void *buffer, size_t buflen, size_t *sent, curl_off_t fragsize, unsigned int flags) { struct websocket *ws; ssize_t n; - size_t nwritten, space; + size_t space, payload_added; CURLcode result; + struct Curl_easy *data = d; + CURL_TRC_WS(data, "curl_ws_send(len=%zu, fragsize=%" FMT_OFF_T + ", flags=%x), raw=%d", + buflen, fragsize, flags, data->set.ws_raw_mode); *sent = 0; if(!data->conn && data->set.connect_only) { result = Curl_connect_only_attach(data); if(result) - return result; + goto out; } if(!data->conn) { failf(data, "No associated connection"); - return CURLE_SEND_ERROR; + result = CURLE_SEND_ERROR; + goto out; } if(!data->conn->proto.ws) { failf(data, "Not a websocket transfer"); - return CURLE_SEND_ERROR; + result = CURLE_SEND_ERROR; + goto out; } ws = data->conn->proto.ws; + /* try flushing any content still waiting to be sent. */ + result = ws_flush(data, ws, FALSE); + if(result) + goto out; + if(data->set.ws_raw_mode) { + /* In raw mode, we write directly to the connection */ if(fragsize || flags) { - DEBUGF(infof(data, "ws_send: " - "fragsize and flags cannot be non-zero in raw mode")); + failf(data, "ws_send, raw mode: fragsize and flags cannot be non-zero"); return CURLE_BAD_FUNCTION_ARGUMENT; } - if(!buflen) - /* nothing to do */ - return CURLE_OK; - /* raw mode sends exactly what was requested, and this is from within - the write callback */ - if(Curl_is_in_callback(data)) { - result = Curl_xfer_send(data, buffer, buflen, &nwritten); - } - else - result = Curl_senddata(data, buffer, buflen, &nwritten); - - infof(data, "WS: wanted to send %zu bytes, sent %zu bytes", - buflen, nwritten); - *sent = nwritten; - return result; + result = ws_send_raw(data, buffer, buflen, sent); + goto out; } /* Not RAW mode, buf we do the frame encoding */ - result = ws_flush(data, ws, FALSE); - if(result) - return result; - - /* TODO: the current design does not allow partial writes, afaict. - * It is not clear how the application is supposed to react. */ space = Curl_bufq_space(&ws->sendbuf); - DEBUGF(infof(data, "curl_ws_send(len=%zu), sendbuf len=%zu space %zu", - buflen, Curl_bufq_len(&ws->sendbuf), space)); - if(space < 14) - return CURLE_AGAIN; + CURL_TRC_WS(data, "curl_ws_send(len=%zu), sendbuf=%zu space_left=%zu", + buflen, Curl_bufq_len(&ws->sendbuf), space); + if(space < 14) { + result = CURLE_AGAIN; + goto out; + } if(flags & CURLWS_OFFSET) { if(fragsize) { @@ -1119,12 +1189,12 @@ CURL_EXTERN CURLcode curl_ws_send(CURL *data, const void *buffer, n = ws_enc_write_head(data, &ws->enc, flags, fragsize, &ws->sendbuf, &result); if(n < 0) - return result; + goto out; } else { if((curl_off_t)buflen > ws->enc.payload_remain) { infof(data, "WS: unaligned frame size (sending %zu instead of %" - CURL_FORMAT_CURL_OFF_T ")", + FMT_OFF_T ")", buflen, ws->enc.payload_remain); } } @@ -1133,16 +1203,66 @@ CURL_EXTERN CURLcode curl_ws_send(CURL *data, const void *buffer, n = ws_enc_write_head(data, &ws->enc, flags, (curl_off_t)buflen, &ws->sendbuf, &result); if(n < 0) - return result; + goto out; } n = ws_enc_write_payload(&ws->enc, data, buffer, buflen, &ws->sendbuf, &result); if(n < 0) - return result; + goto out; + payload_added = (size_t)n; - *sent = (size_t)n; - return ws_flush(data, ws, TRUE); + while(!result && (buflen || !Curl_bufq_is_empty(&ws->sendbuf))) { + /* flush, blocking when in callback */ + result = ws_flush(data, ws, Curl_is_in_callback(data)); + if(!result) { + DEBUGASSERT(payload_added <= buflen); + /* all buffered data sent. Try sending the rest if there is any. */ + *sent += payload_added; + buffer = (const char *)buffer + payload_added; + buflen -= payload_added; + payload_added = 0; + if(buflen) { + n = ws_enc_write_payload(&ws->enc, data, + buffer, buflen, &ws->sendbuf, &result); + if(n < 0) + goto out; + payload_added = Curl_bufq_len(&ws->sendbuf); + } + } + else if(result == CURLE_AGAIN) { + /* partially sent. how much of the call data has been part of it? what + * should we report to out caller so it can retry/send the rest? */ + if(payload_added < buflen) { + /* We did not add everything the caller wanted. Return just + * the partial write to our buffer. */ + *sent = payload_added; + result = CURLE_OK; + goto out; + } + else if(!buflen) { + /* We have no payload to report a partial write. EAGAIN would make + * the caller repeat this and add the frame again. + * Flush blocking seems the only way out of this. */ + *sent = (size_t)n; + result = ws_flush(data, ws, TRUE); + goto out; + } + /* We added the complete data to our sendbuf. Report one byte less as + * sent. This partial success should make the caller invoke us again + * with the last byte. */ + *sent = payload_added - 1; + result = Curl_bufq_unwrite(&ws->sendbuf, 1); + if(!result) + result = CURLE_AGAIN; + } + } + +out: + CURL_TRC_WS(data, "curl_ws_send(len=%zu, fragsize=%" FMT_OFF_T + ", flags=%x, raw=%d) -> %d, %zu", + buflen, fragsize, flags, data->set.ws_raw_mode, result, *sent); + return result; } static void ws_free(struct connectdata *conn) @@ -1157,17 +1277,12 @@ static void ws_free(struct connectdata *conn) static CURLcode ws_setup_conn(struct Curl_easy *data, struct connectdata *conn) { - /* websockets is 1.1 only (for now) */ + /* WebSockets is 1.1 only (for now) */ data->state.httpwant = CURL_HTTP_VERSION_1_1; return Curl_http_setup_conn(data, conn); } -void Curl_ws_done(struct Curl_easy *data) -{ - (void)data; -} - static CURLcode ws_disconnect(struct Curl_easy *data, struct connectdata *conn, bool dead_connection) @@ -1178,10 +1293,11 @@ static CURLcode ws_disconnect(struct Curl_easy *data, return CURLE_OK; } -CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(struct Curl_easy *data) +CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *d) { /* we only return something for websocket, called from within the callback when not using raw mode */ + struct Curl_easy *data = d; if(GOOD_EASY_HANDLE(data) && Curl_is_in_callback(data) && data->conn && data->conn->proto.ws && !data->set.ws_raw_mode) return &data->conn->proto.ws->frame; @@ -1203,6 +1319,7 @@ const struct Curl_handler Curl_handler_ws = { ZERO_NULL, /* perform_getsock */ ws_disconnect, /* disconnect */ Curl_http_write_resp, /* write_resp */ + Curl_http_write_resp_hd, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_HTTP, /* defport */ @@ -1228,6 +1345,7 @@ const struct Curl_handler Curl_handler_wss = { ZERO_NULL, /* perform_getsock */ ws_disconnect, /* disconnect */ Curl_http_write_resp, /* write_resp */ + Curl_http_write_resp_hd, /* write_resp_hd */ ZERO_NULL, /* connection_check */ ZERO_NULL, /* attach connection */ PORT_HTTPS, /* defport */ @@ -1267,9 +1385,9 @@ CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer, return CURLE_NOT_BUILT_IN; } -CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(struct Curl_easy *data) +CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *data) { (void)data; return NULL; } -#endif /* USE_WEBSOCKETS */ +#endif /* !CURL_DISABLE_WEBSOCKETS */ diff --git a/deps/curl/lib/ws.h b/deps/curl/lib/ws.h index 5f40d452..186cc2c6 100644 --- a/deps/curl/lib/ws.h +++ b/deps/curl/lib/ws.h @@ -25,7 +25,7 @@ ***************************************************************************/ #include "curl_setup.h" -#if defined(USE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) #ifdef USE_HYPER #define REQTYPE void @@ -57,7 +57,7 @@ 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 mask[4]; /* 32-bit mask for this connection */ unsigned char firstbyte; /* first byte of frame we encode */ bool contfragment; /* set TRUE if the previous fragment sent was not final */ }; @@ -75,7 +75,6 @@ struct websocket { CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req); CURLcode Curl_ws_accept(struct Curl_easy *data, const char *mem, size_t len); -void Curl_ws_done(struct Curl_easy *data); extern const struct Curl_handler Curl_handler_ws; #ifdef USE_SSL @@ -85,7 +84,6 @@ extern const struct Curl_handler Curl_handler_wss; #else #define Curl_ws_request(x,y) CURLE_OK -#define Curl_ws_done(x) Curl_nop_stmt #define Curl_ws_free(x) Curl_nop_stmt #endif diff --git a/deps/curl/libcurl.pc.in b/deps/curl/libcurl.pc.in index 9db6b0f8..4c60a7ec 100644 --- a/deps/curl/libcurl.pc.in +++ b/deps/curl/libcurl.pc.in @@ -22,9 +22,6 @@ # ########################################################################### -# This should most probably benefit from getting a "Requires:" field added -# dynamically by configure. -# prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ @@ -34,8 +31,11 @@ supported_features="@SUPPORT_FEATURES@" Name: libcurl URL: https://curl.se/ -Description: Library to transfer files with ftp, http, etc. +Description: Library to transfer files with HTTP, FTP, etc. Version: @CURLVERSION@ -Libs: -L${libdir} -lcurl @LIBCURL_NO_SHARED@ -Libs.private: @LIBCURL_LIBS@ -Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@ +Requires: @LIBCURL_PC_REQUIRES@ +Requires.private: @LIBCURL_PC_REQUIRES_PRIVATE@ +Libs: -L${libdir} -lcurl @LIBCURL_PC_LIBS@ +Libs.private: @LDFLAGS@ @LIBCURL_PC_LIBS_PRIVATE@ +Cflags: -I${includedir} @LIBCURL_PC_CFLAGS@ +Cflags.private: @LIBCURL_PC_CFLAGS_PRIVATE@ diff --git a/deps/curl/m4/curl-amissl.m4 b/deps/curl/m4/curl-amissl.m4 index 48067e72..b4172072 100644 --- a/deps/curl/m4/curl-amissl.m4 +++ b/deps/curl/m4/curl-amissl.m4 @@ -52,7 +52,6 @@ if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then LIBS="-lamisslstubs -lamisslauto $LIBS" AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use]) AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]) - AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1, [Define to 1 if using OpenSSL 3 or later.]) AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ openssl/pem.h openssl/ssl.h openssl/err.h) ],[ diff --git a/deps/curl/m4/curl-bearssl.m4 b/deps/curl/m4/curl-bearssl.m4 index f2d661de..02a80e8c 100644 --- a/deps/curl/m4/curl-bearssl.m4 +++ b/deps/curl/m4/curl-bearssl.m4 @@ -43,14 +43,14 @@ if test "x$OPT_BEARSSL" != xno; then AC_CHECK_LIB(bearssl, br_ssl_client_init_full, dnl libbearssl found, set the variable - [ - AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) - AC_SUBST(USE_BEARSSL, [1]) - BEARSSL_ENABLED=1 - USE_BEARSSL="yes" - ssl_msg="BearSSL" - test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], [], -lbearssl) + [ + AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) + AC_SUBST(USE_BEARSSL, [1]) + BEARSSL_ENABLED=1 + USE_BEARSSL="yes" + ssl_msg="BearSSL" + test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], [], -lbearssl) fi addld="" @@ -66,22 +66,22 @@ if test "x$OPT_BEARSSL" != xno; then LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + CPPFLAGS="$CPPFLAGS $addcflags" fi AC_CHECK_LIB(bearssl, br_ssl_client_init_full, - [ - AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) - AC_SUBST(USE_BEARSSL, [1]) - BEARSSL_ENABLED=1 - USE_BEARSSL="yes" - ssl_msg="BearSSL" - test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - ], -lbearssl) + [ + AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled]) + AC_SUBST(USE_BEARSSL, [1]) + BEARSSL_ENABLED=1 + USE_BEARSSL="yes" + ssl_msg="BearSSL" + test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + ], -lbearssl) fi if test "x$USE_BEARSSL" = "xyes"; then diff --git a/deps/curl/m4/curl-compilers.m4 b/deps/curl/m4/curl-compilers.m4 index 9a454770..787423d1 100644 --- a/deps/curl/m4/curl-compilers.m4 +++ b/deps/curl/m4/curl-compilers.m4 @@ -33,6 +33,7 @@ dnl Verify if the C compiler being used is known. AC_DEFUN([CURL_CHECK_COMPILER], [ # compiler_id="unknown" + compiler_ver="" compiler_num="0" # flags_dbg_yes="unknown" @@ -48,8 +49,12 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_INTEL_C CURL_CHECK_COMPILER_CLANG CURL_CHECK_COMPILER_GNU_C - CURL_CHECK_COMPILER_SGI_MIPSPRO_C - CURL_CHECK_COMPILER_SGI_MIPS_C + case $host in + mips-sgi-irix*) + CURL_CHECK_COMPILER_SGI_MIPSPRO_C + CURL_CHECK_COMPILER_SGI_MIPS_C + ;; + esac CURL_CHECK_COMPILER_SUNPRO_C CURL_CHECK_COMPILER_TINY_C # @@ -91,13 +96,17 @@ AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ AC_MSG_RESULT([no]) compiler_id="CLANG" fi - AC_MSG_CHECKING([compiler version]) + AC_MSG_CHECKING([if compiler is Apple clang]) fullclangver=`$CC -v 2>&1 | grep version` if echo $fullclangver | grep 'Apple' >/dev/null; then + AC_MSG_RESULT([yes]) appleclang=1 + compiler_id="APPLECLANG" else + AC_MSG_RESULT([no]) appleclang=0 fi + AC_MSG_CHECKING([compiler version]) clangver=`echo $fullclangver | grep "based on LLVM " | "$SED" 's/.*(based on LLVM \(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*)/\1/'` if test -z "$clangver"; then clangver=`echo $fullclangver | "$SED" 's/.*version \(@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/'` @@ -107,6 +116,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ fi clangvhi=`echo $clangver | cut -d . -f1` 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 dnl Starting with Xcode 7 / clang 3.7, Apple clang won't tell its upstream version @@ -144,7 +154,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_DEC_C], [ CURL_CHECK_DEF([__DECC], [], [silent]) CURL_CHECK_DEF([__DECC_VER], [], [silent]) if test "$curl_cv_have_def___DECC" = "yes" && - test "$curl_cv_have_def___DECC_VER" = "yes"; then + test "$curl_cv_have_def___DECC_VER" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="DEC_C" flags_dbg_yes="-g2" @@ -181,13 +191,14 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [ compiler_id="GNU_C" AC_MSG_CHECKING([compiler version]) # strip '-suffix' parts, e.g. Ubuntu Windows cross-gcc returns '10-win32' - gccver=`$CC -dumpversion | sed -E 's/-.+$//'` + gccver=`$CC -dumpversion | "$SED" 's/-.\{1,\}$//'` gccvhi=`echo $gccver | cut -d . -f1` if echo $gccver | grep -F '.' >/dev/null; then gccvlo=`echo $gccver | cut -d . -f2` else gccvlo="0" fi + compiler_ver="$gccver" compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` AC_MSG_RESULT([gcc '$compiler_num' (raw: '$gccver')]) flags_dbg_yes="-g" @@ -260,6 +271,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ AC_MSG_RESULT([yes]) AC_MSG_CHECKING([compiler version]) compiler_num="$curl_cv_def___INTEL_COMPILER" + compiler_ver=`echo "$compiler_num" | cut -c -2 | $SED 's/^0//'`.`echo "$compiler_num" | cut -c 3-4 | $SED 's/^0//'` AC_MSG_RESULT([Intel C '$compiler_num']) CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then @@ -382,7 +394,7 @@ 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"; then + test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then AC_MSG_RESULT([yes]) tmp_has_include="no" tmp_chg_FLAGS="$CFLAGS" @@ -465,9 +477,9 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ test "$tmp_compiler_works" = "yes"; then CURL_RUN_IFELSE([ AC_LANG_PROGRAM([[ -# ifdef __STDC__ -# include -# endif + #ifdef __STDC__ + # include + #endif ]],[[ int i = 0; exit(i); @@ -509,12 +521,13 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # case "$compiler_id" in # - CLANG) + CLANG|APPLECLANG) # dnl Disable warnings for unused arguments, otherwise clang will dnl warn about compile-time arguments used during link-time, like dnl -O and -g and -pedantic. tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" + tmp_CFLAGS="$tmp_CFLAGS -Werror-implicit-function-declaration" ;; # DEC_C) @@ -564,7 +577,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # INTEL_UNIX_C) # - dnl On unix this compiler uses gcc's header files, so + dnl On Unix this compiler uses gcc's header files, so dnl we select ANSI C89 dialect plus GNU extensions. tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" dnl Change some warnings into errors @@ -777,7 +790,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # case "$compiler_id" in # - CLANG) + CLANG|APPLECLANG) # if test "$want_warnings" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" @@ -847,13 +860,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [enum-conversion]) CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [sometimes-uninitialized]) case $host_os in - cygwin* | mingw*) - dnl skip missing-variable-declarations warnings for cygwin and - dnl mingw because the libtool wrapper executable causes them - ;; - *) - CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [missing-variable-declarations]) - ;; + cygwin* | mingw*) + dnl skip missing-variable-declarations warnings for Cygwin and + dnl MinGW because the libtool wrapper executable causes them + ;; + *) + CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [missing-variable-declarations]) + ;; esac fi # @@ -866,7 +879,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Only clang 3.5 or later if test "$compiler_num" -ge "305"; then CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [pragmas]) - CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unreachable-code-break]) + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unreachable-code-break]) # Not used: Silent in "unity" builds fi # dnl Only clang 3.6 or later @@ -893,10 +906,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" # we have silencing markup for clang 10.0 and above only fi fi - dnl Disable pointer to bool conversion warnings since they cause - dnl lib/securetransp.c cause several warnings for checks we want. - dnl This option should be placed after -Wconversion. - tmp_CFLAGS="$tmp_CFLAGS -Wno-pointer-bool-conversion" ;; # DEC_C) @@ -1031,7 +1040,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # dnl Only gcc 4.5 or later if test "$compiler_num" -ge "405"; then - dnl Only windows targets + dnl Only Windows targets if test "$curl_cv_native_windows" = "yes"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" fi @@ -1067,7 +1076,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [duplicated-branches]) CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [restrict]) CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [alloc-zero]) - tmp_CFLAGS="$tmp_CFLAGS -Wformat-overflow=2" tmp_CFLAGS="$tmp_CFLAGS -Wformat-truncation=2" tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" fi @@ -1244,52 +1252,6 @@ squeeze() { ]) -dnl CURL_CHECK_CURLDEBUG -dnl ------------------------------------------------- -dnl Settings which depend on configure's curldebug given -dnl option, and other additional configure pre-requisites. -dnl Actually the curl debug memory tracking feature can -dnl only be used/enabled when libcurl is built as a static -dnl library or as a shared one on those systems on which -dnl shared libraries support undefined symbols. - -AC_DEFUN([CURL_CHECK_CURLDEBUG], [ - AC_REQUIRE([XC_LIBTOOL])dnl - AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl - supports_curldebug="unknown" - if test "$want_curldebug" = "yes"; then - if test "x$enable_shared" != "xno" && - test "x$enable_shared" != "xyes"; then - AC_MSG_WARN([unknown enable_shared setting.]) - supports_curldebug="no" - fi - if test "x$enable_static" != "xno" && - test "x$enable_static" != "xyes"; then - AC_MSG_WARN([unknown enable_static setting.]) - supports_curldebug="no" - fi - if test "$supports_curldebug" != "no"; then - if test "$enable_shared" = "yes" && - test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then - supports_curldebug="no" - AC_MSG_WARN([shared library does not support undefined symbols.]) - fi - fi - fi - # - if test "$want_curldebug" = "yes"; then - AC_MSG_CHECKING([if curl debug memory tracking can be enabled]) - test "$supports_curldebug" = "no" || supports_curldebug="yes" - AC_MSG_RESULT([$supports_curldebug]) - if test "$supports_curldebug" = "no"; then - AC_MSG_WARN([cannot enable curl debug memory tracking.]) - want_curldebug="no" - fi - fi -]) - - - dnl CURL_CHECK_COMPILER_HALT_ON_ERROR dnl ------------------------------------------------- dnl Verifies if the compiler actually halts after the @@ -1301,7 +1263,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_HALT_ON_ERROR], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ - force compilation error + #error force compilation error ]]) ],[ AC_MSG_RESULT([no]) @@ -1415,9 +1377,9 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ tmp_CFLAGS="" tmp_EXTERN="" case "$compiler_id" in - CLANG) + CLANG|APPLECLANG) dnl All versions of clang support -fvisibility= - tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" + tmp_EXTERN="__attribute__((__visibility__(\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ;; @@ -1425,7 +1387,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ 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 - tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" + tmp_EXTERN="__attribute__((__visibility__(\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" fi @@ -1439,12 +1401,12 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ CFLAGS="$CFLAGS -fvisibility=hidden" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -# include + #include ]],[[ printf("icc fvisibility bug test"); ]]) ],[ - tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" + tmp_EXTERN="__attribute__((__visibility__(\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ]) @@ -1469,10 +1431,10 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ $tmp_EXTERN char *dummy(char *buff); char *dummy(char *buff) { - if(buff) - return ++buff; - else - return buff; + if(buff) + return ++buff; + else + return buff; } ]],[[ char b[16]; @@ -1519,7 +1481,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH], [ AC_MSG_CHECKING([if compiler halts on function prototype mismatch]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -# include + #include int rand(int n); int rand(int n) { diff --git a/deps/curl/m4/curl-confopts.m4 b/deps/curl/m4/curl-confopts.m4 index 37f7d4c2..8109b765 100644 --- a/deps/curl/m4/curl-confopts.m4 +++ b/deps/curl/m4/curl-confopts.m4 @@ -532,7 +532,7 @@ AC_DEFUN([CURL_CHECK_LIB_ARES], [ AC_MSG_CHECKING([that c-ares is good and recent enough]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include /* set of dummy functions in case c-ares was built with debug */ void curl_dofree() { } void curl_sclose() { } @@ -561,13 +561,14 @@ AC_DEFUN([CURL_CHECK_LIB_ARES], [ if test "$want_ares" = "yes"; then dnl finally c-ares will be used AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support]) + AC_DEFINE(CARES_NO_DEPRECATED, 1, [Ignore c-ares deprecation warnings]) AC_SUBST([USE_ARES], [1]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libcares" curl_res_msg="c-ares" fi fi ]) - dnl CURL_CHECK_OPTION_NTLM_WB dnl ------------------------------------------------- dnl Verify if configure has been invoked with option @@ -631,6 +632,41 @@ AC_DEFUN([CURL_CHECK_NTLM_WB], [ fi ]) +dnl CURL_CHECK_OPTION_HTTPSRR +dnl ----------------------------------------------------- +dnl Verify whether configure has been invoked with option +dnl --enable-httpsrr or --disable-httpsrr, and set +dnl shell variable want_httpsrr as appropriate. + +AC_DEFUN([CURL_CHECK_OPTION_HTTPSRR], [ + AC_MSG_CHECKING([whether to enable HTTPSRR support]) + OPT_HTTPSRR="default" + AC_ARG_ENABLE(httpsrr, +AS_HELP_STRING([--enable-httpsrr],[Enable HTTPSRR support]) +AS_HELP_STRING([--disable-httpsrr],[Disable HTTPSRR support]), + OPT_HTTPSRR=$enableval) + case "$OPT_HTTPSRR" in + no) + dnl --disable-httpsrr option used + want_httpsrr="no" + curl_httpsrr_msg="no (--enable-httpsrr)" + AC_MSG_RESULT([no]) + ;; + default) + dnl configure option not specified + want_httpsrr="no" + curl_httpsrr_msg="no (--enable-httpsrr)" + AC_MSG_RESULT([no]) + ;; + *) + dnl --enable-httpsrr option used + want_httpsrr="yes" + curl_httpsrr_msg="enabled (--disable-httpsrr)" + AC_MSG_RESULT([yes]) + ;; + esac +]) + dnl CURL_CHECK_OPTION_ECH dnl ----------------------------------------------------- dnl Verify whether configure has been invoked with option @@ -661,8 +697,8 @@ AS_HELP_STRING([--disable-ech],[Disable ECH support]), dnl --enable-ech option used want_ech="yes" curl_ech_msg="enabled (--disable-ech)" - experimental="ech" AC_MSG_RESULT([yes]) ;; esac ]) +]) diff --git a/deps/curl/m4/curl-functions.m4 b/deps/curl/m4/curl-functions.m4 index 425d9f96..93d00dd2 100644 --- a/deps/curl/m4/curl-functions.m4 +++ b/deps/curl/m4/curl-functions.m4 @@ -150,30 +150,6 @@ curl_includes_netdb="\ ]) -dnl CURL_INCLUDES_POLL -dnl ------------------------------------------------- -dnl Set up variable with list of headers that must be -dnl included when poll.h is to be included. - -AC_DEFUN([CURL_INCLUDES_POLL], [ -curl_includes_poll="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_POLL_H -# include -#endif -#ifdef HAVE_SYS_POLL_H -# include -#endif -/* includes end */" - AC_CHECK_HEADERS( - sys/types.h poll.h sys/poll.h, - [], [], [$curl_includes_poll]) -]) - - dnl CURL_INCLUDES_SETJMP dnl ------------------------------------------------- dnl Set up variable with list of headers that must be @@ -212,27 +188,6 @@ curl_includes_signal="\ ]) -dnl CURL_INCLUDES_SOCKET -dnl ------------------------------------------------- -dnl Set up variable with list of headers that must be -dnl included when socket.h is to be included. - -AC_DEFUN([CURL_INCLUDES_SOCKET], [ -curl_includes_socket="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SOCKET_H -# include -#endif -/* includes end */" - AC_CHECK_HEADERS( - sys/types.h socket.h, - [], [], [$curl_includes_socket]) -]) - - dnl CURL_INCLUDES_STDLIB dnl ------------------------------------------------- dnl Set up variable with list of headers that must be @@ -694,7 +649,6 @@ dnl HAVE_CLOSESOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl - AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_closesocket="unknown" tst_proto_closesocket="unknown" @@ -705,7 +659,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 - $curl_includes_socket ]],[[ if(0 != closesocket(0)) return 1; @@ -722,7 +675,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_MSG_CHECKING([if closesocket is prototyped]) AC_EGREP_CPP([closesocket],[ $curl_includes_winsock2 - $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_closesocket="yes" @@ -737,7 +689,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 - $curl_includes_socket ]],[[ if(0 != closesocket(0)) return 1; @@ -1019,249 +970,6 @@ AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [ fi ]) -dnl CURL_CHECK_FUNC_FGETXATTR -dnl ------------------------------------------------- -dnl Verify if fgetxattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_fgetxattr, then -dnl HAVE_FGETXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_FGETXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_fgetxattr="unknown" - tst_proto_fgetxattr="unknown" - tst_compi_fgetxattr="unknown" - tst_allow_fgetxattr="unknown" - tst_nargs_fgetxattr="unknown" - # - AC_MSG_CHECKING([if fgetxattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([fgetxattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_fgetxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_fgetxattr="no" - ]) - # - if test "$tst_links_fgetxattr" = "yes"; then - AC_MSG_CHECKING([if fgetxattr is prototyped]) - AC_EGREP_CPP([fgetxattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_fgetxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_fgetxattr="no" - ]) - fi - # - if test "$tst_proto_fgetxattr" = "yes"; then - if test "$tst_nargs_fgetxattr" = "unknown"; then - AC_MSG_CHECKING([if fgetxattr takes 4 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != fgetxattr(0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_fgetxattr="yes" - tst_nargs_fgetxattr="4" - ],[ - AC_MSG_RESULT([no]) - tst_compi_fgetxattr="no" - ]) - fi - if test "$tst_nargs_fgetxattr" = "unknown"; then - AC_MSG_CHECKING([if fgetxattr takes 6 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != fgetxattr(0, 0, 0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_fgetxattr="yes" - tst_nargs_fgetxattr="6" - ],[ - AC_MSG_RESULT([no]) - tst_compi_fgetxattr="no" - ]) - fi - AC_MSG_CHECKING([if fgetxattr is compilable]) - if test "$tst_compi_fgetxattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_fgetxattr" = "yes"; then - AC_MSG_CHECKING([if fgetxattr usage allowed]) - if test "x$curl_disallow_fgetxattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_fgetxattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_fgetxattr="no" - fi - fi - # - AC_MSG_CHECKING([if fgetxattr might be used]) - if test "$tst_links_fgetxattr" = "yes" && - test "$tst_proto_fgetxattr" = "yes" && - test "$tst_compi_fgetxattr" = "yes" && - test "$tst_allow_fgetxattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_FGETXATTR, 1, - [Define to 1 if you have the fgetxattr function.]) - dnl AC_DEFINE_UNQUOTED(FGETXATTR_ARGS, $tst_nargs_fgetxattr, - dnl [Specifies the number of arguments to fgetxattr]) - # - if test "$tst_nargs_fgetxattr" -eq "4"; then - AC_DEFINE(HAVE_FGETXATTR_4, 1, [fgetxattr() takes 4 args]) - elif test "$tst_nargs_fgetxattr" -eq "6"; then - AC_DEFINE(HAVE_FGETXATTR_6, 1, [fgetxattr() takes 6 args]) - fi - # - curl_cv_func_fgetxattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_fgetxattr="no" - fi -]) - - -dnl CURL_CHECK_FUNC_FLISTXATTR -dnl ------------------------------------------------- -dnl Verify if flistxattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_flistxattr, then -dnl HAVE_FLISTXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_FLISTXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_flistxattr="unknown" - tst_proto_flistxattr="unknown" - tst_compi_flistxattr="unknown" - tst_allow_flistxattr="unknown" - tst_nargs_flistxattr="unknown" - # - AC_MSG_CHECKING([if flistxattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([flistxattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_flistxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_flistxattr="no" - ]) - # - if test "$tst_links_flistxattr" = "yes"; then - AC_MSG_CHECKING([if flistxattr is prototyped]) - AC_EGREP_CPP([flistxattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_flistxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_flistxattr="no" - ]) - fi - # - if test "$tst_proto_flistxattr" = "yes"; then - if test "$tst_nargs_flistxattr" = "unknown"; then - AC_MSG_CHECKING([if flistxattr takes 3 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != flistxattr(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_flistxattr="yes" - tst_nargs_flistxattr="3" - ],[ - AC_MSG_RESULT([no]) - tst_compi_flistxattr="no" - ]) - fi - if test "$tst_nargs_flistxattr" = "unknown"; then - AC_MSG_CHECKING([if flistxattr takes 4 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != flistxattr(0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_flistxattr="yes" - tst_nargs_flistxattr="4" - ],[ - AC_MSG_RESULT([no]) - tst_compi_flistxattr="no" - ]) - fi - AC_MSG_CHECKING([if flistxattr is compilable]) - if test "$tst_compi_flistxattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_flistxattr" = "yes"; then - AC_MSG_CHECKING([if flistxattr usage allowed]) - if test "x$curl_disallow_flistxattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_flistxattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_flistxattr="no" - fi - fi - # - AC_MSG_CHECKING([if flistxattr might be used]) - if test "$tst_links_flistxattr" = "yes" && - test "$tst_proto_flistxattr" = "yes" && - test "$tst_compi_flistxattr" = "yes" && - test "$tst_allow_flistxattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_FLISTXATTR, 1, - [Define to 1 if you have the flistxattr function.]) - dnl AC_DEFINE_UNQUOTED(FLISTXATTR_ARGS, $tst_nargs_flistxattr, - dnl [Specifies the number of arguments to flistxattr]) - # - if test "$tst_nargs_flistxattr" -eq "3"; then - AC_DEFINE(HAVE_FLISTXATTR_3, 1, [flistxattr() takes 3 args]) - elif test "$tst_nargs_flistxattr" -eq "4"; then - AC_DEFINE(HAVE_FLISTXATTR_4, 1, [flistxattr() takes 4 args]) - fi - # - curl_cv_func_flistxattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_flistxattr="no" - fi -]) - dnl CURL_CHECK_FUNC_FREEADDRINFO dnl ------------------------------------------------- @@ -1359,128 +1067,6 @@ AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [ ]) -dnl CURL_CHECK_FUNC_FREMOVEXATTR -dnl ------------------------------------------------- -dnl Verify if fremovexattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_fremovexattr, then -dnl HAVE_FREMOVEXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_FREMOVEXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_fremovexattr="unknown" - tst_proto_fremovexattr="unknown" - tst_compi_fremovexattr="unknown" - tst_allow_fremovexattr="unknown" - tst_nargs_fremovexattr="unknown" - # - AC_MSG_CHECKING([if fremovexattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([fremovexattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_fremovexattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_fremovexattr="no" - ]) - # - if test "$tst_links_fremovexattr" = "yes"; then - AC_MSG_CHECKING([if fremovexattr is prototyped]) - AC_EGREP_CPP([fremovexattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_fremovexattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_fremovexattr="no" - ]) - fi - # - if test "$tst_proto_fremovexattr" = "yes"; then - if test "$tst_nargs_fremovexattr" = "unknown"; then - AC_MSG_CHECKING([if fremovexattr takes 2 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != fremovexattr(0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_fremovexattr="yes" - tst_nargs_fremovexattr="2" - ],[ - AC_MSG_RESULT([no]) - tst_compi_fremovexattr="no" - ]) - fi - if test "$tst_nargs_fremovexattr" = "unknown"; then - AC_MSG_CHECKING([if fremovexattr takes 3 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != fremovexattr(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_fremovexattr="yes" - tst_nargs_fremovexattr="3" - ],[ - AC_MSG_RESULT([no]) - tst_compi_fremovexattr="no" - ]) - fi - AC_MSG_CHECKING([if fremovexattr is compilable]) - if test "$tst_compi_fremovexattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_fremovexattr" = "yes"; then - AC_MSG_CHECKING([if fremovexattr usage allowed]) - if test "x$curl_disallow_fremovexattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_fremovexattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_fremovexattr="no" - fi - fi - # - AC_MSG_CHECKING([if fremovexattr might be used]) - if test "$tst_links_fremovexattr" = "yes" && - test "$tst_proto_fremovexattr" = "yes" && - test "$tst_compi_fremovexattr" = "yes" && - test "$tst_allow_fremovexattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_FREMOVEXATTR, 1, - [Define to 1 if you have the fremovexattr function.]) - dnl AC_DEFINE_UNQUOTED(FREMOVEXATTR_ARGS, $tst_nargs_fremovexattr, - dnl [Specifies the number of arguments to fremovexattr]) - # - if test "$tst_nargs_fremovexattr" -eq "2"; then - AC_DEFINE(HAVE_FREMOVEXATTR_2, 1, [fremovexattr() takes 2 args]) - elif test "$tst_nargs_fremovexattr" -eq "3"; then - AC_DEFINE(HAVE_FREMOVEXATTR_3, 1, [fremovexattr() takes 3 args]) - fi - # - curl_cv_func_fremovexattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_fremovexattr="no" - fi -]) - - dnl CURL_CHECK_FUNC_FSETXATTR dnl ------------------------------------------------- dnl Verify if fsetxattr is available, prototyped, and @@ -1838,37 +1424,38 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ # if test "$curl_cv_func_getaddrinfo" = "yes"; then AC_MSG_CHECKING([if getaddrinfo is threadsafe]) + case $host in + *-apple-*) + dnl Darwin 6.0 and macOS 10.2.X and newer + tst_tsafe_getaddrinfo="yes" + esac case $host_os in aix[[1234]].* | aix5.[[01]].*) - dnl aix 5.1 and older + dnl AIX 5.1 and older tst_tsafe_getaddrinfo="no" ;; aix*) - dnl aix 5.2 and newer + dnl AIX 5.2 and newer tst_tsafe_getaddrinfo="yes" ;; darwin[[12345]].*) - dnl darwin 5.0 and mac os x 10.1.X and older + dnl Darwin 5.0 and macOS 10.1.X and older tst_tsafe_getaddrinfo="no" ;; - darwin*) - dnl darwin 6.0 and mac os x 10.2.X and newer - tst_tsafe_getaddrinfo="yes" - ;; freebsd[[1234]].* | freebsd5.[[1234]]*) - dnl freebsd 5.4 and older + dnl FreeBSD 5.4 and older tst_tsafe_getaddrinfo="no" ;; freebsd*) - dnl freebsd 5.5 and newer + dnl FreeBSD 5.5 and newer tst_tsafe_getaddrinfo="yes" ;; hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*) - dnl hpux 11.10 and older + dnl HP-UX 11.10 and older tst_tsafe_getaddrinfo="no" ;; hpux*) - dnl hpux 11.11 and newer + dnl HP-UX 11.11 and newer tst_tsafe_getaddrinfo="yes" ;; midnightbsd*) @@ -1876,19 +1463,19 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ tst_tsafe_getaddrinfo="yes" ;; netbsd[[123]].*) - dnl netbsd 3.X and older + dnl NetBSD 3.X and older tst_tsafe_getaddrinfo="no" ;; netbsd*) - dnl netbsd 4.X and newer + dnl NetBSD 4.X and newer tst_tsafe_getaddrinfo="yes" ;; *bsd*) - dnl All other bsd's + dnl All other BSD's tst_tsafe_getaddrinfo="no" ;; solaris2*) - dnl solaris which have it + dnl Solaris which have it tst_tsafe_getaddrinfo="yes" ;; esac @@ -1923,13 +1510,13 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ -#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) - return 0; -#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) - return 0; -#else - force compilation error -#endif + #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) + return 0; + #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) + return 0; + #else + #error force compilation error + #endif ]]) ],[ tst_h_errno_sbs_issue_7="yes" @@ -2522,101 +2109,6 @@ AC_DEFUN([CURL_CHECK_FUNC_GETSOCKNAME], [ fi ]) -dnl CURL_CHECK_FUNC_IF_NAMETOINDEX -dnl ------------------------------------------------- -dnl Verify if if_nametoindex is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_if_nametoindex, then -dnl HAVE_IF_NAMETOINDEX will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_IF_NAMETOINDEX], [ - AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl - AC_REQUIRE([CURL_INCLUDES_NETIF])dnl - AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl - # - tst_links_if_nametoindex="unknown" - tst_proto_if_nametoindex="unknown" - tst_compi_if_nametoindex="unknown" - tst_allow_if_nametoindex="unknown" - # - AC_MSG_CHECKING([if if_nametoindex can be linked]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_winsock2 - $curl_includes_bsdsocket - #include - ]],[[ - if(0 != if_nametoindex("")) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_if_nametoindex="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_if_nametoindex="no" - ]) - # - if test "$tst_links_if_nametoindex" = "yes"; then - AC_MSG_CHECKING([if if_nametoindex is prototyped]) - AC_EGREP_CPP([if_nametoindex],[ - $curl_includes_winsock2 - $curl_includes_netif - ],[ - AC_MSG_RESULT([yes]) - tst_proto_if_nametoindex="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_if_nametoindex="no" - ]) - fi - # - if test "$tst_proto_if_nametoindex" = "yes"; then - AC_MSG_CHECKING([if if_nametoindex is compilable]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_winsock2 - $curl_includes_netif - ]],[[ - if(0 != if_nametoindex("")) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_if_nametoindex="yes" - ],[ - AC_MSG_RESULT([no]) - tst_compi_if_nametoindex="no" - ]) - fi - # - if test "$tst_compi_if_nametoindex" = "yes"; then - AC_MSG_CHECKING([if if_nametoindex usage allowed]) - if test "x$curl_disallow_if_nametoindex" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_if_nametoindex="yes" - else - AC_MSG_RESULT([no]) - tst_allow_if_nametoindex="no" - fi - fi - # - AC_MSG_CHECKING([if if_nametoindex might be used]) - if test "$tst_links_if_nametoindex" = "yes" && - test "$tst_proto_if_nametoindex" = "yes" && - test "$tst_compi_if_nametoindex" = "yes" && - test "$tst_allow_if_nametoindex" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_IF_NAMETOINDEX, 1, - [Define to 1 if you have the if_nametoindex function.]) - curl_cv_func_if_nametoindex="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_if_nametoindex="no" - fi -]) - dnl CURL_CHECK_FUNC_GETIFADDRS dnl ------------------------------------------------- @@ -2734,128 +2226,6 @@ AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [ ]) -dnl CURL_CHECK_FUNC_GETXATTR -dnl ------------------------------------------------- -dnl Verify if getxattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_getxattr, then -dnl HAVE_GETXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_GETXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_getxattr="unknown" - tst_proto_getxattr="unknown" - tst_compi_getxattr="unknown" - tst_allow_getxattr="unknown" - tst_nargs_getxattr="unknown" - # - AC_MSG_CHECKING([if getxattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([getxattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_getxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_getxattr="no" - ]) - # - if test "$tst_links_getxattr" = "yes"; then - AC_MSG_CHECKING([if getxattr is prototyped]) - AC_EGREP_CPP([getxattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_getxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_getxattr="no" - ]) - fi - # - if test "$tst_proto_getxattr" = "yes"; then - if test "$tst_nargs_getxattr" = "unknown"; then - AC_MSG_CHECKING([if getxattr takes 4 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != getxattr(0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_getxattr="yes" - tst_nargs_getxattr="4" - ],[ - AC_MSG_RESULT([no]) - tst_compi_getxattr="no" - ]) - fi - if test "$tst_nargs_getxattr" = "unknown"; then - AC_MSG_CHECKING([if getxattr takes 6 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != getxattr(0, 0, 0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_getxattr="yes" - tst_nargs_getxattr="6" - ],[ - AC_MSG_RESULT([no]) - tst_compi_getxattr="no" - ]) - fi - AC_MSG_CHECKING([if getxattr is compilable]) - if test "$tst_compi_getxattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_getxattr" = "yes"; then - AC_MSG_CHECKING([if getxattr usage allowed]) - if test "x$curl_disallow_getxattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_getxattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_getxattr="no" - fi - fi - # - AC_MSG_CHECKING([if getxattr might be used]) - if test "$tst_links_getxattr" = "yes" && - test "$tst_proto_getxattr" = "yes" && - test "$tst_compi_getxattr" = "yes" && - test "$tst_allow_getxattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_GETXATTR, 1, - [Define to 1 if you have the getxattr function.]) - dnl AC_DEFINE_UNQUOTED(GETXATTR_ARGS, $tst_nargs_getxattr, - dnl [Specifies the number of arguments to getxattr]) - # - if test "$tst_nargs_getxattr" -eq "4"; then - AC_DEFINE(HAVE_GETXATTR_4, 1, [getxattr() takes 4 args]) - elif test "$tst_nargs_getxattr" -eq "6"; then - AC_DEFINE(HAVE_GETXATTR_6, 1, [getxattr() takes 6 args]) - fi - # - curl_cv_func_getxattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_getxattr="no" - fi -]) - - dnl CURL_CHECK_FUNC_GMTIME_R dnl ------------------------------------------------- dnl Verify if gmtime_r is available, prototyped, can @@ -3592,7 +2962,7 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 ]],[[ - int flags = 0; + unsigned long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ]]) @@ -3776,128 +3146,6 @@ AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [ ]) -dnl CURL_CHECK_FUNC_LISTXATTR -dnl ------------------------------------------------- -dnl Verify if listxattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_listxattr, then -dnl HAVE_LISTXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_LISTXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_listxattr="unknown" - tst_proto_listxattr="unknown" - tst_compi_listxattr="unknown" - tst_allow_listxattr="unknown" - tst_nargs_listxattr="unknown" - # - AC_MSG_CHECKING([if listxattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([listxattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_listxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_listxattr="no" - ]) - # - if test "$tst_links_listxattr" = "yes"; then - AC_MSG_CHECKING([if listxattr is prototyped]) - AC_EGREP_CPP([listxattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_listxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_listxattr="no" - ]) - fi - # - if test "$tst_proto_listxattr" = "yes"; then - if test "$tst_nargs_listxattr" = "unknown"; then - AC_MSG_CHECKING([if listxattr takes 3 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != listxattr(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_listxattr="yes" - tst_nargs_listxattr="3" - ],[ - AC_MSG_RESULT([no]) - tst_compi_listxattr="no" - ]) - fi - if test "$tst_nargs_listxattr" = "unknown"; then - AC_MSG_CHECKING([if listxattr takes 4 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != listxattr(0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_listxattr="yes" - tst_nargs_listxattr="4" - ],[ - AC_MSG_RESULT([no]) - tst_compi_listxattr="no" - ]) - fi - AC_MSG_CHECKING([if listxattr is compilable]) - if test "$tst_compi_listxattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_listxattr" = "yes"; then - AC_MSG_CHECKING([if listxattr usage allowed]) - if test "x$curl_disallow_listxattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_listxattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_listxattr="no" - fi - fi - # - AC_MSG_CHECKING([if listxattr might be used]) - if test "$tst_links_listxattr" = "yes" && - test "$tst_proto_listxattr" = "yes" && - test "$tst_compi_listxattr" = "yes" && - test "$tst_allow_listxattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_LISTXATTR, 1, - [Define to 1 if you have the listxattr function.]) - dnl AC_DEFINE_UNQUOTED(LISTXATTR_ARGS, $tst_nargs_listxattr, - dnl [Specifies the number of arguments to listxattr]) - # - if test "$tst_nargs_listxattr" -eq "3"; then - AC_DEFINE(HAVE_LISTXATTR_3, 1, [listxattr() takes 3 args]) - elif test "$tst_nargs_listxattr" -eq "4"; then - AC_DEFINE(HAVE_LISTXATTR_4, 1, [listxattr() takes 4 args]) - fi - # - curl_cv_func_listxattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_listxattr="no" - fi -]) - - dnl CURL_CHECK_FUNC_MEMRCHR dnl ------------------------------------------------- dnl Verify if memrchr is available, prototyped, and @@ -4003,450 +3251,6 @@ AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [ ]) -dnl CURL_CHECK_FUNC_POLL -dnl ------------------------------------------------- -dnl Verify if poll is available, prototyped, can -dnl be compiled and seems to work. - -AC_DEFUN([CURL_CHECK_FUNC_POLL], [ - AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl - AC_REQUIRE([CURL_INCLUDES_POLL])dnl - # - tst_links_poll="unknown" - tst_proto_poll="unknown" - tst_compi_poll="unknown" - tst_works_poll="unknown" - tst_allow_poll="unknown" - # - case $host_os in - darwin*|interix*) - dnl poll() does not work on these platforms - dnl Interix: "does provide poll(), but the implementing developer must - dnl have been in a bad mood, because poll() only works on the /proc - dnl filesystem here" - dnl macOS: poll() first didn't exist, then was broken until fixed in 10.9 - dnl only to break again in 10.12. - curl_disallow_poll="yes" - tst_compi_poll="no" - ;; - esac - # - AC_MSG_CHECKING([if poll can be linked]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_poll - ]],[[ - if(0 != poll(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_poll="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_poll="no" - ]) - # - if test "$tst_links_poll" = "yes"; then - AC_MSG_CHECKING([if poll is prototyped]) - AC_EGREP_CPP([poll],[ - $curl_includes_poll - ],[ - AC_MSG_RESULT([yes]) - tst_proto_poll="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_poll="no" - ]) - fi - # - if test "$tst_proto_poll" = "yes"; then - AC_MSG_CHECKING([if poll is compilable]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_poll - ]],[[ - if(0 != poll(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_poll="yes" - ],[ - AC_MSG_RESULT([no]) - tst_compi_poll="no" - ]) - fi - # - dnl only do runtime verification when not cross-compiling - if test "x$cross_compiling" != "xyes" && - test "$tst_compi_poll" = "yes"; then - AC_MSG_CHECKING([if poll seems to work]) - CURL_RUN_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_stdlib - $curl_includes_poll - $curl_includes_time - ]],[[ - /* detect the original poll() breakage */ - if(0 != poll(0, 0, 10)) - exit(1); /* fail */ - else { - /* detect the 10.12 poll() breakage */ - struct timeval before, after; - int rc; - size_t us; - - gettimeofday(&before, NULL); - rc = poll(NULL, 0, 500); - gettimeofday(&after, NULL); - - us = (after.tv_sec - before.tv_sec) * 1000000 + - (after.tv_usec - before.tv_usec); - - if(us < 400000) - exit(1); - } - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_works_poll="yes" - ],[ - AC_MSG_RESULT([no]) - tst_works_poll="no" - ]) - fi - # - if test "$tst_compi_poll" = "yes" && - test "$tst_works_poll" != "no"; then - AC_MSG_CHECKING([if poll usage allowed]) - if test "x$curl_disallow_poll" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_poll="yes" - else - AC_MSG_RESULT([no]) - tst_allow_poll="no" - fi - fi - # - AC_MSG_CHECKING([if poll might be used]) - if test "$tst_links_poll" = "yes" && - test "$tst_proto_poll" = "yes" && - test "$tst_compi_poll" = "yes" && - test "$tst_allow_poll" = "yes" && - test "$tst_works_poll" != "no"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_POLL_FINE, 1, - [If you have a fine poll]) - curl_cv_func_poll="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_poll="no" - fi -]) - - -dnl CURL_CHECK_FUNC_REMOVEXATTR -dnl ------------------------------------------------- -dnl Verify if removexattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_removexattr, then -dnl HAVE_REMOVEXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_REMOVEXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_removexattr="unknown" - tst_proto_removexattr="unknown" - tst_compi_removexattr="unknown" - tst_allow_removexattr="unknown" - tst_nargs_removexattr="unknown" - # - AC_MSG_CHECKING([if removexattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([removexattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_removexattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_removexattr="no" - ]) - # - if test "$tst_links_removexattr" = "yes"; then - AC_MSG_CHECKING([if removexattr is prototyped]) - AC_EGREP_CPP([removexattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_removexattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_removexattr="no" - ]) - fi - # - if test "$tst_proto_removexattr" = "yes"; then - if test "$tst_nargs_removexattr" = "unknown"; then - AC_MSG_CHECKING([if removexattr takes 2 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != removexattr(0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_removexattr="yes" - tst_nargs_removexattr="2" - ],[ - AC_MSG_RESULT([no]) - tst_compi_removexattr="no" - ]) - fi - if test "$tst_nargs_removexattr" = "unknown"; then - AC_MSG_CHECKING([if removexattr takes 3 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != removexattr(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_removexattr="yes" - tst_nargs_removexattr="3" - ],[ - AC_MSG_RESULT([no]) - tst_compi_removexattr="no" - ]) - fi - AC_MSG_CHECKING([if removexattr is compilable]) - if test "$tst_compi_removexattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_removexattr" = "yes"; then - AC_MSG_CHECKING([if removexattr usage allowed]) - if test "x$curl_disallow_removexattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_removexattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_removexattr="no" - fi - fi - # - AC_MSG_CHECKING([if removexattr might be used]) - if test "$tst_links_removexattr" = "yes" && - test "$tst_proto_removexattr" = "yes" && - test "$tst_compi_removexattr" = "yes" && - test "$tst_allow_removexattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_REMOVEXATTR, 1, - [Define to 1 if you have the removexattr function.]) - dnl AC_DEFINE_UNQUOTED(REMOVEXATTR_ARGS, $tst_nargs_removexattr, - dnl [Specifies the number of arguments to removexattr]) - # - if test "$tst_nargs_removexattr" -eq "2"; then - AC_DEFINE(HAVE_REMOVEXATTR_2, 1, [removexattr() takes 2 args]) - elif test "$tst_nargs_removexattr" -eq "3"; then - AC_DEFINE(HAVE_REMOVEXATTR_3, 1, [removexattr() takes 3 args]) - fi - # - curl_cv_func_removexattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_removexattr="no" - fi -]) - - -dnl CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK -dnl ------------------------------------------------- -dnl Verify if setsockopt with the SO_NONBLOCK command is -dnl available, can be compiled, and seems to work. If -dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK -dnl will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [ - # - tst_compi_setsockopt_so_nonblock="unknown" - tst_allow_setsockopt_so_nonblock="unknown" - # - if test "$curl_cv_func_setsockopt" = "yes"; then - AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_winsock2 - $curl_includes_bsdsocket - $curl_includes_sys_socket - ]],[[ - if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_setsockopt_so_nonblock="yes" - ],[ - AC_MSG_RESULT([no]) - tst_compi_setsockopt_so_nonblock="no" - ]) - fi - # - if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then - AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed]) - if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_setsockopt_so_nonblock="yes" - else - AC_MSG_RESULT([no]) - tst_allow_setsockopt_so_nonblock="no" - fi - fi - # - AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used]) - if test "$tst_compi_setsockopt_so_nonblock" = "yes" && - test "$tst_allow_setsockopt_so_nonblock" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1, - [Define to 1 if you have a working setsockopt SO_NONBLOCK function.]) - curl_cv_func_setsockopt_so_nonblock="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_setsockopt_so_nonblock="no" - fi -]) - - -dnl CURL_CHECK_FUNC_SETXATTR -dnl ------------------------------------------------- -dnl Verify if setxattr is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_setxattr, then -dnl HAVE_SETXATTR will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_SETXATTR], [ - AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl - # - tst_links_setxattr="unknown" - tst_proto_setxattr="unknown" - tst_compi_setxattr="unknown" - tst_allow_setxattr="unknown" - tst_nargs_setxattr="unknown" - # - AC_MSG_CHECKING([if setxattr can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([setxattr]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_setxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_setxattr="no" - ]) - # - if test "$tst_links_setxattr" = "yes"; then - AC_MSG_CHECKING([if setxattr is prototyped]) - AC_EGREP_CPP([setxattr],[ - $curl_includes_sys_xattr - ],[ - AC_MSG_RESULT([yes]) - tst_proto_setxattr="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_setxattr="no" - ]) - fi - # - if test "$tst_proto_setxattr" = "yes"; then - if test "$tst_nargs_setxattr" = "unknown"; then - AC_MSG_CHECKING([if setxattr takes 5 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != setxattr(0, 0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_setxattr="yes" - tst_nargs_setxattr="5" - ],[ - AC_MSG_RESULT([no]) - tst_compi_setxattr="no" - ]) - fi - if test "$tst_nargs_setxattr" = "unknown"; then - AC_MSG_CHECKING([if setxattr takes 6 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_xattr - ]],[[ - if(0 != setxattr(0, 0, 0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_setxattr="yes" - tst_nargs_setxattr="6" - ],[ - AC_MSG_RESULT([no]) - tst_compi_setxattr="no" - ]) - fi - AC_MSG_CHECKING([if setxattr is compilable]) - if test "$tst_compi_setxattr" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_setxattr" = "yes"; then - AC_MSG_CHECKING([if setxattr usage allowed]) - if test "x$curl_disallow_setxattr" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_setxattr="yes" - else - AC_MSG_RESULT([no]) - tst_allow_setxattr="no" - fi - fi - # - AC_MSG_CHECKING([if setxattr might be used]) - if test "$tst_links_setxattr" = "yes" && - test "$tst_proto_setxattr" = "yes" && - test "$tst_compi_setxattr" = "yes" && - test "$tst_allow_setxattr" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_SETXATTR, 1, - [Define to 1 if you have the setxattr function.]) - dnl AC_DEFINE_UNQUOTED(SETXATTR_ARGS, $tst_nargs_setxattr, - dnl [Specifies the number of arguments to setxattr]) - # - if test "$tst_nargs_setxattr" -eq "5"; then - AC_DEFINE(HAVE_SETXATTR_5, 1, [setxattr() takes 5 args]) - elif test "$tst_nargs_setxattr" -eq "6"; then - AC_DEFINE(HAVE_SETXATTR_6, 1, [setxattr() takes 6 args]) - fi - # - curl_cv_func_setxattr="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_setxattr="no" - fi -]) - - dnl CURL_CHECK_FUNC_SIGACTION dnl ------------------------------------------------- dnl Verify if sigaction is available, prototyped, and @@ -4820,7 +3624,6 @@ dnl HAVE_SOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl - AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_socket="unknown" tst_proto_socket="unknown" @@ -4833,7 +3636,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ $curl_includes_winsock2 $curl_includes_bsdsocket $curl_includes_sys_socket - $curl_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; @@ -4852,7 +3654,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ $curl_includes_winsock2 $curl_includes_bsdsocket $curl_includes_sys_socket - $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_socket="yes" @@ -4869,7 +3670,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ $curl_includes_winsock2 $curl_includes_bsdsocket $curl_includes_sys_socket - $curl_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; @@ -4920,7 +3720,6 @@ dnl HAVE_SOCKETPAIR will be defined. AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [ AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl - AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_socketpair="unknown" tst_proto_socketpair="unknown" @@ -4942,7 +3741,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [ AC_MSG_CHECKING([if socketpair is prototyped]) AC_EGREP_CPP([socketpair],[ $curl_includes_sys_socket - $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_socketpair="yes" @@ -4957,7 +3755,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_sys_socket - $curl_includes_socket ]],[[ int sv[2]; if(0 != socketpair(0, 0, 0, sv)) @@ -5776,11 +4573,11 @@ dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH dnl changes contained within this macro. AC_DEFUN([CURL_RUN_IFELSE], [ - case $host_os in - darwin*) + case $host in + *-apple-*) AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4) - ;; - *) + ;; + *) oldcc=$CC old=$LD_LIBRARY_PATH CC="sh ./run-compiler" @@ -5789,8 +4586,8 @@ AC_DEFUN([CURL_RUN_IFELSE], [ AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4) LD_LIBRARY_PATH=$old # restore CC=$oldcc - ;; - esac + ;; + esac ]) dnl CURL_COVERAGE @@ -5807,8 +4604,8 @@ AC_DEFUN([CURL_COVERAGE],[ dnl check if enabled by argument AC_ARG_ENABLE(code-coverage, - AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]), - coverage="$enableval") + AS_HELP_STRING([--enable-code-coverage], [Provide code coverage]), + coverage="$enableval") dnl if not gcc switch off again AS_IF([ test "$GCC" != "yes" ], coverage="no" ) @@ -5887,19 +4684,19 @@ AC_DEFUN([CURL_SIZEOF], [ r=0 dnl Check the sizes in a reasonable order for typesize in 8 4 2 16 1; do - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include $2 ]], - [switch(0) { - case 0: - case (sizeof($1) == $typesize):; - } + [switch(0) { + case 0: + case (sizeof($1) == $typesize):; + } ]) ], [ - r=$typesize], + r=$typesize], [ - r=0]) + r=0]) dnl get out of the loop once matched if test $r -gt 0; then break; @@ -5910,7 +4707,7 @@ $2 fi AC_MSG_RESULT($r) dnl lowercase and underscore instead of space - tname=$(echo "ac_cv_sizeof_$1" | tr A-Z a-z | tr " " "_") + tname=`echo "ac_cv_sizeof_$1" | tr A-Z a-z | tr " " "_"` eval "$tname=$r" AC_DEFINE_UNQUOTED(TYPE, [$r], [Size of $1 in number of bytes]) diff --git a/deps/curl/m4/curl-gnutls.m4 b/deps/curl/m4/curl-gnutls.m4 index d4f553d6..93c3946a 100644 --- a/deps/curl/m4/curl-gnutls.m4 +++ b/deps/curl/m4/curl-gnutls.m4 @@ -93,24 +93,24 @@ if test "x$OPT_GNUTLS" != xno; then LIBS="$addlib $LIBS" LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + CPPFLAGS="$CPPFLAGS $addcflags" fi 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]) - AC_SUBST(USE_GNUTLS, [1]) - 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" - ]) + [ + AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) + AC_SUBST(USE_GNUTLS, [1]) + 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" + ]) if test "x$USE_GNUTLS" = "xyes"; then AC_MSG_NOTICE([detected GnuTLS version $version]) @@ -126,6 +126,7 @@ 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" fi fi @@ -159,10 +160,10 @@ dnl We require GnuTLS with SRP support. dnl --- if test "$GNUTLS_ENABLED" = "1"; then AC_CHECK_LIB(gnutls, gnutls_srp_verifier, - [ - AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) - AC_SUBST(HAVE_GNUTLS_SRP, [1]) - ]) + [ + AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) + AC_SUBST(HAVE_GNUTLS_SRP, [1]) + ]) fi ]) diff --git a/deps/curl/m4/curl-mbedtls.m4 b/deps/curl/m4/curl-mbedtls.m4 index 64116e75..bf14c6c8 100644 --- a/deps/curl/m4/curl-mbedtls.m4 +++ b/deps/curl/m4/curl-mbedtls.m4 @@ -43,14 +43,14 @@ if test "x$OPT_MBEDTLS" != xno; then AC_CHECK_LIB(mbedtls, mbedtls_havege_init, dnl libmbedtls found, set the variable - [ - AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) - AC_SUBST(USE_MBEDTLS, [1]) - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], [], -lmbedx509 -lmbedcrypto) + [ + AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) + AC_SUBST(USE_MBEDTLS, [1]) + MBEDTLS_ENABLED=1 + USE_MBEDTLS="yes" + ssl_msg="mbedTLS" + test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], [], -lmbedx509 -lmbedcrypto) fi addld="" @@ -66,22 +66,22 @@ if test "x$OPT_MBEDTLS" != xno; then LDFLAGS="$LDFLAGS $addld" if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + CPPFLAGS="$CPPFLAGS $addcflags" fi AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, - [ - AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) - AC_SUBST(USE_MBEDTLS, [1]) - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - ], -lmbedx509 -lmbedcrypto) + [ + AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) + AC_SUBST(USE_MBEDTLS, [1]) + MBEDTLS_ENABLED=1 + USE_MBEDTLS="yes" + ssl_msg="mbedTLS" + test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + ], -lmbedx509 -lmbedcrypto) fi if test "x$USE_MBEDTLS" = "xyes"; then @@ -101,6 +101,7 @@ if test "x$OPT_MBEDTLS" != xno; then AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH]) fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mbedtls" fi fi dnl mbedTLS not disabled diff --git a/deps/curl/m4/curl-openssl.m4 b/deps/curl/m4/curl-openssl.m4 index 2fb2abec..dfbbc339 100644 --- a/deps/curl/m4/curl-openssl.m4 +++ b/deps/curl/m4/curl-openssl.m4 @@ -38,7 +38,7 @@ if test "x$OPT_OPENSSL" != xno; then CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" - dnl This is for Msys/Mingw + dnl This is for MSYS/MinGW case $host in *-*-msys* | *-*-mingw*) AC_MSG_CHECKING([for gdi32]) @@ -61,48 +61,48 @@ if test "x$OPT_OPENSSL" != xno; then esac case "$OPT_OPENSSL" in - yes) - dnl --with-openssl (without path) used - PKGTEST="yes" - PREFIX_OPENSSL= - ;; - *) - dnl check the given --with-openssl spot - PKGTEST="no" - 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 the user told us to look - OPENSSL_PCDIR="$OPT_OPENSSL/lib/pkgconfig" - if test -f "$OPENSSL_PCDIR/openssl.pc"; then - AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) + yes) + dnl --with-openssl (without path) used PKGTEST="yes" - fi + PREFIX_OPENSSL= + ;; + *) + dnl check the given --with-openssl spot + PKGTEST="no" + PREFIX_OPENSSL=$OPT_OPENSSL - if test "$PKGTEST" != "yes"; then - # try lib64 instead - OPENSSL_PCDIR="$OPT_OPENSSL/lib64/pkgconfig" + dnl Try pkg-config even when cross-compiling. Since we + dnl specify PKG_CONFIG_LIBDIR we're only looking where + dnl the user told us to look + OPENSSL_PCDIR="$OPT_OPENSSL/lib/pkgconfig" if test -f "$OPENSSL_PCDIR/openssl.pc"; then AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) PKGTEST="yes" fi - fi - if test "$PKGTEST" != "yes"; then - if test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then - AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-openssl prefix!]) + if test "$PKGTEST" != "yes"; then + # try lib64 instead + OPENSSL_PCDIR="$OPT_OPENSSL/lib64/pkgconfig" + if test -f "$OPENSSL_PCDIR/openssl.pc"; then + AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) + PKGTEST="yes" + fi fi - fi - 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 - SSL_LDFLAGS="-L$LIB_OPENSSL" - SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" - fi - ;; + if test "$PKGTEST" != "yes"; then + if test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then + AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-openssl prefix!]) + fi + fi + + 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 + SSL_LDFLAGS="-L$LIB_OPENSSL" + SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" + fi + ;; esac if test "$PKGTEST" = "yes"; then @@ -141,63 +141,60 @@ if test "x$OPT_OPENSSL" != xno; then LDFLAGS="$LDFLAGS $SSL_LDFLAGS" AC_CHECK_LIB(crypto, HMAC_Update,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS" - ],[ - if test -n "$LIB_OPENSSL" ; then - LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" - fi - if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then - # only set this if pkg-config wasn't used - CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" - fi - # Linking previously failed, try extra paths from --with-openssl or - # pkg-config. Use a different function name to avoid reusing the earlier - # cached result. - AC_CHECK_LIB(crypto, HMAC_Init_ex,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS"], [ + HAVECRYPTO="yes" + LIBS="-lcrypto $LIBS" + ],[ + if test -n "$LIB_OPENSSL" ; then + LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" + fi + if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then + # only set this if pkg-config wasn't used + CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" + fi + # Linking previously failed, try extra paths from --with-openssl or + # pkg-config. Use a different function name to avoid reusing the earlier + # cached result. + AC_CHECK_LIB(crypto, HMAC_Init_ex,[ + HAVECRYPTO="yes" + LIBS="-lcrypto $LIBS"], [ - dnl still no, but what about with -ldl? - AC_MSG_CHECKING([OpenSSL linking with -ldl]) - LIBS="-lcrypto $CLEANLIBS -ldl" - AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ - #include - ]], [[ - ERR_clear_error(); - ]]) ], - [ - AC_MSG_RESULT(yes) - HAVECRYPTO="yes" - ], - [ - AC_MSG_RESULT(no) - dnl ok, so what about both -ldl and -lpthread? - dnl This may be necessary for static libraries. + dnl still no, but what about with -ldl? + AC_MSG_CHECKING([OpenSSL linking with -ldl]) + LIBS="-lcrypto $CLEANLIBS -ldl" + AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ + #include + ]], [[ + ERR_clear_error(); + ]]) ], + [ + AC_MSG_RESULT(yes) + HAVECRYPTO="yes" + ], + [ + AC_MSG_RESULT(no) + dnl ok, so what about both -ldl and -lpthread? + dnl This may be necessary for static libraries. - AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread]) - LIBS="-lcrypto $CLEANLIBS -ldl -lpthread" - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]], [[ - ERR_clear_error(); - ]])], - [ - AC_MSG_RESULT(yes) - HAVECRYPTO="yes" - ], - [ - AC_MSG_RESULT(no) - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" - - ]) - - ]) - - ]) + AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread]) + LIBS="-lcrypto $CLEANLIBS -ldl -lpthread" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]], [[ + ERR_clear_error(); + ]])], + [ + AC_MSG_RESULT(yes) + HAVECRYPTO="yes" + ], + [ + AC_MSG_RESULT(no) + LDFLAGS="$CLEANLDFLAGS" + CPPFLAGS="$CLEANCPPFLAGS" + LIBS="$CLEANLIBS" + ]) + ]) + ]) ]) if test X"$HAVECRYPTO" = X"yes"; then @@ -207,18 +204,18 @@ if test "x$OPT_OPENSSL" != xno; then AC_CHECK_LIB(ssl, SSL_connect) if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff - AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); - OLIBS=$LIBS - LIBS="-lRSAglue -lrsaref $LIBS" - AC_CHECK_LIB(ssl, SSL_connect) - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - dnl still no SSL_connect - AC_MSG_RESULT(no) - LIBS=$OLIBS - else - AC_MSG_RESULT(yes) - fi + dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff + AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); + OLIBS=$LIBS + LIBS="-lRSAglue -lrsaref $LIBS" + AC_CHECK_LIB(ssl, SSL_connect) + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + dnl still no SSL_connect + AC_MSG_RESULT(no) + LIBS=$OLIBS + else + AC_MSG_RESULT(yes) + fi else @@ -247,7 +244,7 @@ if test "x$OPT_OPENSSL" != xno; then fi if test X"$OPENSSL_ENABLED" != X"1"; then - LIBS="$CLEANLIBS" + LIBS="$CLEANLIBS" fi if test X"$OPT_OPENSSL" != Xoff && @@ -261,50 +258,50 @@ if test "x$OPT_OPENSSL" != xno; then AC_MSG_CHECKING([for BoringSSL]) AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - #ifndef OPENSSL_IS_BORINGSSL - #error not boringssl - #endif - ]]) + AC_LANG_PROGRAM([[ + #include + ]],[[ + #ifndef OPENSSL_IS_BORINGSSL + #error not boringssl + #endif + ]]) ],[ - AC_MSG_RESULT([yes]) - ssl_msg="BoringSSL" - OPENSSL_IS_BORINGSSL=1 + AC_MSG_RESULT([yes]) + ssl_msg="BoringSSL" + OPENSSL_IS_BORINGSSL=1 ],[ - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for AWS-LC]) AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - #ifndef OPENSSL_IS_AWSLC - #error not AWS-LC - #endif - ]]) + AC_LANG_PROGRAM([[ + #include + ]],[[ + #ifndef OPENSSL_IS_AWSLC + #error not AWS-LC + #endif + ]]) ],[ - AC_MSG_RESULT([yes]) - ssl_msg="AWS-LC" - OPENSSL_IS_BORINGSSL=1 + AC_MSG_RESULT([yes]) + ssl_msg="AWS-LC" + OPENSSL_IS_BORINGSSL=1 ],[ - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) ]) - AC_MSG_CHECKING([for libressl]) + AC_MSG_CHECKING([for LibreSSL]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ int dummy = LIBRESSL_VERSION_NUMBER; ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1, - [Define to 1 if using libressl.]) - ssl_msg="libressl" + [Define to 1 if using LibreSSL.]) + ssl_msg="LibreSSL" ],[ AC_MSG_RESULT([no]) ]) @@ -312,7 +309,7 @@ if test "x$OPT_OPENSSL" != xno; then AC_MSG_CHECKING([for OpenSSL >= v3]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) return 0; @@ -322,8 +319,6 @@ if test "x$OPT_OPENSSL" != xno; then ]]) ],[ AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1, - [Define to 1 if using OpenSSL 3 or later.]) ssl_msg="OpenSSL v3+" ],[ AC_MSG_RESULT([no]) @@ -341,54 +336,29 @@ 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 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" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH]) - fi + 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 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" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH]) + fi fi check_for_ca_bundle=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE openssl" fi test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi if test X"$OPT_OPENSSL" != Xno && - test "$OPENSSL_ENABLED" != "1"; then + test "$OPENSSL_ENABLED" != "1"; then AC_MSG_NOTICE([OPT_OPENSSL: $OPT_OPENSSL]) AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED]) AC_MSG_ERROR([--with-openssl was given but OpenSSL could not be detected]) fi -dnl ********************************************************************** -dnl Check for the random seed preferences -dnl ********************************************************************** - -if test X"$OPENSSL_ENABLED" = X"1"; then - dnl Check for user-specified random device - AC_ARG_WITH(random, - AS_HELP_STRING([--with-random=FILE], - [read randomness from FILE (default=/dev/urandom)]), - [ RANDOM_FILE="$withval" ], - [ - if test x$cross_compiling != xyes; then - dnl Check for random device - AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) - else - AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling]) - fi - ] - ) - if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then - AC_SUBST(RANDOM_FILE) - AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE", - [a suitable file to read random data from]) - fi -fi - dnl --- dnl We require OpenSSL with SRP support. dnl --- @@ -396,7 +366,7 @@ if test "$OPENSSL_ENABLED" = "1"; then AC_MSG_CHECKING([for SRP support in OpenSSL]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ SSL_CTX_set_srp_username(NULL, ""); SSL_CTX_set_srp_password(NULL, ""); @@ -414,31 +384,33 @@ dnl --- dnl Whether the OpenSSL configuration will be loaded automatically dnl --- if test X"$OPENSSL_ENABLED" = X"1"; then -AC_ARG_ENABLE(openssl-auto-load-config, + 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 - 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]) - fi -]) + [ 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]) + fi + ]) fi dnl --- dnl We may use OpenSSL QUIC. dnl --- if test "$OPENSSL_ENABLED" = "1"; then - AC_MSG_CHECKING([for QUIC support in OpenSSL]) + AC_MSG_CHECKING([for QUIC support and OpenSSL >= 3.3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ + #if (OPENSSL_VERSION_NUMBER < 0x30300000L) + #error need at least version 3.3.0 + #endif OSSL_QUIC_client_method(); ]]) ],[ AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_OPENSSL_QUIC, 1, [if you have the functions OSSL_QUIC_client_method]) - AC_SUBST(HAVE_OPENSSL_QUIC, [1]) + have_openssl_quic=1 ],[ AC_MSG_RESULT([no]) ]) diff --git a/deps/curl/m4/curl-override.m4 b/deps/curl/m4/curl-override.m4 index b4a8df9b..e993e30f 100644 --- a/deps/curl/m4/curl-override.m4 +++ b/deps/curl/m4/curl-override.m4 @@ -44,11 +44,11 @@ dnl ------------------------------------------------- dnl This is done to prevent compiler warning dnl 'function declaration isn't a prototype' dnl in function main. This requires at least -dnl a c89 compiler and does not support K&R. +dnl a C89 compiler and does not support K&R. m4_define([AC_LANG_PROGRAM(C)], [$1 -int main (void) +int main(void) { $2 ; @@ -93,6 +93,6 @@ extern "C" #endif char $1 (); #if defined __stub_$1 || defined __stub___$1 -choke me +#error force compilation error #endif ], [return $1 ();])]) diff --git a/deps/curl/m4/curl-reentrant.m4 b/deps/curl/m4/curl-reentrant.m4 index c1f33398..b5387107 100644 --- a/deps/curl/m4/curl-reentrant.m4 +++ b/deps/curl/m4/curl-reentrant.m4 @@ -40,7 +40,7 @@ dnl makes errno available as a preprocessor macro. AC_DEFUN([CURL_CHECK_NEED_REENTRANT_ERRNO], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ if(0 != errno) return 1; @@ -53,27 +53,27 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_ERRNO], [ if test "$tmp_errno" = "yes"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include ]],[[ -#ifdef errno - int dummy=1; -#else - force compilation error -#endif + #ifdef errno + int dummy=1; + #else + #error force compilation error + #endif ]]) ],[ tmp_errno="errno_macro_defined" ],[ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#define _REENTRANT -#include + #define _REENTRANT + #include ]],[[ -#ifdef errno - int dummy=1; -#else - force compilation error -#endif + #ifdef errno + int dummy=1; + #else + #error force compilation error + #endif ]]) ],[ tmp_errno="errno_macro_needs_reentrant" @@ -99,15 +99,15 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GMTIME_R], [ ]) if test "$tmp_gmtime_r" = "yes"; then AC_EGREP_CPP([gmtime_r],[ -#include -#include + #include + #include ],[ tmp_gmtime_r="proto_declared" ],[ AC_EGREP_CPP([gmtime_r],[ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include ],[ tmp_gmtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" @@ -132,15 +132,15 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_LOCALTIME_R], [ ]) if test "$tmp_localtime_r" = "yes"; then AC_EGREP_CPP([localtime_r],[ -#include -#include + #include + #include ],[ tmp_localtime_r="proto_declared" ],[ AC_EGREP_CPP([localtime_r],[ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include ],[ tmp_localtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" @@ -165,15 +165,15 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRERROR_R], [ ]) if test "$tmp_strerror_r" = "yes"; then AC_EGREP_CPP([strerror_r],[ -#include -#include + #include + #include ],[ tmp_strerror_r="proto_declared" ],[ AC_EGREP_CPP([strerror_r],[ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include ],[ tmp_strerror_r="proto_needs_reentrant" tmp_need_reentrant="yes" @@ -198,15 +198,15 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRTOK_R], [ ]) if test "$tmp_strtok_r" = "yes"; then AC_EGREP_CPP([strtok_r],[ -#include -#include + #include + #include ],[ tmp_strtok_r="proto_declared" ],[ AC_EGREP_CPP([strtok_r],[ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include ],[ tmp_strtok_r="proto_needs_reentrant" tmp_need_reentrant="yes" @@ -231,15 +231,15 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R], [ ]) if test "$tmp_gethostbyname_r" = "yes"; then AC_EGREP_CPP([gethostbyname_r],[ -#include -#include + #include + #include ],[ tmp_gethostbyname_r="proto_declared" ],[ AC_EGREP_CPP([gethostbyname_r],[ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include ],[ tmp_gethostbyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" @@ -264,15 +264,15 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ ]) if test "$tmp_getprotobyname_r" = "yes"; then AC_EGREP_CPP([getprotobyname_r],[ -#include -#include + #include + #include ],[ tmp_getprotobyname_r="proto_declared" ],[ AC_EGREP_CPP([getprotobyname_r],[ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include ],[ tmp_getprotobyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" @@ -410,11 +410,11 @@ AC_DEFUN([CURL_CONFIGURE_REENTRANT], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ -#ifdef _REENTRANT - int dummy=1; -#else - force compilation error -#endif + #ifdef _REENTRANT + int dummy=1; + #else + #error force compilation error + #endif ]]) ],[ AC_MSG_RESULT([yes]) @@ -470,11 +470,11 @@ AC_DEFUN([CURL_CONFIGURE_THREAD_SAFE], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ ]],[[ -#ifdef _THREAD_SAFE - int dummy=1; -#else - force compilation error -#endif + #ifdef _THREAD_SAFE + int dummy=1; + #else + #error force compilation error + #endif ]]) ],[ AC_MSG_RESULT([yes]) diff --git a/deps/curl/m4/curl-rustls.m4 b/deps/curl/m4/curl-rustls.m4 index 75542e4a..fdcbfcd5 100644 --- a/deps/curl/m4/curl-rustls.m4 +++ b/deps/curl/m4/curl-rustls.m4 @@ -24,88 +24,167 @@ AC_DEFUN([CURL_WITH_RUSTLS], [ dnl ---------------------------------------------------- -dnl check for rustls +dnl check for Rustls dnl ---------------------------------------------------- if test "x$OPT_RUSTLS" != xno; then - _cppflags=$CPPFLAGS - _ldflags=$LDFLAGS ssl_msg= - if test X"$OPT_RUSTLS" != Xno; then + dnl backup the pre-ssl variables + CLEANLDFLAGS="$LDFLAGS" + CLEANCPPFLAGS="$CPPFLAGS" - if test "$OPT_RUSTLS" = "yes"; then - OPT_RUSTLS="" - fi + ## NEW CODE - case $host_os in - darwin*) - LDFLAGS="$LDFLAGS -framework Security" - ;; - *) - ;; - esac + dnl use pkg-config unless we have been given a path + dnl even then, try pkg-config first - if test -z "$OPT_RUSTLS" ; then - dnl check for lib first without setting any new path + case "$OPT_RUSTLS" in + yes) + dnl --with-rustls (without path) used + PKGTEST="yes" + PREFIX_RUSTLS= + ;; + *) + dnl check the provided --with-rustls path + PKGTEST="no" + PREFIX_RUSTLS=$OPT_RUSTLS - AC_CHECK_LIB(rustls, rustls_client_session_read, - dnl librustls found, set the variable - [ - AC_DEFINE(USE_RUSTLS, 1, [if rustls is enabled]) - AC_SUBST(USE_RUSTLS, [1]) - RUSTLS_ENABLED=1 - USE_RUSTLS="yes" - ssl_msg="rustls" - test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], [], -lpthread -ldl -lm) - fi + dnl Try pkg-config even when cross-compiling. Since we + dnl specify PKG_CONFIG_LIBDIR we are only looking where + dnl the user told us to look - if test "x$USE_RUSTLS" != "xyes"; then - dnl add the path and test again - addld=-L$OPT_RUSTLS/lib$libsuff - addcflags=-I$OPT_RUSTLS/include - rustlslib=$OPT_RUSTLS/lib$libsuff - - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + RUSTLS_PCDIR="$PREFIX_RUSTLS/lib/pkgconfig" + if test -f "$RUSTLS_PCDIR/rustls.pc"; then + AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$RUSTLS_PCDIR"]) + PKGTEST="yes" fi - AC_CHECK_LIB(rustls, rustls_connection_read, - [ - AC_DEFINE(USE_RUSTLS, 1, [if rustls is enabled]) - AC_SUBST(USE_RUSTLS, [1]) - RUSTLS_ENABLED=1 - USE_RUSTLS="yes" - ssl_msg="rustls" - test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - AC_MSG_ERROR([--with-rustls was specified but could not find rustls.]), - -lpthread -ldl -lm) - fi - - if test "x$USE_RUSTLS" = "xyes"; then - AC_MSG_NOTICE([detected rustls]) - check_for_ca_bundle=1 - - LIBS="-lrustls -lpthread -ldl -lm $LIBS" - - if test -n "$rustlslib"; 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 CURL_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - if test "x$cross_compiling" != "xyes"; then - CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$rustlslib" - export CURL_LIBRARY_PATH - AC_MSG_NOTICE([Added $rustlslib to CURL_LIBRARY_PATH]) + if test "$PKGTEST" != "yes"; then + # try lib64 instead + RUSTLS_PCDIR="$PREFIX_RUSTLS/lib64/pkgconfig" + if test -f "$RUSTLS_PCDIR/rustls.pc"; then + AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$RUSTLS_PCDIR"]) + PKGTEST="yes" fi fi + + if test "$PKGTEST" != "yes"; then + dnl pkg-config came up empty, use what we got + dnl via --with-rustls + + addld=-L$PREFIX_RUSTLS/lib$libsuff + addcflags=-I$PREFIX_RUSTLS/include + + LDFLAGS="$LDFLAGS $addld" + if test "$addcflags" != "-I/usr/include"; then + CPPFLAGS="$CPPFLAGS $addcflags" + fi + + case $host in + *-apple-*) + RUSTLS_LDFLAGS="-framework Security -framework Foundation" + ;; + *) + RUSTLS_LDFLAGS="-lpthread -ldl -lm" + ;; + esac + AC_CHECK_LIB(rustls, rustls_connection_read, + [ + AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled]) + AC_SUBST(USE_RUSTLS, [1]) + RUSTLS_ENABLED=1 + USE_RUSTLS="yes" + ssl_msg="rustls" + test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + AC_MSG_ERROR([--with-rustls was specified but could not find Rustls.]), + $RUSTLS_LDFLAGS) + + LIB_RUSTLS="$PREFIX_RUSTLS/lib$libsuff" + if test "$PREFIX_RUSTLS" != "/usr" ; then + SSL_LDFLAGS="-L$LIB_RUSTLS $RUSTLS_LDFLAGS" + SSL_CPPFLAGS="-I$PREFIX_RUSTLS/include" + fi + fi + ;; + esac + + if test "$PKGTEST" = "yes"; then + + CURL_CHECK_PKGCONFIG(rustls, [$RUSTLS_PCDIR]) + + if test "$PKGCONFIG" != "no" ; then + SSL_LIBS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR]) dnl + $PKGCONFIG --libs-only-l --libs-only-other rustls 2>/dev/null` + + SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR]) dnl + $PKGCONFIG --libs-only-L rustls 2>/dev/null` + + SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$RUSTLS_PCDIR]) dnl + $PKGCONFIG --cflags-only-I rustls 2>/dev/null` + + AC_SUBST(SSL_LIBS) + AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"]) + AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"]) + AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"]) + + LIB_RUSTLS=`echo $SSL_LDFLAGS | sed -e 's/^-L//'` + + 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 additional libs may be necessary. Hope that we + dnl don't need any. + LIBS="$SSL_LIBS $LIBS" + ssl_msg="rustls" + AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled]) + AC_SUBST(USE_RUSTLS, [1]) + USE_RUSTLS="yes" + RUSTLS_ENABLED=1 + test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + else + AC_MSG_ERROR([pkg-config: Could not find Rustls]) fi - fi dnl rustls not disabled + else + dnl we did not use pkg-config, so we need to add the + dnl Rustls lib to LIBS + LIBS="-lrustls -lpthread -ldl -lm $LIBS" + fi + + dnl finally, set flags to use this TLS backend + CPPFLAGS="$CLEAN_CPPFLAGS $SSL_CPPFLAGS" + LDFLAGS="$CLAN_LDFLAGS $SSL_LDFLAGS" + + if test "x$USE_RUSTLS" = "xyes"; then + AC_MSG_NOTICE([detected Rustls]) + 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 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 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_RUSTLS" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $LIB_RUSTLS to CURL_LIBRARY_PATH]) + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE rustls" + fi test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" + + 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]) + AC_MSG_ERROR([--with-rustls was given but Rustls could not be detected]) + fi fi ]) + +RUSTLS_ENABLED diff --git a/deps/curl/m4/curl-sysconfig.m4 b/deps/curl/m4/curl-sysconfig.m4 index 9b287bc7..5fcd8859 100644 --- a/deps/curl/m4/curl-sysconfig.m4 +++ b/deps/curl/m4/curl-sysconfig.m4 @@ -24,17 +24,18 @@ AC_DEFUN([CURL_DARWIN_SYSTEMCONFIGURATION], [ AC_MSG_CHECKING([whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks]) -case $host_os in - darwin*) +case $host in + *-apple-*) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include + #include + #include ]],[[ -#if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) - return 0; -#else -#error Not macOS -#endif + #if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) + return 0; + #else + #error Not macOS + #endif ]]) ],[ build_for_macos="yes" diff --git a/deps/curl/m4/curl-wolfssl.m4 b/deps/curl/m4/curl-wolfssl.m4 index 1da47a91..ca60d3b4 100644 --- a/deps/curl/m4/curl-wolfssl.m4 +++ b/deps/curl/m4/curl-wolfssl.m4 @@ -80,8 +80,8 @@ if test "x$OPT_WOLFSSL" != xno; then LDFLAGS="$LDFLAGS $addld" AC_MSG_NOTICE([Add $addld to LDFLAGS]) if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - AC_MSG_NOTICE([Add $addcflags to CPPFLAGS]) + CPPFLAGS="$CPPFLAGS $addcflags" + AC_MSG_NOTICE([Add $addcflags to CPPFLAGS]) fi my_ac_save_LIBS="$LIBS" @@ -91,31 +91,31 @@ if test "x$OPT_WOLFSSL" != xno; then AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -/* These aren't needed for detection and confuse WolfSSL. - They are set up properly later if it is detected. */ -#undef SIZEOF_LONG -#undef SIZEOF_LONG_LONG -#include -#include + /* These are not needed for detection and confuse wolfSSL. + They are set up properly later if it is detected. */ + #undef SIZEOF_LONG + #undef SIZEOF_LONG_LONG + #include + #include ]],[[ return wolfSSL_Init(); ]]) ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled]) - AC_SUBST(USE_WOLFSSL, [1]) - WOLFSSL_ENABLED=1 - USE_WOLFSSL="yes" - ssl_msg="WolfSSL" - QUIC_ENABLED=yes - test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - AC_MSG_RESULT(no) - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - wolfssllibpath="" - ]) + AC_MSG_RESULT(yes) + AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled]) + AC_SUBST(USE_WOLFSSL, [1]) + WOLFSSL_ENABLED=1 + USE_WOLFSSL="yes" + ssl_msg="wolfSSL" + QUIC_ENABLED=yes + test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + ], + [ + AC_MSG_RESULT(no) + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + wolfssllibpath="" + ]) LIBS="$my_ac_save_LIBS" fi @@ -128,7 +128,7 @@ if test "x$OPT_WOLFSSL" != xno; then LIBS="$addlib -lm $LIBS" - dnl WolfSSL needs configure --enable-opensslextra to have *get_peer* + dnl wolfSSL needs configure --enable-opensslextra to have *get_peer* dnl DES* is needed for NTLM support and lives in the OpenSSL compatibility dnl layer AC_CHECK_FUNCS(wolfSSL_get_peer_certificate \ @@ -138,18 +138,18 @@ if test "x$OPT_WOLFSSL" != xno; then dnl OpenSSL API root as well AC_CHECK_FUNC(wolfSSL_DES_ecb_encrypt, [ - AC_DEFINE(HAVE_WOLFSSL_DES_ECB_ENCRYPT, 1, - [if you have wolfSSL_DES_ecb_encrypt]) - WOLFSSL_NTLM=1 + AC_DEFINE(HAVE_WOLFSSL_DES_ECB_ENCRYPT, 1, + [if you have wolfSSL_DES_ecb_encrypt]) + WOLFSSL_NTLM=1 ] ) dnl if this symbol is present, we can make use of BIO filter chains AC_CHECK_FUNC(wolfSSL_BIO_set_shutdown, [ - AC_DEFINE(HAVE_WOLFSSL_FULL_BIO, 1, - [if you have wolfSSL_BIO_set_shutdown]) - WOLFSSL_FULL_BIO=1 + AC_DEFINE(HAVE_WOLFSSL_FULL_BIO, 1, + [if you have wolfSSL_BIO_set_shutdown]) + WOLFSSL_FULL_BIO=1 ] ) @@ -164,8 +164,9 @@ if test "x$OPT_WOLFSSL" != xno; then AC_MSG_NOTICE([Added $wolfssllibpath to CURL_LIBRARY_PATH]) fi 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 doesn't work]) fi fi dnl wolfSSL not disabled diff --git a/deps/curl/m4/xc-am-iface.m4 b/deps/curl/m4/xc-am-iface.m4 index c035f58c..e85e6d42 100644 --- a/deps/curl/m4/xc-am-iface.m4 +++ b/deps/curl/m4/xc-am-iface.m4 @@ -2,7 +2,7 @@ # # xc-am-iface.m4 # -# Copyright (C) Daniel Stenberg +# 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 diff --git a/deps/curl/m4/xc-cc-check.m4 b/deps/curl/m4/xc-cc-check.m4 index a6cfb07e..5cf2af7b 100644 --- a/deps/curl/m4/xc-cc-check.m4 +++ b/deps/curl/m4/xc-cc-check.m4 @@ -2,7 +2,7 @@ # # xc-cc-check.m4 # -# Copyright (C), Daniel Stenberg +# 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 diff --git a/deps/curl/m4/xc-lt-iface.m4 b/deps/curl/m4/xc-lt-iface.m4 index d5e437ff..f3ac0ded 100644 --- a/deps/curl/m4/xc-lt-iface.m4 +++ b/deps/curl/m4/xc-lt-iface.m4 @@ -2,7 +2,7 @@ # # xc-lt-iface.m4 # -# Copyright (C), Daniel Stenberg +# 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 diff --git a/deps/curl/m4/xc-translit.m4 b/deps/curl/m4/xc-translit.m4 deleted file mode 100644 index 6d667719..00000000 --- a/deps/curl/m4/xc-translit.m4 +++ /dev/null @@ -1,165 +0,0 @@ -#--------------------------------------------------------------------------- -# -# xc-translit.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 -# -#--------------------------------------------------------------------------- - -# File version for 'aclocal' use. Keep it a single number. -# serial 2 - - -dnl XC_SH_TR_SH (expression) -dnl ------------------------------------------------- -dnl Shell execution time transliteration of 'expression' -dnl argument, where all non-alfanumeric characters are -dnl converted to the underscore '_' character. -dnl Normal shell expansion and substitution takes place -dnl for given 'expression' at shell execution time before -dnl transliteration is applied to it. - -AC_DEFUN([XC_SH_TR_SH], -[`echo "$1" | sed 's/[[^a-zA-Z0-9_]]/_/g'`]) - - -dnl XC_SH_TR_SH_EX (expression, [extra]) -dnl ------------------------------------------------- -dnl Like XC_SH_TR_SH but transliterating characters -dnl given in 'extra' argument to lowercase 'p'. For -dnl example [*+], [*], and [+] are valid 'extra' args. - -AC_DEFUN([XC_SH_TR_SH_EX], -[ifelse([$2], [], - [XC_SH_TR_SH([$1])], - [`echo "$1" | sed 's/[[$2]]/p/g' | sed 's/[[^a-zA-Z0-9_]]/_/g'`])]) - - -dnl XC_M4_TR_SH (expression) -dnl ------------------------------------------------- -dnl m4 execution time transliteration of 'expression' -dnl argument, where all non-alfanumeric characters are -dnl converted to the underscore '_' character. - -AC_DEFUN([XC_M4_TR_SH], -[patsubst(XC_QPATSUBST(XC_QUOTE($1), - [[^a-zA-Z0-9_]], [_]), - [\(_\(.*\)_\)], [\2])]) - - -dnl XC_M4_TR_SH_EX (expression, [extra]) -dnl ------------------------------------------------- -dnl Like XC_M4_TR_SH but transliterating characters -dnl given in 'extra' argument to lowercase 'p'. For -dnl example [*+], [*], and [+] are valid 'extra' args. - -AC_DEFUN([XC_M4_TR_SH_EX], -[ifelse([$2], [], - [XC_M4_TR_SH([$1])], - [patsubst(XC_QPATSUBST(XC_QPATSUBST(XC_QUOTE($1), - [[$2]], - [p]), - [[^a-zA-Z0-9_]], [_]), - [\(_\(.*\)_\)], [\2])])]) - - -dnl XC_SH_TR_CPP (expression) -dnl ------------------------------------------------- -dnl Shell execution time transliteration of 'expression' -dnl argument, where all non-alfanumeric characters are -dnl converted to the underscore '_' character and alnum -dnl characters are converted to uppercase. -dnl Normal shell expansion and substitution takes place -dnl for given 'expression' at shell execution time before -dnl transliteration is applied to it. - -AC_DEFUN([XC_SH_TR_CPP], -[`echo "$1" | dnl -sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl -sed 's/[[^A-Z0-9_]]/_/g'`]) - - -dnl XC_SH_TR_CPP_EX (expression, [extra]) -dnl ------------------------------------------------- -dnl Like XC_SH_TR_CPP but transliterating characters -dnl given in 'extra' argument to uppercase 'P'. For -dnl example [*+], [*], and [+] are valid 'extra' args. - -AC_DEFUN([XC_SH_TR_CPP_EX], -[ifelse([$2], [], - [XC_SH_TR_CPP([$1])], - [`echo "$1" | dnl -sed 's/[[$2]]/P/g' | dnl -sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | dnl -sed 's/[[^A-Z0-9_]]/_/g'`])]) - - -dnl XC_M4_TR_CPP (expression) -dnl ------------------------------------------------- -dnl m4 execution time transliteration of 'expression' -dnl argument, where all non-alfanumeric characters are -dnl converted to the underscore '_' character and alnum -dnl characters are converted to uppercase. - -AC_DEFUN([XC_M4_TR_CPP], -[patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QUOTE($1), - [abcdefghijklmnopqrstuvwxyz], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), - [[^A-Z0-9_]], [_]), - [\(_\(.*\)_\)], [\2])]) - - -dnl XC_M4_TR_CPP_EX (expression, [extra]) -dnl ------------------------------------------------- -dnl Like XC_M4_TR_CPP but transliterating characters -dnl given in 'extra' argument to uppercase 'P'. For -dnl example [*+], [*], and [+] are valid 'extra' args. - -AC_DEFUN([XC_M4_TR_CPP_EX], -[ifelse([$2], [], - [XC_M4_TR_CPP([$1])], - [patsubst(XC_QPATSUBST(XC_QTRANSLIT(XC_QPATSUBST(XC_QUOTE($1), - [[$2]], - [P]), - [abcdefghijklmnopqrstuvwxyz], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), - [[^A-Z0-9_]], [_]), - [\(_\(.*\)_\)], [\2])])]) - - -dnl XC_QUOTE (expression) -dnl ------------------------------------------------- -dnl Expands to quoted result of 'expression' expansion. - -AC_DEFUN([XC_QUOTE], -[[$@]]) - - -dnl XC_QPATSUBST (string, regexp[, repl]) -dnl ------------------------------------------------- -dnl Expands to quoted result of 'patsubst' expansion. - -AC_DEFUN([XC_QPATSUBST], -[XC_QUOTE(patsubst([$1], [$2], [$3]))]) - - -dnl XC_QTRANSLIT (string, chars, repl) -dnl ------------------------------------------------- -dnl Expands to quoted result of 'translit' expansion. - -AC_DEFUN([XC_QTRANSLIT], -[XC_QUOTE(translit([$1], [$2], [$3]))]) diff --git a/deps/curl/m4/xc-val-flgs.m4 b/deps/curl/m4/xc-val-flgs.m4 index c8f77965..e2225c2e 100644 --- a/deps/curl/m4/xc-val-flgs.m4 +++ b/deps/curl/m4/xc-val-flgs.m4 @@ -2,7 +2,7 @@ # # xc-val-flgs.m4 # -# Copyright (C), Daniel Stenberg +# 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 @@ -211,7 +211,7 @@ AC_DEFUN([XC_CHECK_USER_FLAGS], [ 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.]) + AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.]) fi ]) @@ -239,6 +239,6 @@ AC_DEFUN([XC_CHECK_BUILD_FLAGS], [ 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.]) + AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.]) fi ]) diff --git a/deps/curl/m4/zz40-xc-ovr.m4 b/deps/curl/m4/zz40-xc-ovr.m4 index fa457876..6faa94e4 100644 --- a/deps/curl/m4/zz40-xc-ovr.m4 +++ b/deps/curl/m4/zz40-xc-ovr.m4 @@ -2,7 +2,7 @@ # # zz40-xc-ovr.m4 # -# Copyright (C) Daniel Stenberg +# 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 diff --git a/deps/curl/m4/zz50-xc-ovr.m4 b/deps/curl/m4/zz50-xc-ovr.m4 index 18c1f0ab..735df2f5 100644 --- a/deps/curl/m4/zz50-xc-ovr.m4 +++ b/deps/curl/m4/zz50-xc-ovr.m4 @@ -2,7 +2,7 @@ # # zz50-xc-ovr.m4 # -# Copyright (C), Daniel Stenberg +# 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 diff --git a/deps/curl/m4/zz60-xc-ovr.m4 b/deps/curl/m4/zz60-xc-ovr.m4 index 53166867..d1d3a2fd 100644 --- a/deps/curl/m4/zz60-xc-ovr.m4 +++ b/deps/curl/m4/zz60-xc-ovr.m4 @@ -2,7 +2,7 @@ # # zz60-xc-ovr.m4 # -# Copyright (C), Daniel Stenberg +# 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 diff --git a/deps/curl/packages/Makefile.am b/deps/curl/packages/Makefile.am index b7bf1e59..96f52bdb 100644 --- a/deps/curl/packages/Makefile.am +++ b/deps/curl/packages/Makefile.am @@ -33,6 +33,7 @@ EXTRA_DIST = README.md \ OS400/curl.inc.in \ OS400/initscript.sh \ OS400/config400.default \ + OS400/make-docs.sh \ OS400/make-include.sh \ OS400/make-lib.sh \ OS400/make-src.sh \ diff --git a/deps/curl/packages/OS400/.gitattributes b/deps/curl/packages/OS400/.gitattributes deleted file mode 100644 index e9b8201b..00000000 --- a/deps/curl/packages/OS400/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -# OS400 .cmd files are not windows scripts. -*.cmd text eol=auto diff --git a/deps/curl/packages/OS400/README.OS400 b/deps/curl/packages/OS400/README.OS400 index 38b2c7f0..1bc4132f 100644 --- a/deps/curl/packages/OS400/README.OS400 +++ b/deps/curl/packages/OS400/README.OS400 @@ -226,8 +226,7 @@ in fact, very few common utilities are available. As a consequence, the config-os400.h has been coded manually and the compilation scripts are a set of shell scripts stored in subdirectory packages/OS400. - The "curl" command and the test environment are currently not supported on -OS/400. + The test environment is currently not supported on OS/400. Protocols currently implemented on OS/400: diff --git a/deps/curl/packages/OS400/ccsidcurl.c b/deps/curl/packages/OS400/ccsidcurl.c index 596c1f1e..fe2b4589 100644 --- a/deps/curl/packages/OS400/ccsidcurl.c +++ b/deps/curl/packages/OS400/ccsidcurl.c @@ -127,8 +127,8 @@ convert(char *d, size_t dlen, int dccsid, dccsid = ASCII_CCSID; if(sccsid == dccsid) { - lslen = slen >= 0? slen: strlen(s) + 1; - i = lslen < dlen? lslen: dlen; + lslen = slen >= 0 ? slen : strlen(s) + 1; + i = lslen < dlen ? lslen : dlen; if(s != d && i > 0) memcpy(d, s, i); @@ -170,7 +170,7 @@ 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 = (size_t) (slen < 0 ? strlen(s) : slen) + 1; dlen *= MAX_CONV_EXPANSION; /* Allow some expansion. */ d = malloc(dlen); @@ -294,7 +294,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); if(!s) return (char *) NULL; @@ -324,7 +324,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); if(!s) return (char *) NULL; @@ -437,7 +437,8 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) offsetof(curl_version_info_data, zstd_version), offsetof(curl_version_info_data, hyper_version), offsetof(curl_version_info_data, gsasl_version), - offsetof(curl_version_info_data, feature_names) + offsetof(curl_version_info_data, feature_names), + offsetof(curl_version_info_data, rtmp_version) }; /* The assertion below is possible, because although the second operand @@ -1045,7 +1046,7 @@ Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len) ret = (*p->append)(p->arg, b, l); free(b); - return ret == l? len: -1; + return ret == l ? len : -1; } @@ -1097,6 +1098,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) case CURLOPT_DNS_LOCAL_IP6: case CURLOPT_DNS_SERVERS: case CURLOPT_DOH_URL: + case CURLOPT_ECH: case CURLOPT_EGDSOCKET: case CURLOPT_FTPPORT: case CURLOPT_FTP_ACCOUNT: diff --git a/deps/curl/packages/OS400/config400.default b/deps/curl/packages/OS400/config400.default index 91a82771..4e7ddbac 100644 --- a/deps/curl/packages/OS400/config400.default +++ b/deps/curl/packages/OS400/config400.default @@ -39,6 +39,7 @@ setenv OUTPUT '*NONE' # Compilation output option. setenv TGTRLS '*CURRENT' # Target OS release. setenv IFSDIR '/curl' # Installation IFS directory. setenv QADRTDIR '/QIBM/ProdData/qadrt' # QADRT IFS directory. +setenv PASEPERL '/QOpenSys/pkgs/bin/perl' # PASE Perl interpreter. # Define ZLIB availability and locations. diff --git a/deps/curl/packages/OS400/curl.inc.in b/deps/curl/packages/OS400/curl.inc.in index b3a4e9ef..81ba82c3 100644 --- a/deps/curl/packages/OS400/curl.inc.in +++ b/deps/curl/packages/OS400/curl.inc.in @@ -206,8 +206,10 @@ d CURLAUTH_NTLM c X'00000008' d CURLAUTH_DIGEST_IE... d c X'00000010' + /if not defined(CURL_NO_OLDIES) d CURLAUTH_NTLM_WB... d c X'00000020' + /endif d CURLAUTH_BEARER... d c X'00000040' d CURLAUTH_AWS_SIGV4... @@ -441,8 +443,12 @@ d c X'00000400' d CURLU_ALLOW_SPACE... d c X'00000800' - d CURLU_PUNYCODE... - d c X'00001000' + d CURLU_PUNYCODE c X'00001000' + d CURLU_PUNY2IDN c X'00002000' + d CURLU_GET_EMPTY... + d c X'00004000' + d CURLU_NO_GUESS_SCHEME... + d c X'00008000' * d CURLOT_FLAG_ALIAS... d c X'00000001' @@ -669,6 +675,8 @@ d c 99 d CURLE_TOO_LARGE... d c 100 + d CURLE_ECH_REQUIRED... + d c 101 * /if not defined(CURL_NO_OLDIES) d CURLE_URL_MALFORMAT_USER... @@ -1661,6 +1669,9 @@ d c 10323 d CURLOPT_SERVER_RESPONSE_TIMEOUT_MS... d c 00324 + d CURLOPT_ECH c 10325 + d CURLOPT_TCP_KEEPCNT... + d c 00326 * /if not defined(CURL_NO_OLDIES) d CURLOPT_FILE c 10001 @@ -1902,6 +1913,8 @@ d c X'00600040' d CURLINFO_QUEUE_TIME_T... CURLINFO_OFF_T + 65 d c X'00600041' + d CURLINFO_USED_PROXY... CURLINFO_LONG + 66 + d c X'00200042' * d CURLINFO_HTTP_CODE... Old ...RESPONSE_CODE d c X'00200002' @@ -2065,8 +2078,10 @@ d c 9 d CURLVERSION_ELEVENTH... d c 10 + d CURLVERSION_TWELFTH... + d c 11 d CURLVERSION_NOW... - d c 10 CURLVERSION_ELEVENTH + d c 11 CURLVERSION_ELEVENTH * d CURLHcode s 10i 0 based(######ptr######) Enum d CURLHE_OK c 0 @@ -2413,6 +2428,8 @@ d gsasl_version... d * const char * d feature_names... + d * const char * + d rtmp_version... d * const char * * d curl_certinfo ds based(######ptr######) @@ -3015,6 +3032,14 @@ d running_handles... d 10i 0 * + d curl_multi_waitfds... + d pr extproc('curl_multi_waitfds') + d like(CURLMcode) + d multi * value CURLM * + d ufds * value curl_waitfd * + d size 10u 0 value + d fd_count 10u 0 + * d curl_multi_socket_action... d pr extproc('curl_multi_socket_action') d like(CURLMcode) diff --git a/deps/curl/packages/OS400/curlmain.c b/deps/curl/packages/OS400/curlmain.c index 1b030b7c..a36de322 100644 --- a/deps/curl/packages/OS400/curlmain.c +++ b/deps/curl/packages/OS400/curlmain.c @@ -61,15 +61,13 @@ int main(int argc, char **argv) size_t inbytesleft; size_t outbytesleft; char dummybuf[128]; - char tocode[32]; - char fromcode[32]; + const char *tocode = "IBMCCSID01208"; /* Use UTF-8. */ + const char *fromcode = "IBMCCSID000000000010"; ebcdic_argc = argc; ebcdic_argv = argv; /* Build the encoding converter. */ - strncpy(tocode, "IBMCCSID01208", sizeof(tocode)); /* Use UTF-8. */ - strncpy(fromcode, "IBMCCSID000000000010", sizeof(fromcode)); cd = iconv_open(tocode, fromcode); /* Measure the arguments. */ diff --git a/deps/curl/packages/OS400/initscript.sh b/deps/curl/packages/OS400/initscript.sh index b75055a8..69a354ab 100644 --- a/deps/curl/packages/OS400/initscript.sh +++ b/deps/curl/packages/OS400/initscript.sh @@ -33,14 +33,14 @@ setenv() { # Define and export. - eval ${1}="${2}" - export ${1} + eval "${1}=${2}" + export "${1?}" } case "${SCRIPTDIR}" in /*) ;; -*) SCRIPTDIR="`pwd`/${SCRIPTDIR}" +*) SCRIPTDIR="$(pwd)/${SCRIPTDIR}" esac while true @@ -52,14 +52,14 @@ done # The script directory is supposed to be in $TOPDIR/packages/os400. -TOPDIR=`dirname "${SCRIPTDIR}"` -TOPDIR=`dirname "${TOPDIR}"` +TOPDIR=$(dirname "${SCRIPTDIR}") +TOPDIR=$(dirname "${TOPDIR}") export SCRIPTDIR TOPDIR # Extract the SONAME from the library makefile. -SONAME=`sed -e '/^VERSIONCHANGE=/!d;s/^.*=\([0-9]*\).*/\1/' \ - < "${TOPDIR}/lib/Makefile.soname"` +SONAME="$(sed -e '/^VERSIONCHANGE=/!d;s/^.*=\([0-9]*\).*/\1/' \ + < "${TOPDIR}/lib/Makefile.soname")" export SONAME # Get OS/400 configuration parameters. @@ -69,26 +69,29 @@ if [ -f "${SCRIPTDIR}/config400.override" ] then . "${SCRIPTDIR}/config400.override" fi +# Check if perl available. +{ [ -n "${PASEPERL}" ] && [ -x "${PASEPERL}" ]; } || PASEPERL= + # Need to get the version definitions. -LIBCURL_VERSION=`grep '^#define *LIBCURL_VERSION ' \ +LIBCURL_VERSION=$(grep '^#define *LIBCURL_VERSION ' \ "${TOPDIR}/include/curl/curlver.h" | - sed 's/.*"\(.*\)".*/\1/'` -LIBCURL_VERSION_MAJOR=`grep '^#define *LIBCURL_VERSION_MAJOR ' \ + sed 's/.*"\(.*\)".*/\1/') +LIBCURL_VERSION_MAJOR=$(grep '^#define *LIBCURL_VERSION_MAJOR ' \ "${TOPDIR}/include/curl/curlver.h" | - sed 's/^#define *LIBCURL_VERSION_MAJOR *\([^ ]*\).*/\1/'` -LIBCURL_VERSION_MINOR=`grep '^#define *LIBCURL_VERSION_MINOR ' \ + sed 's/^#define *LIBCURL_VERSION_MAJOR *\([^ ]*\).*/\1/') +LIBCURL_VERSION_MINOR=$(grep '^#define *LIBCURL_VERSION_MINOR ' \ "${TOPDIR}/include/curl/curlver.h" | - sed 's/^#define *LIBCURL_VERSION_MINOR *\([^ ]*\).*/\1/'` -LIBCURL_VERSION_PATCH=`grep '^#define *LIBCURL_VERSION_PATCH ' \ + sed 's/^#define *LIBCURL_VERSION_MINOR *\([^ ]*\).*/\1/') +LIBCURL_VERSION_PATCH=$(grep '^#define *LIBCURL_VERSION_PATCH ' \ "${TOPDIR}/include/curl/curlver.h" | - sed 's/^#define *LIBCURL_VERSION_PATCH *\([^ ]*\).*/\1/'` -LIBCURL_VERSION_NUM=`grep '^#define *LIBCURL_VERSION_NUM ' \ + sed 's/^#define *LIBCURL_VERSION_PATCH *\([^ ]*\).*/\1/') +LIBCURL_VERSION_NUM=$(grep '^#define *LIBCURL_VERSION_NUM ' \ "${TOPDIR}/include/curl/curlver.h" | - sed 's/^#define *LIBCURL_VERSION_NUM *0x\([^ ]*\).*/\1/'` -LIBCURL_TIMESTAMP=`grep '^#define *LIBCURL_TIMESTAMP ' \ + sed 's/^#define *LIBCURL_VERSION_NUM *0x\([^ ]*\).*/\1/') +LIBCURL_TIMESTAMP=$(grep '^#define *LIBCURL_TIMESTAMP ' \ "${TOPDIR}/include/curl/curlver.h" | - sed 's/.*"\(.*\)".*/\1/'` + sed 's/.*"\(.*\)".*/\1/') export LIBCURL_VERSION export LIBCURL_VERSION_MAJOR LIBCURL_VERSION_MINOR LIBCURL_VERSION_PATCH export LIBCURL_VERSION_NUM LIBCURL_TIMESTAMP @@ -119,7 +122,8 @@ action_needed() { [ ! -e "${1}" ] && return 0 - [ "${2}" ] || return 1 + [ -n "${2}" ] || return 1 + # shellcheck disable=SC3013 [ "${1}" -ot "${2}" ] && return 0 return 1 } @@ -136,7 +140,7 @@ canonicalize_path() { if expr "${1}" : '^/' > /dev/null then P="${1}" - else P="`pwd`/${1}" + else P="$(pwd)/${1}" fi R= @@ -147,7 +151,7 @@ canonicalize_path() do IFS="${IFSSAVE}" case "${C}" in .) ;; - ..) R=`expr "${R}" : '^\(.*/\)..*'` + ..) R="$(expr "${R}" : '^\(.*/\)..*')" ;; ?*) R="${R}${C}/" ;; @@ -156,7 +160,7 @@ canonicalize_path() done IFS="${IFSSAVE}" - echo "/`expr "${R}" : '^\(.*\)/'`" + echo "/$(expr "${R}" : '^\(.*\)/')" } @@ -172,7 +176,7 @@ make_module() MODULES="${MODULES} ${1}" MODIFSNAME="${LIBIFSNAME}/${1}.MODULE" action_needed "${MODIFSNAME}" "${2}" || return 0; - SRCDIR=`dirname \`canonicalize_path "${2}"\`` + SRCDIR="$(dirname "$(canonicalize_path "${2}")")" # #pragma convert has to be in the source file itself, i.e. # putting it in an include file makes it only active @@ -180,11 +184,13 @@ make_module() # Thus we build a temporary file with the pragma prepended to # the source file and we compile that temporary file. - echo "#line 1 \"${2}\"" > __tmpsrcf.c - echo "#pragma convert(819)" >> __tmpsrcf.c - echo "#line 1" >> __tmpsrcf.c - cat "${2}" >> __tmpsrcf.c - CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('__tmpsrcf.c')" + { + echo "#line 1 \"${2}\"" + echo "#pragma convert(819)" + echo "#line 1" + cat "${2}" + } > "${1}"__819.c + CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('${1}__819.c')" CMD="${CMD} SYSIFCOPT(*IFS64IO *ASYNCSIGNAL)" # CMD="${CMD} OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)" CMD="${CMD} OPTION(*INCDIRFIRST)" @@ -217,12 +223,15 @@ make_module() then DEFINES="${DEFINES} USE_LIBSSH2" fi - if [ "${DEFINES}" ] + if [ -n "${DEFINES}" ] then CMD="${CMD} DEFINE(${DEFINES})" fi CLcommand "${CMD}" - rm -f __tmpsrcf.c + if [ "${DEBUG}" = "*NONE" ] + then rm -f "${1}"__819.c + fi + # shellcheck disable=SC2034 LINK=YES } @@ -272,16 +281,17 @@ versioned_copy() get_make_vars() { - eval "`sed -e ': begin' \ - -e '/\\\\$/{' \ + eval "$(sed -e ': begin' \ + -e '/\\$/{' \ -e 'N' \ - -e 's/\\\\\\n/ /' \ + -e 's/\\\n/ /' \ -e 'b begin' \ -e '}' \ - -e '/^[A-Za-z_][A-Za-z0-9_]*[[:space:]]*=/!d' \ - -e 's/@\\([A-Za-z0-9_]*\\)@/${\\1}/g' \ - -e 's/[[:space:]]*=[[:space:]]*/=/' \ - -e 's/=\\(.*[^[:space:]]\\)[[:space:]]*$/=\\"\\1\\"/' \ - -e 's/\\\$(\\([^)]*\\))/\${\\1}/g' \ - < \"${1}\"`" + -e 's/[[:space:]][[:space:]]*/ /g' \ + -e '/^[A-Za-z_][A-Za-z0-9_]* *=/!d' \ + -e 's/@\([A-Za-z0-9_]*\)@/${\1}/g' \ + -e 's/ *= */=/' \ + -e 's/=\(.*[^ ]\) *$/="\1"/' \ + -e 's/\$(\([^)]*\))/${\1}/g' \ + < "${1}")" } diff --git a/deps/curl/packages/OS400/make-docs.sh b/deps/curl/packages/OS400/make-docs.sh new file mode 100644 index 00000000..b79b19e9 --- /dev/null +++ b/deps/curl/packages/OS400/make-docs.sh @@ -0,0 +1,65 @@ +#!/bin/sh +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +# Documentation build script for the OS/400. +# + + +SCRIPTDIR=$(dirname "${0}") +. "${SCRIPTDIR}/initscript.sh" + +[ -n "${PASEPERL}" ] || exit 0 # Perl needed for doc build. +cd "${TOPDIR}/docs" || exit 1 +[ -d "${IFSDIR}/docs" ] || mkdir "${IFSDIR}/docs" + + +# Command line options. + +( + cd cmdline-opts || exit 1 + MANPAGE=curl.1 + TEXTPAGE=curl.txt + get_make_vars Makefile.inc + rm -f "${IFSDIR}/docs/${MANPAGE}" "${IFSDIR}/docs/${TEXTPAGE}" + + # Prepare online manual. + # shellcheck disable=SC2086 + ${PASEPERL} "${TOPDIR}/scripts/managen" -c 75 \ + listhelp ${DPAGES} > "${TOPDIR}/src/tool_listhelp.c" + + # Generate text manual and copy it to DB2. + # shellcheck disable=SC2086 + ${PASEPERL} "${TOPDIR}/scripts/managen" -I "${TOPDIR}/include" \ + -c 75 ascii ${DPAGES} > "${IFSDIR}/docs/${TEXTPAGE}" + MEMBER="${LIBIFSNAME}/DOCS.FILE/MANUAL.MBR" + CMD="CPY OBJ('${IFSDIR}/docs/${TEXTPAGE}') TOOBJ('${MEMBER}')" + CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" + CLcommand "${CMD}" + +# Man page is useless as OS/400 has no man command. +# # shellcheck disable=SC2086 +# ${PASEPERL} "${TOPDIR}/scripts/managen" -I "${TOPDIR}/include" \ +# mainpage ${DPAGES} > "${IFSDIR}/docs/${MANPAGE}" +) diff --git a/deps/curl/packages/OS400/make-include.sh b/deps/curl/packages/OS400/make-include.sh index 30235eb7..e30e9505 100644 --- a/deps/curl/packages/OS400/make-include.sh +++ b/deps/curl/packages/OS400/make-include.sh @@ -26,9 +26,9 @@ # Installation of the header files in the OS/400 library. # -SCRIPTDIR=`dirname "${0}"` +SCRIPTDIR=$(dirname "${0}") . "${SCRIPTDIR}/initscript.sh" -cd "${TOPDIR}/include" +cd "${TOPDIR}/include" || exit 1 # Create the OS/400 source program file for the header files. @@ -71,16 +71,16 @@ copy_hfile() # Copy the header files. for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h -do case "`basename \"${HFILE}\" .h`" in +do case "$(basename "${HFILE}" .h)" in stdcheaders|typecheck-gcc) continue;; esac - DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR" + DEST="${SRCPF}/$(db2_name "${HFILE}" nomangle).MBR" if action_needed "${DEST}" "${HFILE}" then copy_hfile "${DEST}" "${HFILE}" - IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`" + IFSDEST="${IFSINCLUDE}/$(basename "${HFILE}")" rm -f "${IFSDEST}" ln -s "${DEST}" "${IFSDEST}" fi diff --git a/deps/curl/packages/OS400/make-lib.sh b/deps/curl/packages/OS400/make-lib.sh index 8179d816..e7b5b519 100644 --- a/deps/curl/packages/OS400/make-lib.sh +++ b/deps/curl/packages/OS400/make-lib.sh @@ -26,9 +26,9 @@ # libcurl compilation script for the OS/400. # -SCRIPTDIR=`dirname "${0}"` +SCRIPTDIR=$(dirname "${0}") . "${SCRIPTDIR}/initscript.sh" -cd "${TOPDIR}/lib" +cd "${TOPDIR}/lib" || exit 1 # Need to have IFS access to the mih/cipher header file. @@ -40,10 +40,12 @@ fi # Create and compile the identification source file. -echo '#pragma comment(user, "libcurl version '"${LIBCURL_VERSION}"'")' > os400.c -echo '#pragma comment(user, __DATE__)' >> os400.c -echo '#pragma comment(user, __TIME__)' >> os400.c -echo '#pragma comment(copyright, "Copyright (C) Daniel Stenberg et al. OS/400 version by P. Monnerat")' >> os400.c +{ + echo '#pragma comment(user, "libcurl version '"${LIBCURL_VERSION}"'")' + echo '#pragma comment(user, __DATE__)' + echo '#pragma comment(user, __TIME__)' + echo '#pragma comment(copyright, "Copyright (C) Daniel Stenberg et al. OS/400 version by P. Monnerat")' +} > os400.c make_module OS400 os400.c BUILDING_LIBCURL LINK= # No need to rebuild service program yet. MODULES= @@ -56,13 +58,14 @@ get_make_vars Makefile.inc # Compile the sources into modules. -INCLUDES="'`pwd`'" +# shellcheck disable=SC2034 +INCLUDES="'$(pwd)'" make_module OS400SYS "${SCRIPTDIR}/os400sys.c" BUILDING_LIBCURL make_module CCSIDCURL "${SCRIPTDIR}/ccsidcurl.c" BUILDING_LIBCURL for SRC in ${CSOURCES} -do MODULE=`db2_name "${SRC}"` +do MODULE=$(db2_name "${SRC}") make_module "${MODULE}" "${SRC}" BUILDING_LIBCURL done @@ -73,7 +76,7 @@ if action_needed "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" then LINK=YES fi -if [ "${LINK}" ] +if [ -n "${LINK}" ] then rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})" CMD="${CMD} TEXT('LibCurl API static binding directory')" @@ -101,17 +104,17 @@ fi # - Unfold lines from the header files so that they contain a semicolon. # - Keep only CURL_EXTERN definitions. # - Remove the CURL_DEPRECATED and CURL_TEMP_PRINTF macro calls. -# - Drop the parenthesized function arguments and what follows. +# - Drop the parenthesized function arguments and what follows. # - Keep the trailing function name only. -EXPORTS=`cat "${TOPDIR}"/include/curl/*.h "${SCRIPTDIR}/ccsidcurl.h" | +EXPORTS=$(cat "${TOPDIR}"/include/curl/*.h "${SCRIPTDIR}/ccsidcurl.h" | sed -e 'H;s/.*//;x;s/\n//;s/.*/& /' \ -e '/^CURL_EXTERN[[:space:]]/!d' \ -e '/\;/!{x;d;}' \ -e 's/ CURL_DEPRECATED([^)]*)//g' \ -e 's/ CURL_TEMP_PRINTF([^)]*)//g' \ -e 's/[[:space:]]*(.*$//' \ - -e 's/^.*[^A-Za-z0-9_]\([A-Za-z0-9_]*\)$/\1/'` + -e 's/^.*[^A-Za-z0-9_]\([A-Za-z0-9_]*\)$/\1/') # Create the service program exportation file in DB2 member if needed. @@ -122,7 +125,7 @@ if action_needed "${BSF}" Makefile.am then LINK=YES fi -if [ "${LINK}" ] +if [ -n "${LINK}" ] then echo " STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('LIBCURL_${SONAME}')" \ > "${BSF}" for EXPORT in ${EXPORTS} @@ -139,7 +142,7 @@ if action_needed "${LIBIFSNAME}/${SRVPGM}.SRVPGM" then LINK=YES fi -if [ "${LINK}" ] +if [ -n "${LINK}" ] then CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})" CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)" CMD="${CMD} MODULE(${TARGETLIB}/OS400)" @@ -167,7 +170,7 @@ if action_needed "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" then LINK=YES fi -if [ "${LINK}" ] +if [ -n "${LINK}" ] then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})" CMD="${CMD} TEXT('LibCurl API dynamic binding directory')" diff --git a/deps/curl/packages/OS400/make-src.sh b/deps/curl/packages/OS400/make-src.sh index 931c1f33..21fd0015 100644 --- a/deps/curl/packages/OS400/make-src.sh +++ b/deps/curl/packages/OS400/make-src.sh @@ -25,9 +25,18 @@ # # Command line interface tool compilation script for the OS/400. -SCRIPTDIR=`dirname "${0}"` +SCRIPTDIR=$(dirname "${0}") . "${SCRIPTDIR}/initscript.sh" -cd "${TOPDIR}/src" +cd "${TOPDIR}/src" || exit 1 + + +# Check if built-in manual can be generated. + +USE_MANUAL= +if [ -f "${IFSDIR}/docs/curl.txt" ] && [ -n "${PASEPERL}" ] +then "${PASEPERL}" ./mkhelp.pl < "${IFSDIR}/docs/curl.txt" > tool_hugehelp.c + USE_MANUAL="'USE_MANUAL'" +fi # Get source lists. @@ -40,25 +49,27 @@ get_make_vars Makefile.inc # Compile the sources into modules. +# shellcheck disable=SC2034 LINK= MODULES= +# shellcheck disable=SC2034 INCLUDES="'${TOPDIR}/lib'" for SRC in ${CURLX_CFILES} -do MODULE=`db2_name "${SRC}"` - MODULE=`db2_name "X${MODULE}"` - make_module "${MODULE}" "${SRC}" +do MODULE=$(db2_name "${SRC}") + MODULE=$(db2_name "X${MODULE}") + make_module "${MODULE}" "${SRC}" "${USE_MANUAL}" done for SRC in ${CURL_CFILES} -do MODULE=`db2_name "${SRC}"` - make_module "${MODULE}" "${SRC}" +do MODULE=$(db2_name "${SRC}") + make_module "${MODULE}" "${SRC}" "${USE_MANUAL}" done # Link modules into program. -MODULES="`echo \"${MODULES}\" | sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`" +MODULES="$(echo "${MODULES}" | sed "s/[^ ][^ ]*/${TARGETLIB}\/&/g")" CMD="CRTPGM PGM(${TARGETLIB}/${CURLPGM})" CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)" CMD="${CMD} MODULE(${MODULES})" diff --git a/deps/curl/packages/OS400/make-tests.sh b/deps/curl/packages/OS400/make-tests.sh index ed475956..3a212596 100644 --- a/deps/curl/packages/OS400/make-tests.sh +++ b/deps/curl/packages/OS400/make-tests.sh @@ -27,9 +27,9 @@ # -SCRIPTDIR=`dirname "${0}"` +SCRIPTDIR=$(dirname "${0}") . "${SCRIPTDIR}/initscript.sh" -cd "${TOPDIR}/tests" +cd "${TOPDIR}/tests" || exit 1 # Build programs in a directory. @@ -40,23 +40,26 @@ build_all_programs() # Compile all programs. # The list is found in variable "noinst_PROGRAMS" - INCLUDES="'`pwd`' '${TOPDIR}/lib' '${TOPDIR}/src'" + # shellcheck disable=SC2034 + INCLUDES="'$(pwd)' '${TOPDIR}/lib' '${TOPDIR}/src'" MODS="${1}" SRVPGMS="${2}" + # shellcheck disable=SC2154 for PGM in ${noinst_PROGRAMS} - do DB2PGM=`db2_name "${PGM}"` + do DB2PGM=$(db2_name "${PGM}") PGMIFSNAME="${LIBIFSNAME}/${DB2PGM}.PGM" # Extract preprocessor symbol definitions from # compilation options for the program. - PGMCFLAGS="`eval echo \"\\${${PGM}_CFLAGS}\"`" + PGMCFLAGS="$(eval echo "\${${PGM}_CFLAGS}")" PGMDFNS= for FLAG in ${PGMCFLAGS} do case "${FLAG}" in - -D?*) DEFINE="`echo \"${FLAG}\" | sed 's/^..//'`" + -D?*) # shellcheck disable=SC2001 + DEFINE="$(echo "${FLAG}" | sed 's/^..//')" PGMDFNS="${PGMDFNS} '${DEFINE}'" ;; esac @@ -64,7 +67,7 @@ build_all_programs() # Compile all C sources for the program into modules. - PGMSOURCES="`eval echo \"\\${${PGM}_SOURCES}\"`" + PGMSOURCES="$(eval echo "\${${PGM}_SOURCES}")" LINK= MODULES= @@ -77,7 +80,7 @@ build_all_programs() case "${SOURCE}" in lib*.c) MODULE="${DB2PGM}" ;; - *) MODULE=`db2_name "${SOURCE}"` + *) MODULE=$(db2_name "${SOURCE}") ;; esac @@ -85,7 +88,7 @@ build_all_programs() # prefix module name with 'X'. case "${SOURCE}" in - ../*) MODULE=`db2_name "X${MODULE}"` + ../*) MODULE=$(db2_name "X${MODULE}") ;; esac @@ -99,17 +102,17 @@ build_all_programs() # Link program if needed. - if [ "${LINK}" ] - then PGMLDADD="`eval echo \"\\${${PGM}_LDADD}\"`" - for ARG in ${PGMLDADD} - do case "${ARG}" in + if [ -n "${LINK}" ] + then PGMLDADD="$(eval echo "\${${PGM}_LDADD}")" + for M in ${PGMLDADD} + do case "${M}" in -*) ;; # Ignore non-module. - *) MODULES="${MODULES} "`db2_name "${ARG}"` + *) MODULES="${MODULES} $(db2_name "${M}")" ;; esac done - MODULES="`echo \"${MODULES}\" | - sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`" + MODULES="$(echo "${MODULES}" | + sed "s/[^ ][^ ]*/${TARGETLIB}\/&/g")" CMD="CRTPGM PGM(${TARGETLIB}/${DB2PGM})" CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)" CMD="${CMD} MODULE(${MODULES} ${MODS})" @@ -124,7 +127,7 @@ build_all_programs() # Build programs in the server directory. ( - cd server + cd server || exit 1 get_make_vars Makefile.inc build_all_programs "${TARGETLIB}/OS400SYS" ) @@ -133,13 +136,9 @@ build_all_programs() # Build all programs in the libtest subdirectory. ( - cd libtest + cd libtest || exit 1 get_make_vars Makefile.inc - # Special case: redefine chkhostname compilation parameters. - - chkhostname_SOURCES=chkhostname.c - chkhostname_LDADD=curl_gethostname.o - + # shellcheck disable=SC2153 build_all_programs "" "${TARGETLIB}/${SRVPGM}" ) diff --git a/deps/curl/packages/OS400/makefile.sh b/deps/curl/packages/OS400/makefile.sh index 3d659645..7f758452 100644 --- a/deps/curl/packages/OS400/makefile.sh +++ b/deps/curl/packages/OS400/makefile.sh @@ -28,9 +28,21 @@ # # This is a shell script since make is not a standard component of OS/400. -SCRIPTDIR=`dirname "${0}"` +SCRIPTDIR=$(dirname "${0}") . "${SCRIPTDIR}/initscript.sh" -cd "${TOPDIR}" +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 +do if [ "${CCSID}" != 1208 ] + then CMD="CPY OBJ('${FILE}') TOOBJ('${FILE}') FROMCCSID(*OBJ)" + CMD="${CMD} TOCCSID(1208) DTAFMT(*TEXT) REPLACE(*YES)" + (CLcommand "${CMD}") + fi +done # Create the OS/400 library if it does not exist. @@ -53,13 +65,13 @@ fi # Copy some documentation files if needed. for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README.OS400" \ - "${TOPDIR}/CHANGES" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ" \ + "${TOPDIR}/CHANGES.md" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ" \ "${TOPDIR}/docs/FEATURES" "${TOPDIR}/docs/SSLCERTS.md" \ "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS.md" \ "${TOPDIR}/docs/HISTORY.md" -do MEMBER="`basename \"${TEXT}\" .OS400`" - MEMBER="`basename \"${MEMBER}\" .md`" - MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR" +do MEMBER="$(basename "${TEXT}" .OS400)" + MEMBER="$(basename "${MEMBER}" .md)" + MEMBER="${LIBIFSNAME}/DOCS.FILE/$(db2_name "${MEMBER}").MBR" [ -e "${TEXT}" ] || continue @@ -83,8 +95,8 @@ fi # Copy RPG examples if needed. for EXAMPLE in "${SCRIPTDIR}/rpg-examples"/* -do MEMBER="`basename \"${EXAMPLE}\"`" - IFSMEMBER="${LIBIFSNAME}/RPGXAMPLES.FILE/`db2_name \"${MEMBER}\"`.MBR" +do MEMBER="$(basename "${EXAMPLE}")" + IFSMEMBER="${LIBIFSNAME}/RPGXAMPLES.FILE/$(db2_name "${MEMBER}").MBR" [ -e "${EXAMPLE}" ] || continue @@ -92,8 +104,8 @@ do MEMBER="`basename \"${EXAMPLE}\"`" then CMD="CPY OBJ('${EXAMPLE}') TOOBJ('${IFSMEMBER}')" CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" CLcommand "${CMD}" - MBRTEXT=`sed -e '1!d;/^ \*/!d;s/^ *\* *//' \ - -e 's/ *$//;s/'"'"'/&&/g' < "${EXAMPLE}"` + MBRTEXT=$(sed -e '1!d;/^ \*/!d;s/^ *\* *//' \ + -e 's/ *$//;s/'"'"'/&&/g' < "${EXAMPLE}") CMD="CHGPFM FILE(${TARGETLIB}/RPGXAMPLES) MBR(${MEMBER})" CMD="${CMD} SRCTYPE(RPGLE) TEXT('${MBRTEXT}')" CLcommand "${CMD}" @@ -117,7 +129,7 @@ fi # Build in each directory. -# for SUBDIR in include lib src tests -for SUBDIR in include lib src +# for SUBDIR in include lib docs src tests +for SUBDIR in include lib docs src do "${SCRIPTDIR}/make-${SUBDIR}.sh" done diff --git a/deps/curl/packages/OS400/os400sys.c b/deps/curl/packages/OS400/os400sys.c index 510c1c4e..07be5dcc 100644 --- a/deps/curl/packages/OS400/os400sys.c +++ b/deps/curl/packages/OS400/os400sys.c @@ -640,8 +640,8 @@ Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter, } if(status == LDAP_SUCCESS) - status = ldap_search_s(ld, ebase? ebase: "", scope, - efilter? efilter: "(objectclass=*)", + status = ldap_search_s(ld, ebase ? ebase : "", scope, + efilter ? efilter : "(objectclass=*)", eattrs, attrsonly, res); if(eattrs) { diff --git a/deps/curl/packages/vms/build_libcurl_pc.com b/deps/curl/packages/vms/build_libcurl_pc.com index 294ae084..de7db269 100644 --- a/deps/curl/packages/vms/build_libcurl_pc.com +++ b/deps/curl/packages/vms/build_libcurl_pc.com @@ -178,7 +178,7 @@ $ then $ write pco "Version: ''curl_version'" $ goto pc_file_loop $ endif -$ if f$locate("@LIBCURL_LIBS@", line_in) .lt line_in_len +$ if f$locate("@LIBCURL_PC_LIBS_PRIVATE@", line_in) .lt line_in_len $ then $ if arch_name .eqs. "VAX" $ then @@ -188,7 +188,7 @@ $ write pco "Libs.private: -lssl -lcrypto -lgssapi -lz" $ endif $ goto pc_file_loop $ endif -$ if f$locate("@CPPFLAG_CURL_STATICLIB@", line_in) .lt line_in_len +$ if f$locate("@LIBCURL_PC_CFLAGS@", line_in) .lt line_in_len $ then $ write pco "Cflags: -I${includedir} -DCURL_STATICLIB" $ goto pc_file_loop diff --git a/deps/curl/packages/vms/build_vms.com b/deps/curl/packages/vms/build_vms.com index 1b023649..d8f89f6e 100644 --- a/deps/curl/packages/vms/build_vms.com +++ b/deps/curl/packages/vms/build_vms.com @@ -20,10 +20,10 @@ $! $! 64 Compile with 64-bit pointers. $! Note, you must match the pointer size that the OpenSSL $! shared image expects. -$! Currently curl is not building properly with 64 bit pointers -$! on VMS because it is trying to cast pointers to 32 bit +$! Currently curl is not building properly with 64-bit pointers +$! on VMS because it is trying to cast pointers to 32-bit $! integers and some OpenVMS library routines called by curl -$! do not yet support 64 bit pointers. +$! do not yet support 64-bit pointers. $! CCQUAL=x Add "x" to the C compiler qualifiers. $! Default qualifiers are: $! /standard=relaxed @@ -638,21 +638,21 @@ $ libzshr_line = "" $ try_shr = "gnv$libzshr" $ if build_64 $ then -$! First look for 64 bit +$! First look for 64-bit $ if f$search("''try_shr'64") .eqs. "" $ then -$! Second look for the J.F. Pieronne 64 bit shared image +$! Second look for the J.F. Pieronne 64-bit shared image $ try_shr = "LIBZ_SHR64" $ if f$search(try_shr) .eqs. "" then nozlib = 1 $ endif $ else -$! First look for 32 bit +$! First look for 32-bit $ if f$search("''try_shr'32") .eqs. "" $ then -$! Second look for old 32 bit image +$! Second look for old 32-bit image $ if f$search(try_shr) .eqs. "" $ then -$! Third look for the J.F. Pieronne 32 bit shared image +$! Third look for the J.F. Pieronne 32-bit shared image $ try_shr = "LIBZ_SHR32" $ if f$search(try_shr) .eqs. "" then nozlib = 1 $ endif diff --git a/deps/curl/packages/vms/clean_gnv_curl.com b/deps/curl/packages/vms/clean_gnv_curl.com index 198c0deb..1a9a0eb7 100644 --- a/deps/curl/packages/vms/clean_gnv_curl.com +++ b/deps/curl/packages/vms/clean_gnv_curl.com @@ -179,9 +179,6 @@ $! $ file = "lcl_root:[.lib]libcurl.vers" $ if f$search(file) .nes. "" then delete 'file';* $! -$ file = "lcl_root:[.lib]libcurl.plist" -$ if f$search(file) .nes. "" then delete 'file';* -$! $ file = "lcl_root:[]ca-bundle.h" $ if f$search(file) .nes. "" then delete 'file';* $! diff --git a/deps/curl/packages/vms/compare_curl_source.com b/deps/curl/packages/vms/compare_curl_source.com index 3f7542de..13ff4667 100644 --- a/deps/curl/packages/vms/compare_curl_source.com +++ b/deps/curl/packages/vms/compare_curl_source.com @@ -17,9 +17,9 @@ $! $! First the files in the original source directory which is assumed to be $! under source code control are compared with the copy directory. $! -$! Then the files are are only in the copy directory are listed. +$! Only files present in the copy directory are listed. $! -$! The result will five diagnostics about of files: +$! Diagnostics are displayed about the files: $! 1. Files that are not generation 1. $! 2. Files missing in the copy directory. $! 3. Files in the copy directory not in the source directory. diff --git a/deps/curl/packages/vms/config_h.com b/deps/curl/packages/vms/config_h.com index 6378802a..8d231f4c 100644 --- a/deps/curl/packages/vms/config_h.com +++ b/deps/curl/packages/vms/config_h.com @@ -113,19 +113,19 @@ $else $ cfile = f$search("sys$disk:[]config.h.in") $ if cfile .eqs. "" $ then -$ cfile = f$search("sys$disk:[]config.h_in") -$ if cfile .eqs. "" -$ then -$ cfile = f$search("sys$disk:[]configh.in") -$ if cfile .eqs. "" -$ then -$ cfile = f$search("sys$disk:[]config__2eh.in") -$ if cfile .eqs. "" -$ then -$ cfile = f$search("sys$disk:[]config.h__2ein") -$ endif -$ endif -$ endif +$ cfile = f$search("sys$disk:[]config.h_in") +$ if cfile .eqs. "" +$ then +$ cfile = f$search("sys$disk:[]configh.in") +$ if cfile .eqs. "" +$ then +$ cfile = f$search("sys$disk:[]config__2eh.in") +$ if cfile .eqs. "" +$ then +$ cfile = f$search("sys$disk:[]config.h__2ein") +$ endif +$ endif +$ endif $ endif $endif $if f$trnlnm("PRJ_INCLUDE") .nes. "" @@ -133,19 +133,19 @@ $then $ cfile = f$search("PRJ_INCLUDE:config.h.in") $ if cfile .eqs. "" $ then -$ cfile = f$search("PRJ_INCLUDE:config.h_in") -$ if cfile .eqs. "" -$ then -$ cfile = f$search("PRJ_INCLUDE:config__2eh.in") -$ if cfile .eqs. "" -$ then -$ cfile = f$search("PRJ_INCLUDE:config__2eh.in") -$ if cfile .eqs. "" -$ then -$ cfile = f$search("PRJ_INCLUDE:config.h__2ein") -$ endif -$ endif -$ endif +$ cfile = f$search("PRJ_INCLUDE:config.h_in") +$ if cfile .eqs. "" +$ then +$ cfile = f$search("PRJ_INCLUDE:config__2eh.in") +$ if cfile .eqs. "" +$ then +$ cfile = f$search("PRJ_INCLUDE:config__2eh.in") +$ if cfile .eqs. "" +$ then +$ cfile = f$search("PRJ_INCLUDE:config.h__2ein") +$ endif +$ endif +$ endif $ endif $endif $if cfile .eqs. "" @@ -156,23 +156,23 @@ $ line_out = line_out + "config__2eh.in, config.h__2ein" $ write/symbol sys$output line_out $ if f$trnlnm("PRJ_INCLUDE") .nes. "" $ then -$ write sys$output "Also looked in PRJ_INCLUDE: for these files." +$ write sys$output "Also looked in PRJ_INCLUDE: for these files." $ endif $! $ write tf "" $ write tf - - " /* Could not find sys$disk:config.h.in */" + " /* Could not find sys$disk:config.h.in */" $ write tf - - " /* Looked also for config.h_in, configh.in, config__2eh.in, */" + " /* Looked also for config.h_in, configh.in, config__2eh.in, */" $ write tf - - " /* config.h__2ein */" + " /* config.h__2ein */" $ if f$trnlnm("PRJ_INCLUDE") .nes. "" $ then -$ write tf - - " /* Also looked in PRJ_INCLUDE: for these files. */" +$ write tf - + " /* Also looked in PRJ_INCLUDE: for these files. */" $ endif $ write tf - - "/*--------------------------------------------------------------*/ + "/*--------------------------------------------------------------*/ $ write tf "" $ goto write_tail $endif @@ -244,8 +244,8 @@ $! Blank line handling $!--------------------- $ if xline .eqs. "" $ then -$ write tf "" -$ goto cfgh_in_loop1 +$ write tf "" +$ goto cfgh_in_loop1 $ endif $ xlen = f$length(xline) $ key = f$extract(0,2,xline) @@ -254,11 +254,11 @@ $! deal with comments by copying exactly $!----------------------------------------- $ if (do_comment .eq. 1) .or. (key .eqs. "/*") $ then -$ do_comment = 1 -$ write tf line_in -$ key = f$extract(xlen - 2, 2, xline) -$ if key .eqs. "*/" then do_comment = 0 -$ goto cfgh_in_loop1 +$ do_comment = 1 +$ write tf line_in +$ key = f$extract(xlen - 2, 2, xline) +$ if key .eqs. "*/" then do_comment = 0 +$ goto cfgh_in_loop1 $ endif $! $! Some quick parsing @@ -281,33 +281,33 @@ $! Comment out this section of the ifblock $!----------------------------------------- $ if if_block .ge. 3 $ then -$ write tf "/* ", xline, " */" -$ if keyif .eqs. "#en" then if_block = 0 -$ goto cfgh_in_loop1 +$ write tf "/* ", xline, " */" +$ if keyif .eqs. "#en" then if_block = 0 +$ goto cfgh_in_loop1 $ endif $! $! Handle the end of an ifblock $!------------------------------- $ if keyif .eqs. "#en" $ then -$ write tf xline -$ if_block = 0 -$ goto cfgh_in_loop1 +$ write tf xline +$ if_block = 0 +$ goto cfgh_in_loop1 $ endif $! $ if key1 .eqs. "#ifndef" $ then -$! Manual check for _ALL_SOURCE on AIX error +$! Manual check for _ALL_SOURCE on AIX error $!----------------------------------------------- -$ if key2 .eqs. "_ALL_SOURCE" -$ then -$ write tf "/* ", xline, " */" +$ if key2 .eqs. "_ALL_SOURCE" +$ then +$ write tf "/* ", xline, " */" $! -$! Ignore the rest of the block +$! Ignore the rest of the block $!-------------------------------------- -$ if_block = 3 -$ goto cfgh_in_loop1 -$ endif +$ if_block = 3 +$ goto cfgh_in_loop1 +$ endif $ endif $! $! @@ -315,9 +315,9 @@ $! Default action for an #if/#else/#endif $!------------------------------------------ $ if keyif .eqs. "#if" .or. keyif .eqs. "#el" $ then -$ if_block = 1 -$ write tf xline -$ goto cfgh_in_loop1 +$ if_block = 1 +$ write tf xline +$ goto cfgh_in_loop1 $ endif $! $! @@ -325,1514 +325,1514 @@ $! Process "normal?" stuff $!--------------------------- $ if key1 .eqs. "#undef" $ then -$ key2c = f$element(2, "_", key2) -$ if (key2c .eqs. "_") .or. (key2c .eqs. "H") then key2c = "" -$ key2d = f$element(3, "_", key2) -$ if (key2d .eqs. "_") .or. (key2d .eqs. "H") then key2d = "" -$ key2e = f$element(4, "_", key2) -$ if (key2e .eqs. "_") .or. (key2e .eqs. "H") then key2e = "" -$ if key2d .eqs. "T" -$ then -$ if key2e .eqs. "TYPE" -$ then -$ key2_h = "_T" -$ key2d = "" -$ endif -$ endif +$ key2c = f$element(2, "_", key2) +$ if (key2c .eqs. "_") .or. (key2c .eqs. "H") then key2c = "" +$ key2d = f$element(3, "_", key2) +$ if (key2d .eqs. "_") .or. (key2d .eqs. "H") then key2d = "" +$ key2e = f$element(4, "_", key2) +$ if (key2e .eqs. "_") .or. (key2e .eqs. "H") then key2e = "" +$ if key2d .eqs. "T" +$ then +$ if key2e .eqs. "TYPE" +$ then +$ key2_h = "_T" +$ key2d = "" +$ endif +$ endif $! -$ double_under = 0 +$ double_under = 0 $! -$! Process FCNTL directives +$! Process FCNTL directives $!------------------------------------- -$ if (key2b .eqs. "FCNTL") .and. (key2c .eqs. "O") .and. - - (key2d .eqs. "NONBLOCK") -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if (key2b .eqs. "FCNTL") .and. (key2c .eqs. "O") .and. - + (key2d .eqs. "NONBLOCK") +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Process GETADDRINFO directives +$! Process GETADDRINFO directives $!------------------------------------- -$ if key2 .eqs. "GETADDRINFO_THREADSAFE" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "GETADDRINFO_THREADSAFE" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Process IOCTL directives +$! Process IOCTL directives $!------------------------------------- -$ if (key2b .eqs. "IOCTL") .and. (key2c .nes. "") -$ then -$ if (key2c .eqs. "FIONBIO") .or. (key2c .eqs. "SIOCGIFADDR") -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ endif +$ if (key2b .eqs. "IOCTL") .and. (key2c .nes. "") +$ then +$ if (key2c .eqs. "FIONBIO") .or. (key2c .eqs. "SIOCGIFADDR") +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ endif $! $! -$! Manual check for LL on +$! Manual check for LL on $!----------------------------------------------- -$ if key2 .eqs. "LL" -$ then -$ write tf "#ifndef __VAX -$ write tf "#define HAVE_''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "LL" +$ then +$ write tf "#ifndef __VAX +$ write tf "#define HAVE_''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "bool_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' short" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "bool_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' short" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "bits16_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' short" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "bits16_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' short" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "u_bits16_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' unsigned short" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "u_bits16_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' unsigned short" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "bits32_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "bits32_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "u_bits32_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' unsigned int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "u_bits32_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' unsigned int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "intmax_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#ifdef __VAX" -$ write tf "#define ''key2' long" -$ write tf "#else" -$ write tf "#define ''key2' long long" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "intmax_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#ifdef __VAX" +$ write tf "#define ''key2' long" +$ write tf "#else" +$ write tf "#define ''key2' long long" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "uintmax_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#ifdef __VAX" -$ write tf "#define ''key2' unsigned long" -$ write tf "#else" -$ write tf "#define ''key2' unsigned long long" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "uintmax_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#ifdef __VAX" +$ write tf "#define ''key2' unsigned long" +$ write tf "#else" +$ write tf "#define ''key2' unsigned long long" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "socklen_t" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "socklen_t" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "GETGROUPS_T" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' gid_t" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "GETGROUPS_T" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' gid_t" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_SYS_SIGLIST" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 0" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_SYS_SIGLIST" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 0" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_SYS_ERRLIST" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_SYS_ERRLIST" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_STRUCT_DIRENT_D_INO" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_STRUCT_DIRENT_D_INO" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_STRUCT_TIMEVAL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_STRUCT_TIMEVAL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! ! The header files have this information, however +$! ! The header files have this information, however $! ! The ioctl() call only works on sockets. -$! if key2 .eqs. "FIONREAD_IN_SYS_IOCTL" -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ''key2' 1" -$! write tf "#endif" -$! goto cfgh_in_loop1 -$! endif +$! if key2 .eqs. "FIONREAD_IN_SYS_IOCTL" +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ''key2' 1" +$! write tf "#endif" +$! goto cfgh_in_loop1 +$! endif $! -$! ! The header files have this information, however +$! ! The header files have this information, however $! ! The ioctl() call only works on sockets. -$! if key2 .eqs. "GWINSZ_IN_SYS_IOCTL" -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ''key2' 1" -$! write tf "#endif" -$! goto cfgh_in_loop1 -$! endif +$! if key2 .eqs. "GWINSZ_IN_SYS_IOCTL" +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ''key2' 1" +$! write tf "#endif" +$! goto cfgh_in_loop1 +$! endif $! -$! ! The header files have this information, however +$! ! The header files have this information, however $! ! The ioctl() call only works on sockets. -$! if key2 .eqs. "STRUCT_WINSIZE_IN_SYS_IOCTL" -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ''key2' 0" -$! write tf "#endif" -$! goto cfgh_in_loop1 -$! endif +$! if key2 .eqs. "STRUCT_WINSIZE_IN_SYS_IOCTL" +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ''key2' 0" +$! write tf "#endif" +$! goto cfgh_in_loop1 +$! endif $! -$ if key2 .eqs. "HAVE_STRUCT_TM_TM_ZONE" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_STRUCT_TM_TM_ZONE" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_TM_ZONE" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_TM_ZONE" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_TIMEVAL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_TIMEVAL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "WEXITSTATUS_OFFSET" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 2" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "WEXITSTATUS_OFFSET" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 2" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_GETPW_DECLS" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_GETPW_DECLS" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_CONFSTR" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_CONFSTR" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_PRINTF" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_PRINTF" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_SBRK" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_SBRK" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRSIGNAL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 0" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRSIGNAL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 0" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2a .eqs. "HAVE_DECL_STRTOLD" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 0" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2a .eqs. "HAVE_DECL_STRTOLD" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 0" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRTOIMAX" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 0" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRTOIMAX" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 0" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRTOL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRTOL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRTOLL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRTOLL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRTOUL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRTOUL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRTOULL" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRTOULL" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_STRTOUMAX" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 0" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_STRTOUMAX" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 0" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "GETPGRP_VOID" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "GETPGRP_VOID" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "NAMED_PIPES_MISSING" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "NAMED_PIPES_MISSING" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "OPENDIR_NOT_ROBUST" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "OPENDIR_NOT_ROBUST" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "PGRP_PIPE" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "PGRP_PIPE" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "CAN_REDEFINE_GETENV" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "CAN_REDEFINE_GETENV" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_PRINTF_A_FORMAT" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_PRINTF_A_FORMAT" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "CTYPE_NON_ASCII" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "CTYPE_NON_ASCII" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_LANGINFO_CODESET" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 0" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_LANGINFO_CODESET" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 0" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! $! This wants execve() to do this automagically to pass. -$! if key2 .eqs. "HAVE_HASH_BANG_EXEC" -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ''key2' 1" -$! write tf "#endif" -$! goto cfgh_in_loop1 -$! endif +$! if key2 .eqs. "HAVE_HASH_BANG_EXEC" +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ''key2' 1" +$! write tf "#endif" +$! goto cfgh_in_loop1 +$! endif $! -$ if key2 .eqs. "ICONV_CONST" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2'" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "ICONV_CONST" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2'" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "VOID_SIGHANDLER" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "VOID_SIGHANDLER" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_POSIX_SIGNALS" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_POSIX_SIGNALS" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "UNUSABLE_RT_SIGNALS" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "UNUSABLE_RT_SIGNALS" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2a .eqs. "HAVE_DECL_FPURGE" -$ then -$ write tf "#ifndef ''key2a'" -$ write tf "#define ''key2a' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2a .eqs. "HAVE_DECL_FPURGE" +$ then +$ write tf "#ifndef ''key2a'" +$ write tf "#define ''key2a' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_DECL_SETREGID" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_DECL_SETREGID" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "HAVE_POSIX_SIGSETJMP" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "HAVE_POSIX_SIGSETJMP" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2b .eqs. "RAND" .and. key2c .nes. "" .and. key2d .eqs. "" -$ then -$ if (key2c .eqs. "EGD") .or. - - (key2c .eqs. "STATUS") .or. - - (key2c .eqs. "SCREEN") -$ then -$ if f$search("''ssl_header_dir'rand.h") .nes. "" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ else -$ write tf "/* #undef ''key2' */" -$ endif -$ endif -$ endif +$ if key2b .eqs. "RAND" .and. key2c .nes. "" .and. key2d .eqs. "" +$ then +$ if (key2c .eqs. "EGD") .or. - + (key2c .eqs. "STATUS") .or. - + (key2c .eqs. "SCREEN") +$ then +$ if f$search("''ssl_header_dir'rand.h") .nes. "" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ else +$ write tf "/* #undef ''key2' */" +$ endif +$ endif +$ endif $! -$ if key2 .eqs. "STRCOLL_BROKEN" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "STRCOLL_BROKEN" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2 .eqs. "DUP_BROKEN" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "DUP_BROKEN" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! This is for a test that getcwd(0,0) works. -$! It does not on VMS. +$! This is for a test that getcwd(0,0) works. +$! It does not on VMS. $!-------------------------- -$ if key2 .eqs. "GETCWD_BROKEN" -$ then -$ write sys$output "" -$ write sys$output - +$ if key2 .eqs. "GETCWD_BROKEN" +$ then +$ write sys$output "" +$ write sys$output - "%CONFIG_H-I-NONPORT, ''key2' being tested for!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-GETCWD, GETCWD(0,0) does not work on VMS." -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-GETCWD2, Work around hack probably required." -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-REVIEW, Manual Code review required!" -$ if update_config_vms -$ then -$ open/append tfcv sys$disk:[]config_vms.h -$ write tfcv "" -$ write tfcv - - "/* Check config.h for use of ''key2' settings */" -$ write tfcv "" -$ close tfcv -$ endif +$ if update_config_vms +$ then +$ open/append tfcv sys$disk:[]config_vms.h +$ write tfcv "" +$ write tfcv - + "/* Check config.h for use of ''key2' settings */" +$ write tfcv "" +$ close tfcv +$ endif $ -$ goto cfgh_in_loop1 -$ endif +$ goto cfgh_in_loop1 +$ endif $! -$ if (key2a .eqs. "HAVE") .or. (key2a .eqs. "STAT") .or. - - (key2 .eqs. "ENABLE_IPV6") .or. (key2b .eqs. "LDAP") -$ then +$ if (key2a .eqs. "HAVE") .or. (key2a .eqs. "STAT") .or. - + (key2 .eqs. "USE_IPV6") .or. (key2b .eqs. "LDAP") +$ then $! -$! Process extra underscores +$! Process extra underscores $!------------------------------------ -$ if f$locate("HAVE___", key2) .lt. key2_len -$ then -$ key2b = "__" + key2d -$ key2d = "" -$ double_under = 1 -$ else -$ if f$locate("HAVE__", key2) .lt. key2_len -$ then -$ key2b = "_" + key2c -$ key2c = "" -$ double_under = 1 -$ endif -$ endif +$ if f$locate("HAVE___", key2) .lt. key2_len +$ then +$ key2b = "__" + key2d +$ key2d = "" +$ double_under = 1 +$ else +$ if f$locate("HAVE__", key2) .lt. key2_len +$ then +$ key2b = "_" + key2c +$ key2c = "" +$ double_under = 1 +$ endif +$ endif $! -$ if (key2_h .eqs. "_H") .or. (key2 .eqs. "ENABLE_IPV6") .or. - - (key2b .eqs. "LDAP") -$ then +$ if (key2_h .eqs. "_H") .or. (key2 .eqs. "USE_IPV6") .or. - + (key2b .eqs. "LDAP") +$ then $! -$! Looking for a header file +$! Looking for a header file $!--------------------------------------- -$ headf = key2b -$ if key2c .nes. "" then headf = headf + "_" + key2c -$ if key2d .nes. "" then headf = headf + "_" + key2d +$ headf = key2b +$ if key2c .nes. "" then headf = headf + "_" + key2c +$ if key2d .nes. "" then headf = headf + "_" + key2d $! -$! (key2b .eqs. "READLINE") +$! (key2b .eqs. "READLINE") $! -$! Some special parsing +$! Some special parsing $!------------------------------------------ -$ if (key2b .eqs. "SYS") .or. (key2b .eqs. "ARPA") .or. - - (key2b .eqs. "NET") .or. (key2b .eqs. "NETINET") -$ then -$ if key2c .nes. "" -$ then -$ headf = key2c -$ if key2d .nes. "" then headf = key2c + "_" + key2d -$ endif -$ endif +$ if (key2b .eqs. "SYS") .or. (key2b .eqs. "ARPA") .or. - + (key2b .eqs. "NET") .or. (key2b .eqs. "NETINET") +$ then +$ if key2c .nes. "" +$ then +$ headf = key2c +$ if key2d .nes. "" then headf = key2c + "_" + key2d +$ endif +$ endif $! -$! And of course what's life with out some special cases +$! And of course what's life with out some special cases $!-------------------------------------------------------------------- -$ if key2 .eqs. "ENABLE_IPV6" -$ then -$ headf = "in6" -$ endif +$ if key2 .eqs. "USE_IPV6" +$ then +$ headf = "in6" +$ endif $! -$ if key2b .eqs. "LDAP" -$ then -$ if (key2 .eqs. "HAVE_LDAP_SSL") .or. - - (key2 .eqs. "HAVE_LDAP_URL_PARSE") -$ then -$ headf = "ldap" -$ endif -$ endif +$ if key2b .eqs. "LDAP" +$ then +$ if (key2 .eqs. "HAVE_LDAP_SSL") .or. - + (key2 .eqs. "HAVE_LDAP_URL_PARSE") +$ then +$ headf = "ldap" +$ endif +$ endif $! $! -$ if key2b .eqs. "FILE" -$ then -$ write sys$output "" -$ write sys$output - +$ if key2b .eqs. "FILE" +$ then +$ write sys$output "" +$ write sys$output - "%CONFIG_H-I-NONPORT, ''key2' being asked for!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-FILE_OLD, file.h will not be configured as is obsolete!" -$ write sys$output - +$ write sys$output - "-CONFIG_H_I-FCNTL_NEW, "Expecting fcntl.h to be configured instead!" -$ write sys$output - +$ write sys$output - "-CONFIG_H_I-FCNTL_CHK, "Unable to verify at this time!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-REVIEW, Manual Code review required!" $! -$ if update_config_vms -$ then -$ open/append tfcv sys$disk:[]config_vms.h -$ write tfcv "" -$ write tfcv - - "/* Check config.h for use of fcntl.h instead of file.h */" -$ write tfcv "" -$ close tfcv -$ endif -$ endif +$ if update_config_vms +$ then +$ open/append tfcv sys$disk:[]config_vms.h +$ write tfcv "" +$ write tfcv - + "/* Check config.h for use of fcntl.h instead of file.h */" +$ write tfcv "" +$ close tfcv +$ endif +$ endif $! -$! Now look it up in the DEC C RTL +$! Now look it up in the DEC C RTL $!--------------------------------------------- -$ define/user sys$output nl: -$ define/user sys$error nl: -$ search/output=nl: 'dchfile' |'headf'|/exact -$ if '$severity' .eq. 1 -$ then -$ if key64 then write tf "#ifndef __VAX" -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" +$ define/user sys$output nl: +$ define/user sys$error nl: +$ search/output=nl: 'dchfile' |'headf'|/exact +$ if '$severity' .eq. 1 +$ then +$ if key64 then write tf "#ifndef __VAX" +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" $if p2 .nes. "" then write sys$output "''dchfile' - #define ''key2' 1" -$ write tf "#endif" -$ if key64 then write tf "#endif" +$ write tf "#endif" +$ if key64 then write tf "#endif" $set nover -$ goto cfgh_in_loop1 -$ endif +$ goto cfgh_in_loop1 +$ endif $! $! -$! Now look it up in the DEC C STARLET_C +$! Now look it up in the DEC C STARLET_C $!--------------------------------------------- -$ define/user sys$output nl: -$ define/user sys$error nl: -$ search/output=nl: 'starhfile' |'headf'|/exact -$ if '$severity' .eq. 1 -$ then -$ if key64 then write tf "#ifndef __VAX" -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" +$ define/user sys$output nl: +$ define/user sys$error nl: +$ search/output=nl: 'starhfile' |'headf'|/exact +$ if '$severity' .eq. 1 +$ then +$ if key64 then write tf "#ifndef __VAX" +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" $if p2 .nes. "" then write sys$output "''starfile' - #define ''key2' 1" -$ write tf "#endif" -$ if key64 then write tf "#endif" +$ write tf "#endif" +$ if key64 then write tf "#endif" $set nover -$ goto cfgh_in_loop1 -$ endif +$ goto cfgh_in_loop1 +$ endif $! -$! Now look for OPENSSL headers +$! Now look for OPENSSL headers $!--------------------------------------------------------- -$ if key2b .eqs. "OPENSSL" -$ then -$ headf = headf - "OPENSSL_" -$ header = f$search("''ssl_header_dir'''headf'.h") -$ if header .nes. "" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" +$ if key2b .eqs. "OPENSSL" +$ then +$ headf = headf - "OPENSSL_" +$ header = f$search("''ssl_header_dir'''headf'.h") +$ if header .nes. "" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" $set nover -$ goto cfgh_in_loop1 -$ endif -$ endif +$ goto cfgh_in_loop1 +$ endif +$ endif $! -$! Now look for Kerberos +$! Now look for Kerberos $!------------------------------------------------------------ -$ if key2b .eqs. "GSSAPI" -$ then -$ header_dir = "sys$sysroot:[kerberos.include]" -$ headf = headf - "GSSAPI_" -$ header = f$search("''header_dir'''headf'.h") -$ if header .nes. "" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" +$ if key2b .eqs. "GSSAPI" +$ then +$ header_dir = "sys$sysroot:[kerberos.include]" +$ headf = headf - "GSSAPI_" +$ header = f$search("''header_dir'''headf'.h") +$ if header .nes. "" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" $set nover -$ goto cfgh_in_loop1 -$ endif -$ endif +$ goto cfgh_in_loop1 +$ endif +$ endif $! $set nover -$ else +$ else $! -$! Looking for a routine or a symbol +$! Looking for a routine or a symbol $!------------------------------------------------ -$ if key2c .eqs. "MACRO" -$ then -$ if (key2b .eqs. "FILE") .or. (key2b .eqs. "DATE") - - .or. (key2b .eqs. "LINE") .or. (key2b .eqs. "TIME") -$ then -$ write tf "#ifndef HAVE_''key2b'" -$ write tf "#define HAVE_''key2b' 1" -$ write tf "#endif" -$ endif -$ goto cfgh_in_loop1 -$ endif +$ if key2c .eqs. "MACRO" +$ then +$ if (key2b .eqs. "FILE") .or. (key2b .eqs. "DATE") - + .or. (key2b .eqs. "LINE") .or. (key2b .eqs. "TIME") +$ then +$ write tf "#ifndef HAVE_''key2b'" +$ write tf "#define HAVE_''key2b' 1" +$ write tf "#endif" +$ endif +$ goto cfgh_in_loop1 +$ endif $! -$! Special false tests +$! Special false tests $!------------------------------------- -$ if double_under -$ then -$ if key2b .eqs. "_FCNTL" .or. key2b .eqs. "__FCNTL" -$ then -$ write tf "/* #undef HAVE_''key2b' */" -$ goto cfgh_in_loop1 -$ endif +$ if double_under +$ then +$ if key2b .eqs. "_FCNTL" .or. key2b .eqs. "__FCNTL" +$ then +$ write tf "/* #undef HAVE_''key2b' */" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2b .eqs. "_STAT" .or. key2b .eqs. "__STAT" -$ then -$ write tf "/* #undef HAVE_''key2b' */" -$ goto cfgh_in_loop1 -$ endif +$ if key2b .eqs. "_STAT" .or. key2b .eqs. "__STAT" +$ then +$ write tf "/* #undef HAVE_''key2b' */" +$ goto cfgh_in_loop1 +$ endif $! -$ if key2b .eqs. "_READ" .or. key2b .eqs. "__READ" -$ then -$ write tf "/* #undef HAVE_''key2b' */" -$ goto cfgh_in_loop1 -$ endif -$ endif +$ if key2b .eqs. "_READ" .or. key2b .eqs. "__READ" +$ then +$ write tf "/* #undef HAVE_''key2b' */" +$ goto cfgh_in_loop1 +$ endif +$ endif $! -$ keysym = key2b -$ if key2c .nes. "" then keysym = keysym + "_" + key2c -$ if key2d .nes. "" then keysym = keysym + "_" + key2d -$ if key2e .nes. "" then keysym = keysym + "_" + key2e +$ keysym = key2b +$ if key2c .nes. "" then keysym = keysym + "_" + key2c +$ if key2d .nes. "" then keysym = keysym + "_" + key2d +$ if key2e .nes. "" then keysym = keysym + "_" + key2e $! $! -$! Stat structure members +$! Stat structure members $!------------------------------------- -$ if key2b .eqs. "STRUCT" -$ then -$ if key2c .eqs. "STAT" .and (key2d .nes. "") -$ then -$ key2b = key2b + "_" + key2c + "_" + key2d -$ key2c = key2e -$ key2d = "" -$ key2e = "" -$ endif -$ endif -$ if (key2b .eqs. "ST") .or. (key2b .eqs. "STRUCT_STAT_ST") -$ then -$ keysym = "ST" + "_" + key2c -$ keysym = f$edit(keysym,"LOWERCASE") -$ endif -$ if key2a .eqs. "STAT" -$ then -$ if (f$locate("STATVFS", key2b) .eq. 0) .and. key2c .eqs. "" -$ then -$ keysym = f$edit(key2b, "LOWERCASE") -$ endif -$!$ if (key2b .eqs. "STATVFS" .or. key2b .eqs. "STATFS2" - -$! .or. key2b .eqs. "STATFS3") .and. key2c .nes. "" +$ if key2b .eqs. "STRUCT" +$ then +$ if key2c .eqs. "STAT" .and (key2d .nes. "") +$ then +$ key2b = key2b + "_" + key2c + "_" + key2d +$ key2c = key2e +$ key2d = "" +$ key2e = "" +$ endif +$ endif +$ if (key2b .eqs. "ST") .or. (key2b .eqs. "STRUCT_STAT_ST") +$ then +$ keysym = "ST" + "_" + key2c +$ keysym = f$edit(keysym,"LOWERCASE") +$ endif +$ if key2a .eqs. "STAT" +$ then +$ if (f$locate("STATVFS", key2b) .eq. 0) .and. key2c .eqs. "" +$ then +$ keysym = f$edit(key2b, "LOWERCASE") +$ endif +$!$ if (key2b .eqs. "STATVFS" .or. key2b .eqs. "STATFS2" - +$! .or. key2b .eqs. "STATFS3") .and. key2c .nes. "" $! -$ if (key2b .eqs. "STATVFS") .and. key2c .nes. "" -$ then -$! Should really verify that the structure -$! named by key2b actually exists first. +$ if (key2b .eqs. "STATVFS") .and. key2c .nes. "" +$ then +$! Should really verify that the structure +$! named by key2b actually exists first. $!------------------------------------------------------------ $! -$! Statvfs structure members +$! Statvfs structure members $!------------------------------------------------- -$ keysym = "f_" + f$edit(key2c,"LOWERCASE") -$ endif -$ endif +$ keysym = "f_" + f$edit(key2c,"LOWERCASE") +$ endif +$ endif $! -$! UTMPX structure members +$! UTMPX structure members $!-------------------------------------- -$ if key2b .eqs. "UT" .and. key2c .eqs. "UT" -$ then -$ keysym = "ut_" + f$edit(key2d,"LOWERCASE") -$ endif +$ if key2b .eqs. "UT" .and. key2c .eqs. "UT" +$ then +$ keysym = "ut_" + f$edit(key2d,"LOWERCASE") +$ endif $! -$ if f$locate("MMAP",key2) .lt. key2_len -$ then -$ write sys$output "" -$ write sys$output - +$ if f$locate("MMAP",key2) .lt. key2_len +$ then +$ write sys$output "" +$ write sys$output - "%CONFIG_H-I-NONPORT, ''key2' being asked for!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-MMAP, MMAP operations only work on STREAM and BINARY files!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-REVIEW, Manual Code review required!" -$ if update_config_vms -$ then -$ open/append tfcv sys$disk:[]config_vms.h -$ write tfcv "" -$ write tfcv - - "/* Check config.h for use of ''key2' settings */" -$ write tfcv "" -$ close tfcv -$ endif -$ endif +$ if update_config_vms +$ then +$ open/append tfcv sys$disk:[]config_vms.h +$ write tfcv "" +$ write tfcv - + "/* Check config.h for use of ''key2' settings */" +$ write tfcv "" +$ close tfcv +$ endif +$ endif $! $! -$ if keysym .eqs. "CRYPT" -$ then -$ write sys$output "" -$ write sys$output - +$ if keysym .eqs. "CRYPT" +$ then +$ write sys$output "" +$ write sys$output - "%CONFIG_H-I-NONPORT, ''key2' being asked for!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-CRYPT, CRYPT operations on the VMS SYSUAF may not work!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-REVIEW, Manual Code review required!" -$ if update_config_vms -$ then -$ open/append tfcv sys$disk:[]config_vms.h -$ write tfcv "" -$ write tfcv - - "/* Check config.h for use of ''keysym' */" -$ write tfcv "" -$ close tfcv -$ endif -$ endif +$ if update_config_vms +$ then +$ open/append tfcv sys$disk:[]config_vms.h +$ write tfcv "" +$ write tfcv - + "/* Check config.h for use of ''keysym' */" +$ write tfcv "" +$ close tfcv +$ endif +$ endif $! $! -$ if keysym .eqs. "EXECL" -$ then -$ write sys$output "" -$ write sys$output - +$ if keysym .eqs. "EXECL" +$ then +$ write sys$output "" +$ write sys$output - "%CONFIG_H-I-NONPORT, ''key2' being asked for!" -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-EXCEL, EXECL configured, Will probably not work." -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-REVIEW, Manual Code review required!" -$ if update_config_vms -$ then -$ open/append tfcv sys$disk:[]config_vms.h -$ write tfcv "" -$ write tfcv - - "/* Check config.h for use of ''keysym' */" -$ write tfcv "" -$ close tfcv -$ endif -$ endif +$ if update_config_vms +$ then +$ open/append tfcv sys$disk:[]config_vms.h +$ write tfcv "" +$ write tfcv - + "/* Check config.h for use of ''keysym' */" +$ write tfcv "" +$ close tfcv +$ endif +$ endif $! $! -$! Process if cpp supports ANSI-C stringizing '#' operator +$! Process if cpp supports ANSI-C stringizing '#' operator $!----------------------------------------------------------------------- -$ if keysym .eqs. "STRINGIZE" -$ then -$ write tf "#ifndef HAVE_STRINGIZE" -$ write tf "#define HAVE_STRINGSIZE 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "STRINGIZE" +$ then +$ write tf "#ifndef HAVE_STRINGIZE" +$ write tf "#define HAVE_STRINGSIZE 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if keysym .eqs. "VOLATILE" -$ then -$ write tf "#ifndef HAVE_VOLATILE" -$ write tf "#define HAVE_VOLATILE 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "VOLATILE" +$ then +$ write tf "#ifndef HAVE_VOLATILE" +$ write tf "#define HAVE_VOLATILE 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if keysym .eqs. "ALLOCA" -$ then -$ write tf "#ifndef HAVE_ALLOCA" -$ write tf "#define HAVE_ALLOCA 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "ALLOCA" +$ then +$ write tf "#ifndef HAVE_ALLOCA" +$ write tf "#define HAVE_ALLOCA 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if keysym .eqs. "ERRNO_DECL" -$ then -$ write tf "#ifndef HAVE_ERRNO_DECL" -$ write tf "#define HAVE_ERRNO_DECL 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "ERRNO_DECL" +$ then +$ write tf "#ifndef HAVE_ERRNO_DECL" +$ write tf "#define HAVE_ERRNO_DECL 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if keysym .eqs. "LONGLONG" -$ then -$ write tf "#ifndef __VAX" -$ write tf "#pragma message disable longlongtype" -$ write tf "#ifndef HAVE_LONGLONG" -$ write tf "#define HAVE_LONGLONG 1" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "LONGLONG" +$ then +$ write tf "#ifndef __VAX" +$ write tf "#pragma message disable longlongtype" +$ write tf "#ifndef HAVE_LONGLONG" +$ write tf "#define HAVE_LONGLONG 1" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! May need to test compiler version +$! May need to test compiler version $!----------------------------------------------- -$ if keysym .eqs. "LONG_LONG" -$ then -$ write tf "#ifndef __VAX" -$ write tf "#pragma message disable longlongtype" -$ write tf "#ifndef HAVE_LONG_LONG" -$ write tf "#define HAVE_LONG_LONG 1" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "LONG_LONG" +$ then +$ write tf "#ifndef __VAX" +$ write tf "#pragma message disable longlongtype" +$ write tf "#ifndef HAVE_LONG_LONG" +$ write tf "#define HAVE_LONG_LONG 1" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! May need to test compiler version +$! May need to test compiler version $!----------------------------------------------- -$ if keysym .eqs. "UNSIGNED_LONG_LONG" -$ then -$ write tf "#ifndef __VAX" -$ write tf "#pragma message disable longlongtype" -$ write tf "#ifndef HAVE_UNSIGNED_LONG_LONG" -$ write tf "#define HAVE_UNSIGNED_LONG_LONG 1" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "UNSIGNED_LONG_LONG" +$ then +$ write tf "#ifndef __VAX" +$ write tf "#pragma message disable longlongtype" +$ write tf "#ifndef HAVE_UNSIGNED_LONG_LONG" +$ write tf "#define HAVE_UNSIGNED_LONG_LONG 1" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! May need to test compiler version +$! May need to test compiler version $!----------------------------------------------- -$ if keysym .eqs. "UNSIGNED_LONG_LONG_INT" -$ then -$ write tf "#ifndef __VAX" -$ write tf "#pragma message disable longlongtype" -$ write tf "#ifndef HAVE_UNSIGNED_LONG_LONG_INT" -$ write tf "#define HAVE_UNSIGNED_LONG_LONG_INT 1" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "UNSIGNED_LONG_LONG_INT" +$ then +$ write tf "#ifndef __VAX" +$ write tf "#pragma message disable longlongtype" +$ write tf "#ifndef HAVE_UNSIGNED_LONG_LONG_INT" +$ write tf "#define HAVE_UNSIGNED_LONG_LONG_INT 1" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! May need to test compiler version +$! May need to test compiler version $!----------------------------------------------- -$ if keysym .eqs. "LONG_DOUBLE" -$ then -$ write tf "#ifndef __VAX" -$ write tf "#pragma message disable longlongtype" -$ write tf "#ifndef HAVE_LONG_DOUBLE" -$ write tf "#define HAVE_LONG_DOUBLE 1" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if keysym .eqs. "LONG_DOUBLE" +$ then +$ write tf "#ifndef __VAX" +$ write tf "#pragma message disable longlongtype" +$ write tf "#ifndef HAVE_LONG_DOUBLE" +$ write tf "#define HAVE_LONG_DOUBLE 1" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$ if keysym .eqs. "FCNTL_LOCK" -$ then -$ write sys$output - +$ if keysym .eqs. "FCNTL_LOCK" +$ then +$ write sys$output - "%CONFIG_H-I-NONPORT, ''key2' being asked for! -$ write sys$output - +$ write sys$output - "-CONFIG_H-I-REVIEW, Manual Code review required!" -$ goto cfgh_in_loop1 -$ endif +$ goto cfgh_in_loop1 +$ endif $! $! -$! These libraries are provided by the DEC C RTL +$! These libraries are provided by the DEC C RTL $!------------------------------------------------------------- -$ if keysym .eqs. "LIBINET" .or. keysym .eqs. "LIBSOCKET" -$ then -$ write tf "#ifndef HAVE_''keysym'" -$ write tf "#define HAVE_''keysym' 1" +$ if keysym .eqs. "LIBINET" .or. keysym .eqs. "LIBSOCKET" +$ then +$ write tf "#ifndef HAVE_''keysym'" +$ write tf "#define HAVE_''keysym' 1" $if p2 .nes. "" then write sys$output "''decc_shr' #define ''keysym' 1" -$ write tf "#endif -$ goto cfgh_in_loop1 -$ endif +$ write tf "#endif +$ goto cfgh_in_loop1 +$ endif $! -$ if keysym .eqs. "HERRNO" then keysym = "h_errno" -$ if keysym .eqs. "UTIMBUF" then keysym = "utimbuf" -$ if key2c .eqs. "STRUCT" -$ then -$ keysym = f$edit(key2d,"LOWERCASE") -$ else -$ if key2_h .eqs. "_T" -$ then -$ if key2_t .eqs. "_TYPE" -$ then -$ keysym = f$extract(0, key2_len - 5, key2) - "HAVE_" -$ endif -$ keysym = f$edit(keysym,"LOWERCASE") -$ endif -$ endif +$ if keysym .eqs. "HERRNO" then keysym = "h_errno" +$ if keysym .eqs. "UTIMBUF" then keysym = "utimbuf" +$ if key2c .eqs. "STRUCT" +$ then +$ keysym = f$edit(key2d,"LOWERCASE") +$ else +$ if key2_h .eqs. "_T" +$ then +$ if key2_t .eqs. "_TYPE" +$ then +$ keysym = f$extract(0, key2_len - 5, key2) - "HAVE_" +$ endif +$ keysym = f$edit(keysym,"LOWERCASE") +$ endif +$ endif $! -$! Check the DEC C RTL shared image first +$! Check the DEC C RTL shared image first $!------------------------------------------------------ -$ if f$search(tfile1) .nes. "" then delete 'tfile1';* -$ define/user sys$output nl: -$ define/user sys$error nl: -$ search/format=nonull/out='tfile1' 'decc_shr' 'keysym' -$ if '$severity' .eq. 1 -$ then +$ if f$search(tfile1) .nes. "" then delete 'tfile1';* +$ define/user sys$output nl: +$ define/user sys$error nl: +$ search/format=nonull/out='tfile1' 'decc_shr' 'keysym' +$ if '$severity' .eq. 1 +$ then $! -$! Not documented, but from observation +$! Not documented, but from observation $!------------------------------------------------------ -$ define/user sys$output nl: -$ define/user sys$error nl: -$ if arch_type .eq. 3 -$ then -$ keyterm = "''keysym'" -$ else -$ if arch_type .eq. 2 -$ then -$ keyterm = "''keysym'" -$ else -$ keyterm = "''keysym'" -$ endif -$ endif -$ search/out=nl: 'tfile1' - +$ define/user sys$output nl: +$ define/user sys$error nl: +$ if arch_type .eq. 3 +$ then +$ keyterm = "''keysym'" +$ else +$ if arch_type .eq. 2 +$ then +$ keyterm = "''keysym'" +$ else +$ keyterm = "''keysym'" +$ endif +$ endif +$ search/out=nl: 'tfile1' - "$''keyterm'","$g''keyterm'","$__utc_''keyterm'",- "$__utctz_''keyterm'","$__bsd44_''keyterm'","$bsd_''keyterm'",- "$''keysym'decc$","$G''keysym'decc$","$GX''keyterm'" -$ severity = '$severity' +$ severity = '$severity' $! $! -$! Of course the 64 bit stuff is different +$! Of course the 64-bit stuff is different $!--------------------------------------------------------- -$ if severity .ne. 1 .and. key64 -$ then -$ define/user sys$output nl: -$ define/user sys$error nl: -$ search/out=nl: 'tfile1' "$_''keyterm'" -$! search/out 'tfile1' "$_''keyterm'" -$ severity = '$severity' -$ endif +$ if severity .ne. 1 .and. key64 +$ then +$ define/user sys$output nl: +$ define/user sys$error nl: +$ search/out=nl: 'tfile1' "$_''keyterm'" +$! search/out 'tfile1' "$_''keyterm'" +$ severity = '$severity' +$ endif $! -$! Unix compatibility routines +$! Unix compatibility routines $!--------------------------------------------- -$ if severity .ne. 1 -$ then -$ define/user sys$output nl: -$ define/user sys$error nl: -$ search/out=nl: 'tfile1' - +$ if severity .ne. 1 +$ then +$ define/user sys$output nl: +$ define/user sys$error nl: +$ search/out=nl: 'tfile1' - "$__unix_''keyterm'","$__vms_''keyterm'","$_posix_''keyterm'" -$ severity = '$severity' -$ endif +$ severity = '$severity' +$ endif $! -$! Show the result of the search +$! Show the result of the search $!------------------------------------------------ -$ if 'severity' .eq. 1 -$ then -$ if key64 then write tf "#ifndef __VAX" -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" +$ if 'severity' .eq. 1 +$ then +$ if key64 then write tf "#ifndef __VAX" +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" $if p2 .nes. "" then write sys$output "''decc_shr' #define ''key2' 1" -$ write tf "#endif" -$ if key64 then write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ endif -$ if f$search(tfile1) .nes. "" then delete 'tfile1';* +$ write tf "#endif" +$ if key64 then write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ endif +$ if f$search(tfile1) .nes. "" then delete 'tfile1';* $! -$! Check the DECC Header files next +$! Check the DECC Header files next $!---------------------------------------------- -$ define/user sys$output nl: -$ define/user sys$error nl: -$ search/out=nl: 'decc_rtldef' - - "''keysym';", "''keysym'[", "struct ''keysym'"/exact -$ severity = '$severity' -$ if severity .eq. 1 -$ then -$ if key64 then write tf "#ifndef __VAX" -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" +$ define/user sys$output nl: +$ define/user sys$error nl: +$ search/out=nl: 'decc_rtldef' - + "''keysym';", "''keysym'[", "struct ''keysym'"/exact +$ severity = '$severity' +$ if severity .eq. 1 +$ then +$ if key64 then write tf "#ifndef __VAX" +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" $if p2 .nes. "" then write sys$output "''decc_rtldef' #define ''key2' 1" -$ write tf "#endif" -$ if key64 then write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ write tf "#endif" +$ if key64 then write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Check kerberos +$! Check kerberos $!-------------------------------------------- -$ if f$search("SYS$SYSROOT:[kerberos]include.dir") .nes. "" -$ then -$ test_mit = "SYS$SYSROOT:[kerberos.include]gssapi_krb5.h" -$ if (key2 .eqs. "HAVE_GSSAPI") -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ endif +$ if f$search("SYS$SYSROOT:[kerberos]include.dir") .nes. "" +$ then +$ test_mit = "SYS$SYSROOT:[kerberos.include]gssapi_krb5.h" +$ if (key2 .eqs. "HAVE_GSSAPI") +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ endif $! -$ endif -$ write tf "/* ", xline, " */" -$ goto cfgh_in_loop1 -$ endif +$ endif +$ write tf "/* ", xline, " */" +$ goto cfgh_in_loop1 +$ endif $! $! -$! Process SIZEOF directives found in SAMBA and others +$! Process SIZEOF directives found in SAMBA and others $!---------------------------------------------------------- -$ if key2a .eqs. "SIZEOF" -$ then -$ if key2b .eqs. "INO" .and. key2_h .eqs. "_T" -$ then -$ write tf "#ifndef SIZEOF_INO_T" -$ write tf "#if !__USING_STD_STAT -$ write tf "#define SIZEOF_INO_T 6" -$ write tf "#else -$ write tf "#define SIZEOF_INO_T 8" -$ write tf "#endif -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "INTMAX" .and. key2_h .eqs. "_T" -$ then -$ write tf "#ifndef SIZEOF_INTMAX_T" -$ write tf "#ifdef __VAX" -$ write tf "#define SIZEOF_INTMAX_T 4" -$ write tf "#else" -$ write tf "#define SIZEOF_INTMAX_T 8" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "OFF" .and. key2_h .eqs. "_T" -$ then -$ write tf "#ifndef SIZEOF_OFF_T" -$ write tf "#if __USE_OFF64_T" -$ write tf "#define SIZEOF_OFF_T 8" -$ write tf "#else" -$ write tf "#define SIZEOF_OFF_T 4" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "CHAR" .and. key2_h .eqs. "_P" -$ then -$ write tf "#ifndef SIZEOF_CHAR_P" -$ write tf "#if __INITIAL_POINTER_SIZE == 64" -$ write tf "#define SIZEOF_CHAR_P 8" -$ write tf "#else" -$ write tf "#define SIZEOF_CHAR_P 4" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "VOIDP" -$ then -$ write tf "#ifndef SIZEOF_VOIDP" -$ write tf "#if __INITIAL_POINTER_SIZE == 64" -$ write tf "#define SIZEOF_VOIDP 8" -$ write tf "#else" -$ write tf "#define SIZEOF_VOIDP 4" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "INT" -$ then -$ write tf "#ifndef SIZEOF_INT" -$ write tf "#define SIZEOF_INT 4" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "SIZE" .and. key2_h .eqs. "_T" -$ then -$ write tf "#ifndef SIZEOF_SIZE_T" -$ write tf "#define SIZEOF_SIZE_T 4" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "TIME" .and. key2_h .eqs. "_T" -$ then -$ write tf "#ifndef SIZEOF_TIME_T" -$ write tf "#define SIZEOF_TIME_T 4" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "DOUBLE" -$ then -$ write tf "#ifndef SIZEOF_DOUBLE" -$ write tf "#define SIZEOF_DOUBLE 8" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2b .eqs. "LONG" -$ then -$ if key2c .eqs. "" -$ then -$ write tf "#ifndef SIZEOF_LONG" -$ write tf "#define SIZEOF_LONG 4" -$ write tf "#endif" -$ else -$ write tf "#ifndef SIZEOF_LONG_LONG" -$ write tf "#ifndef __VAX" -$ write tf "#define SIZEOF_LONG_LONG 8" -$ write tf "#endif" -$ write tf "#endif" -$ endif -$ goto cfgh_in_loop1 -$ endif -$ write tf "/* ", xline, " */" -$ goto cfgh_in_loop1 -$ endif +$ if key2a .eqs. "SIZEOF" +$ then +$ if key2b .eqs. "INO" .and. key2_h .eqs. "_T" +$ then +$ write tf "#ifndef SIZEOF_INO_T" +$ write tf "#if !__USING_STD_STAT +$ write tf "#define SIZEOF_INO_T 6" +$ write tf "#else +$ write tf "#define SIZEOF_INO_T 8" +$ write tf "#endif +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "INTMAX" .and. key2_h .eqs. "_T" +$ then +$ write tf "#ifndef SIZEOF_INTMAX_T" +$ write tf "#ifdef __VAX" +$ write tf "#define SIZEOF_INTMAX_T 4" +$ write tf "#else" +$ write tf "#define SIZEOF_INTMAX_T 8" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "OFF" .and. key2_h .eqs. "_T" +$ then +$ write tf "#ifndef SIZEOF_OFF_T" +$ write tf "#if __USE_OFF64_T" +$ write tf "#define SIZEOF_OFF_T 8" +$ write tf "#else" +$ write tf "#define SIZEOF_OFF_T 4" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "CHAR" .and. key2_h .eqs. "_P" +$ then +$ write tf "#ifndef SIZEOF_CHAR_P" +$ write tf "#if __INITIAL_POINTER_SIZE == 64" +$ write tf "#define SIZEOF_CHAR_P 8" +$ write tf "#else" +$ write tf "#define SIZEOF_CHAR_P 4" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "VOIDP" +$ then +$ write tf "#ifndef SIZEOF_VOIDP" +$ write tf "#if __INITIAL_POINTER_SIZE == 64" +$ write tf "#define SIZEOF_VOIDP 8" +$ write tf "#else" +$ write tf "#define SIZEOF_VOIDP 4" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "INT" +$ then +$ write tf "#ifndef SIZEOF_INT" +$ write tf "#define SIZEOF_INT 4" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "SIZE" .and. key2_h .eqs. "_T" +$ then +$ write tf "#ifndef SIZEOF_SIZE_T" +$ write tf "#define SIZEOF_SIZE_T 4" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "TIME" .and. key2_h .eqs. "_T" +$ then +$ write tf "#ifndef SIZEOF_TIME_T" +$ write tf "#define SIZEOF_TIME_T 4" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "DOUBLE" +$ then +$ write tf "#ifndef SIZEOF_DOUBLE" +$ write tf "#define SIZEOF_DOUBLE 8" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2b .eqs. "LONG" +$ then +$ if key2c .eqs. "" +$ then +$ write tf "#ifndef SIZEOF_LONG" +$ write tf "#define SIZEOF_LONG 4" +$ write tf "#endif" +$ else +$ write tf "#ifndef SIZEOF_LONG_LONG" +$ write tf "#ifndef __VAX" +$ write tf "#define SIZEOF_LONG_LONG 8" +$ write tf "#endif" +$ write tf "#endif" +$ endif +$ goto cfgh_in_loop1 +$ endif +$ write tf "/* ", xline, " */" +$ goto cfgh_in_loop1 +$ endif $! -$! Process NEED directives +$! Process NEED directives $!------------------------------- -$ if key2a .eqs. "NEED" -$ then -$ if key2b .eqs. "STRINGS" .and. key2_h .eqs. "_H" -$ then -$ write tf "#ifndef NEED_STRINGS_H" -$ write tf "#define NEED_STRINGS_H 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ write tf "/* ", xline, " */" -$ goto cfgh_in_loop1 -$ endif +$ if key2a .eqs. "NEED" +$ then +$ if key2b .eqs. "STRINGS" .and. key2_h .eqs. "_H" +$ then +$ write tf "#ifndef NEED_STRINGS_H" +$ write tf "#define NEED_STRINGS_H 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ write tf "/* ", xline, " */" +$ goto cfgh_in_loop1 +$ endif $! -$! Process GETHOSTNAME directives +$! Process GETHOSTNAME directives $!------------------------------------- -$ if key2 .eqs. "GETHOSTNAME_TYPE_ARG2" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#ifdef _DECC_V4_SOURCE" -$ write tf "#define ''key2' int" -$ write tf "#else" -$ write tf "#define ''key2' size_t" -$ write tf "#endif" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "GETHOSTNAME_TYPE_ARG2" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#ifdef _DECC_V4_SOURCE" +$ write tf "#define ''key2' int" +$ write tf "#else" +$ write tf "#define ''key2' size_t" +$ write tf "#endif" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Process GETNAMEINFO directives +$! Process GETNAMEINFO directives $!------------------------------------- -$ if key2a .eqs. "GETNAMEINFO" -$ then -$ if key2 .eqs. "GETNAMEINFO_QUAL_ARG1" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' const" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG1" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' struct sockaddr *" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG2" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' size_t" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG46" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' size_t" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG7" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ endif +$ if key2a .eqs. "GETNAMEINFO" +$ then +$ if key2 .eqs. "GETNAMEINFO_QUAL_ARG1" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' const" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG1" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' struct sockaddr *" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG2" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' size_t" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG46" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' size_t" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG7" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ endif $! -$! Process RECV directives +$! Process RECV directives $!------------------------------------- -$ if key2a .eqs. "RECV" -$ then -$ if key2 .eqs. "RECV_TYPE_ARG1" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "RECV_TYPE_ARG2" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' void *" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "RECV_TYPE_ARG3" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' size_t" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "RECV_TYPE_ARG4" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "RECV_TYPE_RETV" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ endif +$ if key2a .eqs. "RECV" +$ then +$ if key2 .eqs. "RECV_TYPE_ARG1" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "RECV_TYPE_ARG2" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' void *" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "RECV_TYPE_ARG3" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' size_t" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "RECV_TYPE_ARG4" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "RECV_TYPE_RETV" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ endif $! -$! Process SEND directives +$! Process SEND directives $!------------------------------------- -$ if key2a .eqs. "SEND" -$ then -$ if key2 .eqs. "SEND_QUAL_ARG2" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' const" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "SEND_TYPE_ARG1" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "SEND_TYPE_ARG2" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' void *" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "SEND_TYPE_ARG3" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' size_t" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "SEND_TYPE_ARG4" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ if key2 .eqs. "SEND_TYPE_RETV" -$ then -$ write tf "#ifndef ''key2'" -$ write tf "#define ''key2' int" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif -$ endif +$ if key2a .eqs. "SEND" +$ then +$ if key2 .eqs. "SEND_QUAL_ARG2" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' const" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "SEND_TYPE_ARG1" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "SEND_TYPE_ARG2" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' void *" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "SEND_TYPE_ARG3" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' size_t" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "SEND_TYPE_ARG4" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ if key2 .eqs. "SEND_TYPE_RETV" +$ then +$ write tf "#ifndef ''key2'" +$ write tf "#define ''key2' int" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif +$ endif $! $! -$! Process STATFS directives +$! Process STATFS directives $!------------------------------- -$! if key2a .eqs. "STATFS" -$! then -$! write tf "/* ", xline, " */" -$! goto cfgh_in_loop1 -$! endif +$! if key2a .eqs. "STATFS" +$! then +$! write tf "/* ", xline, " */" +$! goto cfgh_in_loop1 +$! endif $! -$! Process inline directive +$! Process inline directive $!------------------------------ -$ if key2 .eqs. "inline" -$ then -$ write tf "#ifndef inline" -$ write tf "#define inline __inline" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "inline" +$ then +$ write tf "#ifndef inline" +$ write tf "#define inline __inline" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Process restrict directive +$! Process restrict directive $!-------------------------------- -$ if key2 .eqs. "restrict" -$ then -$ write tf "#ifndef restrict" -$ write tf "#define restrict __restrict" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "restrict" +$ then +$ write tf "#ifndef restrict" +$ write tf "#define restrict __restrict" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Process STDC_HEADERS (SAMBA!) +$! Process STDC_HEADERS (SAMBA!) $!--------------------------- -$ if key2 .eqs. "STDC_HEADERS" -$ then -$ write tf "#ifndef STDC_HEADERS" -$ write tf "#define STDC_HEADERS 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "STDC_HEADERS" +$ then +$ write tf "#ifndef STDC_HEADERS" +$ write tf "#define STDC_HEADERS 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Process PROTOTYPES directive +$! Process PROTOTYPES directive $!------------------------------------- -$ if key2 .eqs. "PROTOTYPES" -$ then -$ write tf "#ifndef PROTOTYPES" -$ write tf "#define PROTOTYPES 1" -$ write tf "#endif" -$ goto cfgh_in_loop1 -$ endif +$ if key2 .eqs. "PROTOTYPES" +$ then +$ write tf "#ifndef PROTOTYPES" +$ write tf "#define PROTOTYPES 1" +$ write tf "#endif" +$ goto cfgh_in_loop1 +$ endif $! -$! Special for SEEKDIR_RETURNS_VOID +$! Special for SEEKDIR_RETURNS_VOID $!--------------------------------------- -$ if key2 .eqs. "SEEKDIR_RETURNS_VOID" -$ then -$ write tf "#ifndef SEEKDIR_RETURNS_VOID" -$ write tf "#define SEEKDIR_RETURNS_VOID 1" -$ write tf "#endif" -$ endif +$ if key2 .eqs. "SEEKDIR_RETURNS_VOID" +$ then +$ write tf "#ifndef SEEKDIR_RETURNS_VOID" +$ write tf "#define SEEKDIR_RETURNS_VOID 1" +$ write tf "#endif" +$ endif $! -$! Unknown - See if CONFIGURE can give a clue for this +$! Unknown - See if CONFIGURE can give a clue for this $!---------------------------------------------------------- -$ pflag = 0 -$ set_flag = 0 -$! gproj_name = proj_name - "_VMS" - "-VMS" -$ if f$search(tfile1) .nes. "" then delete 'tfile1';* -$ define/user sys$output nl: -$ define/user sys$error nl: -$! if f$locate("FILE", key2) .lt. key2_len then pflag = 1 -$! if f$locate("DIR", key2) .eq. key2_len - 3 then pflag = 1 -$! if f$locate("PATH", key2) .eq. key2_len - 4 then pflag = 1 +$ pflag = 0 +$ set_flag = 0 +$! gproj_name = proj_name - "_VMS" - "-VMS" +$ if f$search(tfile1) .nes. "" then delete 'tfile1';* +$ define/user sys$output nl: +$ define/user sys$error nl: +$! if f$locate("FILE", key2) .lt. key2_len then pflag = 1 +$! if f$locate("DIR", key2) .eq. key2_len - 3 then pflag = 1 +$! if f$locate("PATH", key2) .eq. key2_len - 4 then pflag = 1 $! -$ search/out='tfile1' 'configure_script' "''key2'="/exact -$ search_sev = '$severity' -$ if 'search_sev' .eq. 1 -$ then -$ open/read/err=unknown_cf_rd_error sf 'tfile1' +$ search/out='tfile1' 'configure_script' "''key2'="/exact +$ search_sev = '$severity' +$ if 'search_sev' .eq. 1 +$ then +$ open/read/err=unknown_cf_rd_error sf 'tfile1' $search_file_rd_loop: -$ read/end=unknown_cf_rd_err sf line_in -$ line_in = f$edit(line_in, "TRIM") -$ skey1 = f$element(0,"=",line_in) -$ if skey1 .eqs. key2 -$ then -$ skey2 = f$element(1,"=",line_in) -$ skey2a = f$extract(0,2,skey2) +$ read/end=unknown_cf_rd_err sf line_in +$ line_in = f$edit(line_in, "TRIM") +$ skey1 = f$element(0,"=",line_in) +$ if skey1 .eqs. key2 +$ then +$ skey2 = f$element(1,"=",line_in) +$ skey2a = f$extract(0,2,skey2) $! $! -$! We can not handle assignment to shell symbols. -$! For now skip them. +$! We can not handle assignment to shell symbols. +$! For now skip them. $!------------------------------------------------------------ -$ if f$locate("$", skey2) .lt. f$length(skey2) -$ then -$ write tf "/* ", xline, " */" -$ set_flag = 1 -$ goto found_in_configure -$ endif +$ if f$locate("$", skey2) .lt. f$length(skey2) +$ then +$ write tf "/* ", xline, " */" +$ set_flag = 1 +$ goto found_in_configure +$ endif $! -$! Keep these two cases separate to make it easier to add -$! more future intelligence to this routine +$! Keep these two cases separate to make it easier to add +$! more future intelligence to this routine $!---------------------------------------------------------------------- -$ if skey2a .eqs. """`" -$ then -$! if pflag .eq. 1 -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ",key2," """,gproj_name,"_",key2,"""" -$! write tf "#endif" -$! else -$! Ignore this for now +$ if skey2a .eqs. """`" +$ then +$! if pflag .eq. 1 +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ",key2," """,gproj_name,"_",key2,"""" +$! write tf "#endif" +$! else +$! Ignore this for now $!------------------------------------------ -$ write tf "/* ", xline, " */" -$! endif -$ set_flag = 1 -$ goto found_in_configure -$ endif -$ if skey2a .eqs. """$" -$ then -$! if pflag .eq. 1 -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ",key2," """,gproj_name,"_",key2,"""" -$! write tf "#endif" -$! else -$! Ignore this for now +$ write tf "/* ", xline, " */" +$! endif +$ set_flag = 1 +$ goto found_in_configure +$ endif +$ if skey2a .eqs. """$" +$ then +$! if pflag .eq. 1 +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ",key2," """,gproj_name,"_",key2,"""" +$! write tf "#endif" +$! else +$! Ignore this for now $!------------------------------------------- -$ write tf "/* ", xline, " */" -$! endif -$ set_flag = 1 -$ goto found_in_configure -$ endif +$ write tf "/* ", xline, " */" +$! endif +$ set_flag = 1 +$ goto found_in_configure +$ endif $! -$! Remove multiple layers of quotes if present +$! Remove multiple layers of quotes if present $!---------------------------------------------------------- -$ if f$extract(0, 1, skey2) .eqs. "'" -$ then -$ skey2 = skey2 - "'" - "'" - "'" - "'" -$ endif -$ if f$extract(0, 1, skey2) .eqs. """" -$ then -$ skey2 = skey2 - """" - """" - """" - """" -$ endif -$ write tf "#ifndef ''key2'" -$ if skey2 .eqs. "" -$ then -$ write tf "#define ",key2 -$ else -$! Only quote non-numbers +$ if f$extract(0, 1, skey2) .eqs. "'" +$ then +$ skey2 = skey2 - "'" - "'" - "'" - "'" +$ endif +$ if f$extract(0, 1, skey2) .eqs. """" +$ then +$ skey2 = skey2 - """" - """" - """" - """" +$ endif +$ write tf "#ifndef ''key2'" +$ if skey2 .eqs. "" +$ then +$ write tf "#define ",key2 +$ else +$! Only quote non-numbers $!---------------------------------------- -$ if f$string(skey2+0) .eqs. skey2 -$ then -$ write tf "#define ",key2," ",skey2 -$ else -$ write tf "#define ",key2," """,skey2,"""" -$ endif -$ endif -$ write tf "#endif" -$ set_flag = 1 -$ else -$ goto search_file_rd_loop -$! if pflag .eq. 1 -$! then -$! write tf "#ifndef ''key2'" -$! write tf "#define ",key2," """,gproj_name,"_",key2,"""" -$! write tf "#endif" -$! set_flag = 1 -$! endif -$ endif +$ if f$string(skey2+0) .eqs. skey2 +$ then +$ write tf "#define ",key2," ",skey2 +$ else +$ write tf "#define ",key2," """,skey2,"""" +$ endif +$ endif +$ write tf "#endif" +$ set_flag = 1 +$ else +$ goto search_file_rd_loop +$! if pflag .eq. 1 +$! then +$! write tf "#ifndef ''key2'" +$! write tf "#define ",key2," """,gproj_name,"_",key2,"""" +$! write tf "#endif" +$! set_flag = 1 +$! endif +$ endif $found_in_configure: $unknown_cf_rd_err: -$ if f$trnlnm("sf","lnm$process",,"SUPERVISOR") .nes. "" -$ then -$ close sf -$ endif -$ if f$search(tfile1) .nes. "" then delete 'tfile1';* -$ if set_flag .eq. 1 then goto cfgh_in_loop1 -$ endif +$ if f$trnlnm("sf","lnm$process",,"SUPERVISOR") .nes. "" +$ then +$ close sf +$ endif +$ if f$search(tfile1) .nes. "" then delete 'tfile1';* +$ if set_flag .eq. 1 then goto cfgh_in_loop1 +$ endif $ endif $! $! diff --git a/deps/curl/packages/vms/curl_crtl_init.c b/deps/curl/packages/vms/curl_crtl_init.c index 6ae7e8c3..a94fb666 100644 --- a/deps/curl/packages/vms/curl_crtl_init.c +++ b/deps/curl/packages/vms/curl_crtl_init.c @@ -89,89 +89,87 @@ 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); + 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); + 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; - struct dsc$descriptor_s name_dsc; - int status; - unsigned short result; - struct itmlst_3 itlst[2]; + const $DESCRIPTOR(table_dsc, "LNM$FILE_DEV"); + const unsigned long attr = LNM$M_CASE_BLIND; + struct dsc$descriptor_s name_dsc; + int status; + unsigned short result; + struct itmlst_3 itlst[2]; - itlst[0].buflen = value_len; - itlst[0].itmcode = LNM$_STRING; - itlst[0].bufadr = value; - itlst[0].retlen = &result; + itlst[0].buflen = value_len; + itlst[0].itmcode = LNM$_STRING; + itlst[0].bufadr = value; + itlst[0].retlen = &result; - itlst[1].buflen = 0; - itlst[1].itmcode = 0; + itlst[1].buflen = 0; + itlst[1].itmcode = 0; - name_dsc.dsc$w_length = strlen(logname); - name_dsc.dsc$a_pointer = (char *)logname; - name_dsc.dsc$b_dtype = DSC$K_DTYPE_T; - name_dsc.dsc$b_class = DSC$K_CLASS_S; + name_dsc.dsc$w_length = strlen(logname); + name_dsc.dsc$a_pointer = (char *)logname; + name_dsc.dsc$b_dtype = DSC$K_DTYPE_T; + name_dsc.dsc$b_class = DSC$K_CLASS_S; - status = SYS$TRNLNM(&attr, &table_dsc, &name_dsc, 0, itlst); + status = SYS$TRNLNM(&attr, &table_dsc, &name_dsc, 0, itlst); - if($VMS_STATUS_SUCCESS(status)) { + if($VMS_STATUS_SUCCESS(status)) { - /* Null terminate and return the string */ - /*--------------------------------------*/ - value[result] = '\0'; - } + /* Null terminate and return the string */ + /*--------------------------------------*/ + value[result] = '\0'; + } - return status; + return status; } /* 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"; - struct dsc$descriptor_s proc_table_dsc; - struct dsc$descriptor_s logname_dsc; - struct itmlst_3 item_list[2]; + int ret_val; + const char *proc_table = "LNM$PROCESS_TABLE"; + struct dsc$descriptor_s proc_table_dsc; + 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$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; + 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$w_length = strlen(logname); - logname_dsc.dsc$b_dtype = DSC$K_DTYPE_T; - logname_dsc.dsc$b_class = DSC$K_CLASS_S; + 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; - item_list[0].buflen = strlen(value); - item_list[0].itmcode = LNM$_STRING; - item_list[0].bufadr = (char *)value; - item_list[0].retlen = NULL; + item_list[0].buflen = strlen(value); + item_list[0].itmcode = LNM$_STRING; + item_list[0].bufadr = (char *)value; + item_list[0].retlen = NULL; - item_list[1].buflen = 0; - item_list[1].itmcode = 0; + item_list[1].buflen = 0; + item_list[1].itmcode = 0; - ret_val = SYS$CRELNM(NULL, &proc_table_dsc, &logname_dsc, NULL, item_list); + ret_val = SYS$CRELNM(NULL, &proc_table_dsc, &logname_dsc, NULL, item_list); - return ret_val; + return ret_val; } @@ -183,111 +181,112 @@ static int sys_crelnm #ifdef __VAX static void set_feature_default(const char *name, const char *value) { - sys_crelnm(name, value); + sys_crelnm(name, value); } #else static void set_feature_default(const char *name, int value) { - int index; + int index; - index = decc$feature_get_index(name); + index = decc$feature_get_index(name); - if(index > 0) - decc$feature_set_value (index, 0, value); + if(index > 0) + decc$feature_set_value (index, 0, value); } #endif static void set_features(void) { - int status; - char unix_shell_name[255]; - int use_unix_settings = 1; + int status; + char unix_shell_name[255]; + int use_unix_settings = 1; - status = sys_trnlnm("GNV$UNIX_SHELL", - unix_shell_name, sizeof unix_shell_name -1); - if(!$VMS_STATUS_SUCCESS(status)) { - use_unix_settings = 0; - } + status = sys_trnlnm("GNV$UNIX_SHELL", + unix_shell_name, sizeof(unix_shell_name) -1); + if(!$VMS_STATUS_SUCCESS(status)) { + use_unix_settings = 0; + } - /* ACCESS should check ACLs or it is lying. */ - set_feature_default("DECC$ACL_ACCESS_CHECK", ENABLE); + /* ACCESS should check ACLs or it is lying. */ + set_feature_default("DECC$ACL_ACCESS_CHECK", ENABLE); - /* We always want the new parse style */ - set_feature_default ("DECC$ARGV_PARSE_STYLE" , ENABLE); + /* 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. - */ - set_feature_default("DECC$DISABLE_POSIX_ROOT", DISABLE); + /* Unless we are in POSIX compliant mode, we want the old POSIX root + * enabled. + */ + set_feature_default("DECC$DISABLE_POSIX_ROOT", DISABLE); - /* EFS charset, means UTF-8 support */ - /* VTF-7 support is controlled by a feature setting called UTF8 */ - set_feature_default ("DECC$EFS_CHARSET", ENABLE); - set_feature_default ("DECC$EFS_CASE_PRESERVE", ENABLE); + /* EFS charset, means UTF-8 support */ + /* VTF-7 support is controlled by a feature setting called UTF8 */ + set_feature_default("DECC$EFS_CHARSET", ENABLE); + set_feature_default("DECC$EFS_CASE_PRESERVE", ENABLE); - /* Support timestamps when available */ - set_feature_default ("DECC$EFS_FILE_TIMESTAMPS", ENABLE); + /* Support timestamps when available */ + set_feature_default("DECC$EFS_FILE_TIMESTAMPS", ENABLE); - /* Cache environment variables - performance improvements */ - set_feature_default ("DECC$ENABLE_GETENV_CACHE", ENABLE); + /* Cache environment variables - performance improvements */ + set_feature_default("DECC$ENABLE_GETENV_CACHE", ENABLE); - /* Start out with new file attribute inheritance */ + /* Start out with new file attribute inheritance */ #ifdef __VAX - set_feature_default ("DECC$EXEC_FILEATTR_INHERITANCE", "2"); + set_feature_default("DECC$EXEC_FILEATTR_INHERITANCE", "2"); #else - set_feature_default ("DECC$EXEC_FILEATTR_INHERITANCE", 2); + set_feature_default("DECC$EXEC_FILEATTR_INHERITANCE", 2); #endif - /* Don't display trailing dot after files without type */ - set_feature_default ("DECC$READDIR_DROPDOTNOTYPE", ENABLE); + /* Don't display trailing dot after files without type */ + set_feature_default("DECC$READDIR_DROPDOTNOTYPE", ENABLE); - /* For standard output channels buffer output until terminator */ - /* Gets rid of output logs with single character lines in them. */ - set_feature_default ("DECC$STDIO_CTX_EOL", ENABLE); + /* For standard output channels buffer output until terminator */ + /* Gets rid of output logs with single character lines in them. */ + set_feature_default("DECC$STDIO_CTX_EOL", ENABLE); - /* Fix mv aa.bb aa */ - set_feature_default ("DECC$RENAME_NO_INHERIT", ENABLE); + /* Fix mv aa.bb aa */ + set_feature_default("DECC$RENAME_NO_INHERIT", ENABLE); - if(use_unix_settings) { + if(use_unix_settings) { - /* POSIX requires that open files be able to be removed */ - set_feature_default ("DECC$ALLOW_REMOVE_OPEN_FILES", ENABLE); + /* POSIX requires that open files be able to be removed */ + set_feature_default("DECC$ALLOW_REMOVE_OPEN_FILES", ENABLE); - /* Default to outputting Unix filenames in VMS routines */ - set_feature_default ("DECC$FILENAME_UNIX_ONLY", ENABLE); - /* FILENAME_UNIX_ONLY Implicitly sets */ - /* decc$disable_to_vms_logname_translation */ + /* Default to outputting Unix filenames in VMS routines */ + set_feature_default("DECC$FILENAME_UNIX_ONLY", ENABLE); + /* FILENAME_UNIX_ONLY Implicitly sets */ + /* decc$disable_to_vms_logname_translation */ - set_feature_default ("DECC$FILE_PERMISSION_UNIX", ENABLE); + set_feature_default("DECC$FILE_PERMISSION_UNIX", ENABLE); - set_feature_default ("DECC$FILE_SHARING", ENABLE); + set_feature_default("DECC$FILE_SHARING", ENABLE); - set_feature_default ("DECC$FILE_OWNER_UNIX", ENABLE); - set_feature_default ("DECC$POSIX_SEEK_STREAM_FILE", ENABLE); + 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); - } + } + else { + set_feature_default("DECC$FILENAME_UNIX_REPORT", ENABLE); + } - /* When reporting Unix filenames, glob the same way */ - set_feature_default ("DECC$GLOB_UNIX_STYLE", ENABLE); + /* When reporting Unix filenames, glob the same way */ + set_feature_default("DECC$GLOB_UNIX_STYLE", ENABLE); - /* The VMS version numbers on Unix filenames is incompatible with most */ - /* ported packages. */ - set_feature_default("DECC$FILENAME_UNIX_NO_VERSION", ENABLE); + /* The VMS version numbers on Unix filenames is incompatible with most */ + /* ported packages. */ + set_feature_default("DECC$FILENAME_UNIX_NO_VERSION", ENABLE); - /* The VMS version numbers on Unix filenames is incompatible with most */ - /* ported packages. */ - set_feature_default("DECC$UNIX_PATH_BEFORE_LOGNAME", ENABLE); + /* The VMS version numbers on Unix filenames is incompatible with most */ + /* ported packages. */ + set_feature_default("DECC$UNIX_PATH_BEFORE_LOGNAME", ENABLE); - /* Set strtol to proper behavior */ - set_feature_default("DECC$STRTOL_ERANGE", ENABLE); + /* Set strtol to proper behavior */ + set_feature_default("DECC$STRTOL_ERANGE", ENABLE); - /* 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); */ + /* 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); */ } @@ -308,7 +307,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 diff --git a/deps/curl/packages/vms/curlmsg.msg b/deps/curl/packages/vms/curlmsg.msg index ac2d508e..8d428e88 100644 --- a/deps/curl/packages/vms/curlmsg.msg +++ b/deps/curl/packages/vms/curlmsg.msg @@ -39,96 +39,96 @@ ! ! If you update this file also update curlmsg_vms.h so that they are in sync ! -.TITLE CURLMSG Message files -.FACILITY CURL,1793 /PREFIX=CURL_ -.BASE 1 -.SEVERITY SUCCESS -OK +.TITLE CURLMSG Message files +.FACILITY CURL,1793 /PREFIX=CURL_ +.BASE 1 +.SEVERITY SUCCESS +OK -.SEVERITY ERROR -UNSUPPORTED_PROTOCOL -FAILED_INIT -URL_MALFORMAT -OBSOLETE4 -COULDNT_RESOLVE_PROXY -COULDNT_RESOLVE_HOST -COULDNT_CONNECT -WEIRD_SERVER_REPLY -FTP_ACCESS_DENIED -OBSOLETE10 -FTP_WEIRD_PASS_REPLY -OBSOLETE12 -FTP_WEIRD_PASV_REPLY -FTP_WEIRD_227_FORMAT -FTP_CANT_GET_HOST -OBSOLETE16 -FTP_COULDNT_SET_TYPE -PARTIAL_FILE -FTP_COULDNT_RETR_FILE -OBSOLETE20 -QUOTE_ERROR -HTTP_RETURNED_ERROR -WRITE_ERROR -OBSOLETE24 -UPLOAD_FAILED -READ_ERROR -OUT_OF_MEMORY -OPERATION_TIMEOUTED -OBSOLETE29 -FTP_PORT_FAILED -FTP_COULDNT_USE_REST -OBSOLETE32 -RANGE_ERROR -HTTP_POST_ERROR -SSL_CONNECT_ERROR -BAD_DOWNLOAD_RESUME -FILE_COULDNT_READ_FILE -LDAP_CANNOT_BIND -LDAP_SEARCH_FAILED -OBSOLETE40 -FUNCTION_NOT_FOUND -ABORTED_BY_CALLBACK -BAD_FUNCTION_ARGUMENT -OBSOLETE44 -INTERFACE_FAILED -OBSOLETE46 -TOO_MANY_REDIRECTS -UNKNOWN_TELNET_OPTION -TELNET_OPTION_SYNTAX -OBSOLETE50 -PEER_FAILED_VERIF -GOT_NOTHING -SSL_ENGINE_NOTFOUND -SSL_ENGINE_SETFAILED -SEND_ERROR -RECV_ERROR -OBSOLETE57 -SSL_CERTPROBLEM +.SEVERITY ERROR +UNSUPPORTED_PROTOCOL +FAILED_INIT +URL_MALFORMAT +OBSOLETE4 +COULDNT_RESOLVE_PROXY +COULDNT_RESOLVE_HOST +COULDNT_CONNECT +WEIRD_SERVER_REPLY +FTP_ACCESS_DENIED +OBSOLETE10 +FTP_WEIRD_PASS_REPLY +OBSOLETE12 +FTP_WEIRD_PASV_REPLY +FTP_WEIRD_227_FORMAT +FTP_CANT_GET_HOST +OBSOLETE16 +FTP_COULDNT_SET_TYPE +PARTIAL_FILE +FTP_COULDNT_RETR_FILE +OBSOLETE20 +QUOTE_ERROR +HTTP_RETURNED_ERROR +WRITE_ERROR +OBSOLETE24 +UPLOAD_FAILED +READ_ERROR +OUT_OF_MEMORY +OPERATION_TIMEOUTED +OBSOLETE29 +FTP_PORT_FAILED +FTP_COULDNT_USE_REST +OBSOLETE32 +RANGE_ERROR +HTTP_POST_ERROR +SSL_CONNECT_ERROR +BAD_DOWNLOAD_RESUME +FILE_COULDNT_READ_FILE +LDAP_CANNOT_BIND +LDAP_SEARCH_FAILED +OBSOLETE40 +FUNCTION_NOT_FOUND +ABORTED_BY_CALLBACK +BAD_FUNCTION_ARGUMENT +OBSOLETE44 +INTERFACE_FAILED +OBSOLETE46 +TOO_MANY_REDIRECTS +UNKNOWN_TELNET_OPTION +TELNET_OPTION_SYNTAX +OBSOLETE50 +PEER_FAILED_VERIF +GOT_NOTHING +SSL_ENGINE_NOTFOUND +SSL_ENGINE_SETFAILED +SEND_ERROR +RECV_ERROR +OBSOLETE57 +SSL_CERTPROBLEM SSL_CIPHER -SSL_CACERT -BAD_CONTENT_ENCODING -LDAP_INVALID_URL -FILESIZE_EXCEEDED -USE_SSL_FAILED -SEND_FAIL_REWIND -SSL_ENGINE_INITFAILED -LOGIN_DENIED -TFTP_NOTFOUND -TFTP_PERM -REMOTE_DISK_FULL -TFTP_ILLEGAL -TFTP_UNKNOWNID -REMOTE_FILE_EXISTS -TFTP_NOSUCHUSER -CONV_FAILED -CONV_REQD -SSL_CACERT_BADFILE -REMOTE_FILE_NOT_FOUND -SSH -SSL_SHUTDOWN_FAILED -AGAIN -SSL_CRL_BADFILE -SSL_ISSUER_ERROR -CURL_LAST +SSL_CACERT +BAD_CONTENT_ENCODING +LDAP_INVALID_URL +FILESIZE_EXCEEDED +USE_SSL_FAILED +SEND_FAIL_REWIND +SSL_ENGINE_INITFAILED +LOGIN_DENIED +TFTP_NOTFOUND +TFTP_PERM +REMOTE_DISK_FULL +TFTP_ILLEGAL +TFTP_UNKNOWNID +REMOTE_FILE_EXISTS +TFTP_NOSUCHUSER +CONV_FAILED +CONV_REQD +SSL_CACERT_BADFILE +REMOTE_FILE_NOT_FOUND +SSH +SSL_SHUTDOWN_FAILED +AGAIN +SSL_CRL_BADFILE +SSL_ISSUER_ERROR +CURL_LAST .END diff --git a/deps/curl/packages/vms/curlmsg_vms.h b/deps/curl/packages/vms/curlmsg_vms.h index bb647022..29a38db4 100644 --- a/deps/curl/packages/vms/curlmsg_vms.h +++ b/deps/curl/packages/vms/curlmsg_vms.h @@ -52,92 +52,92 @@ */ static const long vms_cond[] = - { - CURL_OK, - CURL_UNSUPPORTED_PROTOCOL, - CURL_FAILED_INIT, - CURL_URL_MALFORMAT, - CURL_OBSOLETE4, - CURL_COULDNT_RESOLVE_PROXY, - CURL_COULDNT_RESOLVE_HOST, - CURL_COULDNT_CONNECT, - CURL_WEIRD_SERVER_REPLY, - CURL_FTP_ACCESS_DENIED, - CURL_OBSOLETE10, - CURL_FTP_WEIRD_PASS_REPLY, - CURL_OBSOLETE12, - CURL_FTP_WEIRD_PASV_REPLY, - CURL_FTP_WEIRD_227_FORMAT, - CURL_FTP_CANT_GET_HOST, - CURL_OBSOLETE16, - CURL_FTP_COULDNT_SET_TYPE, - CURL_PARTIAL_FILE, - CURL_FTP_COULDNT_RETR_FILE, - CURL_OBSOLETE20, - CURL_QUOTE_ERROR, - CURL_HTTP_RETURNED_ERROR, - CURL_WRITE_ERROR, - CURL_OBSOLETE24, - CURL_UPLOAD_FAILED, - CURL_READ_ERROR, - CURL_OUT_OF_MEMORY, - CURL_OPERATION_TIMEOUTED, - CURL_OBSOLETE29, - CURL_FTP_PORT_FAILED, - CURL_FTP_COULDNT_USE_REST, - CURL_OBSOLETE32, - CURL_RANGE_ERROR, - CURL_HTTP_POST_ERROR, - CURL_SSL_CONNECT_ERROR, - CURL_BAD_DOWNLOAD_RESUME, - CURL_FILE_COULDNT_READ_FILE, - CURL_LDAP_CANNOT_BIND, - CURL_LDAP_SEARCH_FAILED, - CURL_OBSOLETE40, - CURL_FUNCTION_NOT_FOUND, - CURL_ABORTED_BY_CALLBACK, - CURL_BAD_FUNCTION_ARGUMENT, - CURL_OBSOLETE44, - CURL_INTERFACE_FAILED, - CURL_OBSOLETE46, - CURL_TOO_MANY_REDIRECTS, - CURL_UNKNOWN_TELNET_OPTION, - CURL_TELNET_OPTION_SYNTAX, - CURL_OBSOLETE50, - CURL_PEER_FAILED_VERIF, - CURL_GOT_NOTHING, - CURL_SSL_ENGINE_NOTFOUND, - CURL_SSL_ENGINE_SETFAILED, - CURL_SEND_ERROR, - CURL_RECV_ERROR, - CURL_OBSOLETE57, - CURL_SSL_CERTPROBLEM, - CURL_SSL_CIPHER, - CURL_SSL_CACERT, - CURL_BAD_CONTENT_ENCODING, - CURL_LDAP_INVALID_URL, - CURL_FILESIZE_EXCEEDED, - CURL_USE_SSL_FAILED, - CURL_SEND_FAIL_REWIND, - CURL_SSL_ENGINE_INITFAILED, - CURL_LOGIN_DENIED, - CURL_TFTP_NOTFOUND, - CURL_TFTP_PERM, - CURL_REMOTE_DISK_FULL, - CURL_TFTP_ILLEGAL, - CURL_TFTP_UNKNOWNID, - CURL_REMOTE_FILE_EXISTS, - CURL_TFTP_NOSUCHUSER, - CURL_CONV_FAILED, - CURL_CONV_REQD, - CURL_SSL_CACERT_BADFILE, - CURL_REMOTE_FILE_NOT_FOUND, - CURL_SSH, - CURL_SSL_SHUTDOWN_FAILED, - CURL_AGAIN, - CURLE_SSL_CRL_BADFILE, - CURLE_SSL_ISSUER_ERROR, - CURL_CURL_LAST - }; +{ + CURL_OK, + CURL_UNSUPPORTED_PROTOCOL, + CURL_FAILED_INIT, + CURL_URL_MALFORMAT, + CURL_OBSOLETE4, + CURL_COULDNT_RESOLVE_PROXY, + CURL_COULDNT_RESOLVE_HOST, + CURL_COULDNT_CONNECT, + CURL_WEIRD_SERVER_REPLY, + CURL_FTP_ACCESS_DENIED, + CURL_OBSOLETE10, + CURL_FTP_WEIRD_PASS_REPLY, + CURL_OBSOLETE12, + CURL_FTP_WEIRD_PASV_REPLY, + CURL_FTP_WEIRD_227_FORMAT, + CURL_FTP_CANT_GET_HOST, + CURL_OBSOLETE16, + CURL_FTP_COULDNT_SET_TYPE, + CURL_PARTIAL_FILE, + CURL_FTP_COULDNT_RETR_FILE, + CURL_OBSOLETE20, + CURL_QUOTE_ERROR, + CURL_HTTP_RETURNED_ERROR, + CURL_WRITE_ERROR, + CURL_OBSOLETE24, + CURL_UPLOAD_FAILED, + CURL_READ_ERROR, + CURL_OUT_OF_MEMORY, + CURL_OPERATION_TIMEOUTED, + CURL_OBSOLETE29, + CURL_FTP_PORT_FAILED, + CURL_FTP_COULDNT_USE_REST, + CURL_OBSOLETE32, + CURL_RANGE_ERROR, + CURL_HTTP_POST_ERROR, + CURL_SSL_CONNECT_ERROR, + CURL_BAD_DOWNLOAD_RESUME, + CURL_FILE_COULDNT_READ_FILE, + CURL_LDAP_CANNOT_BIND, + CURL_LDAP_SEARCH_FAILED, + CURL_OBSOLETE40, + CURL_FUNCTION_NOT_FOUND, + CURL_ABORTED_BY_CALLBACK, + CURL_BAD_FUNCTION_ARGUMENT, + CURL_OBSOLETE44, + CURL_INTERFACE_FAILED, + CURL_OBSOLETE46, + CURL_TOO_MANY_REDIRECTS, + CURL_UNKNOWN_TELNET_OPTION, + CURL_TELNET_OPTION_SYNTAX, + CURL_OBSOLETE50, + CURL_PEER_FAILED_VERIF, + CURL_GOT_NOTHING, + CURL_SSL_ENGINE_NOTFOUND, + CURL_SSL_ENGINE_SETFAILED, + CURL_SEND_ERROR, + CURL_RECV_ERROR, + CURL_OBSOLETE57, + CURL_SSL_CERTPROBLEM, + CURL_SSL_CIPHER, + CURL_SSL_CACERT, + CURL_BAD_CONTENT_ENCODING, + CURL_LDAP_INVALID_URL, + CURL_FILESIZE_EXCEEDED, + CURL_USE_SSL_FAILED, + CURL_SEND_FAIL_REWIND, + CURL_SSL_ENGINE_INITFAILED, + CURL_LOGIN_DENIED, + CURL_TFTP_NOTFOUND, + CURL_TFTP_PERM, + CURL_REMOTE_DISK_FULL, + CURL_TFTP_ILLEGAL, + CURL_TFTP_UNKNOWNID, + CURL_REMOTE_FILE_EXISTS, + CURL_TFTP_NOSUCHUSER, + CURL_CONV_FAILED, + CURL_CONV_REQD, + CURL_SSL_CACERT_BADFILE, + CURL_REMOTE_FILE_NOT_FOUND, + CURL_SSH, + CURL_SSL_SHUTDOWN_FAILED, + CURL_AGAIN, + CURLE_SSL_CRL_BADFILE, + CURLE_SSL_ISSUER_ERROR, + CURL_CURL_LAST +}; #endif /* HEADER_CURLMSG_VMS_H */ diff --git a/deps/curl/packages/vms/generate_config_vms_h_curl.com b/deps/curl/packages/vms/generate_config_vms_h_curl.com index 99a39c84..81ede597 100644 --- a/deps/curl/packages/vms/generate_config_vms_h_curl.com +++ b/deps/curl/packages/vms/generate_config_vms_h_curl.com @@ -71,8 +71,8 @@ $! ssl$* logicals means HP ssl is present $!---------------------------------------- $ if f$trnlnm("ssl$root") .nes. "" $ then -$ nohpssl = 0 -$ hpssl = 1 +$ nohpssl = 0 +$ hpssl = 1 $ endif $! $! HP defines OPENSSL as SSL$INCLUDE as a convenience for linking. @@ -83,25 +83,25 @@ $!------------------------------------ $ openssl_lnm = f$trnlnm("OPENSSL") $ if (openssl_lnm .nes. "SYS$INCLUDE") $ then -$! Non HP SSL is installed, default to use it. -$ nohpssl = 1 -$ hpssl = 0 +$! Non HP SSL is installed, default to use it. +$ nohpssl = 1 +$ hpssl = 0 $ endif $! $! Now check to see if hpssl has been specifically disabled $!---------------------------------------------------------- $ if f$locate(",nohpssl,", args_lower) .lt. args_len $ then -$ nohpssl = 1 -$ hpssl = 0 +$ nohpssl = 1 +$ hpssl = 0 $ endif $! $! Finally check to see if hp ssl has been specifically included. $!---------------------------------------------------------------- $ if f$locate(",nohpssl,", args_lower) .lt. args_len $ then -$ nohpssl = 1 -$ hpssl = 0 +$ nohpssl = 1 +$ hpssl = 0 $ endif $endif $! @@ -113,14 +113,14 @@ $ write sys$output "NOTICE: A LIBIDN port has been detected." $ write sys$output " This port of curl for VMS has not been tested with it." $ if f$locate(",libidn,", args_lower) .lt. args_len $ then -$ libidn = 1 +$ libidn = 1 $ endif $ if .not. libidn $ then -$ write sys$output " LIBIDN support is not enabled." -$ write sys$output "Run with the ""libidn"" parameter to attempt to use." +$ write sys$output " LIBIDN support is not enabled." +$ write sys$output "Run with the ""libidn"" parameter to attempt to use." $ else -$ write sys$output " Untested LIBIDN support requested." +$ write sys$output " Untested LIBIDN support requested." $ endif $endif $! @@ -132,14 +132,14 @@ $ write sys$output "NOTICE: A LIBSSH2 port has been detected." $ write sys$output " This port of curl for VMS has not been tested with it." $ if f$locate(",libssh2,", args_lower) .lt. args_len $ then -$ libssh2 = 1 +$ libssh2 = 1 $ endif $ if .not. libssh2 $ then -$ write sys$output " LIBSSH2 support is not enabled." -$ write sys$output "Run with the ""libssh2"" parameter to attempt to use." +$ write sys$output " LIBSSH2 support is not enabled." +$ write sys$output "Run with the ""libssh2"" parameter to attempt to use." $ else -$ write sys$output " Untested LIBSSH2 support requested." +$ write sys$output " Untested LIBSSH2 support requested." $ endif $endif $! @@ -159,7 +159,7 @@ $then $! If kerberos is installed: sys$share:gss$rtl.exe exists. $ if f$search("sys$shsare:gss$rtl.exe") .eqs. "" $ then -$ nokerberos = 1 +$ nokerberos = 1 $ endif $endif $! @@ -170,13 +170,13 @@ $if f$trnlnm("GNV$LIBZSHR") .nes. "" $then $ if f$locate(",nozlib,", args_lower) .lt. args_len $ then -$ nozlib = 1 +$ nozlib = 1 $ endif $! if .not. nozlib $! then -$! write sys$output " GNV$LIBZSHR support is enabled." +$! write sys$output " GNV$LIBZSHR support is enabled." $! else -$! write sys$output " GNV$LIBZSHR support is disabled by nozlib." +$! write sys$output " GNV$LIBZSHR support is disabled by nozlib." $! endif $else $ nozlib = 1 @@ -203,13 +203,13 @@ $! Now the DCL builds usually say xxx-HP-VMS and configure scripts $! may put DEC or COMPAQ or HP for the middle part. $! $write cvh "#if defined(__alpha)" -$write cvh "#define OS ""ALPHA-HP-VMS""" +$write cvh "#define CURL_OS ""ALPHA-HP-VMS""" $write cvh "#elif defined(__vax)" -$write cvh "#define OS ""VAX-HP-VMS""" +$write cvh "#define CURL_OS ""VAX-HP-VMS""" $write cvh "#elif defined(__ia64)" -$write cvh "#define OS ""IA64-HP-VMS"" +$write cvh "#define CURL_OS ""IA64-HP-VMS"" $write cvh "#else" -$write cvh "#define OS ""UNKNOWN-HP-VMS"" +$write cvh "#define CURL_OS ""UNKNOWN-HP-VMS"" $write cvh "#endif" $write cvh "" $! @@ -262,9 +262,9 @@ $ write cvh "#undef CURL_DISABLE_LDAP" $ write cvh "#endif" $ if .not. nossl $ then -$ write cvh "#ifdef CURL_DISABLE_LDAPS" -$ write cvh "#undef CURL_DISABLE_LDAPS" -$ write cvh "#endif" +$ write cvh "#ifdef CURL_DISABLE_LDAPS" +$ write cvh "#undef CURL_DISABLE_LDAPS" +$ write cvh "#endif" $ endif $endif $write cvh "#ifdef CURL_DISABLE_LIBCURL_OPTION" @@ -394,7 +394,7 @@ $ endif $endif $! $! -$! LibIDN not ported to VMS at this time. +$! libidn not ported to VMS at this time. $! This is for international domain name support. $! Allow explicit experimentation. $if libidn @@ -410,7 +410,7 @@ $ write cvh "#endif" $endif $! $! -$! LibSSH2 not ported to VMS at this time. +$! libssh2 not ported to VMS at this time. $! Allow explicit experimentation. $if libssh2 $then diff --git a/deps/curl/packages/vms/gnv_link_curl.com b/deps/curl/packages/vms/gnv_link_curl.com index 247987ae..2acd49a6 100644 --- a/deps/curl/packages/vms/gnv_link_curl.com +++ b/deps/curl/packages/vms/gnv_link_curl.com @@ -123,7 +123,7 @@ $ endif $ endif $! $! Create the a new option file with special fixup for HP SSL -$! For a shared image, we always want ZLIB and 32 bit HPSSL +$! For a shared image, we always want ZLIB and 32-bit HPSSL $! $ if f$search("gnv$libzshr32") .eqs. "" $ then @@ -400,6 +400,7 @@ $ link'ldebug'/exe=[.src]curl.exe/dsf=[.src]curl.dsf - [.src]curl-tool_bname.o, [.src]curl-tool_cb_dbg.o, - [.src]curl-tool_cb_hdr.o, [.src]curl-tool_cb_prg.o, - [.src]curl-tool_cb_rea.o, [.src]curl-tool_cb_see.o, - + [.src]curl-tool_cb_soc.o, - [.src]curl-tool_cb_wrt.o, [.src]curl-tool_cfgable.o, - [.src]curl-tool_convert.o, [.src]curl-tool_dirhie.o, - [.src]curl-tool_doswin.o, [.src]curl-tool_easysrc.o, - diff --git a/deps/curl/packages/vms/readme b/deps/curl/packages/vms/readme index 0bb61663..042a22b8 100644 --- a/deps/curl/packages/vms/readme +++ b/deps/curl/packages/vms/readme @@ -138,7 +138,7 @@ pcsi_product_gnv_curl.com readme. This file. report_openssl_version.c - Program to check that the openssl version is new + Program to check that the OpenSSL version is new enough for building a shared libcurl image. setup_gnv_curl_build.com @@ -173,7 +173,7 @@ the GNV tool kit, building a shared libcurl, and producing a PCSI kit for distribution. The curl_gnv_build_steps.text is included in the release notes file of the PCSI kit. -The building with 64 bit pointers does not currently work. +The building with 64-bit pointers does not currently work. The build procedure will detect if HP OpenSSL, LDAP, and Kerberos are installed and default to building with them. diff --git a/deps/curl/packages/vms/report_openssl_version.c b/deps/curl/packages/vms/report_openssl_version.c index 64e1ee05..d08fe713 100644 --- a/deps/curl/packages/vms/report_openssl_version.c +++ b/deps/curl/packages/vms/report_openssl_version.c @@ -1,6 +1,6 @@ /* File: report_openssl_version.c * - * This file dynamically loads the openssl shared image to report the + * This file dynamically loads the OpenSSL shared image to report the * version string. * * It will optionally place that version string in a DCL symbol. @@ -36,65 +36,64 @@ #include unsigned long LIB$SET_SYMBOL( - const struct dsc$descriptor_s * symbol, - const struct dsc$descriptor_s * value, - const unsigned long * table_type); + const struct dsc$descriptor_s * symbol, + const struct dsc$descriptor_s * value, + const unsigned long *table_type); -int main(int argc, char ** argv) { +int main(int argc, char **argv) +{ + void *libptr; + const char * (*ssl_version)(int t); + const char *version; + if(argc < 1) { + puts("report_openssl_version filename"); + exit(1); + } -void * libptr; -const char * (*ssl_version)(int t); -const char * version; + libptr = dlopen(argv[1], 0); - if(argc < 1) { - puts("report_openssl_version filename"); - exit(1); - } + ssl_version = (const char * (*)(int))dlsym(libptr, "SSLeay_version"); + if(!ssl_version) { + ssl_version = (const char * (*)(int))dlsym(libptr, "ssleay_version"); + if(!ssl_version) { + ssl_version = (const char * (*)(int))dlsym(libptr, "SSLEAY_VERSION"); + } + } - libptr = dlopen(argv[1], 0); + dlclose(libptr); - ssl_version = (const char * (*)(int))dlsym(libptr, "SSLeay_version"); - if(ssl_version == NULL) { - ssl_version = (const char * (*)(int))dlsym(libptr, "ssleay_version"); - if(ssl_version == NULL) { - ssl_version = (const char * (*)(int))dlsym(libptr, "SSLEAY_VERSION"); - } - } + if(!ssl_version) { + puts("Unable to lookup version of OpenSSL"); + exit(1); + } - dlclose(libptr); + version = ssl_version(SSLEAY_VERSION); - if(ssl_version == NULL) { - puts("Unable to lookup version of OpenSSL"); - exit(1); - } + puts(version); - version = ssl_version(SSLEAY_VERSION); + /* Was a symbol argument given? */ + if(argc > 1) { + int status; + struct dsc$descriptor_s symbol_dsc; + struct dsc$descriptor_s value_dsc; + const unsigned long table_type = LIB$K_CLI_LOCAL_SYM; - puts(version); + symbol_dsc.dsc$a_pointer = argv[2]; + symbol_dsc.dsc$w_length = strlen(argv[2]); + symbol_dsc.dsc$b_dtype = DSC$K_DTYPE_T; + symbol_dsc.dsc$b_class = DSC$K_CLASS_S; - /* Was a symbol argument given? */ - if(argc > 1) { - int status; - struct dsc$descriptor_s symbol_dsc; - struct dsc$descriptor_s value_dsc; - const unsigned long table_type = LIB$K_CLI_LOCAL_SYM; + value_dsc.dsc$a_pointer = (char *)version; /* Cast ok */ + value_dsc.dsc$w_length = strlen(version); + value_dsc.dsc$b_dtype = DSC$K_DTYPE_T; + value_dsc.dsc$b_class = DSC$K_CLASS_S; - symbol_dsc.dsc$a_pointer = argv[2]; - symbol_dsc.dsc$w_length = strlen(argv[2]); - symbol_dsc.dsc$b_dtype = DSC$K_DTYPE_T; - symbol_dsc.dsc$b_class = DSC$K_CLASS_S; + status = LIB$SET_SYMBOL(&symbol_dsc, &value_dsc, &table_type); + if(!$VMS_STATUS_SUCCESS(status)) { + exit(status); + } + } - value_dsc.dsc$a_pointer = (char *)version; /* Cast ok */ - value_dsc.dsc$w_length = strlen(version); - value_dsc.dsc$b_dtype = DSC$K_DTYPE_T; - value_dsc.dsc$b_class = DSC$K_CLASS_S; - - status = LIB$SET_SYMBOL(&symbol_dsc, &value_dsc, &table_type); - if(!$VMS_STATUS_SUCCESS(status)) { - exit(status); - } - } - - exit(0); + exit(0); } diff --git a/deps/curl/packages/vms/setup_gnv_curl_build.com b/deps/curl/packages/vms/setup_gnv_curl_build.com index 8404ec3c..49882463 100644 --- a/deps/curl/packages/vms/setup_gnv_curl_build.com +++ b/deps/curl/packages/vms/setup_gnv_curl_build.com @@ -66,9 +66,9 @@ $! Set the compiler options for GNV CC wrapper to inherit. $ cc :== cc'clist''cnames'/nested_include_directory=none $ cxx :== cxx'clist''cnames'/nested_include_directory=none $ pointer_size = "32" -$! Note 64 bit pointers requires all libraries to either have -$! 64 bit pointers or have #pragma directives. -$! Currently building curl on VMS with 64 bit pointers does not work. +$! Note 64-bit pointers requires all libraries to either have +$! 64-bit pointers or have #pragma directives. +$! Currently building curl on VMS with 64-bit pointers does not work. $! $! A logical name to make it easier to find some of the hacks. $ define/job gnv_hacks 'base_dir' @@ -102,7 +102,7 @@ $ define/job decc$system_include prj_root:[.include.curl],- gnv$zlib_include:,- sys$sysroot:[kerberos.include] $! -$! Set up a include list for the compiler to find all the header files +$! Set up an include list for the compiler to find all the header files $! that they need. $! $ define/job decc$user_include src_root:[.include.curl] diff --git a/deps/curl/projects/README.md b/deps/curl/projects/README.md index 9b18ccd3..0e77f50e 100644 --- a/deps/curl/projects/README.md +++ b/deps/curl/projects/README.md @@ -8,10 +8,17 @@ Building via IDE Project Files ============================== This document describes how to compile, build and install curl and libcurl -from sources using an IDE based development tool such as Visual Studio. +from sources using legacy versions of Visual Studio 2010 - 2013. -Project files are available for several different Visual C++ versions. The -following directory structure has been used to cater for this: +You will need to generate the project files before using them. Please run +"generate -help" for usage details. + +To generate project files for recent versions of Visual Studio instead, use +cmake. Refer to INSTALL-CMAKE in the docs directory. + +## Directory Structure + +The following directory structure is used for the legacy project files: somedirectory\ |_curl @@ -78,55 +85,52 @@ has a default version of Visual C++. We offer these versions: - VC10 (Visual Studio 2010 Version 10.0) - VC11 (Visual Studio 2012 Version 11.0) - VC12 (Visual Studio 2013 Version 12.0) - - VC14 (Visual Studio 2015 Version 14.0) - - VC14.10 (Visual Studio 2017 Version 15.0) - - VC14.30 (Visual Studio 2022 Version 17.0) Separate solutions are provided for both libcurl and the curl command line tool as well as a solution that includes both projects. libcurl.sln, curl.sln and curl-all.sln, respectively. We recommend using curl-all.sln to build both projects. -For example, if you are using Visual Studio 2022 then you should be able to -use `VC14.30\curl-all.sln` to build curl and libcurl. +For example, if you are using Visual Studio 2010 then you should be able to +use `VC10\curl-all.sln` to build curl and libcurl. ## Running DLL based configurations If you are a developer and plan to run the curl tool from Visual Studio with -any third-party libraries (such as OpenSSL, wolfSSL or LibSSH2) then you will +any third-party libraries (such as OpenSSL, wolfSSL or libssh2) then you will need to add the search path of these DLLs to the configuration's PATH environment. To do that: 1. Open the 'curl-all.sln' or 'curl.sln' solutions 2. Right-click on the 'curl' project and select Properties 3. Navigate to 'Configuration Properties > Debugging > Environment' - 4. Add `PATH='Path to DLL';C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem` + 4. Add `PATH='Path to DLL';C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem` ... where 'Path to DLL` is the configuration specific path. For example the following configurations in Visual Studio 2010 might be: DLL Debug - DLL OpenSSL (Win32): - PATH=..\..\..\..\..\openssl\build\Win32\VC10\DLL Debug;C:\Windows\system32; + PATH=..\..\..\..\..\openssl\build\Win32\VC10\DLL Debug;C:\Windows\System32; C:\Windows;C:\Windows\System32\Wbem DLL Debug - DLL OpenSSL (x64): - PATH=..\..\..\..\..\openssl\build\Win64\VC10\DLL Debug;C:\Windows\system32; + PATH=..\..\..\..\..\openssl\build\Win64\VC10\DLL Debug;C:\Windows\System32; C:\Windows;C:\Windows\System32\Wbem DLL Debug - DLL wolfSSL (Win32): - PATH=..\..\..\..\..\wolfssl\build\Win32\VC10\DLL Debug;C:\Windows\system32; + PATH=..\..\..\..\..\wolfssl\build\Win32\VC10\DLL Debug;C:\Windows\System32; C:\Windows;C:\Windows\System32\Wbem DLL Debug - DLL wolfSSL (x64): - PATH=..\..\..\..\..\wolfssl\build\Win64\VC10\DLL Debug;C:\Windows\system32; + PATH=..\..\..\..\..\wolfssl\build\Win64\VC10\DLL Debug;C:\Windows\System32; 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' will need +(such as DLL Debug - DLL OpenSSL - DLL libssh2) then 'Path to DLL' will need to contain the path to both of these. ## Notes @@ -139,10 +143,6 @@ The following keywords have been used in the directory hierarchy: - `` - The target configuration (For example: DLL Debug, LIB Release - LIB OpenSSL) -If you are using the source code from the git repository, rather than a -release archive or nightly build, you will need to generate the project -files. Please run "generate -help" for usage details. - Should you wish to help out with some of the items on the TODO list, or find bugs in the project files that need correcting, and would like to submit updated files back then please note that, whilst the solution files can be diff --git a/deps/curl/projects/Windows/VC10/curl-all.sln b/deps/curl/projects/Windows/VC10/curl-all.sln index 7bd131c3..4a48651c 100644 --- a/deps/curl/projects/Windows/VC10/curl-all.sln +++ b/deps/curl/projects/Windows/VC10/curl-all.sln @@ -9,8 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxp EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -21,8 +21,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -33,32 +33,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -67,10 +67,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -91,10 +91,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -115,10 +115,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -131,10 +131,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -147,10 +147,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -163,10 +163,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 @@ -179,10 +179,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -203,10 +203,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -227,10 +227,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -243,10 +243,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -259,10 +259,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -275,10 +275,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC10/lib/libcurl.sln b/deps/curl/projects/Windows/VC10/lib/libcurl.sln index 15461ef9..a8c8a56c 100644 --- a/deps/curl/projects/Windows/VC10/lib/libcurl.sln +++ b/deps/curl/projects/Windows/VC10/lib/libcurl.sln @@ -4,8 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -16,8 +16,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -28,32 +28,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -62,10 +62,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -86,10 +86,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -110,10 +110,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -126,10 +126,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -142,10 +142,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -158,10 +158,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC10/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC10/lib/libcurl.tmpl index 7a37c270..1cc2453f 100644 --- a/deps/curl/projects/Windows/VC10/lib/libcurl.tmpl +++ b/deps/curl/projects/Windows/VC10/lib/libcurl.tmpl @@ -9,12 +9,12 @@ DLL Debug - DLL wolfSSL x64 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 Win32 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 x64 @@ -57,12 +57,12 @@ DLL Release - DLL wolfSSL x64 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 Win32 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 x64 @@ -97,12 +97,12 @@ DLL Release x64 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 Win32 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 x64 @@ -137,12 +137,12 @@ LIB Debug - LIB wolfSSL x64 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 Win32 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 x64 @@ -161,12 +161,12 @@ LIB Debug x64 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 Win32 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 x64 @@ -201,12 +201,12 @@ LIB Release - LIB wolfSSL x64 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 Win32 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 x64 @@ -231,7 +231,7 @@ libcurl - + StaticLibrary false Unicode @@ -251,7 +251,7 @@ false Unicode - + StaticLibrary false Unicode @@ -261,7 +261,7 @@ false Unicode - + StaticLibrary false Unicode @@ -281,7 +281,7 @@ false Unicode - + StaticLibrary false Unicode @@ -291,12 +291,12 @@ false Unicode - + DynamicLibrary false Unicode - + DynamicLibrary false Unicode @@ -371,7 +371,7 @@ false Unicode - + StaticLibrary false Unicode @@ -391,7 +391,7 @@ false Unicode - + StaticLibrary false Unicode @@ -401,7 +401,7 @@ false Unicode - + StaticLibrary false Unicode @@ -421,7 +421,7 @@ false Unicode - + StaticLibrary false Unicode @@ -431,12 +431,12 @@ false Unicode - + DynamicLibrary false Unicode - + DynamicLibrary false Unicode @@ -514,7 +514,7 @@ - + @@ -526,13 +526,13 @@ - + - + @@ -544,16 +544,16 @@ - + - + - + @@ -598,7 +598,7 @@ - + @@ -610,13 +610,13 @@ - + - + @@ -628,16 +628,16 @@ - + - + - + @@ -761,26 +761,26 @@ $(OutDir)lib\ false false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)lib\ - false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)lib\ + false ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)lib\ ..\..\..\..\build\Win64\VC10\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC10\$(Configuration)\ ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)lib\ @@ -793,18 +793,18 @@ $(OutDir)lib\ ..\..\..\..\build\Win64\VC10\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)lib\ ..\..\..\..\build\Win64\VC10\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC10\$(Configuration)\ ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)lib\ @@ -817,18 +817,18 @@ $(OutDir)lib\ ..\..\..\..\build\Win64\VC10\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)lib\ $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d @@ -839,16 +839,16 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d @@ -1684,7 +1684,7 @@ MachineX64 - + _DEBUG;%(PreprocessorDefinitions) true @@ -1718,7 +1718,7 @@ MachineX86 - + _DEBUG;%(PreprocessorDefinitions) true @@ -1751,7 +1751,7 @@ MachineX64 - + NDEBUG;%(PreprocessorDefinitions) true @@ -1783,7 +1783,7 @@ MachineX86 - + NDEBUG;%(PreprocessorDefinitions) true @@ -1857,7 +1857,7 @@ MachineX64 - + Disabled ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC10\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) @@ -1877,7 +1877,7 @@ MachineX86 - + X64 @@ -2029,7 +2029,7 @@ MachineX64 - + Disabled ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC10\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) @@ -2049,7 +2049,7 @@ MachineX86 - + X64 @@ -2115,7 +2115,7 @@ MachineX64 - + MaxSpeed OnlyExplicitInline @@ -2135,7 +2135,7 @@ MachineX86 - + X64 @@ -2287,7 +2287,7 @@ MachineX64 - + MaxSpeed OnlyExplicitInline @@ -2307,7 +2307,7 @@ MachineX86 - + X64 @@ -2350,4 +2350,4 @@ CURL_LIB_RC_FILES - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC10/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC10/lib/libcurl.vcxproj.filters index 4d6341d7..d2b9907a 100644 --- a/deps/curl/projects/Windows/VC10/lib/libcurl.vcxproj.filters +++ b/deps/curl/projects/Windows/VC10/lib/libcurl.vcxproj.filters @@ -14,4 +14,4 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC10/src/curl.sln b/deps/curl/projects/Windows/VC10/src/curl.sln index 131f27b7..9b8f96a2 100644 --- a/deps/curl/projects/Windows/VC10/src/curl.sln +++ b/deps/curl/projects/Windows/VC10/src/curl.sln @@ -4,8 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{52 EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -16,8 +16,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -28,32 +28,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -62,10 +62,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -86,10 +86,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -110,10 +110,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -126,10 +126,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -142,10 +142,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -158,10 +158,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC10/src/curl.tmpl b/deps/curl/projects/Windows/VC10/src/curl.tmpl index 5e24977a..074ea243 100644 --- a/deps/curl/projects/Windows/VC10/src/curl.tmpl +++ b/deps/curl/projects/Windows/VC10/src/curl.tmpl @@ -9,12 +9,12 @@ DLL Debug - DLL wolfSSL x64 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 Win32 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 x64 @@ -57,12 +57,12 @@ DLL Release - DLL wolfSSL x64 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 Win32 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 x64 @@ -97,12 +97,12 @@ DLL Release x64 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 Win32 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 x64 @@ -137,12 +137,12 @@ LIB Debug - LIB wolfSSL x64 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 Win32 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 x64 @@ -161,12 +161,12 @@ LIB Debug x64 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 Win32 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 x64 @@ -201,12 +201,12 @@ LIB Release - LIB wolfSSL x64 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 Win32 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 x64 @@ -251,12 +251,12 @@ false Unicode - + Application false Unicode - + Application false Unicode @@ -271,12 +271,12 @@ false Unicode - + Application false Unicode - + Application false Unicode @@ -291,12 +291,12 @@ false Unicode - + Application false Unicode - + Application false Unicode @@ -391,12 +391,12 @@ false Unicode - + Application false Unicode - + Application false Unicode @@ -411,12 +411,12 @@ false Unicode - + Application false Unicode - + Application false Unicode @@ -431,12 +431,12 @@ false Unicode - + Application false Unicode - + Application false Unicode @@ -526,10 +526,10 @@ - + - + @@ -538,10 +538,10 @@ - + - + @@ -550,10 +550,10 @@ - + - + @@ -610,10 +610,10 @@ - + - + @@ -622,10 +622,10 @@ - + - + @@ -634,10 +634,10 @@ - + - + @@ -769,18 +769,18 @@ $(OutDir)src\ false false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)src\ false @@ -793,18 +793,18 @@ ..\..\..\..\build\Win64\VC10\$(Configuration)\ $(OutDir)src\ false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)src\ false @@ -817,18 +817,18 @@ ..\..\..\..\build\Win64\VC10\$(Configuration)\ $(OutDir)src\ false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC10\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC10\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC10\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC10\$(Configuration)\ ..\..\..\..\build\Win32\VC10\$(Configuration)\ $(OutDir)src\ @@ -859,8 +859,8 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d @@ -871,41 +871,41 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) + $(ProjectName)d + $(ProjectName)d + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) @@ -1772,7 +1772,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -1803,7 +1803,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -1835,7 +1835,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -1864,7 +1864,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2016,7 +2016,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2047,7 +2047,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2079,7 +2079,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2108,7 +2108,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2260,7 +2260,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2291,7 +2291,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2323,7 +2323,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2352,7 +2352,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2640,4 +2640,4 @@ CURL_SRC_RC_FILES - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC10/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC10/src/curl.vcxproj.filters index 4d6341d7..d2b9907a 100644 --- a/deps/curl/projects/Windows/VC10/src/curl.vcxproj.filters +++ b/deps/curl/projects/Windows/VC10/src/curl.vcxproj.filters @@ -14,4 +14,4 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC11/curl-all.sln b/deps/curl/projects/Windows/VC11/curl-all.sln index bec0ad84..912f51ae 100644 --- a/deps/curl/projects/Windows/VC11/curl-all.sln +++ b/deps/curl/projects/Windows/VC11/curl-all.sln @@ -9,8 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxp EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -21,8 +21,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -33,32 +33,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -67,10 +67,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -91,10 +91,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -115,10 +115,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -131,10 +131,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -147,10 +147,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -163,10 +163,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 @@ -179,10 +179,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -203,10 +203,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -227,10 +227,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -243,10 +243,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -259,10 +259,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -275,10 +275,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC11/lib/libcurl.sln b/deps/curl/projects/Windows/VC11/lib/libcurl.sln index 780dc91a..e17c4cb8 100644 --- a/deps/curl/projects/Windows/VC11/lib/libcurl.sln +++ b/deps/curl/projects/Windows/VC11/lib/libcurl.sln @@ -4,8 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -16,8 +16,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -28,32 +28,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -62,10 +62,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -86,10 +86,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -110,10 +110,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -126,10 +126,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -142,10 +142,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -158,10 +158,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC11/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC11/lib/libcurl.tmpl index 95cc9f6c..477310f8 100644 --- a/deps/curl/projects/Windows/VC11/lib/libcurl.tmpl +++ b/deps/curl/projects/Windows/VC11/lib/libcurl.tmpl @@ -9,12 +9,12 @@ DLL Debug - DLL wolfSSL x64 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 Win32 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 x64 @@ -57,12 +57,12 @@ DLL Release - DLL wolfSSL x64 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 Win32 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 x64 @@ -97,12 +97,12 @@ DLL Release x64 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 Win32 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 x64 @@ -137,12 +137,12 @@ LIB Debug - LIB wolfSSL x64 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 Win32 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 x64 @@ -161,12 +161,12 @@ LIB Debug x64 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 Win32 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 x64 @@ -201,12 +201,12 @@ LIB Release - LIB wolfSSL x64 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 Win32 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 x64 @@ -231,7 +231,7 @@ libcurl - + StaticLibrary false Unicode @@ -255,7 +255,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -267,7 +267,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -291,7 +291,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -303,13 +303,13 @@ Unicode v110 - + DynamicLibrary false Unicode v110 - + DynamicLibrary false Unicode @@ -399,7 +399,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -423,7 +423,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -435,7 +435,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -459,7 +459,7 @@ Unicode v110 - + StaticLibrary false Unicode @@ -471,13 +471,13 @@ Unicode v110 - + DynamicLibrary false Unicode v110 - + DynamicLibrary false Unicode @@ -570,7 +570,7 @@ - + @@ -582,13 +582,13 @@ - + - + @@ -600,16 +600,16 @@ - + - + - + @@ -654,7 +654,7 @@ - + @@ -666,13 +666,13 @@ - + - + @@ -684,16 +684,16 @@ - + - + - + @@ -817,26 +817,26 @@ $(OutDir)lib\ false false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)lib\ - false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)lib\ + false ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)lib\ ..\..\..\..\build\Win64\VC11\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC11\$(Configuration)\ ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)lib\ @@ -849,18 +849,18 @@ $(OutDir)lib\ ..\..\..\..\build\Win64\VC11\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)lib\ ..\..\..\..\build\Win64\VC11\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC11\$(Configuration)\ ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)lib\ @@ -873,18 +873,18 @@ $(OutDir)lib\ ..\..\..\..\build\Win64\VC11\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)lib\ $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d @@ -895,16 +895,16 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d @@ -1740,7 +1740,7 @@ MachineX64 - + _DEBUG;%(PreprocessorDefinitions) true @@ -1774,7 +1774,7 @@ MachineX86 - + _DEBUG;%(PreprocessorDefinitions) true @@ -1807,7 +1807,7 @@ MachineX64 - + NDEBUG;%(PreprocessorDefinitions) true @@ -1839,7 +1839,7 @@ MachineX86 - + NDEBUG;%(PreprocessorDefinitions) true @@ -1913,7 +1913,7 @@ MachineX64 - + Disabled ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC11\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) @@ -1933,7 +1933,7 @@ MachineX86 - + X64 @@ -2085,7 +2085,7 @@ MachineX64 - + Disabled ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC11\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) @@ -2105,7 +2105,7 @@ MachineX86 - + X64 @@ -2171,7 +2171,7 @@ MachineX64 - + MaxSpeed OnlyExplicitInline @@ -2191,7 +2191,7 @@ MachineX86 - + X64 @@ -2343,7 +2343,7 @@ MachineX64 - + MaxSpeed OnlyExplicitInline @@ -2363,7 +2363,7 @@ MachineX86 - + X64 @@ -2406,4 +2406,4 @@ CURL_LIB_RC_FILES - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC11/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC11/lib/libcurl.vcxproj.filters index 4d6341d7..d2b9907a 100644 --- a/deps/curl/projects/Windows/VC11/lib/libcurl.vcxproj.filters +++ b/deps/curl/projects/Windows/VC11/lib/libcurl.vcxproj.filters @@ -14,4 +14,4 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC11/src/curl.sln b/deps/curl/projects/Windows/VC11/src/curl.sln index e12253e9..7996f2da 100644 --- a/deps/curl/projects/Windows/VC11/src/curl.sln +++ b/deps/curl/projects/Windows/VC11/src/curl.sln @@ -4,8 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{52 EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -16,8 +16,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -28,32 +28,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -62,10 +62,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -86,10 +86,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -110,10 +110,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -126,10 +126,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -142,10 +142,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -158,10 +158,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC11/src/curl.tmpl b/deps/curl/projects/Windows/VC11/src/curl.tmpl index 31df7d64..4405a469 100644 --- a/deps/curl/projects/Windows/VC11/src/curl.tmpl +++ b/deps/curl/projects/Windows/VC11/src/curl.tmpl @@ -9,12 +9,12 @@ DLL Debug - DLL wolfSSL x64 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 Win32 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 x64 @@ -57,12 +57,12 @@ DLL Release - DLL wolfSSL x64 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 Win32 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 x64 @@ -97,12 +97,12 @@ DLL Release x64 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 Win32 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 x64 @@ -137,12 +137,12 @@ LIB Debug - LIB wolfSSL x64 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 Win32 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 x64 @@ -161,12 +161,12 @@ LIB Debug x64 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 Win32 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 x64 @@ -201,12 +201,12 @@ LIB Release - LIB wolfSSL x64 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 Win32 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 x64 @@ -255,13 +255,13 @@ Unicode v110 - + Application false Unicode v110 - + Application false Unicode @@ -279,13 +279,13 @@ Unicode v110 - + Application false Unicode v110 - + Application false Unicode @@ -303,13 +303,13 @@ Unicode v110 - + Application false Unicode v110 - + Application false Unicode @@ -423,13 +423,13 @@ Unicode v110 - + Application false Unicode v110 - + Application false Unicode @@ -447,13 +447,13 @@ Unicode v110 - + Application false Unicode v110 - + Application false Unicode @@ -471,13 +471,13 @@ Unicode v110 - + Application false Unicode v110 - + Application false Unicode @@ -582,10 +582,10 @@ - + - + @@ -594,10 +594,10 @@ - + - + @@ -606,10 +606,10 @@ - + - + @@ -666,10 +666,10 @@ - + - + @@ -678,10 +678,10 @@ - + - + @@ -690,10 +690,10 @@ - + - + @@ -825,18 +825,18 @@ $(OutDir)src\ false false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)src\ false @@ -849,18 +849,18 @@ ..\..\..\..\build\Win64\VC11\$(Configuration)\ $(OutDir)src\ false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)src\ false @@ -873,18 +873,18 @@ ..\..\..\..\build\Win64\VC11\$(Configuration)\ $(OutDir)src\ false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC11\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC11\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC11\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC11\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC11\$(Configuration)\ ..\..\..\..\build\Win32\VC11\$(Configuration)\ $(OutDir)src\ @@ -915,8 +915,8 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d @@ -927,41 +927,41 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) + $(ProjectName)d + $(ProjectName)d + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) @@ -1828,7 +1828,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -1859,7 +1859,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -1891,7 +1891,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -1920,7 +1920,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2072,7 +2072,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2103,7 +2103,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2135,7 +2135,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2164,7 +2164,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2316,7 +2316,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2347,7 +2347,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2379,7 +2379,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2408,7 +2408,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2696,4 +2696,4 @@ CURL_SRC_RC_FILES - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC11/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC11/src/curl.vcxproj.filters index 4d6341d7..d2b9907a 100644 --- a/deps/curl/projects/Windows/VC11/src/curl.vcxproj.filters +++ b/deps/curl/projects/Windows/VC11/src/curl.vcxproj.filters @@ -14,4 +14,4 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC12/curl-all.sln b/deps/curl/projects/Windows/VC12/curl-all.sln index 38b33e6f..31ddd136 100644 --- a/deps/curl/projects/Windows/VC12/curl-all.sln +++ b/deps/curl/projects/Windows/VC12/curl-all.sln @@ -9,8 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxp EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -21,8 +21,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -33,32 +33,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -67,10 +67,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -91,10 +91,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -115,10 +115,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -131,10 +131,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -147,10 +147,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -163,10 +163,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 @@ -179,10 +179,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -203,10 +203,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -227,10 +227,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -243,10 +243,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -259,10 +259,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -275,10 +275,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC12/lib/libcurl.sln b/deps/curl/projects/Windows/VC12/lib/libcurl.sln index 860a0602..0487ef82 100644 --- a/deps/curl/projects/Windows/VC12/lib/libcurl.sln +++ b/deps/curl/projects/Windows/VC12/lib/libcurl.sln @@ -4,8 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -16,8 +16,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -28,32 +28,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -62,10 +62,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -86,10 +86,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -110,10 +110,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -126,10 +126,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -142,10 +142,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -158,10 +158,10 @@ Global {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC12/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC12/lib/libcurl.tmpl index a2d666c2..2b1db48e 100644 --- a/deps/curl/projects/Windows/VC12/lib/libcurl.tmpl +++ b/deps/curl/projects/Windows/VC12/lib/libcurl.tmpl @@ -9,12 +9,12 @@ DLL Debug - DLL wolfSSL x64 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 Win32 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 x64 @@ -57,12 +57,12 @@ DLL Release - DLL wolfSSL x64 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 Win32 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 x64 @@ -97,12 +97,12 @@ DLL Release x64 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 Win32 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 x64 @@ -137,12 +137,12 @@ LIB Debug - LIB wolfSSL x64 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 Win32 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 x64 @@ -161,12 +161,12 @@ LIB Debug x64 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 Win32 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 x64 @@ -201,12 +201,12 @@ LIB Release - LIB wolfSSL x64 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 Win32 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 x64 @@ -231,7 +231,7 @@ libcurl - + StaticLibrary false Unicode @@ -255,7 +255,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -267,7 +267,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -291,7 +291,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -303,13 +303,13 @@ Unicode v120 - + DynamicLibrary false Unicode v120 - + DynamicLibrary false Unicode @@ -399,7 +399,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -423,7 +423,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -435,7 +435,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -459,7 +459,7 @@ Unicode v120 - + StaticLibrary false Unicode @@ -471,13 +471,13 @@ Unicode v120 - + DynamicLibrary false Unicode v120 - + DynamicLibrary false Unicode @@ -570,7 +570,7 @@ - + @@ -582,13 +582,13 @@ - + - + @@ -600,16 +600,16 @@ - + - + - + @@ -654,7 +654,7 @@ - + @@ -666,13 +666,13 @@ - + - + @@ -684,16 +684,16 @@ - + - + - + @@ -817,26 +817,26 @@ $(OutDir)lib\ false false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)lib\ - false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)lib\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)lib\ + false ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)lib\ ..\..\..\..\build\Win64\VC12\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC12\$(Configuration)\ ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)lib\ @@ -849,18 +849,18 @@ $(OutDir)lib\ ..\..\..\..\build\Win64\VC12\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)lib\ ..\..\..\..\build\Win64\VC12\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)lib\ ..\..\..\..\build\Win32\VC12\$(Configuration)\ ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)lib\ @@ -873,18 +873,18 @@ $(OutDir)lib\ ..\..\..\..\build\Win64\VC12\$(Configuration)\ $(OutDir)lib\ - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)lib\ + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)lib\ + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)lib\ $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d @@ -895,16 +895,16 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d @@ -1740,7 +1740,7 @@ MachineX64 - + _DEBUG;%(PreprocessorDefinitions) true @@ -1774,7 +1774,7 @@ MachineX86 - + _DEBUG;%(PreprocessorDefinitions) true @@ -1807,7 +1807,7 @@ MachineX64 - + NDEBUG;%(PreprocessorDefinitions) true @@ -1839,7 +1839,7 @@ MachineX86 - + NDEBUG;%(PreprocessorDefinitions) true @@ -1913,7 +1913,7 @@ MachineX64 - + Disabled ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC12\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) @@ -1933,7 +1933,7 @@ MachineX86 - + X64 @@ -2085,7 +2085,7 @@ MachineX64 - + Disabled ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC12\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) @@ -2105,7 +2105,7 @@ MachineX86 - + X64 @@ -2171,7 +2171,7 @@ MachineX64 - + MaxSpeed OnlyExplicitInline @@ -2191,7 +2191,7 @@ MachineX86 - + X64 @@ -2343,7 +2343,7 @@ MachineX64 - + MaxSpeed OnlyExplicitInline @@ -2363,7 +2363,7 @@ MachineX86 - + X64 @@ -2406,4 +2406,4 @@ CURL_LIB_RC_FILES - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC12/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC12/lib/libcurl.vcxproj.filters index 4d6341d7..d2b9907a 100644 --- a/deps/curl/projects/Windows/VC12/lib/libcurl.vcxproj.filters +++ b/deps/curl/projects/Windows/VC12/lib/libcurl.vcxproj.filters @@ -14,4 +14,4 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC12/src/curl.sln b/deps/curl/projects/Windows/VC12/src/curl.sln index 7b5244c1..bbee81f0 100644 --- a/deps/curl/projects/Windows/VC12/src/curl.sln +++ b/deps/curl/projects/Windows/VC12/src/curl.sln @@ -4,8 +4,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{52 EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + DLL Debug - DLL OpenSSL - DLL libssh2|Win32 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + DLL Debug - DLL OpenSSL - DLL libssh2|x64 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 @@ -16,8 +16,8 @@ Global DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 DLL Debug|Win32 = DLL Debug|Win32 DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + DLL Release - DLL OpenSSL - DLL libssh2|Win32 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + DLL Release - DLL OpenSSL - DLL libssh2|x64 = DLL Release - DLL OpenSSL - DLL libssh2|x64 DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 @@ -28,32 +28,32 @@ Global DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 DLL Release|Win32 = DLL Release|Win32 DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + LIB Debug - DLL OpenSSL - DLL libssh2|Win32 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + LIB Debug - DLL OpenSSL - DLL libssh2|x64 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + LIB Debug - LIB OpenSSL - LIB libssh2|Win32 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + LIB Debug - LIB OpenSSL - LIB libssh2|x64 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 LIB Debug|Win32 = LIB Debug|Win32 LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + LIB Release - DLL OpenSSL - DLL libssh2|Win32 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + LIB Release - DLL OpenSSL - DLL libssh2|x64 = LIB Release - DLL OpenSSL - DLL libssh2|x64 LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + LIB Release - LIB OpenSSL - LIB libssh2|Win32 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + LIB Release - LIB OpenSSL - LIB libssh2|x64 = LIB Release - LIB OpenSSL - LIB libssh2|x64 LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 @@ -62,10 +62,10 @@ Global LIB Release|x64 = LIB Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 @@ -86,10 +86,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 @@ -110,10 +110,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 @@ -126,10 +126,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 @@ -142,10 +142,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL libssh2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 @@ -158,10 +158,10 @@ Global {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|Win32 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB libssh2|x64 + {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB libssh2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB libssh2|x64 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 diff --git a/deps/curl/projects/Windows/VC12/src/curl.tmpl b/deps/curl/projects/Windows/VC12/src/curl.tmpl index 77c244e4..2e9438dd 100644 --- a/deps/curl/projects/Windows/VC12/src/curl.tmpl +++ b/deps/curl/projects/Windows/VC12/src/curl.tmpl @@ -9,12 +9,12 @@ DLL Debug - DLL wolfSSL x64 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 Win32 - - DLL Debug - DLL OpenSSL - DLL LibSSH2 + + DLL Debug - DLL OpenSSL - DLL libssh2 x64 @@ -57,12 +57,12 @@ DLL Release - DLL wolfSSL x64 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 Win32 - - DLL Release - DLL OpenSSL - DLL LibSSH2 + + DLL Release - DLL OpenSSL - DLL libssh2 x64 @@ -97,12 +97,12 @@ DLL Release x64 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 Win32 - - LIB Debug - DLL OpenSSL - DLL LibSSH2 + + LIB Debug - DLL OpenSSL - DLL libssh2 x64 @@ -137,12 +137,12 @@ LIB Debug - LIB wolfSSL x64 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 Win32 - - LIB Debug - LIB OpenSSL - LIB LibSSH2 + + LIB Debug - LIB OpenSSL - LIB libssh2 x64 @@ -161,12 +161,12 @@ LIB Debug x64 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 Win32 - - LIB Release - DLL OpenSSL - DLL LibSSH2 + + LIB Release - DLL OpenSSL - DLL libssh2 x64 @@ -201,12 +201,12 @@ LIB Release - LIB wolfSSL x64 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 Win32 - - LIB Release - LIB OpenSSL - LIB LibSSH2 + + LIB Release - LIB OpenSSL - LIB libssh2 x64 @@ -255,13 +255,13 @@ Unicode v120 - + Application false Unicode v120 - + Application false Unicode @@ -279,13 +279,13 @@ Unicode v120 - + Application false Unicode v120 - + Application false Unicode @@ -303,13 +303,13 @@ Unicode v120 - + Application false Unicode v120 - + Application false Unicode @@ -423,13 +423,13 @@ Unicode v120 - + Application false Unicode v120 - + Application false Unicode @@ -447,13 +447,13 @@ Unicode v120 - + Application false Unicode v120 - + Application false Unicode @@ -471,13 +471,13 @@ Unicode v120 - + Application false Unicode v120 - + Application false Unicode @@ -582,10 +582,10 @@ - + - + @@ -594,10 +594,10 @@ - + - + @@ -606,10 +606,10 @@ - + - + @@ -666,10 +666,10 @@ - + - + @@ -678,10 +678,10 @@ - + - + @@ -690,10 +690,10 @@ - + - + @@ -825,18 +825,18 @@ $(OutDir)src\ false false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)src\ false @@ -849,18 +849,18 @@ ..\..\..\..\build\Win64\VC12\$(Configuration)\ $(OutDir)src\ false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)src\ false @@ -873,18 +873,18 @@ ..\..\..\..\build\Win64\VC12\$(Configuration)\ $(OutDir)src\ false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC12\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC12\$(Configuration)\ - $(OutDir)src\ - false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win32\VC12\$(Configuration)\ + $(OutDir)src\ + false + ..\..\..\..\build\Win64\VC12\$(Configuration)\ + $(OutDir)src\ + false ..\..\..\..\build\Win32\VC12\$(Configuration)\ ..\..\..\..\build\Win32\VC12\$(Configuration)\ $(OutDir)src\ @@ -915,8 +915,8 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d @@ -927,41 +927,41 @@ $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d + $(ProjectName)d + $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) + $(ProjectName)d + $(ProjectName)d + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) - $(ProjectName) + $(ProjectName) $(ProjectName) $(ProjectName) $(ProjectName) @@ -1828,7 +1828,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -1859,7 +1859,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -1891,7 +1891,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -1920,7 +1920,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2072,7 +2072,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2103,7 +2103,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2135,7 +2135,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2164,7 +2164,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2316,7 +2316,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2347,7 +2347,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2379,7 +2379,7 @@ MachineX64 - + $(TargetDir)$(TargetName).tlb @@ -2408,7 +2408,7 @@ MachineX86 - + X64 $(TargetDir)$(TargetName).tlb @@ -2696,4 +2696,4 @@ CURL_SRC_RC_FILES - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC12/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC12/src/curl.vcxproj.filters index 4d6341d7..d2b9907a 100644 --- a/deps/curl/projects/Windows/VC12/src/curl.vcxproj.filters +++ b/deps/curl/projects/Windows/VC12/src/curl.vcxproj.filters @@ -14,4 +14,4 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - \ No newline at end of file + diff --git a/deps/curl/projects/Windows/VC14.10/.gitignore b/deps/curl/projects/Windows/VC14.10/.gitignore deleted file mode 100644 index 11504d2c..00000000 --- a/deps/curl/projects/Windows/VC14.10/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opendb -/*.opensdf -/*.sdf -/*.vc.db -/.vs diff --git a/deps/curl/projects/Windows/VC14.10/curl-all.sln b/deps/curl/projects/Windows/VC14.10/curl-all.sln deleted file mode 100644 index e563caee..00000000 --- a/deps/curl/projects/Windows/VC14.10/curl-all.sln +++ /dev/null @@ -1,298 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "src\curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" - ProjectSection(ProjectDependencies) = postProject - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.10/lib/.gitignore b/deps/curl/projects/Windows/VC14.10/lib/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14.10/lib/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14.10/lib/libcurl.sln b/deps/curl/projects/Windows/VC14.10/lib/libcurl.sln deleted file mode 100644 index 595bdb20..00000000 --- a/deps/curl/projects/Windows/VC14.10/lib/libcurl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.10/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC14.10/lib/libcurl.tmpl deleted file mode 100644 index 5560ad6a..00000000 --- a/deps/curl/projects/Windows/VC14.10/lib/libcurl.tmpl +++ /dev/null @@ -1,2381 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - libcurl - - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - StaticLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - DynamicLibrary - false - Unicode - v141 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)lib\ - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.10\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.10\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - -CURL_LIB_C_FILES -CURL_LIB_VAUTH_C_FILES -CURL_LIB_VQUIC_C_FILES -CURL_LIB_VSSH_C_FILES -CURL_LIB_VTLS_C_FILES - - -CURL_LIB_H_FILES -CURL_LIB_VAUTH_H_FILES -CURL_LIB_VQUIC_H_FILES -CURL_LIB_VSSH_H_FILES -CURL_LIB_VTLS_H_FILES - - -CURL_LIB_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.10/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC14.10/lib/libcurl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14.10/lib/libcurl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.10/src/.gitignore b/deps/curl/projects/Windows/VC14.10/src/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14.10/src/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14.10/src/curl.sln b/deps/curl/projects/Windows/VC14.10/src/curl.sln deleted file mode 100644 index 2af09591..00000000 --- a/deps/curl/projects/Windows/VC14.10/src/curl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.10/src/curl.tmpl b/deps/curl/projects/Windows/VC14.10/src/curl.tmpl deleted file mode 100644 index 307b4b16..00000000 --- a/deps/curl/projects/Windows/VC14.10/src/curl.tmpl +++ /dev/null @@ -1,2671 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {5228E9CE-A216-422F-A5E6-58E95E2DD71D} - curl - - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - Application - false - Unicode - v141 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.10\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14.10\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14.10\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14.10\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14.10\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\LIB Debug;..\..\..\..\..\libssh2\build\Win32\VC14.10\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\LIB Debug;..\..\..\..\..\libssh2\build\Win64\VC14.10\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\LIB Release;..\..\..\..\..\libssh2\build\Win32\VC14.10\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\LIB Release;..\..\..\..\..\libssh2\build\Win64\VC14.10\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14.10\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.10\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libssh2.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.10\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14.10\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.10\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - -CURL_SRC_X_C_FILES -CURL_SRC_C_FILES - - -CURL_SRC_X_H_FILES -CURL_SRC_H_FILES - - -CURL_SRC_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.10/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC14.10/src/curl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14.10/src/curl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.20/.gitignore b/deps/curl/projects/Windows/VC14.20/.gitignore deleted file mode 100644 index 11504d2c..00000000 --- a/deps/curl/projects/Windows/VC14.20/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opendb -/*.opensdf -/*.sdf -/*.vc.db -/.vs diff --git a/deps/curl/projects/Windows/VC14.20/curl-all.sln b/deps/curl/projects/Windows/VC14.20/curl-all.sln deleted file mode 100644 index 99231009..00000000 --- a/deps/curl/projects/Windows/VC14.20/curl-all.sln +++ /dev/null @@ -1,298 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 16 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "src\curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" - ProjectSection(ProjectDependencies) = postProject - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.20/lib/.gitignore b/deps/curl/projects/Windows/VC14.20/lib/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14.20/lib/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14.20/lib/libcurl.sln b/deps/curl/projects/Windows/VC14.20/lib/libcurl.sln deleted file mode 100644 index e34b5eb5..00000000 --- a/deps/curl/projects/Windows/VC14.20/lib/libcurl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 17 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.20/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC14.20/lib/libcurl.tmpl deleted file mode 100644 index ff88b422..00000000 --- a/deps/curl/projects/Windows/VC14.20/lib/libcurl.tmpl +++ /dev/null @@ -1,2381 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - libcurl - - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - StaticLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - DynamicLibrary - false - Unicode - v142 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)lib\ - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.20\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.20\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - -CURL_LIB_C_FILES -CURL_LIB_VAUTH_C_FILES -CURL_LIB_VQUIC_C_FILES -CURL_LIB_VSSH_C_FILES -CURL_LIB_VTLS_C_FILES - - -CURL_LIB_H_FILES -CURL_LIB_VAUTH_H_FILES -CURL_LIB_VQUIC_H_FILES -CURL_LIB_VSSH_H_FILES -CURL_LIB_VTLS_H_FILES - - -CURL_LIB_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.20/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC14.20/lib/libcurl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14.20/lib/libcurl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.20/src/.gitignore b/deps/curl/projects/Windows/VC14.20/src/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14.20/src/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14.20/src/curl.sln b/deps/curl/projects/Windows/VC14.20/src/curl.sln deleted file mode 100644 index 5cfa4ce2..00000000 --- a/deps/curl/projects/Windows/VC14.20/src/curl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 16 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.20/src/curl.tmpl b/deps/curl/projects/Windows/VC14.20/src/curl.tmpl deleted file mode 100644 index 85c71768..00000000 --- a/deps/curl/projects/Windows/VC14.20/src/curl.tmpl +++ /dev/null @@ -1,2671 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {5228E9CE-A216-422F-A5E6-58E95E2DD71D} - curl - - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - Application - false - Unicode - v142 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.20\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14.20\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14.20\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14.20\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14.20\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\LIB Debug;..\..\..\..\..\libssh2\build\Win32\VC14.20\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\LIB Debug;..\..\..\..\..\libssh2\build\Win64\VC14.20\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\LIB Release;..\..\..\..\..\libssh2\build\Win32\VC14.20\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\LIB Release;..\..\..\..\..\libssh2\build\Win64\VC14.20\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14.20\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.20\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libssh2.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.20\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14.20\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.20\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - -CURL_SRC_X_C_FILES -CURL_SRC_C_FILES - - -CURL_SRC_X_H_FILES -CURL_SRC_H_FILES - - -CURL_SRC_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.20/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC14.20/src/curl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14.20/src/curl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.30/.gitignore b/deps/curl/projects/Windows/VC14.30/.gitignore deleted file mode 100644 index 11504d2c..00000000 --- a/deps/curl/projects/Windows/VC14.30/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opendb -/*.opensdf -/*.sdf -/*.vc.db -/.vs diff --git a/deps/curl/projects/Windows/VC14.30/curl-all.sln b/deps/curl/projects/Windows/VC14.30/curl-all.sln deleted file mode 100644 index fc56613f..00000000 --- a/deps/curl/projects/Windows/VC14.30/curl-all.sln +++ /dev/null @@ -1,298 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 17 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "src\curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" - ProjectSection(ProjectDependencies) = postProject - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.30/lib/.gitignore b/deps/curl/projects/Windows/VC14.30/lib/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14.30/lib/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14.30/lib/libcurl.sln b/deps/curl/projects/Windows/VC14.30/lib/libcurl.sln deleted file mode 100644 index e34b5eb5..00000000 --- a/deps/curl/projects/Windows/VC14.30/lib/libcurl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 17 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.30/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC14.30/lib/libcurl.tmpl deleted file mode 100644 index a7afb4f2..00000000 --- a/deps/curl/projects/Windows/VC14.30/lib/libcurl.tmpl +++ /dev/null @@ -1,2381 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - libcurl - - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - StaticLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - DynamicLibrary - false - Unicode - v143 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)lib\ - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14.30\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14.30\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - -CURL_LIB_C_FILES -CURL_LIB_VAUTH_C_FILES -CURL_LIB_VQUIC_C_FILES -CURL_LIB_VSSH_C_FILES -CURL_LIB_VTLS_C_FILES - - -CURL_LIB_H_FILES -CURL_LIB_VAUTH_H_FILES -CURL_LIB_VQUIC_H_FILES -CURL_LIB_VSSH_H_FILES -CURL_LIB_VTLS_H_FILES - - -CURL_LIB_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.30/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC14.30/lib/libcurl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14.30/lib/libcurl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.30/src/.gitignore b/deps/curl/projects/Windows/VC14.30/src/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14.30/src/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14.30/src/curl.sln b/deps/curl/projects/Windows/VC14.30/src/curl.sln deleted file mode 100644 index 2c16858f..00000000 --- a/deps/curl/projects/Windows/VC14.30/src/curl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 17 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14.30/src/curl.tmpl b/deps/curl/projects/Windows/VC14.30/src/curl.tmpl deleted file mode 100644 index 2d8772ef..00000000 --- a/deps/curl/projects/Windows/VC14.30/src/curl.tmpl +++ /dev/null @@ -1,2671 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {5228E9CE-A216-422F-A5E6-58E95E2DD71D} - curl - - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - Application - false - Unicode - v143 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win32\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - ..\..\..\..\build\Win64\VC14.30\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14.30\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14.30\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14.30\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14.30\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\LIB Debug;..\..\..\..\..\libssh2\build\Win32\VC14.30\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\LIB Debug;..\..\..\..\..\libssh2\build\Win64\VC14.30\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\LIB Release;..\..\..\..\..\libssh2\build\Win32\VC14.30\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\LIB Release;..\..\..\..\..\libssh2\build\Win64\VC14.30\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14.30\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14.30\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libssh2.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14.30\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14.30\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14.30\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - -CURL_SRC_X_C_FILES -CURL_SRC_C_FILES - - -CURL_SRC_X_H_FILES -CURL_SRC_H_FILES - - -CURL_SRC_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14.30/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC14.30/src/curl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14.30/src/curl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14/.gitignore b/deps/curl/projects/Windows/VC14/.gitignore deleted file mode 100644 index 11504d2c..00000000 --- a/deps/curl/projects/Windows/VC14/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opendb -/*.opensdf -/*.sdf -/*.vc.db -/.vs diff --git a/deps/curl/projects/Windows/VC14/curl-all.sln b/deps/curl/projects/Windows/VC14/curl-all.sln deleted file mode 100644 index 05820e1f..00000000 --- a/deps/curl/projects/Windows/VC14/curl-all.sln +++ /dev/null @@ -1,298 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2015 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "src\curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" - ProjectSection(ProjectDependencies) = postProject - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "lib\libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14/lib/.gitignore b/deps/curl/projects/Windows/VC14/lib/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14/lib/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14/lib/libcurl.sln b/deps/curl/projects/Windows/VC14/lib/libcurl.sln deleted file mode 100644 index cd8afe24..00000000 --- a/deps/curl/projects/Windows/VC14/lib/libcurl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2015 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.DLL Release|x64.Build.0 = DLL Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14/lib/libcurl.tmpl b/deps/curl/projects/Windows/VC14/lib/libcurl.tmpl deleted file mode 100644 index 07823b29..00000000 --- a/deps/curl/projects/Windows/VC14/lib/libcurl.tmpl +++ /dev/null @@ -1,2409 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} - libcurl - - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - StaticLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - DynamicLibrary - false - Unicode - v140 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)lib\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)lib\ - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win32\VC14\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WOLFSSL;USE_IPV6;WOLFSSL_DLL;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\wolfssl\build\Win64\VC14\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - 4214 - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\wolfssl;..\..\..\..\..\wolfssl\wolfssl;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - 4214 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - %(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14\DLL Debug;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - _DEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - Win32 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win32\VC14\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14\DLL Release;%(AdditionalLibraryDirectories) - $(IntDir)$(TargetFileName).intermediate.manifest - $(TargetDir)$(TargetName).lib - MachineX86 - - - - - NDEBUG;%(PreprocessorDefinitions) - true - X64 - $(OutDir)$(ProjectName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\..\openssl\build\Win64\VC14\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14\DLL Release;%(AdditionalLibraryDirectories) - $(TargetDir)$(TargetName).lib - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\LIB Debug\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\LIB Debug\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - _DEBUG;BUILDING_LIBCURL;DEBUGBUILD;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\DLL Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WINDOWS_SSPI;USE_SCHANNEL;USE_WIN32_IDN;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\LIB Release\include;..\..\..\..\..\openssl\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win32\VC14\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX86 - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;..\..\..\..\..\openssl\include\..\build\Win64\VC14\LIB Release\include;..\..\..\..\..\openssl\include;..\..\..\..\..\libssh2\include;%(AdditionalIncludeDirectories) - NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_OPENSSL;USE_LIBSSH2;USE_IPV6;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - $(OutDir)$(TargetName)$(TargetExt) - MachineX64 - - - -CURL_LIB_C_FILES -CURL_LIB_VAUTH_C_FILES -CURL_LIB_VQUIC_C_FILES -CURL_LIB_VSSH_C_FILES -CURL_LIB_VTLS_C_FILES - - -CURL_LIB_H_FILES -CURL_LIB_VAUTH_H_FILES -CURL_LIB_VQUIC_H_FILES -CURL_LIB_VSSH_H_FILES -CURL_LIB_VTLS_H_FILES - - -CURL_LIB_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14/lib/libcurl.vcxproj.filters b/deps/curl/projects/Windows/VC14/lib/libcurl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14/lib/libcurl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14/src/.gitignore b/deps/curl/projects/Windows/VC14/src/.gitignore deleted file mode 100644 index 5baee834..00000000 --- a/deps/curl/projects/Windows/VC14/src/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) Daniel Stenberg, , et al. -# -# SPDX-License-Identifier: curl - -/*.opensdf -/*.sdf -/*.user -/*.vc.db -/*.vcxproj -/.vs diff --git a/deps/curl/projects/Windows/VC14/src/curl.sln b/deps/curl/projects/Windows/VC14/src/curl.sln deleted file mode 100644 index b40c18be..00000000 --- a/deps/curl/projects/Windows/VC14/src/curl.sln +++ /dev/null @@ -1,181 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2015 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - DLL Debug - DLL OpenSSL|Win32 = DLL Debug - DLL OpenSSL|Win32 - DLL Debug - DLL OpenSSL|x64 = DLL Debug - DLL OpenSSL|x64 - DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - DLL Debug - DLL Windows SSPI|Win32 = DLL Debug - DLL Windows SSPI|Win32 - DLL Debug - DLL Windows SSPI|x64 = DLL Debug - DLL Windows SSPI|x64 - DLL Debug - DLL wolfSSL|Win32 = DLL Debug - DLL wolfSSL|Win32 - DLL Debug - DLL wolfSSL|x64 = DLL Debug - DLL wolfSSL|x64 - DLL Debug|Win32 = DLL Debug|Win32 - DLL Debug|x64 = DLL Debug|x64 - DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - DLL Release - DLL OpenSSL - DLL LibSSH2|x64 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - DLL Release - DLL OpenSSL|Win32 = DLL Release - DLL OpenSSL|Win32 - DLL Release - DLL OpenSSL|x64 = DLL Release - DLL OpenSSL|x64 - DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - DLL Release - DLL Windows SSPI - DLL WinIDN|x64 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - DLL Release - DLL Windows SSPI|Win32 = DLL Release - DLL Windows SSPI|Win32 - DLL Release - DLL Windows SSPI|x64 = DLL Release - DLL Windows SSPI|x64 - DLL Release - DLL wolfSSL|Win32 = DLL Release - DLL wolfSSL|Win32 - DLL Release - DLL wolfSSL|x64 = DLL Release - DLL wolfSSL|x64 - DLL Release|Win32 = DLL Release|Win32 - DLL Release|x64 = DLL Release|x64 - LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - LIB Debug - DLL OpenSSL|Win32 = LIB Debug - DLL OpenSSL|Win32 - LIB Debug - DLL OpenSSL|x64 = LIB Debug - DLL OpenSSL|x64 - LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - LIB Debug - DLL Windows SSPI|Win32 = LIB Debug - DLL Windows SSPI|Win32 - LIB Debug - DLL Windows SSPI|x64 = LIB Debug - DLL Windows SSPI|x64 - LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - LIB Debug - LIB OpenSSL|Win32 = LIB Debug - LIB OpenSSL|Win32 - LIB Debug - LIB OpenSSL|x64 = LIB Debug - LIB OpenSSL|x64 - LIB Debug - LIB wolfSSL|Win32 = LIB Debug - LIB wolfSSL|Win32 - LIB Debug - LIB wolfSSL|x64 = LIB Debug - LIB wolfSSL|x64 - LIB Debug|Win32 = LIB Debug|Win32 - LIB Debug|x64 = LIB Debug|x64 - LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - LIB Release - DLL OpenSSL - DLL LibSSH2|x64 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - LIB Release - DLL OpenSSL|Win32 = LIB Release - DLL OpenSSL|Win32 - LIB Release - DLL OpenSSL|x64 = LIB Release - DLL OpenSSL|x64 - LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - LIB Release - DLL Windows SSPI - DLL WinIDN|x64 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - LIB Release - DLL Windows SSPI|Win32 = LIB Release - DLL Windows SSPI|Win32 - LIB Release - DLL Windows SSPI|x64 = LIB Release - DLL Windows SSPI|x64 - LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - LIB Release - LIB OpenSSL - LIB LibSSH2|x64 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - LIB Release - LIB OpenSSL|Win32 = LIB Release - LIB OpenSSL|Win32 - LIB Release - LIB OpenSSL|x64 = LIB Release - LIB OpenSSL|x64 - LIB Release - LIB wolfSSL|Win32 = LIB Release - LIB wolfSSL|Win32 - LIB Release - LIB wolfSSL|x64 = LIB Release - LIB wolfSSL|x64 - LIB Release|Win32 = LIB Release|Win32 - LIB Release|x64 = LIB Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.ActiveCfg = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|Win32.Build.0 = DLL Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.ActiveCfg = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL OpenSSL|x64.Build.0 = DLL Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.ActiveCfg = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|Win32.Build.0 = DLL Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.ActiveCfg = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL Windows SSPI|x64.Build.0 = DLL Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.ActiveCfg = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|Win32.Build.0 = DLL Debug - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.ActiveCfg = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug - DLL wolfSSL|x64.Build.0 = DLL Debug - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Debug|x64.Build.0 = DLL Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = DLL Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.ActiveCfg = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|Win32.Build.0 = DLL Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.ActiveCfg = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL OpenSSL|x64.Build.0 = DLL Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = DLL Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.ActiveCfg = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|Win32.Build.0 = DLL Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.ActiveCfg = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL Windows SSPI|x64.Build.0 = DLL Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.ActiveCfg = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|Win32.Build.0 = DLL Release - DLL wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.ActiveCfg = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release - DLL wolfSSL|x64.Build.0 = DLL Release - DLL wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|Win32.Build.0 = DLL Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.ActiveCfg = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.DLL Release|x64.Build.0 = DLL Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Debug - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.ActiveCfg = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|Win32.Build.0 = LIB Debug - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.ActiveCfg = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL OpenSSL|x64.Build.0 = LIB Debug - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Debug - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.ActiveCfg = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|Win32.Build.0 = LIB Debug - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.ActiveCfg = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - DLL Windows SSPI|x64.Build.0 = LIB Debug - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Debug - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.ActiveCfg = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|Win32.Build.0 = LIB Debug - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.ActiveCfg = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB OpenSSL|x64.Build.0 = LIB Debug - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.ActiveCfg = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|Win32.Build.0 = LIB Debug - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.ActiveCfg = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug - LIB wolfSSL|x64.Build.0 = LIB Debug - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.ActiveCfg = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|Win32.Build.0 = LIB Debug|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.ActiveCfg = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Debug|x64.Build.0 = LIB Debug|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|Win32.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.ActiveCfg = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL - DLL LibSSH2|x64.Build.0 = LIB Release - DLL OpenSSL - DLL LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.ActiveCfg = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|Win32.Build.0 = LIB Release - DLL OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.ActiveCfg = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL OpenSSL|x64.Build.0 = LIB Release - DLL OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|Win32.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.ActiveCfg = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI - DLL WinIDN|x64.Build.0 = LIB Release - DLL Windows SSPI - DLL WinIDN|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.ActiveCfg = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|Win32.Build.0 = LIB Release - DLL Windows SSPI|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.ActiveCfg = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - DLL Windows SSPI|x64.Build.0 = LIB Release - DLL Windows SSPI|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|Win32.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.ActiveCfg = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL - LIB LibSSH2|x64.Build.0 = LIB Release - LIB OpenSSL - LIB LibSSH2|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.ActiveCfg = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|Win32.Build.0 = LIB Release - LIB OpenSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.ActiveCfg = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB OpenSSL|x64.Build.0 = LIB Release - LIB OpenSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.ActiveCfg = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|Win32.Build.0 = LIB Release - LIB wolfSSL|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.ActiveCfg = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release - LIB wolfSSL|x64.Build.0 = LIB Release - LIB wolfSSL|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.ActiveCfg = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|Win32.Build.0 = LIB Release|Win32 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.ActiveCfg = LIB Release|x64 - {5228E9CE-A216-422F-A5E6-58E95E2DD71D}.LIB Release|x64.Build.0 = LIB Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/deps/curl/projects/Windows/VC14/src/curl.tmpl b/deps/curl/projects/Windows/VC14/src/curl.tmpl deleted file mode 100644 index 9f0e54b4..00000000 --- a/deps/curl/projects/Windows/VC14/src/curl.tmpl +++ /dev/null @@ -1,2699 +0,0 @@ - - - - - DLL Debug - DLL wolfSSL - Win32 - - - DLL Debug - DLL wolfSSL - x64 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Debug - DLL OpenSSL - Win32 - - - DLL Debug - DLL OpenSSL - x64 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Debug - DLL Windows SSPI - Win32 - - - DLL Debug - DLL Windows SSPI - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - DLL wolfSSL - Win32 - - - DLL Release - DLL wolfSSL - x64 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - DLL Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - DLL Release - DLL OpenSSL - Win32 - - - DLL Release - DLL OpenSSL - x64 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - DLL Release - DLL Windows SSPI - DLL WinIDN - x64 - - - DLL Release - DLL Windows SSPI - Win32 - - - DLL Release - DLL Windows SSPI - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Debug - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Debug - DLL OpenSSL - Win32 - - - LIB Debug - DLL OpenSSL - x64 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Debug - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Debug - DLL Windows SSPI - Win32 - - - LIB Debug - DLL Windows SSPI - x64 - - - LIB Debug - LIB wolfSSL - Win32 - - - LIB Debug - LIB wolfSSL - x64 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Debug - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Debug - LIB OpenSSL - Win32 - - - LIB Debug - LIB OpenSSL - x64 - - - LIB Debug - Win32 - - - LIB Debug - x64 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - Win32 - - - LIB Release - DLL OpenSSL - DLL LibSSH2 - x64 - - - LIB Release - DLL OpenSSL - Win32 - - - LIB Release - DLL OpenSSL - x64 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - Win32 - - - LIB Release - DLL Windows SSPI - DLL WinIDN - x64 - - - LIB Release - DLL Windows SSPI - Win32 - - - LIB Release - DLL Windows SSPI - x64 - - - LIB Release - LIB wolfSSL - Win32 - - - LIB Release - LIB wolfSSL - x64 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - Win32 - - - LIB Release - LIB OpenSSL - LIB LibSSH2 - x64 - - - LIB Release - LIB OpenSSL - Win32 - - - LIB Release - LIB OpenSSL - x64 - - - LIB Release - Win32 - - - LIB Release - x64 - - - - {5228E9CE-A216-422F-A5E6-58E95E2DD71D} - curl - - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - Application - false - Unicode - v140 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - ..\..\..\..\build\Win32\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - ..\..\..\..\build\Win64\VC14\$(Configuration)\ - $(OutDir)src\ - $(OutDir)src\ - false - false - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName)d - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - true - $(TargetDir)$(TargetName).pdb - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - true - $(TargetDir)$(TargetName).pdb - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\wolfssl\build\Win32\VC14\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;wolfssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\wolfssl\build\Win64\VC14\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\LIB Debug;..\..\..\..\..\libssh2\build\Win32\VC14\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\LIB Debug;..\..\..\..\..\libssh2\build\Win64\VC14\LIB Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\LIB Release;..\..\..\..\..\libssh2\build\Win32\VC14\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\LIB Release;..\..\..\..\..\libssh2\build\Win64\VC14\LIB Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\DLL Debug;..\..\..\..\..\libssh2\build\Win32\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurld.lib;libcrypto.lib;libssl.lib;libssh2d.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\DLL Debug;..\..\..\..\..\libssh2\build\Win64\VC14\DLL Debug;%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libcrypto.lib;libssl.lib;libssh2.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win32\VC14\DLL Release;..\..\..\..\..\libssh2\build\Win32\VC14\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - crypt32.lib;ws2_32.lib;wldap32.lib;libcurl.lib;libssh2.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);..\..\..\..\..\openssl\build\Win64\VC14\DLL Release;..\..\..\..\..\libssh2\build\Win64\VC14\DLL Release;%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - Disabled - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - _DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level4 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - true - $(TargetDir)$(TargetName).pdb - Console - MachineX64 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX86 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - - - X64 - $(TargetDir)$(TargetName).tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories) - NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\..\..\include;%(AdditionalIncludeDirectories) - - - ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories) - Console - MachineX64 - - - -CURL_SRC_X_C_FILES -CURL_SRC_C_FILES - - -CURL_SRC_X_H_FILES -CURL_SRC_H_FILES - - -CURL_SRC_RC_FILES - - - - - \ No newline at end of file diff --git a/deps/curl/projects/Windows/VC14/src/curl.vcxproj.filters b/deps/curl/projects/Windows/VC14/src/curl.vcxproj.filters deleted file mode 100644 index 4d6341d7..00000000 --- a/deps/curl/projects/Windows/VC14/src/curl.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/deps/curl/projects/build-openssl.bat b/deps/curl/projects/build-openssl.bat index b6453834..f1ebbddb 100644 --- a/deps/curl/projects/build-openssl.bat +++ b/deps/curl/projects/build-openssl.bat @@ -241,7 +241,7 @@ rem *************************************************************************** echo. cd /d "%START_DIR%" || (echo Error: Failed cd start & exit /B 1) - rem Save the full path of the openssl source dir + rem Save the full path of the OpenSSL source dir set "SOURCE_PATH=%CD%" rem Set temporary paths for building and installing OpenSSL. If a temporary diff --git a/deps/curl/projects/checksrc.bat b/deps/curl/projects/checksrc.bat index 018dc596..69e3d8c4 100644 --- a/deps/curl/projects/checksrc.bat +++ b/deps/curl/projects/checksrc.bat @@ -115,7 +115,7 @@ rem *************************************************************************** if "%CHECK_SRC%" == "TRUE" ( rem Check the src directory if exist %SRC_DIR%\src ( - for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\scripts\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_hugehelp.c "%%i" + for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\scripts\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_ca_embed.c -Wtool_hugehelp.c "%%i" for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\scripts\checksrc.pl" "-D%SRC_DIR%\src" "%%i" ) ) diff --git a/deps/curl/projects/generate.bat b/deps/curl/projects/generate.bat index 9c41d34f..8145883f 100644 --- a/deps/curl/projects/generate.bat +++ b/deps/curl/projects/generate.bat @@ -52,22 +52,18 @@ rem *************************************************************************** set VERSION=VC11 ) else if /i "%~1" == "vc12" ( set VERSION=VC12 - ) else if /i "%~1" == "vc14" ( - set VERSION=VC14 - ) else if /i "%~1" == "vc14.10" ( - set VERSION=VC14.10 - ) else if /i "%~1" == "vc14.20" ( - set VERSION=VC14.20 - ) else if /i "%~1" == "vc14.30" ( - set VERSION=VC14.30 ) else if /i "%~1" == "-clean" ( set MODE=CLEAN ) else if /i "%~1" == "-?" ( goto syntax + ) else if /i "%~1" == "/?" ( + goto syntax ) else if /i "%~1" == "-h" ( goto syntax ) else if /i "%~1" == "-help" ( goto syntax + ) else if /i "%~1" == "--help" ( + goto syntax ) else ( goto unknown ) @@ -88,10 +84,6 @@ rem *************************************************************************** if "%VERSION%" == "VC10" goto vc10 if "%VERSION%" == "VC11" goto vc11 if "%VERSION%" == "VC12" goto vc12 - if "%VERSION%" == "VC14" goto vc14 - if "%VERSION%" == "VC14.10" goto vc14.10 - if "%VERSION%" == "VC14.20" goto vc14.20 - if "%VERSION%" == "VC14.30" goto vc14.30 :vc10 echo. @@ -136,66 +128,6 @@ rem *************************************************************************** call :clean Windows\VC12\lib\libcurl.vcxproj ) - if not "%VERSION%" == "ALL" goto success - -:vc14 - echo. - - if "%MODE%" == "GENERATE" ( - echo Generating VC14 project files - call :generate vcxproj Windows\VC14\src\curl.tmpl Windows\VC14\src\curl.vcxproj - call :generate vcxproj Windows\VC14\lib\libcurl.tmpl Windows\VC14\lib\libcurl.vcxproj - ) else ( - echo Removing VC14 project files - call :clean Windows\VC14\src\curl.vcxproj - call :clean Windows\VC14\lib\libcurl.vcxproj - ) - - if not "%VERSION%" == "ALL" goto success - -:vc14.10 - echo. - - if "%MODE%" == "GENERATE" ( - echo Generating VC14.10 project files - call :generate vcxproj Windows\VC14.10\src\curl.tmpl Windows\VC14.10\src\curl.vcxproj - call :generate vcxproj Windows\VC14.10\lib\libcurl.tmpl Windows\VC14.10\lib\libcurl.vcxproj - ) else ( - echo Removing VC14.10 project files - call :clean Windows\VC14.10\src\curl.vcxproj - call :clean Windows\VC14.10\lib\libcurl.vcxproj - ) - - if not "%VERSION%" == "ALL" goto success - -:vc14.20 - echo. - - if "%MODE%" == "GENERATE" ( - echo Generating VC14.20 project files - call :generate vcxproj Windows\VC14.20\src\curl.tmpl Windows\VC14.20\src\curl.vcxproj - call :generate vcxproj Windows\VC14.20\lib\libcurl.tmpl Windows\VC14.20\lib\libcurl.vcxproj - ) else ( - echo Removing VC14.20 project files - call :clean Windows\VC14.20\src\curl.vcxproj - call :clean Windows\VC14.20\lib\libcurl.vcxproj - ) - - if not "%VERSION%" == "ALL" goto success - -:vc14.30 - echo. - - if "%MODE%" == "GENERATE" ( - echo Generating VC14.30 project files - call :generate vcxproj Windows\VC14.30\src\curl.tmpl Windows\VC14.30\src\curl.vcxproj - call :generate vcxproj Windows\VC14.30\lib\libcurl.tmpl Windows\VC14.30\lib\libcurl.vcxproj - ) else ( - echo Removing VC14.30 project files - call :clean Windows\VC14.30\src\curl.vcxproj - call :clean Windows\VC14.30\lib\libcurl.vcxproj - ) - goto success rem Main generate function. @@ -375,10 +307,11 @@ rem echo vc10 - Use Visual Studio 2010 echo vc11 - Use Visual Studio 2012 echo vc12 - Use Visual Studio 2013 - echo vc14 - Use Visual Studio 2015 - echo vc14.10 - Use Visual Studio 2017 - echo vc14.20 - Use Visual Studio 2019 - echo vc14.30 - Use Visual Studio 2022 + echo. + echo Only legacy Visual Studio project files can be generated. + echo. + echo To generate recent versions of Visual Studio project files use cmake. + echo Refer to INSTALL-CMAKE in the docs directory. echo. echo -clean - Removes the project files goto error diff --git a/deps/curl/projects/wolfssl_options.h b/deps/curl/projects/wolfssl_options.h index 3ef23fbc..ebc35d85 100644 --- a/deps/curl/projects/wolfssl_options.h +++ b/deps/curl/projects/wolfssl_options.h @@ -29,7 +29,7 @@ build-wolfssl will copy to the wolfSSL include directories and will result in maximum compatibility. These are the configure options that were used to build wolfSSL v5.1.1 in -mingw and generate the options in this file: +MinGW and generate the options in this file: C_EXTRA_FLAGS="\ -Wno-attributes \ @@ -75,7 +75,7 @@ create the thread local storage and that could be a problem for LoadLibrary. Regarding the options that were added via C_EXTRA_FLAGS: FP_MAX_BITS=16384 -https://www.yassl.com/forums/topic423-cacertorgs-ca-cert-verify-failed-but-withdisablefastmath-it-works.html +https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html "Since root.crt uses a 4096-bit RSA key, you'll need to increase the fastmath buffer size. You can do this using the define: FP_MAX_BITS and setting it to 8192." diff --git a/deps/curl/projects/wolfssl_override.props b/deps/curl/projects/wolfssl_override.props index fab60f3c..b81ba13d 100644 --- a/deps/curl/projects/wolfssl_override.props +++ b/deps/curl/projects/wolfssl_override.props @@ -16,7 +16,7 @@ file by using the CustomAfterMicrosoftCommonTargets property. --> $(SolutionDir)\wolfssl\options.h;%(ForcedIncludeFiles); _UNICODE;UNICODE;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(UndefinePreprocessorDefinitions); diff --git a/deps/curl/renovate.json b/deps/curl/renovate.json new file mode 100644 index 00000000..f8b54078 --- /dev/null +++ b/deps/curl/renovate.json @@ -0,0 +1,100 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:best-practices", + ":disableDependencyDashboard" + ], + "semanticCommitType": "ci", + "packageRules": [ + { + "matchManagers": [ + "github-actions" + ], + "commitMessagePrefix": "gha: ", + "labels": [ + "CI" + ] + }, + { + "matchUpdateTypes": [ + "pin", + "pinDigest", + "digest" + ], + "commitMessagePrefix": "ci: ", + "labels": [ + "CI" + ] + }, + { + "matchManagers": [ + "custom.regex" + ], + "commitMessagePrefix": "ci: ", + "labels": [ + "CI" + ] + }, + { + "matchDepNames": [ + "debian" + ], + "matchFileNames": [ + ".github/workflows/linux-old.yml" + ], + "enabled": false + } + ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": [ + ".circleci/config.yml" + ], + "matchStrings": [ + "# renovate: datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?( extractVersion=(?.+?))?( registryUrl=(?.*?))?\\s.*?_VER=(?.*)\\s" + ], + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}", + "extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^v?(?.+)${{/if}}" + }, + { + "customType": "regex", + "fileMatch": [ + "^.github/workflows/.*\\.yml$" + ], + "matchStrings": [ + "# renovate: datasource=(?.*?) depName=(?.*?)( versioning=(?.*?))?( extractVersion=(?.+?))?( registryUrl=(?.*?))?\\s.*?-version:\\s*(?.*)\\s" + ], + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}", + "extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^v?(?.+)${{/if}}" + }, + { + "customType": "regex", + "fileMatch": [ + "^.github/workflows/linux.yml$", + "^.github/workflows/http3-linux.yml$" + ], + "matchStrings": [ + "openssl-version: (?.*)\\s" + ], + "datasourceTemplate": "github-tags", + "depNameTemplate": "openssl/openssl", + "versioningTemplate": "semver", + "extractVersionTemplate": "^openssl-(?.*)$" + }, + { + "customType": "regex", + "fileMatch": [ + "^.github/workflows/linux.yml$", + "^.github/workflows/http3-linux.yml$" + ], + "matchStrings": [ + "quictls-version: (?.*)\\s" + ], + "datasourceTemplate": "github-tags", + "depNameTemplate": "quictls/openssl", + "versioningTemplate": "semver", + "extractVersionTemplate": "^openssl-(?.*)-quic1$" + } + ] +} diff --git a/deps/curl/scripts/Makefile.am b/deps/curl/scripts/Makefile.am index 2d136d8e..4454d42c 100644 --- a/deps/curl/scripts/Makefile.am +++ b/deps/curl/scripts/Makefile.am @@ -23,7 +23,8 @@ ########################################################################### EXTRA_DIST = coverage.sh completion.pl firefox-db2pem.sh checksrc.pl \ - mk-ca-bundle.pl schemetable.c cd2nroff nroff2cd cdall cd2cd + mk-ca-bundle.pl mk-unity.pl schemetable.c cd2nroff nroff2cd cdall cd2cd managen \ + dmaketgz maketgz release-tools.sh verify-release cmakelint.sh ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@ FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@ @@ -68,13 +69,13 @@ if USE_ZSH_COMPLETION if test -n "$(PERL)"; then \ $(MKDIR_P) $(DESTDIR)$(ZSH_FUNCTIONS_DIR); \ $(INSTALL_DATA) $(ZSH_COMPLETION_FUNCTION_FILENAME) $(DESTDIR)$(ZSH_FUNCTIONS_DIR)/$(ZSH_COMPLETION_FUNCTION_FILENAME) ; \ - fi + fi endif if USE_FISH_COMPLETION if test -n "$(PERL)"; then \ $(MKDIR_P) $(DESTDIR)$(FISH_FUNCTIONS_DIR); \ $(INSTALL_DATA) $(FISH_COMPLETION_FUNCTION_FILENAME) $(DESTDIR)$(FISH_FUNCTIONS_DIR)/$(FISH_COMPLETION_FUNCTION_FILENAME) ; \ - fi + fi endif endif diff --git a/deps/curl/scripts/cd2nroff b/deps/curl/scripts/cd2nroff index 5d699ca0..4c905009 100644 --- a/deps/curl/scripts/cd2nroff +++ b/deps/curl/scripts/cd2nroff @@ -25,7 +25,7 @@ =begin comment -Converts a curldown file to nroff (man page). +Converts a curldown file to nroff (manpage). =end comment =cut @@ -77,11 +77,11 @@ HELP use POSIX qw(strftime); my @ts; if (defined($ENV{SOURCE_DATE_EPOCH})) { - @ts = localtime($ENV{SOURCE_DATE_EPOCH}); + @ts = gmtime($ENV{SOURCE_DATE_EPOCH}); } else { @ts = localtime; } -my $date = strftime "%B %d %Y", @ts; +my $date = strftime "%Y-%m-%d", @ts; sub outseealso { my (@sa) = @_; @@ -96,17 +96,119 @@ sub outseealso { return @o; } +sub outprotocols { + my (@p) = @_; + my $comma = 0; + my @o; + push @o, ".SH PROTOCOLS\n"; + + if($p[0] eq "TLS") { + push @o, "This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc."; + } + else { + my @s = sort @p; + push @o, "This functionality affects "; + for my $e (sort @s) { + push @o, sprintf "%s%s", + $comma ? (($e eq $s[-1]) ? " and " : ", "): "", + lc($e); + $comma = 1; + } + if($#s == 0) { + if($s[0] eq "All") { + push @o, " supported protocols"; + } + else { + push @o, " only"; + } + } + } + push @o, "\n"; + return @o; +} + +sub outtls { + my (@t) = @_; + my $comma = 0; + my @o; + if($t[0] eq "All") { + push @o, "\nAll TLS backends support this option."; + } + else { + push @o, "\nThis option works only with the following TLS backends:\n"; + my @s = sort @t; + for my $e (@s) { + push @o, sprintf "%s$e", + $comma ? (($e eq $s[-1]) ? " and " : ", "): ""; + $comma = 1; + } + } + push @o, "\n"; + return @o; +} + +my %knownprotos = ( + 'DICT' => 1, + 'FILE' => 1, + 'FTP' => 1, + 'FTPS' => 1, + 'GOPHER' => 1, + 'GOPHERS' => 1, + 'HTTP' => 1, + 'HTTPS' => 1, + 'IMAP' => 1, + 'IMAPS' => 1, + 'LDAP' => 1, + 'LDAPS' => 1, + 'MQTT' => 1, + 'POP3' => 1, + 'POP3S' => 1, + 'RTMP' => 1, + 'RTMPS' => 1, + 'RTSP' => 1, + 'SCP' => 1, + 'SFTP' => 1, + 'SMB' => 1, + 'SMBS' => 1, + 'SMTP' => 1, + 'SMTPS' => 1, + 'TELNET' => 1, + 'TFTP' => 1, + 'WS' => 1, + 'WSS' => 1, + 'TLS' => 1, + 'TCP' => 1, + 'QUIC' => 1, + 'All' => 1 + ); + +my %knowntls = ( + 'BearSSL' => 1, + 'GnuTLS' => 1, + 'mbedTLS' => 1, + 'OpenSSL' => 1, + 'rustls' => 1, + 'Schannel' => 1, + 'Secure Transport' => 1, + 'wolfSSL' => 1, + 'All' => 1, + ); + sub single { my @seealso; + my @proto; + my @tls; my $d; my ($f)=@_; my $copyright; my $errors = 0; my $fh; my $line; - my $salist; + my $list; + my $tlslist; my $section; my $source; + my $addedin; my $spdx; my $start = 0; my $title; @@ -141,7 +243,7 @@ sub single { $source=$1; } elsif(/^See-also: +(.*)/i) { - $salist = 0; + $list = 1; # 1 for see-also push @seealso, $1; } elsif(/^See-also: */i) { @@ -149,13 +251,37 @@ sub single { print STDERR "$f:$line:1:ERROR: bad See-Also, needs list\n"; return 2; } - $salist = 1; + $list = 1; # 1 for see-also + } + elsif(/^Protocol:/i) { + $list = 2; # 2 for protocol + } + elsif(/^TLS-backend:/i) { + $list = 3; # 3 for TLS backend + } + elsif(/^Added-in: *(.*)/i) { + $addedin=$1; + if(($addedin !~ /^[0-9.]+[0-9]\z/) && + ($addedin ne "n/a")) { + print STDERR "$f:$line:1:ERROR: invalid version number in Added-in line: $addedin\n"; + return 2; + } } elsif(/^ +- (.*)/i) { - # the only list we support is the see-also - if($salist) { + # the only lists we support are see-also and protocol + if($list == 1) { push @seealso, $1; } + elsif($list == 2) { + push @proto, $1; + } + elsif($list == 3) { + push @tls, $1; + } + else { + print STDERR "$f:$line:1:ERROR: list item without owner?\n"; + return 2; + } } # REUSE-IgnoreStart elsif(/^C: (.*)/i) { @@ -168,11 +294,19 @@ sub single { elsif(/^---/) { # end of the header section if(!$title) { - print STDERR "ERROR: no 'Title:' in $f\n"; + print STDERR "$f:$line:1:ERROR: no 'Title:' in $f\n"; return 1; } if(!$section) { - print STDERR "ERROR: no 'Section:' in $f\n"; + print STDERR "$f:$line:1:ERROR: no 'Section:' in $f\n"; + return 2; + } + if(!$source) { + print STDERR "$f:$line:1:ERROR: no 'Source:' in $f\n"; + return 2; + } + if(($source eq "libcurl") && !$addedin) { + print STDERR "$f:$line:1:ERROR: no 'Added-in:' in $f\n"; return 2; } if(!$seealso[0]) { @@ -187,11 +321,41 @@ sub single { print STDERR "$f:$line:1:ERROR: no 'SPDX-License-Identifier:' field present\n"; return 2; } + if($section == 3) { + if(!$proto[0]) { + printf STDERR "$f:$line:1:ERROR: missing Protocol:\n"; + exit 2; + } + my $tls = 0; + for my $p (@proto) { + if($p eq "TLS") { + $tls = 1; + } + if(!$knownprotos{$p}) { + printf STDERR "$f:$line:1:ERROR: invalid protocol used: $p:\n"; + exit 2; + } + } + # This is for TLS, require TLS-backend: + if($tls) { + if(!$tls[0]) { + printf STDERR "$f:$line:1:ERROR: missing TLS-backend:\n"; + exit 2; + } + for my $t (@tls) { + if(!$knowntls{$t}) { + printf STDERR "$f:$line:1:ERROR: invalid TLS backend: $t:\n"; + exit 2; + } + } + } + } last; } else { chomp; - print STDERR "WARN: unrecognized line in $f, ignoring:\n:'$_';" + print STDERR "$f:$line:1:ERROR: unrecognized header keyword: '$_'\n"; + $errors++; } } @@ -252,12 +416,13 @@ sub single { $d =~ s/\*(\S.*?)\*/\\fI$1\\fP/g; if($d =~ /[^\\][\<\>]/) { - print STDERR "$f:$line:1:WARN: un-escaped < or > used\n"; + print STDERR "$f:$line:1:ERROR: un-escaped < or > used\n"; + $errors++; } # convert backslash-'<' or '> to just the second character $d =~ s/\\([<>])/$1/g; - # mentions of curl symbols with man pages use italics by default + # mentions of curl symbols with manpages use italics by default $d =~ s/((lib|)curl([^ ]*\(3\)))/\\fI$1\\fP/gi; # backticked becomes italics @@ -277,10 +442,41 @@ sub single { } $header = 1; } + elsif(/^##/) { + # end of IP sequence + push @desc, ".PP\n"; + $header = 1; + } elsif(/^# (.*)/) { my $word = $1; # if there are enclosing quotes, remove them first $word =~ s/[\"\'](.*)[\"\']\z/$1/; + + if($word eq "PROTOCOLS") { + print STDERR "$f:$line:1:WARN: PROTOCOLS section in source file\n"; + } + elsif($word eq "AVAILABILITY") { + print STDERR "$f:$line:1:WARN: AVAILABILITY section in source file\n"; + } + elsif($word eq "%PROTOCOLS%") { + # insert the generated PROTOCOLS section + push @desc, outprotocols(@proto); + + if($proto[0] eq "TLS") { + push @desc, outtls(@tls); + } + $header = 1; + next; + } + elsif($word eq "%AVAILABILITY%") { + if($addedin ne "n/a") { + # insert the generated AVAILABILITY section + push @desc, ".SH AVAILABILITY\n"; + push @desc, "Added in curl $addedin\n"; + } + $header = 1; + next; + } push @desc, ".SH $word\n"; $header = 1; } diff --git a/deps/curl/scripts/checksrc.pl b/deps/curl/scripts/checksrc.pl index be085e06..7075278d 100644 --- a/deps/curl/scripts/checksrc.pl +++ b/deps/curl/scripts/checksrc.pl @@ -50,54 +50,59 @@ my @ignore_line; my %warnings_extended = ( 'COPYRIGHTYEAR' => 'copyright year incorrect', 'STRERROR', => 'strerror() detected', + 'STRNCPY', => 'strncpy() detected', 'STDERR', => 'stderr detected', ); my %warnings = ( 'ASSIGNWITHINCONDITION' => 'assignment within conditional expression', - 'ASTERISKNOSPACE' => 'pointer declared without space before asterisk', - 'ASTERISKSPACE' => 'pointer declared with space after asterisk', - 'BADCOMMAND' => 'bad !checksrc! instruction', - 'BANNEDFUNC' => 'a banned function was used', - 'BANNEDPREPROC' => 'a banned symbol was used on a preprocessor line', - 'BRACEELSE' => '} else on the same line', - 'BRACEPOS' => 'wrong position for an open brace', - 'BRACEWHILE' => 'A single space between open brace and while', - 'COMMANOSPACE' => 'comma without following space', - 'COMMENTNOSPACEEND' => 'no space before */', - 'COMMENTNOSPACESTART' => 'no space following /*', - 'COPYRIGHT' => 'file missing a copyright statement', - 'CPPCOMMENTS' => '// comment detected', - 'DOBRACE' => 'A single space between do and open brace', - 'EMPTYLINEBRACE' => 'Empty line before the open brace', - 'EQUALSNOSPACE' => 'equals sign without following space', - 'EQUALSNULL' => 'if/while comparison with == NULL', - 'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression', - 'FOPENMODE' => 'fopen needs a macro for the mode string', - 'INCLUDEDUP', => 'same file is included again', - 'INDENTATION' => 'wrong start column for code', - 'LONGLINE' => "Line longer than $max_column", - 'SPACEBEFORELABEL' => 'labels not at the start of the line', - 'MULTISPACE' => 'multiple spaces used when not suitable', - 'NOSPACEEQUALS' => 'equals sign without preceding space', - 'NOTEQUALSZERO', => 'if/while comparison with != 0', - 'ONELINECONDITION' => 'conditional block on the same line as the if()', - 'OPENCOMMENT' => 'file ended with a /* comment still "open"', - 'PARENBRACE' => '){ without sufficient space', - 'RETURNNOSPACE' => 'return without space', - 'SEMINOSPACE' => 'semicolon without following space', - 'SIZEOFNOPAREN' => 'use of sizeof without parentheses', - 'SNPRINTF' => 'use of snprintf', - 'SPACEAFTERPAREN' => 'space after open parenthesis', - 'SPACEBEFORECLOSE' => 'space before a close parenthesis', - 'SPACEBEFORECOMMA' => 'space before a comma', - 'SPACEBEFOREPAREN' => 'space before an open parenthesis', - 'SPACESEMICOLON' => 'space before semicolon', - 'SPACESWITCHCOLON' => 'space before colon of switch label', - 'TABS' => 'TAB characters not allowed', - 'TRAILINGSPACE' => 'Trailing whitespace on the line', - 'TYPEDEFSTRUCT' => 'typedefed struct', - 'UNUSEDIGNORE' => 'a warning ignore was not used', + 'ASTERISKNOSPACE' => 'pointer declared without space before asterisk', + 'ASTERISKSPACE' => 'pointer declared with space after asterisk', + 'BADCOMMAND' => 'bad !checksrc! instruction', + 'BANNEDFUNC' => 'a banned function was used', + 'BANNEDPREPROC' => 'a banned symbol was used on a preprocessor line', + 'BRACEELSE' => '} else on the same line', + 'BRACEPOS' => 'wrong position for an open brace', + 'BRACEWHILE' => 'A single space between open brace and while', + 'COMMANOSPACE' => 'comma without following space', + 'COMMENTNOSPACEEND' => 'no space before */', + 'COMMENTNOSPACESTART' => 'no space following /*', + 'COPYRIGHT' => 'file missing a copyright statement', + 'CPPCOMMENTS' => '// comment detected', + 'DOBRACE' => 'A single space between do and open brace', + 'EMPTYLINEBRACE' => 'Empty line before the open brace', + 'EQUALSNOSPACE' => 'equals sign without following space', + 'EQUALSNULL' => 'if/while comparison with == NULL', + 'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression', + 'FOPENMODE' => 'fopen needs a macro for the mode string', + 'INCLUDEDUP', => 'same file is included again', + 'INDENTATION' => 'wrong start column for code', + 'LONGLINE' => "Line longer than $max_column", + 'SPACEBEFORELABEL' => 'labels not at the start of the line', + 'MULTISPACE' => 'multiple spaces used when not suitable', + 'NOSPACEAND' => 'missing space around Logical AND operator', + 'NOSPACEC' => 'missing space around ternary colon operator', + 'NOSPACEEQUALS' => 'equals sign without preceding space', + 'NOSPACEQ' => 'missing space around ternary question mark operator', + 'NOSPACETHAN' => 'missing space around less or greater than', + 'NOTEQUALSZERO', => 'if/while comparison with != 0', + 'ONELINECONDITION' => 'conditional block on the same line as the if()', + 'OPENCOMMENT' => 'file ended with a /* comment still "open"', + 'PARENBRACE' => '){ without sufficient space', + 'RETURNNOSPACE' => 'return without space', + 'SEMINOSPACE' => 'semicolon without following space', + 'SIZEOFNOPAREN' => 'use of sizeof without parentheses', + 'SNPRINTF' => 'use of snprintf', + 'SPACEAFTERPAREN' => 'space after open parenthesis', + 'SPACEBEFORECLOSE' => 'space before a close parenthesis', + 'SPACEBEFORECOMMA' => 'space before a comma', + 'SPACEBEFOREPAREN' => 'space before an open parenthesis', + 'SPACESEMICOLON' => 'space before semicolon', + 'SPACESWITCHCOLON' => 'space before colon of switch label', + 'TABS' => 'TAB characters not allowed', + 'TRAILINGSPACE' => 'Trailing whitespace on the line', + 'TYPEDEFSTRUCT' => 'typedefed struct', + 'UNUSEDIGNORE' => 'a warning ignore was not used', ); sub readskiplist { @@ -115,9 +120,20 @@ sub readskiplist { # and since that's already handled via !checksrc! commands there is probably # little use to add it. sub readlocalfile { + my ($file) = @_; my $i = 0; + my $rcfile; - open(my $rcfile, "<", "$dir/.checksrc") or return; + if(($dir eq ".") && $file =~ /\//) { + my $ldir; + if($file =~ /(.*)\//) { + $ldir = $1; + open($rcfile, "<", "$dir/$ldir/.checksrc") or return; + } + } + else { + open($rcfile, "<", "$dir/.checksrc") or return; + } while(<$rcfile>) { $windows_os ? $_ =~ s/\r?\n$// : chomp; @@ -264,7 +280,7 @@ if(!$file) { } readskiplist(); -readlocalfile(); +readlocalfile($file); do { if("$wlist" !~ / $file /) { @@ -611,6 +627,76 @@ sub scanfile { "space after open parenthesis"); } + # check spaces before Logical AND operator + if($nostr =~ /^(.*)\w&&/i) { + checkwarn("NOSPACEAND", + $line, length($1)+1, $file, $l, + "missing space before Logical AND"); + } + + # check spaces after Logical AND operator + if($nostr =~ /^(.*&&)\w/i) { + checkwarn("NOSPACEAND", + $line, length($1), $file, $l, + "missing space after Logical AND"); + } + + # check spaces before colon + if($nostr =~ /^(.*[^']\?[^'].*)(\w|\)|\]|')\:/i) { + my $m = $1; + my $e = $nostr; + $e =~ s/'(.)':'(.)'/$1:$2/g; # eliminate chars quotes that surround colon + $e =~ s/':'//g; # ignore these + if($e =~ /^(.*[^']\?[^'].*)(\w|\)|\]|')\:/i) { + checkwarn("NOSPACEC", + $line, length($m)+1, $file, $l, + "missing space before colon"); + } + } + # check spaces after colon + if($nostr =~ /^(.*[^'"]\?[^'"].*)\:(\w|\)|\]|')/i) { + my $m = $1; + my $e = $nostr; + $e =~ s/'(.)':'(.)'/$1:$2/g; # eliminate chars quotes that surround colon + $e =~ s/':'//g; # ignore these + if($e =~ /^(.*[^'"]\?[^'"].*)\:(\w|\)|\]|')/i) { + checkwarn("NOSPACEC", + $line, length($m)+1, $file, $l, + "missing space after colon"); + } + } + + # check spaces before question mark + if($nostr =~ /^(.*)(\w|\)|\]|')\?/i) { + my $m = $1; + my $e = $nostr; + $e =~ s/'?'//g; # ignore these + if($e =~ /^(.*)(\w|\)|\]|')\?/i) { + checkwarn("NOSPACEQ", + $line, length($m)+1, $file, $l, + "missing space before question mark"); + } + } + # check spaces after question mark + if($nostr =~ /^(.*)\?\w/i) { + checkwarn("NOSPACEQ", + $line, length($1)+1, $file, $l, + "missing space after question mark"); + } + + # check spaces before less or greater than + if($nostr =~ /^(.*)(\w|\)|\])[<>]/) { + checkwarn("NOSPACETHAN", + $line, length($1)+1, $file, $l, + "missing space before less or greater than"); + } + # check spaces after less or greater than + if($nostr =~ /^(.*)[^-][<>](\w|\(|\[)/) { + checkwarn("NOSPACETHAN", + $line, length($1)+1, $file, $l, + "missing space after less or greater than"); + } + # check spaces before close parentheses, unless it was a space or a # close parenthesis! if($l =~ /(.*[^\) ]) \)/) { @@ -720,7 +806,8 @@ sub scanfile { strtok| v?sprintf| (str|_mbs|_tcs|_wcs)n?cat| - LoadLibrary(Ex)?(A|W)?) + LoadLibrary(Ex)?(A|W)?| + _?w?access) \s*\( /x) { checkwarn("BANNEDFUNC", @@ -739,6 +826,18 @@ sub scanfile { } } } + if($warnings{"STRNCPY"}) { + # scan for use of banned strncpy. This is not a BANNEDFUNC to + # allow for individual enable/disable of this warning. + if($l =~ /^(.*\W)(strncpy)\s*\(/x) { + if($1 !~ /^ *\#/) { + # skip preprocessor lines + checkwarn("STRNCPY", + $line, length($1), $file, $ol, + "use of $2 is banned"); + } + } + } if($warnings{"STDERR"}) { # scan for use of banned stderr. This is not a BANNEDFUNC to # allow for individual enable/disable of this warning. @@ -923,7 +1022,7 @@ sub scanfile { checkwarn("COPYRIGHT", 1, 0, $file, "", "Missing copyright statement", 1); } - # COPYRIGHTYEAR is a extended warning so we must first see if it has been + # COPYRIGHTYEAR is an extended warning so we must first see if it has been # enabled in .checksrc if(defined($warnings{"COPYRIGHTYEAR"})) { # The check for updated copyrightyear is overly complicated in order to diff --git a/deps/curl/scripts/ciconfig.pl b/deps/curl/scripts/ciconfig.pl index e232e3e5..93358def 100644 --- a/deps/curl/scripts/ciconfig.pl +++ b/deps/curl/scripts/ciconfig.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | diff --git a/deps/curl/scripts/cijobs.pl b/deps/curl/scripts/cijobs.pl index 150e2cb8..7d0a2dec 100644 --- a/deps/curl/scripts/cijobs.pl +++ b/deps/curl/scripts/cijobs.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | diff --git a/deps/curl/scripts/cmakelint.sh b/deps/curl/scripts/cmakelint.sh new file mode 100644 index 00000000..4eb54e14 --- /dev/null +++ b/deps/curl/scripts/cmakelint.sh @@ -0,0 +1,50 @@ +#!/bin/sh +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Dan Fandrich, , 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 +# +########################################################################### + +# Run cmakelint on the curl source code. It will check all files given on the +# command-line, or else all relevant files in git, or if not in a git +# repository, all files starting in the tree rooted in the current directory. +# +# cmakelint can be installed from PyPi with the command "python3 -m pip install +# cmakelint". +# +# The xargs invocation is portable, but does not preserve spaces in file names. +# 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'". +{ + if [ -n "$1" ]; then + for A in "$@"; do printf "%s\n" "$A"; done + elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git ls-files + else + # strip off the leading ./ to make the grep regexes work properly + find . -type f | sed 's@^\./@@' + fi +} | grep -E '(/CMake|\.cmake$)' | grep -v -E '(\.h\.cmake|\.in)$' \ + | xargs \ + cmakelint \ + --spaces=2 --linelength=132 \ + --filter=-whitespace/indent,-convention/filename,-package/stdargs diff --git a/deps/curl/scripts/contributors.sh b/deps/curl/scripts/contributors.sh index 90ea5c94..ad6f0b56 100644 --- a/deps/curl/scripts/contributors.sh +++ b/deps/curl/scripts/contributors.sh @@ -29,21 +29,21 @@ # RELEASE-NOTES. # -start=$1 +set -eu + +start="${1:-}" if test "$start" = "-h"; then - echo "Usage: $0 [--releasenotes]" - exit + echo "Usage: $0 [--releasenotes]" + exit fi if test -z "$start"; then - start=`git tag --sort=taggerdate | grep "^curl-" | tail -1`; - echo "Since $start:" + start=$(git tag --sort=taggerdate | grep "^curl-" | tail -1) + echo "Since $start:" fi # We also include curl-www if possible. Override by setting CURLWWW -if [ -z "$CURLWWW" ] ; then - CURLWWW=../curl-www -fi +CURLWWW="${CURLWWW:-../curl-www}" # filter out Author:, Commit: and *by: lines # cut off the email parts @@ -55,31 +55,30 @@ fi # sort all unique names # awk them into RELEASE-NOTES format -( - ( - git log --pretty=full --use-mailmap $start..HEAD - if [ -d "$CURLWWW" ] - then - git -C "$CURLWWW" log --pretty=full --use-mailmap $start..HEAD - fi - ) | \ -grep -Eai '(^Author|^Commit|by):' | \ -cut -d: -f2- | \ -cut '-d(' -f1 | \ -cut '-d<' -f1 | \ -tr , '\012' | \ -sed 's/ at github/ on github/' | \ -sed 's/ and /\n/' | \ -sed -e 's/^ *//' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/' +{ + { + git log --pretty=full --use-mailmap "$start..HEAD" + if [ -d "$CURLWWW" ]; then + git -C "$CURLWWW" log --pretty=full --use-mailmap "$start..HEAD" + fi + } | \ + grep -Eai '(^Author|^Commit|by):' | \ + cut -d: -f2- | \ + cut '-d(' -f1 | \ + cut '-d<' -f1 | \ + tr , '\012' | \ + sed 's/ at github/ on github/' | \ + sed 's/ and /\n/' | \ + sed -e 's/^ *//' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/' -grep -a "^ [^ \(]" RELEASE-NOTES| \ -sed 's/, */\n/g'| \ -sed 's/^ *//' - -)| \ + grep -a "^ [^ \(]" RELEASE-NOTES| \ + sed 's/, */\n/g'| \ + sed 's/^ *//' +} | \ sed -f ./docs/THANKS-filter | \ sort -fu | \ -awk '{ +awk ' +{ if(length($0)) { num++; n = sprintf("%s%s%s,", n, length(n)?" ":"", $0); @@ -92,10 +91,9 @@ awk '{ } } - END { - pp=substr(p,1,length(p)-1); - printf(" %s\n", pp); - printf(" (%d contributors)\n", num); - } - +END { + pp=substr(p,1,length(p)-1); + printf(" %s\n", pp); + printf(" (%d contributors)\n", num); +} ' diff --git a/deps/curl/scripts/contrithanks.sh b/deps/curl/scripts/contrithanks.sh index b1884228..2afc30c2 100644 --- a/deps/curl/scripts/contrithanks.sh +++ b/deps/curl/scripts/contrithanks.sh @@ -28,50 +28,46 @@ # puts them at the end of the THANKS document on stdout # -start=$1 +set -eu + +start="${1:-}" if test "$start" = "-h"; then echo "Usage: $0 " exit fi if test -z "$start"; then - start=`git tag --sort=taggerdate | grep "^curl-" | tail -1`; + start=$(git tag --sort=taggerdate | grep "^curl-" | tail -1) fi - # We also include curl-www if possible. Override by setting CURLWWW -if [ -z "$CURLWWW" ] ; then - CURLWWW=../curl-www -fi +CURLWWW="${CURLWWW:-../curl-www}" cat ./docs/THANKS -( - ( - git log --use-mailmap $start..HEAD - if [ -d "$CURLWWW" ] - then - git -C ../curl-www log --use-mailmap $start..HEAD - fi - ) | \ +{ + { + git log --use-mailmap "$start..HEAD" + if [ -d "$CURLWWW" ]; then + git -C "$CURLWWW" log --use-mailmap "$start..HEAD" + fi + } | \ + grep -Eai '(^Author|^Commit|by):' | \ + cut -d: -f2- | \ + cut '-d(' -f1 | \ + cut '-d<' -f1 | \ + tr , '\012' | \ + sed 's/ at github/ on github/' | \ + sed 's/ and /\n/' | \ + sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/' -grep -Eai '(^Author|^Commit|by):' | \ -cut -d: -f2- | \ -cut '-d(' -f1 | \ -cut '-d<' -f1 | \ -tr , '\012' | \ -sed 's/ at github/ on github/' | \ -sed 's/ and /\n/' | \ -sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/' - -# grep out the list of names from RELEASE-NOTES -# split on ", " -# remove leading whitespace -grep -a "^ [^ (]" RELEASE-NOTES| \ -sed 's/, */\n/g'| \ -sed 's/^ *//' - -)| \ + # grep out the list of names from RELEASE-NOTES + # split on ", " + # remove leading whitespace + grep -a "^ [^ (]" RELEASE-NOTES| \ + sed 's/, */\n/g'| \ + sed 's/^ *//' +} | \ sed -f ./docs/THANKS-filter | \ sort -fu | \ -grep -aixvf ./docs/THANKS +grep -aixvFf ./docs/THANKS diff --git a/deps/curl/scripts/copyright.pl b/deps/curl/scripts/copyright.pl deleted file mode 100644 index c83b7ebb..00000000 --- a/deps/curl/scripts/copyright.pl +++ /dev/null @@ -1,227 +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 -# -########################################################################### -# -# Invoke script in the root of the git checkout. Scans all files in git unless -# given a specific single file. -# -# Usage: copyright.pl [file] -# - -my %skips; - -# file names -my %skiplist = ( - # REUSE-specific file - ".reuse/dep5" => "", - - # License texts - "LICENSES/BSD-3-Clause.txt" => "", - "LICENSES/BSD-4-Clause-UC.txt" => "", - "LICENSES/ISC.txt" => "", - "LICENSES/curl.txt" => "", - "COPYING" => "", - - ); - -sub scanfile { - my ($f) = @_; - my $line=1; - my $found = 0; - open(F, "<$f") || return -1; - while () { - chomp; - my $l = $_; - # check for a copyright statement and save the years - if($l =~ /.* ?copyright .* (\d\d\d\d|)/i) { - my $count = 0; - while($l =~ /([\d]{4})/g) { - push @copyright, { - year => $1, - line => $line, - col => index($l, $1), - code => $l - }; - $count++; - } - if(!$count) { - # year-less - push @copyright, { - year => -1, - line => $line, - col => index($l, $1), - code => $l - }; - $count++; - } - $found = $count; - } - if($l =~ /SPDX-License-Identifier:/) { - $spdx = 1; - } - # allow within the first 100 lines - if(++$line > 100) { - last; - } - } - close(F); - return $found; -} - -sub checkfile { - my ($file, $skipped, $pattern) = @_; - $spdx = 0; - my $found = scanfile($file); - - if($found < 1) { - if($skipped) { - # just move on - $skips{$pattern}++; - return 0; - } - if(!$found) { - print "$file:1: missing copyright range\n"; - return 2; - } - # this means the file couldn't open - it might not exist, consider - # that fine - return 1; - } - if(!$spdx) { - if($skipped) { - # move on - $skips{$pattern}++; - return 0; - } - print "$file:1: missing SPDX-License-Identifier\n"; - return 2; - } - - if($skipped) { - print "$file:1: ignored superfluously by $pattern\n" if($verbose); - $superf{$pattern}++; - } - - return 1; -} - -sub dep5 { - my ($file) = @_; - my @files; - my $copy; - open(F, "<$file") || die "can't open $file"; - my $line = 0; - while() { - $line++; - if(/^Files: (.*)/i) { - push @files, `git ls-files $1`; - } - elsif(/^Copyright: (.*)/i) { - $copy = $1; - } - elsif(/^License: (.*)/i) { - my $license = $1; - for my $f (@files) { - chomp $f; - if($f =~ /\.gitignore\z/) { - # ignore .gitignore - } - else { - if($skiplist{$f}) { - print STDERR "$f already skipped at $skiplist{$f}\n"; - } - $skiplist{$f} = "dep5:$line"; - } - } - undef @files; - } - } - close(F); -} - -dep5(".reuse/dep5"); - -my $checkall = 0; -my @all; -my $verbose; -if($ARGV[0] eq "-v") { - $verbose = 1; - shift @ARGV; -} -if($ARGV[0]) { - push @all, @ARGV; -} -else { - @all = `git ls-files`; - $checkall = 1; -} - -for my $f (@all) { - chomp $f; - my $skipped = 0; - my $miss; - my $wro; - my $pattern; - if($skiplist{$f}) { - $pattern = $skip; - $skiplisted++; - $skipped = 1; - $skip{$f}++; - } - - my $r = checkfile($f, $skipped, $pattern); - $mis=1 if($r == 2); - $wro=1 if(!$r); - - if(!$skipped) { - $missing += $mis; - $wrong += $wro; - } -} - -if($verbose) { - print STDERR "$missing files have no copyright\n" if($missing); - print STDERR "$wrong files have wrong copyright year\n" if ($wrong); - print STDERR "$skiplisted files are skipped\n" if ($skiplisted); - - for my $s (@skiplist) { - if(!$skips{$s}) { - printf ("Never skipped pattern: %s\n", $s); - } - if($superf{$s}) { - printf ("%s was skipped superfluously %u times and legitimately %u times\n", - $s, $superf{$s}, $skips{$s}); - } - } -} - -if($checkall) { - for(keys %skiplist) { - if(!$skip{$_}) { - printf STDERR "$_ is marked for SKIP but is missing!\n"; - } - } -} - -exit 1 if($missing || $wrong); diff --git a/deps/curl/scripts/coverage.sh b/deps/curl/scripts/coverage.sh index 0a7c7824..b5540568 100644 --- a/deps/curl/scripts/coverage.sh +++ b/deps/curl/scripts/coverage.sh @@ -23,6 +23,8 @@ # ########################################################################### +set -eu + autoreconf -fi mkdir -p cvr cd cvr diff --git a/deps/curl/scripts/delta b/deps/curl/scripts/delta index a294f5a5..43bc25ce 100644 --- a/deps/curl/scripts/delta +++ b/deps/curl/scripts/delta @@ -89,7 +89,7 @@ $deletes=`git diff-tree --diff-filter=A -r --summary origin/$branch $start 2>/de $creates=`git diff-tree --diff-filter=D -r --summary origin/$branch $start 2>/dev/null| wc -l`; # Time since that tag -$tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # unix timestamp +$tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # Unix timestamp $taggednice=`git for-each-ref --format="%(refname:short) | %(creatordate)" refs/tags/* | grep ^$start | cut '-d|' -f2`; # human readable time chomp $taggednice; $now=`date +%s`; @@ -140,9 +140,9 @@ close(F); # Produce the summary print "== Since $start $taggednice ==\n"; +my $days = $elapsed / 3600 / 24; printf "Elapsed time: %.1f days (total %d)\n", - $elapsed / 3600 / 24, - $total / 3600 / 24; + $days, $total / 3600 / 24; printf "Commits: %d (total %d)\n", $commits, $acommits; printf "Commit authors: %d, %d new (total %d)\n", @@ -156,7 +156,8 @@ printf "New curl_easy_setopt() options: %d (total %d)\n", printf "New command line options: %d (total %d)\n", $noptions, $aoptions; printf "Changes logged: %d\n", $numchanges; -printf "Bugfixes logged: %d\n", $numbugfixes; +printf "Bugfixes logged: %d (%.2f per day)\n", + $numbugfixes, $numbugfixes / $days; printf "Added files: %d (total %d)\n", $creates, $afiles; printf "Deleted files: %d (delta: %d)\n", $deletes, diff --git a/deps/curl/tests/libtest/notexists.pl b/deps/curl/scripts/dmaketgz similarity index 63% rename from deps/curl/tests/libtest/notexists.pl rename to deps/curl/scripts/dmaketgz index 2bc9bb5a..e5854427 100644 --- a/deps/curl/tests/libtest/notexists.pl +++ b/deps/curl/scripts/dmaketgz @@ -1,4 +1,6 @@ -#!/usr/bin/env perl +#!/bin/sh +# docker-maketgz +# #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | @@ -22,17 +24,31 @@ # SPDX-License-Identifier: curl # ########################################################################### -# Check that given arguments do not exist on filesystem. -my $code = 0; -if ($#ARGV < 0) { - print "Usage: $0 file1 [fileN]\n"; - exit 2; -} -while (@ARGV) { - my $fname = shift @ARGV; - if (-e $fname) { - print "Found '$fname' when not supposed to exist.\n"; - $code = 1; - } -} -exit $code; + +set -eu + +version="${1:-}" + +if [ -z "$version" ]; then + echo "Specify a version number!" + exit +fi + +timestamp="${2:-$(date -u +%s)}" + +if test -f Makefile; then + make distclean +fi +docker build \ + --build-arg SOURCE_DATE_EPOCH="$timestamp" \ + --build-arg UID="$(id -u)" \ + --build-arg GID="$(id -g)" \ + -t curl/curl . + +docker run --rm -u "$(id -u):$(id -g)" \ + -v "$(pwd):/usr/src" -w /usr/src curl/curl sh -c " + set -e + autoreconf -fi + ./configure --without-ssl --without-libpsl + make -sj8 + ./scripts/maketgz $version" diff --git a/deps/curl/scripts/firefox-db2pem.sh b/deps/curl/scripts/firefox-db2pem.sh index f78f4152..57252b40 100644 --- a/deps/curl/scripts/firefox-db2pem.sh +++ b/deps/curl/scripts/firefox-db2pem.sh @@ -26,8 +26,14 @@ # It extracts all ca certs it finds in the local Firefox database and converts # them all into PEM format. # -db=$(ls -1d $HOME/.mozilla/firefox/*default*) -out=$1 +# It uses the "certutil" command line tool from the NSS project to perform the +# conversion. On Debian it comes in the "libnss3-tools" package. +# + +set -eu + +db=$(ls -1d "$HOME"/.mozilla/firefox/*default*) +out="${1:-}" if test -z "$out"; then out="ca-bundle.crt" # use a sensible default @@ -35,7 +41,7 @@ fi currentdate=$(date) -cat >$out < "$out" <> $out +done >> "$out" diff --git a/deps/curl/scripts/installcheck.sh b/deps/curl/scripts/installcheck.sh index 433420e0..b13db2aa 100644 --- a/deps/curl/scripts/installcheck.sh +++ b/deps/curl/scripts/installcheck.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | @@ -23,28 +23,30 @@ # ########################################################################### -PREFIX=$1 +set -eu + +PREFIX="${1:-}" # Run this script in the root of the git clone. Point out the install prefix # where 'make install' has already installed curl. -if test -z "$1"; then - echo "scripts/installcheck.sh [PREFIX]" - exit +if test -z "$PREFIX"; then + echo "scripts/installcheck.sh [PREFIX]" + exit fi -diff -u <(find docs/libcurl/ -name "*.3" -printf "%f\n" | grep -v template| sort) <(find $PREFIX/share/man/ -name "*.3" -printf "%f\n" | sort) +diff -u <(find docs/libcurl/ -name "*.3" -printf "%f\n" | grep -v template | sort) <(find "$PREFIX/share/man/" -name "*.3" -printf "%f\n" | sort) if test "$?" -ne "0"; then - echo "ERROR: installed libcurl docs mismatch" - exit 2 + echo "ERROR: installed libcurl docs mismatch" + exit 2 fi -diff -u <(find include/ -name "*.h" -printf "%f\n" | sort) <(find $PREFIX/include/ -name "*.h" -printf "%f\n" | sort) +diff -u <(find include/ -name "*.h" -printf "%f\n" | sort) <(find "$PREFIX/include/" -name "*.h" -printf "%f\n" | sort) if test "$?" -ne "0"; then - echo "ERROR: installed include files mismatch" - exit 1 + echo "ERROR: installed include files mismatch" + exit 1 fi echo "installcheck: installed libcurl docs and include files look good" diff --git a/deps/curl/scripts/log2changes.pl b/deps/curl/scripts/log2changes.pl deleted file mode 100644 index 35541836..00000000 --- a/deps/curl/scripts/log2changes.pl +++ /dev/null @@ -1,103 +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 -# -########################################################################### - -# git log --pretty=fuller --no-color --date=short --decorate=full - -my @mname = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); - -sub nicedate { - my ($date)=$_; - - if($date =~ /(\d\d\d\d)-(\d\d)-(\d\d)/) { - return sprintf("%d %s %4d", $3, $mname[$2-1], $1); - } - return $date; -} - -sub printmsg { - my ($p, $msg)=@_; - while(length($msg) > 77) { - print $p.substr($msg, 0, 77, "")."\n"; - $p=" "; - } - if($msg eq "") { - $p = ""; - } - print "$p$msg\n"; -} - -print -' _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Changelog -'; - -my $tag; -while() { - my $l = $_; - - if($l =~/^commit ([[:xdigit:]]*) ?(.*)/) { - $co = $1; - my $ref = $2; - if ($ref =~ /refs\/tags\/curl-([0-9_]*)/) { - $tag = $1; - $tag =~ tr/_/./; - } - } - elsif($l =~ /^Author: *(.*) +$PLIST +sed -i "s/#define CURL_VERSION .*/#define CURL_VERSION \"$curlversion\"/g" "$CHEADER" if test -n "$only"; then # done! - exit; + exit fi echo "curl version $curlversion" @@ -110,7 +118,7 @@ echo "datestamp $datestamp" findprog() { file="$1" - for part in `echo $PATH| tr ':' ' '`; do + for part in $(echo "$PATH" | tr ':' ' '); do path="$part/$file" if [ -x "$path" ]; then # there it is! @@ -130,6 +138,11 @@ findprog() { echo "Re-running config.status" ./config.status --recheck >/dev/null +echo "Recreate the built-in manual (with correct version)" +export CURL_MAKETGZ_VERSION="$version" +rm -f docs/cmdline-opts/curl.txt +make -C src + ############################################################################ # # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has @@ -137,26 +150,19 @@ echo "Re-running config.status" # if { findprog automake >/dev/null 2>/dev/null; } then - echo "- Could not find or run automake, I hope you know what you're doing!" + echo "- Could not find or run automake, I hope you know what you are doing!" else echo "Runs automake --include-deps" automake --include-deps Makefile >/dev/null fi -############################################################################ -# -# make the generated file newer than the man page +if test -n "$commit"; then + echo "produce docs/tarball-commit.txt" + git rev-parse HEAD >docs/tarball-commit.txt.dist +fi -touch src/tool_hugehelp.c - -############################################################################ -# -# Update the IDE files -echo "make vc-ide" -make -s vc-ide - -echo "produce CHANGES" -git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./scripts/log2changes.pl > CHANGES.dist +echo "produce RELEASE-TOOLS.md" +./scripts/release-tools.sh "$timestamp" "$version" "$commit" > docs/RELEASE-TOOLS.md.dist ############################################################################ # @@ -165,14 +171,31 @@ git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./script echo "make dist" targz="curl-$version.tar.gz" -make -sj dist VERSION=$version +make -sj dist "VERSION=$version" res=$? if test "$res" != 0; then - echo "make dist failed" - exit 2 + echo "make dist failed" + exit 2 fi +retar() { + tempdir=$1 + rm -rf "$tempdir" + mkdir "$tempdir" + cd "$tempdir" + gzip -dc "../$targz" | tar -xf - + 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 .. + rm -rf "$tempdir" +} + +retar ".tarbuild" +echo "replace $targz with out.tar.gz" +mv out.tar.gz "$targz" + ############################################################################ # # Now make a bz2 archive from the tar.gz original @@ -180,7 +203,7 @@ fi bzip2="curl-$version.tar.bz2" echo "Generating $bzip2" -gzip -dc $targz | bzip2 --best > $bzip2 +gzip -dc "$targz" | bzip2 --best > "$bzip2" ############################################################################ # @@ -189,21 +212,21 @@ gzip -dc $targz | bzip2 --best > $bzip2 xz="curl-$version.tar.xz" echo "Generating $xz" -gzip -dc $targz | xz -6e - > $xz +gzip -dc "$targz" | xz -6e - > "$xz" ############################################################################ # # Now make a zip archive from the tar.gz original # makezip() { - rm -rf $tempdir - mkdir $tempdir - cd $tempdir - gzip -dc ../$targz | tar -xf - - find . | zip $zip -@ >/dev/null - mv $zip ../ + rm -rf "$tempdir" + mkdir "$tempdir" + cd "$tempdir" + gzip -dc "../$targz" | tar -xf - + find . | sort | zip -9 -X "$zip" -@ >/dev/null + mv "$zip" ../ cd .. - rm -rf $tempdir + rm -rf "$tempdir" } zip="curl-$version.zip" @@ -211,10 +234,14 @@ echo "Generating $zip" tempdir=".builddir" makezip +# Set deterministic timestamp +touch -c -t "$filestamp" "$targz" "$bzip2" "$xz" "$zip" + echo "------------------" echo "maketgz report:" echo "" -ls -l $targz $bzip2 $zip $xz +ls -l "$targz" "$bzip2" "$xz" "$zip" +sha256sum "$targz" "$bzip2" "$xz" "$zip" echo "Run this:" -echo "gpg -b -a $targz && gpg -b -a $bzip2 && gpg -b -a $zip && gpg -b -a $xz" +echo "gpg -b -a '$targz' && gpg -b -a '$bzip2' && gpg -b -a '$xz' && gpg -b -a '$zip'" diff --git a/deps/curl/docs/cmdline-opts/gen.pl b/deps/curl/scripts/managen similarity index 79% rename from deps/curl/docs/cmdline-opts/gen.pl rename to deps/curl/scripts/managen index eeaabd2e..20abfc12 100644 --- a/deps/curl/docs/cmdline-opts/gen.pl +++ b/deps/curl/scripts/managen @@ -27,7 +27,7 @@ This script generates the manpage. -Example: gen.pl [files] > curl.1 +Example: managen [files] > curl.1 Dev notes: @@ -50,25 +50,18 @@ my %catlong; use POSIX qw(strftime); my @ts; if (defined($ENV{SOURCE_DATE_EPOCH})) { - @ts = localtime($ENV{SOURCE_DATE_EPOCH}); + @ts = gmtime($ENV{SOURCE_DATE_EPOCH}); } else { @ts = localtime; } -my $date = strftime "%B %d %Y", @ts; +my $date = strftime "%Y-%m-%d", @ts; my $year = strftime "%Y", @ts; my $version = "unknown"; my $globals; +my $error = 0; +my $indent = 4; -open(INC, "<../../include/curl/curlver.h"); -while() { - if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) { - $version = $1; - last; - } -} -close(INC); - -# get the long name version, return the man page string +# get the long name version, return the manpage string sub manpageify { my ($k)=@_; my $l; @@ -94,13 +87,19 @@ sub manpageify { } -my $colwidth=78; # max number of columns +my $colwidth=79; # max number of columns + +sub prefixline { + my ($num) = @_; + print "\t" x ($num/8); + print ' ' x ($num%8); +} sub justline { my ($lvl, @line) = @_; my $w = -1; my $spaces = -1; - my $width = $colwidth - ($lvl * 4); + my $width = $colwidth - ($lvl * $indent); for(@line) { $w += length($_); $w++; @@ -112,7 +111,7 @@ sub justline { $ratio = $inject / $spaces; } my $spare = 0; - print ' ' x ($lvl * 4); + prefixline($lvl * $indent); my $prev; for(@line) { while($spare >= 0.90) { @@ -128,7 +127,8 @@ sub justline { sub lastline { my ($lvl, @line) = @_; - print ' ' x ($lvl * 4); + $line[0] =~ s/^( +)//; + prefixline($lvl * $indent + length($1)); my $prev = 0; for(@line) { printf "%s%s", $prev?" ":"", $_; @@ -143,7 +143,7 @@ sub outputpara { my $w = 0; my @words = split(/ */, $f); - my $width = $colwidth - ($lvl * 4); + my $width = $colwidth - ($lvl * $indent); my @line; for my $e (@words) { @@ -194,6 +194,12 @@ sub printdesc { # quoted, do not right-justify chomp $l; lastline($baselvl + $lvl + 1, $l); + my $w = ($baselvl + $lvl + 1) * $indent + length($l); + if ($w > $colwidth) { + print STDERR "ERROR: $w columns is too long\n"; + print STDERR "$l\n"; + $error++; + } } else { $para .= $l; @@ -232,7 +238,7 @@ sub protocols { return ".SH \"PROTOCOLS\"\n$data\n"; } else { - return " ($data) " if($manpage); + return "($data) " if($manpage); return "[1]($data) " if(!$manpage); } } @@ -246,8 +252,8 @@ sub too_old { elsif($version =~ /^(\d+)\.(\d+)/) { $a = $1 * 1000 + $2 * 10; } - if($a < 7500) { - # we consider everything before 7.50.0 to be too old to mention + if($a < 7600) { + # we consider everything before 7.60.0 to be too old to mention # specific changes for return 1; } @@ -277,11 +283,13 @@ sub render { my $top = ($line == 1); my $quote; my $level; + my $finalblank; $start = 0; while(<$fh>) { my $d = $_; $line++; + $finalblank = ($d eq "\n"); if($d =~ /^\.(SH|BR|IP|B)/) { print STDERR "$f:$line:1:ERROR: nroff instruction in input: \".$1\"\n"; return 4; @@ -316,9 +324,9 @@ sub render { $word =~ s/[\"\'](.*)[\"\']\z/$1/; # remove backticks from headers - $words =~ s/\`//g; + $word =~ s/\`//g; - # if there is a space, it needs quotes for man page + # if there is a space, it needs quotes for manpage if(($word =~ / /) && $manpage) { $word = "\"$word\""; } @@ -347,7 +355,7 @@ sub render { } if($tablemode) { # end of table - push @desc, ".RE\n.IP\n"; + push @desc, ".RE\n.IP\n" if($manpage); $tablemode = 0; } $header = 1; @@ -366,7 +374,9 @@ sub render { elsif($d =~ /^ (.*)/) { my $word = $1; if(!$quote && $manpage) { + push @desc, "\n" if($blankline); push @desc, ".nf\n"; + $blankline = 0; } $quote = 1; $d = "$word\n"; @@ -384,10 +394,19 @@ sub render { # convert backticks to double quotes $d =~ s/\`/\"/g; + if($d =~ /\(added in(.*)/i) { + if(length($1) < 2) { + print STDERR "$f:$line:1:ERROR: broken up added-in line:\n"; + print STDERR "$f:$line:1:ERROR: $d"; + return 3; + } + } + again: if($d =~ /\(Added in ([0-9.]+)\)/i) { my $ver = $1; if(too_old($ver)) { $d =~ s/ *\(Added in $ver\)//gi; + goto again; } } @@ -440,6 +459,14 @@ sub render { $header = 0; } + if($finalblank) { + print STDERR "$f:$line:1:ERROR: trailing blank line\n"; + exit 3; + } + if($quote) { + # don't leave the quote "hanging" + push @desc, ".fi\n" if($manpage); + } if($tablemode) { # end of table push @desc, ".RE\n.IP\n" if($manpage); @@ -447,11 +474,25 @@ sub render { return @desc; } +sub maybespace { + my ($string) = @_; + + if(($string =~ /(.* )(.*)/) && + (length($2) <= 20)) { + return $1; + } + if(($string =~ /(.*:)(.*)/) && + (length($2) <= 20)) { + return $1; + } + return $string; +} + sub single { - my ($manpage, $f, $standalone)=@_; + my ($dir, $manpage, $f, $standalone)=@_; my $fh; - open($fh, "<:crlf", "$f") || - return 1; + open($fh, "<:crlf", "$dir/$f") || + die "could not find $dir/$f"; my $short; my $long; my $tags; @@ -649,6 +690,10 @@ sub single { my $pre = $manpage ? "\n": "[1]"; if($scope) { + if($category !~ /global/) { + print STDERR "$f:$line:1:ERROR: global scope option does not have global category\n"; + return 2; + } if($scope eq "global") { push @desc, "\n" if(!$manpage); push @desc, "${pre}This option is global and does not need to be specified for each use of --next.\n"; @@ -659,9 +704,6 @@ sub single { } } - printdesc($manpage, 2, (@leading, @desc)); - undef @desc; - my @extra; if($multi eq "single") { push @extra, "${pre}If --$long is provided several times, the last set ". @@ -690,12 +732,18 @@ sub single { elsif($multi eq "custom") { ; # left for the text to describe } + elsif($multi eq "per-URL") { + push @extra, + "${pre}--$long is associated with a single URL. Use it once per URL ". + "when you use several URLs in a command line.\n"; + } else { print STDERR "$f:$line:1:ERROR: unrecognized Multi: '$multi'\n"; return 2; } - printdesc($manpage, 2, @extra); + printdesc($manpage, 2, (@leading, @desc, @extra)); + undef @desc; my @foot; @@ -719,25 +767,31 @@ sub single { $mstr .= sprintf "%s$l", $mstr?"$sep ":""; $i++; } - push @foot, seealso($standalone, $mstr); if($requires) { my $l = $manpage ? manpageify($long) : "--$long"; - push @foot, "$l requires that the underlying libcurl". - " was built to support $requires. "; + push @foot, "$l requires that libcurl". + " is built to support $requires.\n"; } if($mutexed) { my @m=split(/ /, $mutexed); my $mstr; + my $num = scalar(@m); + my $count; for my $k (@m) { if(!$helplong{$k}) { print STDERR "WARN: $f mutexes a non-existing option: $k\n"; } my $l = $manpage ? manpageify($k) : "--$k"; - $mstr .= sprintf "%s$l", $mstr?" and ":""; + my $sep = ", "; + if($count == ($num -1)) { + $sep = " and "; + } + $mstr .= sprintf "%s$l", $mstr?$sep:""; + $count++; } push @foot, overrides($standalone, - "This option is mutually exclusive to $mstr. "); + "This option is mutually exclusive with $mstr.\n"); } if($examples[0]) { my $s =""; @@ -749,16 +803,44 @@ sub single { $e =~ s!\$URL!https://example.com!g; # convert single backslahes to doubles $e =~ s/\\/\\\\/g; - print " curl $e\n"; + print "curl $e\n"; } print ".fi\n"; } else { my @ex; push @ex, "[0q]Example$s:\n"; + # + # long ASCII examples are wrapped. Preferably at the last space + # before the margin. Or at a colon. Otherwise it just cuts at the + # exact boundary. + # foreach my $e (@examples) { $e =~ s!\$URL!https://example.com!g; - push @ex, "[0q] curl $e\n"; + my $maxwidth = 60; # plus the " curl " 18 col prefix + if(length($e) > $maxwidth) { + # a long example, shorten it + my $p = substr($e, 0, $maxwidth); + $p = maybespace($p); + push @ex, "[0q] curl ".$p."\\"; + $e = substr($e, length($p)); + do { + my $r = substr($e, 0, $maxwidth); + if(length($e) > $maxwidth) { + $r = maybespace($r); + } + my $slash =""; + $e = substr($e, length($r)); + if(length($e) > 0) { + $slash = "\\"; + } + + push @ex, "[0q] $r$slash" if($r); + } while(length($e)); + } + else { + push @ex, "[0q] curl $e\n"; + } } printdesc($manpage, 2, @ex); } @@ -766,23 +848,25 @@ sub single { if($added) { push @foot, added($standalone, $added); } - if($foot[0]) { - print "\n"; - my $f = join("", @foot); - if($manpage) { - $f =~ s/ +\z//; # remove trailing space - print "$f\n"; - } - else { - printdesc($manpage, 2, "[1]$f"); - } + push @foot, seealso($standalone, $mstr); + + print "\n"; + my $f = join("", @foot); + if($manpage) { + $f =~ s/ +\z//; # remove trailing space + print "$f\n"; + } + else { + printdesc($manpage, 2, "[1]$f"); } return 0; } sub getshortlong { - my ($f)=@_; - open(F, "<:crlf", "$f"); + my ($dir, $f)=@_; + $f =~ s/^.*\///; + open(F, "<:crlf", "$dir/$f") || + die "could not find $dir/$f"; my $short; my $long; my $help; @@ -790,7 +874,9 @@ sub getshortlong { my $protocols; my $category; my $start = 0; + my $line = 0; while() { + $line++; if(!$start) { if(/^---/) { $start = 1; @@ -805,6 +891,11 @@ sub getshortlong { } elsif(/^Help: (.*)/i) { $help=$1; + my $len = length($help); + if($len >= 49) { + printf STDERR "$f:$line:1:WARN: oversized help text: %d characters\n", + $len; + } } elsif(/^Arg: (.*)/i) { $arg=$1; @@ -833,22 +924,41 @@ sub getshortlong { } sub indexoptions { - my (@files) = @_; + my ($dir, @files) = @_; foreach my $f (@files) { - getshortlong($f); + getshortlong($dir, $f); } } sub header { - my ($manpage, $f)=@_; + my ($dir, $manpage, $f)=@_; my $fh; - open($fh, "<:crlf", "$f"); + open($fh, "<:crlf", "$dir/$f") || + die "could not find $dir/$f"; my @d = render($manpage, $fh, $f, 1); close($fh); printdesc($manpage, 0, @d); } + +sub sourcecategories { + my ($dir) = @_; + my %cats; + open(H, "<$dir/../../src/tool_help.h") || + die "can't find the header file"; + while() { + if(/^\#define CURLHELP_([A-Z0-9]*)/) { + $cats{lc($1)}++; + } + } + close(H); + return %cats; +} + sub listhelp { + my ($dir) = @_; + my %cats = sourcecategories($dir); + print <) { @@ -990,7 +1106,7 @@ sub listglobals { sub noext { my $in = $_[0]; - $in =~ s/\.d//; + $in =~ s/\.md//; return $in; } @@ -999,12 +1115,12 @@ sub sortnames { } sub mainpage { - my ($manpage, @files) = @_; + my ($dir, $manpage, @files) = @_; # $manpage is 1 for nroff, 0 for ASCII my $ret; my $fh; - open($fh, "<:crlf", "mainpage.idx") || - return 1; + open($fh, "<:crlf", "$dir/mainpage.idx") || + die "no $dir/mainpage.idx file"; print <
[files]\n"; + print "Usage: managen ". + "[-d dir] [files]\n"; } #------------------------------------------------------------------------ +my $dir = "."; +my $include = "../../include"; my $cmd = shift @ARGV; + + check: +if($cmd eq "-d") { + # specifies source directory + $dir = shift @ARGV; + $cmd = shift @ARGV; + goto check; +} +elsif($cmd eq "-I") { + # include path root + $include = shift @ARGV; + $cmd = shift @ARGV; + goto check; +} +elsif($cmd eq "-c") { + # Column width + $colwidth = 0 + shift @ARGV; + $cmd = shift @ARGV; + goto check; +} + my @files = @ARGV; # the rest are the files -# learn all existing options -indexoptions(@files); +# can be overridden for releases +if($ENV{'CURL_MAKETGZ_VERSION'}) { + $version = $ENV{'CURL_MAKETGZ_VERSION'}; +} +else { + open(INC, "<$include/curl/curlver.h"); + while() { + if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) { + $version = $1; + last; + } + } + close(INC); +} -getargs($cmd, @files); +# learn all existing options +indexoptions($dir, @files); + +getargs($dir, $cmd, @files); + +exit $error; diff --git a/deps/curl/scripts/mk-ca-bundle.pl b/deps/curl/scripts/mk-ca-bundle.pl index 83027a48..07eabbe8 100644 --- a/deps/curl/scripts/mk-ca-bundle.pl +++ b/deps/curl/scripts/mk-ca-bundle.pl @@ -136,8 +136,6 @@ else { $url = $opt_d; } -my $curl = `curl -V`; - if ($opt_i) { print ("=" x 78 . "\n"); print "Script Version : $version\n"; @@ -314,6 +312,7 @@ if(!$opt_n) { # If we have an HTTPS URL then use curl if($url =~ /^https:\/\//i) { + my $curl = `curl -V`; if($curl) { if($curl =~ /^Protocols:.* https( |$)/m) { report "Get certdata with curl!"; @@ -409,6 +408,8 @@ print CRT <] [--exclude ]\n"; +} + +# Specific sources to exclude or add as an extra source file +my @src; +my %exclude; +my $in_exclude = 0; +foreach my $src (@ARGV) { + if($in_exclude) { + $exclude{$src} = 1; + } + elsif($src eq "--exclude") { + $in_exclude = 1; + } + else { + push @src, $src; + } +} + +print <
, 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 +# +########################################################################### + +set -eu + +# this should ideally be passed in +timestamp=${1:-unknown} +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 + tag="$(cat docs/tarball-commit.txt.dist)" +fi + +cat </dev/null; then + echo "Error: could not find dpkg" >&2 + exit 1 +fi + +debian() { + echo "- $1: $(dpkg -l "$1" | grep ^ii | awk '{print $3}')" +} +debian autoconf +debian automake +debian libtool +debian make +debian perl +debian git + +cat < 4)" }, + {"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(USE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)" }, - {"wss", "#if defined(USE_WEBSOCKETS) && \\\n" + {"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 } }; @@ -112,10 +113,10 @@ static void showtable(int try, int init, int shift) printf(" static const struct Curl_handler * const protocols[%d] = {", try); /* generate table */ - for(i=0; i < try; i++) { + for(i = 0; i < try; i++) { int match = 0; int j; - for(j=0; scheme[j].n; j++) { + for(j = 0; scheme[j].n; j++) { if(ix[j] == i) { printf("\n"); printf("%s\n", scheme[j].ifdef); @@ -128,7 +129,7 @@ static void showtable(int try, int init, int shift) } } if(!match) { - if(!nulls || (nulls>10)) { + if(!nulls || (nulls > 10)) { printf("\n "); nulls = 0; } @@ -154,7 +155,7 @@ int main(void) unsigned int v = calc(scheme[i].n, add, shift); int j; int badcombo = 0; - for(j=0; j < i; j++) { + for(j = 0; j < i; j++) { if(num[j] == v) { /* @@ -183,9 +184,8 @@ int main(void) /* check for dupes */ for(i = 0; scheme[i].n && good; ++i) { int j; - for(j=0; j < i; j++) { + for(j = 0; j < i; j++) { if(ix[j] == ix[i]) { - /* printf("NOPE, try %u causes dupes (%d and %d)\n", try, j, i); */ good = 0; break; } diff --git a/deps/curl/scripts/singleuse.pl b/deps/curl/scripts/singleuse.pl index 06499022..42c5d27d 100644 --- a/deps/curl/scripts/singleuse.pl +++ b/deps/curl/scripts/singleuse.pl @@ -114,6 +114,7 @@ my %api = ( 'curl_multi_strerror' => 'API', 'curl_multi_timeout' => 'API', 'curl_multi_wait' => 'API', + 'curl_multi_waitfds' => 'API', 'curl_multi_wakeup' => 'API', 'curl_mvaprintf' => 'API', 'curl_mvfprintf' => 'API', @@ -151,7 +152,7 @@ my %api = ( sub doublecheck { my ($f, $used) = @_; - open(F, "git grep -le '$f\\W' -- lib ${unittests}packages|"); + open(F, "git grep -Fwle '$f' -- lib ${unittests}packages|"); my @also; while() { my $e = $_; @@ -179,13 +180,17 @@ while () { if($l =~ /^([0-9a-z_-]+)\.o:/) { $file = $1; } - if($l =~ /^([0-9a-f]+) T (.*)/) { + # libcurl.a(unity_0_c.c.o): + elsif($l =~ /\(([0-9a-z_.-]+)\.o\):/) { # Apple nm + $file = $1; + } + if($l =~ /^([0-9a-f]+) T _?(.*)/) { my ($name)=($2); #print "Define $name in $file\n"; $file =~ s/^libcurl_la-//; $exist{$name} = $file; } - elsif($l =~ /^ U (.*)/) { + elsif($l =~ /^ U _?(.*)/) { my ($name)=($1); #print "Uses $name in $file\n"; $uses{$name} .= "$file, "; diff --git a/deps/curl/scripts/verify-release b/deps/curl/scripts/verify-release new file mode 100644 index 00000000..2f7a0bf8 --- /dev/null +++ b/deps/curl/scripts/verify-release @@ -0,0 +1,80 @@ +#!/bin/sh + +#*************************************************************************** +# _ _ ____ _ +# 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 remakes a provided curl release and verifies that the newly +# built version is identical to the original file. +# +# It is designed to be invoked in a clean directory with the path to the +# release tarball as an argument. +# + +set -eu + +tarball="${1:-}" + +if [ -z "$tarball" ]; then + echo "Provide a curl release tarball name as argument" + exit +fi + +i="0" + +# shellcheck disable=SC2034 +for dl in curl-*; do + i=$((i + 1)) +done + +if test "$i" -gt 1; then + echo "multiple curl-* entries found, disambiguate please" + exit +fi + +mkdir -p _tarballs +rm -rf _tarballs/* + +# checksum the original tarball to compare with later +sha256sum "$tarball" >_tarballs/checksum + +# extract the release contents +tar xf "$tarball" + +curlver=$(grep '#define LIBCURL_VERSION ' curl-*/include/curl/curlver.h | sed 's/[^0-9.]//g') + +echo "version $curlver" + +timestamp=$(grep -Eo 'SOURCE_DATE_EPOCH=[0-9]*' curl-"$curlver"/docs/RELEASE-TOOLS.md | cut -d= -f2) + +pwd=$(pwd) +cd "curl-$curlver" +./configure --without-ssl --without-libpsl +./scripts/dmaketgz "$curlver" "$timestamp" + +mv curl-"$curlver"* ../_tarballs/ +cd "$pwd" +cd "_tarballs" + +# compare the new tarball against the original +sha256sum -c checksum diff --git a/deps/curl/src/.checksrc b/deps/curl/src/.checksrc index 946367c4..df9b1f07 100644 --- a/deps/curl/src/.checksrc +++ b/deps/curl/src/.checksrc @@ -1 +1,2 @@ enable STDERR +enable STRNCPY diff --git a/deps/curl/src/.gitignore b/deps/curl/src/.gitignore index c132010c..b866dad6 100644 --- a/deps/curl/src/.gitignore +++ b/deps/curl/src/.gitignore @@ -10,5 +10,6 @@ curl curl_config.h curl_config.h.in stamp-h2 +tool_ca_embed.c tool_hugehelp.c tool_version.h.dist diff --git a/deps/curl/src/CMakeLists.txt b/deps/curl/src/CMakeLists.txt index cd1e9be4..0f87fcc9 100644 --- a/deps/curl/src/CMakeLists.txt +++ b/deps/curl/src/CMakeLists.txt @@ -22,44 +22,58 @@ # ########################################################################### set(EXE_NAME curl) -add_definitions(-DBUILDING_CURL) +add_definitions("-DBUILDING_CURL") if(ENABLE_CURL_MANUAL AND HAVE_MANUAL_TOOLS) add_definitions("-DUSE_MANUAL") add_custom_command( - OUTPUT tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> tool_hugehelp.c - COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" < "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> tool_hugehelp.c - - COMMAND ${CMAKE_COMMAND} -E echo "#else" >> tool_hugehelp.c - COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c < "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> tool_hugehelp.c + OUTPUT "tool_hugehelp.c" + COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c" + COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> "tool_hugehelp.c" + COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c" + COMMAND ${CMAKE_COMMAND} -E echo "#else" >> "tool_hugehelp.c" + COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c" + COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> "tool_hugehelp.c" DEPENDS generate-curl.1 - "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.1" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" "${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.h" + "${CURL_ASCIIPAGE}" VERBATIM) else() add_custom_command( - OUTPUT tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_hugehelp.h\"" > tool_hugehelp.c + OUTPUT "tool_hugehelp.c" + COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_hugehelp.h\"" > "tool_hugehelp.c" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.h" VERBATIM) - endif() +# Get 'CURL_CFILES', 'CURLX_CFILES', 'CURL_HFILES', 'CURLTOOL_LIBCURL_CFILES' variables transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) +include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") + +if(CURL_CA_EMBED_SET) + if(PERL_FOUND) + add_definitions("-DCURL_CA_EMBED") + add_custom_command( + OUTPUT "tool_ca_embed.c" + COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" --var curl_ca_embed + < "${CURL_CA_EMBED}" > "tool_ca_embed.c" + DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" + "${CURL_CA_EMBED}" + VERBATIM) + list(APPEND CURL_CFILES "tool_ca_embed.c") + else() + message(WARNING "Perl not found. Will not embed the CA bundle.") + endif() +endif() if(WIN32) - list(APPEND CURL_CFILES curl.rc) + list(APPEND CURL_CFILES "curl.rc") endif() -# CURL_CFILES, CURLX_CFILES, CURL_HFILES, CURLTOOL_LIBCURL_CFILES -# come from Makefile.inc if(BUILD_STATIC_CURL) set(CURLX_CFILES ${CURLTOOL_LIBCURL_CFILES}) endif() @@ -67,26 +81,26 @@ endif() if(ENABLE_CURLDEBUG) # We must compile this source separately to avoid memdebug.h redefinitions # applying to them. - set_source_files_properties(../lib/curl_multibyte.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + set_source_files_properties("../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) endif() add_executable( ${EXE_NAME} ${CURL_CFILES} ${CURLX_CFILES} ${CURL_HFILES} - ) +) add_executable( ${PROJECT_NAME}::${EXE_NAME} ALIAS ${EXE_NAME} - ) +) add_library( - curltool # special libcurltool library just for unittests + curltool # special libcurltool library just for unittests STATIC EXCLUDE_FROM_ALL ${CURL_CFILES} ${CURLTOOL_LIBCURL_CFILES} ${CURL_HFILES} ) -target_compile_definitions(curltool PUBLIC UNITTESTS CURL_STATICLIB) +target_compile_definitions(curltool PUBLIC "UNITTESTS" "CURL_STATICLIB") target_link_libraries(curltool PRIVATE ${CURL_LIBS}) if(CURL_HAS_LTO) @@ -96,7 +110,7 @@ if(CURL_HAS_LTO) endif() if(ENABLE_UNICODE AND MINGW) - target_link_libraries(${EXE_NAME} -municode) + target_link_libraries(${EXE_NAME} "-municode") endif() source_group("curlX source files" FILES ${CURLX_CFILES}) @@ -104,26 +118,19 @@ source_group("curl source files" FILES ${CURL_CFILES}) source_group("curl header files" FILES ${CURL_HFILES}) include_directories( - ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" - ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" - ${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h" + "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" + "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" # This is needed as tool_hugehelp.c is generated in the binary dir - ${CURL_SOURCE_DIR}/src # To be able to reach "tool_hugehelp.h" - ) + "${PROJECT_SOURCE_DIR}/src" # for "tool_hugehelp.h" +) -#Build curl executable +# Build curl executable target_link_libraries(${EXE_NAME} ${LIB_SELECTED_FOR_EXE} ${CURL_LIBS}) ################################################################################ -#SET_TARGET_PROPERTIES(${EXE_NAME} ARCHIVE_OUTPUT_DIRECTORY "blah blah blah") -#SET_TARGET_PROPERTIES(${EXE_NAME} RUNTIME_OUTPUT_DIRECTORY "blah blah blah") -#SET_TARGET_PROPERTIES(${EXE_NAME} LIBRARY_OUTPUT_DIRECTORY "blah blah blah") - -#INCLUDE(ModuleInstall OPTIONAL) - 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}:: + FILE "${PROJECT_BINARY_DIR}/curl-target.cmake" + NAMESPACE ${PROJECT_NAME}:: ) diff --git a/deps/curl/src/Makefile.am b/deps/curl/src/Makefile.am index fcc9cfdf..98cc194c 100644 --- a/deps/curl/src/Makefile.am +++ b/deps/curl/src/Makefile.am @@ -26,6 +26,9 @@ AUTOMAKE_OPTIONS = foreign nostdinc # remove targets if the command fails .DELETE_ON_ERROR: +EXTRA_DIST = mk-file-embed.pl mkhelp.pl \ + Makefile.mk curl.rc Makefile.inc CMakeLists.txt .checksrc + # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library # being currently built and tested are searched before the library which @@ -45,19 +48,42 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ bin_PROGRAMS = curl -if BUILD_DOCS -SUBDIRS = ../docs -endif - if USE_CPPFLAG_CURL_STATICLIB AM_CPPFLAGS += -DCURL_STATICLIB endif AM_CPPFLAGS += -DBUILDING_CURL +AM_LDFLAGS = +if USE_UNICODE +AM_LDFLAGS += -municode +endif + include Makefile.inc +CLEANFILES = + +if USE_UNITY +curl_EXCLUDE = +if DEBUGBUILD +# We must compile this source separately to avoid memdebug.h redefinitions +# applying to them. +curl_EXCLUDE += ../lib/curl_multibyte.c +endif +if USE_CPPFLAG_CURL_STATICLIB +curl_CURLX = $(CURLTOOL_LIBCURL_CFILES) +else +curl_CURLX = $(CURLX_CFILES) +endif +curltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_CURLX) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CURL_CFILES) $(curl_CURLX) --exclude $(curl_EXCLUDE) > curltool_unity.c + +nodist_curl_SOURCES = curltool_unity.c +curl_SOURCES = $(curl_EXCLUDE) +CLEANFILES += curltool_unity.c +else # CURL_FILES comes from Makefile.inc curl_SOURCES = $(CURL_FILES) +endif if HAVE_WINDRES curl_SOURCES += $(CURL_RCFILES) $(CURL_RCFILES): tool_version.h @@ -71,32 +97,28 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) -if USE_EXPLICIT_LIB_DEPS -curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ -else -curl_LDADD = $(top_builddir)/lib/libcurl.la @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@ -endif +curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@ # if unit tests are enabled, build a static library to link them with if BUILD_UNITTESTS noinst_LTLIBRARIES = libcurltool.la -libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -DCURL_STATICLIB -DUNITTESTS +libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS libcurltool_la_CFLAGS = libcurltool_la_LDFLAGS = -static $(LINKFLAGS) +if USE_UNITY +libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(CURLTOOL_LIBCURL_CFILES) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CURL_CFILES) $(CURLTOOL_LIBCURL_CFILES) --exclude $(curl_EXCLUDE) > libcurltool_unity.c + +nodist_libcurltool_la_SOURCES = libcurltool_unity.c +libcurltool_la_SOURCES = $(curl_EXCLUDE) +CLEANFILES += libcurltool_unity.c +else libcurltool_la_SOURCES = $(CURL_FILES) endif - -CLEANFILES = tool_hugehelp.c -# Use the C locale to ensure that only ASCII characters appear in the -# embedded text. -NROFF=env LC_ALL=C @NROFF@ @MANOPT@ 2>/dev/null # figured out by the configure script - -EXTRA_DIST = mkhelp.pl \ - Makefile.mk curl.rc Makefile.inc CMakeLists.txt .checksrc +endif # Use absolute directory to disable VPATH -ASCIIPAGE=$(abs_top_builddir)/docs/cmdline-opts/curl.txt +ASCIIPAGE=$(top_builddir)/docs/cmdline-opts/curl.txt MKHELP=$(top_srcdir)/src/mkhelp.pl HUGE=tool_hugehelp.c @@ -105,13 +127,9 @@ HUGEIT_0 = @echo " HUGE " $@; HUGEIT_1 = HUGEIT_ = $(HUGEIT_0) -CHECKSRC = $(CS_$(V)) -CS_0 = @echo " RUN " $@; -CS_1 = -CS_ = $(CS_0) - if USE_MANUAL # Here are the stuff to create a built-in manual +AM_CPPFLAGS += -DUSE_MANUAL $(ASCIIPAGE): cd $(top_builddir)/docs && $(MAKE) @@ -139,13 +157,34 @@ $(HUGE): echo '#include "tool_hugehelp.h"' >> $(HUGE) endif -# ignore tool_hugehelp.c since it is generated source code and it plays -# by slightly different rules! +CLEANFILES += $(HUGE) + +CA_EMBED_CSOURCE = tool_ca_embed.c +CURL_CFILES += $(CA_EMBED_CSOURCE) +CLEANFILES += $(CA_EMBED_CSOURCE) +if CURL_CA_EMBED_SET +AM_CPPFLAGS += -DCURL_CA_EMBED +MK_FILE_EMBED = $(top_srcdir)/src/mk-file-embed.pl +$(CA_EMBED_CSOURCE): $(MK_FILE_EMBED) $(CURL_CA_EMBED) + $(PERL) $(MK_FILE_EMBED) --var curl_ca_embed < $(CURL_CA_EMBED) > $(CA_EMBED_CSOURCE) +else +$(CA_EMBED_CSOURCE): + echo 'extern const void *curl_ca_embed; const void *curl_ca_embed;' > $(CA_EMBED_CSOURCE) +endif + +CHECKSRC = $(CS_$(V)) +CS_0 = @echo " RUN " $@; +CS_1 = +CS_ = $(CS_0) + +# ignore generated C files since they play by slightly different rules! checksrc: $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \ - -W$(srcdir)/tool_hugehelp.c $(srcdir)/*.[ch]) + -W$(srcdir)/$(HUGE) \ + -W$(srcdir)/$(CA_EMBED_CSOURCE) \ + $(srcdir)/*.[ch]) -if CURLDEBUG +if DEBUGBUILD # for debug builds, we scan the sources on all regular make invokes all-local: checksrc endif @@ -165,3 +204,6 @@ if HAVE_WINDRES .rc.o: $(RC) -I$(top_srcdir)/include -DCURL_EMBED_MANIFEST $(RCFLAGS) -i $< -o $@ endif + +dist-hook: + rm -f $(distdir)/$(CA_EMBED_CSOURCE) diff --git a/deps/curl/src/Makefile.inc b/deps/curl/src/Makefile.inc index c1d202a0..93bef122 100644 --- a/deps/curl/src/Makefile.inc +++ b/deps/curl/src/Makefile.inc @@ -34,7 +34,7 @@ CURLTOOL_LIBCURL_CFILES = \ ../lib/base64.c \ ../lib/dynbuf.c -# libcurl has sources that provide functions named curlx_* that aren't part of +# 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. CURLX_CFILES = \ ../lib/base64.c \ @@ -59,6 +59,7 @@ CURLX_HFILES = \ CURL_CFILES = \ slist_wc.c \ + terminal.c \ tool_binmode.c \ tool_bname.c \ tool_cb_dbg.c \ @@ -66,6 +67,7 @@ CURL_CFILES = \ tool_cb_prg.c \ tool_cb_rea.c \ tool_cb_see.c \ + tool_cb_soc.c \ tool_cb_wrt.c \ tool_cfgable.c \ tool_dirhie.c \ @@ -103,6 +105,7 @@ CURL_CFILES = \ CURL_HFILES = \ slist_wc.h \ + terminal.h \ tool_binmode.h \ tool_bname.h \ tool_cb_dbg.h \ @@ -110,6 +113,7 @@ CURL_HFILES = \ tool_cb_prg.h \ tool_cb_rea.h \ tool_cb_see.h \ + tool_cb_soc.h \ tool_cb_wrt.h \ tool_cfgable.h \ tool_dirhie.h \ diff --git a/deps/curl/src/Makefile.mk b/deps/curl/src/Makefile.mk index 83dd65d1..f25fc02a 100644 --- a/deps/curl/src/Makefile.mk +++ b/deps/curl/src/Makefile.mk @@ -45,6 +45,11 @@ TARGETS := curl$(BIN_EXT) CURL_CFILES += $(notdir $(CURLX_CFILES)) +ifneq ($(CURL_CA_EMBED),) +CPPFLAGS += -DCURL_CA_EMBED +CURL_CFILES += tool_ca_embed.c +endif + curl_OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(strip $(CURL_CFILES))) ifdef MAP CURL_MAP := curl.map @@ -57,31 +62,31 @@ TOCLEAN := $(curl_OBJECTS) ### Rules +PERL ?= perl + ifneq ($(wildcard tool_hugehelp.c.cvs),) -PERL ?= perl -NROFF ?= groff - TOCLEAN += tool_hugehelp.c - -ifneq ($(shell $(call WHICH, $(NROFF))),) -$(PROOT)/docs/curl.1: $(wildcard $(PROOT)/docs/cmdline-opts/*.d) - cd $(PROOT)/docs/cmdline-opts && \ - $(PERL) gen.pl mainpage $(notdir $^) > ../curl.1 - +# Load DPAGES +include $(PROOT)/docs/cmdline-opts/Makefile.inc +$(PROOT)/docs/cmdline-opts/curl.txt: $(addprefix $(PROOT)/docs/cmdline-opts/,$(DPAGES)) $(PROOT)/scripts/managen + cd $(PROOT)/docs/cmdline-opts && $(PERL) ../../scripts/managen ascii $(DPAGES) > curl.txt # Necessary for the generated tools_hugehelp.c CPPFLAGS += -DUSE_MANUAL - ifdef ZLIB _MKHELPOPT += -c endif -tool_hugehelp.c: $(PROOT)/docs/curl.1 mkhelp.pl - $(NROFF) -man -Tascii $(MANOPT) $< | \ - $(PERL) mkhelp.pl $(_MKHELPOPT) $< > $@ +tool_hugehelp.c: $(PROOT)/docs/cmdline-opts/curl.txt mkhelp.pl + $(PERL) mkhelp.pl $(_MKHELPOPT) < $< > $@ else tool_hugehelp.c: @echo Creating $@ @$(call COPY, $@.cvs, $@) endif + +ifneq ($(CURL_CA_EMBED),) +TOCLEAN += tool_ca_embed.c +tool_ca_embed.c: mk-file-embed.pl + $(PERL) mk-file-embed.pl --var curl_ca_embed < $(CURL_CA_EMBED) > $@ endif $(TARGETS): $(curl_OBJECTS) $(PROOT)/lib/libcurl.a diff --git a/deps/curl/src/curl.rc b/deps/curl/src/curl.rc index 6fcaf353..475dfbe8 100644 --- a/deps/curl/src/curl.rc +++ b/deps/curl/src/curl.rc @@ -32,7 +32,7 @@ VS_VERSION_INFO VERSIONINFO FILEVERSION RC_VERSION PRODUCTVERSION RC_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#if defined(DEBUGBUILD) || defined(_DEBUG) +#if defined(DEBUGBUILD) || defined(UNITTESTS) || defined(CURLDEBUG) || defined(_DEBUG) FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0L diff --git a/deps/curl/CMake/FindCARES.cmake b/deps/curl/src/mk-file-embed.pl similarity index 61% rename from deps/curl/CMake/FindCARES.cmake rename to deps/curl/src/mk-file-embed.pl index fa758911..e4dbe35d 100644 --- a/deps/curl/CMake/FindCARES.cmake +++ b/deps/curl/src/mk-file-embed.pl @@ -1,3 +1,4 @@ +#!/usr/bin/env perl #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | @@ -21,27 +22,40 @@ # SPDX-License-Identifier: curl # ########################################################################### -# - Find c-ares -# Find the c-ares includes and library -# This module defines -# CARES_INCLUDE_DIR, where to find ares.h, etc. -# CARES_LIBRARIES, the libraries needed to use c-ares. -# CARES_FOUND, If false, do not try to use c-ares. -# also defined, but not for general use are -# CARES_LIBRARY, where to find the c-ares library. -find_path(CARES_INCLUDE_DIR ares.h) +my $varname = "var"; +if($ARGV[0] eq "--var") { + shift; + $varname = shift @ARGV; +} -set(CARES_NAMES ${CARES_NAMES} cares) -find_library(CARES_LIBRARY - NAMES ${CARES_NAMES} - ) +my $varname_upper = uc($varname); -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(CARES - REQUIRED_VARS CARES_LIBRARY CARES_INCLUDE_DIR) +print <) { + my $line = $_; + foreach my $n (split //, $line) { + my $ord = ord($n); + printf("%s,", $ord); + if($ord == 10) { + printf("\n"); + } + } +} + +print <) { my $line = $_; push @out, $line; @@ -53,6 +45,8 @@ print <, 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 "tool_setup.h" + +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + +#include "terminal.h" + +#include "memdebug.h" /* keep this as LAST include */ + +#ifdef HAVE_TERMIOS_H +# include +#elif defined(HAVE_TERMIO_H) +# include +#endif + +/* + * get_terminal_columns() returns the number of columns in the current + * terminal. It will return 79 on failure. Also, the number can be big. + */ + +unsigned int get_terminal_columns(void) +{ + unsigned int width = 0; + char *colp = curl_getenv("COLUMNS"); + if(colp) { + char *endptr; + long num = strtol(colp, &endptr, 10); + if((endptr != colp) && (endptr == colp + strlen(colp)) && (num > 20) && + (num < 10000)) + width = (unsigned int)num; + curl_free(colp); + } + + if(!width) { + int cols = 0; + +#ifdef TIOCGSIZE + struct ttysize ts; + if(!ioctl(STDIN_FILENO, TIOCGSIZE, &ts)) + cols = ts.ts_cols; +#elif defined(TIOCGWINSZ) + struct winsize ts; + if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts)) + cols = (int)ts.ws_col; +#elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP) + { + HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE); + CONSOLE_SCREEN_BUFFER_INFO console_info; + + if((stderr_hnd != INVALID_HANDLE_VALUE) && + GetConsoleScreenBufferInfo(stderr_hnd, &console_info)) { + /* + * 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); + } + } +#endif /* TIOCGSIZE */ + if(cols >= 0 && cols < 10000) + width = (unsigned int)cols; + } + if(!width) + width = 79; + return width; /* 79 for unknown, might also be tiny or enormous */ +} diff --git a/deps/curl/src/terminal.h b/deps/curl/src/terminal.h new file mode 100644 index 00000000..dbd4abe2 --- /dev/null +++ b/deps/curl/src/terminal.h @@ -0,0 +1,30 @@ +#ifndef HEADER_CURL_TERMINAL_H +#define HEADER_CURL_TERMINAL_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 "tool_setup.h" + +unsigned int get_terminal_columns(void); + +#endif /* HEADER_CURL_TERMINAL_H */ diff --git a/deps/curl/src/tool_binmode.c b/deps/curl/src/tool_binmode.c index e27ce966..a9259641 100644 --- a/deps/curl/src/tool_binmode.c +++ b/deps/curl/src/tool_binmode.c @@ -23,7 +23,7 @@ ***************************************************************************/ #include "tool_setup.h" -#ifdef HAVE_SETMODE +#if defined(HAVE_SETMODE) || defined(HAVE__SETMODE) #ifdef HAVE_IO_H # include @@ -42,6 +42,8 @@ void set_binmode(FILE *stream) #ifdef O_BINARY # ifdef __HIGHC__ _setmode(stream, O_BINARY); +# elif defined(HAVE__SETMODE) + (void)_setmode(fileno(stream), O_BINARY); # else (void)setmode(fileno(stream), O_BINARY); # endif @@ -50,4 +52,4 @@ void set_binmode(FILE *stream) #endif } -#endif /* HAVE_SETMODE */ +#endif /* HAVE_SETMODE || HAVE__SETMODE */ diff --git a/deps/curl/src/tool_binmode.h b/deps/curl/src/tool_binmode.h index bee837b0..ce2f589e 100644 --- a/deps/curl/src/tool_binmode.h +++ b/deps/curl/src/tool_binmode.h @@ -25,7 +25,7 @@ ***************************************************************************/ #include "tool_setup.h" -#ifdef HAVE_SETMODE +#if defined(HAVE_SETMODE) || defined(HAVE__SETMODE) void set_binmode(FILE *stream); @@ -33,6 +33,6 @@ void set_binmode(FILE *stream); #define set_binmode(x) Curl_nop_stmt -#endif /* HAVE_SETMODE */ +#endif /* HAVE_SETMODE || HAVE__SETMODE */ #endif /* HEADER_CURL_TOOL_BINMODE_H */ diff --git a/deps/curl/src/tool_cb_dbg.c b/deps/curl/src/tool_cb_dbg.c index cbf57f05..195127bd 100644 --- a/deps/curl/src/tool_cb_dbg.c +++ b/deps/curl/src/tool_cb_dbg.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "tool_setup.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -59,7 +57,7 @@ static const char *hms_for_sec(time_t tv_sec) } secs = epoch_offset + 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 */ msnprintf(hms_buf, sizeof(hms_buf), "%02d:%02d:%02d", now->tm_hour, now->tm_min, now->tm_sec); cached_tv_sec = tv_sec; @@ -99,7 +97,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, const char *text; struct timeval tv; char timebuf[20]; - /* largest signed 64bit is: 9,223,372,036,854,775,807 + /* largest signed 64-bit is: 9,223,372,036,854,775,807 * max length in decimal: 1 + (6*3) = 19 * formatted via TRC_IDS_FORMAT_IDS_2 this becomes 2 + 19 + 1 + 19 + 2 = 43 * negative xfer-id are not printed, negative conn-ids use TRC_IDS_FORMAT_1 @@ -175,7 +173,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, log_line_start(output, timebuf, idsbuf, type); (void)fwrite(data + st, i - st + 1, 1, output); } - newl = (size && (data[size - 1] != '\n')) ? TRUE : FALSE; + newl = (size && (data[size - 1] != '\n')); traced_data = FALSE; break; case CURLINFO_TEXT: @@ -183,7 +181,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, if(!newl) log_line_start(output, timebuf, idsbuf, type); (void)fwrite(data, size, 1, output); - newl = (size && (data[size - 1] != '\n')) ? TRUE : FALSE; + newl = (size && (data[size - 1] != '\n')); traced_data = FALSE; break; case CURLINFO_DATA_OUT: @@ -191,8 +189,8 @@ int tool_debug_cb(CURL *handle, curl_infotype type, case CURLINFO_SSL_DATA_IN: case CURLINFO_SSL_DATA_OUT: if(!traced_data) { - /* if the data is output to a tty and we're sending this debug trace - to stderr or stdout, we don't display the alert about the data not + /* if the data is output to a tty and we are sending this debug trace + to stderr or stdout, we do not display the alert about the data not being shown as the data _is_ shown then just not via this function */ if(!config->isatty || @@ -286,7 +284,7 @@ static void dump(const char *timebuf, const char *idsbuf, const char *text, (void)infotype; fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x7F)) ? ptr[i + c] : UNPRINTABLE_CHAR); - /* 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((tracetype == TRACE_ASCII) && (i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) && (ptr[i + c + 2] == 0x0A)) { diff --git a/deps/curl/src/tool_cb_hdr.c b/deps/curl/src/tool_cb_hdr.c index 13fb76d6..1b0348d2 100644 --- a/deps/curl/src/tool_cb_hdr.c +++ b/deps/curl/src/tool_cb_hdr.c @@ -24,9 +24,10 @@ #include "tool_setup.h" #include "strcase.h" +#ifdef HAVE_UNISTD_H +#include +#endif -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -47,7 +48,7 @@ static char *parse_filename(const char *ptr, size_t len); #else #define BOLD "\x1b[1m" /* Switch off bold by setting "all attributes off" since the explicit - bold-off code (21) isn't supported everywhere - like in the mac + bold-off code (21) is not supported everywhere - like in the mac Terminal. */ #define BOLDOFF "\x1b[0m" /* OSC 8 hyperlink escape sequence */ @@ -61,6 +62,25 @@ static void write_linked_location(CURL *curl, const char *location, size_t loclen, FILE *stream); #endif +int tool_write_headers(struct HdrCbData *hdrcbdata, FILE *stream) +{ + struct curl_slist *h = hdrcbdata->headlist; + int rc = 1; + while(h) { + /* not "handled", just show it */ + size_t len = strlen(h->data); + if(len != fwrite(h->data, 1, len, stream)) + goto fail; + h = h->next; + } + rc = 0; /* success */ +fail: + curl_slist_free_all(hdrcbdata->headlist); + hdrcbdata->headlist = NULL; + return rc; +} + + /* ** callback for CURLOPT_HEADERFUNCTION */ @@ -102,7 +122,11 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) if(rc != cb) return rc; /* flush the stream to send off what we got earlier */ - (void)fflush(heads->stream); + if(fflush(heads->stream)) { + errorf(per->config->global, "Failed writing headers to %s", + per->config->headerfile); + return CURL_WRITEFUNC_ERROR; + } } curl_easy_getinfo(per->curl, CURLINFO_SCHEME, &scheme); @@ -111,8 +135,9 @@ 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) - /* only care about these headers in 2xx responses */ + if((response/100 != 2) && (response/100 != 3)) + /* only care about etag and content-disposition headers in 2xx and 3xx + responses */ ; /* * Write etag to file when --etag-save option is given. @@ -130,6 +155,19 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) if(eot >= etag_h) { size_t etag_length = eot - etag_h + 1; + /* + * Truncate the etag save stream, it can have an existing etag value. + */ +#ifdef HAVE_FTRUNCATE + if(ftruncate(fileno(etag_save->stream), 0)) { + return CURL_WRITEFUNC_ERROR; + } +#else + if(fseek(etag_save->stream, 0, SEEK_SET)) { + return CURL_WRITEFUNC_ERROR; + } +#endif + fwrite(etag_h, size, etag_length, etag_save->stream); /* terminate with newline */ fputc('\n', etag_save->stream); @@ -145,66 +183,90 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) * Content-Disposition header specifying a filename property. */ - else if(hdrcbdata->honor_cd_filename && - (cb > 20) && checkprefix("Content-disposition:", str)) { - const char *p = str + 20; + else if(hdrcbdata->honor_cd_filename) { + if((cb > 20) && checkprefix("Content-disposition:", str)) { + const char *p = str + 20; - /* look for the 'filename=' parameter - (encoded filenames (*=) are not supported) */ - for(;;) { - char *filename; - size_t len; + /* look for the 'filename=' parameter + (encoded filenames (*=) are not supported) */ + for(;;) { + char *filename; + size_t len; - while((p < end) && *p && !ISALPHA(*p)) - p++; - if(p > end - 9) - break; - - if(memcmp(p, "filename=", 9)) { - /* no match, find next parameter */ - while((p < end) && *p && (*p != ';')) + while((p < end) && *p && !ISALPHA(*p)) p++; - if((p < end) && *p) - continue; - else + if(p > end - 9) break; - } - p += 9; - /* this expression below typecasts 'cb' only to avoid - warning: signed and unsigned type in conditional expression - */ - len = (ssize_t)cb - (p - str); - filename = parse_filename(p, len); - if(filename) { - if(outs->stream) { - /* indication of problem, get out! */ - free(filename); - return CURL_WRITEFUNC_ERROR; + if(memcmp(p, "filename=", 9)) { + /* no match, find next parameter */ + while((p < end) && *p && (*p != ';')) + p++; + if((p < end) && *p) + continue; + else + break; } + p += 9; - if(per->config->output_dir) { - outs->filename = aprintf("%s/%s", per->config->output_dir, - filename); - free(filename); - if(!outs->filename) + len = cb - (size_t)(p - str); + filename = parse_filename(p, len); + if(filename) { + if(outs->stream) { + /* indication of problem, get out! */ + free(filename); + return CURL_WRITEFUNC_ERROR; + } + + if(per->config->output_dir) { + outs->filename = aprintf("%s/%s", per->config->output_dir, + filename); + free(filename); + if(!outs->filename) + return CURL_WRITEFUNC_ERROR; + } + else + outs->filename = filename; + + outs->is_cd_filename = TRUE; + outs->s_isreg = TRUE; + outs->fopened = FALSE; + outs->alloc_filename = TRUE; + hdrcbdata->honor_cd_filename = FALSE; /* done now! */ + if(!tool_create_output_file(outs, per->config)) + return CURL_WRITEFUNC_ERROR; + if(tool_write_headers(&per->hdrcbdata, outs->stream)) return CURL_WRITEFUNC_ERROR; } - else - outs->filename = filename; - - outs->is_cd_filename = TRUE; - outs->s_isreg = TRUE; - outs->fopened = FALSE; - outs->alloc_filename = TRUE; - hdrcbdata->honor_cd_filename = FALSE; /* done now! */ - if(!tool_create_output_file(outs, per->config)) - return CURL_WRITEFUNC_ERROR; + break; } - break; + if(!outs->stream && !tool_create_output_file(outs, per->config)) + return CURL_WRITEFUNC_ERROR; + if(tool_write_headers(&per->hdrcbdata, outs->stream)) + return CURL_WRITEFUNC_ERROR; + } /* content-disposition handling */ + + if(hdrcbdata->honor_cd_filename && + hdrcbdata->config->show_headers) { + /* still awaiting the Content-Disposition header, store the header in + memory. Since it is not zero terminated, we need an extra dance. */ + char *clone = aprintf("%.*s", (int)cb, (char *)str); + if(clone) { + struct curl_slist *old = hdrcbdata->headlist; + hdrcbdata->headlist = curl_slist_append(old, clone); + free(clone); + if(!hdrcbdata->headlist) { + curl_slist_free_all(old); + return CURL_WRITEFUNC_ERROR; + } + } + else { + curl_slist_free_all(hdrcbdata->headlist); + hdrcbdata->headlist = NULL; + return CURL_WRITEFUNC_ERROR; + } + return cb; /* done for now */ } - if(!outs->stream && !tool_create_output_file(outs, per->config)) - return CURL_WRITEFUNC_ERROR; } } if(hdrcbdata->config->writeout) { @@ -255,7 +317,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) } /* - * Copies a file name part and returns an ALLOCATED data buffer. + * Copies a filename part and returns an ALLOCATED data buffer. */ static char *parse_filename(const char *ptr, size_t len) { @@ -296,7 +358,7 @@ static char *parse_filename(const char *ptr, size_t len) } /* If the filename contains a backslash, only use filename portion. The idea - is that even systems that don't handle backslashes as path separators + is that even systems that do not handle backslashes as path separators probably want the path removed for convenience. */ q = strrchr(p, '\\'); if(q) { @@ -307,7 +369,7 @@ static char *parse_filename(const char *ptr, size_t len) } } - /* make sure the file name doesn't end in \r or \n */ + /* make sure the filename does not end in \r or \n */ q = strchr(p, '\r'); if(q) *q = '\0'; @@ -331,17 +393,17 @@ static char *parse_filename(const char *ptr, size_t len) #endif /* _WIN32 || MSDOS */ /* in case we built debug enabled, we allow an environment variable - * named CURL_TESTDIR to prefix the given file name to put it into a + * named CURL_TESTDIR to prefix the given filename to put it into a * specific directory */ #ifdef DEBUGBUILD { - char *tdir = curlx_getenv("CURL_TESTDIR"); + char *tdir = curl_getenv("CURL_TESTDIR"); if(tdir) { char buffer[512]; /* suitably large */ msnprintf(buffer, sizeof(buffer), "%s/%s", tdir, copy); Curl_safefree(copy); - copy = strdup(buffer); /* clone the buffer, we don't use the libcurl + copy = strdup(buffer); /* clone the buffer, we do not use the libcurl aprintf() or similar since we want to use the same memory code as the "real" parse_filename function */ @@ -358,9 +420,9 @@ static char *parse_filename(const char *ptr, size_t len) * Treat the Location: header specially, by writing a special escape * sequence that adds a hyperlink to the displayed text. This makes * the absolute URL of the redirect clickable in supported terminals, - * which couldn't happen otherwise for relative URLs. The Location: + * which could not happen otherwise for relative URLs. The Location: * header is supposed to always be absolute so this theoretically - * shouldn't be needed but the real world returns plenty of relative + * should not be needed but the real world returns plenty of relative * URLs here. */ static @@ -432,7 +494,7 @@ void write_linked_location(CURL *curl, const char *location, size_t loclen, goto locdone; } - /* Not a "safe" URL: don't linkify it */ + /* Not a "safe" URL: do not linkify it */ locout: /* Write the normal output in case of error or unsafe */ diff --git a/deps/curl/src/tool_cb_hdr.h b/deps/curl/src/tool_cb_hdr.h index a855052d..7402c12a 100644 --- a/deps/curl/src/tool_cb_hdr.h +++ b/deps/curl/src/tool_cb_hdr.h @@ -46,9 +46,12 @@ struct HdrCbData { struct OutStruct *outs; struct OutStruct *heads; struct OutStruct *etag_save; + struct curl_slist *headlist; bool honor_cd_filename; }; +int tool_write_headers(struct HdrCbData *hdrcbdata, FILE *stream); + /* ** callback for CURLOPT_HEADERFUNCTION */ diff --git a/deps/curl/src/tool_cb_prg.c b/deps/curl/src/tool_cb_prg.c index 86b6fa60..0e58474a 100644 --- a/deps/curl/src/tool_cb_prg.c +++ b/deps/curl/src/tool_cb_prg.c @@ -23,28 +23,18 @@ ***************************************************************************/ #include "tool_setup.h" -#ifdef HAVE_SYS_IOCTL_H -#include -#endif - -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_cb_prg.h" #include "tool_util.h" #include "tool_operate.h" +#include "terminal.h" #include "memdebug.h" /* keep this as LAST include */ -#define MAX_BARLENGTH 256 - -#ifdef HAVE_TERMIOS_H -# include -#elif defined(HAVE_TERMIO_H) -# include -#endif +#define MAX_BARLENGTH 400 +#define MIN_BARLENGTH 20 /* 200 values generated by this perl code: @@ -53,7 +43,7 @@ printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000; } */ -static const unsigned int sinus[] = { +static const int sinus[] = { 515704, 531394, 547052, 562664, 578214, 593687, 609068, 624341, 639491, 654504, 669364, 684057, 698568, 712883, 726989, 740870, 754513, 767906, 781034, 793885, 806445, 818704, 830647, 842265, 853545, 864476, 875047, @@ -86,19 +76,19 @@ static void fly(struct ProgressData *bar, bool moved) /* bar->width is range checked when assigned */ DEBUGASSERT(bar->width <= MAX_BARLENGTH); - memset(buf, ' ', bar->width); - buf[bar->width] = '\r'; + buf[0] = '\r'; + memset(&buf[1], ' ', bar->width); buf[bar->width + 1] = '\0'; - memcpy(&buf[bar->bar], "-=O=-", 5); + memcpy(&buf[bar->bar + 1], "-=O=-", 5); - pos = sinus[bar->tick%200] / (1000000 / check); + pos = sinus[bar->tick%200] / (1000000 / check) + 1; buf[pos] = '#'; - pos = sinus[(bar->tick + 5)%200] / (1000000 / check); + pos = sinus[(bar->tick + 5)%200] / (1000000 / check) + 1; buf[pos] = '#'; - pos = sinus[(bar->tick + 10)%200] / (1000000 / check); + pos = sinus[(bar->tick + 10)%200] / (1000000 / check) + 1; buf[pos] = '#'; - pos = sinus[(bar->tick + 15)%200] / (1000000 / check); + pos = sinus[(bar->tick + 15)%200] / (1000000 / check) + 1; buf[pos] = '#'; fputs(buf, bar->out); @@ -106,7 +96,7 @@ static void fly(struct ProgressData *bar, bool moved) if(bar->tick >= 200) bar->tick -= 200; - bar->bar += (moved?bar->barmove:0); + bar->bar += (moved ? bar->barmove : 0); if(bar->bar >= (bar->width - 6)) { bar->barmove = -1; bar->bar = bar->width - 6; @@ -128,6 +118,17 @@ static void fly(struct ProgressData *bar, bool moved) # define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF) #endif +static void update_width(struct ProgressData *bar) +{ + int cols = get_terminal_columns(); + if(cols > MAX_BARLENGTH) + bar->width = MAX_BARLENGTH; + else if(cols > MIN_BARLENGTH) + bar->width = (int)cols; + else + bar->width = MIN_BARLENGTH; +} + int tool_progress_cb(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) @@ -170,10 +171,10 @@ int tool_progress_cb(void *clientp, if(total) { /* we know the total data to get... */ if(bar->prev == point) - /* progress didn't change since last invoke */ + /* progress did not change since last invoke */ return 0; else if((tvdiff(now, bar->prevtime) < 100L) && point < total) - /* limit progress-bar updating to 10 Hz except when we're at 100% */ + /* limit progress-bar updating to 10 Hz except when we are at 100% */ return 0; } else { @@ -181,6 +182,7 @@ int tool_progress_cb(void *clientp, if(tvdiff(now, bar->prevtime) < 100L) /* limit progress-bar updating to 10 Hz */ return 0; + update_width(bar); fly(bar, point != bar->prev); } } @@ -188,13 +190,14 @@ int tool_progress_cb(void *clientp, /* simply count invokes */ bar->calls++; + update_width(bar); if((total > 0) && (point != bar->prev)) { char line[MAX_BARLENGTH + 1]; char format[40]; double frac; double percent; int barwidth; - int num; + size_t num; if(point > total) /* we have got more than the expected total! */ total = point; @@ -202,7 +205,7 @@ int tool_progress_cb(void *clientp, frac = (double)point / (double)total; percent = frac * 100.0; barwidth = bar->width - 7; - num = (int) (((double)barwidth) * frac); + num = (size_t) (((double)barwidth) * frac); if(num > MAX_BARLENGTH) num = MAX_BARLENGTH; memset(line, '#', num); @@ -232,59 +235,14 @@ int tool_progress_cb(void *clientp, void progressbarinit(struct ProgressData *bar, struct OperationConfig *config) { - char *colp; memset(bar, 0, sizeof(struct ProgressData)); /* pass the resume from value through to the progress function so it can - * display progress towards total file not just the part that's left. */ + * display progress towards total file not just the part that is left. */ if(config->use_resume) bar->initial_size = config->resume_from; - colp = curlx_getenv("COLUMNS"); - if(colp) { - char *endptr; - long num = strtol(colp, &endptr, 10); - if((endptr != colp) && (endptr == colp + strlen(colp)) && (num > 20) && - (num < 10000)) - bar->width = (int)num; - curl_free(colp); - } - - if(!bar->width) { - int cols = 0; - -#ifdef TIOCGSIZE - struct ttysize ts; - if(!ioctl(STDIN_FILENO, TIOCGSIZE, &ts)) - cols = ts.ts_cols; -#elif defined(TIOCGWINSZ) - struct winsize ts; - if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts)) - cols = ts.ws_col; -#elif defined(_WIN32) - { - HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE); - CONSOLE_SCREEN_BUFFER_INFO console_info; - - if((stderr_hnd != INVALID_HANDLE_VALUE) && - GetConsoleScreenBufferInfo(stderr_hnd, &console_info)) { - /* - * 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); - } - } -#endif /* TIOCGSIZE */ - if(cols > 20) - bar->width = cols; - } - - if(!bar->width) - bar->width = 79; - else if(bar->width > MAX_BARLENGTH) - bar->width = MAX_BARLENGTH; + update_width(bar); bar->out = tool_stderr; bar->tick = 150; diff --git a/deps/curl/src/tool_cb_prg.h b/deps/curl/src/tool_cb_prg.h index 565ad565..dc10f2a5 100644 --- a/deps/curl/src/tool_cb_prg.h +++ b/deps/curl/src/tool_cb_prg.h @@ -40,6 +40,8 @@ struct ProgressData { int barmove; }; +struct OperationConfig; + void progressbarinit(struct ProgressData *bar, struct OperationConfig *config); diff --git a/deps/curl/src/tool_cb_rea.c b/deps/curl/src/tool_cb_rea.c index 8cb5bbe8..a9b0d68a 100644 --- a/deps/curl/src/tool_cb_rea.c +++ b/deps/curl/src/tool_cb_rea.c @@ -27,8 +27,6 @@ #include #endif -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -36,6 +34,7 @@ #include "tool_operate.h" #include "tool_util.h" #include "tool_msgs.h" +#include "tool_sleep.h" #include "memdebug.h" /* keep this as LAST include */ @@ -89,7 +88,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) config->readbusy = TRUE; return CURL_READFUNC_PAUSE; } - /* since size_t is unsigned we can't return negative values fine */ + /* since size_t is unsigned we cannot return negative values fine */ rc = 0; } if((per->uploadfilesize != -1) && @@ -124,9 +123,34 @@ int tool_readbusy_cb(void *clientp, (void)ulnow; /* unused */ if(config->readbusy) { - config->readbusy = FALSE; - curl_easy_pause(per->curl, CURLPAUSE_CONT); + /* lame code to keep the rate down because the input might not deliver + anything, get paused again and come back here immediately */ + static long rate = 500; + static struct timeval prev; + static curl_off_t ulprev; + + if(ulprev == ulnow) { + /* it did not upload anything since last call */ + struct timeval now = tvnow(); + if(prev.tv_sec) + /* get a rolling average rate */ + /* rate = rate - rate/4 + tvdiff(now, prev)/4; */ + rate -= rate/4 - tvdiff(now, prev)/4; + prev = now; + } + else { + rate = 50; + ulprev = ulnow; + } + if(rate >= 50) { + /* keeps the looping down to 20 times per second in the crazy case */ + config->readbusy = FALSE; + curl_easy_pause(per->curl, CURLPAUSE_CONT); + } + else + /* sleep half a period */ + tool_go_sleep(25); } - return per->noprogress? 0 : CURL_PROGRESSFUNC_CONTINUE; + return per->noprogress ? 0 : CURL_PROGRESSFUNC_CONTINUE; } diff --git a/deps/curl/src/tool_cb_see.c b/deps/curl/src/tool_cb_see.c index bce57bb2..a425ebe9 100644 --- a/deps/curl/src/tool_cb_see.c +++ b/deps/curl/src/tool_cb_see.c @@ -23,8 +23,6 @@ ***************************************************************************/ #include "tool_setup.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -54,27 +52,27 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) #if(SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES) /* The offset check following here is only interesting if curl_off_t is - larger than off_t and we are not using the WIN32 large file support - macros that provide the support to do 64bit seeks correctly */ + larger than off_t and we are not using the Win32 large file support + macros that provide the support to do 64-bit seeks correctly */ if(offset > OUR_MAX_SEEK_O) { /* Some precaution code to work around problems with different data sizes - to allow seeking >32bit even if off_t is 32bit. 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 very rare + and is really valid on weirdo-systems. */ curl_off_t left = offset; if(whence != SEEK_SET) - /* this code path doesn't support other types */ + /* this code path does not support other types */ return CURL_SEEKFUNC_FAIL; if(LSEEK_ERROR == lseek(per->infd, 0, SEEK_SET)) - /* couldn't rewind to beginning */ + /* could not rewind to beginning */ return CURL_SEEKFUNC_FAIL; while(left) { long step = (left > OUR_MAX_SEEK_O) ? OUR_MAX_SEEK_L : (long)left; if(LSEEK_ERROR == lseek(per->infd, step, SEEK_CUR)) - /* couldn't seek forwards the desired amount */ + /* could not seek forwards the desired amount */ return CURL_SEEKFUNC_FAIL; left -= step; } @@ -83,39 +81,10 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) #endif if(LSEEK_ERROR == lseek(per->infd, offset, whence)) - /* couldn't rewind, the reason is in errno but errno is just not portable - enough and we don't actually care that much why we failed. We'll let + /* could not rewind, the reason is in errno but errno is just not portable + enough and we do not actually care that much why we failed. We will let libcurl know that it may try other means if it wants to. */ return CURL_SEEKFUNC_CANTSEEK; return CURL_SEEKFUNC_OK; } - -#ifdef USE_TOOL_FTRUNCATE - -#ifdef _WIN32_WCE -/* 64-bit lseek-like function unavailable */ -# undef _lseeki64 -# define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence) -# undef _get_osfhandle -# define _get_osfhandle(fd) (fd) -#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); - - if(_lseeki64(fd, where, SEEK_SET) < 0) - return -1; - - if(!SetEndOfFile((HANDLE)handle)) - return -1; - - return 0; -} - -#endif /* USE_TOOL_FTRUNCATE */ diff --git a/deps/curl/src/tool_cb_see.h b/deps/curl/src/tool_cb_see.h index b5d7bf98..e7b30a76 100644 --- a/deps/curl/src/tool_cb_see.h +++ b/deps/curl/src/tool_cb_see.h @@ -25,18 +25,6 @@ ***************************************************************************/ #include "tool_setup.h" -#if defined(_WIN32) && !defined(HAVE_FTRUNCATE) - -int tool_ftruncate64(int fd, curl_off_t where); - -#undef ftruncate -#define ftruncate(fd,where) tool_ftruncate64(fd,where) - -#define HAVE_FTRUNCATE 1 -#define USE_TOOL_FTRUNCATE 1 - -#endif /* _WIN32 && ! HAVE_FTRUNCATE */ - /* ** callback for CURLOPT_SEEKFUNCTION */ diff --git a/deps/curl/src/tool_cb_soc.c b/deps/curl/src/tool_cb_soc.c new file mode 100644 index 00000000..22048ee6 --- /dev/null +++ b/deps/curl/src/tool_cb_soc.c @@ -0,0 +1,58 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 "tool_setup.h" + +#ifdef HAVE_NETINET_IN_H +#include /* IPPROTO_TCP */ +#endif + +#include "tool_cb_soc.h" + +/* +** callback for CURLOPT_OPENSOCKETFUNCTION +** +** Notice that only Linux is supported for the moment. +*/ + +curl_socket_t tool_socket_open_mptcp_cb(void *clientp, + curlsocktype purpose, + struct curl_sockaddr *addr) +{ + int protocol = addr->protocol; + + (void)clientp; + (void)purpose; + + if(protocol == IPPROTO_TCP) +#if defined(__linux__) +# ifndef IPPROTO_MPTCP +# define IPPROTO_MPTCP 262 +# endif + protocol = IPPROTO_MPTCP; +#else + return CURL_SOCKET_BAD; +#endif + + return socket(addr->family, addr->socktype, protocol); +} diff --git a/deps/curl/tests/libtest/chkhostname.c b/deps/curl/src/tool_cb_soc.h similarity index 65% rename from deps/curl/tests/libtest/chkhostname.c rename to deps/curl/src/tool_cb_soc.h index e49da133..f02150aa 100644 --- a/deps/curl/tests/libtest/chkhostname.c +++ b/deps/curl/src/tool_cb_soc.h @@ -1,3 +1,5 @@ +#ifndef HEADER_CURL_TOOL_CB_SOC_H +#define HEADER_CURL_TOOL_CB_SOC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -21,29 +23,14 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#include "curl_setup.h" +#include "tool_setup.h" -#include "curl_gethostname.h" +/* +** callback for CURLOPT_OPENSOCKETFUNCTION +*/ -#define HOSTNAME_MAX 1024 +curl_socket_t tool_socket_open_mptcp_cb(void *clientp, + curlsocktype purpose, + struct curl_sockaddr *addr); -int main(int argc, char *argv[]) -{ - char buff[HOSTNAME_MAX]; - if(argc != 2) { - printf("Usage: %s EXPECTED_HOSTNAME\n", argv[0]); - return 1; - } - - if(Curl_gethostname(buff, HOSTNAME_MAX)) { - printf("Curl_gethostname() failed\n"); - return 1; - } - - /* compare the name returned by Curl_gethostname() with the expected one */ - if(strncmp(buff, argv[1], HOSTNAME_MAX)) { - printf("got unexpected host name back, LD_PRELOAD failed\n"); - return 1; - } - return 0; -} +#endif /* HEADER_CURL_TOOL_CB_SOC_H */ diff --git a/deps/curl/src/tool_cb_wrt.c b/deps/curl/src/tool_cb_wrt.c index 143cba25..f25a4815 100644 --- a/deps/curl/src/tool_cb_wrt.c +++ b/deps/curl/src/tool_cb_wrt.c @@ -30,8 +30,6 @@ #include -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -56,14 +54,11 @@ bool tool_create_output_file(struct OutStruct *outs, { struct GlobalConfig *global; FILE *file = NULL; - char *fname = outs->filename; + const char *fname = outs->filename; DEBUGASSERT(outs); DEBUGASSERT(config); global = config->global; - if(!fname || !*fname) { - warnf(global, "Remote filename has no length"); - return FALSE; - } + DEBUGASSERT(fname && *fname); if(config->file_clobber_mode == CLOBBER_ALWAYS || (config->file_clobber_mode == CLOBBER_DEFAULT && @@ -75,7 +70,7 @@ bool tool_create_output_file(struct OutStruct *outs, int fd; do { fd = open(fname, O_CREAT | O_WRONLY | O_EXCL | O_BINARY, OPENMODE); - /* Keep retrying in the hope that it isn't interrupted sometime */ + /* Keep retrying in the hope that it is not interrupted sometime */ } while(fd == -1 && errno == EINTR); if(config->file_clobber_mode == CLOBBER_NEVER && fd == -1) { int next_num = 1; @@ -94,15 +89,15 @@ bool tool_create_output_file(struct OutStruct *outs, } memcpy(newname, fname, len); newname[len] = '.'; - while(fd == -1 && /* haven't successfully opened a file */ + 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 haven't reached the retry limit */ ) { - curlx_msnprintf(newname + len + 1, 12, "%d", next_num); + next_num < 100 /* and we have not reached the retry limit */ ) { + msnprintf(newname + len + 1, 12, "%d", next_num); next_num++; do { fd = open(newname, O_CREAT | O_WRONLY | O_EXCL | O_BINARY, OPENMODE); - /* Keep retrying in the hope that it isn't interrupted sometime */ + /* Keep retrying in the hope that it is not interrupted sometime */ } while(fd == -1 && errno == EINTR); } outs->filename = newname; /* remember the new one */ @@ -152,7 +147,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) #ifdef DEBUGBUILD { - char *tty = curlx_getenv("CURL_ISATTY"); + char *tty = curl_getenv("CURL_ISATTY"); if(tty) { is_tty = TRUE; curl_free(tty); @@ -219,7 +214,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) #ifdef _WIN32 fhnd = _get_osfhandle(fileno(outs->stream)); - /* if windows console then UTF-8 must be converted to UTF-16 */ + /* if Windows console then UTF-8 must be converted to UTF-16 */ if(isatty(fileno(outs->stream)) && GetConsoleScreenBufferInfo((HANDLE)fhnd, &console_info)) { wchar_t *wc_buf; @@ -318,7 +313,8 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) if(rlen) { /* calculate buffer size for wide characters */ - wc_len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)rbuf, rlen, NULL, 0); + wc_len = (DWORD)MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)rbuf, (int)rlen, + NULL, 0); if(!wc_len) return CURL_WRITEFUNC_ERROR; @@ -326,8 +322,8 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) if(!wc_buf) return CURL_WRITEFUNC_ERROR; - wc_len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)rbuf, rlen, wc_buf, - wc_len); + wc_len = (DWORD)MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)rbuf, (int)rlen, + wc_buf, (int)wc_len); if(!wc_len) { free(wc_buf); return CURL_WRITEFUNC_ERROR; @@ -349,7 +345,13 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) } else #endif + { + if(per->hdrcbdata.headlist) { + if(tool_write_headers(&per->hdrcbdata, outs->stream)) + return CURL_WRITEFUNC_ERROR; + } rc = fwrite(buffer, sz, nmemb, outs->stream); + } if(bytes == rc) /* we added this amount of data to the output */ diff --git a/deps/curl/src/tool_cfgable.c b/deps/curl/src/tool_cfgable.c index 3259bc7a..d7ee7b1b 100644 --- a/deps/curl/src/tool_cfgable.c +++ b/deps/curl/src/tool_cfgable.c @@ -110,10 +110,14 @@ static void free_config_fields(struct OperationConfig *config) config->url_get = NULL; config->url_out = NULL; +#ifndef CURL_DISABLE_IPFS Curl_safefree(config->ipfs_gateway); +#endif /* !CURL_DISABLE_IPFS */ Curl_safefree(config->doh_url); Curl_safefree(config->cipher_list); Curl_safefree(config->proxy_cipher_list); + Curl_safefree(config->cipher13_list); + Curl_safefree(config->proxy_cipher13_list); Curl_safefree(config->cert); Curl_safefree(config->proxy_cert); Curl_safefree(config->cert_type); @@ -169,13 +173,14 @@ static void free_config_fields(struct OperationConfig *config) Curl_safefree(config->preproxy); Curl_safefree(config->proxy_service_name); Curl_safefree(config->service_name); - Curl_safefree(config->ftp_account); Curl_safefree(config->ftp_alternative_to_user); - Curl_safefree(config->aws_sigv4); Curl_safefree(config->proto_str); Curl_safefree(config->proto_redir_str); + Curl_safefree(config->ech); + Curl_safefree(config->ech_config); + Curl_safefree(config->ech_public); } void config_free(struct OperationConfig *config) diff --git a/deps/curl/src/tool_cfgable.h b/deps/curl/src/tool_cfgable.h index dfa74d81..46f47670 100644 --- a/deps/curl/src/tool_cfgable.h +++ b/deps/curl/src/tool_cfgable.h @@ -50,8 +50,8 @@ struct OperationConfig { struct curl_slist *cookies; /* cookies to serialize into a single line */ char *cookiejar; /* write to this file */ struct curl_slist *cookiefiles; /* file(s) to load cookies from */ - char *altsvc; /* alt-svc cache file name */ - char *hsts; /* HSTS cache file name */ + char *altsvc; /* alt-svc cache filename */ + char *hsts; /* HSTS cache filename */ bool cookiesession; /* new session? */ bool encoding; /* Accept-Encoding please */ bool tr_encoding; /* Transfer-Encoding please */ @@ -85,6 +85,8 @@ struct OperationConfig { char *range; long low_speed_limit; long low_speed_time; + long ip_tos; /* IP Type of Service */ + long vlan_priority; /* VLAN priority */ char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */ char *dns_interface; /* interface name */ char *dns_ipv4_addr; /* dot notation */ @@ -109,12 +111,12 @@ struct OperationConfig { bool sasl_ir; /* Enable/disable SASL initial response */ bool proxytunnel; bool ftp_append; /* APPE on ftp */ - bool use_ascii; /* select ascii or text transfer */ + bool use_ascii; /* select ASCII or text transfer */ bool autoreferer; /* automatically set referer */ bool failonerror; /* fail on (HTTP) errors */ bool failwithbody; /* fail on (HTTP) errors but still store body */ bool show_headers; /* show headers to data output */ - bool no_body; /* don't get the body */ + bool no_body; /* do not get the body */ bool dirlistonly; /* only get the FTP dir list */ bool followlocation; /* follow http redirects */ bool unrestricted_auth; /* Continue to send authentication (user+password) @@ -128,7 +130,9 @@ struct OperationConfig { struct getout *url_get; /* point to the node to fill in URL */ struct getout *url_out; /* point to the node to fill in outfile */ struct getout *url_ul; /* point to the node to fill in upload */ +#ifndef CURL_DISABLE_IPFS char *ipfs_gateway; +#endif /* !CURL_DISABLE_IPFS */ char *doh_url; char *cipher_list; char *proxy_cipher_list; @@ -247,7 +251,8 @@ struct OperationConfig { bool post302; bool post303; bool nokeepalive; /* for keepalive needs */ - long alivetime; + long alivetime; /* keepalive-time */ + long alivecnt; /* keepalive-cnt */ bool content_disposition; /* use Content-disposition filename */ int default_node_flags; /* default flags to search for each 'node', which @@ -256,6 +261,7 @@ struct OperationConfig { bool xattr; /* store metadata in extended attributes */ long gssapi_delegation; bool ssl_allow_beast; /* allow this SSL vulnerability */ + bool ssl_allow_earlydata; /* allow use of TLSv1.3 early data */ bool proxy_ssl_allow_beast; /* allow this SSL vulnerability for proxy */ bool ssl_no_revoke; /* disable SSL certificate revocation checks */ bool ssl_revoke_best_effort; /* ignore SSL revocation offline/missing @@ -292,19 +298,25 @@ struct OperationConfig { CLOBBER_NEVER, /* If the file exists, always fail */ CLOBBER_ALWAYS /* If the file exists, always overwrite it */ } file_clobber_mode; + bool mptcp; /* enable MPTCP support */ struct GlobalConfig *global; struct OperationConfig *prev; struct OperationConfig *next; /* Always last in the struct */ struct State state; /* for create_transfer() */ bool rm_partial; /* on error, remove partially written output files */ + bool skip_existing; + char *ech; /* Config set by --ech keywords */ + char *ech_config; /* Config set by "--ech esl:" option */ + char *ech_public; /* Config set by "--ech pn:" option */ }; struct GlobalConfig { bool showerror; /* show errors when silent */ - bool silent; /* don't show messages, --silent given */ - bool noprogress; /* don't show progress bar */ + bool silent; /* do not show messages, --silent given */ + bool noprogress; /* do not show progress bar */ bool isatty; /* Updated internally if output is a tty */ + unsigned char verbosity; /* How verbose we should be */ char *trace_dump; /* file to dump the network trace to */ FILE *trace_stream; bool trace_fopened; @@ -312,12 +324,12 @@ struct GlobalConfig { bool tracetime; /* include timestamp? */ bool traceids; /* include xfer-/conn-id? */ int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */ - char *libcurl; /* Output libcurl code to this file name */ + char *libcurl; /* Output libcurl code to this filename */ bool fail_early; /* exit on first transfer error */ bool styled_output; /* enable fancy output style detection */ long ms_per_transfer; /* start next transfer after (at least) this many milliseconds */ -#ifdef CURLDEBUG +#ifdef DEBUGBUILD bool test_event_based; #endif bool parallel; diff --git a/deps/curl/src/tool_dirhie.c b/deps/curl/src/tool_dirhie.c index 1cadbd0b..772664c5 100644 --- a/deps/curl/src/tool_dirhie.c +++ b/deps/curl/src/tool_dirhie.c @@ -29,8 +29,6 @@ # include #endif -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_dirhie.h" @@ -50,7 +48,7 @@ static void show_dir_errno(struct GlobalConfig *global, const char *name) switch(errno) { #ifdef EACCES case EACCES: - errorf(global, "You don't have permission to create %s", name); + errorf(global, "You do not have permission to create %s", name); break; #endif #ifdef ENAMETOOLONG @@ -117,7 +115,7 @@ CURLcode create_dir_hierarchy(const char *outfile, struct GlobalConfig *global) } dirbuildup[0] = '\0'; - /* Allow strtok() here since this isn't used threaded */ + /* Allow strtok() here since this is not used threaded */ /* !checksrc! disable BANNEDFUNC 2 */ tempdir = strtok(outdup, PATH_DELIMITERS); @@ -137,13 +135,13 @@ CURLcode create_dir_hierarchy(const char *outfile, struct GlobalConfig *global) It may seem as though that would harmlessly fail but it could be a corner case if X: did not exist, since we would be creating it erroneously. - eg if outfile is X:\foo\bar\filename then don't mkdir X: + eg if outfile is X:\foo\bar\filename then do not mkdir X: This logic takes into account unsupported drives !:, 1:, etc. */ char *p = strchr(tempdir, ':'); if(p && !p[1]) skip = true; #endif - /* the output string doesn't start with a separator */ + /* the output string does not start with a separator */ strcpy(dirbuildup, tempdir); } else diff --git a/deps/curl/src/tool_doswin.c b/deps/curl/src/tool_doswin.c index db2b8b78..70b26311 100644 --- a/deps/curl/src/tool_doswin.c +++ b/deps/curl/src/tool_doswin.c @@ -56,24 +56,23 @@ #endif #ifdef _WIN32 -# define _use_lfn(f) (1) /* long file names always available */ +# define _use_lfn(f) (1) /* long filenames always available */ #elif !defined(__DJGPP__) || (__DJGPP__ < 2) /* DJGPP 2.0 has _use_lfn() */ -# define _use_lfn(f) (0) /* long file names never available */ +# define _use_lfn(f) (0) /* long filenames never available */ #elif defined(__DJGPP__) # include /* _use_lfn(f) prototype */ #endif -#ifndef UNITTESTS +#ifdef MSDOS +/* only used by msdosify() */ static SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos); -#ifdef MSDOS static SANITIZEcode msdosify(char **const sanitized, const char *file_name, int flags); #endif -static SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized, - const char *file_name, - int flags); -#endif /* !UNITTESTS (static declarations used if no unit tests) */ +static SANITIZEcode rename_if_reserved_dos(char **const sanitized, + const char *file_name, + int flags); /* @@ -91,21 +90,12 @@ https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx Flags ----- -SANITIZE_ALLOW_COLONS: Allow colons. -Without this flag colons are sanitized. - SANITIZE_ALLOW_PATH: Allow path separators and colons. Without this flag path separators and colons are sanitized. SANITIZE_ALLOW_RESERVED: Allow reserved device names. -Without this flag a reserved device name is renamed (COM1 => _COM1) unless it's -in a UNC prefixed path. - -SANITIZE_ALLOW_TRUNCATE: Allow truncating a long filename. -Without this flag if the sanitized filename or path will be too long an error -occurs. With this flag the filename --and not any other parts of the path-- may -be truncated to at least a single character. A filename followed by an -alternate data stream (ADS) cannot be truncated in any case. +Without this flag a reserved device name is renamed (COM1 => _COM1) unless it +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. @@ -126,7 +116,7 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, if(!file_name) return SANITIZE_ERR_BAD_ARGUMENT; - if((flags & SANITIZE_ALLOW_PATH)) { + if(flags & SANITIZE_ALLOW_PATH) { #ifndef MSDOS if(file_name[0] == '\\' && file_name[1] == '\\') /* UNC prefixed path \\ (eg \\?\C:\foo) */ @@ -136,27 +126,19 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, 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 shouldn't use it. */ + /* 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; len = strlen(file_name); - if(len > max_sanitized_len) { - if(!(flags & SANITIZE_ALLOW_TRUNCATE) || - truncate_dryrun(file_name, max_sanitized_len)) - return SANITIZE_ERR_INVALID_PATH; + if(len > max_sanitized_len) + return SANITIZE_ERR_INVALID_PATH; - len = max_sanitized_len; - } - - target = malloc(len + 1); + target = strdup(file_name); if(!target) return SANITIZE_ERR_OUT_OF_MEMORY; - strncpy(target, file_name, len); - target[len] = '\0'; - #ifndef MSDOS if((flags & SANITIZE_ALLOW_PATH) && !strncmp(target, "\\\\?\\", 4)) /* Skip the literal path prefix \\?\ */ @@ -170,7 +152,7 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, const char *banned; if((1 <= *p && *p <= 31) || - (!(flags & (SANITIZE_ALLOW_COLONS|SANITIZE_ALLOW_PATH)) && *p == ':') || + (!(flags & SANITIZE_ALLOW_PATH) && *p == ':') || (!(flags & SANITIZE_ALLOW_PATH) && (*p == '/' || *p == '\\'))) { *p = '_'; continue; @@ -217,7 +199,7 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, #endif if(!(flags & SANITIZE_ALLOW_RESERVED)) { - sc = rename_if_reserved_dos_device_name(&p, target, flags); + sc = rename_if_reserved_dos(&p, target, flags); free(target); if(sc) return sc; @@ -234,10 +216,10 @@ SANITIZEcode sanitize_file_name(char **const sanitized, const char *file_name, return SANITIZE_ERR_OK; } - +#if defined(MSDOS) /* Test if truncating a path to a file will leave at least a single character in -the filename. Filenames suffixed by an alternate data stream can't be +the filename. Filenames suffixed by an alternate data stream cannot be truncated. This performs a dry run, nothing is modified. Good truncate_pos 9: C:\foo\bar => C:\foo\ba @@ -253,7 +235,7 @@ Error truncate_pos 7: C:\foo => (pos out of range) Bad truncate_pos 1: C:\foo\ => C * C:foo is ambiguous, C could end up being a drive or file therefore something - like C:superlongfilename can't be truncated. + like C:superlongfilename cannot be truncated. Returns SANITIZE_ERR_OK: Good -- 'path' can be truncated @@ -278,7 +260,7 @@ SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos) if(strpbrk(&path[truncate_pos - 1], "\\/:")) return SANITIZE_ERR_INVALID_PATH; - /* C:\foo can be truncated but C:\foo:ads can't */ + /* C:\foo can be truncated but C:\foo:ads cannot */ if(truncate_pos > 1) { const char *p = &path[truncate_pos - 1]; do { @@ -297,11 +279,11 @@ SANITIZEcode truncate_dryrun(const char *path, const size_t truncate_pos) */ /* -Extra sanitization MSDOS for file_name. +Extra sanitization MS-DOS for file_name. This is a supporting function for sanitize_file_name. -Warning: This is an MSDOS legacy function and was purposely written in a way +Warning: This is an MS-DOS legacy function and was purposely written in a way that some path information may pass through. For example drive letter names (C:, D:, etc) are allowed to pass through. For sanitizing a filename use sanitize_file_name. @@ -309,7 +291,6 @@ sanitize_file_name. Success: (SANITIZE_ERR_OK) *sanitized points to a sanitized copy of file_name. Failure: (!= SANITIZE_ERR_OK) *sanitized is NULL. */ -#if defined(MSDOS) || defined(UNITTESTS) SANITIZEcode msdosify(char **const sanitized, const char *file_name, int flags) { @@ -332,9 +313,7 @@ SANITIZEcode msdosify(char **const sanitized, const char *file_name, if(!file_name) return SANITIZE_ERR_BAD_ARGUMENT; - if(strlen(file_name) > PATH_MAX-1 && - (!(flags & SANITIZE_ALLOW_TRUNCATE) || - truncate_dryrun(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. */ @@ -346,19 +325,19 @@ SANITIZEcode msdosify(char **const sanitized, const char *file_name, /* Get past the drive letter, if any. */ if(s[0] >= 'A' && s[0] <= 'z' && s[1] == ':') { *d++ = *s++; - *d = ((flags & (SANITIZE_ALLOW_COLONS|SANITIZE_ALLOW_PATH))) ? ':' : '_'; + *d = ((flags & SANITIZE_ALLOW_PATH)) ? ':' : '_'; ++d; ++s; } for(idx = 0, dot_idx = -1; *s && d < dlimit; s++, d++) { if(memchr(illegal_aliens, *s, len)) { - if((flags & (SANITIZE_ALLOW_COLONS|SANITIZE_ALLOW_PATH)) && *s == ':') + if((flags & SANITIZE_ALLOW_PATH) && *s == ':') *d = ':'; else if((flags & SANITIZE_ALLOW_PATH) && (*s == '/' || *s == '\\')) *d = *s; - /* Dots are special: DOS doesn't allow them as the leading character, - and a file name cannot have more than a single dot. We leave the + /* Dots are special: DOS does not allow them as the leading character, + and a filename cannot have more than a single dot. We leave the first non-leading dot alone, unless it comes too close to the beginning of the name: we want sh.lex.c to become sh_lex.c, not sh.lex-c. */ @@ -434,22 +413,21 @@ SANITIZEcode msdosify(char **const sanitized, const char *file_name, /* dos_name is truncated, check that truncation requirements are met, specifically truncating a filename suffixed by an alternate data stream or truncating the entire filename is not allowed. */ - if(!(flags & SANITIZE_ALLOW_TRUNCATE) || strpbrk(s, "\\/:") || - truncate_dryrun(dos_name, d - dos_name)) + if(strpbrk(s, "\\/:") || truncate_dryrun(dos_name, d - dos_name)) return SANITIZE_ERR_INVALID_PATH; } *sanitized = strdup(dos_name); return (*sanitized ? SANITIZE_ERR_OK : SANITIZE_ERR_OUT_OF_MEMORY); } -#endif /* MSDOS || UNITTESTS */ +#endif /* MSDOS */ /* -Rename file_name if it's a reserved dos device name. +Rename file_name if it is a reserved dos device name. This is a supporting function for sanitize_file_name. -Warning: This is an MSDOS legacy function and was purposely written in a way +Warning: This is an MS-DOS legacy function and was purposely written in a way that some path information may pass through. For example drive letter names (C:, D:, etc) are allowed to pass through. For sanitizing a filename use sanitize_file_name. @@ -457,47 +435,42 @@ sanitize_file_name. Success: (SANITIZE_ERR_OK) *sanitized points to a sanitized copy of file_name. Failure: (!= SANITIZE_ERR_OK) *sanitized is NULL. */ -SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized, - const char *file_name, - int flags) +static SANITIZEcode rename_if_reserved_dos(char **const sanitized, + const char *file_name, + int flags) { - /* We could have a file whose name is a device on MS-DOS. Trying to - * retrieve such a file would fail at best and wedge us at worst. We need + /* We could have a file whose name is a device on MS-DOS. Trying to + * retrieve such a file would fail at best and wedge us at worst. We need * to rename such files. */ char *p, *base; char fname[PATH_MAX]; #ifdef MSDOS struct_stat st_buf; #endif + size_t len; - if(!sanitized) + if(!sanitized || !file_name) return SANITIZE_ERR_BAD_ARGUMENT; *sanitized = NULL; - - if(!file_name) - return SANITIZE_ERR_BAD_ARGUMENT; + len = strlen(file_name); /* Ignore UNC prefixed paths, they are allowed to contain a reserved name. */ #ifndef MSDOS if((flags & SANITIZE_ALLOW_PATH) && file_name[0] == '\\' && file_name[1] == '\\') { - size_t len = strlen(file_name); - *sanitized = malloc(len + 1); + *sanitized = strdup(file_name); if(!*sanitized) return SANITIZE_ERR_OUT_OF_MEMORY; - strncpy(*sanitized, file_name, len + 1); return SANITIZE_ERR_OK; } #endif - if(strlen(file_name) > PATH_MAX-1 && - (!(flags & SANITIZE_ALLOW_TRUNCATE) || - truncate_dryrun(file_name, PATH_MAX-1))) + if(len > PATH_MAX-1) return SANITIZE_ERR_INVALID_PATH; - strncpy(fname, file_name, PATH_MAX-1); - fname[PATH_MAX-1] = '\0'; + memcpy(fname, file_name, len); + fname[len] = '\0'; base = basename(fname); /* Rename reserved device names that are known to be accessible without \\.\ @@ -529,7 +502,7 @@ SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized, continue; } else if(p[x] == ':') { - if(!(flags & (SANITIZE_ALLOW_COLONS|SANITIZE_ALLOW_PATH))) { + if(!(flags & SANITIZE_ALLOW_PATH)) { p[x] = '_'; continue; } @@ -542,12 +515,8 @@ SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized, p_len = strlen(p); /* Prepend a '_' */ - if(strlen(fname) == PATH_MAX-1) { - --p_len; - if(!(flags & SANITIZE_ALLOW_TRUNCATE) || truncate_dryrun(p, p_len)) - return SANITIZE_ERR_INVALID_PATH; - p[p_len] = '\0'; - } + if(strlen(fname) == PATH_MAX-1) + return SANITIZE_ERR_INVALID_PATH; memmove(p + 1, p, p_len + 1); p[0] = '_'; ++p_len; @@ -558,22 +527,19 @@ SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized, } /* This is the legacy portion from rename_if_dos_device_name that checks for - reserved device names. It only works on MSDOS. On Windows XP the stat + reserved device names. It only works on MS-DOS. On Windows XP the stat check errors with EINVAL if the device name is reserved. On Windows - Vista/7/8 it sets mode S_IFREG (regular file or device). According to MSDN - stat doc the latter behavior is correct, but that doesn't help us identify - whether it's a reserved device name and not a regular file name. */ + Vista/7/8 it sets mode S_IFREG (regular file or device). According to + MSDN stat doc the latter behavior is correct, but that does not help us + identify whether it is a reserved device name and not a regular + filename. */ #ifdef MSDOS if(base && ((stat(base, &st_buf)) == 0) && (S_ISCHR(st_buf.st_mode))) { /* Prepend a '_' */ size_t blen = strlen(base); if(blen) { - if(strlen(fname) == PATH_MAX-1) { - --blen; - if(!(flags & SANITIZE_ALLOW_TRUNCATE) || truncate_dryrun(base, blen)) - return SANITIZE_ERR_INVALID_PATH; - base[blen] = '\0'; - } + if(strlen(fname) >= PATH_MAX-1) + return SANITIZE_ERR_INVALID_PATH; memmove(base + 1, base, blen + 1); base[0] = '_'; } @@ -599,56 +565,51 @@ char **__crt0_glob_function(char *arg) #ifdef _WIN32 -/* +#if !defined(CURL_WINDOWS_UWP) && \ + !defined(CURL_DISABLE_CA_SEARCH) && !defined(CURL_CA_SEARCH_SAFE) +/* Search and set the CA cert file for Windows. + * + * Do not call this function if Schannel is the selected SSL backend. We allow + * setting CA location for Schannel only when explicitly specified by the user + * via CURLOPT_CAINFO / --cacert. + * * Function to find CACert bundle on a Win32 platform using SearchPath. * (SearchPath is already declared via inclusions done in setup header file) - * (Use the ASCII version instead of the unicode one!) + * (Use the ASCII version instead of the Unicode one!) * The order of the directories it searches is: * 1. application's directory * 2. current working directory - * 3. Windows System directory (e.g. C:\windows\system32) - * 4. Windows Directory (e.g. C:\windows) + * 3. Windows System directory (e.g. C:\Windows\System32) + * 4. Windows Directory (e.g. C:\Windows) * 5. all directories along %PATH% * * For WinXP and later search order actually depends on registry value: * HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode */ - CURLcode FindWin32CACert(struct OperationConfig *config, - curl_sslbackend backend, const TCHAR *bundle_file) { CURLcode result = CURLE_OK; + DWORD res_len; + TCHAR buf[PATH_MAX]; + TCHAR *ptr = NULL; - /* Search and set cert file only if libcurl supports SSL. - * - * 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. - */ - if(feature_ssl && backend != CURLSSLBACKEND_SCHANNEL) { + buf[0] = TEXT('\0'); - DWORD res_len; - TCHAR buf[PATH_MAX]; - TCHAR *ptr = NULL; - - buf[0] = TEXT('\0'); - - res_len = SearchPath(NULL, bundle_file, NULL, PATH_MAX, buf, &ptr); - if(res_len > 0) { - char *mstr = curlx_convert_tchar_to_UTF8(buf); - Curl_safefree(config->cacert); - if(mstr) - config->cacert = strdup(mstr); - curlx_unicodefree(mstr); - if(!config->cacert) - result = CURLE_OUT_OF_MEMORY; - } + res_len = SearchPath(NULL, bundle_file, NULL, PATH_MAX, buf, &ptr); + if(res_len > 0) { + char *mstr = curlx_convert_tchar_to_UTF8(buf); + Curl_safefree(config->cacert); + if(mstr) + config->cacert = strdup(mstr); + curlx_unicodefree(mstr); + if(!config->cacert) + result = CURLE_OUT_OF_MEMORY; } return result; } - +#endif /* Get a list of all loaded modules with full paths. * Returns slist on success or NULL on error. @@ -677,7 +638,7 @@ struct curl_slist *GetLoadedModulePaths(void) #ifdef UNICODE /* sizeof(mod.szExePath) is the max total bytes of wchars. the max total - bytes of multibyte chars won't be more than twice that. */ + bytes of multibyte chars will not be more than twice that. */ char buffer[sizeof(mod.szExePath) * 2]; if(!WideCharToMultiByte(CP_ACP, 0, mod.szExePath, -1, buffer, sizeof(buffer), NULL, NULL)) @@ -703,6 +664,9 @@ cleanup: return slist; } +bool tool_term_has_bold; + +#ifndef CURL_WINDOWS_UWP /* The terminal settings to restore on exit */ static struct TerminalSettings { HANDLE hStdOut; @@ -714,8 +678,6 @@ static struct TerminalSettings { #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif -bool tool_term_has_bold; - static void restore_terminal(void) { if(InterlockedExchange(&TerminalSettings.valid, (LONG)FALSE)) @@ -770,6 +732,7 @@ static void init_terminal(void) } } } +#endif LARGE_INTEGER tool_freq; bool tool_isVistaOrGreater; @@ -786,7 +749,9 @@ CURLcode win32_init(void) QueryPerformanceFrequency(&tool_freq); +#ifndef CURL_WINDOWS_UWP init_terminal(); +#endif return CURLE_OK; } diff --git a/deps/curl/src/tool_doswin.h b/deps/curl/src/tool_doswin.h index e07d89d9..25df78ee 100644 --- a/deps/curl/src/tool_doswin.h +++ b/deps/curl/src/tool_doswin.h @@ -27,10 +27,8 @@ #if defined(_WIN32) || defined(MSDOS) -#define SANITIZE_ALLOW_COLONS (1<<0) /* Allow colons */ #define SANITIZE_ALLOW_PATH (1<<1) /* Allow path separators and colons */ #define SANITIZE_ALLOW_RESERVED (1<<2) /* Allow reserved device names */ -#define SANITIZE_ALLOW_TRUNCATE (1<<3) /* Allow truncating a long filename */ typedef enum { SANITIZE_ERR_OK = 0, /* 0 - OK */ @@ -59,9 +57,11 @@ char **__crt0_glob_function(char *arg); #ifdef _WIN32 +#if !defined(CURL_WINDOWS_UWP) && \ + !defined(CURL_DISABLE_CA_SEARCH) && !defined(CURL_CA_SEARCH_SAFE) CURLcode FindWin32CACert(struct OperationConfig *config, - curl_sslbackend backend, const TCHAR *bundle_file); +#endif struct curl_slist *GetLoadedModulePaths(void); CURLcode win32_init(void); diff --git a/deps/curl/src/tool_easysrc.c b/deps/curl/src/tool_easysrc.c index 6ef2be72..a623f196 100644 --- a/deps/curl/src/tool_easysrc.c +++ b/deps/curl/src/tool_easysrc.c @@ -27,8 +27,6 @@ #ifndef CURL_DISABLE_LIBCURL_OPTION -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -113,7 +111,7 @@ CURLcode easysrc_addf(struct slist_wc **plist, const char *fmt, ...) char *bufp; va_list ap; va_start(ap, fmt); - bufp = curlx_mvaprintf(fmt, ap); + bufp = vaprintf(fmt, ap); va_end(ap); if(!bufp) { ret = CURLE_OUT_OF_MEMORY; diff --git a/deps/curl/src/tool_filetime.c b/deps/curl/src/tool_filetime.c index 13113886..05125ded 100644 --- a/deps/curl/src/tool_filetime.c +++ b/deps/curl/src/tool_filetime.c @@ -38,10 +38,10 @@ int getfiletime(const char *filename, struct GlobalConfig *global, { int rc = 1; -/* Windows stat() may attempt to adjust the unix GMT file time by a daylight - saving time offset and since it's GMT that is bad behavior. When we have +/* Windows stat() may attempt to adjust the Unix GMT file time by a daylight + saving time offset and since it is GMT that is bad behavior. When we have access to a 64-bit type we can bypass stat and get the times directly. */ -#if defined(_WIN32) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) HANDLE hfile; TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename); @@ -92,14 +92,14 @@ void setfiletime(curl_off_t filetime, const char *filename, struct GlobalConfig *global) { if(filetime >= 0) { -/* Windows utime() may attempt to adjust the unix GMT file time by a daylight - saving time offset and since it's GMT that is bad behavior. When we have +/* Windows utime() may attempt to adjust the Unix GMT file time by a daylight + saving time offset and since it is GMT that is bad behavior. When we have access to a 64-bit type we can bypass utime and set the times directly. */ -#if defined(_WIN32) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) HANDLE hfile; TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename); - /* 910670515199 is the maximum unix filetime that can be used as a + /* 910670515199 is the maximum Unix filetime that can be used as a Windows FILETIME without overflow: 30827-12-31T23:59:59. */ if(filetime > CURL_OFF_T_C(910670515199)) { warnf(global, "Failed to set filetime %" CURL_FORMAT_CURL_OFF_T diff --git a/deps/curl/src/tool_findfile.c b/deps/curl/src/tool_findfile.c index a1544a56..672fc7b9 100644 --- a/deps/curl/src/tool_findfile.c +++ b/deps/curl/src/tool_findfile.c @@ -35,7 +35,7 @@ #include #endif -#include +#include #include "tool_findfile.h" @@ -51,7 +51,7 @@ struct finder { in the findfile() function */ static const struct finder conf_list[] = { { "CURL_HOME", NULL, FALSE }, - { "XDG_CONFIG_HOME", NULL, FALSE }, /* index == 1, used in the code */ + { "XDG_CONFIG_HOME", NULL, TRUE }, { "HOME", NULL, FALSE }, #ifdef _WIN32 { "USERPROFILE", NULL, FALSE }, @@ -72,9 +72,9 @@ static char *checkhome(const char *home, const char *fname, bool dotscore) for(i = 0; i < (dotscore ? 2 : 1); i++) { char *c; if(dotscore) - c = curl_maprintf("%s" DIR_CHAR "%c%s", home, pref[i], &fname[1]); + c = aprintf("%s" DIR_CHAR "%c%s", home, pref[i], &fname[1]); else - c = curl_maprintf("%s" DIR_CHAR "%s", home, fname); + c = aprintf("%s" DIR_CHAR "%s", home, fname); if(c) { int fd = open(c, O_RDONLY); if(fd >= 0) { @@ -97,12 +97,11 @@ static char *checkhome(const char *home, const char *fname, bool dotscore) * * 1. Iterate over the environment variables in order, and if set, check for * the given file to be accessed there, then it is a match. - * 2. Non-windows: try getpwuid + * 2. Non-Windows: try getpwuid */ char *findfile(const char *fname, int dotscore) { int i; - bool xdg = FALSE; DEBUGASSERT(fname && fname[0]); DEBUGASSERT((dotscore != 1) || (fname[0] == '.')); @@ -114,21 +113,19 @@ char *findfile(const char *fname, int dotscore) if(home) { char *path; const char *filename = fname; - if(i == 1 /* XDG_CONFIG_HOME */) - xdg = TRUE; if(!home[0]) { curl_free(home); continue; } if(conf_list[i].append) { - char *c = curl_maprintf("%s%s", home, conf_list[i].append); + char *c = aprintf("%s%s", home, conf_list[i].append); curl_free(home); if(!c) return NULL; home = c; } if(conf_list[i].withoutdot) { - if(!dotscore || xdg) { + if(!dotscore) { /* this is not looking for .curlrc, or the XDG_CONFIG_HOME was defined so we skip the extended check */ curl_free(home); diff --git a/deps/curl/src/tool_formparse.c b/deps/curl/src/tool_formparse.c index 875ce78d..15918d3e 100644 --- a/deps/curl/src/tool_formparse.c +++ b/deps/curl/src/tool_formparse.c @@ -25,8 +25,6 @@ #include "strcase.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -637,7 +635,7 @@ static int get_param_part(struct OperationConfig *config, char endchar, *pfilename = filename; else if(filename) warnf(config->global, - "Field file name not allowed here: %s", filename); + "Field filename not allowed here: %s", filename); if(pencoder) *pencoder = encoder; @@ -693,7 +691,7 @@ static int get_param_part(struct OperationConfig *config, char endchar, * 'name=foo;headers=@headerfile' or why not * 'name=@filemame;headers=@headerfile' * - * To upload a file, but to fake the file name that will be included in the + * To upload a file, but to fake the filename that will be included in the * formpost, do like this: * * 'name=@filename;filename=/dev/null' or quote the faked filename like: @@ -720,7 +718,7 @@ int formparse(struct OperationConfig *config, struct tool_mime **mimecurrent, bool literal_value) { - /* input MUST be a string in the format 'name=contents' and we'll + /* input MUST be a string in the format 'name=contents' and we will build a linked list with the info */ char *name = NULL; char *contents = NULL; @@ -779,7 +777,7 @@ int formparse(struct OperationConfig *config, } else if('@' == contp[0] && !literal_value) { - /* we use the @-letter to indicate file name(s) */ + /* we use the @-letter to indicate filename(s) */ struct tool_mime *subparts = NULL; @@ -831,7 +829,7 @@ int formparse(struct OperationConfig *config, SET_TOOL_MIME_PTR(part, encoder); /* *contp could be '\0', so we just check with the delimiter */ - } while(sep); /* loop if there's another file name */ + } while(sep); /* loop if there is another filename */ part = (*mimecurrent)->subparts; /* Set name on group. */ } else { diff --git a/deps/curl/src/tool_getparam.c b/deps/curl/src/tool_getparam.c index 23fe3106..1231b3bd 100644 --- a/deps/curl/src/tool_getparam.c +++ b/deps/curl/src/tool_getparam.c @@ -25,8 +25,6 @@ #include "strcase.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_binmode.h" @@ -71,299 +69,16 @@ static ParameterError getstr(char **str, const char *val, bool allowblank) return PARAM_OK; } -/* one enum for every command line option. The name is the verbatim long - option name, but in uppercase with periods and minuses replaced with - underscores using a "C_" prefix. */ -typedef enum { - C_ABSTRACT_UNIX_SOCKET, - C_ALPN, - C_ALT_SVC, - C_ANYAUTH, - C_APPEND, - C_AWS_SIGV4, - C_BASIC, - C_BUFFER, - C_CA_NATIVE, - C_CACERT, - C_CAPATH, - C_CERT, - C_CERT_STATUS, - C_CERT_TYPE, - C_CIPHERS, - C_CLOBBER, - C_COMPRESSED, - C_COMPRESSED_SSH, - C_CONFIG, - C_CONNECT_TIMEOUT, - C_CONNECT_TO, - C_CONTINUE_AT, - C_COOKIE, - C_COOKIE_JAR, - C_CREATE_DIRS, - C_CREATE_FILE_MODE, - C_CRLF, - C_CRLFILE, - C_CURVES, - C_DATA, - C_DATA_ASCII, - C_DATA_BINARY, - C_DATA_RAW, - C_DATA_URLENCODE, - C_DELEGATION, - C_DIGEST, - C_DISABLE, - C_DISABLE_EPRT, - C_DISABLE_EPSV, - C_DISALLOW_USERNAME_IN_URL, - C_DNS_INTERFACE, - C_DNS_IPV4_ADDR, - C_DNS_IPV6_ADDR, - C_DNS_SERVERS, - C_DOH_CERT_STATUS, - C_DOH_INSECURE, - C_DOH_URL, - C_DUMP_HEADER, - C_EGD_FILE, - C_ENGINE, - C_EPRT, - C_EPSV, - C_ETAG_COMPARE, - C_ETAG_SAVE, - C_EXPECT100_TIMEOUT, - C_FAIL, - C_FAIL_EARLY, - C_FAIL_WITH_BODY, - C_FALSE_START, - C_FORM, - C_FORM_ESCAPE, - C_FORM_STRING, - C_FTP_ACCOUNT, - C_FTP_ALTERNATIVE_TO_USER, - C_FTP_CREATE_DIRS, - C_FTP_METHOD, - C_FTP_PASV, - C_FTP_PORT, - C_FTP_PRET, - C_FTP_SKIP_PASV_IP, - C_FTP_SSL, - C_FTP_SSL_CCC, - C_FTP_SSL_CCC_MODE, - C_FTP_SSL_CONTROL, - C_FTP_SSL_REQD, - C_GET, - C_GLOBOFF, - C_HAPPY_EYEBALLS_TIMEOUT_MS, - C_HAPROXY_CLIENTIP, - C_HAPROXY_PROTOCOL, - C_HEAD, - C_HEADER, - C_HELP, - C_HOSTPUBMD5, - C_HOSTPUBSHA256, - C_HSTS, - C_HTTP0_9, - C_HTTP1_0, - C_HTTP1_1, - C_HTTP2, - C_HTTP2_PRIOR_KNOWLEDGE, - C_HTTP3, - C_HTTP3_ONLY, - C_IGNORE_CONTENT_LENGTH, - C_INCLUDE, - C_INSECURE, - C_INTERFACE, - C_IPFS_GATEWAY, - C_IPV4, - C_IPV6, - C_JSON, - C_JUNK_SESSION_COOKIES, - C_KEEPALIVE, - C_KEEPALIVE_TIME, - C_KEY, - C_KEY_TYPE, - C_KRB, - C_KRB4, - C_LIBCURL, - C_LIMIT_RATE, - C_LIST_ONLY, - C_LOCAL_PORT, - C_LOCATION, - C_LOCATION_TRUSTED, - C_LOGIN_OPTIONS, - C_MAIL_AUTH, - C_MAIL_FROM, - C_MAIL_RCPT, - C_MAIL_RCPT_ALLOWFAILS, - C_MANUAL, - C_MAX_FILESIZE, - C_MAX_REDIRS, - C_MAX_TIME, - C_METALINK, - C_NEGOTIATE, - C_NETRC, - C_NETRC_FILE, - C_NETRC_OPTIONAL, - C_NEXT, - C_NOPROXY, - C_NPN, - C_NTLM, - C_NTLM_WB, - C_OAUTH2_BEARER, - C_OUTPUT, - C_OUTPUT_DIR, - C_PARALLEL, - C_PARALLEL_IMMEDIATE, - C_PARALLEL_MAX, - C_PASS, - C_PATH_AS_IS, - C_PINNEDPUBKEY, - C_POST301, - C_POST302, - C_POST303, - C_PREPROXY, - C_PROGRESS_BAR, - C_PROGRESS_METER, - C_PROTO, - C_PROTO_DEFAULT, - C_PROTO_REDIR, - C_PROXY, - C_PROXY_ANYAUTH, - C_PROXY_BASIC, - C_PROXY_CA_NATIVE, - C_PROXY_CACERT, - C_PROXY_CAPATH, - C_PROXY_CERT, - C_PROXY_CERT_TYPE, - C_PROXY_CIPHERS, - C_PROXY_CRLFILE, - C_PROXY_DIGEST, - C_PROXY_HEADER, - C_PROXY_HTTP2, - C_PROXY_INSECURE, - C_PROXY_KEY, - C_PROXY_KEY_TYPE, - C_PROXY_NEGOTIATE, - C_PROXY_NTLM, - C_PROXY_PASS, - C_PROXY_PINNEDPUBKEY, - C_PROXY_SERVICE_NAME, - C_PROXY_SSL_ALLOW_BEAST, - C_PROXY_SSL_AUTO_CLIENT_CERT, - C_PROXY_TLS13_CIPHERS, - C_PROXY_TLSAUTHTYPE, - C_PROXY_TLSPASSWORD, - C_PROXY_TLSUSER, - C_PROXY_TLSV1, - C_PROXY_USER, - C_PROXY1_0, - C_PROXYTUNNEL, - C_PUBKEY, - C_QUOTE, - C_RANDOM_FILE, - C_RANGE, - C_RATE, - C_RAW, - C_REFERER, - C_REMOTE_HEADER_NAME, - C_REMOTE_NAME, - C_REMOTE_NAME_ALL, - C_REMOTE_TIME, - C_REMOVE_ON_ERROR, - C_REQUEST, - C_REQUEST_TARGET, - C_RESOLVE, - C_RETRY, - C_RETRY_ALL_ERRORS, - C_RETRY_CONNREFUSED, - C_RETRY_DELAY, - C_RETRY_MAX_TIME, - C_SASL_AUTHZID, - C_SASL_IR, - C_SERVICE_NAME, - C_SESSIONID, - C_SHOW_ERROR, - C_SILENT, - C_SOCKS4, - C_SOCKS4A, - C_SOCKS5, - C_SOCKS5_BASIC, - C_SOCKS5_GSSAPI, - C_SOCKS5_GSSAPI_NEC, - C_SOCKS5_GSSAPI_SERVICE, - C_SOCKS5_HOSTNAME, - C_SPEED_LIMIT, - C_SPEED_TIME, - C_SSL, - C_SSL_ALLOW_BEAST, - C_SSL_AUTO_CLIENT_CERT, - C_SSL_NO_REVOKE, - C_SSL_REQD, - C_SSL_REVOKE_BEST_EFFORT, - C_SSLV2, - C_SSLV3, - C_STDERR, - C_STYLED_OUTPUT, - C_SUPPRESS_CONNECT_HEADERS, - C_TCP_FASTOPEN, - C_TCP_NODELAY, - C_TELNET_OPTION, - C_TEST_EVENT, - C_TFTP_BLKSIZE, - C_TFTP_NO_OPTIONS, - C_TIME_COND, - C_TLS_MAX, - C_TLS13_CIPHERS, - C_TLSAUTHTYPE, - C_TLSPASSWORD, - C_TLSUSER, - C_TLSV1, - C_TLSV1_0, - C_TLSV1_1, - C_TLSV1_2, - C_TLSV1_3, - C_TR_ENCODING, - C_TRACE, - C_TRACE_ASCII, - C_TRACE_CONFIG, - C_TRACE_IDS, - C_TRACE_TIME, - C_UNIX_SOCKET, - C_UPLOAD_FILE, - C_URL, - C_URL_QUERY, - C_USE_ASCII, - C_USER, - C_USER_AGENT, - C_VARIABLE, - C_VERBOSE, - C_VERSION, - C_WDEBUG, - C_WRITE_OUT, - C_XATTR -} cmdline_t; - -struct LongShort { - const char *lname; /* long name option */ - enum { - ARG_NONE, /* stand-alone but not a boolean */ - ARG_BOOL, /* accepts a --no-[name] prefix */ - ARG_STRG, /* requires an argument */ - ARG_FILE /* requires an argument, usually a file name */ - } desc; - char letter; /* short name option or ' ' */ - cmdline_t cmd; -}; - /* this array MUST be alphasorted based on the 'lname' */ static const struct LongShort aliases[]= { {"abstract-unix-socket", ARG_FILE, ' ', C_ABSTRACT_UNIX_SOCKET}, - {"alpn", ARG_BOOL, ' ', C_ALPN}, + {"alpn", ARG_BOOL|ARG_NO, ' ', C_ALPN}, {"alt-svc", ARG_STRG, ' ', C_ALT_SVC}, {"anyauth", ARG_BOOL, ' ', C_ANYAUTH}, {"append", ARG_BOOL, 'a', C_APPEND}, {"aws-sigv4", ARG_STRG, ' ', C_AWS_SIGV4}, {"basic", ARG_BOOL, ' ', C_BASIC}, - {"buffer", ARG_BOOL, 'N', C_BUFFER}, + {"buffer", ARG_BOOL|ARG_NO, 'N', C_BUFFER}, {"ca-native", ARG_BOOL, ' ', C_CA_NATIVE}, {"cacert", ARG_FILE, ' ', C_CACERT}, {"capath", ARG_FILE, ' ', C_CAPATH}, @@ -371,7 +86,7 @@ static const struct LongShort aliases[]= { {"cert-status", ARG_BOOL, ' ', C_CERT_STATUS}, {"cert-type", ARG_STRG, ' ', C_CERT_TYPE}, {"ciphers", ARG_STRG, ' ', C_CIPHERS}, - {"clobber", ARG_BOOL, ' ', C_CLOBBER}, + {"clobber", ARG_BOOL|ARG_NO, ' ', C_CLOBBER}, {"compressed", ARG_BOOL, ' ', C_COMPRESSED}, {"compressed-ssh", ARG_BOOL, ' ', C_COMPRESSED_SSH}, {"config", ARG_FILE, 'K', C_CONFIG}, @@ -403,7 +118,9 @@ static const struct LongShort aliases[]= { {"doh-cert-status", ARG_BOOL, ' ', C_DOH_CERT_STATUS}, {"doh-insecure", ARG_BOOL, ' ', C_DOH_INSECURE}, {"doh-url" , ARG_STRG, ' ', C_DOH_URL}, + {"dump-ca-embed", ARG_NONE, ' ', C_DUMP_CA_EMBED}, {"dump-header", ARG_FILE, 'D', C_DUMP_HEADER}, + {"ech", ARG_STRG, ' ', C_ECH}, {"egd-file", ARG_STRG, ' ', C_EGD_FILE}, {"engine", ARG_STRG, ' ', C_ENGINE}, {"eprt", ARG_BOOL, ' ', C_EPRT}, @@ -450,15 +167,19 @@ static const struct LongShort aliases[]= { {"http3", ARG_NONE, ' ', C_HTTP3}, {"http3-only", ARG_NONE, ' ', C_HTTP3_ONLY}, {"ignore-content-length", ARG_BOOL, ' ', C_IGNORE_CONTENT_LENGTH}, - {"include", ARG_BOOL, 'i', C_INCLUDE}, + {"include", ARG_BOOL, ' ', C_INCLUDE}, {"insecure", ARG_BOOL, 'k', C_INSECURE}, {"interface", ARG_STRG, ' ', C_INTERFACE}, + {"ip-tos", ARG_STRG, ' ', C_IP_TOS}, +#ifndef CURL_DISABLE_IPFS {"ipfs-gateway", ARG_STRG, ' ', C_IPFS_GATEWAY}, +#endif /* !CURL_DISABLE_IPFS */ {"ipv4", ARG_NONE, '4', C_IPV4}, {"ipv6", ARG_NONE, '6', C_IPV6}, {"json", ARG_STRG, ' ', C_JSON}, {"junk-session-cookies", ARG_BOOL, 'j', C_JUNK_SESSION_COOKIES}, - {"keepalive", ARG_BOOL, ' ', C_KEEPALIVE}, + {"keepalive", ARG_BOOL|ARG_NO, ' ', C_KEEPALIVE}, + {"keepalive-cnt", ARG_STRG, ' ', C_KEEPALIVE_CNT}, {"keepalive-time", ARG_STRG, ' ', C_KEEPALIVE_TIME}, {"key", ARG_FILE, ' ', C_KEY}, {"key-type", ARG_STRG, ' ', C_KEY_TYPE}, @@ -480,13 +201,14 @@ static const struct LongShort aliases[]= { {"max-redirs", ARG_STRG, ' ', C_MAX_REDIRS}, {"max-time", ARG_STRG, 'm', C_MAX_TIME}, {"metalink", ARG_BOOL, ' ', C_METALINK}, + {"mptcp", ARG_BOOL, ' ', C_MPTCP}, {"negotiate", ARG_BOOL, ' ', C_NEGOTIATE}, {"netrc", ARG_BOOL, 'n', C_NETRC}, {"netrc-file", ARG_FILE, ' ', C_NETRC_FILE}, {"netrc-optional", ARG_BOOL, ' ', C_NETRC_OPTIONAL}, {"next", ARG_NONE, ':', C_NEXT}, {"noproxy", ARG_STRG, ' ', C_NOPROXY}, - {"npn", ARG_BOOL, ' ', C_NPN}, + {"npn", ARG_BOOL|ARG_NO, ' ', C_NPN}, {"ntlm", ARG_BOOL, ' ', C_NTLM}, {"ntlm-wb", ARG_BOOL, ' ', C_NTLM_WB}, {"oauth2-bearer", ARG_STRG, ' ', C_OAUTH2_BEARER}, @@ -503,7 +225,7 @@ static const struct LongShort aliases[]= { {"post303", ARG_BOOL, ' ', C_POST303}, {"preproxy", ARG_STRG, ' ', C_PREPROXY}, {"progress-bar", ARG_BOOL, '#', C_PROGRESS_BAR}, - {"progress-meter", ARG_BOOL, ' ', C_PROGRESS_METER}, + {"progress-meter", ARG_BOOL|ARG_NO, ' ', C_PROGRESS_METER}, {"proto", ARG_STRG, ' ', C_PROTO}, {"proto-default", ARG_STRG, ' ', C_PROTO_DEFAULT}, {"proto-redir", ARG_STRG, ' ', C_PROTO_REDIR}, @@ -561,9 +283,11 @@ static const struct LongShort aliases[]= { {"sasl-authzid", ARG_STRG, ' ', C_SASL_AUTHZID}, {"sasl-ir", ARG_BOOL, ' ', C_SASL_IR}, {"service-name", ARG_STRG, ' ', C_SERVICE_NAME}, - {"sessionid", ARG_BOOL, ' ', C_SESSIONID}, + {"sessionid", ARG_BOOL|ARG_NO, ' ', C_SESSIONID}, {"show-error", ARG_BOOL, 'S', C_SHOW_ERROR}, + {"show-headers", ARG_BOOL, 'i', C_SHOW_HEADERS}, {"silent", ARG_BOOL, 's', C_SILENT}, + {"skip-existing", ARG_BOOL, ' ', C_SKIP_EXISTING}, {"socks4", ARG_STRG, ' ', C_SOCKS4}, {"socks4a", ARG_STRG, ' ', C_SOCKS4A}, {"socks5", ARG_STRG, ' ', C_SOCKS5}, @@ -592,6 +316,7 @@ static const struct LongShort aliases[]= { {"tftp-blksize", ARG_STRG, ' ', C_TFTP_BLKSIZE}, {"tftp-no-options", ARG_BOOL, ' ', C_TFTP_NO_OPTIONS}, {"time-cond", ARG_STRG, 'z', C_TIME_COND}, + {"tls-earlydata", ARG_BOOL, ' ', C_TLS_EARLYDATA}, {"tls-max", ARG_STRG, ' ', C_TLS_MAX}, {"tls13-ciphers", ARG_STRG, ' ', C_TLS13_CIPHERS}, {"tlsauthtype", ARG_STRG, ' ', C_TLSAUTHTYPE}, @@ -618,6 +343,7 @@ static const struct LongShort aliases[]= { {"variable", ARG_STRG, ' ', C_VARIABLE}, {"verbose", ARG_BOOL, 'v', C_VERBOSE}, {"version", ARG_BOOL, 'V', C_VERSION}, + {"vlan-priority", ARG_STRG, ' ', C_VLAN_PRIORITY}, #ifdef USE_WATT32 {"wdebug", ARG_BOOL, ' ', C_WDEBUG}, #endif @@ -627,7 +353,7 @@ static const struct LongShort aliases[]= { /* Split the argument of -E to 'certname' and 'passphrase' separated by colon. * We allow ':' and '\' to be escaped by '\' so that we can use certificate - * nicknames containing ':'. See + * nicknames containing ':'. See * for details. */ #ifndef UNITTESTS static @@ -665,10 +391,10 @@ void parse_cert_parameter(const char *cert_parameter, param_place = cert_parameter; while(*param_place) { span = strcspn(param_place, ":\\"); - strncpy(certname_place, param_place, span); + memcpy(certname_place, param_place, span); param_place += span; certname_place += span; - /* we just ate all the non-special chars. now we're on either a special + /* we just ate all the non-special chars. now we are on either a special * char or the end of the string. */ switch(*param_place) { case '\0': @@ -695,11 +421,11 @@ void parse_cert_parameter(const char *cert_parameter, } break; case ':': - /* Since we live in a world of weirdness and confusion, the win32 + /* Since we live in a world of weirdness and confusion, the Windows dudes can use : when using drive letters and thus c:\file:password needs to work. In order not to break compatibility, we still use : as - separator, but we try to detect when it is used for a file name! On - windows. */ + separator, but we try to detect when it is used for a filename! On + Windows. */ #ifdef _WIN32 if((param_place == &cert_parameter[1]) && (cert_parameter[2] == '\\' || cert_parameter[2] == '/') && @@ -714,7 +440,7 @@ void parse_cert_parameter(const char *cert_parameter, } #endif /* escaped colons and Windows drive letter colons were handled - * above; if we're still here, this is a separating colon */ + * above; if we are still here, this is a separating colon */ param_place++; if(*param_place) { *passphrase = strdup(param_place); @@ -825,7 +551,7 @@ static ParameterError GetSizeParameter(struct GlobalConfig *global, static void cleanarg(argv_item_t str) { /* now that getstr has copied the contents of nextarg, wipe the next - * argument out so that the username:password isn't displayed in the + * argument out so that the username:password is not displayed in the * system process list */ if(str) { size_t len = strlen(str); @@ -836,6 +562,9 @@ static void cleanarg(argv_item_t str) #define cleanarg(x) #endif +/* the maximum size we allow the dynbuf generated string */ +#define MAX_DATAURLENCODE (500*1024*1024) + /* --data-urlencode */ static ParameterError data_urlencode(struct GlobalConfig *global, char *nextarg, @@ -843,7 +572,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global, size_t *lenp) { /* [name]=[content], we encode the content part only - * [name]@[file name] + * [name]@[filename] * * Case 2: we first load the file using that name and then encode * the content. @@ -862,13 +591,14 @@ static ParameterError data_urlencode(struct GlobalConfig *global, is_file = *p++; /* pass the separator */ } else { - /* neither @ nor =, so no name and it isn't a file */ - nlen = is_file = 0; + /* neither @ nor =, so no name and it is not a file */ + nlen = 0; + is_file = 0; p = nextarg; } if('@' == is_file) { FILE *file; - /* a '@' letter, it means that a file name or - (stdin) follows */ + /* a '@' letter, it means that a filename or - (stdin) follows */ if(!strcmp("-", p)) { file = stdin; set_binmode(stdin); @@ -892,8 +622,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global, err = getstr(&postdata, p, ALLOW_BLANK); if(err) goto error; - if(postdata) - size = strlen(postdata); + size = strlen(postdata); } if(!postdata) { @@ -911,15 +640,22 @@ static ParameterError data_urlencode(struct GlobalConfig *global, char *n; replace_url_encoded_space_by_plus(enc); if(nlen > 0) { /* only append '=' if we have a name */ - n = aprintf("%.*s=%s", (int)nlen, nextarg, enc); - curl_free(enc); - if(!n) + struct curlx_dynbuf dyn; + curlx_dyn_init(&dyn, MAX_DATAURLENCODE); + if(curlx_dyn_addn(&dyn, nextarg, nlen) || + curlx_dyn_addn(&dyn, "=", 1) || + curlx_dyn_add(&dyn, enc)) { + curl_free(enc); return PARAM_NO_MEM; + } + curl_free(enc); + n = curlx_dyn_ptr(&dyn); + size = curlx_dyn_len(&dyn); } - else + else { n = enc; - - size = strlen(n); + size = strlen(n); + } postdata = n; } else @@ -954,7 +690,7 @@ static CURLcode set_trace_config(struct GlobalConfig *global, if(!tmp) return CURLE_OUT_OF_MEMORY; - /* Allow strtok() here since this isn't used threaded */ + /* Allow strtok() here since this is not used threaded */ /* !checksrc! disable BANNEDFUNC 2 */ token = strtok(tmp, ", "); while(token) { @@ -1005,17 +741,18 @@ static int findarg(const void *a, const void *b) return strcmp(aa->lname, bb->lname); } -static const struct LongShort *single(char letter) +const struct LongShort *findshortopt(char letter) { static const struct LongShort *singles[128 - ' ']; /* ASCII => pointer */ static bool singles_done = FALSE; - DEBUGASSERT((letter < 127) && (letter > ' ')); + if((letter >= 127) || (letter <= ' ')) + return NULL; if(!singles_done) { unsigned int j; for(j = 0; j < sizeof(aliases)/sizeof(aliases[0]); j++) { if(aliases[j].letter != ' ') { - unsigned char l = aliases[j].letter; + unsigned char l = (unsigned char)aliases[j].letter; singles[l - ' '] = &aliases[j]; } } @@ -1024,6 +761,52 @@ static const struct LongShort *single(char letter) return singles[letter - ' ']; } +struct TOSEntry { + const char *name; + unsigned char value; +}; + +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} +}; + +static int find_tos(const void *a, const void *b) +{ + const struct TOSEntry *aa = a; + const struct TOSEntry *bb = b; + return strcmp(aa->name, bb->name); +} + #define MAX_QUERY_LEN 100000 /* larger is not likely to ever work */ static ParameterError url_query(char *nextarg, struct GlobalConfig *global, @@ -1077,7 +860,7 @@ static ParameterError set_data(cmdline_t cmd, return err; } else if('@' == *nextarg && (cmd != C_DATA_RAW)) { - /* the data begins with a '@' letter, it means that a file name + /* the data begins with a '@' letter, it means that a filename or - (stdin) follows */ nextarg++; /* pass the @ */ @@ -1121,8 +904,7 @@ static ParameterError set_data(cmdline_t cmd, err = getstr(&postdata, nextarg, ALLOW_BLANK); if(err) return err; - if(postdata) - size = strlen(postdata); + size = strlen(postdata); } if(cmd == C_JSON) config->jsoned = TRUE; @@ -1163,7 +945,7 @@ static ParameterError set_rate(struct GlobalConfig *global, if(numlen > sizeof(number) -1) return PARAM_NUMBER_TOO_LARGE; - strncpy(number, nextarg, numlen); + memcpy(number, nextarg, numlen); number[numlen] = 0; err = str2unum(&denominator, number); if(err) @@ -1174,6 +956,20 @@ static ParameterError set_rate(struct GlobalConfig *global, if(div) { char unit = div[1]; + curl_off_t numunits; + char *endp; + + if(curlx_strtoofft(&div[1], &endp, 10, &numunits)) { + /* if it fails, there is no legit number specified */ + if(endp == &div[1]) + /* if endp did not move, accept it as a 1 */ + numunits = 1; + else + return PARAM_BAD_USE; + } + else + unit = *endp; + switch(unit) { case 's': /* per second */ numerator = 1000; @@ -1191,6 +987,14 @@ static ParameterError set_rate(struct GlobalConfig *global, err = PARAM_BAD_USE; break; } + + if((LONG_MAX / numerator) < numunits) { + /* overflow, too large number */ + errorf(global, "too large --rate unit"); + err = PARAM_NUMBER_TOO_LARGE; + } + /* this typecast is okay based on the check above */ + numerator *= (long)numunits; } if(err) @@ -1203,6 +1007,15 @@ static ParameterError set_rate(struct GlobalConfig *global, return err; } +const struct LongShort *findlongopt(const char *opt) +{ + struct LongShort key; + key.lname = opt; + + return bsearch(&key, aliases, sizeof(aliases)/sizeof(aliases[0]), + sizeof(aliases[0]), findarg); +} + ParameterError getparameter(const char *flag, /* f or -long-flag */ char *nextarg, /* NULL if unset */ @@ -1214,9 +1027,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ { int rc; const char *parse = NULL; - time_t now; bool longopt = FALSE; bool singleopt = FALSE; /* when true means '-o foo' used '-ofoo' */ + size_t nopts = 0; /* options processed in `flag`*/ ParameterError err = PARAM_OK; bool toggle = TRUE; /* how to switch boolean options, on or off. Controlled by using --OPTION or --no-OPTION */ @@ -1237,14 +1050,13 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ (void)cleararg; #endif - *usedarg = FALSE; /* default is that we don't use the arg */ + *usedarg = FALSE; /* default is that we do not use the arg */ if(('-' != flag[0]) || ('-' == flag[1])) { /* this should be a long name */ const char *word = ('-' == flag[0]) ? flag + 2 : flag; bool noflagged = FALSE; bool expand = FALSE; - struct LongShort key; if(!strncmp(word, "no-", 3)) { /* disable this option but ignore the "no-" part when looking for it */ @@ -1257,10 +1069,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ word += 7; expand = TRUE; } - key.lname = word; - a = bsearch(&key, aliases, sizeof(aliases)/sizeof(aliases[0]), - sizeof(aliases[0]), findarg); + a = findlongopt(word); if(a) { longopt = TRUE; } @@ -1268,8 +1078,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ err = PARAM_OPTION_UNKNOWN; goto error; } - if(noflagged && (a->desc != ARG_BOOL)) { - /* --no- prefixed an option that isn't boolean! */ + if(noflagged && (ARGTYPE(a->desc) != ARG_BOOL)) { + /* --no- prefixed an option that is not boolean! */ err = PARAM_NO_NOT_BOOLEAN; goto error; } @@ -1277,9 +1087,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ struct curlx_dynbuf nbuf; bool replaced; - if((a->desc != ARG_STRG) && - (a->desc != ARG_FILE)) { - /* --expand on an option that isn't a string or a filename */ + if((ARGTYPE(a->desc) != ARG_STRG) && + (ARGTYPE(a->desc) != ARG_FILE)) { + /* --expand on an option that is not a string or a filename */ err = PARAM_EXPAND_ERROR; goto error; } @@ -1305,19 +1115,19 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ cmdline_t cmd; if(!longopt && !a) { - a = single(*parse); + a = findshortopt(*parse); if(!a) { err = PARAM_OPTION_UNKNOWN; break; } } letter = a->letter; - cmd = a->cmd; - if(a->desc >= ARG_STRG) { + cmd = (cmdline_t)a->cmd; + if(ARGTYPE(a->desc) >= ARG_STRG) { /* this option requires an extra parameter */ if(!longopt && parse[1]) { nextarg = (char *)&parse[1]; /* this is the actual extra parameter */ - singleopt = TRUE; /* don't loop anymore after this */ + singleopt = TRUE; /* do not loop anymore after this */ } else if(!nextarg) { err = PARAM_REQUIRES_PARAMETER; @@ -1330,14 +1140,19 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ *usedarg = TRUE; /* mark it as used */ } - if((a->desc == ARG_FILE) && + if((ARGTYPE(a->desc) == ARG_FILE) && (nextarg[0] == '-') && nextarg[1]) { - /* if the file name looks like a command line option */ - warnf(global, "The file name argument '%s' looks like a flag.", + /* if the filename looks like a command line option */ + warnf(global, "The filename argument '%s' looks like a flag.", + nextarg); + } + else if(!strncmp("\xe2\x80\x9c", nextarg, 3)) { + warnf(global, "The argument '%s' starts with a Unicode quote where " + "maybe an ASCII \" was intended?", nextarg); } } - else if((a->desc == ARG_NONE) && !toggle) { + else if((ARGTYPE(a->desc) == ARG_NONE) && !toggle) { err = PARAM_NO_PREFIX; break; } @@ -1350,6 +1165,12 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ nextarg = (char *)""; switch(cmd) { + case C_RANDOM_FILE: /* --random-file */ + case C_EGD_FILE: /* --egd-file */ + case C_NTLM_WB: /* --ntlm-wb */ + warnf(global, "--%s is deprecated and has no function anymore", + a->lname); + break; case C_DNS_IPV4_ADDR: /* --dns-ipv4-addr */ if(!curlinfo->ares_num) /* c-ares is needed for this */ err = PARAM_LIBCURL_DOESNT_SUPPORT; @@ -1364,10 +1185,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ /* addr in dot notation */ err = getstr(&config->dns_ipv6_addr, nextarg, DENY_BLANK); break; - case C_RANDOM_FILE: /* --random-file */ - break; - case C_EGD_FILE: /* --egd-file */ - break; case C_OAUTH2_BEARER: /* --oauth2-bearer */ err = getstr(&config->oauth_bearer, nextarg, DENY_BLANK); if(!err) { @@ -1401,7 +1218,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->disallow_username_in_url = toggle; break; case C_EPSV: /* --epsv */ - config->disable_epsv = (!toggle)?TRUE:FALSE; + config->disable_epsv = !toggle; break; case C_DNS_SERVERS: /* --dns-servers */ if(!curlinfo->ares_num) /* c-ares is needed for this */ @@ -1431,7 +1248,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ } break; case C_ALPN: /* --alpn */ - config->noalpn = (!toggle)?TRUE:FALSE; + config->noalpn = !toggle; break; case C_LIMIT_RATE: /* --limit-rate */ err = GetSizeParameter(global, nextarg, "rate", &value); @@ -1474,14 +1291,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ else err = PARAM_LIBCURL_DOESNT_SUPPORT; break; - case C_NTLM_WB: /* --ntlm-wb */ - if(!toggle) - config->authtype &= ~CURLAUTH_NTLM_WB; - else if(feature_ntlm_wb) - config->authtype |= CURLAUTH_NTLM_WB; - else - err = PARAM_LIBCURL_DOESNT_SUPPORT; - break; case C_BASIC: /* --basic */ if(toggle) config->authtype |= CURLAUTH_BASIC; @@ -1491,7 +1300,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_ANYAUTH: /* --anyauth */ if(toggle) config->authtype = CURLAUTH_ANY; - /* --no-anyauth simply doesn't touch it */ + /* --no-anyauth simply does not touch it */ break; #ifdef USE_WATT32 case C_WDEBUG: /* --wdebug */ @@ -1514,9 +1323,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ if(!err && (config->maxredirs < -1)) err = PARAM_BAD_NUMERIC; break; +#ifndef CURL_DISABLE_IPFS case C_IPFS_GATEWAY: /* --ipfs-gateway */ err = getstr(&config->ipfs_gateway, nextarg, DENY_BLANK); break; +#endif /* !CURL_DISABLE_IPFS */ case C_PROXY_NTLM: /* --proxy-ntlm */ if(!feature_ntlm) err = PARAM_LIBCURL_DOESNT_SUPPORT; @@ -1560,7 +1371,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->disable_eprt = toggle; break; case C_EPRT: /* --eprt */ - config->disable_eprt = (!toggle)?TRUE:FALSE; + config->disable_eprt = !toggle; break; case C_XATTR: /* --xattr */ config->xattr = toggle; @@ -1570,7 +1381,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->url_get = config->url_list; if(config->url_get) { - /* there's a node here, if it already is filled-in continue to find + /* there is a node here, if it already is filled-in continue to find an "empty" node */ while(config->url_get && (config->url_get->flags & GETOUT_URL)) config->url_get = config->url_get->next; @@ -1629,6 +1440,22 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_TCP_NODELAY: /* --tcp-nodelay */ config->tcp_nodelay = toggle; break; + case C_IP_TOS: { /* --ip-tos */ + struct TOSEntry find; + const struct TOSEntry *entry; + find.name = nextarg; + entry = bsearch(&find, tos_entries, + sizeof(tos_entries)/sizeof(*tos_entries), + sizeof(*tos_entries), find_tos); + if(entry) + config->ip_tos = entry->value; + else /* numeric tos value */ + err = str2unummax(&config->ip_tos, nextarg, 0xFF); + break; + } + case C_VLAN_PRIORITY: /* --vlan-priority */ + err = str2unummax(&config->vlan_priority, nextarg, 7); + break; case C_PROXY_DIGEST: /* --proxy-digest */ config->proxydigest = toggle; break; @@ -1687,7 +1514,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ while(ISDIGIT(*p)) p++; if(*p) { - /* if there's anything more than a plain decimal number */ + /* if there is anything more than a plain decimal number */ rc = sscanf(p, " - %6s", lrange); *p = 0; /* null-terminate to make str2unum() work below */ } @@ -1725,7 +1552,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->ftp_ssl_reqd = toggle; break; case C_SESSIONID: /* --sessionid */ - config->disable_sessionid = (!toggle)?TRUE:FALSE; + config->disable_sessionid = !toggle; break; case C_FTP_SSL_CONTROL: /* --ftp-ssl-control */ if(toggle && !feature_ssl) @@ -1755,11 +1582,14 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->raw = toggle; break; case C_KEEPALIVE: /* --keepalive */ - config->nokeepalive = (!toggle)?TRUE:FALSE; + config->nokeepalive = !toggle; break; case C_KEEPALIVE_TIME: /* --keepalive-time */ err = str2unum(&config->alivetime, nextarg); break; + case C_KEEPALIVE_CNT: /* --keepalive-cnt */ + err = str2unum(&config->alivecnt, nextarg); + break; case C_POST301: /* --post301 */ config->post301 = toggle; break; @@ -1824,7 +1654,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->sasl_ir = toggle; break; case C_TEST_EVENT: /* --test-event */ -#ifdef CURLDEBUG +#ifdef DEBUGBUILD global->test_event_based = toggle; #else warnf(global, "--test-event is ignored unless a debug build"); @@ -1861,6 +1691,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->abstract_unix_socket = TRUE; err = getstr(&config->unix_socket_path, nextarg, DENY_BLANK); break; + case C_TLS_EARLYDATA: /* --tls-earlydata */ + if(feature_ssl) + config->ssl_allow_earlydata = toggle; + break; case C_TLS_MAX: /* --tls-max */ err = str2tls_max(&config->ssl_version_max, nextarg); break; @@ -1887,7 +1721,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_PROGRESS_BAR: /* --progress-bar */ global->progressmode = toggle ? CURL_PROGRESS_BAR : CURL_PROGRESS_STATS; break; - case C_VARIABLE: /* --Variable */ + case C_VARIABLE: /* --variable */ err = setvariable(global, nextarg); break; case C_NEXT: /* --next */ @@ -2029,6 +1863,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_URL_QUERY: /* --url-query */ err = url_query(nextarg, global, config); break; + case C_DUMP_CA_EMBED: /* --dump-ca-embed */ + err = PARAM_CA_EMBED_REQUESTED; + break; case C_DUMP_HEADER: /* --dump-header */ err = getstr(&config->headerfile, nextarg, DENY_BLANK); break; @@ -2079,6 +1916,53 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ err = PARAM_ENGINES_REQUESTED; } break; + case C_ECH: /* --ech */ + if(!feature_ech) + err = PARAM_LIBCURL_DOESNT_SUPPORT; + else if(strlen(nextarg) > 4 && strncasecompare("pn:", nextarg, 3)) { + /* a public_name */ + err = getstr(&config->ech_public, nextarg, DENY_BLANK); + } + else if(strlen(nextarg) > 5 && strncasecompare("ecl:", nextarg, 4)) { + /* an ECHConfigList */ + if('@' != *(nextarg + 4)) { + err = getstr(&config->ech_config, nextarg, DENY_BLANK); + } + else { + /* Indirect case: @filename or @- for stdin */ + char *tmpcfg = NULL; + FILE *file; + + nextarg++; /* skip over '@' */ + if(!strcmp("-", nextarg)) { + file = stdin; + } + else { + file = fopen(nextarg, FOPEN_READTEXT); + } + if(!file) { + warnf(global, + "Couldn't read file \"%s\" " + "specified for \"--ech ecl:\" option", + nextarg); + return PARAM_BAD_USE; /* */ + } + err = file2string(&tmpcfg, file); + if(file != stdin) + fclose(file); + if(err) + return err; + config->ech_config = aprintf("ecl:%s",tmpcfg); + if(!config->ech_config) + return PARAM_NO_MEM; + free(tmpcfg); + } /* file done */ + } + else { + /* Simple case: just a string, with a keyword */ + err = getstr(&config->ech, nextarg, DENY_BLANK); + } + break; case C_CAPATH: /* --capath */ err = getstr(&config->capath, nextarg, DENY_BLANK); break; @@ -2283,9 +2167,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ nextarg, &config->mimeroot, &config->mimecurrent, - (cmd == C_FORM_STRING)?TRUE:FALSE)) /* literal string */ + (cmd == C_FORM_STRING))) /* literal string */ err = PARAM_BAD_USE; - else if(SetHTTPrequest(config, HTTPREQ_MIMEPOST, &config->httpreq)) + else if(SetHTTPrequest(config, TOOL_HTTPREQ_MIMEPOST, &config->httpreq)) err = PARAM_BAD_USE; break; case C_GLOBOFF: /* --globoff */ @@ -2318,7 +2202,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ char *string; size_t len; bool use_stdin = !strcmp(&nextarg[1], "-"); - FILE *file = use_stdin?stdin:fopen(&nextarg[1], FOPEN_READTEXT); + FILE *file = use_stdin ? stdin : fopen(&nextarg[1], FOPEN_READTEXT); if(!file) { errorf(global, "Failed to open %s", &nextarg[1]); err = PARAM_READ_ERROR; @@ -2326,7 +2210,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ else { err = file2memory(&string, &len, file); if(!err && string) { - /* Allow strtok() here since this isn't used threaded */ + /* Allow strtok() here since this is not used threaded */ /* !checksrc! disable BANNEDFUNC 2 */ char *h = strtok(string, "\r\n"); while(h) { @@ -2352,6 +2236,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ } break; case C_INCLUDE: /* --include */ + case C_SHOW_HEADERS: /* --show-headers */ config->show_headers = toggle; /* show the headers as well in the general output stream */ break; @@ -2361,9 +2246,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_HEAD: /* --head */ config->no_body = toggle; config->show_headers = toggle; - if(SetHTTPrequest(config, - (config->no_body)?HTTPREQ_HEAD:HTTPREQ_GET, - &config->httpreq)) + if(SetHTTPrequest(config, (config->no_body) ? TOOL_HTTPREQ_HEAD : + TOOL_HTTPREQ_GET, &config->httpreq)) err = PARAM_BAD_USE; break; case C_REMOTE_HEADER_NAME: /* --remote-header-name */ @@ -2422,7 +2306,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->nobuffer = longopt ? !toggle : TRUE; break; case C_REMOTE_NAME_ALL: /* --remote-name-all */ - config->default_node_flags = toggle?GETOUT_USEREMOTE:0; + config->default_node_flags = toggle ? GETOUT_USEREMOTE : 0; break; case C_OUTPUT_DIR: /* --output-dir */ err = getstr(&config->output_dir, nextarg, DENY_BLANK); @@ -2436,7 +2320,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ if(!config->url_out) config->url_out = config->url_list; if(config->url_out) { - /* there's a node here, if it already is filled-in continue to find + /* there is a node here, if it already is filled-in continue to find an "empty" node */ while(config->url_out && (config->url_out->flags & GETOUT_OUTFILE)) config->url_out = config->url_out->next; @@ -2487,7 +2371,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ break; case C_DISABLE: /* --disable */ - /* if used first, already taken care of, we do it like this so we don't + /* if used first, already taken care of, we do it like this so we do not cause an error! */ break; case C_QUOTE: /* --quote */ @@ -2510,9 +2394,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ break; case C_RANGE: /* --range */ /* Specifying a range WITHOUT A DASH will create an illegal HTTP range - (and won't 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. */ + (and will not actually be range by definition). The manpage + previously claimed that to be a good way, why this code is added to + work-around it. */ if(ISDIGIT(*nextarg) && !strchr(nextarg, '-')) { char buffer[32]; if(curlx_strtoofft(nextarg, NULL, 10, &value)) { @@ -2554,6 +2438,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_SILENT: /* --silent */ global->silent = toggle; break; + case C_SKIP_EXISTING: /* --skip-existing */ + config->skip_existing = toggle; + break; case C_SHOW_ERROR: /* --show-error */ global->showerror = toggle; break; @@ -2566,7 +2453,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ if(!config->url_ul) config->url_ul = config->url_list; if(config->url_ul) { - /* there's a node here, if it already is filled-in continue to find + /* there is a node here, if it already is filled-in continue to find an "empty" node */ while(config->url_ul && (config->url_ul->flags & GETOUT_UPLOAD)) config->url_ul = config->url_ul->next; @@ -2605,8 +2492,27 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ cleanarg(clearthis); break; case C_VERBOSE: /* --verbose */ - if(toggle) { - /* the '%' thing here will cause the trace get sent to stderr */ + /* This option is a super-boolean with side effect when applied + * more than once in the same argument flag, like `-vvv`. */ + if(!toggle) { + global->verbosity = 0; + if(set_trace_config(global, "-all")) + err = PARAM_NO_MEM; + global->tracetype = TRACE_NONE; + break; + } + else if(!nopts) { + /* fist `-v` in an argument resets to base verbosity */ + global->verbosity = 0; + if(set_trace_config(global, "-all")) { + err = PARAM_NO_MEM; + break; + } + } + /* the '%' thing here will cause the trace get sent to stderr */ + switch(global->verbosity) { + case 0: + global->verbosity = 1; Curl_safefree(global->trace_dump); global->trace_dump = strdup("%"); if(!global->trace_dump) @@ -2614,13 +2520,30 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ else { if(global->tracetype && (global->tracetype != TRACE_PLAIN)) warnf(global, - "-v, --verbose overrides an earlier trace/verbose option"); + "-v, --verbose overrides an earlier trace option"); global->tracetype = TRACE_PLAIN; } + break; + case 1: + global->verbosity = 2; + if(set_trace_config(global, "ids,time,protocol")) + err = PARAM_NO_MEM; + break; + case 2: + global->verbosity = 3; + global->tracetype = TRACE_ASCII; + if(set_trace_config(global, "ssl,read,write")) + err = PARAM_NO_MEM; + break; + case 3: + global->verbosity = 4; + if(set_trace_config(global, "network")) + err = PARAM_NO_MEM; + break; + default: + /* no effect for now */ + break; } - else - /* verbose is disabled here */ - global->tracetype = TRACE_NONE; break; case C_VERSION: /* --version */ if(toggle) /* --no-version yields no output! */ @@ -2629,7 +2552,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case C_WRITE_OUT: /* --write-out */ /* get the output string */ if('@' == *nextarg) { - /* the data begins with a '@' letter, it means that a file name + /* the data begins with a '@' letter, it means that a filename or - (stdin) follows */ FILE *file; const char *fname; @@ -2657,7 +2580,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ warnf(global, "Failed to read %s", fname); } else - err = getstr(&config->writeout, nextarg, DENY_BLANK); + err = getstr(&config->writeout, nextarg, ALLOW_BLANK); break; case C_PREPROXY: /* --preproxy */ err = getstr(&config->preproxy, nextarg, DENY_BLANK); @@ -2723,10 +2646,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ nextarg++; break; } - now = time(NULL); - config->condtime = (curl_off_t)curl_getdate(nextarg, &now); + config->condtime = (curl_off_t)curl_getdate(nextarg, NULL); if(-1 == config->condtime) { - /* now let's see if it is a file name to get the time from instead! */ + /* now let's see if it is a filename to get the time from instead! */ rc = getfiletime(nextarg, global, &value); if(!rc) /* pull the time out from the file */ @@ -2736,17 +2658,20 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ config->timecond = CURL_TIMECOND_NONE; warnf(global, "Illegal date format for -z, --time-cond (and not " - "a file name). Disabling time condition. " + "a filename). Disabling time condition. " "See curl_getdate(3) for valid date syntax."); } } break; + case C_MPTCP: /* --mptcp */ + config->mptcp = TRUE; + break; default: /* unknown flag */ err = PARAM_OPTION_UNKNOWN; break; } a = NULL; - + ++nopts; /* processed one option from `flag` input, loop for more */ } while(!longopt && !singleopt && *++parse && !*usedarg && !err); error: @@ -2822,7 +2747,7 @@ ParameterError parse_args(struct GlobalConfig *global, int argc, } } else if(!result && passarg) - i++; /* we're supposed to skip this */ + i++; /* we are supposed to skip this */ } } else { @@ -2837,16 +2762,15 @@ ParameterError parse_args(struct GlobalConfig *global, int argc, } if(!result && config->content_disposition) { - if(config->show_headers) - result = PARAM_CONTDISP_SHOW_HEADER; - else if(config->resume_from_current) + if(config->resume_from_current) result = PARAM_CONTDISP_RESUME_FROM; } if(result && result != PARAM_HELP_REQUESTED && result != PARAM_MANUAL_REQUESTED && result != PARAM_VERSION_INFO_REQUESTED && - result != PARAM_ENGINES_REQUESTED) { + result != PARAM_ENGINES_REQUESTED && + result != PARAM_CA_EMBED_REQUESTED) { const char *reason = param2text(result); if(orig_opt && strcmp(":", orig_opt)) diff --git a/deps/curl/src/tool_getparam.h b/deps/curl/src/tool_getparam.h index 12a971d0..c42f686a 100644 --- a/deps/curl/src/tool_getparam.h +++ b/deps/curl/src/tool_getparam.h @@ -25,6 +25,303 @@ ***************************************************************************/ #include "tool_setup.h" +/* one enum for every command line option. The name is the verbatim long + option name, but in uppercase with periods and minuses replaced with + underscores using a "C_" prefix. */ +typedef enum { + C_ABSTRACT_UNIX_SOCKET, + C_ALPN, + C_ALT_SVC, + C_ANYAUTH, + C_APPEND, + C_AWS_SIGV4, + C_BASIC, + C_BUFFER, + C_CA_NATIVE, + C_CACERT, + C_CAPATH, + C_CERT, + C_CERT_STATUS, + C_CERT_TYPE, + C_CIPHERS, + C_CLOBBER, + C_COMPRESSED, + C_COMPRESSED_SSH, + C_CONFIG, + C_CONNECT_TIMEOUT, + C_CONNECT_TO, + C_CONTINUE_AT, + C_COOKIE, + C_COOKIE_JAR, + C_CREATE_DIRS, + C_CREATE_FILE_MODE, + C_CRLF, + C_CRLFILE, + C_CURVES, + C_DATA, + C_DATA_ASCII, + C_DATA_BINARY, + C_DATA_RAW, + C_DATA_URLENCODE, + C_DELEGATION, + C_DIGEST, + C_DISABLE, + C_DISABLE_EPRT, + C_DISABLE_EPSV, + C_DISALLOW_USERNAME_IN_URL, + C_DNS_INTERFACE, + C_DNS_IPV4_ADDR, + C_DNS_IPV6_ADDR, + C_DNS_SERVERS, + C_DOH_CERT_STATUS, + C_DOH_INSECURE, + C_DOH_URL, + C_DUMP_CA_EMBED, + C_DUMP_HEADER, + C_ECH, + C_EGD_FILE, + C_ENGINE, + C_EPRT, + C_EPSV, + C_ETAG_COMPARE, + C_ETAG_SAVE, + C_EXPECT100_TIMEOUT, + C_FAIL, + C_FAIL_EARLY, + C_FAIL_WITH_BODY, + C_FALSE_START, + C_FORM, + C_FORM_ESCAPE, + C_FORM_STRING, + C_FTP_ACCOUNT, + C_FTP_ALTERNATIVE_TO_USER, + C_FTP_CREATE_DIRS, + C_FTP_METHOD, + C_FTP_PASV, + C_FTP_PORT, + C_FTP_PRET, + C_FTP_SKIP_PASV_IP, + C_FTP_SSL, + C_FTP_SSL_CCC, + C_FTP_SSL_CCC_MODE, + C_FTP_SSL_CONTROL, + C_FTP_SSL_REQD, + C_GET, + C_GLOBOFF, + C_HAPPY_EYEBALLS_TIMEOUT_MS, + C_HAPROXY_CLIENTIP, + C_HAPROXY_PROTOCOL, + C_HEAD, + C_HEADER, + C_HELP, + C_HOSTPUBMD5, + C_HOSTPUBSHA256, + C_HSTS, + C_HTTP0_9, + C_HTTP1_0, + C_HTTP1_1, + C_HTTP2, + C_HTTP2_PRIOR_KNOWLEDGE, + C_HTTP3, + C_HTTP3_ONLY, + C_IGNORE_CONTENT_LENGTH, + C_INCLUDE, + C_INSECURE, + C_INTERFACE, + C_IPFS_GATEWAY, + C_IPV4, + C_IPV6, + C_JSON, + C_JUNK_SESSION_COOKIES, + C_KEEPALIVE, + C_KEEPALIVE_CNT, + C_KEEPALIVE_TIME, + C_KEY, + C_KEY_TYPE, + C_KRB, + C_KRB4, + C_LIBCURL, + C_LIMIT_RATE, + C_LIST_ONLY, + C_LOCAL_PORT, + C_LOCATION, + C_LOCATION_TRUSTED, + C_LOGIN_OPTIONS, + C_MAIL_AUTH, + C_MAIL_FROM, + C_MAIL_RCPT, + C_MAIL_RCPT_ALLOWFAILS, + C_MANUAL, + C_MAX_FILESIZE, + C_MAX_REDIRS, + C_MAX_TIME, + C_METALINK, + C_MPTCP, + C_NEGOTIATE, + C_NETRC, + C_NETRC_FILE, + C_NETRC_OPTIONAL, + C_NEXT, + C_NOPROXY, + C_NPN, + C_NTLM, + C_NTLM_WB, + C_OAUTH2_BEARER, + C_OUTPUT, + C_OUTPUT_DIR, + C_PARALLEL, + C_PARALLEL_IMMEDIATE, + C_PARALLEL_MAX, + C_PASS, + C_PATH_AS_IS, + C_PINNEDPUBKEY, + C_POST301, + C_POST302, + C_POST303, + C_PREPROXY, + C_PROGRESS_BAR, + C_PROGRESS_METER, + C_PROTO, + C_PROTO_DEFAULT, + C_PROTO_REDIR, + C_PROXY, + C_PROXY_ANYAUTH, + C_PROXY_BASIC, + C_PROXY_CA_NATIVE, + C_PROXY_CACERT, + C_PROXY_CAPATH, + C_PROXY_CERT, + C_PROXY_CERT_TYPE, + C_PROXY_CIPHERS, + C_PROXY_CRLFILE, + C_PROXY_DIGEST, + C_PROXY_HEADER, + C_PROXY_HTTP2, + C_PROXY_INSECURE, + C_PROXY_KEY, + C_PROXY_KEY_TYPE, + C_PROXY_NEGOTIATE, + C_PROXY_NTLM, + C_PROXY_PASS, + C_PROXY_PINNEDPUBKEY, + C_PROXY_SERVICE_NAME, + C_PROXY_SSL_ALLOW_BEAST, + C_PROXY_SSL_AUTO_CLIENT_CERT, + C_PROXY_TLS13_CIPHERS, + C_PROXY_TLSAUTHTYPE, + C_PROXY_TLSPASSWORD, + C_PROXY_TLSUSER, + C_PROXY_TLSV1, + C_PROXY_USER, + C_PROXY1_0, + C_PROXYTUNNEL, + C_PUBKEY, + C_QUOTE, + C_RANDOM_FILE, + C_RANGE, + C_RATE, + C_RAW, + C_REFERER, + C_REMOTE_HEADER_NAME, + C_REMOTE_NAME, + C_REMOTE_NAME_ALL, + C_REMOTE_TIME, + C_REMOVE_ON_ERROR, + C_REQUEST, + C_REQUEST_TARGET, + C_RESOLVE, + C_RETRY, + C_RETRY_ALL_ERRORS, + C_RETRY_CONNREFUSED, + C_RETRY_DELAY, + C_RETRY_MAX_TIME, + C_SASL_AUTHZID, + C_SASL_IR, + C_SERVICE_NAME, + C_SESSIONID, + C_SHOW_ERROR, + C_SHOW_HEADERS, + C_SILENT, + C_SKIP_EXISTING, + C_SOCKS4, + C_SOCKS4A, + C_SOCKS5, + C_SOCKS5_BASIC, + C_SOCKS5_GSSAPI, + C_SOCKS5_GSSAPI_NEC, + C_SOCKS5_GSSAPI_SERVICE, + C_SOCKS5_HOSTNAME, + C_SPEED_LIMIT, + C_SPEED_TIME, + C_SSL, + C_SSL_ALLOW_BEAST, + C_SSL_AUTO_CLIENT_CERT, + C_SSL_NO_REVOKE, + C_SSL_REQD, + C_SSL_REVOKE_BEST_EFFORT, + C_SSLV2, + C_SSLV3, + C_STDERR, + C_STYLED_OUTPUT, + C_SUPPRESS_CONNECT_HEADERS, + C_TCP_FASTOPEN, + C_TCP_NODELAY, + C_TELNET_OPTION, + C_TEST_EVENT, + C_TFTP_BLKSIZE, + C_TFTP_NO_OPTIONS, + C_TIME_COND, + C_TLS_EARLYDATA, + C_TLS_MAX, + C_TLS13_CIPHERS, + C_TLSAUTHTYPE, + C_TLSPASSWORD, + C_TLSUSER, + C_TLSV1, + C_TLSV1_0, + C_TLSV1_1, + C_TLSV1_2, + C_TLSV1_3, + C_TR_ENCODING, + C_TRACE, + C_TRACE_ASCII, + C_TRACE_CONFIG, + C_TRACE_IDS, + C_TRACE_TIME, + C_IP_TOS, + C_UNIX_SOCKET, + C_UPLOAD_FILE, + C_URL, + C_URL_QUERY, + C_USE_ASCII, + C_USER, + C_USER_AGENT, + C_VARIABLE, + C_VERBOSE, + C_VERSION, + C_VLAN_PRIORITY, + C_WDEBUG, + C_WRITE_OUT, + C_XATTR +} cmdline_t; + +#define ARG_NONE 0 /* stand-alone but not a boolean */ +#define ARG_BOOL 1 /* accepts a --no-[name] prefix */ +#define ARG_STRG 2 /* requires an argument */ +#define ARG_FILE 3 /* requires an argument, usually a filename */ + +#define ARG_TYPEMASK 0x03 +#define ARGTYPE(x) ((x) & ARG_TYPEMASK) + +#define ARG_NO 0x80 /* set if the option is documented as --no-* */ + +struct LongShort { + const char *lname; /* long name option */ + unsigned char desc; /* type, see ARG_* */ + char letter; /* short name option or ' ' */ + unsigned short cmd; +}; + typedef enum { PARAM_OK = 0, PARAM_OPTION_AMBIGUOUS, @@ -35,6 +332,7 @@ typedef enum { PARAM_MANUAL_REQUESTED, PARAM_VERSION_INFO_REQUESTED, PARAM_ENGINES_REQUESTED, + PARAM_CA_EMBED_REQUESTED, PARAM_GOT_EXTRA_PARAMETER, PARAM_BAD_NUMERIC, PARAM_NEGATIVE_NUMERIC, @@ -45,7 +343,6 @@ typedef enum { PARAM_NO_PREFIX, PARAM_NUMBER_TOO_LARGE, PARAM_NO_NOT_BOOLEAN, - PARAM_CONTDISP_SHOW_HEADER, /* --include and --remote-header-name */ PARAM_CONTDISP_RESUME_FROM, /* --continue-at and --remote-header-name */ PARAM_READ_ERROR, PARAM_EXPAND_ERROR, /* --expand problem */ @@ -56,6 +353,9 @@ typedef enum { struct GlobalConfig; struct OperationConfig; +const struct LongShort *findlongopt(const char *opt); +const struct LongShort *findshortopt(char letter); + ParameterError getparameter(const char *flag, char *nextarg, argv_item_t cleararg, bool *usedarg, diff --git a/deps/curl/src/tool_getpass.c b/deps/curl/src/tool_getpass.c index 8ccccdfb..412c50a1 100644 --- a/deps/curl/src/tool_getpass.c +++ b/deps/curl/src/tool_getpass.c @@ -64,8 +64,8 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) long sts; short chan; - /* MSK, 23-JAN-2004, iosbdef.h wasn't in VAX V7.2 or CC 6.4 */ - /* distribution so I created this. May revert back later to */ + /* 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 { @@ -115,7 +115,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) } /* since echo is disabled, print a newline */ fputs("\n", tool_stderr); - /* if user didn't hit ENTER, terminate buffer */ + /* if user did not hit ENTER, terminate buffer */ if(i == buflen) buffer[buflen-1] = '\0'; @@ -146,15 +146,15 @@ static bool ttyecho(bool enable, int fd) #ifdef HAVE_TERMIOS_H tcgetattr(fd, &withecho); noecho = withecho; - noecho.c_lflag &= ~ECHO; + noecho.c_lflag &= ~(tcflag_t)ECHO; tcsetattr(fd, TCSANOW, &noecho); #elif defined(HAVE_TERMIO_H) ioctl(fd, TCGETA, &withecho); noecho = withecho; - noecho.c_lflag &= ~ECHO; + noecho.c_lflag &= ~(tcflag_t)ECHO; ioctl(fd, TCSETA, &noecho); #else - /* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H, we can't disable echo! */ + /* neither HAVE_TERMIO_H nor HAVE_TERMIOS_H, we cannot disable echo! */ (void)fd; return FALSE; /* not disabled */ #endif @@ -180,7 +180,7 @@ char *getpass_r(const char *prompt, /* prompt to display */ bool disabled; int fd = open("/dev/tty", O_RDONLY); if(-1 == fd) - fd = STDIN_FILENO; /* use stdin if the tty couldn't be used */ + fd = STDIN_FILENO; /* use stdin if the tty could not be used */ disabled = ttyecho(FALSE, fd); /* disable terminal echo */ diff --git a/deps/curl/src/tool_getpass.h b/deps/curl/src/tool_getpass.h index b93585d9..0a4d6d5a 100644 --- a/deps/curl/src/tool_getpass.h +++ b/deps/curl/src/tool_getpass.h @@ -26,7 +26,7 @@ #include "tool_setup.h" #ifndef HAVE_GETPASS_R -/* If there's a system-provided function named like this, we trust it is +/* If there is a system-provided function named like this, we trust it is also found in one of the standard headers. */ /* diff --git a/deps/curl/src/tool_help.c b/deps/curl/src/tool_help.c index 04ac2453..57b14a3b 100644 --- a/deps/curl/src/tool_help.c +++ b/deps/curl/src/tool_help.c @@ -22,14 +22,17 @@ * ***************************************************************************/ #include "tool_setup.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ + #include "curlx.h" #include "tool_help.h" #include "tool_libinfo.h" #include "tool_util.h" #include "tool_version.h" +#include "tool_cb_prg.h" +#include "tool_hugehelp.h" +#include "tool_getparam.h" +#include "terminal.h" #include "memdebug.h" /* keep this as LAST include */ @@ -37,44 +40,46 @@ # define USE_WATT32 #endif +#ifndef ARRAYSIZE +#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) +#endif + struct category_descriptors { const char *opt; const char *desc; - curlhelp_t category; + unsigned int category; }; static const struct category_descriptors categories[] = { - {"auth", "Different types of authentication methods", CURLHELP_AUTH}, - {"connection", "Low level networking operations", - CURLHELP_CONNECTION}, - {"curl", "The command line tool itself", CURLHELP_CURL}, - {"dns", "General DNS options", CURLHELP_DNS}, - {"file", "FILE protocol options", CURLHELP_FILE}, - {"ftp", "FTP protocol options", CURLHELP_FTP}, - {"http", "HTTP and HTTPS protocol options", CURLHELP_HTTP}, - {"imap", "IMAP protocol options", CURLHELP_IMAP}, /* important is left out because it is the default help page */ - {"misc", "Options that don't fit into any other category", CURLHELP_MISC}, + {"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", "Filesystem output", CURLHELP_OUTPUT}, - {"pop3", "POP3 protocol options", CURLHELP_POP3}, - {"post", "HTTP Post specific options", CURLHELP_POST}, - {"proxy", "All options related to proxies", CURLHELP_PROXY}, - {"scp", "SCP protocol options", CURLHELP_SCP}, - {"sftp", "SFTP protocol options", CURLHELP_SFTP}, - {"smtp", "SMTP protocol options", CURLHELP_SMTP}, - {"ssh", "SSH protocol options", CURLHELP_SSH}, - {"telnet", "TELNET protocol options", CURLHELP_TELNET}, - {"tftp", "TFTP protocol options", CURLHELP_TFTP}, - {"tls", "All TLS/SSL related options", CURLHELP_TLS}, - {"upload", "All options for uploads", - CURLHELP_UPLOAD}, - {"verbose", "Options related to any kind of command line output of curl", - CURLHELP_VERBOSE}, - {NULL, NULL, CURLHELP_HIDDEN} + {"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(curlhelp_t category) +static void print_category(unsigned int category, unsigned int cols) { unsigned int i; size_t longopt = 5; @@ -91,23 +96,31 @@ static void print_category(curlhelp_t category) if(len > longdesc) longdesc = len; } - if(longopt + longdesc > 80) - longopt = 80 - longdesc; + if(longopt + longdesc > cols) + longopt = cols - longdesc; for(i = 0; helptext[i].opt; ++i) if(helptext[i].categories & category) { - printf(" %-*s %s\n", (int)longopt, helptext[i].opt, helptext[i].desc); + size_t opt = longopt; + size_t desclen = strlen(helptext[i].desc); + if(opt + desclen >= (cols - 2)) { + if(desclen < (cols - 2)) + opt = (cols - 3) - desclen; + else + opt = 0; + } + printf(" %-*s %s\n", (int)opt, helptext[i].opt, helptext[i].desc); } } /* Prints category if found. If not, it returns 1 */ -static int get_category_content(const char *category) +static int get_category_content(const char *category, unsigned int cols) { unsigned int i; - for(i = 0; categories[i].opt; ++i) + for(i = 0; i < ARRAYSIZE(categories); ++i) if(curl_strequal(categories[i].opt, category)) { printf("%s: %s\n", categories[i].opt, categories[i].desc); - print_category(categories[i].category); + print_category(categories[i].category, cols); return 0; } return 1; @@ -117,33 +130,178 @@ static int get_category_content(const char *category) static void get_categories(void) { unsigned int i; - for(i = 0; categories[i].opt; ++i) + for(i = 0; i < ARRAYSIZE(categories); ++i) printf(" %-11s %s\n", categories[i].opt, categories[i].desc); } +/* Prints all categories as a comma-separated list of given width */ +static void get_categories_list(unsigned int width) +{ + unsigned int i; + size_t col = 0; + for(i = 0; i < ARRAYSIZE(categories); ++i) { + size_t len = strlen(categories[i].opt); + if(i == ARRAYSIZE(categories) - 1) { + /* final category */ + if(col + len + 1 < width) + printf("%s.\n", categories[i].opt); + else + /* start a new line first */ + printf("\n%s.\n", categories[i].opt); + } + else if(col + len + 2 < width) { + printf("%s, ", categories[i].opt); + col += len + 2; + } + else { + /* start a new line first */ + printf("\n%s, ", categories[i].opt); + col = len + 2; + } + } +} + +#ifdef USE_MANUAL + +void inithelpscan(struct scan_ctx *ctx, + const char *trigger, + const char *arg, + const char *endarg) +{ + ctx->trigger = trigger; + ctx->tlen = strlen(trigger); + ctx->arg = arg; + ctx->flen = strlen(arg); + ctx->endarg = endarg; + ctx->elen = strlen(endarg); + DEBUGASSERT((ctx->elen < sizeof(ctx->rbuf)) || + (ctx->flen < sizeof(ctx->rbuf))); + ctx->show = 0; + ctx->olen = 0; + memset(ctx->rbuf, 0, sizeof(ctx->rbuf)); +} + +bool helpscan(unsigned char *buf, size_t len, struct scan_ctx *ctx) +{ + size_t i; + for(i = 0; i < len; i++) { + if(!ctx->show) { + /* wait for the trigger */ + memmove(&ctx->rbuf[0], &ctx->rbuf[1], ctx->tlen - 1); + ctx->rbuf[ctx->tlen - 1] = buf[i]; + if(!memcmp(ctx->rbuf, ctx->trigger, ctx->tlen)) + ctx->show++; + continue; + } + /* past the trigger */ + if(ctx->show == 1) { + memmove(&ctx->rbuf[0], &ctx->rbuf[1], ctx->flen - 1); + ctx->rbuf[ctx->flen - 1] = buf[i]; + if(!memcmp(ctx->rbuf, ctx->arg, ctx->flen)) { + /* match, now output until endarg */ + fputs(&ctx->arg[1], stdout); + ctx->show++; + } + continue; + } + /* show until the end */ + memmove(&ctx->rbuf[0], &ctx->rbuf[1], ctx->elen - 1); + ctx->rbuf[ctx->elen - 1] = buf[i]; + if(!memcmp(ctx->rbuf, ctx->endarg, ctx->elen)) + return FALSE; + + if(buf[i] == '\n') { + DEBUGASSERT(ctx->olen < sizeof(ctx->obuf)); + if(ctx->olen == sizeof(ctx->obuf)) + return FALSE; /* bail out */ + ctx->obuf[ctx->olen++] = 0; + ctx->olen = 0; + puts(ctx->obuf); + } + else { + DEBUGASSERT(ctx->olen < sizeof(ctx->obuf)); + if(ctx->olen == sizeof(ctx->obuf)) + return FALSE; /* bail out */ + ctx->obuf[ctx->olen++] = buf[i]; + } + } + return TRUE; +} + +#endif void tool_help(char *category) { - puts("Usage: curl [options...] "); + unsigned int cols = get_terminal_columns(); /* If no category was provided */ if(!category) { - const char *category_note = "\nThis is not the full help, this " - "menu is stripped into categories.\nUse \"--help category\" to get " - "an overview of all categories.\nFor all options use the manual" - " or \"--help all\"."; - print_category(CURLHELP_IMPORTANT); + 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 = + "Use \"--help all\" to list all options" +#ifdef USE_MANUAL + "\nUse \"--help [option]\" to view documentation for a given option" +#endif + ; + puts("Usage: curl [options...] "); + print_category(CURLHELP_IMPORTANT, cols); puts(category_note); + get_categories_list(cols); + puts(category_note2); } /* Lets print everything if "all" was provided */ else if(curl_strequal(category, "all")) - /* Print everything except hidden */ - print_category(~(CURLHELP_HIDDEN)); + /* Print everything */ + print_category(CURLHELP_ALL, cols); /* Lets handle the string "category" differently to not print an errormsg */ else if(curl_strequal(category, "category")) get_categories(); + else if(category[0] == '-') { +#ifdef USE_MANUAL + /* command line option help */ + const struct LongShort *a = NULL; + if(category[1] == '-') { + char *lookup = &category[2]; + bool noflagged = FALSE; + if(!strncmp(lookup, "no-", 3)) { + lookup += 3; + noflagged = TRUE; + } + a = findlongopt(lookup); + if(a && noflagged && (ARGTYPE(a->desc) != ARG_BOOL)) + /* a --no- prefix for a non-boolean is not specifying a proper + option */ + a = NULL; + } + else if(!category[2]) + a = findshortopt(category[1]); + if(!a) { + fprintf(tool_stderr, "Incorrect option name to show help for," + " see curl -h\n"); + } + else { + char cmdbuf[80]; + if(a->letter != ' ') + msnprintf(cmdbuf, sizeof(cmdbuf), "\n -%c, --", a->letter); + else if(a->desc & ARG_NO) + msnprintf(cmdbuf, sizeof(cmdbuf), "\n --no-%s", a->lname); + else + msnprintf(cmdbuf, sizeof(cmdbuf), "\n %s", category); + if(a->cmd == C_XATTR) + /* this is the last option, which then ends when FILES starts */ + showhelp("\nALL OPTIONS\n", cmdbuf, "\nFILES"); + else + showhelp("\nALL OPTIONS\n", cmdbuf, "\n -"); + } +#else + fprintf(tool_stderr, "Cannot comply. " + "This curl was built without built-in manual\n"); +#endif + } /* Otherwise print category and handle the case if the cat was not found */ - else if(get_category_content(category)) { - puts("Invalid category provided, here is a list of all categories:\n"); + else if(get_category_content(category, cols)) { + puts("Unknown category provided, here is a list of all categories:\n"); get_categories(); } free(category); @@ -173,6 +331,7 @@ void tool_version_info(void) printf("Release-Date: %s\n", LIBCURL_TIMESTAMP); #endif if(built_in_protos[0]) { +#ifndef CURL_DISABLE_IPFS const char *insert = NULL; /* we have ipfs and ipns support if libcurl has http support */ for(builtin = built_in_protos; *builtin; ++builtin) { @@ -187,24 +346,45 @@ void tool_version_info(void) insert = *builtin; } } +#endif /* !CURL_DISABLE_IPFS */ printf("Protocols:"); for(builtin = built_in_protos; *builtin; ++builtin) { /* Special case: do not list rtmp?* protocols. They may only appear together with "rtmp" */ if(!curl_strnequal(*builtin, "rtmp", 4) || !builtin[0][4]) printf(" %s", *builtin); +#ifndef CURL_DISABLE_IPFS if(insert && insert == *builtin) { printf(" ipfs ipns"); insert = NULL; } +#endif /* !CURL_DISABLE_IPFS */ } puts(""); /* newline */ } if(feature_names[0]) { - printf("Features:"); - for(builtin = feature_names; *builtin; ++builtin) - printf(" %s", *builtin); - puts(""); /* newline */ + const char **feat_ext; + size_t feat_ext_count = feature_count; +#ifdef CURL_CA_EMBED + ++feat_ext_count; +#endif + feat_ext = malloc(sizeof(*feature_names) * (feat_ext_count + 1)); + if(feat_ext) { + memcpy((void *)feat_ext, feature_names, + sizeof(*feature_names) * feature_count); + feat_ext_count = feature_count; +#ifdef CURL_CA_EMBED + feat_ext[feat_ext_count++] = "CAcert"; +#endif + feat_ext[feat_ext_count] = NULL; + qsort((void *)feat_ext, feat_ext_count, sizeof(*feat_ext), + struplocompare4sort); + printf("Features:"); + for(builtin = feat_ext; *builtin; ++builtin) + printf(" %s", *builtin); + puts(""); /* newline */ + free((void *)feat_ext); + } } if(strcmp(CURL_VERSION, curlinfo->version)) { printf("WARNING: curl and libcurl versions do not match. " diff --git a/deps/curl/src/tool_help.h b/deps/curl/src/tool_help.h index a7906266..4b407153 100644 --- a/deps/curl/src/tool_help.h +++ b/deps/curl/src/tool_help.h @@ -28,47 +28,65 @@ void tool_help(char *category); void tool_list_engines(void); void tool_version_info(void); - -typedef unsigned int curlhelp_t; +struct scan_ctx { + const char *trigger; + size_t tlen; + const char *arg; + size_t flen; + const char *endarg; + size_t elen; + size_t olen; + char rbuf[40]; + char obuf[160]; + unsigned char show; /* start as at 0. + trigger match moves it to 1 + arg match moves it to 2 + endarg stops the search */ +}; +void inithelpscan(struct scan_ctx *ctx, const char *trigger, + const char *arg, const char *endarg); +bool helpscan(unsigned char *buf, size_t len, struct scan_ctx *ctx); struct helptxt { const char *opt; const char *desc; - curlhelp_t categories; + unsigned int categories; }; /* * The bitmask output is generated with the following command ------------------------------------------------------------ - cd $srcroot/docs/cmdline-opts - ./gen.pl listcats *.d + make -C docs/cmdline-opts listcats */ -#define CURLHELP_HIDDEN 1u << 0u -#define CURLHELP_AUTH 1u << 1u -#define CURLHELP_CONNECTION 1u << 2u -#define CURLHELP_CURL 1u << 3u -#define CURLHELP_DNS 1u << 4u -#define CURLHELP_FILE 1u << 5u -#define CURLHELP_FTP 1u << 6u -#define CURLHELP_HTTP 1u << 7u -#define CURLHELP_IMAP 1u << 8u -#define CURLHELP_IMPORTANT 1u << 9u -#define CURLHELP_IPFS 1u << 10u -#define CURLHELP_MISC 1u << 11u -#define CURLHELP_OUTPUT 1u << 12u -#define CURLHELP_POP3 1u << 13u -#define CURLHELP_POST 1u << 14u -#define CURLHELP_PROXY 1u << 15u -#define CURLHELP_SCP 1u << 16u -#define CURLHELP_SFTP 1u << 17u -#define CURLHELP_SMTP 1u << 18u -#define CURLHELP_SSH 1u << 19u -#define CURLHELP_TELNET 1u << 20u -#define CURLHELP_TFTP 1u << 21u -#define CURLHELP_TLS 1u << 22u -#define CURLHELP_UPLOAD 1u << 23u -#define CURLHELP_VERBOSE 1u << 24u +#define CURLHELP_AUTH (1u << 0u) +#define CURLHELP_CONNECTION (1u << 1u) +#define CURLHELP_CURL (1u << 2u) +#define CURLHELP_DEPRECATED (1u << 3u) +#define CURLHELP_DNS (1u << 4u) +#define CURLHELP_FILE (1u << 5u) +#define CURLHELP_FTP (1u << 6u) +#define CURLHELP_GLOBAL (1u << 7u) +#define CURLHELP_HTTP (1u << 8u) +#define CURLHELP_IMAP (1u << 9u) +#define CURLHELP_IMPORTANT (1u << 10u) +#define CURLHELP_LDAP (1u << 11u) +#define CURLHELP_OUTPUT (1u << 12u) +#define CURLHELP_POP3 (1u << 13u) +#define CURLHELP_POST (1u << 14u) +#define CURLHELP_PROXY (1u << 15u) +#define CURLHELP_SCP (1u << 16u) +#define CURLHELP_SFTP (1u << 17u) +#define CURLHELP_SMTP (1u << 18u) +#define CURLHELP_SSH (1u << 19u) +#define CURLHELP_TELNET (1u << 20u) +#define CURLHELP_TFTP (1u << 21u) +#define CURLHELP_TIMEOUT (1u << 22u) +#define CURLHELP_TLS (1u << 23u) +#define CURLHELP_UPLOAD (1u << 24u) +#define CURLHELP_VERBOSE (1u << 25u) + +#define CURLHELP_ALL (0xfffffffu) extern const struct helptxt helptext[]; diff --git a/deps/curl/src/tool_helpers.c b/deps/curl/src/tool_helpers.c index 67924a26..02193c3e 100644 --- a/deps/curl/src/tool_helpers.c +++ b/deps/curl/src/tool_helpers.c @@ -25,8 +25,6 @@ #include "strcase.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" @@ -40,9 +38,8 @@ ** Helper functions that are used from more than one source file. */ -const char *param2text(int res) +const char *param2text(ParameterError error) { - ParameterError error = (ParameterError)res; switch(error) { case PARAM_GOT_EXTRA_PARAMETER: return "had unsupported trailing garbage"; @@ -59,19 +56,17 @@ const char *param2text(int res) case PARAM_NEGATIVE_NUMERIC: return "expected a positive numerical parameter"; case PARAM_LIBCURL_DOESNT_SUPPORT: - return "the installed libcurl version doesn't support this"; + return "the installed libcurl version does not support this"; case PARAM_LIBCURL_UNSUPPORTED_PROTOCOL: return "a specified protocol is unsupported by libcurl"; case PARAM_NO_MEM: return "out of memory"; case PARAM_NO_PREFIX: - return "the given option can't be reversed with a --no- prefix"; + return "the given option cannot be reversed with a --no- prefix"; case PARAM_NUMBER_TOO_LARGE: return "too large number"; case PARAM_NO_NOT_BOOLEAN: - return "used '--no-' for option that isn't a boolean"; - case PARAM_CONTDISP_SHOW_HEADER: - return "showing headers and --remote-header-name cannot be combined"; + return "used '--no-' for option that is not a boolean"; case PARAM_CONTDISP_RESUME_FROM: return "--continue-at and --remote-header-name cannot be combined"; case PARAM_READ_ERROR: @@ -97,7 +92,7 @@ int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store) "PUT (-T, --upload-file)" }; - if((*store == HTTPREQ_UNSPEC) || + if((*store == TOOL_HTTPREQ_UNSPEC) || (*store == req)) { *store = req; return 0; diff --git a/deps/curl/src/tool_helpers.h b/deps/curl/src/tool_helpers.h index 2cfbad21..dd085e2c 100644 --- a/deps/curl/src/tool_helpers.h +++ b/deps/curl/src/tool_helpers.h @@ -25,7 +25,7 @@ ***************************************************************************/ #include "tool_setup.h" -const char *param2text(int res); +const char *param2text(ParameterError error); int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store); diff --git a/deps/curl/src/tool_hugehelp.c.cvs b/deps/curl/src/tool_hugehelp.c.cvs index 06b132fb..77116613 100644 --- a/deps/curl/src/tool_hugehelp.c.cvs +++ b/deps/curl/src/tool_hugehelp.c.cvs @@ -27,5 +27,13 @@ void hugehelp(void) { - puts("This is a silly replacement for the actual file."); + puts("built-in manual was disabled at build-time"); +} + +void showhelp(const char *trigger, const char *arg, const char *endarg) +{ + (void)trigger; + (void)arg; + (void)endarg; + hugehelp(); } diff --git a/deps/curl/src/tool_hugehelp.h b/deps/curl/src/tool_hugehelp.h index ce9af0c5..f00f8870 100644 --- a/deps/curl/src/tool_hugehelp.h +++ b/deps/curl/src/tool_hugehelp.h @@ -25,6 +25,8 @@ ***************************************************************************/ #include "tool_setup.h" +void showhelp(const char *trigger, const char *arg, const char *endarg); + #ifdef USE_MANUAL void hugehelp(void); #else diff --git a/deps/curl/src/tool_ipfs.c b/deps/curl/src/tool_ipfs.c index f3a20aa9..46bd8e14 100644 --- a/deps/curl/src/tool_ipfs.c +++ b/deps/curl/src/tool_ipfs.c @@ -23,8 +23,7 @@ ***************************************************************************/ #include "tool_setup.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ +#ifndef CURL_DISABLE_IPFS #include "curlx.h" #include "dynbuf.h" @@ -65,7 +64,7 @@ static char *ipfs_gateway(void) char *ipfs_path = NULL; char *gateway_composed_file_path = NULL; FILE *gateway_file = NULL; - char *gateway = curlx_getenv("IPFS_GATEWAY"); + char *gateway = curl_getenv("IPFS_GATEWAY"); /* Gateway is found from environment variable. */ if(gateway) { @@ -75,15 +74,13 @@ static char *ipfs_gateway(void) } /* Try to find the gateway in the IPFS data folder. */ - ipfs_path = curlx_getenv("IPFS_PATH"); + ipfs_path = curl_getenv("IPFS_PATH"); if(!ipfs_path) { - char *home = curlx_getenv("HOME"); + char *home = getenv("HOME"); if(home && *home) ipfs_path = aprintf("%s/.ipfs/", home); - /* fallback to "~/.ipfs", as that's the default location. */ - - Curl_safefree(home); + /* fallback to "~/.ipfs", as that is the default location. */ } if(!ipfs_path || ensure_trailing_slash(&ipfs_path)) @@ -134,7 +131,7 @@ fail: } /* - * Rewrite ipfs:// and ipns:// to a HTTP(S) + * Rewrite ipfs:// and ipns:// to an HTTP(S) * URL that can be handled by an IPFS gateway. */ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, @@ -164,7 +161,7 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, goto clean; /* We might have a --ipfs-gateway argument. Check it first and use it. Error - * if we do have something but if it's an invalid url. + * if we do have something but if it is an invalid url. */ if(config->ipfs_gateway) { /* ensure the gateway ends in a trailing / */ @@ -291,3 +288,4 @@ clean: } return result; } +#endif /* !CURL_DISABLE_IPFS */ diff --git a/deps/curl/src/tool_ipfs.h b/deps/curl/src/tool_ipfs.h index 9c8a83e3..31d8019f 100644 --- a/deps/curl/src/tool_ipfs.h +++ b/deps/curl/src/tool_ipfs.h @@ -25,9 +25,11 @@ ***************************************************************************/ #include "tool_setup.h" +#ifndef CURL_DISABLE_IPFS #define MAX_GATEWAY_URL_LEN 10000 CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, struct OperationConfig *config); #endif /* HEADER_CURL_TOOL_IPFS_H */ +#endif /* !CURL_DISABLE_IPFS */ diff --git a/deps/curl/src/tool_libinfo.c b/deps/curl/src/tool_libinfo.c index 0bf3a90b..f6053e84 100644 --- a/deps/curl/src/tool_libinfo.c +++ b/deps/curl/src/tool_libinfo.c @@ -25,15 +25,13 @@ #include "strcase.h" -#define ENABLE_CURLX_PRINTF -/* use our own printf() functions */ #include "curlx.h" #include "tool_libinfo.h" #include "memdebug.h" /* keep this as LAST include */ -/* global variable definitions, for libcurl run-time info */ +/* global variable definitions, for libcurl runtime info */ static const char *no_protos = NULL; @@ -51,8 +49,10 @@ const char *proto_rtsp = NULL; const char *proto_scp = NULL; const char *proto_sftp = NULL; const char *proto_tftp = NULL; +#ifndef CURL_DISABLE_IPFS const char *proto_ipfs = "ipfs"; const char *proto_ipns = "ipns"; +#endif /* !CURL_DISABLE_IPFS */ static struct proto_name_tokenp { const char *proto_name; @@ -83,6 +83,7 @@ bool feature_spnego = FALSE; bool feature_ssl = FALSE; bool feature_tls_srp = FALSE; bool feature_zstd = FALSE; +bool feature_ech = FALSE; static struct feature_name_presentp { const char *feature_name; @@ -95,6 +96,7 @@ static struct feature_name_presentp { {"brotli", &feature_brotli, CURL_VERSION_BROTLI}, {"CharConv", NULL, CURL_VERSION_CONV}, {"Debug", NULL, CURL_VERSION_DEBUG}, + {"ECH", &feature_ech, 0}, {"gsasl", NULL, CURL_VERSION_GSASL}, {"GSS-API", NULL, CURL_VERSION_GSSAPI}, {"HSTS", &feature_hsts, CURL_VERSION_HSTS}, @@ -124,10 +126,11 @@ static struct feature_name_presentp { static const char *fnames[sizeof(maybe_feature) / sizeof(maybe_feature[0])]; const char * const *feature_names = fnames; +size_t feature_count; /* - * libcurl_info_init: retrieves run-time information about libcurl, - * setting a global pointer 'curlinfo' to libcurl's run-time info + * libcurl_info_init: retrieves runtime information about libcurl, + * setting a global pointer 'curlinfo' to libcurl's runtime info * struct, count protocols and flag those we are interested in. * Global pointer feature_names is set to the feature names array. If * the latter is not returned by curl_version_info(), it is built from @@ -139,7 +142,7 @@ CURLcode get_libcurl_info(void) CURLcode result = CURLE_OK; const char *const *builtin; - /* Pointer to libcurl's run-time version information */ + /* Pointer to libcurl's runtime version information */ curlinfo = curl_version_info(CURLVERSION_NOW); if(!curlinfo) return CURLE_FAILED_INIT; @@ -182,6 +185,7 @@ CURLcode get_libcurl_info(void) *p->feature_presentp = TRUE; break; } + ++feature_count; } return CURLE_OK; diff --git a/deps/curl/src/tool_libinfo.h b/deps/curl/src/tool_libinfo.h index 46063ad1..0d176699 100644 --- a/deps/curl/src/tool_libinfo.h +++ b/deps/curl/src/tool_libinfo.h @@ -25,7 +25,7 @@ ***************************************************************************/ #include "tool_setup.h" -/* global variable declarations, for libcurl run-time info */ +/* global variable declarations, for libcurl runtime info */ extern curl_version_info_data *curlinfo; @@ -34,6 +34,7 @@ extern const char * const *built_in_protos; extern size_t proto_count; extern const char * const *feature_names; +extern size_t feature_count; extern const char *proto_file; extern const char *proto_ftp; @@ -60,6 +61,7 @@ extern bool feature_spnego; extern bool feature_ssl; extern bool feature_tls_srp; extern bool feature_zstd; +extern bool feature_ech; CURLcode get_libcurl_info(void); const char *proto_token(const char *proto); diff --git a/deps/curl/src/tool_listhelp.c b/deps/curl/src/tool_listhelp.c index f2feb271..2d5f2b3a 100644 --- a/deps/curl/src/tool_listhelp.c +++ b/deps/curl/src/tool_listhelp.c @@ -45,14 +45,14 @@ const struct helptxt helptext[] = { {"-a, --append", "Append to target file when uploading", CURLHELP_FTP | CURLHELP_SFTP}, - {" --aws-sigv4 ", - "Use AWS V4 signature authentication", + {" --aws-sigv4 ", + "AWS V4 signature auth", CURLHELP_AUTH | CURLHELP_HTTP}, {" --basic", - "Use HTTP Basic Authentication", + "HTTP Basic Authentication", CURLHELP_AUTH}, {" --ca-native", - "Use CA certificates from the native OS", + "Load CA certs from the OS", CURLHELP_TLS}, {" --cacert ", "CA certificate to verify peer against", @@ -64,13 +64,13 @@ const struct helptxt helptext[] = { "Client certificate file and password", CURLHELP_TLS}, {" --cert-status", - "Verify the status of the server cert via OCSP-staple", + "Verify server cert status OCSP-staple", CURLHELP_TLS}, {" --cert-type ", "Certificate type (DER/PEM/ENG/P12)", CURLHELP_TLS}, - {" --ciphers ", - "SSL ciphers to use", + {" --ciphers ", + "TLS 1.2 (1.1, 1.0) ciphers to use", CURLHELP_TLS}, {" --compressed", "Request compressed response", @@ -81,24 +81,24 @@ const struct helptxt helptext[] = { {"-K, --config ", "Read config from a file", CURLHELP_CURL}, - {" --connect-timeout ", - "Maximum time allowed for connection", - CURLHELP_CONNECTION}, + {" --connect-timeout ", + "Maximum time allowed to connect", + CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, {" --connect-to ", - "Connect to host", - CURLHELP_CONNECTION}, + "Connect to host2 instead of host1", + CURLHELP_CONNECTION | CURLHELP_DNS}, {"-C, --continue-at ", "Resumed transfer offset", CURLHELP_CONNECTION}, {"-b, --cookie ", - "Send cookies from string/file", + "Send cookies from string/load from file", CURLHELP_HTTP}, {"-c, --cookie-jar ", - "Write cookies to after operation", + "Save cookies to after operation", CURLHELP_HTTP}, {" --create-dirs", "Create necessary local directory hierarchy", - CURLHELP_CURL}, + CURLHELP_OUTPUT}, {" --create-file-mode ", "File mode for created files", CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_FILE | CURLHELP_UPLOAD}, @@ -106,10 +106,10 @@ const struct helptxt helptext[] = { "Convert LF to CRLF in upload", CURLHELP_FTP | CURLHELP_SMTP}, {" --crlfile ", - "Use this CRL list", + "Certificate Revocation list", CURLHELP_TLS}, - {" --curves ", - "(EC) TLS key exchange algorithm(s) to request", + {" --curves ", + "(EC) TLS key exchange algorithms to request", CURLHELP_TLS}, {"-d, --data ", "HTTP POST data", @@ -130,7 +130,7 @@ const struct helptxt helptext[] = { "GSS-API delegation permission", CURLHELP_AUTH}, {" --digest", - "Use HTTP Digest Authentication", + "HTTP Digest Authentication", CURLHELP_PROXY | CURLHELP_AUTH | CURLHELP_HTTP}, {"-q, --disable", "Disable .curlrc", @@ -157,7 +157,7 @@ const struct helptxt helptext[] = { "DNS server addrs to use", CURLHELP_DNS}, {" --doh-cert-status", - "Verify the status of the DoH server cert via OCSP-staple", + "Verify DoH server cert status OCSP-staple", CURLHELP_DNS | CURLHELP_TLS}, {" --doh-insecure", "Allow insecure DoH server connections", @@ -165,30 +165,36 @@ const struct helptxt helptext[] = { {" --doh-url ", "Resolve hostnames over DoH", CURLHELP_DNS}, + {" --dump-ca-embed", + "Write the embedded CA bundle to standard output", + CURLHELP_HTTP | CURLHELP_PROXY | CURLHELP_TLS}, {"-D, --dump-header ", "Write the received headers to ", CURLHELP_HTTP | CURLHELP_FTP}, + {" --ech ", + "Configure ECH", + CURLHELP_TLS}, {" --egd-file ", "EGD socket path for random data", - CURLHELP_TLS}, + CURLHELP_DEPRECATED}, {" --engine ", "Crypto engine to use", CURLHELP_TLS}, {" --etag-compare ", - "Pass an ETag from a file as a custom header", + "Load ETag from file", CURLHELP_HTTP}, {" --etag-save ", - "Parse ETag from a request and save it to a file", + "Parse incoming ETag and save to a file", CURLHELP_HTTP}, {" --expect100-timeout ", "How long to wait for 100-continue", - CURLHELP_HTTP}, + CURLHELP_HTTP | CURLHELP_TIMEOUT}, {"-f, --fail", "Fail fast with no output on HTTP errors", CURLHELP_IMPORTANT | CURLHELP_HTTP}, {" --fail-early", - "Fail on first transfer error, do not continue", - CURLHELP_CURL}, + "Fail on first transfer error", + CURLHELP_CURL | CURLHELP_GLOBAL}, {" --fail-with-body", "Fail on HTTP errors but save the body", CURLHELP_HTTP | CURLHELP_OUTPUT}, @@ -197,13 +203,15 @@ const struct helptxt helptext[] = { CURLHELP_TLS}, {"-F, --form ", "Specify multipart MIME data", - CURLHELP_HTTP | CURLHELP_UPLOAD}, + CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST | CURLHELP_IMAP | + CURLHELP_SMTP}, {" --form-escape", - "Escape multipart form field/filenames using backslash", - CURLHELP_HTTP | CURLHELP_UPLOAD}, + "Escape form fields using backslash", + CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST}, {" --form-string ", "Specify multipart MIME data", - CURLHELP_HTTP | CURLHELP_UPLOAD}, + CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST | CURLHELP_SMTP | + CURLHELP_IMAP}, {" --ftp-account ", "Account data string", CURLHELP_FTP | CURLHELP_AUTH}, @@ -212,15 +220,15 @@ const struct helptxt helptext[] = { CURLHELP_FTP}, {" --ftp-create-dirs", "Create the remote dirs if not present", - CURLHELP_FTP | CURLHELP_SFTP | CURLHELP_CURL}, + CURLHELP_FTP | CURLHELP_SFTP}, {" --ftp-method ", "Control CWD usage", CURLHELP_FTP}, {" --ftp-pasv", - "Use PASV/EPSV instead of PORT", + "Send PASV/EPSV instead of PORT", CURLHELP_FTP}, {"-P, --ftp-port
", - "Use PORT instead of PASV", + "Send PORT instead of PASV", CURLHELP_FTP}, {" --ftp-pret", "Send PRET before PASV", @@ -235,19 +243,19 @@ const struct helptxt helptext[] = { "Set CCC mode", CURLHELP_FTP | CURLHELP_TLS}, {" --ftp-ssl-control", - "Require SSL/TLS for FTP login, clear for transfer", + "Require TLS for login, clear for transfer", CURLHELP_FTP | CURLHELP_TLS}, {"-G, --get", "Put the post data in the URL and use GET", - CURLHELP_HTTP | CURLHELP_UPLOAD}, + CURLHELP_HTTP}, {"-g, --globoff", - "Disable URL sequences and ranges using {} and []", + "Disable URL globbing with {} and []", CURLHELP_CURL}, - {" --happy-eyeballs-timeout-ms ", - "Time for IPv6 before trying IPv4", - CURLHELP_CONNECTION}, - {" --haproxy-clientip ", - "Sets client IP in HAProxy PROXY protocol v1 header", + {" --happy-eyeballs-timeout-ms ", + "Time for IPv6 before IPv4", + CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, + {" --haproxy-clientip ", + "Set address in HAProxy PROXY", CURLHELP_HTTP | CURLHELP_PROXY}, {" --haproxy-protocol", "Send HAProxy PROXY protocol v1 header", @@ -258,15 +266,15 @@ const struct helptxt helptext[] = { {"-H, --header
", "Pass custom header(s) to server", CURLHELP_HTTP | CURLHELP_IMAP | CURLHELP_SMTP}, - {"-h, --help ", + {"-h, --help ", "Get help for commands", CURLHELP_IMPORTANT | CURLHELP_CURL}, {" --hostpubmd5 ", - "Acceptable MD5 hash of the host public key", - CURLHELP_SFTP | CURLHELP_SCP}, + "Acceptable MD5 hash of host public key", + CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH}, {" --hostpubsha256 ", - "Acceptable SHA256 hash of the host public key", - CURLHELP_SFTP | CURLHELP_SCP}, + "Acceptable SHA256 hash of host public key", + CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH}, {" --hsts ", "Enable HSTS with this cache file", CURLHELP_HTTP}, @@ -294,18 +302,18 @@ const struct helptxt helptext[] = { {" --ignore-content-length", "Ignore the size of the remote resource", CURLHELP_HTTP | CURLHELP_FTP}, - {"-i, --include", - "Include protocol response headers in the output", - CURLHELP_IMPORTANT | CURLHELP_VERBOSE}, {"-k, --insecure", "Allow insecure server connections", - CURLHELP_TLS | CURLHELP_SFTP | CURLHELP_SCP}, + CURLHELP_TLS | CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH}, {" --interface ", - "Use network INTERFACE (or address)", + "Use network interface", + CURLHELP_CONNECTION}, + {" --ip-tos ", + "Set IP Type of Service or Traffic Class", CURLHELP_CONNECTION}, {" --ipfs-gateway ", "Gateway for IPFS", - CURLHELP_IPFS}, + CURLHELP_CURL}, {"-4, --ipv4", "Resolve names to IPv4 addresses", CURLHELP_CONNECTION | CURLHELP_DNS}, @@ -318,9 +326,12 @@ const struct helptxt helptext[] = { {"-j, --junk-session-cookies", "Ignore session cookies read from file", CURLHELP_HTTP}, + {" --keepalive-cnt ", + "Maximum number of keepalive probes", + CURLHELP_CONNECTION}, {" --keepalive-time ", "Interval time for keepalive probes", - CURLHELP_CONNECTION}, + CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, {" --key ", "Private key filename", CURLHELP_TLS | CURLHELP_SSH}, @@ -331,26 +342,27 @@ const struct helptxt helptext[] = { "Enable Kerberos with security ", CURLHELP_FTP}, {" --libcurl ", - "Dump libcurl equivalent code of this command line", - CURLHELP_CURL}, + "Generate libcurl code for this command line", + CURLHELP_CURL | CURLHELP_GLOBAL}, {" --limit-rate ", "Limit transfer speed to RATE", CURLHELP_CONNECTION}, {"-l, --list-only", "List only mode", - CURLHELP_FTP | CURLHELP_POP3 | CURLHELP_SFTP}, - {" --local-port ", - "Force use of RANGE for local port numbers", + CURLHELP_FTP | CURLHELP_POP3 | CURLHELP_SFTP | CURLHELP_FILE}, + {" --local-port ", + "Use a local port number within RANGE", CURLHELP_CONNECTION}, {"-L, --location", "Follow redirects", CURLHELP_HTTP}, {" --location-trusted", - "Like --location, and send auth to other hosts", + "As --location, but send secrets to other hosts", CURLHELP_HTTP | CURLHELP_AUTH}, {" --login-options ", "Server login options", - CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | CURLHELP_AUTH}, + CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | CURLHELP_AUTH | + CURLHELP_LDAP}, {" --mail-auth
", "Originator address of the original email", CURLHELP_SMTP}, @@ -361,7 +373,7 @@ const struct helptxt helptext[] = { "Mail to this address", CURLHELP_SMTP}, {" --mail-rcpt-allowfails", - "Allow RCPT TO command to fail for some recipients", + "Allow RCPT TO command to fail", CURLHELP_SMTP}, {"-M, --manual", "Display the full manual", @@ -372,42 +384,45 @@ const struct helptxt helptext[] = { {" --max-redirs ", "Maximum number of redirects allowed", CURLHELP_HTTP}, - {"-m, --max-time ", + {"-m, --max-time ", "Maximum time allowed for transfer", - CURLHELP_CONNECTION}, + CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, {" --metalink", "Process given URLs as metalink XML file", - CURLHELP_MISC}, + CURLHELP_DEPRECATED}, + {" --mptcp", + "Enable Multipath TCP", + CURLHELP_CONNECTION}, {" --negotiate", "Use HTTP Negotiate (SPNEGO) authentication", CURLHELP_AUTH | CURLHELP_HTTP}, {"-n, --netrc", "Must read .netrc for username and password", - CURLHELP_CURL}, + CURLHELP_AUTH}, {" --netrc-file ", "Specify FILE for netrc", - CURLHELP_CURL}, + CURLHELP_AUTH}, {" --netrc-optional", "Use either .netrc or URL", - CURLHELP_CURL}, + CURLHELP_AUTH}, {"-:, --next", - "Make next URL use its separate set of options", + "Make next URL use separate options", CURLHELP_CURL}, {" --no-alpn", "Disable the ALPN TLS extension", CURLHELP_TLS | CURLHELP_HTTP}, {"-N, --no-buffer", "Disable buffering of the output stream", - CURLHELP_CURL}, + CURLHELP_OUTPUT}, {" --no-clobber", "Do not overwrite files that already exist", - CURLHELP_CURL | CURLHELP_OUTPUT}, + CURLHELP_OUTPUT}, {" --no-keepalive", "Disable TCP keepalive on the connection", CURLHELP_CONNECTION}, {" --no-npn", "Disable the NPN TLS extension", - CURLHELP_TLS | CURLHELP_HTTP}, + CURLHELP_DEPRECATED}, {" --no-progress-meter", "Do not show the progress meter", CURLHELP_VERBOSE}, @@ -418,53 +433,54 @@ const struct helptxt helptext[] = { "List of hosts which do not use proxy", CURLHELP_PROXY}, {" --ntlm", - "Use HTTP NTLM authentication", + "HTTP NTLM authentication", CURLHELP_AUTH | CURLHELP_HTTP}, {" --ntlm-wb", - "Use HTTP NTLM authentication with winbind", - CURLHELP_AUTH | CURLHELP_HTTP}, + "HTTP NTLM authentication with winbind", + CURLHELP_DEPRECATED}, {" --oauth2-bearer ", "OAuth 2 Bearer Token", - CURLHELP_AUTH}, + CURLHELP_AUTH | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | + CURLHELP_LDAP}, {"-o, --output ", "Write to file instead of stdout", - CURLHELP_IMPORTANT | CURLHELP_CURL}, + CURLHELP_IMPORTANT | CURLHELP_OUTPUT}, {" --output-dir ", "Directory to save files in", - CURLHELP_CURL}, + CURLHELP_OUTPUT}, {"-Z, --parallel", "Perform transfers in parallel", - CURLHELP_CONNECTION | CURLHELP_CURL}, + CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, {" --parallel-immediate", - "Do not wait for multiplexing (with --parallel)", - CURLHELP_CONNECTION | CURLHELP_CURL}, + "Do not wait for multiplexing", + CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, {" --parallel-max ", "Maximum concurrency for parallel transfers", - CURLHELP_CONNECTION | CURLHELP_CURL}, + CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL}, {" --pass ", - "Pass phrase for the private key", + "Passphrase for the private key", CURLHELP_SSH | CURLHELP_TLS | CURLHELP_AUTH}, {" --path-as-is", "Do not squash .. sequences in URL path", CURLHELP_CURL}, {" --pinnedpubkey ", - "FILE/HASHES Public key to verify peer against", + "Public key to verify peer against", CURLHELP_TLS}, {" --post301", - "Do not switch to GET after following a 301", + "Do not switch to GET after a 301 redirect", CURLHELP_HTTP | CURLHELP_POST}, {" --post302", - "Do not switch to GET after following a 302", + "Do not switch to GET after a 302 redirect", CURLHELP_HTTP | CURLHELP_POST}, {" --post303", - "Do not switch to GET after following a 303", + "Do not switch to GET after a 303 redirect", CURLHELP_HTTP | CURLHELP_POST}, {" --preproxy [protocol://]host[:port]", "Use this proxy first", CURLHELP_PROXY}, {"-#, --progress-bar", "Display transfer progress as a bar", - CURLHELP_VERBOSE}, + CURLHELP_VERBOSE | CURLHELP_GLOBAL}, {" --proto ", "Enable/disable PROTOCOLS", CURLHELP_CONNECTION | CURLHELP_CURL}, @@ -484,13 +500,13 @@ const struct helptxt helptext[] = { "Use Basic authentication on the proxy", CURLHELP_PROXY | CURLHELP_AUTH}, {" --proxy-ca-native", - "Use CA certificates from the native OS for proxy", + "Load CA certs from the OS to verify proxy", CURLHELP_TLS}, {" --proxy-cacert ", - "CA certificate to verify peer against for proxy", + "CA certificates to verify proxy against", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-capath ", - "CA directory to verify peer against for proxy", + "CA directory to verify proxy against", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-cert ", "Set client certificate for proxy", @@ -499,13 +515,13 @@ const struct helptxt helptext[] = { "Client certificate type for HTTPS proxy", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-ciphers ", - "SSL ciphers to use for proxy", + "TLS 1.2 (1.1, 1.0) ciphers to use for proxy", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-crlfile ", "Set a CRL list for proxy", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-digest", - "Use Digest authentication on the proxy", + "Digest auth with the proxy", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-header
", "Pass custom header(s) to proxy", @@ -514,7 +530,7 @@ const struct helptxt helptext[] = { "Use HTTP/2 with HTTPS proxy", CURLHELP_HTTP | CURLHELP_PROXY}, {" --proxy-insecure", - "Do HTTPS proxy connections without verifying the proxy", + "Skip HTTPS proxy cert verification", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-key ", "Private key for HTTPS proxy", @@ -523,13 +539,13 @@ const struct helptxt helptext[] = { "Private key file type for proxy", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-negotiate", - "Use HTTP Negotiate (SPNEGO) authentication on the proxy", + "HTTP Negotiate (SPNEGO) auth with the proxy", CURLHELP_PROXY | CURLHELP_AUTH}, {" --proxy-ntlm", - "Use NTLM authentication on the proxy", + "NTLM authentication with the proxy", CURLHELP_PROXY | CURLHELP_AUTH}, {" --proxy-pass ", - "Pass phrase for the private key for HTTPS proxy", + "Passphrase for private key for HTTPS proxy", CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, {" --proxy-pinnedpubkey ", "FILE/HASHES public key to verify proxy with", @@ -538,12 +554,12 @@ const struct helptxt helptext[] = { "SPNEGO proxy service name", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-ssl-allow-beast", - "Allow security flaw for interop for HTTPS proxy", + "Allow this security flaw for HTTPS proxy", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-ssl-auto-client-cert", - "Use auto client certificate for proxy (Schannel)", + "Auto client certificate for proxy", CURLHELP_PROXY | CURLHELP_TLS}, - {" --proxy-tls13-ciphers ", + {" --proxy-tls13-ciphers ", "TLS 1.3 proxy cipher suites", CURLHELP_PROXY | CURLHELP_TLS}, {" --proxy-tlsauthtype ", @@ -556,7 +572,7 @@ const struct helptxt helptext[] = { "TLS username for HTTPS proxy", CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, {" --proxy-tlsv1", - "Use TLSv1 for HTTPS proxy", + "TLSv1 for HTTPS proxy", CURLHELP_PROXY | CURLHELP_TLS | CURLHELP_AUTH}, {"-U, --proxy-user ", "Proxy user and password", @@ -565,23 +581,23 @@ const struct helptxt helptext[] = { "Use HTTP/1.0 proxy on given port", CURLHELP_PROXY}, {"-p, --proxytunnel", - "Operate through an HTTP proxy tunnel (using CONNECT)", + "HTTP proxy tunnel (using CONNECT)", CURLHELP_PROXY}, {" --pubkey ", "SSH Public key filename", - CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_AUTH}, + CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH | CURLHELP_AUTH}, {"-Q, --quote ", "Send command(s) to server before transfer", CURLHELP_FTP | CURLHELP_SFTP}, {" --random-file ", "File for reading random data from", - CURLHELP_MISC}, + CURLHELP_DEPRECATED}, {"-r, --range ", "Retrieve only the bytes within RANGE", CURLHELP_HTTP | CURLHELP_FTP | CURLHELP_SFTP | CURLHELP_FILE}, {" --rate ", "Request rate for serial transfers", - CURLHELP_CONNECTION}, + CURLHELP_CONNECTION | CURLHELP_GLOBAL}, {" --raw", "Do HTTP raw; no transfer decoding", CURLHELP_HTTP}, @@ -592,56 +608,63 @@ const struct helptxt helptext[] = { "Use the header-provided filename", CURLHELP_OUTPUT}, {"-O, --remote-name", - "Write output to a file named as the remote file", + "Write output to file named as remote file", CURLHELP_IMPORTANT | CURLHELP_OUTPUT}, {" --remote-name-all", "Use the remote filename for all URLs", CURLHELP_OUTPUT}, {"-R, --remote-time", - "Set the remote file's time on the local output", + "Set remote file's time on local output", CURLHELP_OUTPUT}, {" --remove-on-error", "Remove output file on errors", - CURLHELP_CURL}, + CURLHELP_OUTPUT}, {"-X, --request ", "Specify request method to use", - CURLHELP_CONNECTION}, + CURLHELP_CONNECTION | CURLHELP_POP3 | CURLHELP_FTP | CURLHELP_IMAP | + CURLHELP_SMTP}, {" --request-target ", "Specify the target for this request", CURLHELP_HTTP}, {" --resolve <[+]host:port:addr[,addr]...>", - "Resolve the host+port to this address", + "Resolve host+port to address", CURLHELP_CONNECTION | CURLHELP_DNS}, {" --retry ", "Retry request if transient problems occur", CURLHELP_CURL}, {" --retry-all-errors", - "Retry all errors (use with --retry)", + "Retry all errors (with --retry)", CURLHELP_CURL}, {" --retry-connrefused", - "Retry on connection refused (use with --retry)", + "Retry on connection refused (with --retry)", CURLHELP_CURL}, {" --retry-delay ", "Wait time between retries", - CURLHELP_CURL}, + CURLHELP_CURL | CURLHELP_TIMEOUT}, {" --retry-max-time ", "Retry only within this period", - CURLHELP_CURL}, + CURLHELP_CURL | CURLHELP_TIMEOUT}, {" --sasl-authzid ", "Identity for SASL PLAIN authentication", CURLHELP_AUTH}, {" --sasl-ir", - "Enable initial response in SASL authentication", + "Initial response in SASL authentication", CURLHELP_AUTH}, {" --service-name ", "SPNEGO service name", - CURLHELP_MISC}, + CURLHELP_AUTH}, {"-S, --show-error", "Show error even when -s is used", - CURLHELP_CURL}, + CURLHELP_CURL | CURLHELP_GLOBAL}, + {"-i, --show-headers", + "Show response headers in output", + CURLHELP_IMPORTANT | CURLHELP_VERBOSE | CURLHELP_OUTPUT}, {"-s, --silent", "Silent mode", CURLHELP_IMPORTANT | CURLHELP_VERBOSE}, + {" --skip-existing", + "Skip download if local file already exists", + CURLHELP_CURL | CURLHELP_OUTPUT}, {" --socks4 ", "SOCKS4 proxy on given host + port", CURLHELP_PROXY}, @@ -652,7 +675,7 @@ const struct helptxt helptext[] = { "SOCKS5 proxy on given host + port", CURLHELP_PROXY}, {" --socks5-basic", - "Enable username/password auth for SOCKS5 proxies", + "Username/password auth for SOCKS5 proxies", CURLHELP_PROXY | CURLHELP_AUTH}, {" --socks5-gssapi", "Enable GSS-API auth for SOCKS5 proxies", @@ -671,10 +694,11 @@ const struct helptxt helptext[] = { CURLHELP_CONNECTION}, {"-y, --speed-time ", "Trigger 'speed-limit' abort after this time", - CURLHELP_CONNECTION}, + CURLHELP_CONNECTION | CURLHELP_TIMEOUT}, {" --ssl", - "Try SSL/TLS", - CURLHELP_TLS}, + "Try enabling TLS", + CURLHELP_TLS | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | + CURLHELP_LDAP}, {" --ssl-allow-beast", "Allow security flaw to improve interop", CURLHELP_TLS}, @@ -686,22 +710,23 @@ const struct helptxt helptext[] = { CURLHELP_TLS}, {" --ssl-reqd", "Require SSL/TLS", - CURLHELP_TLS}, + CURLHELP_TLS | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | + CURLHELP_LDAP}, {" --ssl-revoke-best-effort", - "Ignore missing/offline cert CRL dist points (Schannel)", + "Ignore missing cert CRL dist points", CURLHELP_TLS}, {"-2, --sslv2", - "Use SSLv2", - CURLHELP_TLS}, + "SSLv2", + CURLHELP_DEPRECATED}, {"-3, --sslv3", - "Use SSLv3", - CURLHELP_TLS}, + "SSLv3", + CURLHELP_DEPRECATED}, {" --stderr ", "Where to redirect stderr", - CURLHELP_VERBOSE}, + CURLHELP_VERBOSE | CURLHELP_GLOBAL}, {" --styled-output", "Enable styled output for HTTP headers", - CURLHELP_VERBOSE}, + CURLHELP_VERBOSE | CURLHELP_GLOBAL}, {" --suppress-connect-headers", "Suppress proxy CONNECT response headers", CURLHELP_PROXY}, @@ -709,7 +734,7 @@ const struct helptxt helptext[] = { "Use TCP Fast Open", CURLHELP_CONNECTION}, {" --tcp-nodelay", - "Use the TCP_NODELAY option", + "Set TCP_NODELAY", CURLHELP_CONNECTION}, {"-t, --telnet-option ", "Set telnet option", @@ -723,10 +748,13 @@ const struct helptxt helptext[] = { {"-z, --time-cond --g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface ::1 +-g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface %CLIENT6IP-NB -# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out - -perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );" - # diff --git a/deps/curl/tests/data/test1047 b/deps/curl/tests/data/test1047 index d54a8494..b7d17275 100644 --- a/deps/curl/tests/data/test1047 +++ b/deps/curl/tests/data/test1047 @@ -11,9 +11,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -45,6 +43,9 @@ ftp://%HOSTIP:%FTPPORT/ --interface %CLIENTIP # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1048 b/deps/curl/tests/data/test1048 index 56f19c4a..5aed75a3 100644 --- a/deps/curl/tests/data/test1048 +++ b/deps/curl/tests/data/test1048 @@ -13,9 +13,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -27,14 +25,14 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # # Client-side -ipv6 +IPv6 ftp-ipv6 @@ -43,17 +41,16 @@ ftp-ipv6 FTP-IPv6 dir list PASV with localhost --interface --g "ftp://%HOST6IP:%FTP6PORT/" --interface ::1 +-g "ftp://%HOST6IP:%FTP6PORT/" --interface %CLIENT6IP-NB -# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out - -perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );" - # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test105 b/deps/curl/tests/data/test105 index 2a26ac7e..7f305299 100644 --- a/deps/curl/tests/data/test105 +++ b/deps/curl/tests/data/test105 @@ -37,6 +37,9 @@ ftp://userdude:passfellow@%HOSTIP:%FTPPORT/%TESTNUMBER --use-ascii # Verify data after the test has been "shot" + +QUIT + USER userdude PASS passfellow diff --git a/deps/curl/tests/data/test1050 b/deps/curl/tests/data/test1050 index ff179c63..0f8267f9 100644 --- a/deps/curl/tests/data/test1050 +++ b/deps/curl/tests/data/test1050 @@ -2,6 +2,7 @@ # Similar to test 253 +FTP FTP-ipv6 IPv6 EPRT @@ -10,9 +11,7 @@ EPRT # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,13 +23,13 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # Client-side -ipv6 +IPv6 ftp-ipv6 @@ -39,16 +38,15 @@ ftp-ipv6 FTP-IPv6 dir list, EPRT with specified IP --g "ftp://%HOST6IP:%FTP6PORT/" -P ::1 +-g "ftp://%HOST6IP:%FTP6PORT/" -P %CLIENT6IP-NB -# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out - -perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );" - # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of EPRT that curl can send s/^(EPRT \|2\|::1\|)(.*)/$1/ diff --git a/deps/curl/tests/data/test1055 b/deps/curl/tests/data/test1055 index 2d1c604b..0624a969 100644 --- a/deps/curl/tests/data/test1055 +++ b/deps/curl/tests/data/test1055 @@ -54,6 +54,9 @@ the # # Verify data after the test has been "shot" + +QUIT + PUT /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/deps/curl/tests/data/test1056 b/deps/curl/tests/data/test1056 index 40879662..7ecc3498 100644 --- a/deps/curl/tests/data/test1056 +++ b/deps/curl/tests/data/test1056 @@ -48,7 +48,7 @@ body # test there. This feature doesn't work on msys or Cygwin, so use a precheck # to skip those. -ipv6 +IPv6 !win32 @@ -62,7 +62,7 @@ HTTP follow redirect from IPv4 to IPv6 with scope http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L -perl -e "print 'Test is not supported on the Windows kernel' if ($^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin');" +%PERL -e "print 'Test is not supported on the Windows kernel' if ($^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin');" diff --git a/deps/curl/tests/data/test1057 b/deps/curl/tests/data/test1057 index a7cb3bc6..e211dd7d 100644 --- a/deps/curl/tests/data/test1057 +++ b/deps/curl/tests/data/test1057 @@ -36,6 +36,9 @@ FTP retrieve a byte-range relative to end of file # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test106 b/deps/curl/tests/data/test106 index b5e1e692..2fec6347 100644 --- a/deps/curl/tests/data/test106 +++ b/deps/curl/tests/data/test106 @@ -35,6 +35,9 @@ FTP GET with type=A style ASCII URL using %20 codes # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1062 b/deps/curl/tests/data/test1062 index 31a27a94..36b726af 100644 --- a/deps/curl/tests/data/test1062 +++ b/deps/curl/tests/data/test1062 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1063 b/deps/curl/tests/data/test1063 index fcbc4b88..449263ef 100644 --- a/deps/curl/tests/data/test1063 +++ b/deps/curl/tests/data/test1063 @@ -20,7 +20,7 @@ none file -large_file +Largefile Invalid large X- range on a file:// diff --git a/deps/curl/tests/data/test107 b/deps/curl/tests/data/test107 index a741b766..a92a635f 100644 --- a/deps/curl/tests/data/test107 +++ b/deps/curl/tests/data/test107 @@ -30,6 +30,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt # Verify data after the test has been "shot" + +QUIT + data to diff --git a/deps/curl/tests/data/test108 b/deps/curl/tests/data/test108 index 20ef6577..ceea4d4b 100644 --- a/deps/curl/tests/data/test108 +++ b/deps/curl/tests/data/test108 @@ -31,6 +31,9 @@ Moooooooooooo # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1082 b/deps/curl/tests/data/test1082 index 606df1c8..7d26323a 100644 --- a/deps/curl/tests/data/test1082 +++ b/deps/curl/tests/data/test1082 @@ -35,7 +35,7 @@ HTTP GET with localhost --interface http://%HOSTIP:%HTTPPORT/%TESTNUMBER -4 --interface 127.0.0.1 -perl -e "print 'Test requires default test client host address' if ( '%CLIENTIP' ne '127.0.0.1' );" +%PERL -e "print 'Test requires default test client host address' if ( '%CLIENTIP' ne '127.0.0.1' );" diff --git a/deps/curl/tests/data/test1083 b/deps/curl/tests/data/test1083 index 8728d618..b82e308f 100644 --- a/deps/curl/tests/data/test1083 +++ b/deps/curl/tests/data/test1083 @@ -27,7 +27,7 @@ Content-Type: text/plain # Client-side -ipv6 +IPv6 http-ipv6 @@ -39,7 +39,7 @@ HTTP-IPv6 GET with ip6-localhost --interface -g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface ip6-localhost -perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test client host address';} else {exec './server/resolve --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}" +%PERL -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test client host address';} else {exec './server/resolve --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}" diff --git a/deps/curl/tests/data/test1085 b/deps/curl/tests/data/test1085 index b63b0f03..55eb00e0 100644 --- a/deps/curl/tests/data/test1085 +++ b/deps/curl/tests/data/test1085 @@ -20,7 +20,7 @@ non-existing host http -ipv6 +IPv6 none diff --git a/deps/curl/tests/data/test1086 b/deps/curl/tests/data/test1086 index 0b4b875d..ae5e7a09 100644 --- a/deps/curl/tests/data/test1086 +++ b/deps/curl/tests/data/test1086 @@ -6,7 +6,7 @@ EPSV RETR timeout FAILURE -SLOWDOWN +SLOWDOWNDATA flaky timing-dependent @@ -14,10 +14,8 @@ timing-dependent # Server-side -# Overload some standard FTP responses to make them shorter and faster -# to avoid wasting time waiting for the data phase to start -SLOWDOWN +SLOWDOWNDATA REPLY welcome 220 Hey REPLY USER 331 OK REPLY PASS 230 OK @@ -90,7 +88,7 @@ ftp FTP download with strict timeout and slow data transfer -ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -m 7 +ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -m 5 diff --git a/deps/curl/tests/data/test109 b/deps/curl/tests/data/test109 index d466437f..63d1bc6b 100644 --- a/deps/curl/tests/data/test109 +++ b/deps/curl/tests/data/test109 @@ -31,6 +31,9 @@ Moooooooooooo # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1091 b/deps/curl/tests/data/test1091 index 445d3165..b5006c6b 100644 --- a/deps/curl/tests/data/test1091 +++ b/deps/curl/tests/data/test1091 @@ -30,6 +30,9 @@ FTP URL with type=i # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1096 b/deps/curl/tests/data/test1096 index e7b16392..f8eb1d4f 100644 --- a/deps/curl/tests/data/test1096 +++ b/deps/curl/tests/data/test1096 @@ -30,6 +30,9 @@ ftp://%HOSTIP:%FTPPORT/dir/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/dir/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + 78 diff --git a/deps/curl/tests/data/test110 b/deps/curl/tests/data/test110 index e53fcd13..c3c3d04b 100644 --- a/deps/curl/tests/data/test110 +++ b/deps/curl/tests/data/test110 @@ -36,6 +36,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C 20 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1100 b/deps/curl/tests/data/test1100 index 1148a79f..13eaeb31 100644 --- a/deps/curl/tests/data/test1100 +++ b/deps/curl/tests/data/test1100 @@ -65,7 +65,7 @@ This is the final page ! NTLM SSL !SSPI -debug +Debug http @@ -73,18 +73,9 @@ http HTTP POST with NTLM authorization and following a 302 redirect - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -L -d "stuff to send away" - -chkhostname curlhost - # Verify data after the test has been "shot" diff --git a/deps/curl/tests/data/test1102 b/deps/curl/tests/data/test1102 index 16994d95..12822b95 100644 --- a/deps/curl/tests/data/test1102 +++ b/deps/curl/tests/data/test1102 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1103 b/deps/curl/tests/data/test1103 index a53b504b..2ceb89de 100644 --- a/deps/curl/tests/data/test1103 +++ b/deps/curl/tests/data/test1103 @@ -33,6 +33,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1105 b/deps/curl/tests/data/test1105 index afe621bb..68922dc7 100644 --- a/deps/curl/tests/data/test1105 +++ b/deps/curl/tests/data/test1105 @@ -37,11 +37,9 @@ 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" - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - cookies +local-http diff --git a/deps/curl/tests/data/test1107 b/deps/curl/tests/data/test1107 index 8b31c76f..de8b7d76 100644 --- a/deps/curl/tests/data/test1107 +++ b/deps/curl/tests/data/test1107 @@ -38,6 +38,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-pret # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test111 b/deps/curl/tests/data/test111 index a46f7aef..a7cd3c3d 100644 --- a/deps/curl/tests/data/test111 +++ b/deps/curl/tests/data/test111 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C 2000 # Verify data after the test has been "shot" + +QUIT + 36 diff --git a/deps/curl/tests/data/test1112 b/deps/curl/tests/data/test1112 index b0a61066..5e03509b 100644 --- a/deps/curl/tests/data/test1112 +++ b/deps/curl/tests/data/test1112 @@ -7,17 +7,15 @@ EPSV RETR timeout FAILURE -SLOWDOWN +SLOWDOWNDATA timing-dependent # Server-side -# Overload some standard FTP responses to make them shorter and faster -# to avoid wasting time waiting for the data phase to start -SLOWDOWN +SLOWDOWNDATA REPLY welcome 220 Hey REPLY USER 331 OK REPLY PASS 230 OK @@ -93,7 +91,7 @@ ftps FTPS download with strict timeout and slow data transfer --k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/%TESTNUMBER -m 16 +-k --ftp-ssl-control ftps://%HOSTIP:%FTPSPORT/%TESTNUMBER -m 5 diff --git a/deps/curl/tests/data/test1113 b/deps/curl/tests/data/test1113 index 8d10975e..c0e1230c 100644 --- a/deps/curl/tests/data/test1113 +++ b/deps/curl/tests/data/test1113 @@ -36,6 +36,9 @@ FTP wildcard download - changed fnmatch, 2x perform (DOS LIST response) ############################################ # Verify data after the test has been "shot" + +QUIT + 0 diff --git a/deps/curl/tests/data/test112 b/deps/curl/tests/data/test112 index 41bbc025..231f3452 100644 --- a/deps/curl/tests/data/test112 +++ b/deps/curl/tests/data/test112 @@ -31,6 +31,9 @@ worx? # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1135 b/deps/curl/tests/data/test1135 index de028a0c..e1e74752 100644 --- a/deps/curl/tests/data/test1135 +++ b/deps/curl/tests/data/test1135 @@ -109,6 +109,7 @@ curl_multi_assign curl_multi_get_handles curl_pushheader_bynum curl_pushheader_byname +curl_multi_waitfds curl_easy_option_by_name curl_easy_option_by_id curl_easy_option_next diff --git a/deps/curl/tests/data/test1137 b/deps/curl/tests/data/test1137 index cb20aee3..4e8f24f0 100644 --- a/deps/curl/tests/data/test1137 +++ b/deps/curl/tests/data/test1137 @@ -38,6 +38,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ignore-content-length # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1140 b/deps/curl/tests/data/test1140 index aec680ce..2e4d8daf 100644 --- a/deps/curl/tests/data/test1140 +++ b/deps/curl/tests/data/test1140 @@ -19,7 +19,7 @@ Verify the nroff of manpages -%SRCDIR/test1140.pl %PWD/../docs/ %PWD/../docs/libcurl/*.3 %PWD/../docs/libcurl/opts/*.3 %PWD/../docs/*.1 +%SRCDIR/test1140.pl %PWD/../docs/ %PWD/../docs/libcurl/*.3 %PWD/../docs/libcurl/opts/*.3 %PWD/../docs/*.1 %PWD/../docs/cmdline-opts/*.1 diff --git a/deps/curl/tests/data/test1145 b/deps/curl/tests/data/test1145 index 570197ee..1a02c031 100644 --- a/deps/curl/tests/data/test1145 +++ b/deps/curl/tests/data/test1145 @@ -18,6 +18,8 @@ file:// bad host # This command should not succeed since we only accept # file:/// file://localhost/ file://127.0.0.1/ +# Pass %PWD instead of %FILE_PWD to trigger the expected +# error code with native Windows curl. file://bad-host%PWD/%LOGDIR/test%TESTNUMBER.txt diff --git a/deps/curl/tests/data/test1149 b/deps/curl/tests/data/test1149 index 7686ef10..4b3ba376 100644 --- a/deps/curl/tests/data/test1149 +++ b/deps/curl/tests/data/test1149 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -44,6 +42,9 @@ ftp://%HOSTIP:%FTPPORT/list/this/path/%TESTNUMBER/ --ftp-method multicwd --next # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test115 b/deps/curl/tests/data/test115 index 22f75c0b..e4da7ea1 100644 --- a/deps/curl/tests/data/test115 +++ b/deps/curl/tests/data/test115 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + 13 diff --git a/deps/curl/tests/data/test1152 b/deps/curl/tests/data/test1152 index 490fde3b..6052b70b 100644 --- a/deps/curl/tests/data/test1152 +++ b/deps/curl/tests/data/test1152 @@ -13,8 +13,6 @@ LIST REPLY PWD 257 "just one -# When doing LIST, we get the default list output hard-coded in the test -# FTP server total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . @@ -47,6 +45,9 @@ ftp://%HOSTIP:%FTPPORT/test-%TESTNUMBER/ # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1153 b/deps/curl/tests/data/test1153 index 36c76693..56ed8400 100644 --- a/deps/curl/tests/data/test1153 +++ b/deps/curl/tests/data/test1153 @@ -13,8 +13,6 @@ LIST REPLY PWD 257 "/""hello""" -# When doing LIST, we get the default list output hard-coded in the test -# FTP server total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . @@ -47,6 +45,9 @@ ftp://%HOSTIP:%FTPPORT/test-%TESTNUMBER/ # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1158 b/deps/curl/tests/data/test1158 index 1a29bd84..f3cce449 100644 --- a/deps/curl/tests/data/test1158 +++ b/deps/curl/tests/data/test1158 @@ -32,7 +32,7 @@ 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"' -perl -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');" +%PERL -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');" # We create this file before the command is invoked! diff --git a/deps/curl/tests/data/test116 b/deps/curl/tests/data/test116 index 37aed2ce..cab67ad5 100644 --- a/deps/curl/tests/data/test116 +++ b/deps/curl/tests/data/test116 @@ -23,7 +23,7 @@ ftp # EPRT is only sent when IPv6 is enabled -ipv6 +IPv6 FTP download, failed PORT @@ -35,6 +35,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P 1.2.3.4 # Verify data after the test has been "shot" + +QUIT + 30 diff --git a/deps/curl/tests/data/test1162 b/deps/curl/tests/data/test1162 index b6b39413..5aa706b7 100644 --- a/deps/curl/tests/data/test1162 +++ b/deps/curl/tests/data/test1162 @@ -37,6 +37,9 @@ MSYS2_ARG_CONV_EXCL=ftp:// + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1163 b/deps/curl/tests/data/test1163 index a109b511..09ede0cb 100644 --- a/deps/curl/tests/data/test1163 +++ b/deps/curl/tests/data/test1163 @@ -33,6 +33,9 @@ FTP wildcard with pattern ending with an open-bracket + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test117 b/deps/curl/tests/data/test117 index 3bd5cb57..c292af73 100644 --- a/deps/curl/tests/data/test117 +++ b/deps/curl/tests/data/test117 @@ -28,6 +28,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + 17 diff --git a/deps/curl/tests/data/test1173 b/deps/curl/tests/data/test1173 index 97d338df..89b0cb5a 100644 --- a/deps/curl/tests/data/test1173 +++ b/deps/curl/tests/data/test1173 @@ -15,11 +15,11 @@ none -Man page syntax checks +Manpage syntax checks -%SRCDIR/test1173.pl %SRCDIR/../docs/libcurl/symbols-in-versions %PWD/../docs/*.1 %PWD/../docs/libcurl/*.3 %PWD/../docs/libcurl/opts/*.3 +%SRCDIR/test1173.pl %SRCDIR/../docs/libcurl/symbols-in-versions %PWD/../docs/*.1 %PWD/../docs/cmdline-opts/*.1 %PWD/../docs/libcurl/*.3 %PWD/../docs/libcurl/opts/*.3 diff --git a/deps/curl/tests/data/test118 b/deps/curl/tests/data/test118 index 9b5b8708..de701214 100644 --- a/deps/curl/tests/data/test118 +++ b/deps/curl/tests/data/test118 @@ -31,6 +31,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + 19 diff --git a/deps/curl/tests/data/test1182 b/deps/curl/tests/data/test1182 index d1b8fb07..118b967b 100644 --- a/deps/curl/tests/data/test1182 +++ b/deps/curl/tests/data/test1182 @@ -21,16 +21,15 @@ Verify that runtests.pl accepts an exclude file with the -E option mkdir %LOGDIR/data ; mkdir %LOGDIR/log; cp %SRCDIR/data/test1 %LOGDIR/data; echo 'test:1:Test should not run for unit test %TESTNUMBER' > %LOGDIR/test%TESTNUMBER-exclude-file - -grep -q "Test should not run for unit test %TESTNUMBER" %LOGDIR/stdout%TESTNUMBER - - 1 + +grep -q "Test should not run for unit test %TESTNUMBER" %LOGDIR/stdout%TESTNUMBER + diff --git a/deps/curl/tests/data/test1185 b/deps/curl/tests/data/test1185 index 94c3be10..c3133aa2 100644 --- a/deps/curl/tests/data/test1185 +++ b/deps/curl/tests/data/test1185 @@ -72,10 +72,12 @@ void startfunc(int a, int b) { int a = sizeof int; int a = snprintf(buffer, sizeof(buffer), "%d", 99); + int moo = hej?wrong:a>b; + int moo2 = wrong2:(a)>(b); if(a) b++; - // CPP comment? + // CPP comment ? /* comment doesn't end @@ -163,11 +165,35 @@ void startfunc(int a, int b) { ./%LOGDIR/code1185.c:53:10: warning: use of snprintf is banned (SNPRINTF) int a = snprintf(buffer, sizeof(buffer), "%d", 99); ^ -./%LOGDIR/code1185.c:55:7: warning: conditional block on the same line (ONELINECONDITION) +./%LOGDIR/code1185.c:54:21: warning: missing space before colon (NOSPACEC) + int moo = hej?wrong:a>b; + ^ +./%LOGDIR/code1185.c:54: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) + int moo = hej?wrong:a>b; + ^ +./%LOGDIR/code1185.c:54: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) + int moo = hej?wrong:a>b; + ^ +./%LOGDIR/code1185.c:54: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) + int moo2 = wrong2:(a)>(b); + ^ +./%LOGDIR/code1185.c:55: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) if(a) b++; ^ -./%LOGDIR/code1185.c:57:2: warning: // comment (CPPCOMMENTS) - // CPP comment? +./%LOGDIR/code1185.c:59:2: warning: // comment (CPPCOMMENTS) + // CPP comment ? ^ ./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT) @@ -175,7 +201,7 @@ void startfunc(int a, int b) { ./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT) ^ -checksrc: 0 errors and 30 warnings +checksrc: 0 errors and 38 warnings 5 diff --git a/deps/curl/tests/data/test1186 b/deps/curl/tests/data/test1186 index 35be0e10..5e528dc4 100644 --- a/deps/curl/tests/data/test1186 +++ b/deps/curl/tests/data/test1186 @@ -32,7 +32,7 @@ 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"' -perl -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');" +%PERL -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');" # We create this file before the command is invoked! diff --git a/deps/curl/tests/data/test119 b/deps/curl/tests/data/test119 index 4426def0..2b36051f 100644 --- a/deps/curl/tests/data/test119 +++ b/deps/curl/tests/data/test119 @@ -30,6 +30,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P - # Verify data after the test has been "shot" + +QUIT + 19 diff --git a/deps/curl/tests/data/test120 b/deps/curl/tests/data/test120 index 64628b65..6e285b43 100644 --- a/deps/curl/tests/data/test120 +++ b/deps/curl/tests/data/test120 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "-DELE file" # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1201 b/deps/curl/tests/data/test1201 index 296e7fa6..f4c1a483 100644 --- a/deps/curl/tests/data/test1201 +++ b/deps/curl/tests/data/test1201 @@ -25,7 +25,7 @@ gopher Gopher selector -gopher://%HOSTIP:%GOPHERPORT/1/selector/SELECTOR/%TESTNUMBER? +gopher://%HOSTIP:%GOPHERPORT/1/selector/SELECTOR/%TESTNUMBER @@ -33,7 +33,7 @@ gopher://%HOSTIP:%GOPHERPORT/1/selector/SELECTOR/%TESTNUMBER? # Verify data after the test has been "shot" -/selector/SELECTOR/%TESTNUMBER? +/selector/SELECTOR/%TESTNUMBER diff --git a/deps/curl/tests/data/test1203 b/deps/curl/tests/data/test1203 index b4c70e9c..267fc15c 100644 --- a/deps/curl/tests/data/test1203 +++ b/deps/curl/tests/data/test1203 @@ -20,7 +20,7 @@ iMenu results error.host 1 # Client-side -ipv6 +IPv6 gopher-ipv6 diff --git a/deps/curl/tests/data/test1206 b/deps/curl/tests/data/test1206 index 228df4ad..6abb0c59 100644 --- a/deps/curl/tests/data/test1206 +++ b/deps/curl/tests/data/test1206 @@ -33,6 +33,9 @@ FTP PORT and 425 on download # Verify data after the test has been "shot" + +QUIT + s/^EPRT \|1\|(.*)/EPRT \|1\|/ diff --git a/deps/curl/tests/data/test1207 b/deps/curl/tests/data/test1207 index 612c42b0..e192e425 100644 --- a/deps/curl/tests/data/test1207 +++ b/deps/curl/tests/data/test1207 @@ -33,6 +33,9 @@ FTP PORT and 421 on download # Verify data after the test has been "shot" + +QUIT + s/^EPRT \|1\|(.*)/EPRT \|1\|/ diff --git a/deps/curl/tests/data/test121 b/deps/curl/tests/data/test121 index 3625d0e3..d9dfe279 100644 --- a/deps/curl/tests/data/test121 +++ b/deps/curl/tests/data/test121 @@ -35,6 +35,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "-DELE after_transfer" -Q "DELE before_tra # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1210 b/deps/curl/tests/data/test1210 index 4a07147f..09f830c7 100644 --- a/deps/curl/tests/data/test1210 +++ b/deps/curl/tests/data/test1210 @@ -24,22 +24,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -J without Content-Disposition - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER?junk -J -O +http://%HOSTIP:%HTTPPORT/%TESTNUMBER?junk -J -O --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1217 b/deps/curl/tests/data/test1217 index 691c88e7..47059b24 100644 --- a/deps/curl/tests/data/test1217 +++ b/deps/curl/tests/data/test1217 @@ -32,6 +32,9 @@ ftp://%HOSTIP:%FTPPORT/get/file/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/get/file/agai # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1219 b/deps/curl/tests/data/test1219 index 45465439..b28077dc 100644 --- a/deps/curl/tests/data/test1219 +++ b/deps/curl/tests/data/test1219 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + PWD EPSV diff --git a/deps/curl/tests/data/test122 b/deps/curl/tests/data/test122 index 1f007c1c..0566b240 100644 --- a/deps/curl/tests/data/test122 +++ b/deps/curl/tests/data/test122 @@ -31,6 +31,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -C 5 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1224 b/deps/curl/tests/data/test1224 index 64ba4482..61036cd0 100644 --- a/deps/curl/tests/data/test1224 +++ b/deps/curl/tests/data/test1224 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT//%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1225 b/deps/curl/tests/data/test1225 index b20363c3..39abfcb9 100644 --- a/deps/curl/tests/data/test1225 +++ b/deps/curl/tests/data/test1225 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT//foo/%TESTNUMBER ftp://%HOSTIP:%FTPPORT//foo/bar/%TESTNUM # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1226 b/deps/curl/tests/data/test1226 index 08e706b9..4ae0e6af 100644 --- a/deps/curl/tests/data/test1226 +++ b/deps/curl/tests/data/test1226 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT//%TESTNUMBER --ftp-method singlecwd # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1227 b/deps/curl/tests/data/test1227 index 30477a46..f8246fa4 100644 --- a/deps/curl/tests/data/test1227 +++ b/deps/curl/tests/data/test1227 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT//%TESTNUMBER --ftp-method nocwd # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test123 b/deps/curl/tests/data/test123 index 8ccd69cf..1d29c866 100644 --- a/deps/curl/tests/data/test123 +++ b/deps/curl/tests/data/test123 @@ -28,6 +28,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER -C 51 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1230 b/deps/curl/tests/data/test1230 index 5cdf1643..fbcff603 100644 --- a/deps/curl/tests/data/test1230 +++ b/deps/curl/tests/data/test1230 @@ -42,7 +42,7 @@ mooooooo # Client-side -ipv6 +IPv6 proxy diff --git a/deps/curl/tests/data/test1233 b/deps/curl/tests/data/test1233 index 79e641d3..0ca5eed9 100644 --- a/deps/curl/tests/data/test1233 +++ b/deps/curl/tests/data/test1233 @@ -32,6 +32,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test124 b/deps/curl/tests/data/test124 index d2717949..2dfc96bb 100644 --- a/deps/curl/tests/data/test124 +++ b/deps/curl/tests/data/test124 @@ -32,6 +32,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test125 b/deps/curl/tests/data/test125 index 8de97c14..a615d092 100644 --- a/deps/curl/tests/data/test125 +++ b/deps/curl/tests/data/test125 @@ -27,6 +27,9 @@ ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + 9 diff --git a/deps/curl/tests/data/test126 b/deps/curl/tests/data/test126 index b830fc77..285618f1 100644 --- a/deps/curl/tests/data/test126 +++ b/deps/curl/tests/data/test126 @@ -32,6 +32,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/lululul/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1262 b/deps/curl/tests/data/test1262 index 0a7046ce..2cb5d885 100644 --- a/deps/curl/tests/data/test1262 +++ b/deps/curl/tests/data/test1262 @@ -28,6 +28,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -z "-1 jan 2001" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1268 b/deps/curl/tests/data/test1268 index 05fe9d8e..15b15b56 100644 --- a/deps/curl/tests/data/test1268 +++ b/deps/curl/tests/data/test1268 @@ -17,10 +17,10 @@ warning none -unix-sockets +UnixSockets -file name argument looks like a flag +filename argument looks like a flag --stderr %LOGDIR/moo%TESTNUMBER --unix-socket -k hej://moo @@ -29,7 +29,7 @@ file name argument looks like a flag -Warning: The file name argument '-k' looks like a flag. +Warning: The filename argument '-k' looks like a flag. curl: (1) Protocol "hej" not supported diff --git a/deps/curl/tests/data/test127 b/deps/curl/tests/data/test127 index ebf122d0..6871e0dc 100644 --- a/deps/curl/tests/data/test127 +++ b/deps/curl/tests/data/test127 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER --disable-epsv # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1279 b/deps/curl/tests/data/test1279 index 041f5449..4b9ce2f1 100644 --- a/deps/curl/tests/data/test1279 +++ b/deps/curl/tests/data/test1279 @@ -24,7 +24,7 @@ Verify libcurl.def against CURL_EXTERN declarations - + diff --git a/deps/curl/tests/data/test128 b/deps/curl/tests/data/test128 index d1a5d2ac..d46f454e 100644 --- a/deps/curl/tests/data/test128 +++ b/deps/curl/tests/data/test128 @@ -24,7 +24,7 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/upload%TESTNUMBER --crlf file -with unix newlines +with Unix newlines meant to be converted with @@ -35,6 +35,9 @@ the # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -46,7 +49,7 @@ QUIT file -with unix newlines +with Unix newlines meant to be converted with diff --git a/deps/curl/tests/data/test1291 b/deps/curl/tests/data/test1291 index ea9a0c6a..30ea21ac 100644 --- a/deps/curl/tests/data/test1291 +++ b/deps/curl/tests/data/test1291 @@ -31,7 +31,7 @@ XXXXXXXx # generate the config file -perl -e 'for(1 .. 1000) { printf("upload-file=%LOGDIR/upload-this\nurl=htttttp://non-existing-host.haxx.se/upload/%TESTNUMBER\n", $_);}' > %LOGDIR/cmd%TESTNUMBER; +%PERL -e 'for(1 .. 1000) { printf("upload-file=%LOGDIR/upload-this\nurl=htttttp://non-existing-host.haxx.se/upload/%TESTNUMBER\n", $_);}' > %LOGDIR/cmd%TESTNUMBER; diff --git a/deps/curl/tests/data/test1294 b/deps/curl/tests/data/test1294 index 396f8a17..b16ecb14 100644 --- a/deps/curl/tests/data/test1294 +++ b/deps/curl/tests/data/test1294 @@ -30,7 +30,7 @@ Funny-head: yesyes # hyper doesn't support the added crazy header -debug +Debug !hyper diff --git a/deps/curl/tests/data/test1295 b/deps/curl/tests/data/test1295 index e3692f5d..5c963cae 100644 --- a/deps/curl/tests/data/test1295 +++ b/deps/curl/tests/data/test1295 @@ -29,7 +29,7 @@ Funny-head: yesyes # Client-side -debug +Debug http diff --git a/deps/curl/tests/data/test1296 b/deps/curl/tests/data/test1296 index 20dc2657..65fbdb2d 100644 --- a/deps/curl/tests/data/test1296 +++ b/deps/curl/tests/data/test1296 @@ -51,4 +51,3 @@ Accept: */* - diff --git a/deps/curl/tests/data/test130 b/deps/curl/tests/data/test130 index d6fed336..a0673dd8 100644 --- a/deps/curl/tests/data/test130 +++ b/deps/curl/tests/data/test130 @@ -10,9 +10,8 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -51,6 +50,9 @@ default login userdef password passwddef # # Verify data after the test has been "shot" + +QUIT + USER user1 PASS passwd1 diff --git a/deps/curl/tests/data/test131 b/deps/curl/tests/data/test131 index c4893117..0511520f 100644 --- a/deps/curl/tests/data/test131 +++ b/deps/curl/tests/data/test131 @@ -10,10 +10,7 @@ netrc # # Server-side -# -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -50,6 +47,9 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" + +QUIT + USER user2 PASS passwd2 diff --git a/deps/curl/tests/data/test1310 b/deps/curl/tests/data/test1310 index 12fdbb15..49bb0d36 100644 --- a/deps/curl/tests/data/test1310 +++ b/deps/curl/tests/data/test1310 @@ -3,122 +3,61 @@ HTTP HTTP GET -HTTP NTLM auth +-J +--show-headers -# Server-side + +# + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Disposition: inline; filename="name%TESTNUMBER" +Content-Type: text/html - - - -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== - -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 - -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 TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - -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! - - +12345 + +# # Client-side - -NTLM_WB -debug - http -HTTP with NTLM delegation to winbind helper +HTTP GET with -J + --show-headers - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so -# set path to fake_auth instead of real ntlm_auth to generate NTLM type1 and type 3 messages -CURL_NTLM_WB_FILE=%PWD/server/fake_ntlm -# set source directory so fake_ntlm can find the test files -CURL_NTLM_AUTH_SRCDIR=%SRCDIR -# set source directory so fake_ntlm can find the test and log files -CURL_NTLM_LOGDIR=%LOGDIR -# set the test number -CURL_NTLM_AUTH_TESTNUM=%TESTNUMBER - - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:anypasswd --ntlm-wb + +http://%HOSTIP:%HTTPPORT/junk -J -O --show-headers --output-dir %LOGDIR - -chkhostname curlhost - +# # Verify data after the test has been "shot" -GET /%TESTNUMBER HTTP/1.1 +GET /junk HTTP/1.1 Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAA -User-Agent: curl/%VERSION -Accept: */* - -GET /%TESTNUMBER HTTP/1.1 -Host: %HOSTIP:%HTTPPORT -Authorization: NTLM TlRMTVNTUAADAAAAGAAYAE8AAAAYABgAZwAAAAAAAABAAAAACAAIAEAAAAAHAAcASAAAAAAAAAAAAAAAggEAAHRlc3R1c2VyVU5LTk9XTlpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOQ== User-Agent: curl/%VERSION 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-Disposition: inline; filename="name%TESTNUMBER" +Content-Type: text/html + +12345 + + -# Input and output (type 1 message) for fake_ntlm - - -YR - - -YR TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAA - - -# Input and output (type 3 message) for fake_ntlm - - -TT TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== - - -KK TlRMTVNTUAADAAAAGAAYAE8AAAAYABgAZwAAAAAAAABAAAAACAAIAEAAAAAHAAcASAAAAAAAAAAAAAAAggEAAHRlc3R1c2VyVU5LTk9XTlpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOQ== - - diff --git a/deps/curl/tests/data/test1311 b/deps/curl/tests/data/test1311 index 8e48794a..1a14547c 100644 --- a/deps/curl/tests/data/test1311 +++ b/deps/curl/tests/data/test1311 @@ -25,22 +25,14 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -J output in - -debug - http HTTP GET with -J and Content-Disposition - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1312 b/deps/curl/tests/data/test1312 index c8170a8a..b67fdded 100644 --- a/deps/curl/tests/data/test1312 +++ b/deps/curl/tests/data/test1312 @@ -25,22 +25,14 @@ Content-Disposition: inline; filename="name%TESTNUMBER;weird" # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -J output in - -debug - http HTTP GET with -J, Content-Disposition and ; in filename - -CURL_TESTDIR=%LOGDIR - -%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O +%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1313 b/deps/curl/tests/data/test1313 index 8a285974..922dbc76 100644 --- a/deps/curl/tests/data/test1313 +++ b/deps/curl/tests/data/test1313 @@ -25,22 +25,14 @@ Content-Disposition: inline; filename='name%TESTNUMBER # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -J output in - -debug - http HTTP GET with -J, Content-Disposition, uneven quotes - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1316 b/deps/curl/tests/data/test1316 index b6b8a189..c3f70878 100644 --- a/deps/curl/tests/data/test1316 +++ b/deps/curl/tests/data/test1316 @@ -19,15 +19,7 @@ Magic: sure you can FTP me -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - -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 - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -39,7 +31,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -68,6 +60,9 @@ ftp://ftp.%TESTNUMBER:%FTPPORT/ -p -x %HOSTIP:%PROXYPORT # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test132 b/deps/curl/tests/data/test132 index 8aa2f790..47748494 100644 --- a/deps/curl/tests/data/test132 +++ b/deps/curl/tests/data/test132 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -49,6 +47,9 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" + +QUIT + USER mary PASS mark diff --git a/deps/curl/tests/data/test133 b/deps/curl/tests/data/test133 index c8d2f903..f80d840a 100644 --- a/deps/curl/tests/data/test133 +++ b/deps/curl/tests/data/test133 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -49,6 +47,9 @@ machine %HOSTIP login mary password drfrank # # Verify data after the test has been "shot" + +QUIT + USER mary PASS drfrank diff --git a/deps/curl/tests/data/test1334 b/deps/curl/tests/data/test1334 index 88a41d8b..1a13864c 100644 --- a/deps/curl/tests/data/test1334 +++ b/deps/curl/tests/data/test1334 @@ -23,22 +23,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O without Content-Disposition, -D file - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1335 b/deps/curl/tests/data/test1335 index 4d64ea87..a0b3aae6 100644 --- a/deps/curl/tests/data/test1335 +++ b/deps/curl/tests/data/test1335 @@ -23,22 +23,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O without Content-Disposition, -D stdout - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1336 b/deps/curl/tests/data/test1336 index 993d8c6f..dd93b5f9 100644 --- a/deps/curl/tests/data/test1336 +++ b/deps/curl/tests/data/test1336 @@ -24,26 +24,15 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O and Content-Disposition, -D file - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # @@ -74,6 +63,8 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1337 b/deps/curl/tests/data/test1337 index 4b954d06..5dbddeea 100644 --- a/deps/curl/tests/data/test1337 +++ b/deps/curl/tests/data/test1337 @@ -24,26 +24,15 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O and Content-Disposition, -D stdout - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # @@ -71,6 +60,8 @@ Content-Type: text/html Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - +> +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1338 b/deps/curl/tests/data/test1338 index c1c271a9..bc7b641e 100644 --- a/deps/curl/tests/data/test1338 +++ b/deps/curl/tests/data/test1338 @@ -24,22 +24,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O and -J output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -J without Content-Disposition, -D file - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1339 b/deps/curl/tests/data/test1339 index a46934d3..a3533841 100644 --- a/deps/curl/tests/data/test1339 +++ b/deps/curl/tests/data/test1339 @@ -24,22 +24,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O and -J output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -J without Content-Disposition, -D stdout - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test134 b/deps/curl/tests/data/test134 index d0716c3d..aa104bf1 100644 --- a/deps/curl/tests/data/test134 +++ b/deps/curl/tests/data/test134 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -51,6 +49,9 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" + +QUIT + USER romulus PASS rhemus diff --git a/deps/curl/tests/data/test1340 b/deps/curl/tests/data/test1340 index ebec701a..9b6c092d 100644 --- a/deps/curl/tests/data/test1340 +++ b/deps/curl/tests/data/test1340 @@ -25,22 +25,14 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O and -J output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -J and Content-Disposition, -D file - -CURL_TESTDIR=%PWD/%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER -w "curl saved to filename %{filename_effective}\n" +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D %LOGDIR/heads%TESTNUMBER -w "curl saved to filename %{filename_effective}\n" --output-dir %LOGDIR @@ -71,7 +63,7 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange -curl saved to filename %PWD/%LOGDIR/name%TESTNUMBER +curl saved to filename %LOGDIR/name%TESTNUMBER diff --git a/deps/curl/tests/data/test1341 b/deps/curl/tests/data/test1341 index 75d9daae..74cfd3b3 100644 --- a/deps/curl/tests/data/test1341 +++ b/deps/curl/tests/data/test1341 @@ -25,22 +25,14 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O and -J output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -J and Content-Disposition, -D stdout - -CURL_TESTDIR=%PWD/%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - -w "curl saved to filename %{filename_effective}\n" +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O -D - -w "curl saved to filename %{filename_effective}\n" --output-dir %LOGDIR @@ -68,7 +60,7 @@ Connection: close Content-Type: text/html Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange -curl saved to filename %PWD/%LOGDIR/name%TESTNUMBER +curl saved to filename %LOGDIR/name%TESTNUMBER diff --git a/deps/curl/tests/data/test1342 b/deps/curl/tests/data/test1342 index 39dbfab5..6d039f7e 100644 --- a/deps/curl/tests/data/test1342 +++ b/deps/curl/tests/data/test1342 @@ -23,22 +23,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -i without Content-Disposition, -D file - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1343 b/deps/curl/tests/data/test1343 index 6a9eb7dc..c6a18f2b 100644 --- a/deps/curl/tests/data/test1343 +++ b/deps/curl/tests/data/test1343 @@ -23,22 +23,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -i without Content-Disposition, -D stdout - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1344 b/deps/curl/tests/data/test1344 index ba4b3897..de440520 100644 --- a/deps/curl/tests/data/test1344 +++ b/deps/curl/tests/data/test1344 @@ -24,26 +24,15 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -i and Content-Disposition, -D file - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # @@ -82,6 +71,8 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1345 b/deps/curl/tests/data/test1345 index a9298e4e..a093e5d8 100644 --- a/deps/curl/tests/data/test1345 +++ b/deps/curl/tests/data/test1345 @@ -24,26 +24,15 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -i and Content-Disposition, -D stdout - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O -D - --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # @@ -79,6 +68,8 @@ Content-Type: text/html Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange - + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1346 b/deps/curl/tests/data/test1346 index bab67cb6..af2a35cb 100644 --- a/deps/curl/tests/data/test1346 +++ b/deps/curl/tests/data/test1346 @@ -23,22 +23,14 @@ Content-Type: text/html # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -i without Content-Disposition, without -D - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1347 b/deps/curl/tests/data/test1347 index 868e2611..bbef9f40 100644 --- a/deps/curl/tests/data/test1347 +++ b/deps/curl/tests/data/test1347 @@ -24,26 +24,15 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - http HTTP GET with -O -i and Content-Disposition, without -D - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -O --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # @@ -71,6 +60,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1348 b/deps/curl/tests/data/test1348 index 3de0b4a9..fde0ffb2 100644 --- a/deps/curl/tests/data/test1348 +++ b/deps/curl/tests/data/test1348 @@ -16,27 +16,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without Content-Disposition inside, using -O - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1349 b/deps/curl/tests/data/test1349 index d2565496..41673666 100644 --- a/deps/curl/tests/data/test1349 +++ b/deps/curl/tests/data/test1349 @@ -16,27 +16,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -D file - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test135 b/deps/curl/tests/data/test135 index 3dc1d531..cdb54836 100644 --- a/deps/curl/tests/data/test135 +++ b/deps/curl/tests/data/test135 @@ -38,6 +38,9 @@ FTP retrieve a byte-range # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1350 b/deps/curl/tests/data/test1350 index b5568f53..f896f22b 100644 --- a/deps/curl/tests/data/test1350 +++ b/deps/curl/tests/data/test1350 @@ -16,27 +16,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -D stdout - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D - +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D - --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1351 b/deps/curl/tests/data/test1351 index 93232d55..947300f6 100644 --- a/deps/curl/tests/data/test1351 +++ b/deps/curl/tests/data/test1351 @@ -17,27 +17,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -J -D file - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1352 b/deps/curl/tests/data/test1352 index 0649289b..a74d2f33 100644 --- a/deps/curl/tests/data/test1352 +++ b/deps/curl/tests/data/test1352 @@ -17,27 +17,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -J -D stdout - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D - +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D - --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1353 b/deps/curl/tests/data/test1353 index 8e0ad50e..a4df5d8b 100644 --- a/deps/curl/tests/data/test1353 +++ b/deps/curl/tests/data/test1353 @@ -16,27 +16,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -i -D file - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D %LOGDIR/heads%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1354 b/deps/curl/tests/data/test1354 index 506ec90e..3413d467 100644 --- a/deps/curl/tests/data/test1354 +++ b/deps/curl/tests/data/test1354 @@ -16,27 +16,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -i -D stdout - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D - +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D - --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1355 b/deps/curl/tests/data/test1355 index fa19fabc..e99dd015 100644 --- a/deps/curl/tests/data/test1355 +++ b/deps/curl/tests/data/test1355 @@ -16,27 +16,22 @@ mooo # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file without C-D inside, using -O -i, without -D - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i --output-dir %LOGDIR # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1356 b/deps/curl/tests/data/test1356 index 0c326f48..77a88be5 100644 --- a/deps/curl/tests/data/test1356 +++ b/deps/curl/tests/data/test1356 @@ -24,30 +24,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with Content-Disposition inside, using -O - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -74,6 +66,8 @@ MOOOO - + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1357 b/deps/curl/tests/data/test1357 index 9d395a87..b0943b7f 100644 --- a/deps/curl/tests/data/test1357 +++ b/deps/curl/tests/data/test1357 @@ -24,30 +24,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -D file - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -94,6 +86,8 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1358 b/deps/curl/tests/data/test1358 index 973ef7cf..c71520c9 100644 --- a/deps/curl/tests/data/test1358 +++ b/deps/curl/tests/data/test1358 @@ -24,30 +24,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -D stdout - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D - +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -D - --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -92,5 +84,8 @@ MOOOO s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1359 b/deps/curl/tests/data/test1359 index fc1eb372..63cdc4ce 100644 --- a/deps/curl/tests/data/test1359 +++ b/deps/curl/tests/data/test1359 @@ -25,30 +25,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -J -D file - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -96,5 +88,8 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test136 b/deps/curl/tests/data/test136 index ef0b2c49..f71f4b36 100644 --- a/deps/curl/tests/data/test136 +++ b/deps/curl/tests/data/test136 @@ -28,6 +28,9 @@ FTP with user and no password # Verify data after the test has been "shot" + +QUIT + USER user PASS diff --git a/deps/curl/tests/data/test1360 b/deps/curl/tests/data/test1360 index 1fb80eec..6f8732a1 100644 --- a/deps/curl/tests/data/test1360 +++ b/deps/curl/tests/data/test1360 @@ -25,30 +25,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -J -D stdout - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D - +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D - --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -93,5 +85,8 @@ MOOOO s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1361 b/deps/curl/tests/data/test1361 index 6b9af1ad..c80b097a 100644 --- a/deps/curl/tests/data/test1361 +++ b/deps/curl/tests/data/test1361 @@ -24,30 +24,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -i -D file - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D %LOGDIR/heads%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D %LOGDIR/heads%TESTNUMBER --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -95,5 +87,8 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1362 b/deps/curl/tests/data/test1362 index 03d99047..9e4890ae 100644 --- a/deps/curl/tests/data/test1362 +++ b/deps/curl/tests/data/test1362 @@ -24,30 +24,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -i -D stdout - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D - +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i -D - --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -92,5 +84,8 @@ MOOOO s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1363 b/deps/curl/tests/data/test1363 index 009f68ca..4ef72cf7 100644 --- a/deps/curl/tests/data/test1363 +++ b/deps/curl/tests/data/test1363 @@ -24,30 +24,22 @@ MOOOO # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O output in, using the CURL_TESTDIR variable - -debug - ftp FTP download, file with C-D inside, using -O -i, without -D - -CURL_TESTDIR=%LOGDIR - -ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i +ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -i --output-dir %LOGDIR - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -75,5 +67,8 @@ MOOOO + +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1364 b/deps/curl/tests/data/test1364 index 0ea1e2b1..2b3b566f 100644 --- a/deps/curl/tests/data/test1364 +++ b/deps/curl/tests/data/test1364 @@ -32,9 +32,6 @@ HTTP GET -o fname without Content-Disposition, -D file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -65,5 +62,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1365 b/deps/curl/tests/data/test1365 index abd371c0..1a28a77e 100644 --- a/deps/curl/tests/data/test1365 +++ b/deps/curl/tests/data/test1365 @@ -32,9 +32,6 @@ HTTP GET -o fname without Content-Disposition, -D stdout http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -62,5 +59,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1366 b/deps/curl/tests/data/test1366 index 78f5573e..1107c228 100644 --- a/deps/curl/tests/data/test1366 +++ b/deps/curl/tests/data/test1366 @@ -33,9 +33,6 @@ HTTP GET -o fname and Content-Disposition, -D file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -67,5 +64,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1367 b/deps/curl/tests/data/test1367 index 24929365..5d1efa3a 100644 --- a/deps/curl/tests/data/test1367 +++ b/deps/curl/tests/data/test1367 @@ -33,9 +33,6 @@ HTTP GET -o fname and Content-Disposition, -D stdout http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -64,5 +61,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1368 b/deps/curl/tests/data/test1368 index 1d6d181b..c9ee0216 100644 --- a/deps/curl/tests/data/test1368 +++ b/deps/curl/tests/data/test1368 @@ -33,9 +33,6 @@ HTTP GET -o fname -J without Content-Disposition, -D file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -66,5 +63,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1369 b/deps/curl/tests/data/test1369 index 48fd3180..93627e6a 100644 --- a/deps/curl/tests/data/test1369 +++ b/deps/curl/tests/data/test1369 @@ -33,9 +33,6 @@ HTTP GET -o fname -J without Content-Disposition, -D stdout http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -63,5 +60,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test137 b/deps/curl/tests/data/test137 index 33b93589..8154af88 100644 --- a/deps/curl/tests/data/test137 +++ b/deps/curl/tests/data/test137 @@ -31,6 +31,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/lululul/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1370 b/deps/curl/tests/data/test1370 index d7694014..637444c5 100644 --- a/deps/curl/tests/data/test1370 +++ b/deps/curl/tests/data/test1370 @@ -34,9 +34,6 @@ HTTP GET -o fname -J and Content-Disposition, -D file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -68,5 +65,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1371 b/deps/curl/tests/data/test1371 index 8565363b..d05c1a15 100644 --- a/deps/curl/tests/data/test1371 +++ b/deps/curl/tests/data/test1371 @@ -34,9 +34,6 @@ HTTP GET -o fname -J and Content-Disposition, -D stdout http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -o %LOGDIR/outfile%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -65,5 +62,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1372 b/deps/curl/tests/data/test1372 index 76b36713..a39a243c 100644 --- a/deps/curl/tests/data/test1372 +++ b/deps/curl/tests/data/test1372 @@ -32,9 +32,6 @@ HTTP GET -o fname -i without Content-Disposition, -D file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -72,5 +69,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1373 b/deps/curl/tests/data/test1373 index c475deb9..7d94775d 100644 --- a/deps/curl/tests/data/test1373 +++ b/deps/curl/tests/data/test1373 @@ -32,9 +32,6 @@ HTTP GET -o fname -i without Content-Disposition, -D stdout http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -69,5 +66,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1374 b/deps/curl/tests/data/test1374 index aa2b3e34..95af862f 100644 --- a/deps/curl/tests/data/test1374 +++ b/deps/curl/tests/data/test1374 @@ -33,9 +33,6 @@ HTTP GET -o fname -i and Content-Disposition, -D file http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -75,5 +72,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1375 b/deps/curl/tests/data/test1375 index 6df55263..f56a7d90 100644 --- a/deps/curl/tests/data/test1375 +++ b/deps/curl/tests/data/test1375 @@ -33,9 +33,6 @@ HTTP GET -o fname -i and Content-Disposition, -D stdout http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -72,5 +69,9 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1376 b/deps/curl/tests/data/test1376 index f3d36e0a..5b3280b0 100644 --- a/deps/curl/tests/data/test1376 +++ b/deps/curl/tests/data/test1376 @@ -32,9 +32,6 @@ HTTP GET -o fname -i without Content-Disposition, without -D http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -62,5 +59,8 @@ Content-Type: text/html + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1377 b/deps/curl/tests/data/test1377 index d1a6b721..4bdc864b 100644 --- a/deps/curl/tests/data/test1377 +++ b/deps/curl/tests/data/test1377 @@ -33,9 +33,6 @@ HTTP GET -o fname -i and Content-Disposition, without -D http://%HOSTIP:%HTTPPORT/%TESTNUMBER -i -o %LOGDIR/outfile%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER %LOGDIR/name%TESTNUMBER - # @@ -63,6 +60,10 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange + +%LOGDIR/%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1378 b/deps/curl/tests/data/test1378 index 7348a3f1..f8551251 100644 --- a/deps/curl/tests/data/test1378 +++ b/deps/curl/tests/data/test1378 @@ -25,13 +25,13 @@ FTP DL, file without Content-Disposition inside, using -o fname ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -51,6 +51,9 @@ mooo + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1379 b/deps/curl/tests/data/test1379 index 0b8d20ae..9cecb0ea 100644 --- a/deps/curl/tests/data/test1379 +++ b/deps/curl/tests/data/test1379 @@ -25,13 +25,13 @@ FTP DL, file without C-D inside, using -o fname -D file ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -72,5 +72,8 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test138 b/deps/curl/tests/data/test138 index db3b6ec7..e00c3110 100644 --- a/deps/curl/tests/data/test138 +++ b/deps/curl/tests/data/test138 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/lululul/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1380 b/deps/curl/tests/data/test1380 index 187dd8cd..d5342239 100644 --- a/deps/curl/tests/data/test1380 +++ b/deps/curl/tests/data/test1380 @@ -25,13 +25,13 @@ FTP DL, file without C-D inside, using -o fname -D stdout ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -69,5 +69,8 @@ mooo s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1381 b/deps/curl/tests/data/test1381 index 4ba20eb3..28c2af5f 100644 --- a/deps/curl/tests/data/test1381 +++ b/deps/curl/tests/data/test1381 @@ -26,13 +26,13 @@ FTP DL, file without C-D inside, using -o fname -J -D file ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -73,5 +73,8 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1382 b/deps/curl/tests/data/test1382 index 26ff7acb..d96ad468 100644 --- a/deps/curl/tests/data/test1382 +++ b/deps/curl/tests/data/test1382 @@ -26,13 +26,13 @@ FTP DL, file without C-D inside, using -o fname -J -D stdout ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -70,5 +70,8 @@ mooo s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1383 b/deps/curl/tests/data/test1383 index d4c5c828..2c9f3329 100644 --- a/deps/curl/tests/data/test1383 +++ b/deps/curl/tests/data/test1383 @@ -25,13 +25,13 @@ FTP DL, file without C-D inside, using -o fname -i -D file ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -72,5 +72,8 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1384 b/deps/curl/tests/data/test1384 index af7afdf7..1dd2aa28 100644 --- a/deps/curl/tests/data/test1384 +++ b/deps/curl/tests/data/test1384 @@ -25,13 +25,13 @@ FTP DL, file without C-D inside, using -o fname -i -D stdout ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -69,5 +69,8 @@ mooo s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1385 b/deps/curl/tests/data/test1385 index d2038ee9..8654da65 100644 --- a/deps/curl/tests/data/test1385 +++ b/deps/curl/tests/data/test1385 @@ -25,13 +25,13 @@ FTP DL, file without C-D inside, using -o fname -i, without -D ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -52,5 +52,8 @@ mooo + +%LOGDIR/file%TESTNUMBER + diff --git a/deps/curl/tests/data/test1386 b/deps/curl/tests/data/test1386 index 0aaf6641..44b8dcd4 100644 --- a/deps/curl/tests/data/test1386 +++ b/deps/curl/tests/data/test1386 @@ -33,13 +33,13 @@ FTP DL, file with Content-Disposition inside, using -o fname ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -67,5 +67,9 @@ MOOOO + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1387 b/deps/curl/tests/data/test1387 index 0f124d87..6a24b767 100644 --- a/deps/curl/tests/data/test1387 +++ b/deps/curl/tests/data/test1387 @@ -33,13 +33,13 @@ FTP DL, file with C-D inside, using -o fname -D file ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -87,5 +87,9 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1388 b/deps/curl/tests/data/test1388 index d78844e7..a26a829c 100644 --- a/deps/curl/tests/data/test1388 +++ b/deps/curl/tests/data/test1388 @@ -33,13 +33,13 @@ FTP DL, file with C-D inside, using -o fname -D stdout ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -83,6 +83,10 @@ MOOOO s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1389 b/deps/curl/tests/data/test1389 index 0863a401..77f7b5f2 100644 --- a/deps/curl/tests/data/test1389 +++ b/deps/curl/tests/data/test1389 @@ -34,13 +34,13 @@ FTP DL, file with C-D inside, using -o fname -J -D file ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -87,6 +87,10 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test139 b/deps/curl/tests/data/test139 index 160f628e..61a0da60 100644 --- a/deps/curl/tests/data/test139 +++ b/deps/curl/tests/data/test139 @@ -31,6 +31,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -z "1 jan 1989" # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1390 b/deps/curl/tests/data/test1390 index a856d1e8..be7cf2ed 100644 --- a/deps/curl/tests/data/test1390 +++ b/deps/curl/tests/data/test1390 @@ -34,13 +34,13 @@ FTP DL, file with C-D inside, using -o fname -J -D stdout ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -J -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -85,5 +85,9 @@ MOOOO s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1391 b/deps/curl/tests/data/test1391 index ae1495ee..c0c5bc58 100644 --- a/deps/curl/tests/data/test1391 +++ b/deps/curl/tests/data/test1391 @@ -33,13 +33,13 @@ FTP DL, file with C-D inside, using -o fname -i -D file ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D %LOGDIR/heads%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -87,5 +87,9 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1392 b/deps/curl/tests/data/test1392 index f715fe8b..49472104 100644 --- a/deps/curl/tests/data/test1392 +++ b/deps/curl/tests/data/test1392 @@ -33,13 +33,13 @@ FTP DL, file with C-D inside, using -o fname -i -D stdout ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i -D - - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -84,5 +84,9 @@ MOOOO s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test1393 b/deps/curl/tests/data/test1393 index dc7a6f93..81734206 100644 --- a/deps/curl/tests/data/test1393 +++ b/deps/curl/tests/data/test1393 @@ -33,13 +33,13 @@ FTP DL, file with C-D inside, using -o fname -i, without -D ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -o %LOGDIR/download%TESTNUMBER -i - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/file%TESTNUMBER %LOGDIR/name%TESTNUMBER - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -67,5 +67,9 @@ MOOOO + +%LOGDIR/file%TESTNUMBER +%LOGDIR/name%TESTNUMBER + diff --git a/deps/curl/tests/data/test140 b/deps/curl/tests/data/test140 index 5e29f5c7..cacef2ae 100644 --- a/deps/curl/tests/data/test140 +++ b/deps/curl/tests/data/test140 @@ -30,6 +30,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -z "1 jan 2004" # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1405 b/deps/curl/tests/data/test1405 index 8a13a688..5ca006a1 100644 --- a/deps/curl/tests/data/test1405 +++ b/deps/curl/tests/data/test1405 @@ -42,6 +42,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FA # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1408 b/deps/curl/tests/data/test1408 index 925be875..5c7f6493 100644 --- a/deps/curl/tests/data/test1408 +++ b/deps/curl/tests/data/test1408 @@ -40,7 +40,7 @@ Set-Cookie: time=2 cookies -ipv6 +IPv6 http-ipv6 diff --git a/deps/curl/tests/data/test141 b/deps/curl/tests/data/test141 index 425a98f2..5ffbc452 100644 --- a/deps/curl/tests/data/test141 +++ b/deps/curl/tests/data/test141 @@ -32,6 +32,9 @@ ftp://%HOSTIP:%FTPPORT/blalbla/%TESTNUMBER -I # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1411 b/deps/curl/tests/data/test1411 index bd8a8dd6..9c75a225 100644 --- a/deps/curl/tests/data/test1411 +++ b/deps/curl/tests/data/test1411 @@ -2,7 +2,7 @@ HTTP -PUT +HTTP PUT diff --git a/deps/curl/tests/data/test1414 b/deps/curl/tests/data/test1414 index 4be9b542..9fc2a56f 100644 --- a/deps/curl/tests/data/test1414 +++ b/deps/curl/tests/data/test1414 @@ -38,6 +38,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -P - # Verify data after the test has been "shot" + +QUIT + s/^(EPRT \|1\|)(.*)/$1/ s/^(PORT)(.*)/$1/ diff --git a/deps/curl/tests/data/test142 b/deps/curl/tests/data/test142 index c4ad11a6..db17e307 100644 --- a/deps/curl/tests/data/test142 +++ b/deps/curl/tests/data/test142 @@ -26,6 +26,9 @@ ftp://%HOSTIP:%FTPPORT/part1/part2/part3/part4/part5/part6/part7/part8/part9/par # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1422 b/deps/curl/tests/data/test1422 index c62c2cbd..9aa95bf2 100644 --- a/deps/curl/tests/data/test1422 +++ b/deps/curl/tests/data/test1422 @@ -24,10 +24,7 @@ Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=str//nge # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -O and -J output in, using the CURL_TESTDIR variable -debug file @@ -36,11 +33,8 @@ http HTTP GET with -O -J and Content-Disposition (empty file) - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O file://%PWD/%LOGDIR/name%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O file://%FILE_PWD/%LOGDIR/name%TESTNUMBER --output-dir %LOGDIR diff --git a/deps/curl/tests/data/test1423 b/deps/curl/tests/data/test1423 index f269cc0b..16a4cf31 100644 --- a/deps/curl/tests/data/test1423 +++ b/deps/curl/tests/data/test1423 @@ -30,11 +30,8 @@ file HTTP GET -o fname without Content-Disposition (empty file) -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER file://%PWD/%LOGDIR/outfile%TESTNUMBER +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER file://%FILE_PWD/%LOGDIR/outfile%TESTNUMBER - -perl %SRCDIR/libtest/notexists.pl %LOGDIR/%TESTNUMBER - # @@ -51,5 +48,8 @@ Accept: */* + +%LOGDIR/%TESTNUMBER + diff --git a/deps/curl/tests/data/test1425 b/deps/curl/tests/data/test1425 index f51483dd..4e13dbef 100644 Binary files a/deps/curl/tests/data/test1425 and b/deps/curl/tests/data/test1425 differ diff --git a/deps/curl/tests/data/test1426 b/deps/curl/tests/data/test1426 index d53138af..792cc4ba 100644 Binary files a/deps/curl/tests/data/test1426 and b/deps/curl/tests/data/test1426 differ diff --git a/deps/curl/tests/data/test143 b/deps/curl/tests/data/test143 index ed89e70d..8984a3f1 100644 --- a/deps/curl/tests/data/test143 +++ b/deps/curl/tests/data/test143 @@ -28,6 +28,9 @@ FTP URL with type=a # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1435 b/deps/curl/tests/data/test1435 index 0e1e34f5..321ea4c0 100644 --- a/deps/curl/tests/data/test1435 +++ b/deps/curl/tests/data/test1435 @@ -3,7 +3,7 @@ HTTP HTTP GET -unix sockets +UnixSockets @@ -19,7 +19,7 @@ Based on test300 -unix-sockets +UnixSockets http-unix diff --git a/deps/curl/tests/data/test1436 b/deps/curl/tests/data/test1436 index 352ef34e..f82384e5 100644 --- a/deps/curl/tests/data/test1436 +++ b/deps/curl/tests/data/test1436 @@ -3,7 +3,7 @@ HTTP HTTP GET -unix sockets +UnixSockets @@ -33,7 +33,7 @@ Third -unix-sockets +UnixSockets http-unix diff --git a/deps/curl/tests/data/test1438 b/deps/curl/tests/data/test1438 index 90610a82..cbf19550 100644 --- a/deps/curl/tests/data/test1438 +++ b/deps/curl/tests/data/test1438 @@ -44,7 +44,7 @@ Connection: close Content-Type: text/plain testdata -HTTP +http GET /%TESTNUMBER HTTP/1.1 diff --git a/deps/curl/tests/data/test144 b/deps/curl/tests/data/test144 index be2ca5c8..e7a983bc 100644 --- a/deps/curl/tests/data/test144 +++ b/deps/curl/tests/data/test144 @@ -31,6 +31,9 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1440 b/deps/curl/tests/data/test1440 index dbdfc736..8ae45753 100644 --- a/deps/curl/tests/data/test1440 +++ b/deps/curl/tests/data/test1440 @@ -19,7 +19,7 @@ file Check --write-out with trailing %{ -file://localhost/%PWD/%LOGDIR/non-existent-file.txt --write-out '%{' +file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '%{' diff --git a/deps/curl/tests/data/test1441 b/deps/curl/tests/data/test1441 index 2ff6be03..16b2a871 100644 --- a/deps/curl/tests/data/test1441 +++ b/deps/curl/tests/data/test1441 @@ -19,7 +19,7 @@ file Check --write-out with trailing % -file://localhost/%PWD/%LOGDIR/non-existent-file.txt --write-out '%' +file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '%' diff --git a/deps/curl/tests/data/test1442 b/deps/curl/tests/data/test1442 index 02ecea67..0825a1e0 100644 --- a/deps/curl/tests/data/test1442 +++ b/deps/curl/tests/data/test1442 @@ -19,7 +19,7 @@ file Check --write-out with trailing \ -file://localhost/%PWD/%LOGDIR/non-existent-file.txt --write-out '\' +file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '\' diff --git a/deps/curl/tests/data/test1443 b/deps/curl/tests/data/test1443 index bbfaf7f1..45aead93 100644 --- a/deps/curl/tests/data/test1443 +++ b/deps/curl/tests/data/test1443 @@ -25,28 +25,17 @@ Connection: close # # Client-side -# This relies on the debug feature to allow us to set a directory -# in which to store the -O output - -debug - http HTTP GET with -O and --remote-time - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O --remote-time +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O --remote-time --output-dir %LOGDIR # 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 filesystem. - -perl -e 'exit((stat("%LOGDIR/%TESTNUMBER"))[9] != 960898200)' - # @@ -62,5 +51,8 @@ Accept: */* 12345 + +%PERL -e 'exit((stat("%LOGDIR/%TESTNUMBER"))[9] != 960898200)' + diff --git a/deps/curl/tests/data/test1444 b/deps/curl/tests/data/test1444 index 61b3a29f..ad1dc463 100644 --- a/deps/curl/tests/data/test1444 +++ b/deps/curl/tests/data/test1444 @@ -28,15 +28,13 @@ FTP with --remote-time ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --remote-time -# 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 filesystem. - -perl -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 1234567890)' - # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -48,5 +46,10 @@ 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 filesystem. + +%PERL -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 1234567890)' + diff --git a/deps/curl/tests/data/test1445 b/deps/curl/tests/data/test1445 index fee8932f..f52be8f7 100644 --- a/deps/curl/tests/data/test1445 +++ b/deps/curl/tests/data/test1445 @@ -15,7 +15,7 @@ FILE file -perl %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir file:// with --remote-time @@ -23,13 +23,13 @@ file:// with --remote-time file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.dir/plainfile.txt --remote-time - -perl %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \ -perl -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 946728000)' - # 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)' + diff --git a/deps/curl/tests/data/test1446 b/deps/curl/tests/data/test1446 index f633ac17..bec6dd7f 100644 --- a/deps/curl/tests/data/test1446 +++ b/deps/curl/tests/data/test1446 @@ -18,7 +18,7 @@ SFTP sftp -perl %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP with --remote-time @@ -26,17 +26,14 @@ SFTP with --remote-time --key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/rofile.txt --insecure --remote-time - -perl %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \ -perl -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 978264000)' - # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \ +%PERL -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 978264000)' + diff --git a/deps/curl/tests/data/test1448 b/deps/curl/tests/data/test1448 index 6a9ba521..33aedc4f 100644 --- a/deps/curl/tests/data/test1448 +++ b/deps/curl/tests/data/test1448 @@ -39,15 +39,13 @@ OK http -idn +IDN +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - Redirect following to UTF-8 IDN host name diff --git a/deps/curl/tests/data/test1449 b/deps/curl/tests/data/test1449 index 0b9de019..d761f3c0 100644 --- a/deps/curl/tests/data/test1449 +++ b/deps/curl/tests/data/test1449 @@ -27,6 +27,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -r 36893488147419103232- # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test145 b/deps/curl/tests/data/test145 index 53f3f631..7f12b36f 100644 --- a/deps/curl/tests/data/test145 +++ b/deps/curl/tests/data/test145 @@ -30,6 +30,9 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l # Verify data after the test has been "shot" + +QUIT + 19 diff --git a/deps/curl/tests/data/test1451 b/deps/curl/tests/data/test1451 index 9fdd68a6..be424011 100644 --- a/deps/curl/tests/data/test1451 +++ b/deps/curl/tests/data/test1451 @@ -28,9 +28,6 @@ Basic SMB request -u 'curltest:curltest' smb://%HOSTIP:%SMBPORT/TESTS/%TESTNUMBER - -python3 -c "__import__('pkgutil').find_loader('impacket') or (__import__('sys').stdout.write('Test only works if Python package impacket is installed\n'), __import__('sys').exit(1))" - # diff --git a/deps/curl/tests/data/test1454 b/deps/curl/tests/data/test1454 index 4908a178..dff914b1 100644 --- a/deps/curl/tests/data/test1454 +++ b/deps/curl/tests/data/test1454 @@ -14,7 +14,7 @@ # Client-side -!ipv6 +!IPv6 http diff --git a/deps/curl/tests/data/test1456 b/deps/curl/tests/data/test1456 index 3f3a7478..d846b41e 100644 --- a/deps/curl/tests/data/test1456 +++ b/deps/curl/tests/data/test1456 @@ -31,7 +31,7 @@ These data aren't actually sent to the client # Client-side -ipv6 +IPv6 http-ipv6 diff --git a/deps/curl/tests/data/test1459 b/deps/curl/tests/data/test1459 index c05da3cb..335b2657 100644 --- a/deps/curl/tests/data/test1459 +++ b/deps/curl/tests/data/test1459 @@ -40,9 +40,5 @@ CURL_HOME=%PWD/%LOGDIR/test%TESTNUMBER.dir 60 - -disable - - diff --git a/deps/curl/tests/data/test146 b/deps/curl/tests/data/test146 index 803fbfc4..c7586573 100644 --- a/deps/curl/tests/data/test146 +++ b/deps/curl/tests/data/test146 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/%TESTNU # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1460 b/deps/curl/tests/data/test1460 index c3180ff9..7422d4b9 100644 --- a/deps/curl/tests/data/test1460 +++ b/deps/curl/tests/data/test1460 @@ -11,33 +11,26 @@ HTTP GET HTTP/1.1 200 swsclose - 12345 -fooo -54 3 2 1 +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange +Content-Length: 4 +hej # # Client-side -# this relies on the debug feature to allow us to set directory to store the -# -J output in - -debug - http HTTP GET with -Ji and Content-Disposition with existing file - -CURL_TESTDIR=%LOGDIR - -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Ji -O +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -Ji -O --output-dir %LOGDIR initial content @@ -47,9 +40,9 @@ initial content # # Verify data after the test has been "shot" -# Warning: --include and --remote-header-name cannot be combined. +# Warning: Failed to open the file log/name1460: File exists -2 +23 initial content diff --git a/deps/curl/tests/data/test1461 b/deps/curl/tests/data/test1461 index e25e29f3..f1c481ec 100644 --- a/deps/curl/tests/data/test1461 +++ b/deps/curl/tests/data/test1461 @@ -13,6 +13,9 @@ # # Client-side + +manual + none @@ -32,22 +35,26 @@ curl important --help Usage: curl [options...] - -d, --data HTTP POST data - -f, --fail Fail fast with no output on HTTP errors - -h, --help Get help for commands - -i, --include Include protocol response headers in the output - -o, --output Write to file instead of stdout - -O, --remote-name Write output to a file named as the remote file - -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 + -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 stripped into categories. -Use "--help category" to get an overview of all categories. -For all options use the manual or "--help all". +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, +upload, verbose. +Use "--help all" to list all options +Use "--help [option]" to view documentation for a given option diff --git a/deps/curl/tests/data/test1462 b/deps/curl/tests/data/test1462 index 654e4434..a3cc46e3 100644 --- a/deps/curl/tests/data/test1462 +++ b/deps/curl/tests/data/test1462 @@ -31,31 +31,33 @@ curl invalid category --help 0 -Usage: curl [options...] -Invalid category provided, here is a list of all categories: +Unknown category provided, here is a list of all categories: - auth Different types of authentication methods - connection Low level networking operations + auth Authentication methods + connection Manage connections curl The command line tool itself - dns General DNS options - file FILE protocol options - ftp FTP protocol options - http HTTP and HTTPS protocol options - imap IMAP protocol options - misc Options that don't fit into any other category + deprecated Legacy + dns Names and resolving + file FILE protocol + ftp FTP protocol + global Global options + http HTTP and HTTPS protocol + imap IMAP protocol + ldap LDAP protocol output Filesystem output - pop3 POP3 protocol options - post HTTP Post specific options - proxy All options related to proxies - scp SCP protocol options - sftp SFTP protocol options - smtp SMTP protocol options - ssh SSH protocol options - telnet TELNET protocol options - tftp TFTP protocol options - tls All TLS/SSL related options - upload All options for uploads - verbose Options related to any kind of command line output of curl + pop3 POP3 protocol + post HTTP POST specific + proxy Options for proxies + scp SCP protocol + sftp SFTP protocol + smtp SMTP protocol + ssh SSH protocol + telnet TELNET protocol + tftp TFTP protocol + timeout Timeouts and delays + tls TLS/SSL related + upload Upload, sending data + verbose Tracing, logging etc diff --git a/deps/curl/tests/data/test1463 b/deps/curl/tests/data/test1463 index c59ac552..9fd527f7 100644 --- a/deps/curl/tests/data/test1463 +++ b/deps/curl/tests/data/test1463 @@ -35,11 +35,11 @@ curl file category --help 0 -Usage: curl [options...] -file: FILE protocol options - --create-file-mode File mode for created files - -I, --head Show document info only - -r, --range Retrieve only the bytes within RANGE +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/deps/curl/tests/data/test1464 b/deps/curl/tests/data/test1464 index 091933df..59f58dfc 100644 --- a/deps/curl/tests/data/test1464 +++ b/deps/curl/tests/data/test1464 @@ -35,11 +35,11 @@ curl file category --help with lower/upper mix 0 -Usage: curl [options...] -file: FILE protocol options - --create-file-mode File mode for created files - -I, --head Show document info only - -r, --range Retrieve only the bytes within RANGE +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/deps/curl/tests/data/test1467 b/deps/curl/tests/data/test1467 index bf6ed8f3..568670a7 100644 --- a/deps/curl/tests/data/test1467 +++ b/deps/curl/tests/data/test1467 @@ -4,7 +4,7 @@ HTTP HTTP GET SOCKS5 -unix sockets +UnixSockets @@ -32,14 +32,14 @@ Funny-head: yesyes proxy -unix-sockets +UnixSockets http socks5unix -HTTP GET via SOCKS5 proxy via unix sockets +HTTP GET via SOCKS5 proxy via Unix sockets --socks5 localhost%SOCKSUNIXPATH http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test1468 b/deps/curl/tests/data/test1468 index dad25df1..9836434d 100644 --- a/deps/curl/tests/data/test1468 +++ b/deps/curl/tests/data/test1468 @@ -5,7 +5,7 @@ HTTP HTTP GET SOCKS5 SOCKS5h -unix sockets +UnixSockets @@ -33,14 +33,14 @@ Funny-head: yesyes proxy -unix-sockets +UnixSockets http socks5unix -HTTP GET with host name using SOCKS5h via unix sockets +HTTP GET with host name using SOCKS5h via Unix sockets http://this.is.a.host.name:%HTTPPORT/%TESTNUMBER --proxy socks5h://localhost%SOCKSUNIXPATH diff --git a/deps/curl/tests/data/test147 b/deps/curl/tests/data/test147 index 769043d4..b2772f60 100644 --- a/deps/curl/tests/data/test147 +++ b/deps/curl/tests/data/test147 @@ -31,6 +31,9 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/%TESTNUMBER --ftp-create-dirs # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1470 b/deps/curl/tests/data/test1470 index ad4fb711..1c9389a4 100644 --- a/deps/curl/tests/data/test1470 +++ b/deps/curl/tests/data/test1470 @@ -6,7 +6,7 @@ HTTP HTTP GET SOCKS5 SOCKS5h -unix sockets +UnixSockets @@ -34,14 +34,14 @@ Funny-head: yesyes proxy -unix-sockets +UnixSockets https socks5unix -HTTPS GET with host name using SOCKS5h via unix sockets +HTTPS GET with host name using SOCKS5h via Unix sockets https://this.is.a.host.name:%HTTPSPORT/%TESTNUMBER -k --proxy socks5h://localhost%SOCKSUNIXPATH diff --git a/deps/curl/tests/data/test1478 b/deps/curl/tests/data/test1478 index b489ac03..ef7b4037 100644 --- a/deps/curl/tests/data/test1478 +++ b/deps/curl/tests/data/test1478 @@ -19,7 +19,7 @@ src/tool_listhelp.c is in sync with docs/cmdline-opts -%SRCDIR/../docs/cmdline-opts/gen.pl listhelp %SRCDIR/../docs/cmdline-opts/*.md +%SRCDIR/../scripts/managen -d %SRCDIR/../docs/cmdline-opts -I %SRCDIR/../include listhelp %SRCDIR/../docs/cmdline-opts/*.md diff --git a/deps/curl/tests/data/test148 b/deps/curl/tests/data/test148 index 051d31a9..c8ec7a6d 100644 --- a/deps/curl/tests/data/test148 +++ b/deps/curl/tests/data/test148 @@ -28,6 +28,9 @@ ftp://%HOSTIP:%FTPPORT/attempt/to/get/this/%TESTNUMBER --ftp-create-dirs # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1481 b/deps/curl/tests/data/test1481 new file mode 100644 index 00000000..5d79e695 --- /dev/null +++ b/deps/curl/tests/data/test1481 @@ -0,0 +1,118 @@ + + + +HTTP +HTTP GET +--libcurl + + + +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Connection: close + + + + +# Client-side + + +http + + +proxy +SSL + + +--libcurl with TLS version options + + +SSL_CERT_FILE= + + +http://moo/ --libcurl %LOGDIR/test%TESTNUMBER.c --tls-max 1.3 --proxy-tlsv1 -x http://%HOSTIP:%HTTPPORT + + + +# 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 + + + +s/(USERAGENT, \")[^\"]+/${1}stripped/ +# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with +# CURLOPT_INTERLEAVEDATA requires RTSP protocol +# configurations - just ignore them +$_ = '' if /CURLOPT_SSL_VERIFYPEER/ +$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ +$_ = '' if /CURLOPT_HTTP_VERSION/ +$_ = '' if /CURLOPT_HTTP09_ALLOWED/ +$_ = '' if /CURLOPT_INTERLEAVEDATA/ + + +/********* 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_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_DEFAULT | CURL_SSLVERSION_MAX_TLSv1_3)); + curl_easy_setopt(hnd, CURLOPT_PROXY_SSLVERSION, (long)(CURL_SSLVERSION_TLSv1 | CURL_SSLVERSION_MAX_NONE)); + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); +%if ftp + curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L); +%endif + 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_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_ERRORBUFFER was set to an object pointer + CURLOPT_STDERR was set to an object pointer + CURLOPT_DEBUGFUNCTION was set to a function pointer + CURLOPT_DEBUGDATA was set to an object pointer + CURLOPT_HEADERFUNCTION was set to a function pointer + CURLOPT_HEADERDATA 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/deps/curl/tests/data/test1482 b/deps/curl/tests/data/test1482 new file mode 100644 index 00000000..027ccf25 --- /dev/null +++ b/deps/curl/tests/data/test1482 @@ -0,0 +1,87 @@ + + + +HTTP +HTTP GET +chunked Transfer-Encoding +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 +cccccccccccccccccccccccccccccccc + +0 +%if !hyper +chunky-trailer: header data +another-header: yes +%endif + + + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked, chunked +Connection: mooo + +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc +%if !hyper +chunky-trailer: header data +another-header: yes +%endif + + +writedelay: 10 + + + +# +# Client-side + + +http + + +HTTP GET with double chunked in TE header + + +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 + +%if !hyper +chunky-trailer: header data +another-header: yes +%endif + + + + diff --git a/deps/curl/tests/data/test1483 b/deps/curl/tests/data/test1483 new file mode 100644 index 00000000..5bb59a9c --- /dev/null +++ b/deps/curl/tests/data/test1483 @@ -0,0 +1,90 @@ + + + +HTTP +HTTP GET +chunked Transfer-Encoding +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 +cccccccccccccccccccccccccccccccc + +0 +%if !hyper +chunky-trailer: header data +another-header: yes +%endif + + + +HTTP/1.1 200 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Transfer-Encoding: chunked +Transfer-Encoding: chunked +Connection: mooo + +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc +%if !hyper +chunky-trailer: header data +another-header: yes +%endif + + +writedelay: 10 + + + +# +# Client-side + + +http + + +HTTP GET with double chunked in TE header + + +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 + +%if !hyper +chunky-trailer: header data +another-header: yes +%endif + + + + diff --git a/deps/curl/tests/data/test1484 b/deps/curl/tests/data/test1484 new file mode 100644 index 00000000..52de029a --- /dev/null +++ b/deps/curl/tests/data/test1484 @@ -0,0 +1,53 @@ + + + +HTTP +HTTP HEAD + + + +# +# Server-side + + +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 + + + + +# +# Client-side + + +http + + +HTTP HEAD with response body to ignore + + +-I http://%HOSTIP:%HTTPPORT/%TESTNUMBER --http1.1 + + + +# +# Verify data after the test has been "shot" + + +HEAD /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + + diff --git a/deps/curl/tests/data/test1485 b/deps/curl/tests/data/test1485 new file mode 100644 index 00000000..d89362f4 --- /dev/null +++ b/deps/curl/tests/data/test1485 @@ -0,0 +1,51 @@ + + + +HTTP +HTTP GET + + + +# Server-side + + +HTTP/1.1 200 OK +Server: Someone +Content-Length: 7 + +123456 + + +HTTP/1.1 200 OK +Server: Someone +Content-Length: 7 + +123456 + + +# Client-side + + +http + + +lib%TESTNUMBER + + +get curlinfo on last header in callback + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/deps/curl/tests/data/test1486 b/deps/curl/tests/data/test1486 new file mode 100644 index 00000000..e974b99e --- /dev/null +++ b/deps/curl/tests/data/test1486 @@ -0,0 +1,32 @@ + + + +source analysis +docs +--write-out + + + +# +# Client-side + + +none + + + +Verify that write-out.md and tool_writeout.c are in sync + + + +%SRCDIR/test1486.pl %SRCDIR + + + + + +OK + + + + diff --git a/deps/curl/tests/data/test1487 b/deps/curl/tests/data/test1487 new file mode 100644 index 00000000..a3eac5db --- /dev/null +++ b/deps/curl/tests/data/test1487 @@ -0,0 +1,54 @@ + + + +HTTP +HTTP GET +-J + + + +# + + +HTTP/1.1 301 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 + + + +# +# Client-side + + +http + + +HTTP GET with -J and Content-Disposition on 301 + + +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/deps/curl/tests/data/test1488 b/deps/curl/tests/data/test1488 new file mode 100644 index 00000000..f987e151 --- /dev/null +++ b/deps/curl/tests/data/test1488 @@ -0,0 +1,31 @@ + + + +documentation +symbols-in-versions +manpages + + + +# +# Client-side + + +none + + + +symbols-in-versions and manpages agree on added-in versions + + + +%SRCDIR/test1488.pl %SRCDIR/.. ../include/curl + + + + + +OK + + + diff --git a/deps/curl/tests/data/test1489 b/deps/curl/tests/data/test1489 new file mode 100644 index 00000000..e1460bf5 --- /dev/null +++ b/deps/curl/tests/data/test1489 @@ -0,0 +1,66 @@ + + + +HTTP +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 + +-foo- + + + +# +# Client-side + + +http + + +-D sent to stderr + + +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 +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 + + + + diff --git a/deps/curl/tests/data/test149 b/deps/curl/tests/data/test149 index 404922b2..60d9089a 100644 --- a/deps/curl/tests/data/test149 +++ b/deps/curl/tests/data/test149 @@ -27,6 +27,9 @@ send away this contents # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test1490 b/deps/curl/tests/data/test1490 new file mode 100644 index 00000000..41d4c3a4 --- /dev/null +++ b/deps/curl/tests/data/test1490 @@ -0,0 +1,43 @@ + + + +FILE + + + +# no Server-side + +# Client-side + + +file + + +"upload" with file:// overwriting existing + + +file://localhost%FILE_PWD/%LOGDIR/result%TESTNUMBER.txt -T %LOGDIR/upload%TESTNUMBER.txt + + +data +in +file +to +write + + +already existing + + + +# Verify data after the test has been "shot" + + +data +in +file +to +write + + + diff --git a/deps/curl/tests/data/test1491 b/deps/curl/tests/data/test1491 new file mode 100644 index 00000000..84d4e94e --- /dev/null +++ b/deps/curl/tests/data/test1491 @@ -0,0 +1,37 @@ + + + +FILE + + + + + + +# Client-side + + +file + + +file:// don't overwrite self with --skip-existing + + +file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt -o %LOGDIR/test%TESTNUMBER.txt --skip-existing + + +foo + bar +bar + foo +moo + + + +# Verify data after the test has been "shot" + + +Note: skips transfer, "%LOGDIR/test%TESTNUMBER.txt" exists locally + + + diff --git a/deps/curl/tests/data/test1492 b/deps/curl/tests/data/test1492 new file mode 100644 index 00000000..2e7e1f32 --- /dev/null +++ b/deps/curl/tests/data/test1492 @@ -0,0 +1,63 @@ + + + +HTTP +HTTP GET +-J +--show-headers + + + +# + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Jisposition: inline; filename="name%TESTNUMBER" +Content-Type: text/html + +12345 + + + +# +# Client-side + + +http + + +HTTP GET with -J + --show-headers but no Content-Disposition: + + +http://%HOSTIP:%HTTPPORT/junk%TESTNUMBER -J -O --show-headers --output-dir %LOGDIR + + + +# +# Verify data after the test has been "shot" + + +GET /junk%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 +Content-Length: 6 +Connection: close +Content-Jisposition: inline; filename="name%TESTNUMBER" +Content-Type: text/html + +12345 + + + + diff --git a/deps/curl/tests/data/test1501 b/deps/curl/tests/data/test1501 index 195c1799..070ff7d9 100644 --- a/deps/curl/tests/data/test1501 +++ b/deps/curl/tests/data/test1501 @@ -39,6 +39,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ # Verify data after the test has been "shot" + +QUIT + 0 diff --git a/deps/curl/tests/data/test1521 b/deps/curl/tests/data/test1521 index 21d51fdc..f62f58c5 100644 --- a/deps/curl/tests/data/test1521 +++ b/deps/curl/tests/data/test1521 @@ -26,5 +26,8 @@ unused # # Verify data after the test has been "shot" + +ok + diff --git a/deps/curl/tests/data/test1538 b/deps/curl/tests/data/test1538 index c0f038be..111f2d8d 100644 --- a/deps/curl/tests/data/test1538 +++ b/deps/curl/tests/data/test1538 @@ -37,9 +37,9 @@ e1: Unsupported protocol e2: Failed initialization e3: URL using bad/illegal format or missing URL e4: A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. -e5: Couldn't resolve proxy name -e6: Couldn't resolve host name -e7: Couldn't connect to server +e5: Could not resolve proxy name +e6: Could not resolve hostname +e7: Could not connect to server e8: Weird server reply e9: Access denied to remote resource e10: FTP: The server failed to connect to data port @@ -47,11 +47,11 @@ e11: FTP: unknown PASS reply e12: FTP: Accepting server connect has timed out e13: FTP: unknown PASV reply e14: FTP: unknown 227 response format -e15: FTP: can't figure out the host in the PASV response +e15: FTP: cannot figure out the host in the PASV response e16: Error in the HTTP2 framing layer -e17: FTP: couldn't set file type +e17: FTP: could not set file type e18: Transferred a partial file -e19: FTP: couldn't retrieve (RETR failed) the specified file +e19: FTP: could not retrieve (RETR failed) the specified file e20: Unknown error e21: Quote command returned error e22: HTTP response code said error @@ -68,8 +68,8 @@ e32: Unknown error e33: Requested range was not delivered by the server e34: Internal problem setting up the POST e35: SSL connect error -e36: Couldn't resume download -e37: Couldn't read a file:// file +e36: Could not resume download +e37: Could not read a file:// file e38: LDAP: cannot bind e39: LDAP: search failed e40: Unknown error @@ -91,7 +91,7 @@ e55: Failed sending data to the peer e56: Failure when receiving data from the peer e57: Unknown error e58: Problem with the local SSL certificate -e59: Couldn't use specified SSL cipher +e59: Could not use specified SSL cipher e60: SSL peer certificate or SSH remote key was not OK e61: Unrecognized or bad HTTP Content or Transfer-Encoding e62: Unknown error @@ -133,7 +133,8 @@ e97: proxy handshake error e98: SSL Client Certificate required e99: Unrecoverable error in select/poll e100: A value or data field grew larger than allowed -e101: Unknown error +e101: ECH attempted but failed +e102: Unknown error m-1: Please call curl_multi_perform() soon m0: No error m1: Invalid multi handle diff --git a/deps/curl/tests/data/test1541 b/deps/curl/tests/data/test1541 new file mode 100644 index 00000000..9b29f435 --- /dev/null +++ b/deps/curl/tests/data/test1541 @@ -0,0 +1,74 @@ + + + +HTTP +HTTP GET +chunked Transfer-Encoding +Trailer: +DELAY + + + +# Server-side + + +HTTP/1.1 200 OK swsclose +Transfer-Encoding: chunked + +4 +data +5 +d474 + +0 + + + +CURLINFO_CONNECT_TIME_T on 1st header is OK +CURLINFO_PRETRANSFER_TIME_T on 1st header is OK +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 + +datad474 +CURLINFO_CONNECT_TIME_T on done is OK +CURLINFO_PRETRANSFER_TIME_T on done is OK +CURLINFO_POSTTRANSFER_TIME_T on done is OK +CURLINFO_STARTTRANSFER_TIME_T on done is OK +CURLINFO_APPCONNECT_TIME_T on done is OK +CURLINFO_SPEED_DOWNLOAD_T on done is OK +CURLINFO_TOTAL_TIME_T on done is OK + + +writedelay: 10 + + +# Client-side + + +http + + +lib%TESTNUMBER + + +chunked with trailers and pausing the receive + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + diff --git a/deps/curl/tests/data/test1542 b/deps/curl/tests/data/test1542 index f9806cda..0454d76d 100644 --- a/deps/curl/tests/data/test1542 +++ b/deps/curl/tests/data/test1542 @@ -58,11 +58,11 @@ Accept: */* == Info: Connection #0 to host %HOSTIP left intact == Info: Connection #0 to host %HOSTIP left intact == Info: Connection #0 to host %HOSTIP left intact -== Info: Closing connection +== Info: shutting down connection #0 == Info: Connection #1 to host %HOSTIP left intact -$_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/)) +$_ = '' if (($_ !~ /left intact/) && ($_ !~ /(closing|shutting down) connection #\d+/)) diff --git a/deps/curl/tests/data/test1546 b/deps/curl/tests/data/test1546 new file mode 100644 index 00000000..0ec7093f --- /dev/null +++ b/deps/curl/tests/data/test1546 @@ -0,0 +1,63 @@ + + + +HTTP +HTTP GET +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 + + + + +# +# Client-side + + +libz + + +http + + +HTTP transfer-encoding wrong order + + +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: */* +Connection: TE +TE: gzip + + + +61 + + + diff --git a/deps/curl/tests/data/test1554 b/deps/curl/tests/data/test1554 index c16195c1..8dc248b9 100644 --- a/deps/curl/tests/data/test1554 +++ b/deps/curl/tests/data/test1554 @@ -19,67 +19,57 @@ Content-Length: 29 run 1: foobar and so on fun! --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock +-> 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 -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock +-> 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 -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock +-> 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 -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock --> Mutex lock -<- Mutex unlock +-> Mutex lock CONNECT +<- Mutex unlock CONNECT +-> Mutex lock CONNECT +<- Mutex unlock CONNECT +-> Mutex lock SHARE +<- Mutex unlock SHARE +-> Mutex lock SHARE +-> Mutex lock CONNECT +<- Mutex unlock CONNECT +<- Mutex unlock SHARE diff --git a/deps/curl/tests/data/test1569 b/deps/curl/tests/data/test1569 index 159a8139..24f16ee7 100644 --- a/deps/curl/tests/data/test1569 +++ b/deps/curl/tests/data/test1569 @@ -40,6 +40,9 @@ lib%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test1570 b/deps/curl/tests/data/test1570 index 713ab5ea..e558b9bc 100644 --- a/deps/curl/tests/data/test1570 +++ b/deps/curl/tests/data/test1570 @@ -40,6 +40,9 @@ lib1569 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test159 b/deps/curl/tests/data/test159 index fabcb4f9..cc183855 100644 --- a/deps/curl/tests/data/test159 +++ b/deps/curl/tests/data/test159 @@ -45,7 +45,7 @@ This is not the real page either! NTLM SSL !SSPI -debug +Debug http @@ -53,18 +53,9 @@ http HTTP with NTLM authorization when talking HTTP/1.0 (known to fail) - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --ntlm -0 - -chkhostname curlhost - # Verify data after the test has been "shot" diff --git a/deps/curl/tests/data/test1592 b/deps/curl/tests/data/test1592 index e0adc0ef..4dde4976 100644 --- a/deps/curl/tests/data/test1592 +++ b/deps/curl/tests/data/test1592 @@ -29,9 +29,6 @@ http://a-site-never-accessed.example.org/%TESTNUMBER # Verify data after the test has been "shot" - -disable - 0 diff --git a/deps/curl/tests/data/test1604 b/deps/curl/tests/data/test1604 index 33e4e26c..c8d19f54 100644 --- a/deps/curl/tests/data/test1604 +++ b/deps/curl/tests/data/test1604 @@ -15,7 +15,7 @@ none unittest -Test WIN32/MSDOS filename sanitization +Test Windows/MS-DOS filename sanitization diff --git a/deps/curl/tests/data/test1616 b/deps/curl/tests/data/test1616 new file mode 100644 index 00000000..cce79c12 --- /dev/null +++ b/deps/curl/tests/data/test1616 @@ -0,0 +1,22 @@ + + + +unittest +hash + + + +# +# Client-side + + +none + + +unittest + + +Internal hash_offt create/add/destroy testing, exercising clean functions + + + diff --git a/deps/curl/tests/data/test1631 b/deps/curl/tests/data/test1631 index 83bc83e4..f624c414 100644 --- a/deps/curl/tests/data/test1631 +++ b/deps/curl/tests/data/test1631 @@ -53,6 +53,9 @@ proxy # Verify data after the test has been "shot" + +QUIT + # 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! diff --git a/deps/curl/tests/data/test1632 b/deps/curl/tests/data/test1632 index 18674d21..919f2c52 100644 --- a/deps/curl/tests/data/test1632 +++ b/deps/curl/tests/data/test1632 @@ -62,6 +62,9 @@ proxy # Verify data after the test has been "shot" + +QUIT + # 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! diff --git a/deps/curl/tests/data/test165 b/deps/curl/tests/data/test165 index d0353946..39787db8 100644 --- a/deps/curl/tests/data/test165 +++ b/deps/curl/tests/data/test165 @@ -28,16 +28,14 @@ Funny-head: yesyes http -idn +IDN proxy +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - HTTP over proxy with IDN host name diff --git a/deps/curl/tests/data/test1655 b/deps/curl/tests/data/test1655 index c5ec0912..6e791703 100644 --- a/deps/curl/tests/data/test1655 +++ b/deps/curl/tests/data/test1655 @@ -17,7 +17,7 @@ unittest DoH -unit test for doh_encode +unit test for doh_req_encode diff --git a/deps/curl/tests/data/test1656 b/deps/curl/tests/data/test1656 new file mode 100644 index 00000000..2fab21be --- /dev/null +++ b/deps/curl/tests/data/test1656 @@ -0,0 +1,22 @@ + + + +unittest +Curl_x509_GTime2str + + + +# +# Client-side + + +none + + +unittest + + +Curl_x509_GTime2str unit tests + + + diff --git a/deps/curl/tests/data/test1660 b/deps/curl/tests/data/test1660 index f86126d1..4b6f9615 100644 --- a/deps/curl/tests/data/test1660 +++ b/deps/curl/tests/data/test1660 @@ -52,7 +52,7 @@ this.example [this.example]: 1548400797 Input 12: error 43 Input 13: error 43 Input 14: error 43 -3.example.com [example.com]: 1569905261 includeSubDomains +3.example.com [3.example.com]: 1569905261 includeSubDomains 3.example.com [example.com]: 1569905261 includeSubDomains foo.example.com [example.com]: 1569905261 includeSubDomains 'foo.xample.com' is not HSTS diff --git a/deps/curl/tests/data/test1662 b/deps/curl/tests/data/test1662 index b2fbcce8..7e72add9 100644 --- a/deps/curl/tests/data/test1662 +++ b/deps/curl/tests/data/test1662 @@ -38,7 +38,7 @@ Funny-head: nono Mime -debug +Debug http diff --git a/deps/curl/tests/data/test1663 b/deps/curl/tests/data/test1663 new file mode 100644 index 00000000..160bfde3 --- /dev/null +++ b/deps/curl/tests/data/test1663 @@ -0,0 +1,23 @@ + + + +unittest +interface +bind + + + +# +# Client-side + + +none + + +unittest + + +unit tests for interface option parsing + + + diff --git a/deps/curl/tests/data/test1683 b/deps/curl/tests/data/test1683 index 581470df..66f41cea 100644 --- a/deps/curl/tests/data/test1683 +++ b/deps/curl/tests/data/test1683 @@ -39,11 +39,8 @@ 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, ">", $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, "<", $filename) or die $!; ( eq "to stay the same" and eq "") or die "incorrect $filename" ; close(FH) }' - # @@ -55,5 +52,8 @@ perl -e 'for my $i ((1..100)) { my $filename = "%LOGDIR/exist%TESTNUMBER.$i"; op 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) }' + diff --git a/deps/curl/tests/data/test1700 b/deps/curl/tests/data/test1700 index 8d1fff58..be5644db 100644 --- a/deps/curl/tests/data/test1700 +++ b/deps/curl/tests/data/test1700 @@ -42,7 +42,6 @@ Content-Type: text/html h2c -http http/2 diff --git a/deps/curl/tests/data/test1701 b/deps/curl/tests/data/test1701 index c81862ae..469026d7 100644 --- a/deps/curl/tests/data/test1701 +++ b/deps/curl/tests/data/test1701 @@ -33,7 +33,6 @@ Funny-head: yesyes h2c -http http/2 diff --git a/deps/curl/tests/data/test1702 b/deps/curl/tests/data/test1702 index ced2ca06..ce4a1c04 100644 --- a/deps/curl/tests/data/test1702 +++ b/deps/curl/tests/data/test1702 @@ -32,7 +32,6 @@ Funny-head: yesyes h2c -http http/2 diff --git a/deps/curl/tests/data/test1704 b/deps/curl/tests/data/test1704 index a8f285ee..a8740187 100644 --- a/deps/curl/tests/data/test1704 +++ b/deps/curl/tests/data/test1704 @@ -54,7 +54,7 @@ User-Agent: curl/%VERSION Accept: */* Connection: Upgrade, HTTP2-Settings Upgrade: h2c -HTTP2-Settings: AAMAAABkAAQAoAAAAAIAAAAA +HTTP2-Settings: AAMAAABkAAQAAQAAAAIAAAAA diff --git a/deps/curl/tests/data/test1705 b/deps/curl/tests/data/test1705 new file mode 100644 index 00000000..6736d928 --- /dev/null +++ b/deps/curl/tests/data/test1705 @@ -0,0 +1,302 @@ + + + +script +documentation +managen + + + +# +# Client-side + + +none + + + +managen makes manpage + + + +_header.md +%options +_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. + + +--- +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: + - --verbose $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 + + +--- +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. + + + + +# 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 + + + +%SRCDIR/../scripts/managen -d %LOGDIR -I %SRCDIR/../include mainpage option1.md option2.md + + + + + +option1.md:19:1:WARN: see-also a non-existing option: include +option1.md:19:1:WARN: see-also a non-existing option: silent +option1.md:19:1:WARN: see-also a non-existing option: trace +option1.md:19:1:WARN: see-also a non-existing option: trace-ascii +WARN: option1.md mutexes a non-existing option: trace +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 manpage 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 --next. + +Providing --fakeitreal multiple times has no extra effect. +Disable it again with \-\-no-fakeitreal. + +Example: +.nf +curl --verbose 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 --proto is provided several times, the last set value is used. + +Example: +.nf +curl --proto =http,https,sftp https://example.com +.fi + +See also \fI-v, \-\-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/deps/curl/tests/data/test1706 b/deps/curl/tests/data/test1706 new file mode 100644 index 00000000..7752ecf3 --- /dev/null +++ b/deps/curl/tests/data/test1706 @@ -0,0 +1,288 @@ + + + +script +documentation +managen + + + +# +# Client-side + + +none + + + +managen makes ASCII page + + + +_header.md +%options +_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. + + +--- +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: + - --verbose $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. + + +--- +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. + + + + +# 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 + + + +%SRCDIR/../scripts/managen -d %LOGDIR ascii option1.md option2.md + + + + + +option1.md:19:1:WARN: see-also a non-existing option: include +option1.md:19:1:WARN: see-also a non-existing option: silent +option1.md:19:1:WARN: see-also a non-existing option: trace +option1.md:19:1:WARN: see-also a non-existing option: trace-ascii +WARN: option1.md mutexes a non-existing option: trace +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 --verbose 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/deps/curl/tests/data/test1707 b/deps/curl/tests/data/test1707 new file mode 100644 index 00000000..f1874906 --- /dev/null +++ b/deps/curl/tests/data/test1707 @@ -0,0 +1,27 @@ + + + +curl + + + +# +# Client-side + + +manual + + +none + + + +Verify curl -h --insecure + + + +%SRCDIR/test1707.pl %CURL --insecure %LOGDIR/help%TESTNUMBER ../docs/cmdline-opts/curl.txt + + + + diff --git a/deps/curl/tests/data/test1708 b/deps/curl/tests/data/test1708 new file mode 100644 index 00000000..ab59e71f --- /dev/null +++ b/deps/curl/tests/data/test1708 @@ -0,0 +1,27 @@ + + + +curl + + + +# +# Client-side + + +manual + + +none + + + +Verify curl -h -F + + + +%SRCDIR/test1707.pl %CURL -F %LOGDIR/help%TESTNUMBER ../docs/cmdline-opts/curl.txt + + + + diff --git a/deps/curl/tests/data/test1709 b/deps/curl/tests/data/test1709 new file mode 100644 index 00000000..8482ba49 --- /dev/null +++ b/deps/curl/tests/data/test1709 @@ -0,0 +1,32 @@ + + + +curl + + + +# +# Client-side + + +manual + + +none + + + +Verify curl -h --badone + + + +-h --badone + + + + + +Incorrect option name to show help for, see curl -h + + + diff --git a/deps/curl/tests/data/test1710 b/deps/curl/tests/data/test1710 new file mode 100644 index 00000000..7356355e --- /dev/null +++ b/deps/curl/tests/data/test1710 @@ -0,0 +1,27 @@ + + + +curl + + + +# +# Client-side + + +manual + + +none + + + +Verify curl -h --no-clobber + + + +%SRCDIR/test1707.pl %CURL --no-clobber %LOGDIR/help%TESTNUMBER ../docs/cmdline-opts/curl.txt + + + + diff --git a/deps/curl/tests/data/test173 b/deps/curl/tests/data/test173 index a4bffcd9..5e6f7516 100644 --- a/deps/curl/tests/data/test173 +++ b/deps/curl/tests/data/test173 @@ -31,7 +31,7 @@ http HTTP RFC1867-formpost a file from stdin with "faked" filename -http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F field1=contents1 -F "fileupload=@-;filename=/dev/null;type=text/x-null;format=x-curl" +http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F field1=contents1 -F "fileupload=@-;filename=%DEV_NULL;type=text/x-null;format=x-curl" @@ -64,7 +64,7 @@ Content-Disposition: form-data; name="field1" contents1 ------------------------------5dbea401cd8c -Content-Disposition: form-data; name="fileupload"; filename="/dev/null" +Content-Disposition: form-data; name="fileupload"; filename="%DEV_NULL" Content-Type: text/x-null;format=x-curl line1 diff --git a/deps/curl/tests/data/test1800 b/deps/curl/tests/data/test1800 index de315d06..b1fd8021 100644 --- a/deps/curl/tests/data/test1800 +++ b/deps/curl/tests/data/test1800 @@ -49,7 +49,7 @@ User-Agent: curl/%VERSION Accept: */* Connection: Upgrade, HTTP2-Settings Upgrade: %H2CVER -HTTP2-Settings: AAMAAABkAAQAoAAAAAIAAAAA +HTTP2-Settings: AAMAAABkAAQAAQAAAAIAAAAA diff --git a/deps/curl/tests/data/test182 b/deps/curl/tests/data/test182 index cb1e4f0c..b49f10f8 100644 --- a/deps/curl/tests/data/test182 +++ b/deps/curl/tests/data/test182 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test190 b/deps/curl/tests/data/test190 index b0328fdc..033152f3 100644 --- a/deps/curl/tests/data/test190 +++ b/deps/curl/tests/data/test190 @@ -27,7 +27,7 @@ ftp FTP download with strict timeout and slow CWD -ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER -m %FTPTIME2 +ftp://%HOSTIP:%FTPPORT/path/to/file/%TESTNUMBER -m 10 diff --git a/deps/curl/tests/data/test1901 b/deps/curl/tests/data/test1901 new file mode 100644 index 00000000..143a5f16 --- /dev/null +++ b/deps/curl/tests/data/test1901 @@ -0,0 +1,60 @@ + + + +HTTP +HTTP POST +CURLOPT_READFUNCTION + + + +# Server-side + + +HTTP/1.1 200 OK +Content-Length: 6 +Content-Type: text/html + +-foo- + + + +# Client-side + + +http + + + +Chunked HTTP POST from callback with CURLOPT_POSTFIELDSIZE set + + +lib%TESTNUMBER + + + +http://%HOSTIP:%HTTPPORT/boom + + + +# Verify data after the test has been "shot" + + +POST /boom HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Transfer-Encoding: chunked +Content-Type: application/x-www-form-urlencoded + +3 +one +3 +two +5 +three +4 +four +0 + + + + diff --git a/deps/curl/tests/data/test1908 b/deps/curl/tests/data/test1908 index 4ec55ed2..e4ec639c 100644 --- a/deps/curl/tests/data/test1908 +++ b/deps/curl/tests/data/test1908 @@ -37,7 +37,7 @@ http # require debug so that alt-svc can work over plain old HTTP alt-svc -debug +Debug alt-svc cache save after resetting the handle diff --git a/deps/curl/tests/data/test191 b/deps/curl/tests/data/test191 index 02936936..749a34ec 100644 --- a/deps/curl/tests/data/test191 +++ b/deps/curl/tests/data/test191 @@ -27,6 +27,9 @@ FTP URL with ?-letters in username and password # Verify data after the test has been "shot" + +QUIT + USER use?r PASS pass?word diff --git a/deps/curl/tests/data/test1915 b/deps/curl/tests/data/test1915 index 0af54211..34a2881e 100644 --- a/deps/curl/tests/data/test1915 +++ b/deps/curl/tests/data/test1915 @@ -21,7 +21,6 @@ http none -# require debug so that alt-svc can work over plain old HTTP HSTS read/write callbacks diff --git a/deps/curl/tests/data/test1933 b/deps/curl/tests/data/test1933 index 3f3e8ac2..456c8cfa 100644 --- a/deps/curl/tests/data/test1933 +++ b/deps/curl/tests/data/test1933 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1934 b/deps/curl/tests/data/test1934 index a131df49..f0235a7d 100644 --- a/deps/curl/tests/data/test1934 +++ b/deps/curl/tests/data/test1934 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1935 b/deps/curl/tests/data/test1935 index d39a8647..b36e1fad 100644 --- a/deps/curl/tests/data/test1935 +++ b/deps/curl/tests/data/test1935 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1936 b/deps/curl/tests/data/test1936 index a0d38403..e937235d 100644 --- a/deps/curl/tests/data/test1936 +++ b/deps/curl/tests/data/test1936 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1937 b/deps/curl/tests/data/test1937 index ca1214b8..fc2d48c5 100644 --- a/deps/curl/tests/data/test1937 +++ b/deps/curl/tests/data/test1937 @@ -36,7 +36,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1938 b/deps/curl/tests/data/test1938 index 565a54ff..ed24261b 100644 Binary files a/deps/curl/tests/data/test1938 and b/deps/curl/tests/data/test1938 differ diff --git a/deps/curl/tests/data/test1955 b/deps/curl/tests/data/test1955 index 27bb466c..61b5100b 100644 --- a/deps/curl/tests/data/test1955 +++ b/deps/curl/tests/data/test1955 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1956 b/deps/curl/tests/data/test1956 index 76aaa93a..fbde6d71 100644 --- a/deps/curl/tests/data/test1956 +++ b/deps/curl/tests/data/test1956 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1957 b/deps/curl/tests/data/test1957 index add27db0..39f11ac8 100644 --- a/deps/curl/tests/data/test1957 +++ b/deps/curl/tests/data/test1957 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1958 b/deps/curl/tests/data/test1958 index c54b1796..99989097 100644 --- a/deps/curl/tests/data/test1958 +++ b/deps/curl/tests/data/test1958 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1959 b/deps/curl/tests/data/test1959 index 2be813b0..e3d08050 100644 --- a/deps/curl/tests/data/test1959 +++ b/deps/curl/tests/data/test1959 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test196 b/deps/curl/tests/data/test196 index b1a684f1..c72cbebf 100644 --- a/deps/curl/tests/data/test196 +++ b/deps/curl/tests/data/test196 @@ -22,7 +22,7 @@ ftp FTP transient error, retry request once -ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --retry 1 +ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --retry 1 -w '%{num_retries}\n' @@ -38,5 +38,8 @@ PASS ftp@example.com USER anonymous PASS ftp@example.com + +1 + diff --git a/deps/curl/tests/data/test1970 b/deps/curl/tests/data/test1970 index 1fbe60b4..9ed1a1e6 100644 --- a/deps/curl/tests/data/test1970 +++ b/deps/curl/tests/data/test1970 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1971 b/deps/curl/tests/data/test1971 index c311d176..a0b20c4d 100644 --- a/deps/curl/tests/data/test1971 +++ b/deps/curl/tests/data/test1971 @@ -28,7 +28,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1972 b/deps/curl/tests/data/test1972 index 39e57474..901aae29 100644 --- a/deps/curl/tests/data/test1972 +++ b/deps/curl/tests/data/test1972 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1973 b/deps/curl/tests/data/test1973 index 559fd5fc..af64b90e 100644 --- a/deps/curl/tests/data/test1973 +++ b/deps/curl/tests/data/test1973 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1974 b/deps/curl/tests/data/test1974 index 9b5bb847..ee88bec7 100644 --- a/deps/curl/tests/data/test1974 +++ b/deps/curl/tests/data/test1974 @@ -35,7 +35,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1975 b/deps/curl/tests/data/test1975 index 09256de0..277e35ed 100644 --- a/deps/curl/tests/data/test1975 +++ b/deps/curl/tests/data/test1975 @@ -28,7 +28,7 @@ http # this relies on the debug feature which allow to set the time SSL -debug +Debug crypto diff --git a/deps/curl/tests/data/test1976 b/deps/curl/tests/data/test1976 new file mode 100644 index 00000000..7c04bc65 --- /dev/null +++ b/deps/curl/tests/data/test1976 @@ -0,0 +1,60 @@ + + + +HTTP +CURLOPT_AWS_SIGV4 + + + +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 + + + + +# Client-side + + +http + + +SSL +Debug +crypto + + +HTTP AWS_SIGV4 canonical request header sorting test + + +-X PUT -H "X-Amz-Meta-Test-Two: test2" -H "x-amz-meta-test: test" --aws-sigv4 "aws:amz:us-east-1:s3" -u "xxx:yyy" http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* +^Content-Length:.* +^Accept:.* + + +# 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 +X-Amz-Date: 19700101T000000Z +x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +X-Amz-Meta-Test-Two: test2 +x-amz-meta-test: test + + + + diff --git a/deps/curl/tests/data/test2000 b/deps/curl/tests/data/test2000 index 032bf5b1..ee2e5073 100644 --- a/deps/curl/tests/data/test2000 +++ b/deps/curl/tests/data/test2000 @@ -46,6 +46,9 @@ moo # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test2001 b/deps/curl/tests/data/test2001 index de167353..39eb1ff9 100644 --- a/deps/curl/tests/data/test2001 +++ b/deps/curl/tests/data/test2001 @@ -63,6 +63,9 @@ moo # # Verify data after the test has been "shot" + +QUIT + GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/deps/curl/tests/data/test2002 b/deps/curl/tests/data/test2002 index 4b2b4fef..7a581a5c 100644 --- a/deps/curl/tests/data/test2002 +++ b/deps/curl/tests/data/test2002 @@ -73,6 +73,9 @@ moo # Verify data after the test has been "shot" +QUIT + + ^timeout = [5-6]$ diff --git a/deps/curl/tests/data/test2003 b/deps/curl/tests/data/test2003 index dcd86217..2475bbe3 100644 --- a/deps/curl/tests/data/test2003 +++ b/deps/curl/tests/data/test2003 @@ -73,6 +73,9 @@ moo # Verify data after the test has been "shot" +QUIT + + ^timeout = [5-6]$ diff --git a/deps/curl/tests/data/test2004 b/deps/curl/tests/data/test2004 index 404b354c..a9cb75f7 100644 --- a/deps/curl/tests/data/test2004 +++ b/deps/curl/tests/data/test2004 @@ -72,8 +72,5 @@ for several protocols Test data file for tftp test - -disable - diff --git a/deps/curl/tests/data/test201 b/deps/curl/tests/data/test201 index aff9ca2b..a413ca3f 100644 --- a/deps/curl/tests/data/test201 +++ b/deps/curl/tests/data/test201 @@ -21,7 +21,7 @@ file missing file:// file -file://localhost/%PWD/%LOGDIR/non-existent-file.txt +file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt diff --git a/deps/curl/tests/data/test2023 b/deps/curl/tests/data/test2023 index e395ece9..759e6828 100644 --- a/deps/curl/tests/data/test2023 +++ b/deps/curl/tests/data/test2023 @@ -112,18 +112,9 @@ libauthretry HTTP authorization retry (Basic) - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic basic - -chkhostname curlhost - # Verify data after the test has been "shot" diff --git a/deps/curl/tests/data/test2024 b/deps/curl/tests/data/test2024 index 07bf931a..915f7691 100644 --- a/deps/curl/tests/data/test2024 +++ b/deps/curl/tests/data/test2024 @@ -126,18 +126,9 @@ libauthretry HTTP authorization retry (Basic switching to Digest) - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - http://%HOSTIP:%HTTPPORT/%TESTNUMBER basic digest - -chkhostname curlhost - # Verify data after the test has been "shot" diff --git a/deps/curl/tests/data/test2026 b/deps/curl/tests/data/test2026 index 81d252a3..96e2ad49 100644 --- a/deps/curl/tests/data/test2026 +++ b/deps/curl/tests/data/test2026 @@ -162,18 +162,9 @@ libauthretry HTTP authorization retry (Digest switching to Basic) - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest basic - -chkhostname curlhost - # Verify data after the test has been "shot" diff --git a/deps/curl/tests/data/test2027 b/deps/curl/tests/data/test2027 index 0a933877..45baa64b 100644 --- a/deps/curl/tests/data/test2027 +++ b/deps/curl/tests/data/test2027 @@ -185,18 +185,9 @@ libauthretry HTTP authorization retry (Digest) - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - http://%HOSTIP:%HTTPPORT/%TESTNUMBER digest digest - -chkhostname curlhost - # Verify data after the test has been "shot" diff --git a/deps/curl/tests/data/test2033 b/deps/curl/tests/data/test2033 index 2a9f9009..01056594 100644 --- a/deps/curl/tests/data/test2033 +++ b/deps/curl/tests/data/test2033 @@ -27,6 +27,7 @@ MooMoo SSL SSLpinning Schannel +local-http https Server-localhost-sv.pem @@ -35,16 +36,12 @@ https Server-localhost-sv.pem simple HTTPS GET with DER public key pinning (Schannel variant) -# This test is pointless if we're not using the schannel backend +# This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2034 b/deps/curl/tests/data/test2034 index 5192cb73..68963bd5 100644 --- a/deps/curl/tests/data/test2034 +++ b/deps/curl/tests/data/test2034 @@ -27,6 +27,7 @@ MooMoo SSL SSLpinning !Schannel +local-http https Server-localhost-sv.pem @@ -35,12 +36,8 @@ https Server-localhost-sv.pem simple HTTPS GET with DER public key pinning ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2035 b/deps/curl/tests/data/test2035 index b17cddd5..66fa5874 100644 --- a/deps/curl/tests/data/test2035 +++ b/deps/curl/tests/data/test2035 @@ -18,6 +18,7 @@ PEM certificate SSL SSLpinning +local-http https Server-localhost-sv.pem @@ -26,12 +27,8 @@ https Server-localhost-sv.pem HTTPS wrong DER pinnedpubkey but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.der https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.der https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2037 b/deps/curl/tests/data/test2037 index 96406410..50c4c72e 100644 --- a/deps/curl/tests/data/test2037 +++ b/deps/curl/tests/data/test2037 @@ -27,6 +27,7 @@ MooMoo SSL SSLpinning !Schannel +local-http https Server-localhost-sv.pem @@ -35,12 +36,8 @@ https Server-localhost-sv.pem simple HTTPS GET with PEM public key pinning ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2038 b/deps/curl/tests/data/test2038 index 6cd91d62..2ec01af6 100644 --- a/deps/curl/tests/data/test2038 +++ b/deps/curl/tests/data/test2038 @@ -18,6 +18,7 @@ PEM certificate SSL SSLpinning +local-http https Server-localhost-sv.pem @@ -26,12 +27,8 @@ https Server-localhost-sv.pem HTTPS wrong PEM pinnedpubkey but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pem https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pem https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2039 b/deps/curl/tests/data/test2039 index fdb61ed0..05f23ab7 100644 --- a/deps/curl/tests/data/test2039 +++ b/deps/curl/tests/data/test2039 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -50,6 +48,9 @@ machine %HOSTIP login user2 password passwd2 # # Verify data after the test has been "shot" + +QUIT + USER userdef PASS passwddef diff --git a/deps/curl/tests/data/test2041 b/deps/curl/tests/data/test2041 index b7b461e0..e4ee415e 100644 --- a/deps/curl/tests/data/test2041 +++ b/deps/curl/tests/data/test2041 @@ -27,6 +27,7 @@ MooMoo SSL SSLpinning !Schannel +local-http https Server-localhost-sv.pem @@ -35,12 +36,8 @@ https Server-localhost-sv.pem simple HTTPS GET with base64-sha256 public key pinning ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//AAUDLk4c98xcFUDvA9i/MnA9HuO03IPi15r+Cx9OXnc= https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2042 b/deps/curl/tests/data/test2042 index 594a7e46..13a0fad2 100644 --- a/deps/curl/tests/data/test2042 +++ b/deps/curl/tests/data/test2042 @@ -18,6 +18,7 @@ PEM certificate SSL SSLpinning +local-http https Server-localhost-sv.pem @@ -26,12 +27,8 @@ https Server-localhost-sv.pem HTTPS wrong base64-sha256 pinnedpubkey but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//bSIggTf+ikMG0CtmDlpMVBd7yi7H1md4URogRPqerso= https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//bSIggTf+ikMG0CtmDlpMVBd7yi7H1md4URogRPqerso= https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2046 b/deps/curl/tests/data/test2046 index fc5ddca8..c0d3a0e8 100644 --- a/deps/curl/tests/data/test2046 +++ b/deps/curl/tests/data/test2046 @@ -39,15 +39,13 @@ OK http -idn +IDN +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - Connection reuse with IDN host name diff --git a/deps/curl/tests/data/test2047 b/deps/curl/tests/data/test2047 index 76bed3cc..1d7be6db 100644 --- a/deps/curl/tests/data/test2047 +++ b/deps/curl/tests/data/test2047 @@ -39,16 +39,14 @@ OK http -idn +IDN proxy +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - Connection reuse with IDN host name over HTTP proxy diff --git a/deps/curl/tests/data/test2048 b/deps/curl/tests/data/test2048 index f14c8fbe..63da9c76 100644 --- a/deps/curl/tests/data/test2048 +++ b/deps/curl/tests/data/test2048 @@ -26,7 +26,7 @@ https Server-localhost-sv.pem pinnedpubkey no-match must fail even when insecure ---insecure --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost.nn-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --insecure --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost.nn-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test205 b/deps/curl/tests/data/test205 index 8239f632..d3fbce76 100644 --- a/deps/curl/tests/data/test205 +++ b/deps/curl/tests/data/test205 @@ -14,10 +14,10 @@ FAILURE file -"upload" with file:// +"upload" nonexisting with file:// -file://localhost/%PWD/%LOGDIR/nonexisting/result%TESTNUMBER.txt -T %LOGDIR/upload%TESTNUMBER.txt +file://localhost/%FILE_PWD/%LOGDIR/nonexisting/result%TESTNUMBER.txt -T %LOGDIR/upload%TESTNUMBER.txt data diff --git a/deps/curl/tests/data/test2056 b/deps/curl/tests/data/test2056 index 008f137d..80e59202 100644 --- a/deps/curl/tests/data/test2056 +++ b/deps/curl/tests/data/test2056 @@ -40,7 +40,7 @@ HTTP Negotiate authentication (stub krb5) GSS-API ld_preload -!debug +!Debug LD_PRELOAD=%PWD/libtest/.libs/libstubgss.so diff --git a/deps/curl/tests/data/test2057 b/deps/curl/tests/data/test2057 index dfc7798f..5cbb9459 100644 --- a/deps/curl/tests/data/test2057 +++ b/deps/curl/tests/data/test2057 @@ -51,12 +51,12 @@ Nice auth sir! http -HTTP Negotiate authentication (stub ntlm) +HTTP Negotiate authentication (stub NTLM) GSS-API ld_preload -!debug +!Debug LD_PRELOAD=%PWD/libtest/.libs/libstubgss.so diff --git a/deps/curl/tests/data/test2070 b/deps/curl/tests/data/test2070 index 38b6ca89..e46f4588 100644 --- a/deps/curl/tests/data/test2070 +++ b/deps/curl/tests/data/test2070 @@ -26,6 +26,7 @@ MooMoo SSL Schannel +local-http https Server-localhost-sv.pem @@ -34,16 +35,12 @@ https Server-localhost-sv.pem Ignore certificate revocation "best effort" strategy -# This test is pointless if we're not using the schannel backend +# This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2072 b/deps/curl/tests/data/test2072 index 50cb4b60..c1a25209 100644 --- a/deps/curl/tests/data/test2072 +++ b/deps/curl/tests/data/test2072 @@ -21,13 +21,13 @@ moo file -file:// with unix path resolution behavior for the case of extra slashes +file:// with Unix path resolution behavior for the case of extra slashes -file:////%PWD/%LOGDIR/test%TESTNUMBER.txt +file:////%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt -perl -e "print 'Test requires a unix system' if ( $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'msys');" +%PERL -e "print 'Test requires a Unix system' if ( $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'msys');" foo diff --git a/deps/curl/tests/data/test2079 b/deps/curl/tests/data/test2079 index 0164d1b3..09e36be2 100644 --- a/deps/curl/tests/data/test2079 +++ b/deps/curl/tests/data/test2079 @@ -27,6 +27,7 @@ MooMoo SSL SSLpinning Schannel +local-http https Server-localhost-sv.pem @@ -35,16 +36,12 @@ https Server-localhost-sv.pem simple HTTPS GET with PEM public key pinning (Schannel variant) -# This test is pointless if we're not using the schannel backend +# This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test2087 b/deps/curl/tests/data/test2087 index eb8d3bad..5b7cce5d 100644 --- a/deps/curl/tests/data/test2087 +++ b/deps/curl/tests/data/test2087 @@ -27,6 +27,7 @@ MooMoo SSL SSLpinning Schannel +local-http https Server-localhost-sv.pem @@ -35,16 +36,12 @@ https Server-localhost-sv.pem simple HTTPS GET with base64-sha256 public key pinning (Schannel variant) -# This test is pointless if we're not using the schannel backend +# This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//AAUDLk4c98xcFUDvA9i/MnA9HuO03IPi15r+Cx9OXnc= --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test210 b/deps/curl/tests/data/test210 index 1ee313d7..c4ccb6b2 100644 --- a/deps/curl/tests/data/test210 +++ b/deps/curl/tests/data/test210 @@ -33,6 +33,9 @@ data blobb # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test2100 b/deps/curl/tests/data/test2100 index 120a6af7..3f5f5d92 100644 --- a/deps/curl/tests/data/test2100 +++ b/deps/curl/tests/data/test2100 @@ -47,9 +47,9 @@ http # requires IPv6 so that we can assume and compare both DoH requests -debug +Debug DoH -ipv6 +IPv6 HTTP GET using DoH diff --git a/deps/curl/tests/data/test211 b/deps/curl/tests/data/test211 index 6830727a..01dcad0e 100644 --- a/deps/curl/tests/data/test211 +++ b/deps/curl/tests/data/test211 @@ -34,6 +34,9 @@ data blobb # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test212 b/deps/curl/tests/data/test212 index db0201e1..a16bf421 100644 --- a/deps/curl/tests/data/test212 +++ b/deps/curl/tests/data/test212 @@ -23,7 +23,7 @@ ftp # EPRT is only sent when IPv6 is enabled -ipv6 +IPv6 Get two FTP files with no remote EPRT support @@ -39,6 +39,9 @@ data blobb # Verify data after the test has been "shot" + +QUIT + # Strip the addresses and port number but leave the rest s/^(EPRT \|1\|)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|/$1/ diff --git a/deps/curl/tests/data/test215 b/deps/curl/tests/data/test215 index cead9c74..d2ba2c70 100644 --- a/deps/curl/tests/data/test215 +++ b/deps/curl/tests/data/test215 @@ -7,9 +7,7 @@ FTP # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -21,7 +19,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + @@ -40,6 +38,9 @@ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNUMBER/ ftp://%HOSTIP:%FTPPORT/a/path/%TESTNU # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test216 b/deps/curl/tests/data/test216 index 1be87c0d..a0ec72be 100644 --- a/deps/curl/tests/data/test216 +++ b/deps/curl/tests/data/test216 @@ -27,6 +27,9 @@ upload this file twice # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test227 b/deps/curl/tests/data/test227 index f7b44518..bf55fdd6 100644 --- a/deps/curl/tests/data/test227 +++ b/deps/curl/tests/data/test227 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FA # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test228 b/deps/curl/tests/data/test228 index 8e7d73ff..ae19b534 100644 --- a/deps/curl/tests/data/test228 +++ b/deps/curl/tests/data/test228 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-account "one count" # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test2300 b/deps/curl/tests/data/test2300 index fa620a1b..e8a14592 100644 --- a/deps/curl/tests/data/test2300 +++ b/deps/curl/tests/data/test2300 @@ -27,7 +27,7 @@ upgrade # for the forced CURL_ENTROPY -debug +Debug ws diff --git a/deps/curl/tests/data/test2301 b/deps/curl/tests/data/test2301 index 1f8ed662..cc728d89 100644 --- a/deps/curl/tests/data/test2301 +++ b/deps/curl/tests/data/test2301 @@ -29,7 +29,7 @@ upgrade # require debug for the forced CURL_ENTROPY -debug +Debug ws diff --git a/deps/curl/tests/data/test2302 b/deps/curl/tests/data/test2302 index 013c324e..9ade6a1e 100644 --- a/deps/curl/tests/data/test2302 +++ b/deps/curl/tests/data/test2302 @@ -29,7 +29,7 @@ upgrade # require debug for the forced CURL_ENTROPY -debug +Debug ws diff --git a/deps/curl/tests/data/test2303 b/deps/curl/tests/data/test2303 index dbd1115c..79cb4c2a 100644 --- a/deps/curl/tests/data/test2303 +++ b/deps/curl/tests/data/test2303 @@ -22,7 +22,7 @@ hello # require debug for the forced CURL_ENTROPY -debug +Debug ws diff --git a/deps/curl/tests/data/test2304 b/deps/curl/tests/data/test2304 index 895518fb..8ade3e77 100644 --- a/deps/curl/tests/data/test2304 +++ b/deps/curl/tests/data/test2304 @@ -29,7 +29,7 @@ upgrade # require debug for the forced CURL_ENTROPY -debug +Debug ws diff --git a/deps/curl/tests/data/test2305 b/deps/curl/tests/data/test2305 index 869f6d36..773b5df3 100644 --- a/deps/curl/tests/data/test2305 +++ b/deps/curl/tests/data/test2305 @@ -31,7 +31,7 @@ upgrade # require debug for the forced CURL_ENTROPY -debug +Debug ws @@ -50,7 +50,7 @@ ws://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/save%TESTNUMBER # - + %repeat[256 x helothisisdaniel]% %repeat[256 x helothisisdaniel]% %repeat[256 x helothisisdaniel]% diff --git a/deps/curl/tests/data/test2307 b/deps/curl/tests/data/test2307 index ce260ac1..7c9f625b 100644 --- a/deps/curl/tests/data/test2307 +++ b/deps/curl/tests/data/test2307 @@ -29,7 +29,7 @@ upgrade # require debug for the forced CURL_ENTROPY -debug +Debug ws !hyper diff --git a/deps/curl/tests/data/test2308 b/deps/curl/tests/data/test2308 new file mode 100644 index 00000000..3881d353 --- /dev/null +++ b/deps/curl/tests/data/test2308 @@ -0,0 +1,57 @@ + + + +HTTP +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 + +-foo- + + + +# Client-side + + +http + +# tool to run + +lib%TESTNUMBER + + + +verify return code when write callback returns error + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + +Returned 23, should be 23. + + + diff --git a/deps/curl/tests/data/test235 b/deps/curl/tests/data/test235 index 4bfe7497..485be98e 100644 --- a/deps/curl/tests/data/test235 +++ b/deps/curl/tests/data/test235 @@ -32,6 +32,9 @@ worx? # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test236 b/deps/curl/tests/data/test236 index a66fa046..13493f26 100644 --- a/deps/curl/tests/data/test236 +++ b/deps/curl/tests/data/test236 @@ -33,6 +33,9 @@ Test data # Verify data after the test has been "shot" + +QUIT + USER anonymous diff --git a/deps/curl/tests/data/test238 b/deps/curl/tests/data/test238 index 3c0db044..71b46ddc 100644 --- a/deps/curl/tests/data/test238 +++ b/deps/curl/tests/data/test238 @@ -27,6 +27,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + # 13 = CURLE_FTP_WEIRD_PASV_REPLY 13 diff --git a/deps/curl/tests/data/test240 b/deps/curl/tests/data/test240 index d033ae35..75bd4bb3 100644 --- a/deps/curl/tests/data/test240 +++ b/deps/curl/tests/data/test240 @@ -29,7 +29,7 @@ Funny-head: yesyes # Client-side -ipv6 +IPv6 http-ipv6 diff --git a/deps/curl/tests/data/test2400 b/deps/curl/tests/data/test2400 index e920f4f1..ef7b1266 100644 --- a/deps/curl/tests/data/test2400 +++ b/deps/curl/tests/data/test2400 @@ -27,8 +27,8 @@ Funny-head: yesyes # Client-side -debug -h2c +Debug +http/2 SSL @@ -36,7 +36,7 @@ http http/2 -HTTP/2 GET +HTTP/2 GET over HTTPS diff --git a/deps/curl/tests/data/test2401 b/deps/curl/tests/data/test2401 index ef5fbb18..9929c139 100644 --- a/deps/curl/tests/data/test2401 +++ b/deps/curl/tests/data/test2401 @@ -25,16 +25,15 @@ Funny-head: yesyes # Client-side -debug -h2c +Debug +http/2 SSL -http http/2 -HTTP/2 GET +HTTP/2 POST over HTTPS @@ -57,7 +56,7 @@ via: 1.1 nghttpx -POST /2401 HTTP/1.1 +POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTP2TLSPORT User-Agent: curl/%VERSION Accept: */* diff --git a/deps/curl/tests/data/test2402 b/deps/curl/tests/data/test2402 index 44d48f85..48a48562 100644 --- a/deps/curl/tests/data/test2402 +++ b/deps/curl/tests/data/test2402 @@ -47,18 +47,17 @@ file contents should appear once for each file # Client-side -h2c +http/2 SSL -http http/2 lib%TESTNUMBER -HTTP GET multiple over HTTP/2 +HTTP GET multiple files over HTTP/2 using HTTPS https://%HOSTIP:%HTTP2TLSPORT/path/%TESTNUMBER %HOSTIP %HTTP2TLSPORT diff --git a/deps/curl/tests/data/test2403 b/deps/curl/tests/data/test2403 index 7a993d73..222f236d 100644 --- a/deps/curl/tests/data/test2403 +++ b/deps/curl/tests/data/test2403 @@ -29,16 +29,15 @@ Funny-head: yesyes # Client-side -h2c +http/2 SSL headers-api -http http/2 -HTTP/2 GET +HTTP/2 GET using %{header_json} diff --git a/deps/curl/tests/data/test2404 b/deps/curl/tests/data/test2404 index bcf1035a..89461a46 100644 --- a/deps/curl/tests/data/test2404 +++ b/deps/curl/tests/data/test2404 @@ -47,11 +47,10 @@ file contents should appear once for each file # Client-side -h2c +http/2 SSL -http http/2 diff --git a/deps/curl/tests/data/test2405 b/deps/curl/tests/data/test2405 new file mode 100644 index 00000000..8489156e --- /dev/null +++ b/deps/curl/tests/data/test2405 @@ -0,0 +1,50 @@ + + + +multi +HTTP +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: 6007 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- +%repeat[1000 x foobar]% + + + +# Client-side + + +http/2 + + +lib%TESTNUMBER + + +checking curl_multi_waitfds functionality + + +http://%HOSTIP:%HTTP2PORT/%TESTNUMBER + + + +# Verify data after the test has been "shot" + + + + + diff --git a/deps/curl/tests/data/test2406 b/deps/curl/tests/data/test2406 new file mode 100644 index 00000000..6bf4fa8c --- /dev/null +++ b/deps/curl/tests/data/test2406 @@ -0,0 +1,65 @@ + + + +HTTP +HTTP GET +HTTP/2 +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 + +-foo- + + + +# +# Client-side + + +Debug +http/2 +SSL + + +http/2 + + +HTTP/2 over HTTPS with -f + + + + +-k --http2 -f "https://%HOSTIP:%HTTP2TLSPORT/%TESTNUMBER" + + + + +# +# Verify data after the test has been "shot" + + +HTTP/2 404 +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +server: nghttpx +via: 1.1 nghttpx + + + +22 + + + diff --git a/deps/curl/tests/data/test241 b/deps/curl/tests/data/test241 index 92a43142..38dea3fd 100644 --- a/deps/curl/tests/data/test241 +++ b/deps/curl/tests/data/test241 @@ -24,7 +24,7 @@ hello # Client-side -ipv6 +IPv6 http-ipv6 diff --git a/deps/curl/tests/data/test242 b/deps/curl/tests/data/test242 index a498ab29..91aeb381 100644 --- a/deps/curl/tests/data/test242 +++ b/deps/curl/tests/data/test242 @@ -24,7 +24,7 @@ hello # Client-side -ipv6 +IPv6 http-ipv6 diff --git a/deps/curl/tests/data/test244 b/deps/curl/tests/data/test244 index 782be2be..ad9cf4fe 100644 --- a/deps/curl/tests/data/test244 +++ b/deps/curl/tests/data/test244 @@ -41,6 +41,9 @@ FTP dir listing with nocwd and URL encoded path # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test247 b/deps/curl/tests/data/test247 index 40f42e7d..5eade37b 100644 --- a/deps/curl/tests/data/test247 +++ b/deps/curl/tests/data/test247 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt -z "apr 1 2005 # Verify data after the test has been "shot" + +QUIT + diff --git a/deps/curl/tests/data/test248 b/deps/curl/tests/data/test248 index 097e1e58..2d5c845b 100644 --- a/deps/curl/tests/data/test248 +++ b/deps/curl/tests/data/test248 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt -z "apr 1 2005 # Verify data after the test has been "shot" + +QUIT + data to diff --git a/deps/curl/tests/data/test250 b/deps/curl/tests/data/test250 index 455d9ea1..59f7fa31 100644 --- a/deps/curl/tests/data/test250 +++ b/deps/curl/tests/data/test250 @@ -11,7 +11,7 @@ SLOWDOWN # When doing LIST, we get the default list output hard-coded in the test # FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + SLOWDOWN @@ -46,6 +46,9 @@ ftp://%HOSTIP:%FTPPORT/ # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test2500 b/deps/curl/tests/data/test2500 index 6ec739d1..f880672d 100644 --- a/deps/curl/tests/data/test2500 +++ b/deps/curl/tests/data/test2500 @@ -33,7 +33,6 @@ http/3 nghttpx-h3 -http http/3 diff --git a/deps/curl/tests/data/test2501 b/deps/curl/tests/data/test2501 index 4db52ecf..1f35372f 100644 --- a/deps/curl/tests/data/test2501 +++ b/deps/curl/tests/data/test2501 @@ -25,12 +25,11 @@ Funny-head: yesyes # Client-side -debug +Debug http http/3 -http http/3 diff --git a/deps/curl/tests/data/test2502 b/deps/curl/tests/data/test2502 index aae65e1c..2efd04f2 100644 --- a/deps/curl/tests/data/test2502 +++ b/deps/curl/tests/data/test2502 @@ -50,7 +50,6 @@ file contents should appear once for each file http/3 -http http/3 @@ -92,10 +91,10 @@ Via: 3 nghttpx ^Host:.* -* Connection #0 to host localhost left intact -* Connection #0 to host localhost left intact -* Connection #0 to host localhost left intact -* Connection #0 to host localhost left intact +== Info: Connection #0 to host localhost left intact +== Info: Connection #0 to host localhost left intact +== Info: Connection #0 to host localhost left intact +== Info: Connection #0 to host localhost left intact $_ = '' if (($_ !~ /left intact/) && ($_ !~ /Closing connection/)) diff --git a/deps/curl/tests/data/test2503 b/deps/curl/tests/data/test2503 index 9877ee4c..ab86c66b 100644 --- a/deps/curl/tests/data/test2503 +++ b/deps/curl/tests/data/test2503 @@ -33,7 +33,6 @@ nghttpx-h3 headers-api -http http/3 diff --git a/deps/curl/tests/data/test251 b/deps/curl/tests/data/test251 index 46124bfe..6de2003c 100644 --- a/deps/curl/tests/data/test251 +++ b/deps/curl/tests/data/test251 @@ -8,9 +8,7 @@ SLOWDOWN # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -22,7 +20,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + SLOWDOWN @@ -43,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test252 b/deps/curl/tests/data/test252 index 220cda18..35c3014a 100644 --- a/deps/curl/tests/data/test252 +++ b/deps/curl/tests/data/test252 @@ -10,9 +10,7 @@ EPSV # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,14 +22,14 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # # Client-side -ipv6 +IPv6 ftp-ipv6 @@ -47,6 +45,9 @@ FTP IPv6 dir list PASV # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test253 b/deps/curl/tests/data/test253 index 2c1008d7..8f7192d2 100644 --- a/deps/curl/tests/data/test253 +++ b/deps/curl/tests/data/test253 @@ -10,9 +10,7 @@ EPRT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -21,17 +19,17 @@ drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev drwxrwxrwx 2 98 98 512 May 29 16:04 download.html -dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc +dr-xr-xr-x 2 0 1 512 Nov 30 1995 moo drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # # Client-side -ipv6 +IPv6 ftp-ipv6 @@ -47,6 +45,9 @@ FTP IPv6 dir list with EPRT # # Verify data after the test has been "shot" + +QUIT + s/^(EPRT \|2\|::1\|)(.*)/$1/ diff --git a/deps/curl/tests/data/test254 b/deps/curl/tests/data/test254 index 30978758..ede44535 100644 --- a/deps/curl/tests/data/test254 +++ b/deps/curl/tests/data/test254 @@ -11,9 +11,7 @@ EPSV # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,14 +23,14 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # # Client-side -ipv6 +IPv6 ftp-ipv6 @@ -48,6 +46,9 @@ FTP IPv6 dir list PASV and --disable-epsv # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test255 b/deps/curl/tests/data/test255 index 37b9da2a..190908e3 100644 --- a/deps/curl/tests/data/test255 +++ b/deps/curl/tests/data/test255 @@ -11,9 +11,7 @@ EPRT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,14 +23,14 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # # Client-side -ipv6 +IPv6 ftp-ipv6 @@ -48,6 +46,9 @@ FTP IPv6 dir list with EPRT and --disable-eprt # # Verify data after the test has been "shot" + +QUIT + s/^(EPRT \|2\|::1\|)(.*)/$1/ diff --git a/deps/curl/tests/data/test2600 b/deps/curl/tests/data/test2600 index 5b88aedb..0b4ee8b2 100644 --- a/deps/curl/tests/data/test2600 +++ b/deps/curl/tests/data/test2600 @@ -15,8 +15,9 @@ none unittest -debug +Debug http +!win32 connection filter connect/destroy unit tests diff --git a/deps/curl/tests/data/test2604 b/deps/curl/tests/data/test2604 new file mode 100644 index 00000000..4e825aa2 --- /dev/null +++ b/deps/curl/tests/data/test2604 @@ -0,0 +1,22 @@ + + + +unittest + + + +# +# Client-side + + +none + + +unittest +sftp + + +Curl_get_pathname unit test + + + diff --git a/deps/curl/tests/data/test261 b/deps/curl/tests/data/test261 index d5f94037..192b2bcd 100644 --- a/deps/curl/tests/data/test261 +++ b/deps/curl/tests/data/test261 @@ -34,6 +34,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test263 b/deps/curl/tests/data/test263 index 93e98a19..64870252 100644 --- a/deps/curl/tests/data/test263 +++ b/deps/curl/tests/data/test263 @@ -24,7 +24,7 @@ hello # Client-side -ipv6 +IPv6 proxy diff --git a/deps/curl/tests/data/test268 b/deps/curl/tests/data/test268 index 3a1ab6a9..0d205fe7 100644 --- a/deps/curl/tests/data/test268 +++ b/deps/curl/tests/data/test268 @@ -32,7 +32,7 @@ Funny-head: yesyes http -JSON encoding of unicode string +JSON encoding of Unicode string %hex[%e2%80%9c]hex% diff --git a/deps/curl/tests/data/test270 b/deps/curl/tests/data/test270 index efa183f1..f4f5a023 100644 --- a/deps/curl/tests/data/test270 +++ b/deps/curl/tests/data/test270 @@ -36,6 +36,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --ftp-skip-pasv-ip --disable-epsv # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test272 b/deps/curl/tests/data/test272 index 2857c3ea..5607a108 100644 --- a/deps/curl/tests/data/test272 +++ b/deps/curl/tests/data/test272 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -z "2004 jan 1 12:12:12 UTC" # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test280 b/deps/curl/tests/data/test280 index 1ed41e65..dbe809e1 100644 --- a/deps/curl/tests/data/test280 +++ b/deps/curl/tests/data/test280 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,8 +21,8 @@ dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub -dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - +dr-xr-xr-x 5 0 1 512 Oct 1 1997 fine + REPLY USER 530 We don't like USER commands COUNT USER 1 @@ -48,6 +46,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ --ftp-alternative-to-user "USER replacement" # # Verify data after the test has been "shot" + +QUIT + USER anonymous USER replacement diff --git a/deps/curl/tests/data/test29 b/deps/curl/tests/data/test29 index 64d5e6c6..689ac43e 100644 --- a/deps/curl/tests/data/test29 +++ b/deps/curl/tests/data/test29 @@ -26,6 +26,9 @@ wait 10 http + +http + HTTP with 2 secs timeout diff --git a/deps/curl/tests/data/test290 b/deps/curl/tests/data/test290 index e7048a53..6ffa9a72 100644 --- a/deps/curl/tests/data/test290 +++ b/deps/curl/tests/data/test290 @@ -27,6 +27,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --max-filesize 30 # Verify data after the test has been "shot" + +QUIT + 63 diff --git a/deps/curl/tests/data/test291 b/deps/curl/tests/data/test291 index 05cc2b44..2385f7db 100644 --- a/deps/curl/tests/data/test291 +++ b/deps/curl/tests/data/test291 @@ -33,6 +33,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --max-filesize 100 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test294 b/deps/curl/tests/data/test294 index b840b8c7..4e2e9857 100644 --- a/deps/curl/tests/data/test294 +++ b/deps/curl/tests/data/test294 @@ -11,9 +11,7 @@ ACCT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + REPLY PASS 332 Give me an ACCT now REPLY ACCT 230 Thank-you for the ACCT @@ -49,6 +47,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER/ --ftp-account "data for acct" # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test296 b/deps/curl/tests/data/test296 index c88ec99b..d4b87dfa 100644 --- a/deps/curl/tests/data/test296 +++ b/deps/curl/tests/data/test296 @@ -31,6 +31,9 @@ FTP CWD with --ftp-method multicwd # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test297 b/deps/curl/tests/data/test297 index 99c10d3e..d982a3b7 100644 --- a/deps/curl/tests/data/test297 +++ b/deps/curl/tests/data/test297 @@ -31,6 +31,9 @@ FTP CWD with --ftp-method singlecwd # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test298 b/deps/curl/tests/data/test298 index 5188c854..3880a607 100644 --- a/deps/curl/tests/data/test298 +++ b/deps/curl/tests/data/test298 @@ -31,6 +31,9 @@ FTP CWD with --ftp-method nocwd # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test3000 b/deps/curl/tests/data/test3000 index 05f4a010..43c2695c 100644 --- a/deps/curl/tests/data/test3000 +++ b/deps/curl/tests/data/test3000 @@ -26,6 +26,7 @@ MooMoo SSL !Schannel +local-http https Server-localhost-firstSAN-sv.pem @@ -34,12 +35,8 @@ https Server-localhost-firstSAN-sv.pem HTTPS GET to localhost, first subject alt name matches, CN does not match ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test3001 b/deps/curl/tests/data/test3001 index 3a954324..9bfeb708 100644 --- a/deps/curl/tests/data/test3001 +++ b/deps/curl/tests/data/test3001 @@ -26,6 +26,7 @@ MooMoo SSL !Schannel +local-http https Server-localhost-lastSAN-sv.pem @@ -34,12 +35,8 @@ https Server-localhost-lastSAN-sv.pem HTTPS GET to localhost, last subject alt name matches, CN does not match ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test3015 b/deps/curl/tests/data/test3015 index 5b59bba3..41e0640b 100644 --- a/deps/curl/tests/data/test3015 +++ b/deps/curl/tests/data/test3015 @@ -50,7 +50,7 @@ http HTTP GET -w num_headers with redirected fetch (2 connects) -http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_headers}\n" -L -o/dev/null +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_headers}\n" -L -o%DEV_NULL diff --git a/deps/curl/tests/data/test3016 b/deps/curl/tests/data/test3016 index d04633c7..e1285a32 100644 --- a/deps/curl/tests/data/test3016 +++ b/deps/curl/tests/data/test3016 @@ -21,7 +21,7 @@ GET a directory using file:// !win32 -file://%PWD/ +file://%FILE_PWD/ diff --git a/deps/curl/tests/data/test3017 b/deps/curl/tests/data/test3017 index 4d907b39..209babf2 100644 --- a/deps/curl/tests/data/test3017 +++ b/deps/curl/tests/data/test3017 @@ -47,7 +47,7 @@ mqtt://%HOSTIP:%MQTTPORT/%TESTNUMBER -m 3 s/^(.* 00044d5154540402003c000c6375726c).*/$1/ -# on windows the disconnect is never seen - no idea why +# on Windows the disconnect is never seen - no idea why ^server DISCONNECT 0 e000 diff --git a/deps/curl/tests/data/test3018 b/deps/curl/tests/data/test3018 index 71e06b59..d58daf41 100644 --- a/deps/curl/tests/data/test3018 +++ b/deps/curl/tests/data/test3018 @@ -45,7 +45,7 @@ mqtt://%HOSTIP:%MQTTPORT/%TESTNUMBER --max-filesize 11 s/^(.* 00044d5154540402003c000c6375726c).*/$1/ -# on windows the disconnect is never seen - no idea why +# on Windows the disconnect is never seen - no idea why ^server DISCONNECT 0 e000 diff --git a/deps/curl/tests/data/test3021 b/deps/curl/tests/data/test3021 index bdf8f375..56b4f9b4 100644 --- a/deps/curl/tests/data/test3021 +++ b/deps/curl/tests/data/test3021 @@ -46,8 +46,5 @@ test 0 - -disable - diff --git a/deps/curl/tests/data/test3022 b/deps/curl/tests/data/test3022 index d76e5f49..1213a028 100644 --- a/deps/curl/tests/data/test3022 +++ b/deps/curl/tests/data/test3022 @@ -46,8 +46,5 @@ test 0 - -disable - diff --git a/deps/curl/tests/data/test3023 b/deps/curl/tests/data/test3023 index fe43c199..09e66331 100644 --- a/deps/curl/tests/data/test3023 +++ b/deps/curl/tests/data/test3023 @@ -26,6 +26,7 @@ MooMoo SSL Schannel +local-http https Server-localhost-firstSAN-sv.pem @@ -34,16 +35,12 @@ https Server-localhost-firstSAN-sv.pem HTTPS GET to localhost, first subject alt name matches, CN does not match (Schannel variant) -# This test is pointless if we're not using the schannel backend +# This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test3024 b/deps/curl/tests/data/test3024 index 55b26788..11c7643f 100644 --- a/deps/curl/tests/data/test3024 +++ b/deps/curl/tests/data/test3024 @@ -26,6 +26,7 @@ MooMoo SSL Schannel +local-http https Server-localhost-lastSAN-sv.pem @@ -34,16 +35,12 @@ https Server-localhost-lastSAN-sv.pem HTTPS GET to localhost, last subject alt name matches, CN does not match (Schannel variant) -# This test is pointless if we're not using the schannel backend +# This test is pointless if we are not using the Schannel backend CURL_SSL_BACKEND=schannel ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test3027 b/deps/curl/tests/data/test3027 index 05a811f4..416c0079 100644 --- a/deps/curl/tests/data/test3027 +++ b/deps/curl/tests/data/test3027 @@ -40,6 +40,9 @@ data blobb # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test3029 b/deps/curl/tests/data/test3029 index 2e51bbea..14366020 100644 --- a/deps/curl/tests/data/test3029 +++ b/deps/curl/tests/data/test3029 @@ -36,4 +36,4 @@ Content-Length: 6 - \ No newline at end of file + diff --git a/deps/curl/tests/data/test3030 b/deps/curl/tests/data/test3030 index 7e169cf4..56da81c7 100644 --- a/deps/curl/tests/data/test3030 +++ b/deps/curl/tests/data/test3030 @@ -40,4 +40,4 @@ Content-Length: 6 - \ No newline at end of file + diff --git a/deps/curl/tests/data/test3031 b/deps/curl/tests/data/test3031 new file mode 100644 index 00000000..58edc376 --- /dev/null +++ b/deps/curl/tests/data/test3031 @@ -0,0 +1,67 @@ + + + +--dump-header + + +# +# 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 + +-foo- + + + +# +# Client-side + + +http + + +http + + +--output-dir with --create-dirs + + +http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER --dump-header %PWD/%LOGDIR/tmp/out.txt --create-dirs + + + +# +# 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 +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 + + + + diff --git a/deps/curl/tests/data/test307 b/deps/curl/tests/data/test307 index ce3232ac..475fdaee 100644 --- a/deps/curl/tests/data/test307 +++ b/deps/curl/tests/data/test307 @@ -29,7 +29,7 @@ OpenSSL https -perl %SRCDIR/libtest/test%TESTNUMBER.pl %CURL +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl %CURL diff --git a/deps/curl/tests/data/test31 b/deps/curl/tests/data/test31 index 3ceaad0f..d9d07399 100644 --- a/deps/curl/tests/data/test31 +++ b/deps/curl/tests/data/test31 @@ -144,11 +144,9 @@ TZ=GMT http://test31.curl:%HTTPPORT/we/want/%TESTNUMBER -b none -c %LOGDIR/jar%TESTNUMBER.txt --resolve test31.curl:%HTTPPORT:127.0.0.1 - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - cookies +local-http diff --git a/deps/curl/tests/data/test310 b/deps/curl/tests/data/test310 index b9f1850e..1baf3209 100644 --- a/deps/curl/tests/data/test310 +++ b/deps/curl/tests/data/test310 @@ -26,6 +26,7 @@ MooMoo SSL !Schannel +local-http https Server-localhost-sv.pem @@ -34,12 +35,8 @@ https Server-localhost-sv.pem simple HTTPS GET ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test3102 b/deps/curl/tests/data/test3102 index 4df7ba9c..7635e654 100644 --- a/deps/curl/tests/data/test3102 +++ b/deps/curl/tests/data/test3102 @@ -20,7 +20,6 @@ HTTP GET SSL !bearssl -!mbedtls !rustls !wolfssl diff --git a/deps/curl/tests/data/test311 b/deps/curl/tests/data/test311 index a3f9ed0e..61fe2e90 100644 --- a/deps/curl/tests/data/test311 +++ b/deps/curl/tests/data/test311 @@ -17,6 +17,7 @@ PEM certificate SSL +local-http https Server-localhost0h-sv.pem @@ -25,12 +26,8 @@ https Server-localhost0h-sv.pem HTTPS wrong subjectAltName but right CN ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test312 b/deps/curl/tests/data/test312 index c8c46b82..52fc37cb 100644 --- a/deps/curl/tests/data/test312 +++ b/deps/curl/tests/data/test312 @@ -17,6 +17,7 @@ PEM certificate SSL +local-http https Server-localhost.nn-sv.pem @@ -25,12 +26,8 @@ https Server-localhost.nn-sv.pem HTTPS GET to localhost and null-prefixed CN cert ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test313 b/deps/curl/tests/data/test313 index 12f91f96..cff9a9b2 100644 --- a/deps/curl/tests/data/test313 +++ b/deps/curl/tests/data/test313 @@ -13,6 +13,7 @@ CRL SSL +local-http https Server-localhost-sv.pem @@ -21,12 +22,8 @@ https Server-localhost-sv.pem CRL test ---cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/%TESTNUMBER +-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/%TESTNUMBER -# Ensure that we're running on localhost because we're checking the host name - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test3202 b/deps/curl/tests/data/test3202 index 25ec6073..48a74e13 100644 --- a/deps/curl/tests/data/test3202 +++ b/deps/curl/tests/data/test3202 @@ -31,7 +31,7 @@ These data aren't actually sent to the client # Client-side -ipv6 +IPv6 http-ipv6 diff --git a/deps/curl/tests/data/test3203 b/deps/curl/tests/data/test3203 new file mode 100644 index 00000000..527e870a --- /dev/null +++ b/deps/curl/tests/data/test3203 @@ -0,0 +1,41 @@ + + + +HTTP +HTTP GET +FILE + + + +# +# Client-side + + +file + + +GET a directory using file:// + + + +!win32 + + +file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.dir/ + + +Contents of file are irrelevant + + + +# +# Verify data after the test has been "shot" + + +0 + + +dir-listing-test.txt + + + diff --git a/deps/curl/tests/data/test3204 b/deps/curl/tests/data/test3204 new file mode 100644 index 00000000..8cc9c2f5 --- /dev/null +++ b/deps/curl/tests/data/test3204 @@ -0,0 +1,52 @@ + + + +HTTP +HTTP GET + + + +# +# Server-side + + +HTTP/1.1 304 Not Modified +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +ETag: "21025-dc7-39462498" + + + + +# +# Client-side + + +http + + +Use --etag-compare and --etag-save on an existing file + + +"21025-dc7-39462498" + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER --etag-save %LOGDIR/etag%TESTNUMBER + + + +# 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" + + + +"21025-dc7-39462498" + + + diff --git a/deps/curl/tests/data/test3205 b/deps/curl/tests/data/test3205 new file mode 100644 index 00000000..3a26cd6d --- /dev/null +++ b/deps/curl/tests/data/test3205 @@ -0,0 +1,22 @@ + + + +unittest +cipher_suite + + + +# +# Client-side + + +none + + +unittest + + +cipher suite name lookup + + + diff --git a/deps/curl/tests/data/test3207 b/deps/curl/tests/data/test3207 new file mode 100644 index 00000000..01b3353a --- /dev/null +++ b/deps/curl/tests/data/test3207 @@ -0,0 +1,175 @@ + + + +HTTPS + + + +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +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! + + + +# Client-side + + +SSL +OpenSSL + + +https + + +concurrent HTTPS GET using shared ssl session cache + + +lib%TESTNUMBER + +# provide URL and ca-cert + +https://localhost:%HTTPSPORT/%TESTNUMBER %SRCDIR/certs/EdelCurlRoot-ca.crt + + + +# Verify data after the test has been "shot" + + + diff --git a/deps/curl/tests/data/test336 b/deps/curl/tests/data/test336 index f50b42ad..4e881379 100644 --- a/deps/curl/tests/data/test336 +++ b/deps/curl/tests/data/test336 @@ -41,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --range 3-6 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test337 b/deps/curl/tests/data/test337 index d44a712f..b82f9478 100644 --- a/deps/curl/tests/data/test337 +++ b/deps/curl/tests/data/test337 @@ -41,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --range 3-6 # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test348 b/deps/curl/tests/data/test348 index 55e9d608..988e5bd0 100644 --- a/deps/curl/tests/data/test348 +++ b/deps/curl/tests/data/test348 @@ -36,6 +36,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt # Verify data after the test has been "shot" + +QUIT + data to diff --git a/deps/curl/tests/data/test350 b/deps/curl/tests/data/test350 index 6830d704..7342275d 100644 --- a/deps/curl/tests/data/test350 +++ b/deps/curl/tests/data/test350 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -43,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT// --ftp-method multicwd # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test351 b/deps/curl/tests/data/test351 index ef21364a..31c07fa3 100644 --- a/deps/curl/tests/data/test351 +++ b/deps/curl/tests/data/test351 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -43,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT// --ftp-method nocwd # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test352 b/deps/curl/tests/data/test352 index cfcdc1f1..d54ab60e 100644 --- a/deps/curl/tests/data/test352 +++ b/deps/curl/tests/data/test352 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -43,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT// --ftp-method singlecwd # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test353 b/deps/curl/tests/data/test353 index 26115d67..dedd0696 100644 --- a/deps/curl/tests/data/test353 +++ b/deps/curl/tests/data/test353 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -43,6 +41,9 @@ ftp://%HOSTIP:%FTPPORT/ --ftp-method singlecwd # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test354 b/deps/curl/tests/data/test354 index dc6d732d..9a40d49c 100644 --- a/deps/curl/tests/data/test354 +++ b/deps/curl/tests/data/test354 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PWD diff --git a/deps/curl/tests/data/test356 b/deps/curl/tests/data/test356 index 3fb001c5..1d441d7e 100644 --- a/deps/curl/tests/data/test356 +++ b/deps/curl/tests/data/test356 @@ -29,7 +29,7 @@ Alt-Svc: h1="nowhere.foo:70000" # Client-side -debug +Debug alt-svc diff --git a/deps/curl/tests/data/test358 b/deps/curl/tests/data/test358 index 5df596de..9db8b66f 100644 --- a/deps/curl/tests/data/test358 +++ b/deps/curl/tests/data/test358 @@ -29,7 +29,7 @@ Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0 alt-svc -debug +Debug h2c diff --git a/deps/curl/tests/data/test359 b/deps/curl/tests/data/test359 index 117b4def..2b7e52ce 100644 --- a/deps/curl/tests/data/test359 +++ b/deps/curl/tests/data/test359 @@ -29,7 +29,7 @@ Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0 alt-svc -debug +Debug h2c diff --git a/deps/curl/tests/data/test362 b/deps/curl/tests/data/test362 index e8ce9731..d259593f 100644 --- a/deps/curl/tests/data/test362 +++ b/deps/curl/tests/data/test362 @@ -29,6 +29,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER -T %LOGDIR/test%TESTNUMBER.txt --continue-at + +QUIT + data to diff --git a/deps/curl/tests/data/test363 b/deps/curl/tests/data/test363 index 7cc7dad9..d2d9661f 100644 --- a/deps/curl/tests/data/test363 +++ b/deps/curl/tests/data/test363 @@ -43,7 +43,7 @@ contents # Client-side -debug +Debug proxy diff --git a/deps/curl/tests/data/test380 b/deps/curl/tests/data/test380 index bd0c6976..47676e3d 100644 --- a/deps/curl/tests/data/test380 +++ b/deps/curl/tests/data/test380 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -50,6 +48,9 @@ machine %HOSTIP login mary password yram # # Verify data after the test has been "shot" + +QUIT + USER mary PASS yram diff --git a/deps/curl/tests/data/test381 b/deps/curl/tests/data/test381 index 902cc91d..bf287730 100644 --- a/deps/curl/tests/data/test381 +++ b/deps/curl/tests/data/test381 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -54,6 +52,9 @@ machine %HOSTIP login mary password yram # # Verify data after the test has been "shot" + +QUIT + USER mary PASS drfrank diff --git a/deps/curl/tests/data/test389 b/deps/curl/tests/data/test389 index fcb29f5b..a38d70ee 100644 --- a/deps/curl/tests/data/test389 +++ b/deps/curl/tests/data/test389 @@ -31,16 +31,16 @@ Funny-head: yesyes http + +local-http + *.localhost is a local host -http://curlmachine.localhost:%HTTPPORT/%TESTNUMBER +-4 http://curlmachine.localhost:%HTTPPORT/%TESTNUMBER # Ensure that we're running on localhost - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - # diff --git a/deps/curl/tests/data/test392 b/deps/curl/tests/data/test392 index 5c1076c8..a9f756d9 100644 --- a/deps/curl/tests/data/test392 +++ b/deps/curl/tests/data/test392 @@ -35,13 +35,11 @@ HTTP secure cookies over localhost TZ=GMT -http://localhost:%HTTPPORT/%TESTNUMBER -b none http://localhost:%HTTPPORT/%TESTNUMBER +-4 http://localhost:%HTTPPORT/%TESTNUMBER -b none http://localhost:%HTTPPORT/%TESTNUMBER - -perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" - cookies +local-http diff --git a/deps/curl/tests/data/test400 b/deps/curl/tests/data/test400 index db774bf1..e20774a4 100644 --- a/deps/curl/tests/data/test400 +++ b/deps/curl/tests/data/test400 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTPS server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/deps/curl/tests/data/test403 b/deps/curl/tests/data/test403 index 7c2904af..7c08d5ca 100644 --- a/deps/curl/tests/data/test403 +++ b/deps/curl/tests/data/test403 @@ -12,9 +12,7 @@ FAILURE # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTPS server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -26,7 +24,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/deps/curl/tests/data/test406 b/deps/curl/tests/data/test406 index eca49d0d..db497bf6 100644 --- a/deps/curl/tests/data/test406 +++ b/deps/curl/tests/data/test406 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTPS server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/deps/curl/tests/data/test412 b/deps/curl/tests/data/test412 index de607baa..5923054f 100644 --- a/deps/curl/tests/data/test412 +++ b/deps/curl/tests/data/test412 @@ -28,7 +28,7 @@ Funny-head: yesyes alt-svc -debug +Debug http diff --git a/deps/curl/tests/data/test413 b/deps/curl/tests/data/test413 index 8639306e..e0aec1ea 100644 --- a/deps/curl/tests/data/test413 +++ b/deps/curl/tests/data/test413 @@ -28,7 +28,7 @@ Funny-head: yesyes alt-svc -debug +Debug http diff --git a/deps/curl/tests/data/test416 b/deps/curl/tests/data/test416 index b6b10b3d..f50ad70d 100644 --- a/deps/curl/tests/data/test416 +++ b/deps/curl/tests/data/test416 @@ -38,6 +38,9 @@ FTP growing file support # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test417 b/deps/curl/tests/data/test417 index 9061f833..50f4b479 100644 --- a/deps/curl/tests/data/test417 +++ b/deps/curl/tests/data/test417 @@ -51,31 +51,7 @@ s/^(.*):(.*)[\r\n]*// nomnom ------BEGIN CERTIFICATE----- -MIIERDCCAyygAwIBAgIGDzR1UZ/TMA0GCSqGSIb3DQEBCwUAMGgxCzAJBgNVBAYT -Ak5OMTEwLwYDVQQKDChFZGVsIEN1cmwgQXJjdGljIElsbHVkaXVtIFJlc2VhcmNo -IENsb3VkMSYwJAYDVQQDDB1Ob3J0aGVybiBOb3doZXJlIFRydXN0IEFuY2hvcjAe -Fw0yMjEyMjMxMjIxMzlaFw0zMTAzMTExMjIxMzlaMFQxCzAJBgNVBAYTAk5OMTEw -LwYDVQQKDChFZGVsIEN1cmwgQXJjdGljIElsbHVkaXVtIFJlc2VhcmNoIENsb3Vk -MRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK -AoIBAQCrCrAD0Hb+Xs4V3mHV45FvfNa7yiaOeL4mNdGmWfHVPFU+CSzsoNSvDjxa -orWweFGVYoCAcchOn1lZk0ASsqnOss0Xi58n8+PPI3gG0gYjX5sg7EJ3Zq2kXoK0 -TZRy6hNkcvzLgyzXoYv1LkzTwYiyyJgZX++Y/GKAs2fMHyP8XzjNgm4tltk1k/4p -omllwN9Fqz+sFxgAgEq3ybq4Xym7xKwWl8xXNBDJNmVsPtiJRcilQoR8Xs0a6PE+ -VbMhD9A2E/LEL7lzQfqHqtxE1mSW5FpQ+Uqf4KLnafStWs86IOWnCeLP6BmhAK6o -uyICNFyzz7UkTHa/renxuNOGun2TAgMBAAGjggEGMIIBAjAUBgNVHREEDTALggls -b2NhbGhvc3QwCwYDVR0PBAQDAgOoMBMGA1UdJQQMMAoGCCsGAQUFBwMBMB0GA1Ud -DgQWBBScl7A9s1Cx9tRx4uvLgOqTfJjMcjAfBgNVHSMEGDAWgBSHy7EzLsFnfnHj -5StMTaSzbtJbqTAJBgNVHRMEAjAAMEMGCCsGAQUFBwEBBDcwNTAzBggrBgEFBQcw -AoYnaHR0cDovL3Rlc3QuY3VybC5zZS9jYS9FZGVsQ3VybFJvb3QuY2VyMDgGA1Ud -HwQxMC8wLaAroCmGJ2h0dHA6Ly90ZXN0LmN1cmwuc2UvY2EvRWRlbEN1cmxSb290 -LmNybDANBgkqhkiG9w0BAQsFAAOCAQEAC4rtaof6cRWIJViFG0oJv0MANZN4DXIU -MFHik4Oh2hsvqTGut8dMcsJeMiTxlpNw1T+1hYATdTLPDvhdxKIphEMsdYEmEmqg -y3tXwZJ4hQj6ZFDCe4MCTXkTvGFkTbhr1fGEaxJcaZCtQEfA7d3qimZ+h4UZqonT -PAhyCKFNY2BbmxeeABKhAFLKeAGIGMftW8fk2eu9P6+SUz/+WFcN/PR7e6JP6blc -taRSULRWWkSO2dDt3o9+rBxYdluoecmVq4Ud20wTgkqlQRsp9dOW34DRHgB9ujWU -V4HhCCqBaxwwUDcBGg4mT2vtyVAXNyszP2j+xvAhjOeyeVXyQr0vsA== ------END CERTIFICATE----- +%strippemfile[%SRCDIR/certs/stunnel-sv.crt]strippemfile% diff --git a/deps/curl/tests/data/test424 b/deps/curl/tests/data/test424 index 36ba8c4b..9ae6b1fa 100644 --- a/deps/curl/tests/data/test424 +++ b/deps/curl/tests/data/test424 @@ -59,10 +59,10 @@ http # Verify data after the test has been "shot" -anotherhost.example+/%TESTNUMBER0002+http+uuuu+pppp+2023+moo.html+ -hello2000+/%TESTNUMBER+h55p+++1+qqqq+ffff +anotherhost.example+/4240002+http+++2023+moo.html+ +hello2000+/424+h55p+++1+qqqq+ffff +++++++ -anotherhost.example+/%TESTNUMBER0002+http+u22u+p22p+2023+moo.html+ +anotherhost.example+/4240002+http+++2023+moo.html+ diff --git a/deps/curl/tests/data/test433 b/deps/curl/tests/data/test433 index e86f3dea..f1c40563 100644 --- a/deps/curl/tests/data/test433 +++ b/deps/curl/tests/data/test433 @@ -20,7 +20,7 @@ Content-Type: text/1 # # Client-side - + --next header = "a: a" data = "curlrc read" @@ -34,9 +34,9 @@ HOME= CURL_HOME= -Verify XDG_CONFIG_HOME use to find .curlrc +Verify XDG_CONFIG_HOME use to find curlrc - + %HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test436 b/deps/curl/tests/data/test436 index d435b511..762ab3f9 100644 --- a/deps/curl/tests/data/test436 +++ b/deps/curl/tests/data/test436 @@ -35,7 +35,7 @@ XDG_CONFIG_HOME= Find .curlrc in .config/curlrc via CURL_HOME - + %HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test437 b/deps/curl/tests/data/test437 index f12052d2..0f781e0b 100644 --- a/deps/curl/tests/data/test437 +++ b/deps/curl/tests/data/test437 @@ -26,8 +26,9 @@ Alt-Svc: h1="[ffff::1]:8181" # Client-side -debug +Debug alt-svc +IPv6 http diff --git a/deps/curl/tests/data/test438 b/deps/curl/tests/data/test438 index 4dd3b82c..aad056ae 100644 --- a/deps/curl/tests/data/test438 +++ b/deps/curl/tests/data/test438 @@ -29,8 +29,8 @@ Alt-Svc: h1="%HOST6IP:%HTTP6PORT", ma=315360000; persist=0 alt-svc -debug -ipv6 +Debug +IPv6 http diff --git a/deps/curl/tests/data/test439 b/deps/curl/tests/data/test439 index c997a397..43b56ea7 100644 --- a/deps/curl/tests/data/test439 +++ b/deps/curl/tests/data/test439 @@ -32,7 +32,7 @@ Funny-head: yesyes http -debug +Debug aws-sigv4 with query diff --git a/deps/curl/tests/data/test446 b/deps/curl/tests/data/test446 index b8e719dd..7f989125 100644 --- a/deps/curl/tests/data/test446 +++ b/deps/curl/tests/data/test446 @@ -41,7 +41,7 @@ http-proxy HSTS proxy https -debug +Debug CURL_HSTS_HTTP=yes diff --git a/deps/curl/tests/data/test447 b/deps/curl/tests/data/test447 index f514a130..2783b750 100644 --- a/deps/curl/tests/data/test447 +++ b/deps/curl/tests/data/test447 @@ -30,7 +30,7 @@ Funny-head: yesyes # Client-side -debug +Debug http diff --git a/deps/curl/tests/data/test467 b/deps/curl/tests/data/test467 new file mode 100644 index 00000000..4184ac06 --- /dev/null +++ b/deps/curl/tests/data/test467 @@ -0,0 +1,31 @@ + + + +cmdline + + + +# +# Client-side + + +none + + +use a bad short option letter that does not exist (after one does exist) + + +# the second option is outside the normal accepted range + +curl -v http://example.com + + + +# +# Verify errorcode + + +2 + + + diff --git a/deps/curl/tests/data/test468 b/deps/curl/tests/data/test468 new file mode 100644 index 00000000..0b06a4d3 --- /dev/null +++ b/deps/curl/tests/data/test468 @@ -0,0 +1,60 @@ + + + +HTTP +--write-out +--config + + + +# +# 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 + +-foo- + + + +# +# Client-side + + +http + + +set -w in config, then reset -w to blank on cmdline + + +-w "output\n" + + +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 +Accept: */* + + + +-foo- + + + diff --git a/deps/curl/tests/data/test469 b/deps/curl/tests/data/test469 new file mode 100644 index 00000000..81d341cd --- /dev/null +++ b/deps/curl/tests/data/test469 @@ -0,0 +1,53 @@ + + + +HTTP + + + + +# +# 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 + +-foo- + + + +# +# Client-side + + +!win32 + + +http + + +warn about Unicode quote character + + +-H “host: %HOSTIP:%HTTPPORT/” -s + + + +# +# Verify data after the test has been "shot" + + +%hex[Warning: The argument '%e2%80%9chost:' starts with a Unicode quote where maybe an ]hex% +Warning: ASCII " was intended? + + + diff --git a/deps/curl/tests/data/test470 b/deps/curl/tests/data/test470 new file mode 100644 index 00000000..70e50e62 --- /dev/null +++ b/deps/curl/tests/data/test470 @@ -0,0 +1,56 @@ + + + +HTTP + + + + +# +# 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 + +-foo- + + + +# +# Client-side + + +!hyper + + +http + + +warn about Unicode quote character read from config file + + +-H “host:fake” + + +%HOSTIP:%HTTPPORT --no-progress-meter -K "%LOGDIR/input%TESTNUMBER" + + + +# +# Verify data after the test has been "shot" + + +%hex[Warning: The argument '%e2%80%9chost:fake%e2%80%9d' starts with a Unicode quote where ]hex% +Warning: maybe an ASCII " was intended? + + + diff --git a/deps/curl/tests/data/test471 b/deps/curl/tests/data/test471 new file mode 100644 index 00000000..69ecb5e2 --- /dev/null +++ b/deps/curl/tests/data/test471 @@ -0,0 +1,74 @@ + + + +HTTP +HTTP GET +globbing +{} list + + +# +# 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 +Content-Type: text/html +Funny-head: yesyes + +-foo- + + +HTTP/2 200 OK +Content-Type: text/html +Funny-head: swsclose +Connection: close + +crap data + + + +# +# Client-side + + +http/2 +http + + +http + + +Reject HTTP/1.1 to HTTP/2 switch on the same connection + + +"http://%HOSTIP:%HTTPPORT/{%TESTNUMBER,%TESTNUMBER0001}" -o "%LOGDIR/dumpit#1.dump" + + + +# +# 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: */* + + +# curl: (1) Version mismatch (from HTTP/1 to HTTP/2) + +1 + + + diff --git a/deps/curl/tests/data/test472 b/deps/curl/tests/data/test472 new file mode 100644 index 00000000..88cc78f9 --- /dev/null +++ b/deps/curl/tests/data/test472 @@ -0,0 +1,59 @@ + + + +HTTP +aws-sigv4 + + + +# +# 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 + +-foo- + + + +# +# Client-side + + +http + + +Debug +Unicode + + +aws-sigv4 with query + + +"http://fake.fake.fake:8000/%TESTNUMBER/a=あ" -u user:secret --aws-sigv4 "aws:amz:us-east-2:es" --connect-to fake.fake.fake:8000:%HOSTIP:%HTTPPORT + + + +# +# 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=c63315c199922f7ee00141869a250389405d19e205057249fb74726d940b1fc3 +X-Amz-Date: 19700101T000000Z +User-Agent: curl/%VERSION +Accept: */* + + + + diff --git a/deps/curl/tests/data/test473 b/deps/curl/tests/data/test473 new file mode 100644 index 00000000..874813c4 --- /dev/null +++ b/deps/curl/tests/data/test473 @@ -0,0 +1,62 @@ + + + +HTTP +HTTP GET + + +# +# Server-side + + +HTTP/1.1 301 funky chunky! +Server: fakeit/0.9 fakeitbad/1.0 +Location: /redirected +Transfer-Encoding: chunked +Trailer: chunky-trailer +Connection: mooo +ETag: W/"asdf" + +40 +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +30 +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +21;heresatest=moooo +cccccccccccccccccccccccccccccccc + +0 +chunky-trailer: header data + + + + +# +# Client-side + + +http + + +Check if --etag-save saved correct etag to a file on 301 + + +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: */* + + + +W/"asdf" + + + + diff --git a/deps/curl/tests/data/test474 b/deps/curl/tests/data/test474 new file mode 100644 index 00000000..37e0805b --- /dev/null +++ b/deps/curl/tests/data/test474 @@ -0,0 +1,52 @@ + + + +-w +--write-out + + + +# +# Server-side + + +HTTP/1.1 301 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 0 +Connection: close +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 +Connection: close + + + + +# +# Client-side + + +http +https + + +-w urle.scheme after HTTP to HTTPS redirect + + +-k -L http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "%{num_redirects} %{url_effective} %{urle.scheme}\n" + + + +# +# Verify data after the test has been "shot" + + +1 https://%HOSTIP:%HTTPSPORT/%TESTNUMBER0002 https + + + diff --git a/deps/curl/tests/data/test475 b/deps/curl/tests/data/test475 new file mode 100644 index 00000000..75e0e6b9 --- /dev/null +++ b/deps/curl/tests/data/test475 @@ -0,0 +1,49 @@ + + + +FTP +EPSV +STOR +TYPE A + + + +# Client-side + + +ftp + + +FTP PASV upload ASCII file + + +%if win32 +%repeat[1750 x a line of text used for verifying this !%0d%0a]% +%else +%repeat[1750 x a line of text used for verifying this !%0a]% +%endif + + +"ftp://%HOSTIP:%FTPPORT/%TESTNUMBER;type=a" -T %LOGDIR/test%TESTNUMBER.txt + + + +# Verify data after the test has been "shot" + + +QUIT + + +%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 + + + diff --git a/deps/curl/tests/data/test476 b/deps/curl/tests/data/test476 new file mode 100644 index 00000000..2396d3ee --- /dev/null +++ b/deps/curl/tests/data/test476 @@ -0,0 +1,45 @@ + + + +FTP +EPSV +STOR +TYPE A + + + +# Client-side + + +ftp + + +FTP PASV upload ASCII file already using CRLF + + +%repeat[1750 x a line of text used for verifying this !%0d%0a]% + + +"ftp://%HOSTIP:%FTPPORT/%TESTNUMBER;type=a" -T %LOGDIR/test%TESTNUMBER.txt + + + +# Verify data after the test has been "shot" + + +QUIT + + +%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 + + + diff --git a/deps/curl/tests/data/test477 b/deps/curl/tests/data/test477 new file mode 100644 index 00000000..12843918 --- /dev/null +++ b/deps/curl/tests/data/test477 @@ -0,0 +1,67 @@ + + + +HTTP +HTTP GET +--max-filesize + + + +# +# Server-side + + +HTTP/1.1 301 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: %TESTNUMBER0002 +Accept-Ranges: bytes +Content-Length: 26 +Funny-head: yesyes + +aaaaaaaaaaaaaaaaaaaa-foo- + + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Accept-Ranges: bytes +Content-Length: 4 +Funny-head: yesyes + +hej + + + +# +# Client-side + + +http + + +HTTP GET with maximum filesize with a redirect sending data + + +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: */* + + + + diff --git a/deps/curl/tests/data/test494 b/deps/curl/tests/data/test494 index 64831872..c089d75c 100644 --- a/deps/curl/tests/data/test494 +++ b/deps/curl/tests/data/test494 @@ -46,6 +46,9 @@ machine %HOSTIP login user1 password passwd1 # # Verify data after the test has been "shot" + +QUIT + USER user1 PASS passwd1 diff --git a/deps/curl/tests/data/test502 b/deps/curl/tests/data/test502 index 0bca19c6..4e7ce38a 100644 --- a/deps/curl/tests/data/test502 +++ b/deps/curl/tests/data/test502 @@ -30,7 +30,7 @@ lib%TESTNUMBER simple multi file:// get -file://%PWD/%LOGDIR/test%TESTNUMBER.txt +file://%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt foo diff --git a/deps/curl/tests/data/test503 b/deps/curl/tests/data/test503 index 0690ad34..9fbc00b9 100644 --- a/deps/curl/tests/data/test503 +++ b/deps/curl/tests/data/test503 @@ -73,7 +73,7 @@ moo CONNECT machine.%TESTNUMBER:%HTTPPORT HTTP/1.1 Host: machine.%TESTNUMBER:%HTTPPORT -Proxy-Authorization: Basic dGVzdDppbmc= +Proxy-Authorization: Basic dGVzdCUyMDppbmclNDE= Proxy-Connection: Keep-Alive [DISCONNECT] diff --git a/deps/curl/tests/data/test505 b/deps/curl/tests/data/test505 index 6eba4893..aa26ccb5 100644 --- a/deps/curl/tests/data/test505 +++ b/deps/curl/tests/data/test505 @@ -40,6 +40,9 @@ works? # Verify data after the test has been "shot" + +QUIT + Contents of diff --git a/deps/curl/tests/data/test508 b/deps/curl/tests/data/test508 index 06cdba75..cc1932a3 100644 --- a/deps/curl/tests/data/test508 +++ b/deps/curl/tests/data/test508 @@ -41,10 +41,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -# remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled: -s/^(this is what we post to the silly web server)\r\n/$1\n/ if($has_charconv) - POST /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/deps/curl/tests/data/test511 b/deps/curl/tests/data/test511 index adcabe8b..7637dced 100644 --- a/deps/curl/tests/data/test511 +++ b/deps/curl/tests/data/test511 @@ -35,6 +35,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" + +QUIT + # CURLE_REMOTE_FILE_NOT_FOUND 78 diff --git a/deps/curl/tests/data/test520 b/deps/curl/tests/data/test520 index 6a27bb3f..17d89199 100644 --- a/deps/curl/tests/data/test520 +++ b/deps/curl/tests/data/test520 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/520 # # Verify data after the test has been "shot" + +QUIT + USER anonymous diff --git a/deps/curl/tests/data/test521 b/deps/curl/tests/data/test521 index 1eec1bb2..eaeb040d 100644 --- a/deps/curl/tests/data/test521 +++ b/deps/curl/tests/data/test521 @@ -9,9 +9,7 @@ CURLOPT_PORT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -46,6 +44,9 @@ ftp://%HOSTIP/%TESTNUMBER/ %FTPPORT # # Verify data after the test has been "shot" + +QUIT + USER xxx PASS yyy diff --git a/deps/curl/tests/data/test525 b/deps/curl/tests/data/test525 index 2b96a7fd..82a85276 100644 --- a/deps/curl/tests/data/test525 +++ b/deps/curl/tests/data/test525 @@ -36,6 +36,9 @@ Moooooooooooo # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test526 b/deps/curl/tests/data/test526 index 85b24d5d..3a303e9a 100644 --- a/deps/curl/tests/data/test526 +++ b/deps/curl/tests/data/test526 @@ -39,6 +39,9 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test527 b/deps/curl/tests/data/test527 index 85b24d5d..3a303e9a 100644 --- a/deps/curl/tests/data/test527 +++ b/deps/curl/tests/data/test527 @@ -39,6 +39,9 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test529 b/deps/curl/tests/data/test529 index 737e5018..c92b377e 100644 --- a/deps/curl/tests/data/test529 +++ b/deps/curl/tests/data/test529 @@ -36,6 +36,9 @@ Moooooooooooo # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test531 b/deps/curl/tests/data/test531 index 59501d5e..33739ea7 100644 --- a/deps/curl/tests/data/test531 +++ b/deps/curl/tests/data/test531 @@ -39,6 +39,9 @@ don't upload this # Verify data after the test has been "shot" + +QUIT + # Strip all valid kinds of PORT and EPRT that curl can send ^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3} diff --git a/deps/curl/tests/data/test532 b/deps/curl/tests/data/test532 index c1d3b0b0..128b2d88 100644 --- a/deps/curl/tests/data/test532 +++ b/deps/curl/tests/data/test532 @@ -39,6 +39,9 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test533 b/deps/curl/tests/data/test533 index 1dbceb6d..f6467aca 100644 --- a/deps/curl/tests/data/test533 +++ b/deps/curl/tests/data/test533 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test534 b/deps/curl/tests/data/test534 index 0e0f35ab..87b98b5e 100644 --- a/deps/curl/tests/data/test534 +++ b/deps/curl/tests/data/test534 @@ -38,6 +38,9 @@ ftp://non-existing-host.haxx.se/path/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/%TE # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test539 b/deps/curl/tests/data/test539 index 1fb4e125..b774ead0 100644 --- a/deps/curl/tests/data/test539 +++ b/deps/curl/tests/data/test539 @@ -12,22 +12,14 @@ FTP file contents + +contents for file number two + + file contents +contents for file number two - -total 20 -drwxr-xr-x 8 98 98 512 Oct 22 13:06 . -drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. -drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT --r--r--r-- 1 0 1 35 Jul 16 1996 README -lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin -dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev -drwxrwxrwx 2 98 98 512 May 29 16:04 download.html -dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc -drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub -dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - # Client-side @@ -44,13 +36,16 @@ lib%TESTNUMBER Two FTP fetches using different CURLOPT_FTP_FILEMETHOD -ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER0001 # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com @@ -63,8 +58,8 @@ RETR %TESTNUMBER SYST CWD / EPSV -TYPE A -LIST path/to/the/file/%TESTNUMBER. +SIZE path/to/the/file/%TESTNUMBER0001 +RETR path/to/the/file/%TESTNUMBER0001 QUIT diff --git a/deps/curl/tests/data/test541 b/deps/curl/tests/data/test541 index c0677d8e..9492d085 100644 --- a/deps/curl/tests/data/test541 +++ b/deps/curl/tests/data/test541 @@ -40,6 +40,9 @@ works? # Verify data after the test has been "shot" + +QUIT + diff --git a/deps/curl/tests/data/test542 b/deps/curl/tests/data/test542 index b39b1b30..4a412c8b 100644 --- a/deps/curl/tests/data/test542 +++ b/deps/curl/tests/data/test542 @@ -44,6 +44,9 @@ 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 + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test546 b/deps/curl/tests/data/test546 index f8f01641..6021b675 100644 --- a/deps/curl/tests/data/test546 +++ b/deps/curl/tests/data/test546 @@ -44,6 +44,9 @@ ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/%TESTNUMBER # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test557 b/deps/curl/tests/data/test557 index 19637749..9d86c0ac 100644 --- a/deps/curl/tests/data/test557 +++ b/deps/curl/tests/data/test557 @@ -41,6 +41,7 @@ All curl_mprintf() signed long tests OK! All curl_mprintf() curl_off_t tests OK! All curl_mprintf() strings tests OK! All float strings tests OK! +All curl_mprintf() octal & hexadecimal tests OK! diff --git a/deps/curl/tests/data/test558 b/deps/curl/tests/data/test558 index 06b77281..47605de0 100644 --- a/deps/curl/tests/data/test558 +++ b/deps/curl/tests/data/test558 @@ -17,7 +17,7 @@ none TrackMemory -ipv6 +IPv6 # tool is what to use instead of 'curl' diff --git a/deps/curl/tests/data/test562 b/deps/curl/tests/data/test562 index d1793891..c2cf2546 100644 --- a/deps/curl/tests/data/test562 +++ b/deps/curl/tests/data/test562 @@ -39,6 +39,9 @@ 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 + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test564 b/deps/curl/tests/data/test564 index 96a6f9b1..3b0a2ae1 100644 --- a/deps/curl/tests/data/test564 +++ b/deps/curl/tests/data/test564 @@ -45,6 +45,9 @@ proxy # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test574 b/deps/curl/tests/data/test574 index 436e1828..50d2120f 100644 --- a/deps/curl/tests/data/test574 +++ b/deps/curl/tests/data/test574 @@ -11,10 +11,8 @@ ftplistparser # # Server-side - - - - +# +# Data is generated by the ftp server itself # Client-side @@ -35,6 +33,9 @@ ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*.txt ############################################ # Verify data after the test has been "shot" + +QUIT + 0 diff --git a/deps/curl/tests/data/test575 b/deps/curl/tests/data/test575 index d51c5a08..35b65a3d 100644 --- a/deps/curl/tests/data/test575 +++ b/deps/curl/tests/data/test575 @@ -32,6 +32,9 @@ ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/* # Verify data after the test has been "shot" + +QUIT + 0 diff --git a/deps/curl/tests/data/test579 b/deps/curl/tests/data/test579 index 68fce50d..eaee6e32 100644 --- a/deps/curl/tests/data/test579 +++ b/deps/curl/tests/data/test579 @@ -76,14 +76,10 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER # Verify data after the test has been "shot" -Progress callback called with UL 0 out of 0 -Progress callback called with UL 5 out of 0 -Progress callback called with UL 0 out of 0 -Progress callback called with UL 8 out of 0 -Progress callback called with UL 16 out of 0 -Progress callback called with UL 26 out of 0 -Progress callback called with UL 61 out of 0 -Progress callback called with UL 66 out of 0 +Progress: start UL 0/0 +Progress: end UL 5/0 +Progress: start UL 0/0 +Progress: end UL 66/0 diff --git a/deps/curl/tests/data/test582 b/deps/curl/tests/data/test582 index 194591b5..de6a1a1d 100644 --- a/deps/curl/tests/data/test582 +++ b/deps/curl/tests/data/test582 @@ -34,9 +34,6 @@ Moooooooooooo # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test583 b/deps/curl/tests/data/test583 index 0f49cd99..c9e614ba 100644 --- a/deps/curl/tests/data/test583 +++ b/deps/curl/tests/data/test583 @@ -35,9 +35,6 @@ sftp://localhost:%SSHPORT%SSH_PWD/%LOGDIR/upload%TESTNUMBER.txt %USER: %LOGDIR/s # Verify data after the test has been "shot" - -disable - 0 diff --git a/deps/curl/tests/data/test586 b/deps/curl/tests/data/test586 index b17a702a..a708f3b5 100644 --- a/deps/curl/tests/data/test586 +++ b/deps/curl/tests/data/test586 @@ -45,6 +45,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test587 b/deps/curl/tests/data/test587 index 541df454..c896a5b6 100644 --- a/deps/curl/tests/data/test587 +++ b/deps/curl/tests/data/test587 @@ -41,21 +41,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" - -s/^--------------------------[A-Za-z0-9]*/------------------------------/ -s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - - -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" - - # CURLE_ABORTED_BY_CALLBACK (42) 42 diff --git a/deps/curl/tests/data/test588 b/deps/curl/tests/data/test588 index 9c8c5f32..d41131c4 100644 --- a/deps/curl/tests/data/test588 +++ b/deps/curl/tests/data/test588 @@ -45,6 +45,9 @@ Moooooooooooo # Verify data after the test has been "shot" + +QUIT + # Strip off parts of the PORT and EPRT commands that might differ s/^PORT (.*)/PORT/ diff --git a/deps/curl/tests/data/test591 b/deps/curl/tests/data/test591 index d1cbf082..10d12ca2 100644 --- a/deps/curl/tests/data/test591 +++ b/deps/curl/tests/data/test591 @@ -47,6 +47,9 @@ Moooooooooooo for %TESTNUMBER # Verify data after the test has been "shot" + +QUIT + # Strip off parts of the PORT and EPRT commands that might differ s/^PORT (.*)/PORT/ diff --git a/deps/curl/tests/data/test592 b/deps/curl/tests/data/test592 index f77eb9a8..a6fbaf72 100644 --- a/deps/curl/tests/data/test592 +++ b/deps/curl/tests/data/test592 @@ -47,6 +47,9 @@ Moooooooooooo for %TESTNUMBER # Verify data after the test has been "shot" + +QUIT + # Strip off parts of the PORT and EPRT commands that might differ s/^PORT (.*)/PORT/ diff --git a/deps/curl/tests/data/test593 b/deps/curl/tests/data/test593 index 9a15a518..5c3bdf35 100644 --- a/deps/curl/tests/data/test593 +++ b/deps/curl/tests/data/test593 @@ -47,6 +47,9 @@ Moooooooooooo for %TESTNUMBER # Verify data after the test has been "shot" + +QUIT + # Strip off parts of the PORT and EPRT commands that might differ s/^PORT (.*)/PORT/ diff --git a/deps/curl/tests/data/test594 b/deps/curl/tests/data/test594 index cd98f0b9..e0dfc56e 100644 --- a/deps/curl/tests/data/test594 +++ b/deps/curl/tests/data/test594 @@ -49,6 +49,9 @@ Moooooooooooo for %TESTNUMBER # Verify data after the test has been "shot" + +QUIT + # Strip off parts of the PORT and EPRT commands that might differ s/^PORT (.*)/PORT/ diff --git a/deps/curl/tests/data/test595 b/deps/curl/tests/data/test595 index 40ace13d..13d6bb92 100644 --- a/deps/curl/tests/data/test595 +++ b/deps/curl/tests/data/test595 @@ -43,6 +43,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test596 b/deps/curl/tests/data/test596 index 7175c63f..30e401df 100644 --- a/deps/curl/tests/data/test596 +++ b/deps/curl/tests/data/test596 @@ -43,6 +43,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER %LOGDIR/ip%TESTNUMBER activeftp # # Verify data after the test has been "shot" + +QUIT + s/^(EPRT \|1\|)(.*)/$1/ diff --git a/deps/curl/tests/data/test600 b/deps/curl/tests/data/test600 index f2d6510a..40aef1c4 100644 --- a/deps/curl/tests/data/test600 +++ b/deps/curl/tests/data/test600 @@ -35,8 +35,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test601 b/deps/curl/tests/data/test601 index 1f01ffd8..03f95d82 100644 --- a/deps/curl/tests/data/test601 +++ b/deps/curl/tests/data/test601 @@ -35,8 +35,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test602 b/deps/curl/tests/data/test602 index 8894c096..6eb9b062 100644 --- a/deps/curl/tests/data/test602 +++ b/deps/curl/tests/data/test602 @@ -36,8 +36,5 @@ for ssh upload test Test data for ssh upload test - -disable - diff --git a/deps/curl/tests/data/test603 b/deps/curl/tests/data/test603 index e98b73d1..e422cf07 100644 --- a/deps/curl/tests/data/test603 +++ b/deps/curl/tests/data/test603 @@ -36,8 +36,5 @@ for ssh upload test Test data for ssh upload test - -disable - diff --git a/deps/curl/tests/data/test604 b/deps/curl/tests/data/test604 index 9e129ae5..9ac9a233 100644 --- a/deps/curl/tests/data/test604 +++ b/deps/curl/tests/data/test604 @@ -23,9 +23,6 @@ SFTP retrieval of nonexistent file # # Verify data after the test has been "shot" - -disable - 78 diff --git a/deps/curl/tests/data/test605 b/deps/curl/tests/data/test605 index 380b77a7..d035e64e 100644 --- a/deps/curl/tests/data/test605 +++ b/deps/curl/tests/data/test605 @@ -26,8 +26,5 @@ SCP retrieval of nonexistent file 78 - -disable - diff --git a/deps/curl/tests/data/test606 b/deps/curl/tests/data/test606 index 85c462f0..757192d6 100644 --- a/deps/curl/tests/data/test606 +++ b/deps/curl/tests/data/test606 @@ -26,8 +26,5 @@ SFTP invalid user login 67 - -disable - diff --git a/deps/curl/tests/data/test607 b/deps/curl/tests/data/test607 index 091a73e4..c9718a4e 100644 --- a/deps/curl/tests/data/test607 +++ b/deps/curl/tests/data/test607 @@ -26,8 +26,5 @@ SCP invalid user login 67 - -disable - diff --git a/deps/curl/tests/data/test608 b/deps/curl/tests/data/test608 index 157713e3..6f9ed07b 100644 --- a/deps/curl/tests/data/test608 +++ b/deps/curl/tests/data/test608 @@ -24,13 +24,10 @@ sftp SFTP post-quote rename ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-rename %PWD/%LOGDIR/file%TESTNUMBER.txt %PWD/%LOGDIR/file%TESTNUMBER-renamed.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-rename %SSH_PWD/%LOGDIR/file%TESTNUMBER.txt %SSH_PWD/%LOGDIR/file%TESTNUMBER-renamed.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure # Verify that the file was renamed properly, then rename the file back to what # it was so the verify section works and the file can be cleaned up. - -perl %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/file%TESTNUMBER.txt move %PWD/%LOGDIR/file%TESTNUMBER-renamed.txt %PWD/%LOGDIR/file%TESTNUMBER.txt - Test file for rename test @@ -42,8 +39,8 @@ Test file for rename test Test file for rename test - -disable - + +%PERL %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/file%TESTNUMBER.txt move %PWD/%LOGDIR/file%TESTNUMBER-renamed.txt %PWD/%LOGDIR/file%TESTNUMBER.txt + diff --git a/deps/curl/tests/data/test609 b/deps/curl/tests/data/test609 index 3b966855..01e8981a 100644 --- a/deps/curl/tests/data/test609 +++ b/deps/curl/tests/data/test609 @@ -25,7 +25,7 @@ sftp SFTP post-quote mkdir failure ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-mkdir %PWD/%LOGDIR/file%TESTNUMBER.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-mkdir %SSH_PWD/%LOGDIR/file%TESTNUMBER.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure Test file for mkdir test @@ -38,8 +38,5 @@ Test file for mkdir test 21 - -disable - diff --git a/deps/curl/tests/data/test610 b/deps/curl/tests/data/test610 index 0ca51f73..4b015881 100644 --- a/deps/curl/tests/data/test610 +++ b/deps/curl/tests/data/test610 @@ -21,17 +21,14 @@ Dummy test file for rmdir test sftp -perl %SRCDIR/libtest/test%TESTNUMBER.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP post-quote rmdir ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-rmdir %PWD/%LOGDIR/test%TESTNUMBER.dir" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-rmdir %SSH_PWD/%LOGDIR/test%TESTNUMBER.dir" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure - -perl %SRCDIR/libtest/test%TESTNUMBER.pl gone %PWD/%LOGDIR/test%TESTNUMBER.dir - Dummy test file for rmdir test @@ -40,8 +37,8 @@ Dummy test file for rmdir test # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl gone %PWD/%LOGDIR/test%TESTNUMBER.dir + diff --git a/deps/curl/tests/data/test611 b/deps/curl/tests/data/test611 index dc75e20d..2123e478 100644 --- a/deps/curl/tests/data/test611 +++ b/deps/curl/tests/data/test611 @@ -21,17 +21,14 @@ Dummy test file for rename test sftp -perl %SRCDIR/libtest/test610.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test610.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP post-quote rename ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-rename %PWD/%LOGDIR/test%TESTNUMBER.dir %PWD/%LOGDIR/test%TESTNUMBER.new" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-rename %SSH_PWD/%LOGDIR/test%TESTNUMBER.dir %SSH_PWD/%LOGDIR/test%TESTNUMBER.new" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure - -perl %SRCDIR/libtest/test610.pl rmdir %PWD/%LOGDIR/test%TESTNUMBER.new - Dummy test file for rename test @@ -40,8 +37,8 @@ Dummy test file for rename test # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test610.pl rmdir %PWD/%LOGDIR/test%TESTNUMBER.new + diff --git a/deps/curl/tests/data/test612 b/deps/curl/tests/data/test612 index 2c43f6a0..40212b45 100644 --- a/deps/curl/tests/data/test612 +++ b/deps/curl/tests/data/test612 @@ -24,11 +24,8 @@ sftp SFTP post-quote remove file ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -T %LOGDIR/file%TESTNUMBER.txt -Q "-rm %PWD/%LOGDIR/file%TESTNUMBER.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/upload.%TESTNUMBER --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -T %LOGDIR/file%TESTNUMBER.txt -Q "-rm %SSH_PWD/%LOGDIR/file%TESTNUMBER.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/upload.%TESTNUMBER --insecure - -perl %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/test%TESTNUMBER.txt - Dummy test file for remove test @@ -40,8 +37,8 @@ Dummy test file for remove test Dummy test file for remove test - -disable - + +%PERL %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/test%TESTNUMBER.txt + diff --git a/deps/curl/tests/data/test613 b/deps/curl/tests/data/test613 index f8443efa..42cb1ee4 100644 --- a/deps/curl/tests/data/test613 +++ b/deps/curl/tests/data/test613 @@ -23,7 +23,7 @@ d????????? N U U N ??? N NN:NN asubdir sftp -perl %SRCDIR/libtest/test%TESTNUMBER.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP directory retrieval @@ -31,16 +31,13 @@ SFTP directory retrieval --key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/ --insecure - -perl %SRCDIR/libtest/test%TESTNUMBER.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %PWD/%LOGDIR/curl%TESTNUMBER.out - # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test%TESTNUMBER.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %PWD/%LOGDIR/curl%TESTNUMBER.out + diff --git a/deps/curl/tests/data/test614 b/deps/curl/tests/data/test614 index 012d6cee..53d34137 100644 --- a/deps/curl/tests/data/test614 +++ b/deps/curl/tests/data/test614 @@ -24,24 +24,21 @@ d????????? N U U N ??? N NN:NN asubdir sftp -perl %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP pre-quote chmod ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "chmod 444 %PWD/%LOGDIR/test%TESTNUMBER.dir/plainfile.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/ --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "chmod 444 %SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/plainfile.txt" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/ --insecure - -perl %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %PWD/%LOGDIR/curl%TESTNUMBER.out - # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %PWD/%LOGDIR/curl%TESTNUMBER.out + diff --git a/deps/curl/tests/data/test615 b/deps/curl/tests/data/test615 index 4626d3f1..dabca40b 100644 --- a/deps/curl/tests/data/test615 +++ b/deps/curl/tests/data/test615 @@ -14,7 +14,7 @@ FAILURE sftp -perl %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test613.pl prepare %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP put remote failure @@ -22,9 +22,6 @@ SFTP put remote failure --key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -T %LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/rofile.txt --insecure - -perl %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir - Test data for ssh upload test @@ -37,8 +34,8 @@ for ssh upload test 9 - -disable - + +%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir + diff --git a/deps/curl/tests/data/test616 b/deps/curl/tests/data/test616 index 0ebc7343..f76c68af 100644 --- a/deps/curl/tests/data/test616 +++ b/deps/curl/tests/data/test616 @@ -32,8 +32,5 @@ SFTP retrieval of empty file # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test617 b/deps/curl/tests/data/test617 index 0ab6ced0..af0f23b0 100644 --- a/deps/curl/tests/data/test617 +++ b/deps/curl/tests/data/test617 @@ -32,8 +32,5 @@ SCP retrieval of empty file # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test618 b/deps/curl/tests/data/test618 index 2094768f..0d2933b2 100644 --- a/deps/curl/tests/data/test618 +++ b/deps/curl/tests/data/test618 @@ -26,9 +26,6 @@ for ssh test # # Verify data after the test has been "shot" - -disable - Test data for ssh test diff --git a/deps/curl/tests/data/test619 b/deps/curl/tests/data/test619 index 6c3296c9..12b064d2 100644 --- a/deps/curl/tests/data/test619 +++ b/deps/curl/tests/data/test619 @@ -26,9 +26,6 @@ for ssh test # # Verify data after the test has been "shot" - -disable - Test data for ssh test diff --git a/deps/curl/tests/data/test620 b/deps/curl/tests/data/test620 index 0f32d6fd..69641001 100644 --- a/deps/curl/tests/data/test620 +++ b/deps/curl/tests/data/test620 @@ -27,9 +27,6 @@ for ssh test # # Verify data after the test has been "shot" - -disable - Test data for ssh test diff --git a/deps/curl/tests/data/test621 b/deps/curl/tests/data/test621 index cafd8089..683575ce 100644 --- a/deps/curl/tests/data/test621 +++ b/deps/curl/tests/data/test621 @@ -27,9 +27,6 @@ for ssh test # # Verify data after the test has been "shot" - -disable - Test data for ssh test diff --git a/deps/curl/tests/data/test622 b/deps/curl/tests/data/test622 index 014ea96d..b210c935 100644 --- a/deps/curl/tests/data/test622 +++ b/deps/curl/tests/data/test622 @@ -36,8 +36,5 @@ for ssh upload test 78 - -disable - diff --git a/deps/curl/tests/data/test623 b/deps/curl/tests/data/test623 index 945079b3..55802be2 100644 --- a/deps/curl/tests/data/test623 +++ b/deps/curl/tests/data/test623 @@ -33,9 +33,6 @@ for ssh upload test # # Verify data after the test has been "shot" - -disable - 25 diff --git a/deps/curl/tests/data/test624 b/deps/curl/tests/data/test624 index 3a4ca4b3..4305f481 100644 --- a/deps/curl/tests/data/test624 +++ b/deps/curl/tests/data/test624 @@ -24,9 +24,6 @@ SFTP put with --ftp-create-dirs --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%SSH_PWD/%LOGDIR/test%TESTNUMBER.dir/upload.%TESTNUMBER --insecure - -perl %SRCDIR/libtest/test610.pl move %PWD/%LOGDIR/test%TESTNUMBER.dir/upload.%TESTNUMBER %PWD/%LOGDIR/upload.%TESTNUMBER rmdir %PWD/%LOGDIR/test%TESTNUMBER.dir - Test data for ssh upload test @@ -40,8 +37,8 @@ for ssh upload test Test data for ssh upload test - -disable - + +%PERL %SRCDIR/libtest/test610.pl move %PWD/%LOGDIR/test%TESTNUMBER.dir/upload.%TESTNUMBER %PWD/%LOGDIR/upload.%TESTNUMBER rmdir %PWD/%LOGDIR/test%TESTNUMBER.dir + diff --git a/deps/curl/tests/data/test625 b/deps/curl/tests/data/test625 index ff754947..29a9a1cb 100644 --- a/deps/curl/tests/data/test625 +++ b/deps/curl/tests/data/test625 @@ -24,9 +24,6 @@ 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%SSH_PWD/%LOGDIR/test%TESTNUMBER.a/upload.%TESTNUMBER -T %LOGDIR/file%TESTNUMBER.txt sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/test%TESTNUMBER.b/upload.%TESTNUMBER --insecure - -perl %SRCDIR/libtest/test610.pl move %PWD/%LOGDIR/test%TESTNUMBER.a/upload.%TESTNUMBER %PWD/%LOGDIR/upload.%TESTNUMBER rmdir %PWD/%LOGDIR/test%TESTNUMBER.a rm %PWD/%LOGDIR/test%TESTNUMBER.b/upload.%TESTNUMBER rmdir %PWD/%LOGDIR/test%TESTNUMBER.b - Test data for ssh upload test @@ -40,8 +37,8 @@ for ssh upload test Test data for ssh upload test - -disable - + +%PERL %SRCDIR/libtest/test610.pl move %PWD/%LOGDIR/test%TESTNUMBER.a/upload.%TESTNUMBER %PWD/%LOGDIR/upload.%TESTNUMBER rmdir %PWD/%LOGDIR/test%TESTNUMBER.a rm %PWD/%LOGDIR/test%TESTNUMBER.b/upload.%TESTNUMBER rmdir %PWD/%LOGDIR/test%TESTNUMBER.b + diff --git a/deps/curl/tests/data/test626 b/deps/curl/tests/data/test626 index b963b6de..2c74329c 100644 --- a/deps/curl/tests/data/test626 +++ b/deps/curl/tests/data/test626 @@ -35,8 +35,5 @@ Test file for rename test 21 - -disable - diff --git a/deps/curl/tests/data/test627 b/deps/curl/tests/data/test627 index 8ebdc123..4696209b 100644 --- a/deps/curl/tests/data/test627 +++ b/deps/curl/tests/data/test627 @@ -24,11 +24,8 @@ sftp SFTP quote remove file with NOBODY ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -I -Q "rm %PWD/%LOGDIR/file%TESTNUMBER.txt" sftp://%HOSTIP:%SSHPORT --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -I -Q "rm %SSH_PWD/%LOGDIR/file%TESTNUMBER.txt" sftp://%HOSTIP:%SSHPORT --insecure - -perl %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/test%TESTNUMBER.txt - Dummy test file for remove test @@ -37,10 +34,10 @@ Dummy test file for remove test # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test610.pl gone %PWD/%LOGDIR/test%TESTNUMBER.txt + diff --git a/deps/curl/tests/data/test628 b/deps/curl/tests/data/test628 index 755181e3..a1407e4a 100644 --- a/deps/curl/tests/data/test628 +++ b/deps/curl/tests/data/test628 @@ -26,8 +26,5 @@ SFTP invalid user login (password authentication) 67 - -disable - diff --git a/deps/curl/tests/data/test629 b/deps/curl/tests/data/test629 index 6bf42f4a..e413e2c6 100644 --- a/deps/curl/tests/data/test629 +++ b/deps/curl/tests/data/test629 @@ -26,8 +26,5 @@ SCP invalid user login (password authentication) 67 - -disable - diff --git a/deps/curl/tests/data/test630 b/deps/curl/tests/data/test630 index 8a5c4438..3ab532b9 100644 --- a/deps/curl/tests/data/test630 +++ b/deps/curl/tests/data/test630 @@ -27,8 +27,5 @@ SFTP incorrect host key 60 - -disable - diff --git a/deps/curl/tests/data/test631 b/deps/curl/tests/data/test631 index ebf66144..4f9669b4 100644 --- a/deps/curl/tests/data/test631 +++ b/deps/curl/tests/data/test631 @@ -27,8 +27,5 @@ SCP incorrect host key 60 - -disable - diff --git a/deps/curl/tests/data/test633 b/deps/curl/tests/data/test633 index 8f8c4352..6a4da83b 100644 --- a/deps/curl/tests/data/test633 +++ b/deps/curl/tests/data/test633 @@ -35,8 +35,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test634 b/deps/curl/tests/data/test634 index 3669a8bf..94fd9e3d 100644 --- a/deps/curl/tests/data/test634 +++ b/deps/curl/tests/data/test634 @@ -36,8 +36,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test635 b/deps/curl/tests/data/test635 index b07b5c82..11a2457e 100644 --- a/deps/curl/tests/data/test635 +++ b/deps/curl/tests/data/test635 @@ -35,8 +35,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test636 b/deps/curl/tests/data/test636 index 96ffc0c1..cb0b4524 100644 --- a/deps/curl/tests/data/test636 +++ b/deps/curl/tests/data/test636 @@ -36,8 +36,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test637 b/deps/curl/tests/data/test637 index df80c483..a77cbf12 100644 --- a/deps/curl/tests/data/test637 +++ b/deps/curl/tests/data/test637 @@ -37,8 +37,5 @@ for ssh test 36 - -disable - diff --git a/deps/curl/tests/data/test638 b/deps/curl/tests/data/test638 index b41a3aec..7734577a 100644 --- a/deps/curl/tests/data/test638 +++ b/deps/curl/tests/data/test638 @@ -23,17 +23,14 @@ Dummy test file for rename test sftp -perl %SRCDIR/libtest/test610.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test610.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP post-quote rename * asterisk accept-fail ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-*rename %PWD/%LOGDIR/test%TESTNUMBER.dir %PWD/%LOGDIR/test%TESTNUMBER.new" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-*rename %SSH_PWD/%LOGDIR/test%TESTNUMBER.dir %SSH_PWD/%LOGDIR/test%TESTNUMBER.new" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure - -perl %SRCDIR/libtest/test610.pl rmdir %PWD/%LOGDIR/test%TESTNUMBER.new - Dummy test file for rename test @@ -42,8 +39,8 @@ Dummy test file for rename test # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test610.pl rmdir %PWD/%LOGDIR/test%TESTNUMBER.new + diff --git a/deps/curl/tests/data/test639 b/deps/curl/tests/data/test639 index 8105798f..74440a4b 100644 --- a/deps/curl/tests/data/test639 +++ b/deps/curl/tests/data/test639 @@ -23,17 +23,14 @@ Dummy test file for rename test sftp -perl %SRCDIR/libtest/test610.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir +%PERL %SRCDIR/libtest/test610.pl mkdir %PWD/%LOGDIR/test%TESTNUMBER.dir SFTP post-quote rename * asterisk accept-fail ---key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-*rename %PWD/%LOGDIR/test%TESTNUMBER-not-exists-dir %PWD/%LOGDIR/test%TESTNUMBER.new" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure +--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: -Q "-*rename %SSH_PWD/%LOGDIR/test%TESTNUMBER-not-exists-dir %SSH_PWD/%LOGDIR/test%TESTNUMBER.new" sftp://%HOSTIP:%SSHPORT%SSH_PWD/%LOGDIR/file%TESTNUMBER.txt --insecure - -perl %SRCDIR/libtest/test610.pl rmdir %PWD/%LOGDIR/test%TESTNUMBER.dir - Dummy test file for rename test @@ -42,8 +39,8 @@ Dummy test file for rename test # # Verify data after the test has been "shot" - -disable - + +%PERL %SRCDIR/libtest/test610.pl rmdir %PWD/%LOGDIR/test%TESTNUMBER.dir + diff --git a/deps/curl/tests/data/test640 b/deps/curl/tests/data/test640 index ecfc0934..31d2305d 100644 --- a/deps/curl/tests/data/test640 +++ b/deps/curl/tests/data/test640 @@ -34,8 +34,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test641 b/deps/curl/tests/data/test641 index 828198b4..0e82dbc0 100644 --- a/deps/curl/tests/data/test641 +++ b/deps/curl/tests/data/test641 @@ -34,8 +34,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test642 b/deps/curl/tests/data/test642 index ccb0c605..a249d642 100644 --- a/deps/curl/tests/data/test642 +++ b/deps/curl/tests/data/test642 @@ -35,8 +35,5 @@ for ssh test # # Verify data after the test has been "shot" - -disable - diff --git a/deps/curl/tests/data/test644 b/deps/curl/tests/data/test644 index fc670756..b055763a 100644 --- a/deps/curl/tests/data/test644 +++ b/deps/curl/tests/data/test644 @@ -47,7 +47,7 @@ Funny-head: yesyes http -debug +Debug xattr # simulate the xattr operations @@ -78,6 +78,7 @@ Accept: */* +user.creator => curl user.mime_type => text/html user.xdg.origin.url => http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test649 b/deps/curl/tests/data/test649 index 7751e38f..502e16ea 100644 --- a/deps/curl/tests/data/test649 +++ b/deps/curl/tests/data/test649 @@ -42,32 +42,12 @@ It contains at least an 8-bit byte value. # # Verify data after the test has been "shot" - -s/^--------------------------[A-Za-z0-9]*/------------------------------/ -s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ - EHLO %TESTNUMBER MAIL FROM: RCPT TO: DATA - -Content-Type: multipart/mixed; boundary=---------------------------- -Mime-Version: 1.0 -From: different -To: another - ------------------------------- -Content-Transfer-Encoding: 7bit - -This is valid ------------------------------- -Content-Disposition: attachment; filename="test%TESTNUMBER.txt" -Content-Transfer-Encoding: 7bit - -This is an attached file (in french: pi - 26 diff --git a/deps/curl/tests/data/test656 b/deps/curl/tests/data/test656 index 9478757d..22eb6c1b 100644 --- a/deps/curl/tests/data/test656 +++ b/deps/curl/tests/data/test656 @@ -23,9 +23,6 @@ SFTP retrieval with nonexistent private key file # # Verify data after the test has been "shot" - -disable - 67 diff --git a/deps/curl/tests/data/test661 b/deps/curl/tests/data/test661 index 5965bd8a..799d51e2 100644 --- a/deps/curl/tests/data/test661 +++ b/deps/curl/tests/data/test661 @@ -33,6 +33,9 @@ ftp://%HOSTIP:%FTPPORT/ # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test664 b/deps/curl/tests/data/test664 index 6ef1d90c..4a36a284 100644 --- a/deps/curl/tests/data/test664 +++ b/deps/curl/tests/data/test664 @@ -37,8 +37,5 @@ test 0 - -disable - diff --git a/deps/curl/tests/data/test665 b/deps/curl/tests/data/test665 index bdab8294..fe020e1a 100644 --- a/deps/curl/tests/data/test665 +++ b/deps/curl/tests/data/test665 @@ -37,8 +37,5 @@ test 0 - -disable - diff --git a/deps/curl/tests/data/test687 b/deps/curl/tests/data/test687 index 500a1dfb..28b8bee7 100644 --- a/deps/curl/tests/data/test687 +++ b/deps/curl/tests/data/test687 @@ -29,7 +29,7 @@ Content-Type: fake/data http -debug +Debug xattr # simulate the xattr operations @@ -55,6 +55,7 @@ Accept: */* +user.creator => curl user.mime_type => fake/data user.xdg.origin.url => http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test688 b/deps/curl/tests/data/test688 index c545c470..6fbd339f 100644 --- a/deps/curl/tests/data/test688 +++ b/deps/curl/tests/data/test688 @@ -29,7 +29,7 @@ Content-Type: fake/data http -debug +Debug xattr # simulate the xattr operations @@ -55,6 +55,7 @@ Accept: */* +user.creator => curl user.mime_type => fake/data user.xdg.origin.url => http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/deps/curl/tests/data/test690 b/deps/curl/tests/data/test690 new file mode 100644 index 00000000..6f333381 --- /dev/null +++ b/deps/curl/tests/data/test690 @@ -0,0 +1,67 @@ + + + +HTTP +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 + +-foo- + + + +# +# Client-side + + +http + + +-O with URL without path using trailing slash + + +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 +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/deps/curl/tests/data/test691 b/deps/curl/tests/data/test691 new file mode 100644 index 00000000..b8a9a08a --- /dev/null +++ b/deps/curl/tests/data/test691 @@ -0,0 +1,67 @@ + + + +HTTP +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 + +-foo- + + + +# +# Client-side + + +http + + +-O with URL with path using trailing slash + + +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 +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/deps/curl/tests/data/test692 b/deps/curl/tests/data/test692 new file mode 100644 index 00000000..e3e49a01 --- /dev/null +++ b/deps/curl/tests/data/test692 @@ -0,0 +1,56 @@ + + + +HTTP +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 + +-foo- + + + +# +# Client-side + + +http + + +-JO with URL without path using trailing slash + + +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/deps/curl/tests/data/test706 b/deps/curl/tests/data/test706 index 656b3dd8..8fbb24ba 100644 --- a/deps/curl/tests/data/test706 +++ b/deps/curl/tests/data/test706 @@ -11,9 +11,7 @@ SOCKS4 # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -49,6 +47,9 @@ FTP dir list PASV via SOCKS4 # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test707 b/deps/curl/tests/data/test707 index 3ed89ec6..f22b2010 100644 --- a/deps/curl/tests/data/test707 +++ b/deps/curl/tests/data/test707 @@ -11,9 +11,7 @@ SOCKS5 # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # @@ -49,6 +47,9 @@ FTP dir list PASV via SOCKS5 # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test711 b/deps/curl/tests/data/test711 index 355ca0e5..288fcc1d 100644 --- a/deps/curl/tests/data/test711 +++ b/deps/curl/tests/data/test711 @@ -43,6 +43,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test712 b/deps/curl/tests/data/test712 index 7bcc2a1b..ef64b3f5 100644 --- a/deps/curl/tests/data/test712 +++ b/deps/curl/tests/data/test712 @@ -37,6 +37,9 @@ ftp://%HOSTIP:%FTPPORT/%TESTNUMBER --proxy socks5://%HOSTIP:%SOCKSPORT # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test713 b/deps/curl/tests/data/test713 index 44820a78..81374027 100644 --- a/deps/curl/tests/data/test713 +++ b/deps/curl/tests/data/test713 @@ -38,6 +38,9 @@ ftp://ftp.example.com/%TESTNUMBER --connect-to ::%HOSTIP:%FTPPORT --proxy socks5 # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test714 b/deps/curl/tests/data/test714 index a38400bb..6414188e 100644 --- a/deps/curl/tests/data/test714 +++ b/deps/curl/tests/data/test714 @@ -57,6 +57,9 @@ ftp://ftp.example.com.%TESTNUMBER/%TESTNUMBER --connect-to ::connect.example.com # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test715 b/deps/curl/tests/data/test715 index 6f9670af..e931e0d6 100644 --- a/deps/curl/tests/data/test715 +++ b/deps/curl/tests/data/test715 @@ -59,6 +59,9 @@ ftp://ftp.example.com.%TESTNUMBER/%TESTNUMBER --connect-to ::connect.example.com # # Verify data after the test has been "shot" + +QUIT + USER anonymous PASS ftp@example.com diff --git a/deps/curl/tests/data/test719 b/deps/curl/tests/data/test719 index 63cb8888..45446098 100644 --- a/deps/curl/tests/data/test719 +++ b/deps/curl/tests/data/test719 @@ -31,7 +31,7 @@ Funny-head: yesyes # Client-side -ipv6 +IPv6 proxy diff --git a/deps/curl/tests/data/test76 b/deps/curl/tests/data/test76 deleted file mode 100644 index 4c83566d..00000000 --- a/deps/curl/tests/data/test76 +++ /dev/null @@ -1,36 +0,0 @@ - - - -FAILURE - - -# -# Server-side - - - -# -# Client-side - - -none - - -http - - -HTTP, -O with no file name part in the URL - - -http://%HOSTIP:%NOLISTENPORT/%TESTNUMBER/ -O - - - -# -# Verify data after the test has been "shot" - - -23 - - - diff --git a/deps/curl/tests/data/test780 b/deps/curl/tests/data/test780 new file mode 100644 index 00000000..cdb8b711 --- /dev/null +++ b/deps/curl/tests/data/test780 @@ -0,0 +1,81 @@ + + + +HTTP +HTTP proxy +HSTS + + + + + +# we use this as response to a CONNECT + +HTTP/1.1 200 OK +Server: fake + + + + +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 +Strict-Transport-Security: max-age = 1000 + + + + + + +http +http-proxy +https + + +HSTS +proxy +https +Debug + + + +CURL_HSTS_HTTP=yes +CURL_TIME=1728465947 + + + +this.hsts.example "99991001 04:47:41" + + + +HSTS with updated expiry in response + + +-x http://%HOSTIP:%PROXYPORT http://this.hsts.example:%HTTPSPORT/%TESTNUMBER --hsts %LOGDIR/input%TESTNUMBER -k + + + + + + +HTTP/1.1 200 OK +Server: fake + +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 +Strict-Transport-Security: max-age = 1000 + + + + +# Your HSTS cache. https://curl.se/docs/hsts.html +# This file was generated by libcurl! Edit at your own risk. +this.hsts.example "20241009 09:42:27" + + + diff --git a/deps/curl/tests/data/test781 b/deps/curl/tests/data/test781 new file mode 100644 index 00000000..e931da4f --- /dev/null +++ b/deps/curl/tests/data/test781 @@ -0,0 +1,84 @@ + + + +HTTP +HTTP proxy +HSTS + + + + + +# we use this as response to a CONNECT + +HTTP/1.1 200 OK +Server: fake + + + + +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 +Strict-Transport-Security: max-age=1000 + + + + + + +http +http-proxy +https + + +HSTS +proxy +https +Debug +large-time + + + +CURL_HSTS_HTTP=yes +CURL_TIME=1728465947 + + + +.hsts.example "20991001 04:47:41" +this.hsts.example "99991001 04:47:41" + + + +HSTS update expiry, with parent includeSubDomains domain present + + +-x http://%HOSTIP:%PROXYPORT http://this.hsts.example:%HTTPSPORT/%TESTNUMBER --hsts %LOGDIR/input%TESTNUMBER -k + + + + + + +HTTP/1.1 200 OK +Server: fake + +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 +Strict-Transport-Security: max-age=1000 + + + + +# Your HSTS cache. https://curl.se/docs/hsts.html +# This file was generated by libcurl! Edit at your own risk. +.hsts.example "20991001 04:47:41" +this.hsts.example "20241009 09:42:27" + + + diff --git a/deps/curl/tests/data/test782 b/deps/curl/tests/data/test782 new file mode 100644 index 00000000..ae0d7474 --- /dev/null +++ b/deps/curl/tests/data/test782 @@ -0,0 +1,84 @@ + + + +HTTP +HTTP proxy +HSTS + + + + + +# we use this as response to a CONNECT + +HTTP/1.1 200 OK +Server: fake + + + + +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 +Strict-Transport-Security: max-age=1000; includesubdomains + + + + + + +http +http-proxy +https + + +HSTS +proxy +https +Debug +large-time + + + +CURL_HSTS_HTTP=yes +CURL_TIME=1728465947 + + + +.hsts.example "20991001 04:47:41" +.this.hsts.example "99991001 04:47:41" + + + +HSTS update expiry, with two includeSubDomains domains present + + +-x http://%HOSTIP:%PROXYPORT http://this.hsts.example:%HTTPSPORT/%TESTNUMBER --hsts %LOGDIR/input%TESTNUMBER -k + + + + + + +HTTP/1.1 200 OK +Server: fake + +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 +Strict-Transport-Security: max-age=1000; includesubdomains + + + + +# Your HSTS cache. https://curl.se/docs/hsts.html +# This file was generated by libcurl! Edit at your own risk. +.hsts.example "20991001 04:47:41" +.this.hsts.example "20241009 09:42:27" + + + diff --git a/deps/curl/tests/data/test783 b/deps/curl/tests/data/test783 new file mode 100644 index 00000000..dc58fa4f --- /dev/null +++ b/deps/curl/tests/data/test783 @@ -0,0 +1,84 @@ + + + +HTTP +HTTP proxy +HSTS + + + + + +# we use this as response to a CONNECT + +HTTP/1.1 200 OK +Server: fake + + + + +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 +Strict-Transport-Security: max-age=1000; + + + + + + +http +http-proxy +https + + +HSTS +proxy +https +Debug +large-time + + + +CURL_HSTS_HTTP=yes +CURL_TIME=1728465947 + + + +.hsts.example "20991001 04:47:41" +.this.hsts.example "99991001 04:47:41" + + + +HSTS update expiry, removing includesubdomains in update + + +-x http://%HOSTIP:%PROXYPORT http://this.hsts.example:%HTTPSPORT/%TESTNUMBER --hsts %LOGDIR/input%TESTNUMBER -k + + + + + + +HTTP/1.1 200 OK +Server: fake + +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 +Strict-Transport-Security: max-age=1000; + + + + +# Your HSTS cache. https://curl.se/docs/hsts.html +# This file was generated by libcurl! Edit at your own risk. +.hsts.example "20991001 04:47:41" +this.hsts.example "20241009 09:42:27" + + + diff --git a/deps/curl/tests/data/test8 b/deps/curl/tests/data/test8 index 9e581881..e231cd7e 100644 --- a/deps/curl/tests/data/test8 +++ b/deps/curl/tests/data/test8 @@ -79,7 +79,7 @@ Set-Cookie: cookie31=%hex[%7f-junk]hex% -perl -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}' +%PERL -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}' cookies diff --git a/deps/curl/tests/data/test823 b/deps/curl/tests/data/test823 index 18ed5fa6..a3736a6f 100644 --- a/deps/curl/tests/data/test823 +++ b/deps/curl/tests/data/test823 @@ -36,7 +36,7 @@ imap !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test831 b/deps/curl/tests/data/test831 index 38243236..1ef3d45c 100644 --- a/deps/curl/tests/data/test831 +++ b/deps/curl/tests/data/test831 @@ -34,18 +34,9 @@ SSL IMAP NTLM graceful cancellation - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - 'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1' -u testuser:testpass - -chkhostname curlhost - # diff --git a/deps/curl/tests/data/test832 b/deps/curl/tests/data/test832 index 6001c1d4..bbbc0ac7 100644 --- a/deps/curl/tests/data/test832 +++ b/deps/curl/tests/data/test832 @@ -28,7 +28,7 @@ imap !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test834 b/deps/curl/tests/data/test834 index e142ca21..ccdf0d1f 100644 --- a/deps/curl/tests/data/test834 +++ b/deps/curl/tests/data/test834 @@ -45,18 +45,9 @@ SSL IMAP NTLM authentication with SASL downgrade - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - 'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1' -u user:secret - -chkhostname curlhost - # diff --git a/deps/curl/tests/data/test835 b/deps/curl/tests/data/test835 index ee6ed31d..17c8675e 100644 --- a/deps/curl/tests/data/test835 +++ b/deps/curl/tests/data/test835 @@ -39,7 +39,7 @@ imap !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test853 b/deps/curl/tests/data/test853 index de523642..3b57e7d0 100644 --- a/deps/curl/tests/data/test853 +++ b/deps/curl/tests/data/test853 @@ -18,11 +18,11 @@ SLOWDOWN # When doing LIST, we get the default list output hard-coded in the test # POP3 server - + 1 100 2 4294967400 3 200 - + # diff --git a/deps/curl/tests/data/test869 b/deps/curl/tests/data/test869 index 59900df0..56873e03 100644 --- a/deps/curl/tests/data/test869 +++ b/deps/curl/tests/data/test869 @@ -38,7 +38,7 @@ pop3 !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test877 b/deps/curl/tests/data/test877 index 25023706..e2cb4b37 100644 --- a/deps/curl/tests/data/test877 +++ b/deps/curl/tests/data/test877 @@ -35,18 +35,9 @@ SSL POP3 NTLM graceful cancellation - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u testuser:testpass - -chkhostname curlhost - # diff --git a/deps/curl/tests/data/test878 b/deps/curl/tests/data/test878 index 58c2e300..657dc71c 100644 --- a/deps/curl/tests/data/test878 +++ b/deps/curl/tests/data/test878 @@ -29,7 +29,7 @@ pop3 !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test880 b/deps/curl/tests/data/test880 index dfa2e688..21536d81 100644 --- a/deps/curl/tests/data/test880 +++ b/deps/curl/tests/data/test880 @@ -47,18 +47,9 @@ SSL POP3 NTLM authentication with SASL downgrade - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret - -chkhostname curlhost - # diff --git a/deps/curl/tests/data/test881 b/deps/curl/tests/data/test881 index 7cbdf64b..20e35278 100644 --- a/deps/curl/tests/data/test881 +++ b/deps/curl/tests/data/test881 @@ -41,7 +41,7 @@ pop3 !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test907 b/deps/curl/tests/data/test907 index 12d6e828..8c24b68c 100644 --- a/deps/curl/tests/data/test907 +++ b/deps/curl/tests/data/test907 @@ -28,7 +28,7 @@ smtp !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test933 b/deps/curl/tests/data/test933 index 71f38930..3c25ffa5 100644 --- a/deps/curl/tests/data/test933 +++ b/deps/curl/tests/data/test933 @@ -34,18 +34,9 @@ SSL SMTP NTLM graceful cancellation - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u testuser:testpass -T - - -chkhostname curlhost - # diff --git a/deps/curl/tests/data/test934 b/deps/curl/tests/data/test934 index 8fd444e9..5ebf67fe 100644 --- a/deps/curl/tests/data/test934 +++ b/deps/curl/tests/data/test934 @@ -28,7 +28,7 @@ smtp !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test936 b/deps/curl/tests/data/test936 index f57f63ec..723cebca 100644 --- a/deps/curl/tests/data/test936 +++ b/deps/curl/tests/data/test936 @@ -40,18 +40,9 @@ SMTP NTLM authentication with SASL downgrade mail body - -# we force our own host name, in order to make the test machine independent -CURL_GETHOSTNAME=curlhost -# we try to use the LD_PRELOAD hack, if not a debug build -LD_PRELOAD=%PWD/libtest/.libs/libhostname.so - smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -u user:secret -T - - -chkhostname curlhost - # diff --git a/deps/curl/tests/data/test937 b/deps/curl/tests/data/test937 index 6c361b73..bb761f85 100644 --- a/deps/curl/tests/data/test937 +++ b/deps/curl/tests/data/test937 @@ -31,7 +31,7 @@ smtp !SSPI -debug +Debug crypto diff --git a/deps/curl/tests/data/test941 b/deps/curl/tests/data/test941 index 7c87f502..7b7669fd 100644 --- a/deps/curl/tests/data/test941 +++ b/deps/curl/tests/data/test941 @@ -26,12 +26,13 @@ To: another email headers and body -with unix newlines +with Unix newlines meant to be converted with the --crlf option +%repeat[650 x 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789%0a]% smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -T %LOGDIR/upload%TESTNUMBER --crlf @@ -54,12 +55,13 @@ To: another email headers and body -with unix newlines +with Unix newlines meant to be converted with the --crlf option +%repeat[650 x 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 %0a]% . diff --git a/deps/curl/tests/data/test955 b/deps/curl/tests/data/test955 index 24cc2b7e..982afc35 100644 --- a/deps/curl/tests/data/test955 +++ b/deps/curl/tests/data/test955 @@ -21,14 +21,12 @@ smtp !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP without SMTPUTF8 support - UTF-8 based sender (local part only) diff --git a/deps/curl/tests/data/test956 b/deps/curl/tests/data/test956 index 1180523b..22bf3a14 100644 --- a/deps/curl/tests/data/test956 +++ b/deps/curl/tests/data/test956 @@ -18,14 +18,12 @@ smtp !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP without SMTPUTF8 support - UTF-8 based recipient (local part only) diff --git a/deps/curl/tests/data/test957 b/deps/curl/tests/data/test957 index 1b01b7e5..d49739d8 100644 --- a/deps/curl/tests/data/test957 +++ b/deps/curl/tests/data/test957 @@ -19,14 +19,12 @@ smtp !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP VRFY without SMTPUTF8 support - UTF-8 based recipient (local part only) diff --git a/deps/curl/tests/data/test958 b/deps/curl/tests/data/test958 index 3ad77fe1..ea5a2dba 100644 --- a/deps/curl/tests/data/test958 +++ b/deps/curl/tests/data/test958 @@ -19,14 +19,12 @@ smtp !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP external VRFY without SMTPUTF8 support - UTF-8 based recipient (local part only) diff --git a/deps/curl/tests/data/test959 b/deps/curl/tests/data/test959 index 143708df..178e0f13 100644 --- a/deps/curl/tests/data/test959 +++ b/deps/curl/tests/data/test959 @@ -20,16 +20,14 @@ REPLY MAIL 501 not fine enough smtp -!idn +!IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP without SMTPUTF8 support - UTF-8 based sender (host part only) diff --git a/deps/curl/tests/data/test960 b/deps/curl/tests/data/test960 index bcb9bf44..2cf348eb 100644 --- a/deps/curl/tests/data/test960 +++ b/deps/curl/tests/data/test960 @@ -17,16 +17,14 @@ SMTP smtp -!idn +!IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP without SMTPUTF8 support - UTF-8 based recipient (host part only) diff --git a/deps/curl/tests/data/test961 b/deps/curl/tests/data/test961 index 750943ab..57958a4e 100644 --- a/deps/curl/tests/data/test961 +++ b/deps/curl/tests/data/test961 @@ -18,16 +18,14 @@ VRFY smtp -!idn +!IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP external VRFY without SMTPUTF8 support - UTF-8 based recipient (host part only) diff --git a/deps/curl/tests/data/test962 b/deps/curl/tests/data/test962 index 503761b4..6ac4ab08 100644 --- a/deps/curl/tests/data/test962 +++ b/deps/curl/tests/data/test962 @@ -18,16 +18,14 @@ IDN smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP without SMTPUTF8 support - UTF-8 based sender (host part only) diff --git a/deps/curl/tests/data/test963 b/deps/curl/tests/data/test963 index 1b977f00..9fe94f89 100644 --- a/deps/curl/tests/data/test963 +++ b/deps/curl/tests/data/test963 @@ -18,16 +18,14 @@ IDN smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP without SMTPUTF8 support (IDN Enabled) - UTF-8 based recipient (host part only) diff --git a/deps/curl/tests/data/test964 b/deps/curl/tests/data/test964 index e2d69881..05dbda93 100644 --- a/deps/curl/tests/data/test964 +++ b/deps/curl/tests/data/test964 @@ -19,16 +19,14 @@ IDN smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP external VRFY without SMTPUTF8 support (IDN Enabled) - UTF-8 based recipient (host part only) diff --git a/deps/curl/tests/data/test965 b/deps/curl/tests/data/test965 index 71adef8f..f44239e7 100644 --- a/deps/curl/tests/data/test965 +++ b/deps/curl/tests/data/test965 @@ -21,16 +21,14 @@ CAPA SMTPUTF8 smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP with SMTPUTF8 support - UTF-8 based sender diff --git a/deps/curl/tests/data/test966 b/deps/curl/tests/data/test966 index acc248a5..31b6c288 100644 --- a/deps/curl/tests/data/test966 +++ b/deps/curl/tests/data/test966 @@ -21,16 +21,14 @@ CAPA SMTPUTF8 smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP with SMTPUTF8 support - UTF-8 based recipient diff --git a/deps/curl/tests/data/test967 b/deps/curl/tests/data/test967 index 95fb153b..d823b483 100644 --- a/deps/curl/tests/data/test967 +++ b/deps/curl/tests/data/test967 @@ -25,16 +25,14 @@ CAPA SMTPUTF8 smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP external VRFY with SMTPUTF8 support diff --git a/deps/curl/tests/data/test968 b/deps/curl/tests/data/test968 index 099f6fd2..b057be62 100644 --- a/deps/curl/tests/data/test968 +++ b/deps/curl/tests/data/test968 @@ -22,16 +22,14 @@ CAPA SMTPUTF8 smtp -idn +IDN !win32 +codeset-utf8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 - -perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");' - SMTP VRFY with SMTPUTF8 support diff --git a/deps/curl/tests/data/test969 b/deps/curl/tests/data/test969 index bb4cc316..c7bffb9b 100644 --- a/deps/curl/tests/data/test969 +++ b/deps/curl/tests/data/test969 @@ -28,7 +28,7 @@ CAPA SMTPUTF8 smtp -idn +IDN !win32 diff --git a/deps/curl/tests/data/test970 b/deps/curl/tests/data/test970 index 94e00df1..98997973 100644 --- a/deps/curl/tests/data/test970 +++ b/deps/curl/tests/data/test970 @@ -32,7 +32,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i http -debug +Debug proxy @@ -59,7 +59,7 @@ Accept: */* -{"certs":"","content_type":"text/html","conn_id":0,"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,"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_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.scheme":"http","url.user":null,"url.password":null,"url.options":null,"url.host":"%HOSTIP","url.port":"%HTTPPORT","url.path":"/%TESTNUMBER","url.query":null,"url.fragment":null,"url.zoneid":null,"urle.scheme":"http","urle.user":null,"urle.password":null,"urle.options":null,"urle.host":"%HOSTIP","urle.port":"%HTTPPORT","urle.path":"/%TESTNUMBER","urle.query":null,"urle.fragment":null,"urle.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"} +{"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_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"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/deps/curl/tests/data/test972 b/deps/curl/tests/data/test972 index 735c9599..01bd2ed5 100644 --- a/deps/curl/tests/data/test972 +++ b/deps/curl/tests/data/test972 @@ -33,7 +33,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i http -debug +Debug proxy @@ -60,7 +60,7 @@ Accept: */* -{"certs":"","content_type":"text/html","conn_id":0,"errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out972","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"%HOSTIP","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":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_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.scheme":"http","url.user":null,"url.password":null,"url.options":null,"url.host":"%HOSTIP","url.port":"%HTTPPORT","url.path":"/%TESTNUMBER","url.query":null,"url.fragment":null,"url.zoneid":null,"urle.scheme":"http","urle.user":null,"urle.password":null,"urle.options":null,"urle.host":"%HOSTIP","urle.port":"%HTTPPORT","urle.path":"/%TESTNUMBER","urle.query":null,"urle.fragment":null,"urle.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"} +{"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_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"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/deps/curl/tests/data/test973 b/deps/curl/tests/data/test973 index 17748ea7..2961ce7c 100644 --- a/deps/curl/tests/data/test973 +++ b/deps/curl/tests/data/test973 @@ -66,6 +66,9 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -L -u joe:secret # # Verify data after the test has been "shot" + +QUIT + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/deps/curl/tests/data/test975 b/deps/curl/tests/data/test975 index 33f2559c..ea440526 100644 --- a/deps/curl/tests/data/test975 +++ b/deps/curl/tests/data/test975 @@ -66,6 +66,9 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --location-trusted -u joe:secret # # Verify data after the test has been "shot" + +QUIT + GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT diff --git a/deps/curl/tests/data/test99 b/deps/curl/tests/data/test99 index db11a059..b0e769a7 100644 --- a/deps/curl/tests/data/test99 +++ b/deps/curl/tests/data/test99 @@ -35,7 +35,7 @@ Funny-head: yesyes # Client-side -large_file +Largefile http diff --git a/deps/curl/tests/data/test2036 b/deps/curl/tests/data/test993 similarity index 53% rename from deps/curl/tests/data/test2036 rename to deps/curl/tests/data/test993 index 9fd89a2a..01248de3 100644 --- a/deps/curl/tests/data/test2036 +++ b/deps/curl/tests/data/test993 @@ -1,36 +1,42 @@ -FAILURE +POP3 +Clear Text +LIST + # # Server-side + +%repeat[1000 x 95 328485%0d%0a]% # # Client-side -none +pop3 - -http - -HTTP, -O with no slash at all in the URL +POP3 LIST 1000 messages - -%HOSTIP:%NOLISTENPORT -O + +pop3://%HOSTIP:%POP3PORT/ -u user:secret # # Verify data after the test has been "shot" - -23 - + +CAPA +USER user +PASS secret +LIST +QUIT + diff --git a/deps/curl/tests/data/test994 b/deps/curl/tests/data/test994 new file mode 100644 index 00000000..e19d8c01 --- /dev/null +++ b/deps/curl/tests/data/test994 @@ -0,0 +1,42 @@ + + + +HTTP +HTTP GET + + + +# +# Server-side + + + +# +# Client-side + + +http + + +--skip-existing with globbing + + +-o "%LOGDIR/#1" "http://%HOSTIP:%HTTPPORT/%TESTNUMBER/{hey,ho}" --skip-existing + + +content + + +content + + + +# +# Verify data after the test has been "shot" + + +Note: skips transfer, "%LOGDIR/hey" exists locally +Note: skips transfer, "%LOGDIR/ho" exists locally + + + diff --git a/deps/curl/tests/data/test995 b/deps/curl/tests/data/test995 new file mode 100644 index 00000000..f2ec85ea --- /dev/null +++ b/deps/curl/tests/data/test995 @@ -0,0 +1,56 @@ + + + +HTTP +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 + +-foo- + + + +# +# Client-side + + +http + + +--skip-existing without file present + + +-o %LOGDIR/there http://%HOSTIP:%HTTPPORT/%TESTNUMBER --skip-existing + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +-foo- + + + diff --git a/deps/curl/tests/data/test996 b/deps/curl/tests/data/test996 new file mode 100644 index 00000000..7c5e6390 --- /dev/null +++ b/deps/curl/tests/data/test996 @@ -0,0 +1,41 @@ + + + +HTTP +HTTP GET + + + +# +# Server-side + + + +# +# Client-side + + +http + + +--skip-existing with file present + + +-o %LOGDIR/there http://%HOSTIP:%HTTPPORT/%TESTNUMBER --skip-existing + + +content + + + +# +# Verify data after the test has been "shot" + + +Note: skips transfer, "%LOGDIR/there" exists locally + + +content + + + diff --git a/deps/curl/tests/data/test997 b/deps/curl/tests/data/test997 new file mode 100644 index 00000000..2883330f --- /dev/null +++ b/deps/curl/tests/data/test997 @@ -0,0 +1,47 @@ + + + +POP3 +Clear Text +STAT +CUSTOMREQUEST +RFC2449 + + + +# +# Server-side + + +CAPA TOP USER + + + + + +# +# Client-side + + +pop3 + + +POP3 retrieve STAT (CUSTOMREQUEST) + + +pop3://%HOSTIP:%POP3PORT -u user:secret -X 'STAT' + + + +# +# Verify data after the test has been "shot" + + +CAPA +USER user +PASS secret +STAT +QUIT + + + diff --git a/deps/curl/tests/data/test998 b/deps/curl/tests/data/test998 new file mode 100644 index 00000000..c3a8f516 --- /dev/null +++ b/deps/curl/tests/data/test998 @@ -0,0 +1,92 @@ + + + +HTTP +--location-trusted + + + +# +# Server-side + + +HTTP/1.1 301 redirect +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Connection: close +Content-Type: text/html +Location: http://somewhere.else.example/a/path/%TESTNUMBER0002 + + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + +HTTP/1.1 301 redirect +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Connection: close +Content-Type: text/html +Location: http://somewhere.else.example/a/path/%TESTNUMBER0002 + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + + +# +# Client-side + + +proxy + + +http + + +HTTP with auth in URL redirected to another host + + +-x %HOSTIP:%HTTPPORT http://alberto:einstein@somwhere.example/%TESTNUMBER --location-trusted + + + +# +# Verify data after the test has been "shot" + + +QUIT + + +GET http://somwhere.example/998 HTTP/1.1 +Host: somwhere.example +Authorization: Basic YWxiZXJ0bzplaW5zdGVpbg== +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 YWxiZXJ0bzplaW5zdGVpbg== +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive + + + + diff --git a/deps/curl/tests/data/test999 b/deps/curl/tests/data/test999 new file mode 100644 index 00000000..990a8d09 --- /dev/null +++ b/deps/curl/tests/data/test999 @@ -0,0 +1,81 @@ + + + +HTTP +--location-trusted + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + +HTTP/1.1 301 redirect +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 0 +Connection: close +Content-Type: text/html +Location: http://somewhere.else.example/a/path/%TESTNUMBER0002 + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + + +# +# Client-side + + +proxy + + +http + + +HTTP with auth in first URL but not second + + +-x %HOSTIP:%HTTPPORT http://alberto:einstein@somwhere.example/%TESTNUMBER http://somewhere.else.example/%TESTNUMBER + + + +# +# Verify data after the test has been "shot" + + +QUIT + + +GET http://somwhere.example/%TESTNUMBER HTTP/1.1 +Host: somwhere.example +Authorization: Basic YWxiZXJ0bzplaW5zdGVpbg== +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 + + + + diff --git a/deps/curl/tests/devtest.pl b/deps/curl/tests/devtest.pl index 99a25ab6..4fb0934e 100644 --- a/deps/curl/tests/devtest.pl +++ b/deps/curl/tests/devtest.pl @@ -110,7 +110,7 @@ sub parseprotocols { # Initialize @protocols from the curl binary under test # sub init_protocols { - for (`$CURL -V 2>/dev/null`) { + for (`$CURL -V 2>$dev_null`) { if(m/^Protocols: (.*)$/) { parseprotocols($1); } diff --git a/deps/curl/tests/dictserver.py b/deps/curl/tests/dictserver.py index 0a08522f..c28a22e5 100644 --- a/deps/curl/tests/dictserver.py +++ b/deps/curl/tests/dictserver.py @@ -24,7 +24,7 @@ # ########################################################################### # -""" DICT server """ +"""DICT server.""" from __future__ import (absolute_import, division, print_function, unicode_literals) @@ -37,7 +37,7 @@ import sys from util import ClosingFileHandler try: # Python 2 - import SocketServer as socketserver + import SocketServer as socketserver # type: ignore except ImportError: # Python 3 import socketserver @@ -50,10 +50,7 @@ VERIFIED_RSP = "WE ROOLZ: {pid}" def dictserver(options): - """ - Starts up a TCP server with a DICT handler and serves DICT requests - forever. - """ + """Start up a TCP server with a DICT handler and serve DICT requests forever.""" if options.pidfile: pid = os.getpid() # see tests/server/util.c function write_pidfile @@ -74,13 +71,10 @@ def dictserver(options): class DictHandler(socketserver.BaseRequestHandler): - """Handler class for DICT connections. + """Handler class for DICT connections.""" - """ def handle(self): - """ - Simple function which responds to all queries with a 552. - """ + """Respond to all queries with a 552.""" try: # First, send a response to allow the server to continue. rsp = "220 dictserver \n" @@ -133,9 +127,7 @@ def get_options(): def setup_logging(options): - """ - Set up logging from the command line options - """ + """Set up logging from the command line options.""" root_logger = logging.getLogger() add_stdout = False @@ -166,16 +158,13 @@ def setup_logging(options): class ScriptRC(object): - """Enum for script return codes""" + """Enum for script return codes.""" + SUCCESS = 0 FAILURE = 1 EXCEPTION = 2 -class ScriptException(Exception): - pass - - if __name__ == '__main__': # Get the options from the user. options = get_options() @@ -186,8 +175,8 @@ if __name__ == '__main__': # Run main script. try: rc = dictserver(options) - except Exception as e: - log.exception(e) + except Exception: + log.exception('Error running server') rc = ScriptRC.EXCEPTION if options.pidfile and os.path.isfile(options.pidfile): diff --git a/deps/curl/tests/ech_combos.py b/deps/curl/tests/ech_combos.py new file mode 100644 index 00000000..66daaa37 --- /dev/null +++ b/deps/curl/tests/ech_combos.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +# Python3 program to print all combination of size r in an array of size n. +# This is used to generate test lines in tests/ech_test.sh. +# This will be discarded in the process of moving from experimental, +# but is worth preserving for the moment in case of changes to the +# ECH command line args + +def CombinationRepetitionUtil(chosen, arr, badarr, index, + r, start, end): + + # Current combination is ready, + # print it + if index == r: + # figure out if result should be good or bad and + # print prefix, assuming $turl does support ECH so + # should work if given "positive" parameters + res = 1 + j = len(chosen) - 1 + while res and j >= 0: + if chosen[j] in badarr: + res = 0 + j = j - 1 + print("cli_test $turl 1", res, end = " ") + # print combination but eliminating any runs of + # two identical params + for j in range(r): + if j != 0 and chosen[j] != chosen[j-1]: + print(chosen[j], end = " ") + + print() + return + + # When no more elements are + # there to put in chosen[] + if start > n: + return + + # Current is included, put + # next at next location + chosen[index] = arr[start] + + # Current is excluded, replace it + # with next (Note that i+1 is passed, + # but index is not changed) + CombinationRepetitionUtil(chosen, arr, badarr, index + 1, + r, start, end) + CombinationRepetitionUtil(chosen, arr, badarr, index, + r, start + 1, end) + +# The main function that prints all +# combinations of size r in arr[] of +# size n. This function mainly uses +# CombinationRepetitionUtil() +def CombinationRepetition(arr, badarr, n, r): + + # A temporary array to store + # all combination one by one + chosen = [0] * r + + # Print all combination using + # temporary array 'chosen[]' + CombinationRepetitionUtil(chosen, arr, badarr, 0, r, 0, n) + +# Driver code +badarr = [ '--ech grease', '--ech false', '--ech ecl:$badecl', '--ech pn:$badpn' ] +goodarr = [ '--ech hard', '--ech true', '--ech ecl:$goodecl', '--ech pn:$goodpn' ] +arr = badarr + goodarr +r = 8 +n = len(arr) - 1 + +CombinationRepetition(arr, badarr, n, r) + +# This code is contributed by Vaibhav Kumar 12. diff --git a/deps/curl/tests/ech_tests.sh b/deps/curl/tests/ech_tests.sh new file mode 100644 index 00000000..1746f165 --- /dev/null +++ b/deps/curl/tests/ech_tests.sh @@ -0,0 +1,1156 @@ +#!/bin/bash +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# + +# 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 +# for which neither is the case. + +# TODO: Translate this into something that approximates a valid curl test:-) +# Should be useful though even before such translation and a pile less work +# to do this than that. The pile of work required would include making an +# ECH-enabled server and a DoH server. For now, this is just run manually. +# + +# 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) +: "${CURL_CFG_FILE=$HOME/.curlrc}" +active_ech=$(grep ech "$CURL_CFG_FILE" | grep -v "#.*ech") +if [[ "$active_ech" != "" ]] +then + echo "You seem to have an active ECH setting in $CURL_CFG_FILE" + echo "That might affect results so please remove that or comment" + echo "it out - exiting." + exit 1 +fi + + +# Targets we expect to be ECH-enabled servers +# for which an HTTPS RR is published. +# structure is host:port mapped to pathname +# TODO: add negative tests for these +declare -A ech_targets=( + [my-own.net]="ech-check.php" + [my-own.net:8443]="ech-check.php" + [defo.ie]="ech-check.php" + [cover.defo.ie]="" + [draft-13.esni.defo.ie:8413]="stats" + [draft-13.esni.defo.ie:8414]="stats" + [draft-13.esni.defo.ie:9413]="" + [draft-13.esni.defo.ie:10413]="" + [draft-13.esni.defo.ie:11413]="" + [draft-13.esni.defo.ie:12413]="" + [draft-13.esni.defo.ie:12414]="" + [crypto.cloudflare.com]="cdn-cgi/trace" + [tls-ech.dev]="" + # this one's gone away for now (possibly temporarily) + # [epochbelt.com]="" +) + +# Targets we expect not to be ECH-enabled servers +# but for which an HTTPS RR is published. +declare -A httpsrr_targets=( + [ietf.org]="" + [rte.ie]="" +) + +# Targets we expect not to be ECH-enabled servers +# and for which no HTTPS RR is published. +declare -A neither_targets=( + [www.tcd.ie]="" + [jell.ie]="" +) + +# +# Variables that can be over-ridden from environment +# + +# Top of curl test tree, assume we're there +: "${CTOP:=.}" + +# Place to put test log output +: "${LTOP:=$CTOP/tests/ech-log/}" + +# Place to stash outputs when things go wrong +: "${BTOP:=$LTOP}" + +# Time to wait for a remote access to work, 10 seconds +: "${tout:=10s}" + +# Where we find OpenSSL .so's +: "${OSSL:=$HOME/code/openssl-local-inst}" + +# Where we find wolfSSL .so's +: "${WSSL:=$HOME/code/wolfssl/inst/lib}" + +# Where we find BoringSSL .so's +: "${BSSL:=$HOME/code/boringssl/inst/lib}" + +# Where we send DoH queries when using kdig or curl +: "${DOHSERVER:=one.one.one.one}" +: "${DOHPATH:=dns-query}" + +# Whether to send mail when bad things happen (mostly for cronjob) +: "${DOMAIL:=no}" + +# Misc vars and functions + +DEFPORT=443 + +function whenisitagain() +{ + /bin/date -u +%Y%m%d-%H%M%S +} + +function fileage() +{ + echo $(($(date +%s) - $(date +%s -r "$1"))) +} + +function hostport2host() +{ + case $1 in + *:*) host=${1%:*} port=${1##*:};; + *) host=$1 port=$DEFPORT;; + esac + echo "$host" +} + +function hostport2port() +{ + case $1 in + *:*) host=${1%:*} port=${1##*:};; + *) host=$1 port=$DEFPORT;; + esac + echo "$port" +} + +function cli_test() +{ + # 1st param is target URL + turl=$1 + # 2nd param is 0 if we expect curl to not work or 1 if we expect it + # to have worked + curl_winorlose=$2 + # 3rd param is 0 if we expect ECH to not work or 1 if we expect it + # to have worked + ech_winorlose=$3 + # remaining params are passed to command line + # echparms=(${@:4}) + IFS=" " read -r -a echparms <<< "${@:4}" + + TMPF=$(mktemp) + cmd="timeout $tout $CURL ${CURL_PARAMS[*]} ${echparms[*]} $turl >$TMPF 2>&1" + echo "cli_test: $cmd " >> "$logfile" + timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" "${echparms[@]}" "$turl" >"$TMPF" 2>&1 + eres=$? + if [[ "$eres" == "124" ]] + then + allgood="no" + echo "cli_test: Timeout running $cmd" + cat "$TMPF" >> "$logfile" + echo "cli_test: Timeout running $cmd" >> "$logfile" + fi + if [[ "$eres" != "0" && "$curl_winorlose" == "1" ]] + then + allgood="no" + echo "cli_test: curl failure running $cmd" + cat "$TMPF" >> "$logfile" + echo "cli_test: curl failure running $cmd" >> "$logfile" + fi + ech_success=$(grep -c "ECH: result: status is succeeded" "$TMPF") + if [[ "$ech_success" == "$ech_winorlose" ]] + then + echo "cli_test ok for ${echparms[*]}" + else + allgood="no" + echo "cli_test: ECH failure running $cmd" + cat "$TMPF" >> "$logfile" + echo "cli_test: ECH failure running $cmd" >> "$logfile" + fi + rm -f "$TMPF" +} + +function get_ech_configlist() +{ + domain=$1 + ecl=$(dig +short https "$domain" | grep "ech=" | sed -e 's/^.*ech=//' | sed -e 's/ .*//') + echo "$ecl" +} + +# start of main script + +# start by assuming we have nothing we need... +have_ossl="no" +have_wolf="no" +have_bssl="no" +using_ossl="no" +using_wolf="no" +using_bssl="no" +have_curl="no" +have_dig="no" +have_kdig="no" +have_presout="no" +have_portsblocked="no" + +# setup logging +NOW=$(whenisitagain) +BINNAME=$(basename "$0" .sh) +if [ ! -d "$LTOP" ] +then + mkdir -p "$LTOP" +fi +if [ ! -d "$LTOP" ] +then + echo "Can't see $LTOP for logs - exiting" + exit 1 +fi +logfile=$LTOP/${BINNAME}_$NOW.log + +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 +if [ -f "$OSSL"/libssl.so ] +then + have_ossl="yes" +fi +if [ -f "$WSSL"/libwolfssl.so ] +then + have_wolf="yes" +fi +if [ -f "$BSSL"/libssl.so ] +then + have_bssl="yes" +fi +CURL="$CTOP/src/curl" +CURL_PARAMS=(-vvv --doh-url https://one.one.one.one/dns-query) +if [ -f "$CTOP"/src/curl ] +then + have_curl="yes" +fi +ossl_cnt=$(LD_LIBRARY_PATH=$OSSL $CURL "${CURL_PARAMS[@]}" -V 2> /dev/null | grep -c OpenSSL) +if ((ossl_cnt == 1)) +then + using_ossl="yes" + # setup access to our .so + export LD_LIBRARY_PATH=$OSSL +fi +bssl_cnt=$(LD_LIBRARY_PATH=$BSSL $CURL "${CURL_PARAMS[@]}" -V 2> /dev/null | grep -c BoringSSL) +if ((bssl_cnt == 1)) +then + using_bssl="yes" + # setup access to our .so + export LD_LIBRARY_PATH=$BSSL +fi +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 + CURL_PARAMS+=(-k) +fi +# check if we have dig and it knows https or not +digcmd="dig +short" +wdig=$(type -p dig) +if [[ "$wdig" != "" ]] +then + have_dig="yes" +fi +wkdig=$(type -p kdig) +if [[ "$wkdig" != "" ]] +then + have_kdig="yes" + digcmd="kdig @$DOHSERVER +https +short" +fi +# see if our dig version knows HTTPS +dout=$($digcmd https defo.ie) +if [[ $dout != "1 . "* ]] +then + dout=$($digcmd -t TYPE65 defo.ie) + if [[ $dout == "1 . "* ]] + then + # we're good + have_presout="yes" + fi +else + have_presout="yes" +fi + +# Check if ports other than 443 are blocked from this +# vantage point (I run tests in a n/w where that's +# sadly true sometimes;-) +# echo "Checking if ports other than 443 are maybe blocked" +not443testurl="https://draft-13.esni.defo.ie:9413/" +timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" "$not443testurl" >/dev/null 2>&1 +eres=$? +if [[ "$eres" == "124" ]] +then + echo "Timeout running curl for $not443testurl" >> "$logfile" + echo "Timeout running curl for $not443testurl" + have_portsblocked="yes" +fi + +{ + echo "have_ossl: $have_ossl" + echo "have_wolf: $have_wolf" + echo "have_bssl: $have_bssl" + echo "using_ossl: $using_ossl" + echo "using_wolf: $using_wolf" + echo "using_bssl: $using_bssl" + echo "have_curl: $have_curl" + echo "have_dig: $have_dig" + echo "have_kdig: $have_kdig" + echo "have_presout: $have_presout" + echo "have_portsblocked: $have_portsblocked" +} >> "$logfile" + +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" +echo "dig: $have_dig, kdig: $have_kdig, HTTPS pres format: $have_presout" +echo "dig command: |$digcmd|" +echo "ports != 443 blocked: $have_portsblocked" + +if [[ "$have_curl" == "no" ]] +then + echo "Can't proceed without curl - exiting" + exit 32 +fi + +allgood="yes" + +skip="false" + +if [[ "$skip" != "true" ]] +then + +# basic ECH good/bad +for targ in "${!ech_targets[@]}" +do + if [[ "$using_wolf" == "yes" ]] + then + case $targ in + "draft-13.esni.defo.ie:8414" | "tls-ech.dev" | \ + "crypto.cloudflare.com" | "epochbelt.com") + echo "Skipping $targ 'cause wolf"; continue;; + *) + ;; + esac + fi + host=$(hostport2host "$targ") + port=$(hostport2port "$targ") + if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]] + then + echo "Skipping $targ as ports != 443 seem blocked" + continue + fi + path=${ech_targets[$targ]} + turl="https://$host:$port/$path" + echo "ECH check for $turl" + { + echo "" + echo "ECH check for $turl" + } >> "$logfile" + timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech hard "$turl" >> "$logfile" 2>&1 + eres=$? + if [[ "$eres" == "124" ]] + then + allgood="no" + { + echo "Timeout for $turl" + echo -e "\tTimeout for $turl" + echo "Timeout running curl for $host:$port/$path" + } >> "$logfile" + fi + if [[ "$eres" != "0" ]] + then + allgood="no" + echo "Error ($eres) for $turl" >> "$logfile" + echo -e "\tError ($eres) for $turl" + fi + echo "" >> "$logfile" +done + +# check if public_name override works (OpenSSL only) +if [[ "$using_ossl" == "yes" ]] +then + for targ in "${!ech_targets[@]}" + do + host=$(hostport2host "$targ") + port=$(hostport2port "$targ") + if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]] + then + echo "Skipping $targ as ports != 443 seem blocked" + continue + fi + if [[ "$host" == "crypto.cloudflare.com" ]] + then + echo "Skipping $host as they've blocked PN override" + continue + fi + path=${ech_targets[$targ]} + turl="https://$host:$port/$path" + echo "PN override check for $turl" + { + echo "" + echo "PN override check for $turl" + } >> "$logfile" + timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech pn:override --ech hard "$turl" >> "$logfile" 2>&1 + eres=$? + if [[ "$eres" == "124" ]] + then + allgood="no" + { + echo "Timeout for $turl" + echo -e "\tTimeout for $turl" + echo "Timeout running curl for $host:$port/$path" + } >> "$logfile" + fi + if [[ "$eres" != "0" ]] + then + allgood="no" + echo "PN override Error ($eres) for $turl" >> "$logfile" + echo -e "\tPN override Error ($eres) for $turl" + fi + echo "" >> "$logfile" + done +fi + +for targ in "${!httpsrr_targets[@]}" +do + host=$(hostport2host "$targ") + port=$(hostport2port "$targ") + if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]] + then + echo "Skipping $targ as ports != 443 seem blocked" + continue + fi + path=${httpsrr_targets[$targ]} + turl="https://$host:$port/$path" + echo "HTTPS RR but no ECHConfig check for $turl" + { + echo "" + echo "HTTPS RR but no ECHConfig check for $turl" + } >> "$logfile" + timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech true "$turl" >> "$logfile" 2>&1 + eres=$? + if [[ "$eres" == "124" ]] + then + allgood="no" + { + echo "Timeout for $turl" + echo -e "\tTimeout for $turl" + echo "Timeout running curl for $host:$port/$path" + } >> "$logfile" + fi + if [[ "$eres" != "0" ]] + then + allgood="no" + echo "Error ($eres) for $turl" >> "$logfile" + echo -e "\tError ($eres) for $turl" + fi + echo "" >> "$logfile" +done + +for targ in "${!neither_targets[@]}" +do + host=$(hostport2host "$targ") + port=$(hostport2port "$targ") + if [[ "$port" != "443" && "$have_portsblocked" == "yes" ]] + then + echo "Skipping $targ as ports != 443 seem blocked" + continue + fi + path=${neither_targets[$targ]} + turl="https://$host:$port/$path" + echo "Neither HTTPS nor ECHConfig check for $turl" + { + echo "" + echo "Neither HTTPS nor ECHConfig check for $turl" + } >> "$logfile" + timeout "$tout" "$CURL" "${CURL_PARAMS[@]}" --ech true "$turl" >> "$logfile" 2>&1 + eres=$? + if [[ "$eres" == "124" ]] + then + allgood="no" + { + echo "Timeout for $turl" + echo -e "\tTimeout for $turl" + echo "Timeout running curl for $host:$port/$path" + } >> "$logfile" + fi + if [[ "$eres" != "0" ]] + then + allgood="no" + echo "Error ($eres) for $turl" >> "$logfile" + echo -e "\tError ($eres) for $turl" + fi + echo "" >> "$logfile" +done + + +# Check various command line options, if we're good so far +if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]] +then + # use this test URL as it'll tell us if things worked + turl="https://defo.ie/ech-check.php" + echo "cli_test with $turl" + echo "cli_test with $turl" >> "$logfile" + cli_test "$turl" 1 1 --ech true + cli_test "$turl" 1 0 --ech false + cli_test "$turl" 1 1 --ech false --ech true + cli_test "$turl" 1 1 --ech false --ech true --ech pn:foobar + cli_test "$turl" 1 1 --ech false --ech pn:foobar --ech true + echconfiglist=$(get_ech_configlist defo.ie) + cli_test "$turl" 1 1 --ech ecl:"$echconfiglist" + cli_test "$turl" 1 0 --ech ecl: +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 +# the argument handling here, not the ECH protocol +if [[ "$using_ossl" == "yes" && "$allgood" == "yes" ]] +then + # ech can be hard, true, grease or false + # ecl:ecl can be correct, incorrect or missing + # ech:pn can be correct, incorrect or missing + # in all cases the "last" argument provided should "win" + # but only one of hard, true, grease or false will apply + turl="https://defo.ie/ech-check.php" + echconfiglist=$(get_ech_configlist defo.ie) + goodecl=$echconfiglist + echconfiglist=$(get_ech_configlist hidden.hoba.ie) + badecl=$echconfiglist + goodpn="cover.defo.ie" + badpn="hoba.ie" + echo "more cli_test with $turl" + echo "more cli_test with $turl" >> "$logfile" + + # The combinatorics here are handled via the tests/ech_combos.py script + # which produces all the relevant combinations or inputs and orders + # thereof. We have to manually assess whether or not ECH is expected to + # work for each case. + cli_test "$turl" 0 0 + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" - 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$badecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech false --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech false --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 0 --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 1 1 --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + + # a target URL that doesn't 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 + echconfiglist=$(get_ech_configlist defo.ie) + goodecl=$echconfiglist + badecl="$goodecl" + goodpn="tcd.ie" + badpn="tcd.ie" + cli_test "$turl" 1 0 + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$badecl" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$badecl" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech false --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech hard --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$badpn" --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true --ech ecl:"$goodecl" --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi + cli_test "$turl" 0 0 --ech true --ech pn:"$goodpn" + if [[ "$allgood" != "yes" ]]; then echo "$LINENO"; fi +fi + + +END=$(whenisitagain) +echo "Finished $0 at $END" >> "$logfile" +echo "-----" >> "$logfile" + +if [[ "$allgood" == "yes" ]] +then + echo "Finished $0 at $END" + echo "All good, log in $logfile" + exit 0 +else + echo "Finished $0 at $END" + echo "NOT all good, log in $logfile" +fi + +# send a mail to root (will be fwd'd) 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 + if ((age_of_news < 24*3600)) + then + itsnews="no" + fi +fi +if [[ "$DOMAIL" == "yes" && "$itsnews" == "yes" ]] +then + echo "ECH badness at $NOW" | mail -s "ECH badness at $NOW" root +fi +# add to list of bad runs (updating file age) +echo "ECH badness at $NOW" >>"$LTOP"/bad_runs +exit 2 diff --git a/deps/curl/tests/ftpserver.pl b/deps/curl/tests/ftpserver.pl index 10abe418..abe04959 100644 --- a/deps/curl/tests/ftpserver.pl +++ b/deps/curl/tests/ftpserver.pl @@ -226,7 +226,7 @@ sub ftpmsg { # use this, open->print->close system only to make the file # open as little as possible, to make the test suite run - # better on windows/cygwin + # better on Windows/Cygwin } #********************************************************************** @@ -488,7 +488,7 @@ sub sendcontrol { for(@a) { sockfilt $_; - portable_sleep(0.01); + portable_sleep($ctrldelay); } } my $log; @@ -525,7 +525,7 @@ sub senddata { # pause between each byte for (split(//,$l)) { sockfiltsecondary $_; - portable_sleep(0.01); + portable_sleep($datadelay); } } } @@ -670,7 +670,7 @@ sub protocolsetup { } } -# Perform the disconnecgt handshake with sockfilt on the secondary connection +# Perform the disconnect handshake with sockfilt on the secondary connection # (the only connection we actively disconnect). # This involves waiting for the disconnect acknowledgment after the DISC # command, while throwing away anything else that might come in before @@ -690,9 +690,8 @@ sub disc_handshake { $size = hex($1); } - read_datasockf(\$line, $size); - logmsg "> Throwing away $size bytes on closed connection\n"; + read_datasockf(\$line, $size); } elsif($line eq "DISC\n") { logmsg "Fancy that; client wants to DISC, too\n"; @@ -1863,12 +1862,7 @@ sub RETR_pop3 { } sub LIST_pop3 { - # This is a built-in fake-message list - my @data = ( - "1 100\r\n", - "2 4294967400\r\n", # > 4 GB - "3 200\r\n", - ); + my @data = getpart("reply", "data"); logmsg "retrieve a message list\n"; @@ -2077,7 +2071,8 @@ sub CWD_ftp { my ($folder, $fullcommand) = $_[0]; switch_directory($folder); if($ftptargetdir =~ /^\/fully_simulated/) { - $ftplistparserstate = "enabled"; + $ftplistparserstate = "enabled"; + logmsg "enabled FTP list parser mode\n"; } else { undef $ftplistparserstate; @@ -2097,19 +2092,6 @@ sub PWD_ftp { sub LIST_ftp { # print "150 ASCII data connection for /bin/ls (193.15.23.1,59196) (0 bytes)\r\n"; -# this is a built-in fake-dir ;-) -my @ftpdir=("total 20\r\n", -"drwxr-xr-x 8 98 98 512 Oct 22 13:06 .\r\n", -"drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..\r\n", -"drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT\r\n", -"-r--r--r-- 1 0 1 35 Jul 16 1996 README\r\n", -"lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin\r\n", -"dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev\r\n", -"drwxrwxrwx 2 98 98 512 May 29 16:04 download.html\r\n", -"dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc\r\n", -"drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub\r\n", -"dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr\r\n"); - if($datasockf_conn eq 'no') { if($nodataconn425) { sendcontrol "150 Opening data connection\r\n"; @@ -2129,15 +2111,17 @@ my @ftpdir=("total 20\r\n", return 0; } - if($ftplistparserstate) { - @ftpdir = ftp_contentlist($ftptargetdir); - } - logmsg "pass LIST data on data connection\n"; - if($cwd_testno) { - loadtest("$logdir/test$cwd_testno"); - + if($ftplistparserstate) { + # provide a synthetic response + my @ftpdir = ftp_contentlist($ftptargetdir); + # old hard-coded style + for(@ftpdir) { + senddata $_; + } + } + else { my @data = getpart("reply", "data"); for(@data) { my $send = $_; @@ -2147,13 +2131,6 @@ my @ftpdir=("total 20\r\n", logmsg "send $send as data\n"; senddata $send; } - $cwd_testno = 0; # forget it again - } - else { - # old hard-coded style - for(@ftpdir) { - senddata $_; - } } close_dataconn(0); sendcontrol "226 ASCII transfer complete\r\n"; @@ -2220,6 +2197,7 @@ sub MDTM_ftp { sub SIZE_ftp { my $testno = $_[0]; + if($ftplistparserstate) { my $size = wildcard_filesize($ftptargetdir, $testno); if($size == -1) { @@ -2380,7 +2358,7 @@ sub RETR_ftp { $sz = "($retrsize bytes)"; } - sendcontrol "150 Binary data connection for $testno () $sz.\r\n"; + sendcontrol "150 Binary data connection for $testno ($testpart) $sz.\r\n"; for(@data) { my $send = $_; @@ -2830,6 +2808,7 @@ sub nodataconn_str { # On success returns 1, otherwise zero. # sub customize { + my($cmdfile) = @_; $ctrldelay = 0; # default is no throttling of the ctrl stream $datadelay = 0; # default is no throttling of the data stream $retrweirdo = 0; # default is no use of RETRWEIRDO @@ -2889,10 +2868,15 @@ sub customize { logmsg "FTPD: read POSTFETCH header data\n"; $postfetch = $1; } + elsif($_ =~ /SLOWDOWNDATA/) { + $ctrldelay=0; + $datadelay=0.005; + logmsg "FTPD: send response data with 5ms delay per byte\n"; + } elsif($_ =~ /SLOWDOWN/) { - $ctrldelay=1; - $datadelay=1; - logmsg "FTPD: send response with 0.01 sec delay between each byte\n"; + $ctrldelay=0.005; + $datadelay=0.005; + logmsg "FTPD: send response with 5ms delay between each byte\n"; } elsif($_ =~ /RETRWEIRDO/) { logmsg "FTPD: instructed to use RETRWEIRDO\n"; diff --git a/deps/curl/tests/getpart.pm b/deps/curl/tests/getpart.pm index ed60feca..afc1f062 100644 --- a/deps/curl/tests/getpart.pm +++ b/deps/curl/tests/getpart.pm @@ -316,7 +316,7 @@ sub compareparts { # NOTE: this no longer strips off carriage returns from the arrays. Is that # really necessary? It ruins the testing of newlines. I believe it was once - # added to enable tests on win32. + # added to enable tests on Windows. if($first ne $second) { return 1; @@ -332,7 +332,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 by Kevin Roth for(@$arrayref) { print $temp $_; } diff --git a/deps/curl/tests/globalconfig.pm b/deps/curl/tests/globalconfig.pm index 5aad483e..dec828e0 100644 --- a/deps/curl/tests/globalconfig.pm +++ b/deps/curl/tests/globalconfig.pm @@ -38,6 +38,8 @@ BEGIN { $automakestyle $CURL $CURLVERSION + $CURLVERNUM + $DATE $has_shared $LIBDIR $listonly @@ -45,6 +47,7 @@ BEGIN { $LOGDIR $memanalyze $MEMDUMP + $perlcmd $perl $PIDDIR $proxy_address @@ -63,6 +66,8 @@ BEGIN { %feature %keywords @protocols + $bundle + $dev_null ); } use pathhelp qw(exe_ext); @@ -82,12 +87,14 @@ our $run_event_based; # run curl with --test-event to test the event API our $automakestyle; # use automake-like test status output format 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 # paths our $pwd = getcwd(); # current working directory our $srcdir = $ENV{'srcdir'} || '.'; # root of the test source code -our $perl="perl -I$srcdir"; # invoke perl like this +our $perlcmd="$^X"; +our $perl="$perlcmd -I. -I$srcdir"; # invoke perl like this our $LOGDIR="log"; # root of the log directory; this will be different for # each runner in multiprocess mode our $LIBDIR="./libtest"; @@ -99,6 +106,8 @@ our $VCURL=$CURL; # what curl binary to use to verify the servers with # the path to the script that analyzes the memory debug output file our $memanalyze="$perl $srcdir/memanalyze.pl"; our $valgrind; # path to valgrind, or empty if disabled +our $bundle = 0; # use bundled server, libtest, unit binaries +our $dev_null = ($^O eq 'MSWin32' ? 'NUL' : '/dev/null'); # paths in $LOGDIR our $LOCKDIR = "lock"; # root of the server directory with lock files diff --git a/deps/curl/CMake/FindLibPSL.cmake b/deps/curl/tests/http/CMakeLists.txt similarity index 54% rename from deps/curl/CMake/FindLibPSL.cmake rename to deps/curl/tests/http/CMakeLists.txt index e3bd68d1..aeedad09 100644 --- a/deps/curl/CMake/FindLibPSL.cmake +++ b/deps/curl/tests/http/CMakeLists.txt @@ -21,25 +21,42 @@ # SPDX-License-Identifier: curl # ########################################################################### -# - Try to find the libpsl library -# Once done this will define -# -# LIBPSL_FOUND - system has the libpsl library -# LIBPSL_INCLUDE_DIR - the libpsl include directory -# LIBPSL_LIBRARY - the libpsl library name -find_path(LIBPSL_INCLUDE_DIR libpsl.h) - -find_library(LIBPSL_LIBRARY NAMES psl libpsl) - -if(LIBPSL_INCLUDE_DIR) - file(STRINGS "${LIBPSL_INCLUDE_DIR}/libpsl.h" libpsl_version_str REGEX "^#define[\t ]+PSL_VERSION[\t ]+\"(.*)\"") - string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBPSL_VERSION "${libpsl_version_str}") +find_program(CADDY "caddy") # /usr/bin/caddy +if(NOT CADDY) + set(CADDY "") endif() +mark_as_advanced(CADDY) -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibPSL - REQUIRED_VARS LIBPSL_LIBRARY LIBPSL_INCLUDE_DIR - VERSION_VAR LIBPSL_VERSION) +find_program(VSFTPD "vsftpd") # /usr/sbin/vsftpd +if(NOT VSFTPD) + set(VSFTPD "") +endif() +mark_as_advanced(VSFTPD) -mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY) +find_program(HTTPD "apache2") # /usr/sbin/apache2 +if(NOT HTTPD) + set(HTTPD "") +endif() +mark_as_advanced(HTTPD) + +find_program(APACHECTL "apache2ctl") # /usr/sbin/apache2ctl +if(NOT APACHECTL) + set(APACHECTL "") +endif() +mark_as_advanced(APACHECTL) + +find_program(APXS "apxs") +if(NOT APXS) + set(APXS "") +endif() +mark_as_advanced(APXS) + +find_program(HTTPD_NGHTTPX "nghttpx" PATHS "/usr/bin" "/usr/local/bin") +if(NOT HTTPD_NGHTTPX) + set(HTTPD_NGHTTPX "") +endif() +mark_as_advanced(HTTPD_NGHTTPX) + +# Consumed variables: APACHECTL, APXS, CADDY, HTTPD, HTTPD_NGHTTPX, VSFTPD +configure_file("config.ini.in" "${CMAKE_CURRENT_BINARY_DIR}/config.ini" @ONLY) diff --git a/deps/curl/tests/http/Makefile.am b/deps/curl/tests/http/Makefile.am index d3a219d7..60394605 100644 --- a/deps/curl/tests/http/Makefile.am +++ b/deps/curl/tests/http/Makefile.am @@ -35,10 +35,11 @@ testenv/httpd.py \ testenv/mod_curltest/mod_curltest.c \ testenv/nghttpx.py \ testenv/ports.py \ +testenv/vsftpd.py \ testenv/ws_echo_server.py EXTRA_DIST = \ -config.ini.in \ +CMakeLists.txt \ conftest.py \ requirements.txt \ scorecard.py \ @@ -57,7 +58,13 @@ test_12_reuse.py \ test_13_proxy_auth.py \ test_14_auth.py \ test_15_tracing.py \ +test_16_info.py \ +test_17_ssl_use.py \ +test_18_methods.py \ +test_19_shutdown.py \ test_20_websockets.py \ +test_30_vsftpd.py \ +test_31_vsftpds.py \ $(TESTENV) clean-local: diff --git a/deps/curl/tests/http/README.md b/deps/curl/tests/http/README.md index 3a4b2639..fc3a0b22 100644 --- a/deps/curl/tests/http/README.md +++ b/deps/curl/tests/http/README.md @@ -13,7 +13,7 @@ This is an additional test suite using a combination of Apache httpd and nghttpx The test cases and necessary files are in `tests/http`. You can invoke `pytest` from there or from the top level curl checkout and it will find all tests. ``` -curl> pytest +curl> pytest test/http platform darwin -- Python 3.9.15, pytest-6.2.0, py-1.10.0, pluggy-0.13.1 rootdir: /Users/sei/projects/curl collected 5 items @@ -24,20 +24,19 @@ 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. ``` -curl> pytest -vv -k test_01_02 +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. Depending on your setup, some test cases may be skipped and appear as `s` in the output. If you run pytest verbose, it will also give you the reason for skipping. - # Prerequisites You will need: 1. a recent Python, the `cryptography` module and, of course, `pytest` -2. a 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 will be skipped. @@ -47,31 +46,33 @@ 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. ## 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: ``` -curl> pytest -k "test_02_06 and h2" +curl/tests/http> pytest -k "test_02_06 and h2" ``` -Several test cases can be repeated, they all have the `repeat` parameter. To make this work, you have to start `pytest` in the test directory itself (for some unknown reason). 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" --repeat=100 +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: ``` -curl/tests/http> pytest -k "test_02_06 and h2" --repeat=100 --maxfail=1 +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`: ``` -curl/tests/http> pytest -vvv -k "test_02_06 and h2" --repeat=100 --maxfail=1 +curl/tests/http> pytest -vvv -k "test_02_06 and h2" --count=100 --maxfail=1 ``` all of curl's output and trace file are found in `tests/http/gen/curl`. @@ -84,7 +85,7 @@ There is a lot of [`pytest` documentation](https://docs.pytest.org/) with exampl In `conftest.py` 3 "fixtures" are defined that are used by all test cases: -1. `env`: the test environment. It is an instance of class `testenv/env.py:Env`. It holds all information about paths, availability of features (HTTP/3!), port numbers to use, domains and SSL certificates for those. +1. `env`: the test environment. It is an instance of class `testenv/env.py:Env`. It holds all information about paths, availability of features (HTTP/3), port numbers to use, domains and SSL certificates for those. 2. `httpd`: the Apache httpd instance, configured and started, then stopped at the end of the test suite. It has sites configured for the domains from `env`. It also loads a local module `mod_curltest?` and makes it available in certain locations. (more on mod_curltest below). 3. `nghttpx`: an instance of nghttpx that provides HTTP/3 support. `nghttpx` proxies those requests to the `httpd` server. In a direct mapping, so you may access all the resources under the same path as with HTTP/2. Only the port number used for HTTP/3 requests will be different. diff --git a/deps/curl/tests/http/clients/.gitignore b/deps/curl/tests/http/clients/.gitignore index f461524b..dd6eb29e 100644 --- a/deps/curl/tests/http/clients/.gitignore +++ b/deps/curl/tests/http/clients/.gitignore @@ -3,9 +3,11 @@ # SPDX-License-Identifier: curl h2-serverpush -h2-download +hx-download +hx-upload ws-data ws-pingpong h2-upgrade-extreme tls-session-reuse h2-pausing +upload-pausing diff --git a/deps/curl/tests/http/clients/CMakeLists.txt b/deps/curl/tests/http/clients/CMakeLists.txt new file mode 100644 index 00000000..32c7f4d4 --- /dev/null +++ b/deps/curl/tests/http/clients/CMakeLists.txt @@ -0,0 +1,48 @@ +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### + +add_custom_target(test-http-clients) + +# Get 'check_PROGRAMS' variable +transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") + +foreach(_target IN LISTS check_PROGRAMS) + set(_target_name "curlt-client-${_target}") + add_executable(${_target_name} EXCLUDE_FROM_ALL "${_target}.c") + add_dependencies(testdeps ${_target_name}) + add_dependencies(test-http-clients ${_target_name}) + target_include_directories(${_target_name} PRIVATE + "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" + "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" + ) + target_link_libraries(${_target_name} ${LIB_SELECTED} ${CURL_LIBS}) + target_compile_definitions(${_target_name} PRIVATE "CURL_NO_OLDIES") + if(LIB_SELECTED STREQUAL LIB_STATIC AND WIN32) + set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() + set_target_properties(${_target_name} PROPERTIES + OUTPUT_NAME "${_target}" UNITY_BUILD OFF + PROJECT_LABEL "Test client ${_target}") +endforeach() diff --git a/deps/curl/tests/http/clients/Makefile.am b/deps/curl/tests/http/clients/Makefile.am index 8fdc190b..935614c5 100644 --- a/deps/curl/tests/http/clients/Makefile.am +++ b/deps/curl/tests/http/clients/Makefile.am @@ -24,6 +24,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc +EXTRA_DIST = CMakeLists.txt # Specify our include paths here, and do it relative to $(top_srcdir) and # $(top_builddir), to ensure that these paths which belong to the library @@ -34,8 +35,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ - -I$(top_srcdir)/lib \ - -DCURL_DISABLE_DEPRECATION + -I$(top_srcdir)/lib LIBDIR = $(top_builddir)/lib @@ -50,16 +50,12 @@ endif LIBS = $(BLANK_AT_MAKETIME) # Dependencies -if USE_EXPLICIT_LIB_DEPS -LDADD = $(LIBDIR)/libcurl.la @LIBCURL_LIBS@ -else -LDADD = $(LIBDIR)/libcurl.la -endif +LDADD = $(LIBDIR)/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@ # This might hold -Werror CFLAGS += @CURL_CFLAG_EXTRAS@ -# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines +# Makefile.inc provides the check_PROGRAMS define include Makefile.inc all: $(check_PROGRAMS) diff --git a/deps/curl/tests/http/clients/Makefile.inc b/deps/curl/tests/http/clients/Makefile.inc index ce7a1b6a..c5e4e8af 100644 --- a/deps/curl/tests/http/clients/Makefile.inc +++ b/deps/curl/tests/http/clients/Makefile.inc @@ -24,10 +24,12 @@ # These are all libcurl example programs to be test compiled check_PROGRAMS = \ + hx-download \ + hx-upload \ + h2-pausing \ h2-serverpush \ - h2-download \ - ws-data \ - ws-pingpong \ h2-upgrade-extreme \ tls-session-reuse \ - h2-pausing + upload-pausing \ + ws-data \ + ws-pingpong diff --git a/deps/curl/tests/http/clients/h2-download.c b/deps/curl/tests/http/clients/h2-download.c deleted file mode 100644 index e6f001c7..00000000 --- a/deps/curl/tests/http/clients/h2-download.c +++ /dev/null @@ -1,350 +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 - * - ***************************************************************************/ -/* - * HTTP/2 server push - * - */ - -/* curl stuff */ -#include -#include - -#include -#include -#include - -/* somewhat unix-specific */ -#include -#include - -#ifndef CURLPIPE_MULTIPLEX -#error "too old libcurl, cannot do HTTP/2 server push!" -#endif - -static int verbose = 1; - -static -int my_trace(CURL *handle, curl_infotype type, - char *data, size_t size, - void *userp) -{ - const char *text; - (void)handle; /* prevent compiler warning */ - (void)userp; - - switch(type) { - case CURLINFO_TEXT: - fprintf(stderr, "== Info: %s", data); - return 0; - case CURLINFO_HEADER_OUT: - text = "=> Send header"; - break; - case CURLINFO_DATA_OUT: - if(verbose <= 1) - return 0; - text = "=> Send data"; - break; - case CURLINFO_HEADER_IN: - text = "<= Recv header"; - break; - case CURLINFO_DATA_IN: - if(verbose <= 1) - return 0; - text = "<= Recv data"; - break; - default: /* in case a new one is introduced to shock us */ - return 0; - } - - fprintf(stderr, "%s, %lu bytes (0x%lx)\n", - text, (unsigned long)size, (unsigned long)size); - return 0; -} - -struct transfer { - int idx; - CURL *easy; - char filename[128]; - FILE *out; - curl_off_t recv_size; - curl_off_t pause_at; - int started; - int paused; - int resumed; - int done; -}; - -static size_t transfer_count = 1; -static struct transfer *transfers; - -static struct transfer *get_transfer_for_easy(CURL *easy) -{ - size_t i; - for(i = 0; i < transfer_count; ++i) { - if(easy == transfers[i].easy) - return &transfers[i]; - } - return NULL; -} - -static size_t my_write_cb(char *buf, size_t nitems, size_t buflen, - void *userdata) -{ - struct transfer *t = userdata; - size_t nwritten; - - if(!t->resumed && - t->recv_size < t->pause_at && - ((t->recv_size + (curl_off_t)(nitems * buflen)) >= t->pause_at)) { - fprintf(stderr, "[t-%d] PAUSE\n", t->idx); - t->paused = 1; - return CURL_WRITEFUNC_PAUSE; - } - - if(!t->out) { - curl_msnprintf(t->filename, sizeof(t->filename)-1, "download_%u.data", - t->idx); - t->out = fopen(t->filename, "wb"); - if(!t->out) - return 0; - } - - nwritten = fwrite(buf, nitems, buflen, t->out); - if(nwritten < buflen) { - fprintf(stderr, "[t-%d] write failure\n", t->idx); - return 0; - } - t->recv_size += (curl_off_t)nwritten; - return (size_t)nwritten; -} - -static int setup(CURL *hnd, const char *url, struct transfer *t) -{ - 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(hnd, CURLOPT_WRITEFUNCTION, my_write_cb); - curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t); - - /* please be verbose */ - if(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 void usage(const char *msg) -{ - if(msg) - fprintf(stderr, "%s\n", msg); - fprintf(stderr, - "usage: [options] url\n" - " download a url with following options:\n" - " -m number max parallel downloads\n" - " -n number total downloads\n" - " -P number pause transfer after `number` response bytes\n" - ); -} - -/* - * Download a file over HTTP/2, take care of server push. - */ -int main(int argc, char *argv[]) -{ - CURLM *multi_handle; - struct CURLMsg *m; - const char *url; - size_t i, n, max_parallel = 1; - size_t active_transfers; - size_t pause_offset = 0; - int abort_paused = 0; - struct transfer *t; - int ch; - - while((ch = getopt(argc, argv, "ahm:n:P:")) != -1) { - switch(ch) { - case 'h': - usage(NULL); - return 2; - case 'a': - abort_paused = 1; - break; - case 'm': - max_parallel = (size_t)strtol(optarg, NULL, 10); - break; - case 'n': - transfer_count = (size_t)strtol(optarg, NULL, 10); - break; - case 'P': - pause_offset = (size_t)strtol(optarg, NULL, 10); - break; - default: - usage("invalid option"); - return 1; - } - } - argc -= optind; - argv += optind; - - if(argc != 1) { - usage("not enough arguments"); - return 2; - } - url = argv[0]; - - transfers = calloc(transfer_count, sizeof(*transfers)); - if(!transfers) { - fprintf(stderr, "error allocating transfer structs\n"); - return 1; - } - - multi_handle = curl_multi_init(); - curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); - - active_transfers = 0; - for(i = 0; i < transfer_count; ++i) { - t = &transfers[i]; - t->idx = (int)i; - t->pause_at = (curl_off_t)(pause_offset * i); - } - - n = (max_parallel < transfer_count)? max_parallel : transfer_count; - for(i = 0; i < n; ++i) { - t = &transfers[i]; - t->easy = curl_easy_init(); - if(!t->easy || setup(t->easy, url, t)) { - fprintf(stderr, "[t-%d] FAILED setup\n", (int)i); - return 1; - } - curl_multi_add_handle(multi_handle, t->easy); - t->started = 1; - ++active_transfers; - fprintf(stderr, "[t-%d] STARTED\n", t->idx); - } - - do { - int still_running; /* keep number of running handles */ - 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); - fprintf(stderr, "curl_multi_poll() -> %d\n", mc); - } - - if(mc) - break; - - do { - int msgq = 0; - m = curl_multi_info_read(multi_handle, &msgq); - if(m && (m->msg == CURLMSG_DONE)) { - CURL *e = m->easy_handle; - active_transfers--; - curl_multi_remove_handle(multi_handle, e); - t = get_transfer_for_easy(e); - if(t) { - t->done = 1; - } - else - curl_easy_cleanup(e); - } - else { - /* nothing happening, maintenance */ - if(abort_paused) { - /* abort paused transfers */ - for(i = 0; i < transfer_count; ++i) { - t = &transfers[i]; - if(!t->done && t->paused && t->easy) { - curl_multi_remove_handle(multi_handle, t->easy); - t->done = 1; - active_transfers--; - fprintf(stderr, "[t-%d] ABORTED\n", t->idx); - } - } - } - else { - /* resume one paused transfer */ - for(i = 0; i < transfer_count; ++i) { - t = &transfers[i]; - if(!t->done && t->paused) { - t->resumed = 1; - t->paused = 0; - curl_easy_pause(t->easy, CURLPAUSE_CONT); - fprintf(stderr, "[t-%d] RESUMED\n", t->idx); - break; - } - } - } - - while(active_transfers < max_parallel) { - for(i = 0; i < transfer_count; ++i) { - t = &transfers[i]; - if(!t->started) { - t->easy = curl_easy_init(); - if(!t->easy || setup(t->easy, url, t)) { - fprintf(stderr, "[t-%d] FAILEED setup\n", (int)i); - return 1; - } - curl_multi_add_handle(multi_handle, t->easy); - t->started = 1; - ++active_transfers; - fprintf(stderr, "[t-%d] STARTED\n", t->idx); - break; - } - } - /* all started */ - if(i == transfer_count) - break; - } - } - } while(m); - - } while(active_transfers); /* as long as we have transfers going */ - - for(i = 0; i < transfer_count; ++i) { - t = &transfers[i]; - if(t->out) { - fclose(t->out); - t->out = NULL; - } - if(t->easy) { - curl_easy_cleanup(t->easy); - t->easy = NULL; - } - } - free(transfers); - - curl_multi_cleanup(multi_handle); - - return 0; -} diff --git a/deps/curl/tests/http/clients/h2-pausing.c b/deps/curl/tests/http/clients/h2-pausing.c index 40ae361f..1fd54d4f 100644 --- a/deps/curl/tests/http/clients/h2-pausing.c +++ b/deps/curl/tests/http/clients/h2-pausing.c @@ -25,16 +25,21 @@ * HTTP/2 download pausing * */ -/* This is based on the poc client of issue #11982 +/* This is based on the PoC client of issue #11982 */ +#include + +#include #include #include -#include -#include #include -#include -#include +#ifndef _MSC_VER +/* somewhat Unix-specific */ +#include /* getopt() */ +#endif + +#ifndef _MSC_VER #define HANDLECOUNT 2 static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) @@ -74,8 +79,8 @@ static int debug_cb(CURL *handle, curl_infotype type, if(!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) { - curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, - xfer_id, conn_id); + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, + conn_id); } else { curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_1, xfer_id); @@ -141,15 +146,28 @@ static int err(void) exit(2); } +static void usage(const char *msg) +{ + if(msg) + fprintf(stderr, "%s\n", msg); + fprintf(stderr, + "usage: [options] url\n" + " pause downloads with following options:\n" + " -V http_version (http/1.1, h2, h3) http version to use\n" + ); +} + struct handle { int idx; int paused; int resumed; + int errored; + int fail_write; CURL *h; }; -static size_t cb(void *data, size_t size, size_t nmemb, void *clientp) +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; @@ -165,15 +183,24 @@ static size_t cb(void *data, size_t size, size_t nmemb, void *clientp) ++handle->paused; fprintf(stderr, "INFO: [%d] write, PAUSING %d time on %lu bytes\n", handle->idx, handle->paused, (long)realsize); + assert(handle->paused == 1); return CURL_WRITEFUNC_PAUSE; } + if(handle->fail_write) { + ++handle->errored; + fprintf(stderr, "INFO: [%d] FAIL write of %lu bytes, %d time\n", + handle->idx, (long)realsize, handle->errored); + return CURL_WRITEFUNC_ERROR; + } fprintf(stderr, "INFO: [%d] write, accepting %lu bytes\n", handle->idx, (long)realsize); return realsize; } +#endif /* !_MSC_VER */ int main(int argc, char *argv[]) { +#ifndef _MSC_VER struct handle handles[HANDLECOUNT]; CURLM *multi_handle; int i, still_running = 1, msgs_left, numfds; @@ -186,15 +213,43 @@ int main(int argc, char *argv[]) char *url, *host = NULL, *port = NULL; int all_paused = 0; int resume_round = -1; + int http_version = CURL_HTTP_VERSION_2_0; + int ch; - if(argc != 2) { + while((ch = getopt(argc, argv, "hV:")) != -1) { + switch(ch) { + case 'h': + usage(NULL); + return 2; + case 'V': { + if(!strcmp("http/1.1", optarg)) + http_version = CURL_HTTP_VERSION_1_1; + else if(!strcmp("h2", optarg)) + http_version = CURL_HTTP_VERSION_2_0; + else if(!strcmp("h3", optarg)) + http_version = CURL_HTTP_VERSION_3ONLY; + else { + usage("invalid http version"); + return 1; + } + break; + } + default: + usage("invalid option"); + return 1; + } + } + argc -= optind; + argv += optind; + + if(argc != 1) { fprintf(stderr, "ERROR: need URL as argument\n"); return 2; } - url = argv[1]; + url = argv[0]; curl_global_init(CURL_GLOBAL_DEFAULT); - curl_global_trace("ids,time,http/2"); + curl_global_trace("ids,time,http/2,http/3"); cu = curl_url(); if(!cu) { @@ -214,14 +269,16 @@ int main(int argc, char *argv[]) exit(1); } memset(&resolve, 0, sizeof(resolve)); - curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, - "%s:%s:127.0.0.1", host, port); + curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", + host, port); resolve = curl_slist_append(resolve, resolve_buf); - for(i = 0; imsg == CURLMSG_DONE) { - for(i = 0; ieasy_handle == handles[i].h) { if(handles[i].paused != 1 || !handles[i].resumed) { fprintf(stderr, "ERROR: [%d] done, pauses=%d, resumed=%d, " @@ -299,7 +364,7 @@ int main(int argc, char *argv[]) /* Successfully paused? */ if(!all_paused) { - for(i = 0; i 0 && rounds == resume_round) { /* time to resume */ - for(i = 0; i */ - /* curl stuff */ #include -#include #include #include #include -/* somewhat unix-specific */ -#include -#include - #ifndef CURLPIPE_MULTIPLEX #error "too old libcurl, cannot do HTTP/2 server push!" #endif @@ -58,7 +52,7 @@ void dump(const char *text, unsigned char *ptr, size_t size, fprintf(stderr, "%s, %lu bytes (0x%lx)\n", text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { @@ -189,7 +183,7 @@ static int server_push_callback(CURL *parent, fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n", count, (unsigned long)num_headers); - for(i = 0; i */ +#include + #include #include -#include -#include /* #include */ #include -#include -#include - static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) { @@ -72,8 +69,8 @@ static int debug_cb(CURL *handle, curl_infotype type, if(!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) { - curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, - xfer_id, conn_id); + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, + conn_id); } else { curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_1, xfer_id); @@ -181,8 +178,11 @@ int main(int argc, char *argv[]) curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(easy, CURLOPT_WRITEDATA, NULL); curl_easy_setopt(easy, CURLOPT_HTTPGET, 1L); - curl_msnprintf(range, sizeof(range), "%" PRIu64 "-%" PRIu64, - UINT64_C(0), UINT64_C(16384)); + 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); mc = curl_multi_add_handle(multi, easy); @@ -211,7 +211,8 @@ int main(int argc, char *argv[]) } /* Check for finished handles and remove. */ - while((msg = curl_multi_info_read(multi, &msgs_in_queue))) { + /* !checksrc! disable EQUALSNULL 1 */ + while((msg = curl_multi_info_read(multi, &msgs_in_queue)) != NULL) { if(msg->msg == CURLMSG_DONE) { long status = 0; curl_off_t xfer_id; diff --git a/deps/curl/tests/http/clients/hx-download.c b/deps/curl/tests/http/clients/hx-download.c new file mode 100644 index 00000000..de50e273 --- /dev/null +++ b/deps/curl/tests/http/clients/hx-download.c @@ -0,0 +1,532 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 + * + ***************************************************************************/ +/* + * HTTP/2 server push + * + */ +/* curl stuff */ +#include + +#include +#include +#include + +#ifndef _MSC_VER +/* somewhat Unix-specific */ +#include /* getopt() */ +#endif + +#ifndef CURLPIPE_MULTIPLEX +#error "too old libcurl, cannot do HTTP/2 server push!" +#endif + +#ifndef _MSC_VER +static int verbose = 1; + +static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) +{ + /* + * This is the trace look that is similar to what libcurl makes on its + * own. + */ + static const char * const s_infotype[] = { + "* ", "< ", "> ", "{ ", "} ", "{ ", "} " + }; + if(idsbuf && *idsbuf) + fprintf(log, "%s%s", idsbuf, s_infotype[type]); + else + fputs(s_infotype[type], log); +} + +#define TRC_IDS_FORMAT_IDS_1 "[%" CURL_FORMAT_CURL_OFF_T "-x] " +#define TRC_IDS_FORMAT_IDS_2 "[%" CURL_FORMAT_CURL_OFF_T "-%" \ + CURL_FORMAT_CURL_OFF_T "] " +/* +** callback for CURLOPT_DEBUGFUNCTION +*/ +static int debug_cb(CURL *handle, curl_infotype type, + char *data, size_t size, + void *userdata) +{ + FILE *output = stderr; + static int newl = 0; + static int traced_data = 0; + char idsbuf[60]; + curl_off_t xfer_id, conn_id; + + (void)handle; /* not used */ + (void)userdata; + + if(!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) { + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, + conn_id); + } + else { + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_1, xfer_id); + } + } + else + idsbuf[0] = 0; + + switch(type) { + case CURLINFO_HEADER_OUT: + if(size > 0) { + size_t st = 0; + size_t i; + for(i = 0; i < size - 1; i++) { + if(data[i] == '\n') { /* LF */ + if(!newl) { + log_line_start(output, idsbuf, type); + } + (void)fwrite(data + st, i - st + 1, 1, output); + st = i + 1; + newl = 0; + } + } + if(!newl) + log_line_start(output, idsbuf, type); + (void)fwrite(data + st, i - st + 1, 1, output); + } + newl = (size && (data[size - 1] != '\n')) ? 1 : 0; + traced_data = 0; + break; + case CURLINFO_TEXT: + case CURLINFO_HEADER_IN: + if(!newl) + log_line_start(output, idsbuf, type); + (void)fwrite(data, size, 1, output); + newl = (size && (data[size - 1] != '\n')) ? 1 : 0; + traced_data = 0; + break; + case CURLINFO_DATA_OUT: + case CURLINFO_DATA_IN: + case CURLINFO_SSL_DATA_IN: + case CURLINFO_SSL_DATA_OUT: + if(!traced_data) { + if(!newl) + log_line_start(output, idsbuf, type); + fprintf(output, "[%ld bytes data]\n", (long)size); + newl = 0; + traced_data = 1; + } + break; + default: /* nada */ + newl = 0; + traced_data = 1; + break; + } + + return 0; +} + +struct transfer { + int idx; + CURL *easy; + char filename[128]; + FILE *out; + curl_off_t recv_size; + curl_off_t fail_at; + curl_off_t pause_at; + curl_off_t abort_at; + int started; + int paused; + int resumed; + int done; +}; + +static size_t transfer_count = 1; +static struct transfer *transfers; +static int forbid_reuse = 0; + +static struct transfer *get_transfer_for_easy(CURL *easy) +{ + size_t i; + for(i = 0; i < transfer_count; ++i) { + if(easy == transfers[i].easy) + return &transfers[i]; + } + return NULL; +} + +static size_t my_write_cb(char *buf, size_t nitems, size_t buflen, + void *userdata) +{ + struct transfer *t = userdata; + size_t blen = (nitems * buflen); + size_t nwritten; + + fprintf(stderr, "[t-%d] RECV %ld bytes, total=%ld, pause_at=%ld\n", + t->idx, (long)blen, (long)t->recv_size, (long)t->pause_at); + if(!t->out) { + curl_msnprintf(t->filename, sizeof(t->filename)-1, "download_%u.data", + t->idx); + t->out = fopen(t->filename, "wb"); + if(!t->out) + return 0; + } + + if(!t->resumed && + t->recv_size < t->pause_at && + ((t->recv_size + (curl_off_t)blen) >= t->pause_at)) { + fprintf(stderr, "[t-%d] PAUSE\n", t->idx); + t->paused = 1; + return CURL_WRITEFUNC_PAUSE; + } + + nwritten = fwrite(buf, nitems, buflen, t->out); + if(nwritten < blen) { + fprintf(stderr, "[t-%d] write failure\n", t->idx); + return 0; + } + t->recv_size += (curl_off_t)nwritten; + if(t->fail_at > 0 && t->recv_size >= t->fail_at) { + fprintf(stderr, "[t-%d] FAIL by write callback at %ld bytes\n", + t->idx, (long)t->recv_size); + return CURL_WRITEFUNC_ERROR; + } + + return (size_t)nwritten; +} + +static int my_progress_cb(void *userdata, + curl_off_t dltotal, curl_off_t dlnow, + curl_off_t ultotal, curl_off_t ulnow) +{ + struct transfer *t = userdata; + (void)ultotal; + (void)ulnow; + (void)dltotal; + if(t->abort_at > 0 && dlnow >= t->abort_at) { + fprintf(stderr, "[t-%d] ABORT by progress_cb at %ld bytes\n", + t->idx, (long)dlnow); + return 1; + } + return 0; +} + +static int setup(CURL *hnd, const char *url, struct transfer *t, + int http_version, struct curl_slist *host, + CURLSH *share, int use_earlydata) +{ + 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_WRITEFUNCTION, my_write_cb); + curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t); + curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_cb); + curl_easy_setopt(hnd, CURLOPT_XFERINFODATA, t); + if(use_earlydata) + curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_EARLYDATA); + if(forbid_reuse) + curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L); + if(host) + curl_easy_setopt(hnd, CURLOPT_RESOLVE, host); + + /* please be verbose */ + if(verbose) { + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, debug_cb); + } + +#if (CURLPIPE_MULTIPLEX > 0) + /* wait for pipe connection to confirm */ + curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); +#endif + return 0; /* all is good */ +} + +static void usage(const char *msg) +{ + if(msg) + fprintf(stderr, "%s\n", msg); + fprintf(stderr, + "usage: [options] url\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" + " -f forbid connection reuse\n" + " -n number total downloads\n"); + fprintf(stderr, + " -A number abort transfer after `number` response bytes\n" + " -F number fail writing response after `number` response bytes\n" + " -P number pause transfer after `number` response bytes\n" + " -r :: resolve information\n" + " -V http_version (http/1.1, h2, h3) http version to use\n" + ); +} +#endif /* !_MSC_VER */ + +/* + * Download a file over HTTP/2, take care of server push. + */ +int main(int argc, char *argv[]) +{ +#ifndef _MSC_VER + CURLM *multi_handle; + struct CURLMsg *m; + CURLSH *share; + const char *url; + size_t i, n, max_parallel = 1; + size_t active_transfers; + size_t pause_offset = 0; + size_t abort_offset = 0; + size_t fail_offset = 0; + int abort_paused = 0, use_earlydata = 0; + struct transfer *t; + int http_version = CURL_HTTP_VERSION_2_0; + int ch; + struct curl_slist *host = NULL; + const char *resolve = NULL; + + while((ch = getopt(argc, argv, "aefhm:n:A:F:P:r:V:")) != -1) { + switch(ch) { + case 'h': + usage(NULL); + return 2; + case 'a': + abort_paused = 1; + break; + case 'e': + use_earlydata = 1; + break; + case 'f': + forbid_reuse = 1; + break; + case 'm': + max_parallel = (size_t)strtol(optarg, NULL, 10); + break; + case 'n': + transfer_count = (size_t)strtol(optarg, NULL, 10); + break; + case 'A': + abort_offset = (size_t)strtol(optarg, NULL, 10); + break; + case 'F': + fail_offset = (size_t)strtol(optarg, NULL, 10); + break; + case 'P': + pause_offset = (size_t)strtol(optarg, NULL, 10); + break; + case 'r': + resolve = optarg; + break; + case 'V': { + if(!strcmp("http/1.1", optarg)) + http_version = CURL_HTTP_VERSION_1_1; + else if(!strcmp("h2", optarg)) + http_version = CURL_HTTP_VERSION_2_0; + else if(!strcmp("h3", optarg)) + http_version = CURL_HTTP_VERSION_3ONLY; + else { + usage("invalid http version"); + return 1; + } + break; + } + default: + usage("invalid option"); + return 1; + } + } + argc -= optind; + argv += optind; + + curl_global_init(CURL_GLOBAL_DEFAULT); + curl_global_trace("ids,time,http/2,http/3"); + + if(argc != 1) { + usage("not enough arguments"); + return 2; + } + url = argv[0]; + + if(resolve) + host = curl_slist_append(NULL, resolve); + + share = curl_share_init(); + if(!share) { + fprintf(stderr, "error allocating share\n"); + return 1; + } + 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); + 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); + + transfers = calloc(transfer_count, sizeof(*transfers)); + if(!transfers) { + fprintf(stderr, "error allocating transfer structs\n"); + return 1; + } + + multi_handle = curl_multi_init(); + curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + + active_transfers = 0; + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + t->idx = (int)i; + t->abort_at = (curl_off_t)abort_offset; + t->fail_at = (curl_off_t)fail_offset; + t->pause_at = (curl_off_t)pause_offset; + } + + n = (max_parallel < transfer_count) ? max_parallel : transfer_count; + for(i = 0; i < n; ++i) { + t = &transfers[i]; + t->easy = curl_easy_init(); + if(!t->easy || + setup(t->easy, url, t, http_version, host, share, use_earlydata)) { + fprintf(stderr, "[t-%d] FAILED setup\n", (int)i); + return 1; + } + curl_multi_add_handle(multi_handle, t->easy); + t->started = 1; + ++active_transfers; + fprintf(stderr, "[t-%d] STARTED\n", t->idx); + } + + do { + int still_running; /* keep number of running handles */ + 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(mc) + break; + + do { + int msgq = 0; + m = curl_multi_info_read(multi_handle, &msgq); + if(m && (m->msg == CURLMSG_DONE)) { + CURL *e = m->easy_handle; + --active_transfers; + curl_multi_remove_handle(multi_handle, e); + t = get_transfer_for_easy(e); + if(t) { + t->done = 1; + fprintf(stderr, "[t-%d] FINISHED\n", t->idx); + if(use_earlydata) { + curl_off_t sent; + curl_easy_getinfo(e, CURLINFO_EARLYDATA_SENT_T, &sent); + fprintf(stderr, "[t-%d] EarlyData: %ld\n", t->idx, (long)sent); + } + } + else { + curl_easy_cleanup(e); + fprintf(stderr, "unknown FINISHED???\n"); + } + } + + + /* nothing happening, maintenance */ + if(abort_paused) { + /* abort paused transfers */ + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(!t->done && t->paused && t->easy) { + curl_multi_remove_handle(multi_handle, t->easy); + t->done = 1; + active_transfers--; + fprintf(stderr, "[t-%d] ABORTED\n", t->idx); + } + } + } + else { + /* resume one paused transfer */ + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(!t->done && t->paused) { + t->resumed = 1; + t->paused = 0; + curl_easy_pause(t->easy, CURLPAUSE_CONT); + fprintf(stderr, "[t-%d] RESUMED\n", t->idx); + break; + } + } + } + + while(active_transfers < max_parallel) { + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(!t->started) { + t->easy = curl_easy_init(); + if(!t->easy || + setup(t->easy, url, t, http_version, host, share, + use_earlydata)) { + fprintf(stderr, "[t-%d] FAILED setup\n", (int)i); + return 1; + } + curl_multi_add_handle(multi_handle, t->easy); + t->started = 1; + ++active_transfers; + fprintf(stderr, "[t-%d] STARTED\n", t->idx); + break; + } + } + /* all started */ + if(i == transfer_count) + break; + } + } while(m); + + } while(active_transfers); /* as long as we have transfers going */ + + curl_multi_cleanup(multi_handle); + + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(t->out) { + fclose(t->out); + t->out = NULL; + } + if(t->easy) { + curl_easy_cleanup(t->easy); + t->easy = NULL; + } + } + free(transfers); + + curl_share_cleanup(share); + + return 0; +#else + (void)argc; + (void)argv; + fprintf(stderr, "Not supported with this compiler.\n"); + return 1; +#endif /* !_MSC_VER */ +} diff --git a/deps/curl/tests/http/clients/hx-upload.c b/deps/curl/tests/http/clients/hx-upload.c new file mode 100644 index 00000000..06df2f4c --- /dev/null +++ b/deps/curl/tests/http/clients/hx-upload.c @@ -0,0 +1,617 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 + * + ***************************************************************************/ +/* + * HTTP upload tests and tweaks + * + */ +/* curl stuff */ +#include + +#include +#include +#include + +#ifndef _MSC_VER +/* somewhat Unix-specific */ +#include /* getopt() */ +#endif + +#ifndef CURLPIPE_MULTIPLEX +#error "too old libcurl" +#endif + +#ifndef _MSC_VER +static int verbose = 1; + +static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) +{ + /* + * This is the trace look that is similar to what libcurl makes on its + * own. + */ + static const char * const s_infotype[] = { + "* ", "< ", "> ", "{ ", "} ", "{ ", "} " + }; + if(idsbuf && *idsbuf) + fprintf(log, "%s%s", idsbuf, s_infotype[type]); + else + fputs(s_infotype[type], log); +} + +#define TRC_IDS_FORMAT_IDS_1 "[%" CURL_FORMAT_CURL_OFF_T "-x] " +#define TRC_IDS_FORMAT_IDS_2 "[%" CURL_FORMAT_CURL_OFF_T "-%" \ + CURL_FORMAT_CURL_OFF_T "] " +/* +** callback for CURLOPT_DEBUGFUNCTION +*/ +static int debug_cb(CURL *handle, curl_infotype type, + char *data, size_t size, + void *userdata) +{ + FILE *output = stderr; + static int newl = 0; + static int traced_data = 0; + char idsbuf[60]; + curl_off_t xfer_id, conn_id; + + (void)handle; /* not used */ + (void)userdata; + + if(!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) { + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, + conn_id); + } + else { + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_1, xfer_id); + } + } + else + idsbuf[0] = 0; + + switch(type) { + case CURLINFO_HEADER_OUT: + if(size > 0) { + size_t st = 0; + size_t i; + for(i = 0; i < size - 1; i++) { + if(data[i] == '\n') { /* LF */ + if(!newl) { + log_line_start(output, idsbuf, type); + } + (void)fwrite(data + st, i - st + 1, 1, output); + st = i + 1; + newl = 0; + } + } + if(!newl) + log_line_start(output, idsbuf, type); + (void)fwrite(data + st, i - st + 1, 1, output); + } + newl = (size && (data[size - 1] != '\n')) ? 1 : 0; + traced_data = 0; + break; + case CURLINFO_TEXT: + case CURLINFO_HEADER_IN: + if(!newl) + log_line_start(output, idsbuf, type); + (void)fwrite(data, size, 1, output); + newl = (size && (data[size - 1] != '\n')) ? 1 : 0; + traced_data = 0; + break; + case CURLINFO_DATA_OUT: + case CURLINFO_DATA_IN: + case CURLINFO_SSL_DATA_IN: + case CURLINFO_SSL_DATA_OUT: + if(!traced_data) { + if(!newl) + log_line_start(output, idsbuf, type); + fprintf(output, "[%ld bytes data]\n", (long)size); + newl = 0; + traced_data = 1; + } + break; + default: /* nada */ + newl = 0; + traced_data = 1; + break; + } + + return 0; +} + +struct transfer { + int idx; + CURL *easy; + const char *method; + char filename[128]; + FILE *out; + curl_off_t send_total; + curl_off_t recv_size; + curl_off_t send_size; + curl_off_t fail_at; + curl_off_t pause_at; + curl_off_t abort_at; + int started; + int paused; + int resumed; + int done; +}; + +static size_t transfer_count = 1; +static struct transfer *transfers; +static int forbid_reuse = 0; + +static struct transfer *get_transfer_for_easy(CURL *easy) +{ + size_t i; + for(i = 0; i < transfer_count; ++i) { + if(easy == transfers[i].easy) + return &transfers[i]; + } + return NULL; +} + +static size_t my_write_cb(char *buf, size_t nitems, size_t buflen, + void *userdata) +{ + struct transfer *t = userdata; + size_t blen = (nitems * buflen); + size_t nwritten; + + fprintf(stderr, "[t-%d] RECV %ld bytes, total=%ld, pause_at=%ld\n", + t->idx, (long)blen, (long)t->recv_size, (long)t->pause_at); + if(!t->out) { + curl_msnprintf(t->filename, sizeof(t->filename)-1, "download_%u.data", + t->idx); + t->out = fopen(t->filename, "wb"); + if(!t->out) + return 0; + } + + nwritten = fwrite(buf, nitems, buflen, t->out); + if(nwritten < blen) { + fprintf(stderr, "[t-%d] write failure\n", t->idx); + return 0; + } + t->recv_size += (curl_off_t)nwritten; + return (size_t)nwritten; +} + +static size_t my_read_cb(char *buf, size_t nitems, size_t buflen, + void *userdata) +{ + struct transfer *t = userdata; + size_t blen = (nitems * buflen); + size_t nread; + + if(t->send_total <= t->send_size) + nread = 0; + else if((t->send_total - t->send_size) < (curl_off_t)blen) + nread = (size_t)(t->send_total - t->send_size); + else + nread = blen; + + fprintf(stderr, "[t-%d] SEND %ld bytes, total=%ld, pause_at=%ld\n", + t->idx, (long)nread, (long)t->send_total, (long)t->pause_at); + + if(!t->resumed && + t->send_size < t->pause_at && + ((t->send_size + (curl_off_t)blen) >= t->pause_at)) { + fprintf(stderr, "[t-%d] PAUSE\n", t->idx); + t->paused = 1; + return CURL_READFUNC_PAUSE; + } + + memset(buf, 'x', nread); + t->send_size += (curl_off_t)nread; + if(t->fail_at > 0 && t->send_size >= t->fail_at) { + fprintf(stderr, "[t-%d] ABORT by read callback at %ld bytes\n", + t->idx, (long)t->send_size); + return CURL_READFUNC_ABORT; + } + return (size_t)nread; +} + +static int my_progress_cb(void *userdata, + curl_off_t dltotal, curl_off_t dlnow, + curl_off_t ultotal, curl_off_t ulnow) +{ + struct transfer *t = userdata; + (void)ultotal; + (void)dlnow; + (void)dltotal; + if(t->abort_at > 0 && ulnow >= t->abort_at) { + fprintf(stderr, "[t-%d] ABORT by progress_cb at %ld bytes sent\n", + t->idx, (long)ulnow); + return 1; + } + return 0; +} + +static int setup(CURL *hnd, const char *url, struct transfer *t, + int 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_WRITEFUNCTION, my_write_cb); + curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t); + if(use_earlydata) + curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, (long)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); + else { + fprintf(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_NOPROGRESS, 0L); + curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_cb); + curl_easy_setopt(hnd, CURLOPT_XFERINFODATA, t); + if(forbid_reuse) + curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L); + if(host) + curl_easy_setopt(hnd, CURLOPT_RESOLVE, host); + + /* please be verbose */ + if(verbose) { + curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, debug_cb); + } + +#if (CURLPIPE_MULTIPLEX > 0) + /* wait for pipe connection to confirm */ + curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L); +#endif + return 0; /* all is good */ +} + +static void usage(const char *msg) +{ + if(msg) + fprintf(stderr, "%s\n", msg); + fprintf(stderr, + "usage: [options] url\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" + " -n number total uploads\n" + " -A number abort transfer after `number` request body bytes\n" + " -F number fail reading request body after `number` of bytes\n" + " -P number pause transfer after `number` request body bytes\n" + " -r :: resolve information\n" + " -S number size to upload\n" + " -V http_version (http/1.1, h2, h3) http version to use\n" + ); +} +#endif /* !_MSC_VER */ + +/* + * Download a file over HTTP/2, take care of server push. + */ +int main(int argc, char *argv[]) +{ +#ifndef _MSC_VER + CURLM *multi_handle; + struct CURLMsg *m; + CURLSH *share; + const char *url; + const char *method = "PUT"; + size_t i, n, max_parallel = 1; + size_t active_transfers; + size_t pause_offset = 0; + size_t abort_offset = 0; + size_t fail_offset = 0; + size_t send_total = (128 * 1024); + int abort_paused = 0; + int reuse_easy = 0; + int use_earlydata = 0; + int announce_length = 0; + struct transfer *t; + int http_version = CURL_HTTP_VERSION_2_0; + struct curl_slist *host = NULL; + const char *resolve = NULL; + int ch; + + while((ch = getopt(argc, argv, "aefhlm:n:A:F:M:P:r:RS:V:")) != -1) { + switch(ch) { + case 'h': + usage(NULL); + return 2; + case 'a': + abort_paused = 1; + break; + case 'e': + use_earlydata = 1; + break; + case 'f': + forbid_reuse = 1; + break; + case 'l': + announce_length = 1; + break; + case 'm': + max_parallel = (size_t)strtol(optarg, NULL, 10); + break; + case 'n': + transfer_count = (size_t)strtol(optarg, NULL, 10); + break; + case 'A': + abort_offset = (size_t)strtol(optarg, NULL, 10); + break; + case 'F': + fail_offset = (size_t)strtol(optarg, NULL, 10); + break; + case 'M': + method = optarg; + break; + case 'P': + pause_offset = (size_t)strtol(optarg, NULL, 10); + break; + case 'r': + resolve = optarg; + break; + case 'R': + reuse_easy = 1; + break; + case 'S': + send_total = (size_t)strtol(optarg, NULL, 10); + break; + case 'V': { + if(!strcmp("http/1.1", optarg)) + http_version = CURL_HTTP_VERSION_1_1; + else if(!strcmp("h2", optarg)) + http_version = CURL_HTTP_VERSION_2_0; + else if(!strcmp("h3", optarg)) + http_version = CURL_HTTP_VERSION_3ONLY; + else { + usage("invalid http version"); + return 1; + } + break; + } + default: + usage("invalid option"); + return 1; + } + } + argc -= optind; + argv += optind; + + if(max_parallel > 1 && reuse_easy) { + usage("cannot mix -R and -P"); + return 2; + } + + curl_global_init(CURL_GLOBAL_DEFAULT); + curl_global_trace("ids,time,http/2,http/3"); + + if(argc != 1) { + usage("not enough arguments"); + return 2; + } + url = argv[0]; + + if(resolve) + host = curl_slist_append(NULL, resolve); + + share = curl_share_init(); + if(!share) { + fprintf(stderr, "error allocating share\n"); + return 1; + } + 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); + 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); + + transfers = calloc(transfer_count, sizeof(*transfers)); + if(!transfers) { + fprintf(stderr, "error allocating transfer structs\n"); + return 1; + } + + active_transfers = 0; + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + t->idx = (int)i; + t->method = method; + t->send_total = (curl_off_t)send_total; + t->abort_at = (curl_off_t)abort_offset; + t->fail_at = (curl_off_t)fail_offset; + t->pause_at = (curl_off_t)pause_offset; + } + + if(reuse_easy) { + CURL *easy = curl_easy_init(); + CURLcode rc = CURLE_OK; + if(!easy) { + fprintf(stderr, "failed to init easy handle\n"); + return 1; + } + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + t->easy = easy; + if(setup(t->easy, url, t, http_version, host, share, use_earlydata, + announce_length)) { + fprintf(stderr, "[t-%d] FAILED setup\n", (int)i); + return 1; + } + + fprintf(stderr, "[t-%d] STARTING\n", t->idx); + rc = curl_easy_perform(easy); + fprintf(stderr, "[t-%d] DONE -> %d\n", t->idx, rc); + t->easy = NULL; + curl_easy_reset(easy); + } + curl_easy_cleanup(easy); + } + else { + multi_handle = curl_multi_init(); + curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + + n = (max_parallel < transfer_count) ? max_parallel : transfer_count; + for(i = 0; i < n; ++i) { + t = &transfers[i]; + t->easy = curl_easy_init(); + if(!t->easy || setup(t->easy, url, t, http_version, host, share, + use_earlydata, announce_length)) { + fprintf(stderr, "[t-%d] FAILED setup\n", (int)i); + return 1; + } + curl_multi_add_handle(multi_handle, t->easy); + t->started = 1; + ++active_transfers; + fprintf(stderr, "[t-%d] STARTED\n", t->idx); + } + + do { + int still_running; /* keep number of running handles */ + 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(mc) + break; + + do { + int msgq = 0; + m = curl_multi_info_read(multi_handle, &msgq); + if(m && (m->msg == CURLMSG_DONE)) { + CURL *e = m->easy_handle; + --active_transfers; + curl_multi_remove_handle(multi_handle, e); + t = get_transfer_for_easy(e); + if(t) { + t->done = 1; + fprintf(stderr, "[t-%d] FINISHED\n", t->idx); + if(use_earlydata) { + curl_off_t sent; + curl_easy_getinfo(e, CURLINFO_EARLYDATA_SENT_T, &sent); + fprintf(stderr, "[t-%d] EarlyData: %ld\n", t->idx, (long)sent); + } + } + else { + curl_easy_cleanup(e); + fprintf(stderr, "unknown FINISHED???\n"); + } + } + + + /* nothing happening, maintenance */ + if(abort_paused) { + /* abort paused transfers */ + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(!t->done && t->paused && t->easy) { + curl_multi_remove_handle(multi_handle, t->easy); + t->done = 1; + active_transfers--; + fprintf(stderr, "[t-%d] ABORTED\n", t->idx); + } + } + } + else { + /* resume one paused transfer */ + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(!t->done && t->paused) { + t->resumed = 1; + t->paused = 0; + curl_easy_pause(t->easy, CURLPAUSE_CONT); + fprintf(stderr, "[t-%d] RESUMED\n", t->idx); + break; + } + } + } + + while(active_transfers < max_parallel) { + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(!t->started) { + t->easy = curl_easy_init(); + if(!t->easy || setup(t->easy, url, t, http_version, host, + share, use_earlydata, announce_length)) { + fprintf(stderr, "[t-%d] FAILED setup\n", (int)i); + return 1; + } + curl_multi_add_handle(multi_handle, t->easy); + t->started = 1; + ++active_transfers; + fprintf(stderr, "[t-%d] STARTED\n", t->idx); + break; + } + } + /* all started */ + if(i == transfer_count) + break; + } + } while(m); + + } while(active_transfers); /* as long as we have transfers going */ + + curl_multi_cleanup(multi_handle); + } + + for(i = 0; i < transfer_count; ++i) { + t = &transfers[i]; + if(t->out) { + fclose(t->out); + t->out = NULL; + } + if(t->easy) { + curl_easy_cleanup(t->easy); + t->easy = NULL; + } + } + free(transfers); + curl_share_cleanup(share); + + return 0; +#else + (void)argc; + (void)argv; + fprintf(stderr, "Not supported with this compiler.\n"); + return 1; +#endif /* !_MSC_VER */ +} diff --git a/deps/curl/tests/http/clients/tls-session-reuse.c b/deps/curl/tests/http/clients/tls-session-reuse.c index 0309276c..8e8d6355 100644 --- a/deps/curl/tests/http/clients/tls-session-reuse.c +++ b/deps/curl/tests/http/clients/tls-session-reuse.c @@ -25,16 +25,13 @@ * TLS session reuse * */ +#include + #include #include -#include #include -#include /* #include */ #include -#include -#include - static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) { @@ -73,8 +70,8 @@ static int debug_cb(CURL *handle, curl_infotype type, if(!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) { - curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, - xfer_id, conn_id); + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, + conn_id); } else { curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_1, xfer_id); @@ -142,7 +139,8 @@ static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *opaque) } static void add_transfer(CURLM *multi, CURLSH *share, - struct curl_slist *resolve, const char *url) + struct curl_slist *resolve, + const char *url, int http_version) { CURL *easy; CURLMcode mc; @@ -159,7 +157,7 @@ static void add_transfer(CURLM *multi, CURLSH *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, CURL_HTTP_VERSION_1_1); + curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, http_version); curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(easy, CURLOPT_WRITEDATA, NULL); curl_easy_setopt(easy, CURLOPT_HTTPGET, 1L); @@ -190,13 +188,19 @@ int main(int argc, char *argv[]) int msgs_in_queue; int add_more, waits, ongoing = 0; char *host, *port; + int http_version = CURL_HTTP_VERSION_1_1; - if(argc != 2) { - fprintf(stderr, "%s URL\n", argv[0]); + if(argc != 3) { + fprintf(stderr, "%s proto URL\n", argv[0]); exit(2); } - url = argv[1]; + if(!strcmp("h2", argv[1])) + http_version = CURL_HTTP_VERSION_2; + else if(!strcmp("h3", argv[1])) + http_version = CURL_HTTP_VERSION_3ONLY; + + url = argv[2]; cu = curl_url(); if(!cu) { fprintf(stderr, "out of memory\n"); @@ -215,9 +219,9 @@ int main(int argc, char *argv[]) exit(1); } - memset(&resolve, 0, sizeof(resolve)); - curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, - "%s:%s:127.0.0.1", host, port); + memset(&resolve, 0, sizeof(resolve)); + curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", + host, port); curl_slist_append(&resolve, resolve_buf); multi = curl_multi_init(); @@ -234,7 +238,7 @@ int main(int argc, char *argv[]) curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); - add_transfer(multi, share, &resolve, url); + add_transfer(multi, share, &resolve, url, http_version); ++ongoing; add_more = 6; waits = 3; @@ -260,14 +264,15 @@ int main(int argc, char *argv[]) } else { while(add_more) { - add_transfer(multi, share, &resolve, url); + add_transfer(multi, share, &resolve, url, http_version); ++ongoing; --add_more; } } /* Check for finished handles and remove. */ - while((msg = curl_multi_info_read(multi, &msgs_in_queue))) { + /* !checksrc! disable EQUALSNULL 1 */ + while((msg = curl_multi_info_read(multi, &msgs_in_queue)) != NULL) { if(msg->msg == CURLMSG_DONE) { long status = 0; curl_off_t xfer_id; diff --git a/deps/curl/tests/http/clients/upload-pausing.c b/deps/curl/tests/http/clients/upload-pausing.c new file mode 100644 index 00000000..ff68b7bd --- /dev/null +++ b/deps/curl/tests/http/clients/upload-pausing.c @@ -0,0 +1,321 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 + * + ***************************************************************************/ +/* + * upload pausing + * + */ +/* This is based on the PoC client of issue #11769 + */ +#include + +#include +#include +#include + +#ifndef _MSC_VER +/* somewhat Unix-specific */ +#include /* getopt() */ +#endif + +#ifndef _MSC_VER +static void log_line_start(FILE *log, const char *idsbuf, curl_infotype type) +{ + /* + * This is the trace look that is similar to what libcurl makes on its + * own. + */ + static const char * const s_infotype[] = { + "* ", "< ", "> ", "{ ", "} ", "{ ", "} " + }; + if(idsbuf && *idsbuf) + fprintf(log, "%s%s", idsbuf, s_infotype[type]); + else + fputs(s_infotype[type], log); +} + +#define TRC_IDS_FORMAT_IDS_1 "[%" CURL_FORMAT_CURL_OFF_T "-x] " +#define TRC_IDS_FORMAT_IDS_2 "[%" CURL_FORMAT_CURL_OFF_T "-%" \ + CURL_FORMAT_CURL_OFF_T "] " +/* +** callback for CURLOPT_DEBUGFUNCTION +*/ +static int debug_cb(CURL *handle, curl_infotype type, + char *data, size_t size, + void *userdata) +{ + FILE *output = stderr; + static int newl = 0; + static int traced_data = 0; + char idsbuf[60]; + curl_off_t xfer_id, conn_id; + + (void)handle; /* not used */ + (void)userdata; + + if(!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) { + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_2, xfer_id, + conn_id); + } + else { + curl_msnprintf(idsbuf, sizeof(idsbuf), TRC_IDS_FORMAT_IDS_1, xfer_id); + } + } + else + idsbuf[0] = 0; + + switch(type) { + case CURLINFO_HEADER_OUT: + if(size > 0) { + size_t st = 0; + size_t i; + for(i = 0; i < size - 1; i++) { + if(data[i] == '\n') { /* LF */ + if(!newl) { + log_line_start(output, idsbuf, type); + } + (void)fwrite(data + st, i - st + 1, 1, output); + st = i + 1; + newl = 0; + } + } + if(!newl) + log_line_start(output, idsbuf, type); + (void)fwrite(data + st, i - st + 1, 1, output); + } + newl = (size && (data[size - 1] != '\n')) ? 1 : 0; + traced_data = 0; + break; + case CURLINFO_TEXT: + case CURLINFO_HEADER_IN: + if(!newl) + log_line_start(output, idsbuf, type); + (void)fwrite(data, size, 1, output); + newl = (size && (data[size - 1] != '\n')) ? 1 : 0; + traced_data = 0; + break; + case CURLINFO_DATA_OUT: + case CURLINFO_DATA_IN: + case CURLINFO_SSL_DATA_IN: + case CURLINFO_SSL_DATA_OUT: + if(!traced_data) { + if(!newl) + log_line_start(output, idsbuf, type); + fprintf(output, "[%ld bytes data]\n", (long)size); + newl = 0; + traced_data = 1; + } + break; + default: /* nada */ + newl = 0; + traced_data = 1; + break; + } + + return 0; +} + +#define PAUSE_READ_AFTER 1 +static size_t total_read = 0; + +static size_t read_callback(char *ptr, size_t size, size_t nmemb, + void *userdata) +{ + (void)size; + (void)nmemb; + (void)userdata; + if(total_read >= PAUSE_READ_AFTER) { + fprintf(stderr, "read_callback, return PAUSE\n"); + return CURL_READFUNC_PAUSE; + } + else { + ptr[0] = '\n'; + ++total_read; + fprintf(stderr, "read_callback, return 1 byte\n"); + return 1; + } +} + +static int progress_callback(void *clientp, + curl_off_t dltotal, + curl_off_t dlnow, + curl_off_t ultotal, + curl_off_t ulnow) +{ + (void)dltotal; + (void)dlnow; + (void)ultotal; + (void)ulnow; + (void)clientp; +#if 0 + /* Used to unpause on progress, but keeping for now. */ + { + CURL *curl = (CURL *)clientp; + curl_easy_pause(curl, CURLPAUSE_CONT); + /* curl_easy_pause(curl, CURLPAUSE_RECV_CONT); */ + } +#endif + return 0; +} + +static int err(void) +{ + fprintf(stderr, "something unexpected went wrong - bailing out!\n"); + exit(2); +} + +static void usage(const char *msg) +{ + if(msg) + fprintf(stderr, "%s\n", msg); + fprintf(stderr, + "usage: [options] url\n" + " upload and pause, options:\n" + " -V http_version (http/1.1, h2, h3) http version to use\n" + ); +} +#endif /* !_MSC_VER */ + +int main(int argc, char *argv[]) +{ +#ifndef _MSC_VER + CURL *curl; + CURLcode rc = CURLE_OK; + CURLU *cu; + struct curl_slist *resolve = NULL; + char resolve_buf[1024]; + char *url, *host = NULL, *port = NULL; + int http_version = CURL_HTTP_VERSION_1_1; + int ch; + + while((ch = getopt(argc, argv, "V:")) != -1) { + switch(ch) { + case 'V': { + if(!strcmp("http/1.1", optarg)) + http_version = CURL_HTTP_VERSION_1_1; + else if(!strcmp("h2", optarg)) + http_version = CURL_HTTP_VERSION_2_0; + else if(!strcmp("h3", optarg)) + http_version = CURL_HTTP_VERSION_3ONLY; + else { + usage("invalid http version"); + return 1; + } + break; + } + default: + usage("invalid option"); + return 1; + } + } + argc -= optind; + argv += optind; + + if(argc != 1) { + usage("not enough arguments"); + return 2; + } + url = argv[0]; + + curl_global_init(CURL_GLOBAL_DEFAULT); + curl_global_trace("ids,time"); + + cu = curl_url(); + if(!cu) { + fprintf(stderr, "out of memory\n"); + exit(1); + } + if(curl_url_set(cu, CURLUPART_URL, url, 0)) { + fprintf(stderr, "not a URL: '%s'\n", url); + exit(1); + } + if(curl_url_get(cu, CURLUPART_HOST, &host, 0)) { + fprintf(stderr, "could not get host of '%s'\n", url); + exit(1); + } + if(curl_url_get(cu, CURLUPART_PORT, &port, 0)) { + fprintf(stderr, "could not get port of '%s'\n", url); + exit(1); + } + memset(&resolve, 0, sizeof(resolve)); + curl_msnprintf(resolve_buf, sizeof(resolve_buf)-1, "%s:%s:127.0.0.1", + host, port); + resolve = curl_slist_append(resolve, resolve_buf); + + curl = curl_easy_init(); + if(!curl) { + fprintf(stderr, "out of memory\n"); + exit(1); + } + /* We want to use our own read function. */ + curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + + /* It will help us to continue the read function. */ + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); + curl_easy_setopt(curl, CURLOPT_XFERINFODATA, curl); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + + /* It will help us to ensure that keepalive does not help. */ + curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); + curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 1L); + curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 1L); + curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 1L); + + /* Enable uploading. */ + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); + + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); + + if(curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L) != CURLE_OK || + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, debug_cb) + != CURLE_OK || + curl_easy_setopt(curl, CURLOPT_RESOLVE, resolve) != CURLE_OK) + err(); + + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, http_version); + + rc = curl_easy_perform(curl); + + if(curl) { + curl_easy_cleanup(curl); + } + + curl_slist_free_all(resolve); + curl_free(host); + curl_free(port); + curl_url_cleanup(cu); + curl_global_cleanup(); + + return (int)rc; +#else + (void)argc; + (void)argv; + fprintf(stderr, "Not supported with this compiler.\n"); + return 1; +#endif /* !_MSC_VER */ +} diff --git a/deps/curl/tests/http/clients/ws-data.c b/deps/curl/tests/http/clients/ws-data.c index 487d109e..6698326d 100644 --- a/deps/curl/tests/http/clients/ws-data.c +++ b/deps/curl/tests/http/clients/ws-data.c @@ -22,10 +22,9 @@ * ***************************************************************************/ /* - * Websockets data echos + * WebSockets data echos * */ - /* curl stuff */ #include "curl_setup.h" #include @@ -34,11 +33,16 @@ #include #include -/* somewhat unix-specific */ -#include -#include +#ifndef CURL_DISABLE_WEBSOCKETS -#ifdef USE_WEBSOCKETS +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#else +#include +#endif static void dump(const char *text, unsigned char *ptr, size_t size, @@ -56,7 +60,7 @@ void dump(const char *text, unsigned char *ptr, size_t size, fprintf(stderr, "%s, %lu bytes (0x%lx)\n", text, (unsigned long)size, (unsigned long)size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)?ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { @@ -112,7 +116,11 @@ static CURLcode recv_binary(CURL *curl, char *exp_data, size_t exp_len) result = curl_ws_recv(curl, recvbuf, sizeof(recvbuf), &nread, &frame); if(result == CURLE_AGAIN) { fprintf(stderr, "EAGAIN, sleep, try again\n"); +#ifdef _WIN32 + Sleep(100); +#else usleep(100*1000); +#endif continue; } fprintf(stderr, "ws: curl_ws_recv(offset=%ld, len=%ld) -> %d, %ld\n", @@ -168,7 +176,7 @@ static void websocket_close(CURL *curl) static CURLcode data_echo(CURL *curl, size_t plen_min, size_t plen_max) { - CURLcode res; + CURLcode res = CURLE_OK; size_t len; char *send_buf; size_t i; @@ -202,7 +210,7 @@ out: int main(int argc, char *argv[]) { -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS CURL *curl; CURLcode res = CURLE_OK; const char *url; @@ -254,10 +262,10 @@ int main(int argc, char *argv[]) curl_global_cleanup(); return (int)res; -#else /* USE_WEBSOCKETS */ +#else /* !CURL_DISABLE_WEBSOCKETS */ (void)argc; (void)argv; - fprintf(stderr, "websockets not enabled in libcurl\n"); + fprintf(stderr, "WebSockets not enabled in libcurl\n"); return 1; -#endif /* !USE_WEBSOCKETS */ +#endif /* CURL_DISABLE_WEBSOCKETS */ } diff --git a/deps/curl/tests/http/clients/ws-pingpong.c b/deps/curl/tests/http/clients/ws-pingpong.c index dc36d454..efb01bcd 100644 --- a/deps/curl/tests/http/clients/ws-pingpong.c +++ b/deps/curl/tests/http/clients/ws-pingpong.c @@ -22,10 +22,9 @@ * ***************************************************************************/ /* - * Websockets pingpong + * WebSockets pingpong * */ - /* curl stuff */ #include "curl_setup.h" #include @@ -34,11 +33,16 @@ #include #include -/* somewhat unix-specific */ +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#else #include -#include +#endif -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS static CURLcode ping(CURL *curl, const char *send_payload) { @@ -102,7 +106,11 @@ static CURLcode pingpong(CURL *curl, const char *payload) fprintf(stderr, "Receive pong\n"); res = recv_pong(curl, payload); if(res == CURLE_AGAIN) { +#ifdef _WIN32 + Sleep(100); +#else usleep(100*1000); +#endif continue; } websocket_close(curl); @@ -116,7 +124,7 @@ static CURLcode pingpong(CURL *curl, const char *payload) int main(int argc, char *argv[]) { -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS CURL *curl; CURLcode res = CURLE_OK; const char *url, *payload; @@ -149,10 +157,10 @@ int main(int argc, char *argv[]) curl_global_cleanup(); return (int)res; -#else /* USE_WEBSOCKETS */ +#else /* !CURL_DISABLE_WEBSOCKETS */ (void)argc; (void)argv; - fprintf(stderr, "websockets not enabled in libcurl\n"); + fprintf(stderr, "WebSockets not enabled in libcurl\n"); return 1; -#endif /* !USE_WEBSOCKETS */ +#endif /* CURL_DISABLE_WEBSOCKETS */ } diff --git a/deps/curl/tests/http/config.ini.in b/deps/curl/tests/http/config.ini.in index 42a96790..8475c03b 100644 --- a/deps/curl/tests/http/config.ini.in +++ b/deps/curl/tests/http/config.ini.in @@ -35,3 +35,6 @@ nghttpx = @HTTPD_NGHTTPX@ [caddy] caddy = @CADDY@ + +[vsftpd] +vsftpd = @VSFTPD@ diff --git a/deps/curl/tests/http/conftest.py b/deps/curl/tests/http/conftest.py index 3aca42e6..a4a4a172 100644 --- a/deps/curl/tests/http/conftest.py +++ b/deps/curl/tests/http/conftest.py @@ -25,7 +25,7 @@ import logging import os import sys -from typing import Optional +from typing import Generator import pytest @@ -33,6 +33,42 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '.')) from testenv import Env, Nghttpx, Httpd, NghttpxQuic, NghttpxFwd +def pytest_report_header(config): + # Env inits its base properties only once, we can report them here + env = Env() + report = [ + f'Testing curl {env.curl_version()}', + f' curl: Features: {env.curl_features_string()}', + f' curl: Protocols: {env.curl_protocols_string()}', + f' httpd: {env.httpd_version()}, http:{env.http_port} https:{env.https_port}', + f' httpd-proxy: {env.httpd_version()}, http:{env.proxy_port} https:{env.proxys_port}' + ] + if env.have_h3(): + report.extend([ + f' nghttpx: {env.nghttpx_version()}, h3:{env.https_port}' + ]) + if env.has_caddy(): + report.extend([ + f' Caddy: {env.caddy_version()}, http:{env.caddy_http_port} https:{env.caddy_https_port}' + ]) + if env.has_vsftpd(): + report.extend([ + f' VsFTPD: {env.vsftpd_version()}, ftp:{env.ftp_port}, ftps:{env.ftps_port}' + ]) + buildinfo_fn = os.path.join(env.build_dir, 'buildinfo.txt') + if os.path.exists(buildinfo_fn): + with open(buildinfo_fn, 'r') as file_in: + for line in file_in: + line = line.strip() + if line and not line.startswith('#'): + report.extend([line]) + return '\n'.join(report) + +# TODO: remove this and repeat argument everywhere, pytest-repeat can be used to repeat tests +def pytest_generate_tests(metafunc): + if "repeat" in metafunc.fixturenames: + metafunc.parametrize('repeat', [0]) + @pytest.fixture(scope="package") def env(pytestconfig) -> Env: env = Env(pytestconfig=pytestconfig) @@ -46,8 +82,6 @@ def env(pytestconfig) -> Env: pytest.skip(env.incomplete_reason()) env.setup() - if not env.make_clients(): - pytest.exit(1) return env @pytest.fixture(scope="package", autouse=True) @@ -56,7 +90,7 @@ def log_global_env_facts(record_testsuite_property, env): @pytest.fixture(scope='package') -def httpd(env) -> Httpd: +def httpd(env) -> Generator[Httpd, None, None]: httpd = Httpd(env=env) if not httpd.exists(): pytest.skip(f'httpd not found: {env.httpd}') @@ -68,18 +102,18 @@ def httpd(env) -> Httpd: @pytest.fixture(scope='package') -def nghttpx(env, httpd) -> Optional[Nghttpx]: +def nghttpx(env, httpd) -> Generator[Nghttpx, None, None]: nghttpx = NghttpxQuic(env=env) - if env.have_h3(): + if nghttpx.exists() and (env.have_h3() or nghttpx.https_port > 0): nghttpx.clear_logs() assert nghttpx.start() yield nghttpx nghttpx.stop() @pytest.fixture(scope='package') -def nghttpx_fwd(env, httpd) -> Optional[Nghttpx]: +def nghttpx_fwd(env, httpd) -> Generator[Nghttpx, None, None]: nghttpx = NghttpxFwd(env=env) - if env.have_h3(): + if nghttpx.exists() and (env.have_h3() or nghttpx.https_port > 0): nghttpx.clear_logs() assert nghttpx.start() yield nghttpx diff --git a/deps/curl/tests/http/scorecard.py b/deps/curl/tests/http/scorecard.py index 446a1bc5..c675d9c5 100644 --- a/deps/curl/tests/http/scorecard.py +++ b/deps/curl/tests/http/scorecard.py @@ -33,39 +33,43 @@ import sys from statistics import mean from typing import Dict, Any, Optional, List -from testenv import Env, Httpd, Nghttpx, CurlClient, Caddy, ExecResult, NghttpxQuic, RunProfile +from testenv import Env, Httpd, CurlClient, Caddy, ExecResult, NghttpxQuic, RunProfile log = logging.getLogger(__name__) -class ScoreCardException(Exception): +class ScoreCardError(Exception): pass class ScoreCard: def __init__(self, env: Env, - httpd: Optional[Httpd], - nghttpx: Optional[Nghttpx], - caddy: Optional[Caddy], + protocol: str, + server_descr: str, + server_port: int, verbose: int, - curl_verbose: int): + curl_verbose: int, + download_parallel: int = 0, + server_addr: Optional[str] = None): self.verbose = verbose self.env = env - self.httpd = httpd - self.nghttpx = nghttpx - self.caddy = caddy + self.protocol = protocol + self.server_descr = server_descr + self.server_addr = server_addr + self.server_port = server_port self._silent_curl = not curl_verbose + self._download_parallel = download_parallel def info(self, msg): if self.verbose > 0: sys.stderr.write(msg) sys.stderr.flush() - def handshakes(self, proto: str) -> Dict[str, Any]: + def handshakes(self) -> Dict[str, Any]: props = {} sample_size = 5 - self.info(f'TLS Handshake\n') + self.info('TLS Handshake\n') for authority in [ 'curl.se', 'google.com', 'cloudflare.com', 'nghttp2.org' ]: @@ -76,10 +80,11 @@ class ScoreCard: c_samples = [] hs_samples = [] errors = [] - for i in range(sample_size): - curl = CurlClient(env=self.env, silent=self._silent_curl) + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) args = [ - '--http3-only' if proto == 'h3' else '--http2', + '--http3-only' if self.protocol == 'h3' else '--http2', f'--{ipv}', f'https://{authority}/' ] r = curl.run_direct(args=args, with_stats=True) @@ -104,7 +109,17 @@ class ScoreCard: while flen < fsize: fd.write(data1k) flen += len(data1k) - return flen + return fpath + + def setup_resources(self, server_docs: str, + downloads: Optional[List[int]] = None): + for fsize in downloads: + label = self.fmt_size(fsize) + fname = f'score{label}.data' + self._make_docs_file(docs_dir=server_docs, + fname=fname, fsize=fsize) + self._make_docs_file(docs_dir=server_docs, + fname='reqs10.data', fsize=10*1024) def _check_downloads(self, r: ExecResult, count: int): error = '' @@ -117,16 +132,47 @@ class ScoreCard: error += f'{len(fails)} failed' return error if len(error) > 0 else None - def transfer_single(self, url: str, proto: str, count: int): + def transfer_single(self, url: str, count: int): sample_size = count count = 1 samples = [] errors = [] profiles = [] - self.info(f'single...') - for i in range(sample_size): - curl = CurlClient(env=self.env, silent=self._silent_curl) - r = curl.http_download(urls=[url], alpn_proto=proto, no_save=True, + self.info('single...') + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_download(urls=[url], alpn_proto=self.protocol, + no_save=True, with_headers=False, + with_profile=True) + err = self._check_downloads(r, count) + if err: + errors.append(err) + else: + total_size = sum([s['size_download'] for s in r.stats]) + samples.append(total_size / r.duration.total_seconds()) + profiles.append(r.profile) + return { + 'count': count, + 'samples': sample_size, + 'max-parallel': 1, + 'speed': mean(samples) if len(samples) else -1, + 'errors': errors, + 'stats': RunProfile.AverageStats(profiles), + } + + def transfer_serial(self, url: str, count: int): + sample_size = 1 + samples = [] + errors = [] + profiles = [] + url = f'{url}?[0-{count - 1}]' + self.info('serial...') + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_download(urls=[url], alpn_proto=self.protocol, + no_save=True, with_headers=False, with_profile=True) err = self._check_downloads(r, count) if err: @@ -138,51 +184,31 @@ class ScoreCard: return { 'count': count, 'samples': sample_size, + 'max-parallel': 1, 'speed': mean(samples) if len(samples) else -1, 'errors': errors, 'stats': RunProfile.AverageStats(profiles), } - def transfer_serial(self, url: str, proto: str, count: int): + def transfer_parallel(self, url: str, count: int): sample_size = 1 samples = [] errors = [] profiles = [] + max_parallel = self._download_parallel if self._download_parallel > 0 else count url = f'{url}?[0-{count - 1}]' - self.info(f'serial...') - for i in range(sample_size): - curl = CurlClient(env=self.env, silent=self._silent_curl) - r = curl.http_download(urls=[url], alpn_proto=proto, no_save=True, - with_headers=False, with_profile=True) - err = self._check_downloads(r, count) - if err: - errors.append(err) - else: - total_size = sum([s['size_download'] for s in r.stats]) - samples.append(total_size / r.duration.total_seconds()) - profiles.append(r.profile) - return { - 'count': count, - 'samples': sample_size, - 'speed': mean(samples) if len(samples) else -1, - 'errors': errors, - 'stats': RunProfile.AverageStats(profiles), - } - - def transfer_parallel(self, url: str, proto: str, count: int): - sample_size = 1 - samples = [] - errors = [] - profiles = [] - url = f'{url}?[0-{count - 1}]' - self.info(f'parallel...') - for i in range(sample_size): - curl = CurlClient(env=self.env, silent=self._silent_curl) - r = curl.http_download(urls=[url], alpn_proto=proto, no_save=True, + self.info('parallel...') + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_download(urls=[url], alpn_proto=self.protocol, + no_save=True, with_headers=False, with_profile=True, - extra_args=['--parallel', - '--parallel-max', str(count)]) + extra_args=[ + '--parallel', + '--parallel-max', str(max_parallel) + ]) err = self._check_downloads(r, count) if err: errors.append(err) @@ -193,90 +219,191 @@ class ScoreCard: return { 'count': count, 'samples': sample_size, + 'max-parallel': max_parallel, 'speed': mean(samples) if len(samples) else -1, 'errors': errors, 'stats': RunProfile.AverageStats(profiles), } - def download_url(self, label: str, url: str, proto: str, count: int): + def download_url(self, label: str, url: str, count: int): self.info(f' {count}x{label}: ') props = { - 'single': self.transfer_single(url=url, proto=proto, count=10), + 'single': self.transfer_single(url=url, count=10), } if count > 1: - props['serial'] = self.transfer_serial(url=url, proto=proto, - count=count) - props['parallel'] = self.transfer_parallel(url=url, proto=proto, - count=count) - self.info(f'ok.\n') + props['serial'] = self.transfer_serial(url=url, count=count) + props['parallel'] = self.transfer_parallel(url=url, count=count) + self.info('ok.\n') return props - def downloads(self, proto: str, count: int, - fsizes: List[int]) -> Dict[str, Any]: + def downloads(self, count: int, fsizes: List[int]) -> Dict[str, Any]: scores = {} - if self.httpd: - if proto == 'h3': - port = self.env.h3_port - via = 'nghttpx' - descr = f'port {port}, proxying httpd' - else: - port = self.env.https_port - via = 'httpd' - descr = f'port {port}' - self.info(f'{via} downloads\n') - scores[via] = { - 'description': descr, - } - for fsize in fsizes: - label = self.fmt_size(fsize) - fname = f'score{label}.data' - self._make_docs_file(docs_dir=self.httpd.docs_dir, - fname=fname, fsize=fsize) - url = f'https://{self.env.domain1}:{port}/{fname}' - results = self.download_url(label=label, url=url, - proto=proto, count=count) - scores[via][label] = results - if self.caddy: - port = self.caddy.port - via = 'caddy' - descr = f'port {port}' - self.info('caddy downloads\n') - scores[via] = { - 'description': descr, - } - for fsize in fsizes: - label = self.fmt_size(fsize) - fname = f'score{label}.data' - self._make_docs_file(docs_dir=self.caddy.docs_dir, - fname=fname, fsize=fsize) - url = f'https://{self.env.domain1}:{port}/{fname}' - results = self.download_url(label=label, url=url, - proto=proto, count=count) - scores[via][label] = results + for fsize in fsizes: + label = self.fmt_size(fsize) + fname = f'score{label}.data' + url = f'https://{self.env.domain1}:{self.server_port}/{fname}' + scores[label] = self.download_url(label=label, url=url, count=count) return scores - def do_requests(self, url: str, proto: str, count: int, - max_parallel: int = 1): + def _check_uploads(self, r: ExecResult, count: int): + error = '' + if r.exit_code != 0: + error += f'exit={r.exit_code} ' + if r.exit_code != 0 or len(r.stats) != count: + error += f'stats={len(r.stats)}/{count} ' + fails = [s for s in r.stats if s['response_code'] != 200] + if len(fails) > 0: + error += f'{len(fails)} failed' + for f in fails: + error += f'[{f["response_code"]}]' + return error if len(error) > 0 else None + + def upload_single(self, url: str, fpath: str, count: int): + sample_size = count + count = 1 + samples = [] + errors = [] + profiles = [] + self.info('single...') + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_put(urls=[url], fdata=fpath, alpn_proto=self.protocol, + with_headers=False, with_profile=True) + err = self._check_uploads(r, count) + if err: + errors.append(err) + else: + total_size = sum([s['size_upload'] for s in r.stats]) + samples.append(total_size / r.duration.total_seconds()) + profiles.append(r.profile) + return { + 'count': count, + 'samples': sample_size, + 'max-parallel': 1, + 'speed': mean(samples) if len(samples) else -1, + 'errors': errors, + 'stats': RunProfile.AverageStats(profiles) if len(profiles) else {}, + } + + def upload_serial(self, url: str, fpath: str, count: int): + sample_size = 1 + samples = [] + errors = [] + profiles = [] + url = f'{url}?id=[0-{count - 1}]' + self.info('serial...') + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_put(urls=[url], fdata=fpath, alpn_proto=self.protocol, + with_headers=False, with_profile=True) + err = self._check_uploads(r, count) + if err: + errors.append(err) + else: + total_size = sum([s['size_upload'] for s in r.stats]) + samples.append(total_size / r.duration.total_seconds()) + profiles.append(r.profile) + return { + 'count': count, + 'samples': sample_size, + 'max-parallel': 1, + 'speed': mean(samples) if len(samples) else -1, + 'errors': errors, + 'stats': RunProfile.AverageStats(profiles) if len(profiles) else {}, + } + + def upload_parallel(self, url: str, fpath: str, count: int): + sample_size = 1 + samples = [] + errors = [] + profiles = [] + max_parallel = count + url = f'{url}?id=[0-{count - 1}]' + self.info('parallel...') + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_put(urls=[url], fdata=fpath, alpn_proto=self.protocol, + with_headers=False, with_profile=True, + extra_args=[ + '--parallel', + '--parallel-max', str(max_parallel) + ]) + err = self._check_uploads(r, count) + if err: + errors.append(err) + else: + total_size = sum([s['size_upload'] for s in r.stats]) + samples.append(total_size / r.duration.total_seconds()) + profiles.append(r.profile) + return { + 'count': count, + 'samples': sample_size, + 'max-parallel': max_parallel, + 'speed': mean(samples) if len(samples) else -1, + 'errors': errors, + 'stats': RunProfile.AverageStats(profiles) if len(profiles) else {}, + } + + def upload_url(self, label: str, url: str, fpath: str, count: int): + self.info(f' {count}x{label}: ') + props = { + 'single': self.upload_single(url=url, fpath=fpath, count=10), + } + if count > 1: + props['serial'] = self.upload_serial(url=url, fpath=fpath, count=count) + props['parallel'] = self.upload_parallel(url=url, fpath=fpath, count=count) + self.info('ok.\n') + return props + + def uploads(self, count: int, fsizes: List[int]) -> Dict[str, Any]: + scores = {} + url = f'https://{self.env.domain2}:{self.server_port}/curltest/put' + fpaths = {} + for fsize in fsizes: + label = self.fmt_size(fsize) + fname = f'upload{label}.data' + fpaths[label] = self._make_docs_file(docs_dir=self.env.gen_dir, + fname=fname, fsize=fsize) + + for label, fpath in fpaths.items(): + scores[label] = self.upload_url(label=label, url=url, fpath=fpath, + count=count) + return scores + + def do_requests(self, url: str, count: int, max_parallel: int = 1): sample_size = 1 samples = [] errors = [] profiles = [] url = f'{url}?[0-{count - 1}]' - extra_args = ['--parallel', '--parallel-max', str(max_parallel)] \ - if max_parallel > 1 else [] + extra_args = [ + '-w', '%{response_code},\\n', + ] + if max_parallel > 1: + extra_args.extend([ + '--parallel', '--parallel-max', str(max_parallel) + ]) self.info(f'{max_parallel}...') - for i in range(sample_size): - curl = CurlClient(env=self.env, silent=self._silent_curl) - r = curl.http_download(urls=[url], alpn_proto=proto, no_save=True, + for _ in range(sample_size): + curl = CurlClient(env=self.env, silent=self._silent_curl, + server_addr=self.server_addr) + r = curl.http_download(urls=[url], alpn_proto=self.protocol, no_save=True, with_headers=False, with_profile=True, - extra_args=extra_args) - err = self._check_downloads(r, count) - if err: - errors.append(err) + with_stats=False, extra_args=extra_args) + if r.exit_code != 0: + errors.append(f'exit={r.exit_code}') else: - for _ in r.stats: - samples.append(count / r.duration.total_seconds()) - profiles.append(r.profile) + samples.append(count / r.duration.total_seconds()) + non_200s = 0 + for line in r.stdout.splitlines(): + if not line.startswith('200,'): + non_200s += 1 + if non_200s > 0: + errors.append(f'responses != 200: {non_200s}') + profiles.append(r.profile) return { 'count': count, 'samples': sample_size, @@ -285,106 +412,76 @@ class ScoreCard: 'stats': RunProfile.AverageStats(profiles), } - def requests_url(self, url: str, proto: str, count: int): + def requests_url(self, url: str, count: int): self.info(f' {url}: ') - props = { - '1': self.do_requests(url=url, proto=proto, count=count), - '6': self.do_requests(url=url, proto=proto, count=count, - max_parallel=6), - '25': self.do_requests(url=url, proto=proto, count=count, - max_parallel=25), - '50': self.do_requests(url=url, proto=proto, count=count, - max_parallel=50), - '100': self.do_requests(url=url, proto=proto, count=count, - max_parallel=100), - } - self.info(f'ok.\n') + props = {} + # 300 is max in curl, see tool_main.h + for m in [1, 6, 25, 50, 100, 300]: + props[str(m)] = self.do_requests(url=url, count=count, max_parallel=m) + self.info('ok.\n') return props - def requests(self, proto: str, req_count) -> Dict[str, Any]: - scores = {} - if self.httpd: - if proto == 'h3': - port = self.env.h3_port - via = 'nghttpx' - descr = f'port {port}, proxying httpd' - else: - port = self.env.https_port - via = 'httpd' - descr = f'port {port}' - self.info(f'{via} requests\n') - self._make_docs_file(docs_dir=self.httpd.docs_dir, - fname='reqs10.data', fsize=10*1024) - url1 = f'https://{self.env.domain1}:{port}/reqs10.data' - scores[via] = { - 'description': descr, - 'count': req_count, - '10KB': self.requests_url(url=url1, proto=proto, count=req_count), - } - if self.caddy: - port = self.caddy.port - via = 'caddy' - descr = f'port {port}' - self.info('caddy requests\n') - self._make_docs_file(docs_dir=self.caddy.docs_dir, - fname='req10.data', fsize=10 * 1024) - url1 = f'https://{self.env.domain1}:{port}/req10.data' - scores[via] = { - 'description': descr, - 'count': req_count, - '10KB': self.requests_url(url=url1, proto=proto, count=req_count), - } - return scores + def requests(self, req_count) -> Dict[str, Any]: + url = f'https://{self.env.domain1}:{self.server_port}/reqs10.data' + return { + 'count': req_count, + '10KB': self.requests_url(url=url, count=req_count), + } - def score_proto(self, proto: str, - handshakes: bool = True, - downloads: Optional[List[int]] = None, - download_count: int = 50, - req_count=5000, - requests: bool = True): - self.info(f"scoring {proto}\n") + def score(self, + handshakes: bool = True, + downloads: Optional[List[int]] = None, + download_count: int = 50, + uploads: Optional[List[int]] = None, + upload_count: int = 50, + req_count=5000, + requests: bool = True): + self.info(f"scoring {self.protocol} against {self.server_descr}\n") p = {} - if proto == 'h3': + if self.protocol == 'h3': p['name'] = 'h3' if not self.env.have_h3_curl(): - raise ScoreCardException('curl does not support HTTP/3') + raise ScoreCardError('curl does not support HTTP/3') for lib in ['ngtcp2', 'quiche', 'msh3', 'nghttp3']: if self.env.curl_uses_lib(lib): p['implementation'] = lib break - elif proto == 'h2': + elif self.protocol == 'h2': p['name'] = 'h2' if not self.env.have_h2_curl(): - raise ScoreCardException('curl does not support HTTP/2') + raise ScoreCardError('curl does not support HTTP/2') for lib in ['nghttp2', 'hyper']: if self.env.curl_uses_lib(lib): p['implementation'] = lib break - elif proto == 'h1' or proto == 'http/1.1': + elif self.protocol == 'h1' or self.protocol == 'http/1.1': proto = 'http/1.1' p['name'] = proto p['implementation'] = 'hyper' if self.env.curl_uses_lib('hyper')\ else 'native' else: - raise ScoreCardException(f"unknown protocol: {proto}") + raise ScoreCardError(f"unknown protocol: {self.protocol}") if 'implementation' not in p: - raise ScoreCardException(f'did not recognized {p} lib') + raise ScoreCardError(f'did not recognized {p} lib') p['version'] = Env.curl_lib_version(p['implementation']) score = { 'curl': self.env.curl_fullname(), 'os': self.env.curl_os(), 'protocol': p, + 'server': self.server_descr, } if handshakes: - score['handshakes'] = self.handshakes(proto=proto) + score['handshakes'] = self.handshakes() if downloads and len(downloads) > 0: - score['downloads'] = self.downloads(proto=proto, - count=download_count, + score['downloads'] = self.downloads(count=download_count, fsizes=downloads) + if uploads and len(uploads) > 0: + score['uploads'] = self.uploads(count=upload_count, + fsizes=uploads) if requests: - score['requests'] = self.requests(proto=proto, req_count=req_count) + score['requests'] = self.requests(req_count=req_count) self.info("\n") return score @@ -427,42 +524,86 @@ class ScoreCard: m_names = {} mcol_width = 12 mcol_sw = 17 - for server, server_score in score['downloads'].items(): - for sskey, ssval in server_score.items(): - if isinstance(ssval, str): - continue - if sskey not in sizes: - sizes.append(sskey) - for mkey, mval in server_score[sskey].items(): - if mkey not in measures: - measures.append(mkey) - m_names[mkey] = f'{mkey}({mval["count"]}x)' - - print('Downloads') - print(f' {"Server":<8} {"Size":>8}', end='') - for m in measures: print(f' {m_names[m]:>{mcol_width}} {"[cpu/rss]":<{mcol_sw}}', end='') + for sskey, ssval in score['downloads'].items(): + if isinstance(ssval, str): + continue + if sskey not in sizes: + sizes.append(sskey) + for mkey, mval in score['downloads'][sskey].items(): + if mkey not in measures: + measures.append(mkey) + m_names[mkey] = f'{mkey}({mval["count"]}x{mval["max-parallel"]})' + print(f'Downloads from {score["server"]}') + print(f' {"Size":>8}', end='') + for m in measures: + print(f' {m_names[m]:>{mcol_width}} {"[cpu/rss]":<{mcol_sw}}', end='') print(f' {"Errors":^20}') - for server in score['downloads']: - for size in sizes: - size_score = score['downloads'][server][size] - print(f' {server:<8} {size:>8}', end='') - errors = [] - for key, val in size_score.items(): - if 'errors' in val: - errors.extend(val['errors']) - for m in measures: - if m in size_score: - print(f' {self.fmt_mbs(size_score[m]["speed"]):>{mcol_width}}', end='') - s = f'[{size_score[m]["stats"]["cpu"]:>.1f}%'\ - f'/{self.fmt_size(size_score[m]["stats"]["rss"])}]' - print(f' {s:<{mcol_sw}}', end='') - else: - print(' '*mcol_width, end='') - if len(errors): - print(f' {"/".join(errors):<20}') + for size in score['downloads']: + size_score = score['downloads'][size] + print(f' {size:>8}', end='') + errors = [] + for val in size_score.values(): + if 'errors' in val: + errors.extend(val['errors']) + for m in measures: + if m in size_score: + print(f' {self.fmt_mbs(size_score[m]["speed"]):>{mcol_width}}', end='') + s = f'[{size_score[m]["stats"]["cpu"]:>.1f}%'\ + f'/{self.fmt_size(size_score[m]["stats"]["rss"])}]' + print(f' {s:<{mcol_sw}}', end='') else: - print(f' {"-":^20}') + print(' '*mcol_width, end='') + if len(errors): + print(f' {"/".join(errors):<20}') + else: + print(f' {"-":^20}') + + if 'uploads' in score: + # get the key names of all sizes and measurements made + sizes = [] + measures = [] + m_names = {} + mcol_width = 12 + mcol_sw = 17 + for sskey, ssval in score['uploads'].items(): + if isinstance(ssval, str): + continue + if sskey not in sizes: + sizes.append(sskey) + for mkey, mval in ssval.items(): + if mkey not in measures: + measures.append(mkey) + m_names[mkey] = f'{mkey}({mval["count"]}x{mval["max-parallel"]})' + + print(f'Uploads to {score["server"]}') + print(f' {"Size":>8}', end='') + for m in measures: + print(f' {m_names[m]:>{mcol_width}} {"[cpu/rss]":<{mcol_sw}}', end='') + print(f' {"Errors":^20}') + + for size in sizes: + size_score = score['uploads'][size] + print(f' {size:>8}', end='') + errors = [] + for val in size_score.values(): + if 'errors' in val: + errors.extend(val['errors']) + for m in measures: + if m in size_score: + print(f' {self.fmt_mbs(size_score[m]["speed"]):>{mcol_width}}', end='') + stats = size_score[m]["stats"] + if 'cpu' in stats: + s = f'[{stats["cpu"]:>.1f}%/{self.fmt_size(stats["rss"])}]' + else: + s = '[???/???]' + print(f' {s:<{mcol_sw}}', end='') + else: + print(' '*mcol_width, end='') + if len(errors): + print(f' {"/".join(errors):<20}') + else: + print(f' {"-":^20}') if 'requests' in score: sizes = [] @@ -470,44 +611,42 @@ class ScoreCard: m_names = {} mcol_width = 9 mcol_sw = 13 - for server in score['requests']: - server_score = score['requests'][server] - for sskey, ssval in server_score.items(): - if isinstance(ssval, str) or isinstance(ssval, int): - continue - if sskey not in sizes: - sizes.append(sskey) - for mkey, mval in server_score[sskey].items(): - if mkey not in measures: - measures.append(mkey) - m_names[mkey] = f'{mkey}' + for sskey, ssval in score['requests'].items(): + if isinstance(ssval, (str, int)): + continue + if sskey not in sizes: + sizes.append(sskey) + for mkey in score['requests'][sskey]: + if mkey not in measures: + measures.append(mkey) + m_names[mkey] = f'{mkey}' - print('Requests, max in parallel') - print(f' {"Server":<8} {"Size":>6} {"Reqs":>6}', end='') - for m in measures: print(f' {m_names[m]:>{mcol_width}} {"[cpu/rss]":<{mcol_sw}}', end='') + print('Requests (max parallel) to {score["server"]}') + print(f' {"Size":>6} {"Reqs":>6}', end='') + for m in measures: + print(f' {m_names[m]:>{mcol_width}} {"[cpu/rss]":<{mcol_sw}}', end='') print(f' {"Errors":^10}') - for server in score['requests']: - for size in sizes: - size_score = score['requests'][server][size] - count = score['requests'][server]['count'] - print(f' {server:<8} {size:>6} {count:>6}', end='') - errors = [] - for key, val in size_score.items(): - if 'errors' in val: - errors.extend(val['errors']) - for m in measures: - if m in size_score: - print(f' {self.fmt_reqs(size_score[m]["speed"]):>{mcol_width}}', end='') - s = f'[{size_score[m]["stats"]["cpu"]:>.1f}%'\ - f'/{self.fmt_size(size_score[m]["stats"]["rss"])}]' - print(f' {s:<{mcol_sw}}', end='') - else: - print(' '*mcol_width, end='') - if len(errors): - print(f' {"/".join(errors):<10}') + for size in sizes: + size_score = score['requests'][size] + count = score['requests']['count'] + print(f' {size:>6} {count:>6}', end='') + errors = [] + for val in size_score.values(): + if 'errors' in val: + errors.extend(val['errors']) + for m in measures: + if m in size_score: + print(f' {self.fmt_reqs(size_score[m]["speed"]):>{mcol_width}}', end='') + s = f'[{size_score[m]["stats"]["cpu"]:>.1f}%'\ + f'/{self.fmt_size(size_score[m]["stats"]["rss"])}]' + print(f' {s:<{mcol_sw}}', end='') else: - print(f' {"-":^10}') + print(' '*mcol_width, end='') + if len(errors): + print(f' {"/".join(errors):<10}') + else: + print(f' {"-":^10}') def parse_size(s): @@ -543,6 +682,14 @@ def main(): default=None, help="evaluate download size") parser.add_argument("--download-count", action='store', type=int, default=50, help="perform that many downloads") + parser.add_argument("--download-parallel", action='store', type=int, + default=0, help="perform that many downloads in parallel (default all)") + parser.add_argument("-u", "--uploads", action='store_true', + default=False, help="evaluate uploads") + parser.add_argument("--upload", action='append', type=str, + default=None, help="evaluate upload size") + parser.add_argument("--upload-count", action='store', type=int, + default=50, help="perform that many uploads") parser.add_argument("-r", "--requests", action='store_true', default=False, help="evaluate requests") parser.add_argument("--request-count", action='store', type=int, @@ -555,6 +702,10 @@ def main(): default=False, help="run curl with `-v`") parser.add_argument("protocol", default='h2', nargs='?', help="Name of protocol to score") + parser.add_argument("--start-only", action='store_true', default=False, + help="only start the servers") + parser.add_argument("--remote", action='store', type=str, + default=None, help="score against the remote server at :") args = parser.parse_args() if args.verbose > 0: @@ -570,11 +721,20 @@ def main(): downloads = [] for x in args.download: downloads.extend([parse_size(s) for s in x.split(',')]) + + uploads = [1024 * 1024, 10 * 1024 * 1024, 100 * 1024 * 1024] + if args.upload is not None: + uploads = [] + for x in args.upload: + uploads.extend([parse_size(s) for s in x.split(',')]) + requests = True - if args.downloads or args.requests or args.handshakes: + if args.downloads or args.uploads or args.requests or args.handshakes: handshakes = args.handshakes if not args.downloads: downloads = None + if not args.uploads: + uploads = None requests = args.requests test_httpd = protocol != 'h3' @@ -591,36 +751,97 @@ def main(): nghttpx = None caddy = None try: + cards = [] + + if args.remote: + m = re.match(r'^(.+):(\d+)$', args.remote) + if m is None: + raise ScoreCardError(f'unable to parse ip:port from --remote {args.remote}') + test_httpd = False + test_caddy = False + remote_addr = m.group(1) + remote_port = int(m.group(2)) + card = ScoreCard(env=env, + protocol=protocol, + server_descr=f'Server at {args.remote}', + server_addr=remote_addr, + server_port=remote_port, + verbose=args.verbose, curl_verbose=args.curl_verbose, + download_parallel=args.download_parallel) + cards.append(card) + if test_httpd: httpd = Httpd(env=env) assert httpd.exists(), \ f'httpd not found: {env.httpd}' httpd.clear_logs() + server_docs = httpd.docs_dir assert httpd.start() - if 'h3' == protocol: + if protocol == 'h3': nghttpx = NghttpxQuic(env=env) nghttpx.clear_logs() assert nghttpx.start() + server_descr = f'nghttpx: https:{env.h3_port} [backend httpd: {env.httpd_version()}, https:{env.https_port}]' + server_port = env.h3_port + else: + server_descr = f'httpd: {env.httpd_version()}, http:{env.http_port} https:{env.https_port}' + server_port = env.https_port + card = ScoreCard(env=env, + protocol=protocol, + server_descr=server_descr, + server_port=server_port, + verbose=args.verbose, curl_verbose=args.curl_verbose, + download_parallel=args.download_parallel) + card.setup_resources(server_docs, downloads) + cards.append(card) + if test_caddy and env.caddy: + backend = '' + if uploads and httpd is None: + backend = f' [backend httpd: {env.httpd_version()}, http:{env.http_port} https:{env.https_port}]' + httpd = Httpd(env=env) + assert httpd.exists(), \ + f'httpd not found: {env.httpd}' + httpd.clear_logs() + assert httpd.start() caddy = Caddy(env=env) caddy.clear_logs() assert caddy.start() + server_descr = f'Caddy: {env.caddy_version()}, http:{env.caddy_http_port} https:{env.caddy_https_port}{backend}' + server_port = caddy.port + server_docs = caddy.docs_dir + card = ScoreCard(env=env, + protocol=protocol, + server_descr=server_descr, + server_port=server_port, + verbose=args.verbose, curl_verbose=args.curl_verbose, + download_parallel=args.download_parallel) + card.setup_resources(server_docs, downloads) + cards.append(card) - card = ScoreCard(env=env, httpd=httpd, nghttpx=nghttpx, caddy=caddy, - verbose=args.verbose, curl_verbose=args.curl_verbose) - score = card.score_proto(proto=protocol, - handshakes=handshakes, - downloads=downloads, - download_count=args.download_count, - req_count=args.request_count, - requests=requests) - if args.json: - print(json.JSONEncoder(indent=2).encode(score)) + if args.start_only: + print('started servers:') + for card in cards: + print(f'{card.server_descr}') + sys.stderr.write('press [RETURN] to finish') + sys.stderr.flush() + sys.stdin.readline() else: - card.print_score(score) + for card in cards: + score = card.score(handshakes=handshakes, + downloads=downloads, + download_count=args.download_count, + uploads=uploads, + upload_count=args.upload_count, + req_count=args.request_count, + requests=requests) + if args.json: + print(json.JSONEncoder(indent=2).encode(score)) + else: + card.print_score(score) - except ScoreCardException as ex: - sys.stderr.write(f"ERROR: {str(ex)}\n") + except ScoreCardError as ex: + sys.stderr.write(f"ERROR: {ex}\n") rv = 1 except KeyboardInterrupt: log.warning("aborted") diff --git a/deps/curl/tests/http/test_01_basic.py b/deps/curl/tests/http/test_01_basic.py index 3902b75b..391c2315 100644 --- a/deps/curl/tests/http/test_01_basic.py +++ b/deps/curl/tests/http/test_01_basic.py @@ -50,7 +50,7 @@ class TestBasic: assert r.json['server'] == env.domain1 # simple https: GET, any http version - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_02_https_get(self, env: Env, httpd): curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/data.json' @@ -59,7 +59,7 @@ class TestBasic: assert r.json['server'] == env.domain1 # simple https: GET, h2 wanted and got - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_03_h2_get(self, env: Env, httpd): curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/data.json' @@ -68,7 +68,7 @@ class TestBasic: assert r.json['server'] == env.domain1 # simple https: GET, h2 unsupported, fallback to h1 - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_01_04_h2_unsupported(self, env: Env, httpd): curl = CurlClient(env=env) url = f'https://{env.domain2}:{env.https_port}/data.json' @@ -86,7 +86,7 @@ class TestBasic: assert r.json['server'] == env.domain1 # simple download, check connect/handshake timings - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @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, repeat, proto): if proto == 'h3' and not env.have_h3(): @@ -94,8 +94,48 @@ class TestBasic: 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) - r.check_stats(http_status=200, count=1) + r.check_stats(http_status=200, count=1, + remote_port=env.port_for(alpn_proto=proto), + remote_ip='127.0.0.1') assert r.stats[0]['time_connect'] > 0, f'{r.stats[0]}' 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.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") + def test_01_07_head(self, env: Env, httpd, nghttpx, repeat, proto): + 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, + extra_args=['-I']) + r.check_stats(http_status=200, count=1, exitcode=0, + remote_port=env.port_for(alpn_proto=proto), + remote_ip='127.0.0.1') + # got the Conten-Length: header, but did not download anything + assert r.responses[0]['header']['content-length'] == '30', f'{r.responses[0]}' + assert r.stats[0]['size_download'] == 0, f'{r.stats[0]}' + # http: GET for HTTP/2, see Upgrade:, 101 switch + def test_01_08_h2_upgrade(self, env: Env, httpd): + curl = CurlClient(env=env) + url = f'http://{env.domain1}:{env.http_port}/data.json' + r = curl.http_get(url=url, extra_args=['--http2']) + r.check_exit_code(0) + assert len(r.responses) == 2, f'{r.responses}' + assert r.responses[0]['status'] == 101, f'{r.responses[0]}' + assert r.responses[1]['status'] == 200, f'{r.responses[1]}' + assert r.responses[1]['protocol'] == 'HTTP/2', f'{r.responses[1]}' + assert r.json['server'] == env.domain1 + + # http: GET for HTTP/2 with prior knowledge + def test_01_09_h2_prior_knowledge(self, env: Env, httpd): + 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']) + r.check_exit_code(0) + assert len(r.responses) == 1, f'{r.responses}' + assert r.response['status'] == 200, f'{r.responsw}' + assert r.response['protocol'] == 'HTTP/2', f'{r.response}' + assert r.json['server'] == env.domain1 diff --git a/deps/curl/tests/http/test_02_download.py b/deps/curl/tests/http/test_02_download.py index 4db9c9d3..fe92df50 100644 --- a/deps/curl/tests/http/test_02_download.py +++ b/deps/curl/tests/http/test_02_download.py @@ -27,7 +27,9 @@ import difflib import filecmp import logging +import math import os +import re from datetime import timedelta import pytest @@ -77,28 +79,30 @@ class TestDownload: # download 100 files sequentially @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) - def test_02_03_download_100_sequential(self, env: Env, - httpd, nghttpx, repeat, proto): + def test_02_03_download_sequential(self, env: Env, + httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") + count = 10 curl = CurlClient(env=env) - urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-99]' + urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]' r = curl.http_download(urls=[urln], alpn_proto=proto) - r.check_response(http_status=200, count=100, connect_count=1) + r.check_response(http_status=200, count=count, connect_count=1) # download 100 files parallel - @pytest.mark.parametrize("proto", ['h2', 'h3']) - def test_02_04_download_100_parallel(self, env: Env, - httpd, nghttpx, repeat, proto): + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_04_download_parallel(self, env: Env, + httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") - max_parallel = 50 + count = 10 + max_parallel = 5 curl = CurlClient(env=env) - urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-99]' + urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]' r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ '--parallel', '--parallel-max', f'{max_parallel}' ]) - r.check_response(http_status=200, count=100) + r.check_response(http_status=200, count=count) if proto == 'http/1.1': # http/1.1 parallel transfers will open multiple connections assert r.total_connects > 1, r.dump_logs() @@ -164,8 +168,6 @@ class TestDownload: @pytest.mark.parametrize("proto", ['http/1.1']) def test_02_07b_download_reuse(self, env: Env, httpd, nghttpx, repeat, proto): - if env.curl_uses_lib('wolfssl'): - pytest.skip("wolfssl session reuse borked") count = 6 curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-{count-1}]' @@ -182,7 +184,7 @@ class TestDownload: httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") - count = 20 + 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) @@ -193,7 +195,7 @@ class TestDownload: httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") - count = 20 + 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, extra_args=[ @@ -208,7 +210,7 @@ class TestDownload: httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") - count = 10 + count = 3 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto=proto) @@ -223,7 +225,7 @@ class TestDownload: pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") - count = 10 + count = 3 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ @@ -236,7 +238,7 @@ class TestDownload: httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") - count = 50 + count = 5 urln = f'https://{env.authority_for(env.domain1, proto)}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ @@ -249,7 +251,7 @@ class TestDownload: httpd, nghttpx, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") - count = 50 + count = 5 urln = f'http://{env.domain1}:{env.http_port}/data-10m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ @@ -257,8 +259,39 @@ class TestDownload: ]) r.check_response(count=count, http_status=200) + @pytest.mark.parametrize("proto", ['h2', 'h3']) + def test_02_14_not_found(self, env: Env, httpd, nghttpx, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 stalls here") + count = 5 + urln = f'https://{env.authority_for(env.domain1, proto)}/not-found?[0-{count-1}]' + curl = CurlClient(env=env) + r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ + '--parallel' + ]) + r.check_stats(count=count, http_status=404, exitcode=0, + remote_port=env.port_for(alpn_proto=proto), + remote_ip='127.0.0.1') + + @pytest.mark.parametrize("proto", ['h2', 'h3']) + def test_02_15_fail_not_found(self, env: Env, httpd, nghttpx, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 stalls here") + count = 5 + urln = f'https://{env.authority_for(env.domain1, proto)}/not-found?[0-{count-1}]' + curl = CurlClient(env=env) + r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ + '--fail' + ]) + r.check_stats(count=count, http_status=404, exitcode=22, + remote_port=env.port_for(alpn_proto=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=Env().ci_run, reason="not suitable for CI runs") def test_02_20_h2_small_frames(self, env: Env, httpd, repeat): # Test case to reproduce content corruption as observed in # https://github.com/curl/curl/issues/10525 @@ -266,18 +299,18 @@ class TestDownload: # setting smaller frame sizes. This is not released yet, we # test if it works and back out if not. httpd.set_extra_config(env.domain1, lines=[ - f'H2MaxDataFrameLen 1024', + 'H2MaxDataFrameLen 1024', ]) assert httpd.stop() if not httpd.start(): # no, not supported, bail out httpd.set_extra_config(env.domain1, lines=None) assert httpd.start() - pytest.skip(f'H2MaxDataFrameLen not supported') + pytest.skip('H2MaxDataFrameLen not supported') # ok, make 100 downloads with 2 parallel running and they # are expected to stumble into the issue when using `lib/http2.c` # from curl 7.88.0 - count = 100 + count = 5 urln = f'https://{env.authority_for(env.domain1, "h2")}/data-1m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto="h2", extra_args=[ @@ -293,15 +326,18 @@ class TestDownload: # download via lib client, 1 at a time, pause/resume at different offsets @pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000]) - def test_02_21_h2_lib_serial(self, env: Env, httpd, nghttpx, pause_offset, repeat): - count = 10 + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_21_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset, repeat): + 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}' - client = LocalClient(name='h2-download', env=env) + client = LocalClient(name='hx-download', env=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}', url + '-n', f'{count}', '-P', f'{pause_offset}', '-V', proto, url ]) r.check_exit_code(0) srcfile = os.path.join(httpd.docs_dir, docname) @@ -309,35 +345,106 @@ class TestDownload: # download via lib client, several at a time, pause/resume @pytest.mark.parametrize("pause_offset", [100*1023]) - def test_02_22_h2_lib_parallel_resume(self, env: Env, httpd, nghttpx, pause_offset, repeat): - count = 10 + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_offset, repeat): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + count = 2 max_parallel = 5 docname = 'data-10m' url = f'https://localhost:{env.https_port}/{docname}' - client = LocalClient(name='h2-download', env=env) + client = LocalClient(name='hx-download', env=env) if not client.exists(): pytest.skip(f'example client not built: {client.name}') r = client.run(args=[ '-n', f'{count}', '-m', f'{max_parallel}', - '-P', f'{pause_offset}', url + '-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, several at a time, pause and abort paused - @pytest.mark.parametrize("pause_offset", [100*1023]) - def test_02_23_h2_lib_parallel_abort(self, env: Env, httpd, nghttpx, pause_offset, repeat): - count = 200 - max_parallel = 100 - docname = 'data-10m' + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_23a_lib_abort_paused(self, env: Env, httpd, nghttpx, proto, repeat): + 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']: + pause_offset = 64 * 1024 + else: + pause_offset = 12 * 1024 + docname = 'data-1m' url = f'https://localhost:{env.https_port}/{docname}' - client = LocalClient(name='h2-download', env=env) + client = LocalClient(name='hx-download', env=env) if not client.exists(): pytest.skip(f'example client not built: {client.name}') r = client.run(args=[ '-n', f'{count}', '-m', f'{max_parallel}', '-a', - '-P', f'{pause_offset}', url + '-P', f'{pause_offset}', '-V', proto, url + ]) + r.check_exit_code(0) + srcfile = os.path.join(httpd.docs_dir, docname) + # downloads should be there, but not necessarily complete + 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']) + def test_02_23b_lib_abort_offset(self, env: Env, httpd, nghttpx, proto, repeat): + 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']: + abort_offset = 64 * 1024 + else: + abort_offset = 12 * 1024 + docname = 'data-1m' + url = f'https://localhost:{env.https_port}/{docname}' + client = LocalClient(name='hx-download', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', '-m', f'{max_parallel}', '-a', + '-A', f'{abort_offset}', '-V', proto, url + ]) + r.check_exit_code(0) + srcfile = os.path.join(httpd.docs_dir, docname) + # downloads should be there, but not necessarily complete + 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']) + def test_02_23c_lib_fail_offset(self, env: Env, httpd, nghttpx, proto, repeat): + 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']: + fail_offset = 64 * 1024 + else: + fail_offset = 12 * 1024 + docname = 'data-1m' + url = f'https://localhost:{env.https_port}/{docname}' + client = LocalClient(name='hx-download', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', '-m', f'{max_parallel}', '-a', + '-F', f'{fail_offset}', '-V', proto, url ]) r.check_exit_code(0) srcfile = os.path.join(httpd.docs_dir, docname) @@ -345,29 +452,26 @@ class TestDownload: self.check_downloads(client, srcfile, count, complete=False) # speed limited download - @pytest.mark.parametrize("proto", ['h2', 'h3']) + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_24_speed_limit(self, env: Env, httpd, nghttpx, proto, repeat): 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) + speed_limit = 384 * 1024 + min_duration = math.floor((1024 * 1024)/speed_limit) r = curl.http_download(urls=[url], alpn_proto=proto, extra_args=[ - '--limit-rate', f'{196 * 1024}' + '--limit-rate', f'{speed_limit}' ]) r.check_response(count=count, http_status=200) - assert r.duration > timedelta(seconds=4), \ - f'rate limited transfer should take more than 4s, not {r.duration}' + assert r.duration > timedelta(seconds=min_duration), \ + f'rate limited transfer should take more than {min_duration}s, '\ + f'not {r.duration}' # make extreme parallel h2 upgrades, check invalid conn reuse # before protocol switch has happened def test_02_25_h2_upgrade_x(self, env: Env, httpd, repeat): - # not locally reproducible timeouts with certain SSL libs - # Since this test is about connection reuse handling, we skip - # it on these builds. Although we would certainly like to understand - # why this happens. - if env.curl_uses_lib('bearssl'): - pytest.skip('CI workflows timeout on bearssl build') url = f'http://localhost:{env.http_port}/data-100k' client = LocalClient(name='h2-upgrade-extreme', env=env, timeout=15) if not client.exists(): @@ -376,24 +480,56 @@ class TestDownload: assert r.exit_code == 0, f'{client.dump_logs()}' # Special client that tests TLS session reuse in parallel transfers - def test_02_26_session_shared_reuse(self, env: Env, httpd, repeat): - curl = CurlClient(env=env) - url = f'https://{env.domain1}:{env.https_port}/data-100k' + # 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, repeat): + url = f'https://{env.authority_for(env.domain1, proto)}/data-100k' client = LocalClient(name='tls-session-reuse', env=env) if not client.exists(): pytest.skip(f'example client not built: {client.name}') - r = client.run(args=[url]) + r = client.run(args=[proto, url]) r.check_exit_code(0) # test on paused transfers, based on issue #11982 - def test_02_27_paused_no_cl(self, env: Env, httpd, nghttpx, repeat): - proto = 'h2' + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_27a_paused_no_cl(self, env: Env, httpd, nghttpx, proto, repeat): url = f'https://{env.authority_for(env.domain1, proto)}' \ - '/tweak?&chunks=2&chunk_size=16000' + '/curltest/tweak/?&chunks=6&chunk_size=8000' client = LocalClient(env=env, name='h2-pausing') - r = client.run(args=[url]) + r = client.run(args=['-V', proto, url]) r.check_exit_code(0) + # 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, repeat): + url = f'https://{env.authority_for(env.domain1, proto)}' \ + '/curltest/tweak/?error=502' + client = LocalClient(env=env, name='h2-pausing') + r = client.run(args=['-V', proto, url]) + r.check_exit_code(0) + + # 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, repeat): + url = f'https://{env.authority_for(env.domain1, proto)}' \ + '/curltest/tweak/?status=200&chunks=1&chunk_size=100' + client = LocalClient(env=env, name='h2-pausing') + r = client.run(args=['-V', proto, url]) + r.check_exit_code(0) + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, repeat, proto): + 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) + r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ + '--compressed' + ]) + r.check_exit_code(code=0) + r.check_response(count=count, http_status=200) + def check_downloads(self, client, srcfile: str, count: int, complete: bool = True): for i in range(count): @@ -406,3 +542,94 @@ class TestDownload: tofile=dfile, n=1)) assert False, f'download {dfile} differs:\n{diff}' + + # 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']) + def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset, repeat): + count = 2 + docname = 'data-10m' + url = f'https://localhost:{env.https_port}/{docname}' + client = LocalClient(name='hx-download', env=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 parallel with prior knowledge + def test_02_30_parallel_prior_knowledge(self, env: Env, httpd): + count = 3 + curl = CurlClient(env=env) + urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' + r = curl.http_download(urls=[urln], extra_args=[ + '--parallel', '--http2-prior-knowledge' + ]) + r.check_response(http_status=200, count=count) + assert r.total_connects == 1, r.dump_logs() + + # download parallel with h2 "Upgrade:" + def test_02_31_parallel_upgrade(self, env: Env, httpd, nghttpx): + count = 3 + curl = CurlClient(env=env) + urln = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' + r = curl.http_download(urls=[urln], extra_args=[ + '--parallel', '--http2' + ]) + r.check_response(http_status=200, count=count) + # we see 3 connections, because Apache only every serves a single + # request via Upgrade: and then closed the connection. + assert r.total_connects == 3, r.dump_logs() + + # nghttpx is the only server we have that supports TLS early data + @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx") + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto): + if not env.curl_uses_lib('gnutls'): + pytest.skip('TLS earlydata only implemented in GnuTLS') + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + count = 2 + docname = 'data-10k' + # we want this test to always connect to nghttpx, since it is + # the only server we have that supports TLS earlydata + port = env.port_for(proto) + if proto != 'h3': + port = env.nghttpx_https_port + url = f'https://{env.domain1}:{port}/{docname}' + client = LocalClient(name='hx-download', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', + '-e', # use TLS earlydata + '-f', # forbid reuse of connections + '-r', f'{env.domain1}:{port}:127.0.0.1', + '-V', proto, url + ]) + r.check_exit_code(0) + srcfile = os.path.join(httpd.docs_dir, docname) + self.check_downloads(client, srcfile, count) + # check that TLS earlydata worked as expected + earlydata = {} + reused_session = False + for line in r.trace_lines: + m = re.match(r'^\[t-(\d+)] EarlyData: (\d+)', line) + if m: + earlydata[int(m.group(1))] = int(m.group(2)) + continue + m = re.match(r'\[1-1] \* SSL reusing session.*', line) + if m: + reused_session = True + assert reused_session, 'session was not reused for 2nd transfer' + assert earlydata[0] == 0, f'{earlydata}' + if proto == 'http/1.1': + assert earlydata[1] == 69, f'{earlydata}' + elif proto == 'h2': + assert earlydata[1] == 107, f'{earlydata}' + elif proto == 'h3': + # not implemented + assert earlydata[1] == 0, f'{earlydata}' diff --git a/deps/curl/tests/http/test_03_goaway.py b/deps/curl/tests/http/test_03_goaway.py index 1f4a3d78..26d57bbe 100644 --- a/deps/curl/tests/http/test_03_goaway.py +++ b/deps/curl/tests/http/test_03_goaway.py @@ -36,7 +36,6 @@ from testenv import Env, CurlClient, ExecResult log = logging.getLogger(__name__) -@pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") class TestGoAway: @pytest.fixture(autouse=True, scope='class') @@ -83,8 +82,8 @@ class TestGoAway: proto = 'h3' if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") - if proto == 'h3' and env.curl_uses_lib('quiche'): - pytest.skip("does not work in CI, but locally for some reason") + if proto == 'h3' and env.curl_uses_ossl_quic(): + pytest.skip('OpenSSL QUIC fails here') count = 3 self.r = None def long_run(): @@ -103,8 +102,8 @@ class TestGoAway: assert nghttpx.reload(timeout=timedelta(seconds=2)) t.join() r: ExecResult = self.r - # this should take `count` seconds to retrieve - assert r.duration >= timedelta(seconds=count) + # this should take `count` seconds to retrieve, maybe a little less + assert r.duration >= timedelta(seconds=count-1) r.check_response(count=count, http_status=200, connect_count=2) # reload will shut down the connection gracefully with GOAWAY # we expect to see a second connection opened afterwards @@ -120,10 +119,13 @@ class TestGoAway: def long_run(): curl = CurlClient(env=env) # send 10 chunks of 1024 bytes in a response body with 100ms delay in between + # pause 2 seconds between requests urln = f'https://{env.authority_for(env.domain1, proto)}' \ f'/curltest/tweak?id=[0-{count - 1}]'\ '&chunks=10&chunk_size=1024&chunk_delay=100ms' - self.r = curl.http_download(urls=[urln], alpn_proto=proto) + self.r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[ + '--rate', '30/m', + ]) t = Thread(target=long_run) t.start() @@ -134,7 +136,7 @@ class TestGoAway: t.join() r: ExecResult = self.r r.check_response(count=count, http_status=200, connect_count=2) - # reload will shut down the connection gracefully with GOAWAY + # reload will shut down the connection gracefully # we expect to see a second connection opened afterwards for idx, s in enumerate(r.stats): if s['num_connects'] > 0: diff --git a/deps/curl/tests/http/test_04_stuttered.py b/deps/curl/tests/http/test_04_stuttered.py index e017a44c..c5463cc9 100644 --- a/deps/curl/tests/http/test_04_stuttered.py +++ b/deps/curl/tests/http/test_04_stuttered.py @@ -25,7 +25,6 @@ ########################################################################### # import logging -import os from typing import Tuple, List, Dict import pytest diff --git a/deps/curl/tests/http/test_05_errors.py b/deps/curl/tests/http/test_05_errors.py index 68e49f73..e00edcfa 100644 --- a/deps/curl/tests/http/test_05_errors.py +++ b/deps/curl/tests/http/test_05_errors.py @@ -24,12 +24,10 @@ # ########################################################################### # -import json import logging -from typing import Optional, Tuple, List, Dict import pytest -from testenv import Env, CurlClient, ExecResult +from testenv import Env, CurlClient log = logging.getLogger(__name__) @@ -129,9 +127,11 @@ class TestErrors: r = curl.http_download(urls=[url], alpn_proto=proto, extra_args=[ '--parallel', ]) - if proto == 'http/1.0': + if proto == 'http/1.0' and \ + (env.curl_is_debug() or not env.curl_uses_lib('openssl')): + # we are inconsistent if we fail or not in missing TLS shutdown + # openssl code ignore such errors intentionally in non-debug builds r.check_exit_code(56) else: r.check_exit_code(0) r.check_response(http_status=200, count=count) - diff --git a/deps/curl/tests/http/test_06_eyeballs.py b/deps/curl/tests/http/test_06_eyeballs.py index 8a93440c..0c553958 100644 --- a/deps/curl/tests/http/test_06_eyeballs.py +++ b/deps/curl/tests/http/test_06_eyeballs.py @@ -24,12 +24,10 @@ # ########################################################################### # -import json import logging -from typing import Optional, Tuple, List, Dict import pytest -from testenv import Env, CurlClient, ExecResult +from testenv import Env, CurlClient log = logging.getLogger(__name__) @@ -45,7 +43,7 @@ class TestEyeballs: httpd.reload() # download using only HTTP/3 on working server - @pytest.mark.skipif(condition=not Env.have_h3(), reason=f"missing HTTP/3 support") + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") def test_06_01_h3_only(self, env: Env, httpd, nghttpx, repeat): curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, "h3")}/data.json' @@ -54,7 +52,7 @@ class TestEyeballs: assert r.stats[0]['http_version'] == '3' # download using only HTTP/3 on missing server - @pytest.mark.skipif(condition=not Env.have_h3(), reason=f"missing HTTP/3 support") + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") def test_06_02_h3_only(self, env: Env, httpd, nghttpx, repeat): nghttpx.stop_if_running() curl = CurlClient(env=env) @@ -63,7 +61,7 @@ class TestEyeballs: r.check_response(exitcode=7, http_status=None) # download using HTTP/3 on missing server with fallback on h2 - @pytest.mark.skipif(condition=not Env.have_h3(), reason=f"missing HTTP/3 support") + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") def test_06_03_h3_fallback_h2(self, env: Env, httpd, nghttpx, repeat): nghttpx.stop_if_running() curl = CurlClient(env=env) @@ -73,7 +71,7 @@ class TestEyeballs: assert r.stats[0]['http_version'] == '2' # download using HTTP/3 on missing server with fallback on http/1.1 - @pytest.mark.skipif(condition=not Env.have_h3(), reason=f"missing HTTP/3 support") + @pytest.mark.skipif(condition=not Env.have_h3(), reason="missing HTTP/3 support") def test_06_04_h3_fallback_h1(self, env: Env, httpd, nghttpx, repeat): nghttpx.stop_if_running() curl = CurlClient(env=env) @@ -105,7 +103,7 @@ class TestEyeballs: # make https: to an invalid address def test_06_12_stats_fail_tcp(self, env: Env, httpd, nghttpx, repeat): curl = CurlClient(env=env) - urln = f'https://not-valid.com:1/data.json' + urln = 'https://not-valid.com:1/data.json' r = curl.http_download(urls=[urln], extra_args=[ '--resolve', f'not-valid.com:{1}:127.0.0.1' ]) diff --git a/deps/curl/tests/http/test_07_upload.py b/deps/curl/tests/http/test_07_upload.py index 94534ffb..2ce2707c 100644 --- a/deps/curl/tests/http/test_07_upload.py +++ b/deps/curl/tests/http/test_07_upload.py @@ -28,10 +28,11 @@ import difflib import filecmp import logging import os -import time +import re import pytest +from typing import List -from testenv import Env, CurlClient +from testenv import Env, CurlClient, LocalClient log = logging.getLogger(__name__) @@ -43,9 +44,11 @@ class TestUpload: def _class_scope(self, env, httpd, nghttpx): if env.have_h3(): nghttpx.start_if_needed() + env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10*1024) env.make_data_file(indir=env.gen_dir, fname="data-63k", fsize=63*1024) env.make_data_file(indir=env.gen_dir, fname="data-64k", fsize=64*1024) env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100*1024) + env.make_data_file(indir=env.gen_dir, fname="data-1m+", fsize=(1024*1024)+1) env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024) httpd.clear_extra_configs() httpd.reload() @@ -88,7 +91,7 @@ class TestUpload: pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") - count = 50 + count = 20 data = '0123456789' curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]' @@ -106,7 +109,7 @@ class TestUpload: if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") # limit since we use a separate connection in h1 - count = 50 + count = 20 data = '0123456789' curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]' @@ -125,7 +128,7 @@ class TestUpload: if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") fdata = os.path.join(env.gen_dir, 'data-100k') - count = 20 + count = 10 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]' r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto) @@ -154,6 +157,73 @@ class TestUpload: respdata = open(curl.response_file(i)).readlines() assert respdata == indata + # upload from stdin, issue #14870 + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + @pytest.mark.parametrize("indata", [ + '', '1', '123\n456andsomething\n\n' + ]) + def test_07_14_upload_stdin(self, env: Env, httpd, nghttpx, proto, indata): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 stalls here") + count = 1 + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-{count-1}]' + r = curl.http_put(urls=[url], data=indata, alpn_proto=proto) + r.check_stats(count=count, http_status=200, exitcode=0) + for i in range(count): + respdata = open(curl.response_file(i)).readlines() + assert respdata == [f'{len(indata)}'] + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto): + 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?id=[0-{count-1}]' + client = LocalClient(name='hx-upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', '-S', f'{upload_size}', '-V', proto, url + ]) + r.check_exit_code(0) + self.check_downloads(client, [f"{upload_size}"], count) + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto): + 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?id=[0-{count-1}]' + client = LocalClient(name='hx-upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', '-S', f'{upload_size}', '-R', '-V', proto, url + ]) + r.check_exit_code(0) + self.check_downloads(client, [f"{upload_size}"], count) + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto): + 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?id=[0-{count-1}]' + client = LocalClient(name='hx-upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', '-M', 'POST', '-S', f'{upload_size}', '-R', '-V', proto, url + ]) + r.check_exit_code(0) + self.check_downloads(client, ["x" * upload_size], count) + # 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, repeat, proto): @@ -162,7 +232,7 @@ class TestUpload: if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") # limit since we use a separate connection in h1 - count = 20 + count = 10 data = '0123456789' curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]' @@ -182,7 +252,7 @@ class TestUpload: pytest.skip("msh3 stalls here") fdata = os.path.join(env.gen_dir, 'data-100k') # limit since we use a separate connection in h1 - count = 20 + count = 10 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]' r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto, @@ -198,7 +268,7 @@ class TestUpload: if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 stalls here") fdata = os.path.join(env.gen_dir, 'data-10m') - count = 100 + count = 20 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}]' @@ -463,6 +533,78 @@ class TestUpload: n=1)) assert False, f'download {dfile} differs:\n{diff}' + # upload data, pause, let connection die with an incomplete response + # issues #11769 #13260 + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_07_42a_upload_disconnect(self, env: Env, httpd, nghttpx, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 fails here") + client = LocalClient(name='upload-pausing', env=env, timeout=60) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]&die_after=0' + r = client.run(['-V', proto, url]) + if r.exit_code == 18: # PARTIAL_FILE is always ok + pass + elif proto == 'h2': + r.check_exit_code(92) # CURLE_HTTP2_STREAM also ok + elif proto == 'h3': + r.check_exit_code(95) # CURLE_HTTP3 also ok + else: + 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']) + def test_07_42b_upload_disconnect(self, env: Env, httpd, nghttpx, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 fails here") + client = LocalClient(name='upload-pausing', env=env, timeout=60) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]&just_die=1' + r = client.run(['-V', proto, url]) + exp_code = 52 # GOT_NOTHING + if proto == 'h2' or proto == 'h3': + exp_code = 0 # we get a 500 from the server + 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']) + def test_07_42c_upload_disconnect(self, env: Env, httpd, nghttpx, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 fails here") + client = LocalClient(name='upload-pausing', env=env, timeout=60) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]&die_after_100=1' + r = client.run(['-V', proto, url]) + exp_code = 52 # GOT_NOTHING + if proto == 'h2' or proto == 'h3': + 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']) + def test_07_43_upload_denied(self, env: Env, httpd, nghttpx, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 fails here") + fdata = os.path.join(env.gen_dir, 'data-10m') + count = 1 + max_upload = 128 * 1024 + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?'\ + f'id=[0-{count-1}]&max_upload={max_upload}' + r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto, + extra_args=['--trace-config', 'all']) + r.check_stats(count=count, http_status=413, exitcode=0) + # 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, repeat): @@ -471,7 +613,7 @@ class TestUpload: count = 1 fdata = os.path.join(env.gen_dir, 'data-100k') up_len = 100 * 1024 - speed_limit = 20 * 1024 + speed_limit = 50 * 1024 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-0]' r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto, @@ -490,7 +632,7 @@ class TestUpload: pytest.skip("h3 not supported") count = 1 fdata = os.path.join(env.gen_dir, 'data-100k') - speed_limit = 20 * 1024 + speed_limit = 50 * 1024 curl = CurlClient(env=env) url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-0]' r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto, @@ -501,3 +643,86 @@ class TestUpload: up_speed = r.stats[0]['speed_upload'] assert (speed_limit * 0.5) <= up_speed <= (speed_limit * 1.5), f'{r.stats[0]}' + # upload larger data, triggering "Expect: 100-continue" code paths + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_07_60_upload_exp100(self, env: Env, httpd, nghttpx, repeat, proto): + fdata = os.path.join(env.gen_dir, 'data-1m+') + read_delay = 1 + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-0]'\ + f'&read_delay={read_delay}s' + r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto, extra_args=[ + '--expect100-timeout', f'{read_delay+1}' + ]) + r.check_stats(count=1, http_status=200, exitcode=0) + + # upload larger data, triggering "Expect: 100-continue" code paths + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_07_61_upload_exp100_timeout(self, env: Env, httpd, nghttpx, repeat, proto): + fdata = os.path.join(env.gen_dir, 'data-1m+') + read_delay = 2 + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/put?id=[0-0]'\ + f'&read_delay={read_delay}s' + r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto, extra_args=[ + '--expect100-timeout', f'{read_delay-1}' + ]) + r.check_stats(count=1, http_status=200, exitcode=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") + @pytest.mark.parametrize("proto,upload_size,exp_early", [ + ['http/1.1', 100, 203], # headers+body + ['http/1.1', 10*1024, 10345], # headers+body + ['http/1.1', 32*1024, 16384], # headers+body, limited by server max + ['h2', 10*1024, 10378], # headers+body + ['h2', 32*1024, 16384], # headers+body, limited by server max + ['h3', 1024, 0], # earlydata not supported + ]) + def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early): + if not env.curl_uses_lib('gnutls'): + pytest.skip('TLS earlydata only implemented in GnuTLS') + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + count = 2 + # we want this test to always connect to nghttpx, since it is + # the only server we have that supports TLS earlydata + port = env.port_for(proto) + if proto != 'h3': + port = env.nghttpx_https_port + url = f'https://{env.domain1}:{port}/curltest/put?id=[0-{count-1}]' + client = LocalClient(name='hx-upload', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', + '-e', # use TLS earlydata + '-f', # forbid reuse of connections + '-l', # announce upload length, no 'Expect: 100' + '-S', f'{upload_size}', + '-r', f'{env.domain1}:{port}:127.0.0.1', + '-V', proto, url + ]) + r.check_exit_code(0) + self.check_downloads(client, [f"{upload_size}"], count) + earlydata = {} + for line in r.trace_lines: + m = re.match(r'^\[t-(\d+)] EarlyData: (\d+)', line) + if m: + earlydata[int(m.group(1))] = int(m.group(2)) + assert earlydata[0] == 0, f'{earlydata}' + assert earlydata[1] == exp_early, f'{earlydata}' + + def check_downloads(self, client, source: List[str], count: int, + complete: bool = True): + for i in range(count): + dfile = client.download_file(i) + assert os.path.exists(dfile) + if complete: + diff = "".join(difflib.unified_diff(a=source, + b=open(dfile).readlines(), + fromfile='-', + tofile=dfile, + n=1)) + assert not diff, f'download {dfile} differs:\n{diff}' diff --git a/deps/curl/tests/http/test_08_caddy.py b/deps/curl/tests/http/test_08_caddy.py index c35bd27b..335f76e6 100644 --- a/deps/curl/tests/http/test_08_caddy.py +++ b/deps/curl/tests/http/test_08_caddy.py @@ -24,18 +24,21 @@ # ########################################################################### # +import difflib +import filecmp import logging import os +import re import pytest -from testenv import Env, CurlClient, Caddy +from testenv import Env, CurlClient, Caddy, LocalClient log = logging.getLogger(__name__) -@pytest.mark.skipif(condition=not Env.has_caddy(), reason=f"missing caddy") -@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") +@pytest.mark.skipif(condition=not Env.has_caddy(), reason="missing caddy") +@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") class TestCaddy: @pytest.fixture(autouse=True, scope='class') @@ -57,10 +60,12 @@ class TestCaddy: @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env, caddy): + self._make_docs_file(docs_dir=caddy.docs_dir, fname='data10k.data', fsize=10*1024) self._make_docs_file(docs_dir=caddy.docs_dir, fname='data1.data', fsize=1024*1024) self._make_docs_file(docs_dir=caddy.docs_dir, fname='data5.data', fsize=5*1024*1024) self._make_docs_file(docs_dir=caddy.docs_dir, fname='data10.data', fsize=10*1024*1024) self._make_docs_file(docs_dir=caddy.docs_dir, fname='data100.data', fsize=100*1024*1024) + 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']) @@ -151,6 +156,9 @@ class TestCaddy: pytest.skip("h3 not supported in curl") if proto == 'h3' and env.curl_uses_lib('msh3'): pytest.skip("msh3 itself crashes") + 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") count = 50 curl = CurlClient(env=env) urln = f'https://{env.domain1}:{caddy.port}/data10.data?[0-{count-1}]' @@ -164,10 +172,9 @@ class TestCaddy: else: assert r.total_connects == 1, r.dump_logs() - # upload data parallel, check that they were echoed - @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs") - @pytest.mark.parametrize("proto", ['h2', 'h3']) - def test_08_06_upload_parallel(self, env: Env, caddy, repeat, 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, repeat, proto): if proto == 'h3' and not env.have_h3(): pytest.skip("h3 not supported") if proto == 'h3' and env.curl_uses_lib('msh3'): @@ -176,7 +183,69 @@ class TestCaddy: count = 20 data = '0123456789' curl = CurlClient(env=env) - url = f'https://{env.domain1}:{caddy.port}/data10.data?[0-{count-1}]' + url = f'https://{env.domain2}:{caddy.port}/curltest/echo?id=[0-{count-1}]' r = curl.http_upload(urls=[url], data=data, alpn_proto=proto, extra_args=['--parallel']) r.check_stats(count=count, http_status=200, exitcode=0) + for i in range(count): + respdata = open(curl.response_file(i)).readlines() + assert respdata == [data] + + # 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, repeat, proto): + if proto == 'h3' and not env.have_h3(): + pytest.skip("h3 not supported") + if proto == 'h3' and env.curl_uses_lib('msh3'): + pytest.skip("msh3 stalls here") + # limit since we use a separate connection in h1< + count = 1 + fdata = os.path.join(env.gen_dir, 'data-10m') + curl = CurlClient(env=env) + url = f'https://{env.domain2}:{caddy.port}/curltest/put?id=[0-{count-1}]' + r = curl.http_put(urls=[url], fdata=fdata, alpn_proto=proto) + exp_data = [f'{os.path.getsize(fdata)}'] + r.check_response(count=count, http_status=200) + for i in range(count): + respdata = open(curl.response_file(i)).readlines() + assert respdata == exp_data + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) + def test_08_08_earlydata(self, env: Env, httpd, caddy, proto): + count = 2 + docname = 'data10k.data' + url = f'https://{env.domain1}:{caddy.port}/{docname}' + client = LocalClient(name='hx-download', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', + '-e', # use TLS earlydata + '-f', # forbid reuse of connections + '-r', f'{env.domain1}:{caddy.port}:127.0.0.1', + '-V', proto, url + ]) + r.check_exit_code(0) + srcfile = os.path.join(caddy.docs_dir, docname) + self.check_downloads(client, srcfile, count) + earlydata = {} + for line in r.trace_lines: + m = re.match(r'^\[t-(\d+)] EarlyData: (\d+)', line) + if m: + earlydata[int(m.group(1))] = int(m.group(2)) + # Caddy does not support early data + assert earlydata[0] == 0, f'{earlydata}' + assert earlydata[1] == 0, f'{earlydata}' + + def check_downloads(self, client, srcfile: str, count: int, + complete: bool = True): + for i in range(count): + dfile = client.download_file(i) + assert os.path.exists(dfile) + if complete and not filecmp.cmp(srcfile, dfile, shallow=False): + diff = "".join(difflib.unified_diff(a=open(srcfile).readlines(), + b=open(dfile).readlines(), + fromfile=srcfile, + tofile=dfile, + n=1)) + assert False, f'download {dfile} differs:\n{diff}' diff --git a/deps/curl/tests/http/test_09_push.py b/deps/curl/tests/http/test_09_push.py index 90074150..6b36d2f2 100644 --- a/deps/curl/tests/http/test_09_push.py +++ b/deps/curl/tests/http/test_09_push.py @@ -45,14 +45,14 @@ class TestPush: env.make_data_file(indir=push_dir, fname="data2", fsize=1*1024) env.make_data_file(indir=push_dir, fname="data3", fsize=1*1024) httpd.set_extra_config(env.domain1, [ - f'H2EarlyHints on', - f'', - f' H2PushResource /push/data2', - f'', - f'', - f' H2PushResource /push/data1', - f' H2PushResource /push/data3', - f'', + 'H2EarlyHints on', + '', + ' H2PushResource /push/data2', + '', + '', + ' H2PushResource /push/data1', + ' H2PushResource /push/data3', + '', ]) # activate the new config httpd.reload() diff --git a/deps/curl/tests/http/test_10_proxy.py b/deps/curl/tests/http/test_10_proxy.py index ad3a5990..2ebf6678 100644 --- a/deps/curl/tests/http/test_10_proxy.py +++ b/deps/curl/tests/http/test_10_proxy.py @@ -51,8 +51,8 @@ class TestProxy: httpd.reload() def get_tunnel_proto_used(self, r: ExecResult): - for l in r.trace_lines: - m = re.match(r'.* CONNECT tunnel: (\S+) negotiated$', l) + for line in r.trace_lines: + m = re.match(r'.* CONNECT tunnel: (\S+) negotiated$', line) if m: return m.group(1) assert False, f'tunnel protocol not found in:\n{"".join(r.trace_lines)}' @@ -82,7 +82,7 @@ class TestProxy: protocol='HTTP/2' if proto == 'h2' else 'HTTP/1.1') # upload via https: with proto (no tunnel) - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) @pytest.mark.parametrize("fname, fcount", [ ['data.json', 5], @@ -132,7 +132,7 @@ class TestProxy: # download https: with proto via http: proxytunnel @pytest.mark.parametrize("proto", ['http/1.1', 'h2']) - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_10_05_proxytunnel_http(self, env: Env, httpd, proto, repeat): curl = CurlClient(env=env) url = f'https://localhost:{env.https_port}/data.json' @@ -165,7 +165,7 @@ class TestProxy: assert filecmp.cmp(srcfile, dfile, shallow=False) # download many https: with proto via https: proxytunnel - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @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("fname, fcount", [ @@ -195,7 +195,7 @@ class TestProxy: assert r.total_connects == 1, r.dump_logs() # upload many https: with proto via https: proxytunnel - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @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("fname, fcount", [ @@ -221,10 +221,10 @@ class TestProxy: indata = open(srcfile).readlines() for i in range(count): respdata = open(curl.response_file(i)).readlines() - assert respdata == indata + assert respdata == indata, f'resonse {i} differs' assert r.total_connects == 1, r.dump_logs() - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") def test_10_09_reuse_ser(self, env: Env, httpd, nghttpx_fwd, tunnel, repeat): @@ -247,7 +247,7 @@ class TestProxy: else: assert r.total_connects == 2 - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) @pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx available") def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel, repeat): @@ -271,7 +271,7 @@ class TestProxy: r2.check_response(count=2, http_status=200) assert r2.total_connects == 1 - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) @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") @@ -291,13 +291,13 @@ class TestProxy: x2_args = r1.args[1:] x2_args.append('--next') x2_args.extend(proxy_args) - x2_args.extend(['--proxy-tls13-ciphers', 'TLS_AES_128_GCM_SHA256']) + x2_args.extend(['--proxy-tls13-ciphers', 'TLS_AES_256_GCM_SHA384']) r2 = curl.http_download(urls=[url], alpn_proto='http/1.1', with_stats=True, extra_args=x2_args) r2.check_response(count=2, http_status=200) assert r2.total_connects == 2 - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) @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") @@ -317,13 +317,13 @@ class TestProxy: x2_args = r1.args[1:] x2_args.append('--next') x2_args.extend(proxy_args) - x2_args.extend(['--proxy-tls13-ciphers', 'TLS_AES_128_GCM_SHA256']) + x2_args.extend(['--proxy-tls13-ciphers', 'TLS_AES_256_GCM_SHA384']) r2 = curl.http_download(urls=[url], alpn_proto='http/1.1', with_stats=True, extra_args=x2_args) r2.check_response(count=2, http_status=200) assert r2.total_connects == 2 - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") @pytest.mark.parametrize("tunnel", ['http/1.1', 'h2']) @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") @@ -343,7 +343,7 @@ class TestProxy: x2_args = r1.args[1:] x2_args.append('--next') x2_args.extend(proxy_args) - x2_args.extend(['--tls13-ciphers', 'TLS_AES_128_GCM_SHA256']) + x2_args.extend(['--tls13-ciphers', 'TLS_AES_256_GCM_SHA384']) r2 = curl.http_download(urls=[url], alpn_proto='http/1.1', with_stats=True, extra_args=x2_args) r2.check_response(count=2, http_status=200) @@ -362,6 +362,9 @@ class TestProxy: xargs = curl.get_proxy_args(proto=proto, use_ip=True) r = curl.http_download(urls=[url], alpn_proto='http/1.1', with_stats=True, extra_args=xargs) - r.check_response(count=1, http_status=200, - protocol='HTTP/2' if proto == 'h2' else 'HTTP/1.1') - + if env.curl_uses_lib('mbedtls') and \ + not env.curl_lib_version_at_least('mbedtls', '3.5.0'): + r.check_exit_code(60) # CURLE_PEER_FAILED_VERIFICATION + else: + r.check_response(count=1, http_status=200, + protocol='HTTP/2' if proto == 'h2' else 'HTTP/1.1') diff --git a/deps/curl/tests/http/test_11_unix.py b/deps/curl/tests/http/test_11_unix.py index dc2684ad..1fe56927 100644 --- a/deps/curl/tests/http/test_11_unix.py +++ b/deps/curl/tests/http/test_11_unix.py @@ -28,6 +28,8 @@ import logging import os import socket from threading import Thread +from typing import Generator + import pytest from testenv import Env, CurlClient @@ -40,6 +42,7 @@ class UDSFaker: def __init__(self, path): self._uds_path = path self._done = False + self._socket = None @property def path(self): @@ -69,7 +72,7 @@ class UDSFaker: try: c, client_address = self._socket.accept() try: - data = c.recv(16) + c.recv(16) c.sendall("""HTTP/1.1 200 Ok Server: UdsFaker Content-Type: application/json @@ -81,19 +84,21 @@ Content-Length: 19 except ConnectionAbortedError: self._done = True + except OSError: + self._done = True class TestUnix: @pytest.fixture(scope="class") - def uds_faker(self, env: Env) -> UDSFaker: + def uds_faker(self, env: Env) -> Generator[UDSFaker, None, None]: uds_path = os.path.join(env.gen_dir, 'uds_11.sock') faker = UDSFaker(path=uds_path) faker.start() yield faker faker.stop() - # download http: via unix socket + # download http: via Unix socket def test_11_01_unix_connect_http(self, env: Env, httpd, uds_faker, repeat): curl = CurlClient(env=env) url = f'http://{env.domain1}:{env.http_port}/data.json' @@ -103,8 +108,8 @@ class TestUnix: ]) r.check_response(count=1, http_status=200) - # download https: via unix socket - @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") + # download https: via Unix socket + @pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") def test_11_02_unix_connect_http(self, env: Env, httpd, uds_faker, repeat): curl = CurlClient(env=env) url = f'https://{env.domain1}:{env.https_port}/data.json' @@ -114,7 +119,7 @@ class TestUnix: ]) r.check_response(exitcode=35, http_status=None) - # download HTTP/3 via unix socket + # download HTTP/3 via Unix socket @pytest.mark.skipif(condition=not Env.have_h3(), reason='h3 not supported') def test_11_03_unix_connect_quic(self, env: Env, httpd, uds_faker, repeat): curl = CurlClient(env=env) diff --git a/deps/curl/tests/http/test_12_reuse.py b/deps/curl/tests/http/test_12_reuse.py index 83bfadfe..9252f247 100644 --- a/deps/curl/tests/http/test_12_reuse.py +++ b/deps/curl/tests/http/test_12_reuse.py @@ -24,10 +24,9 @@ # ########################################################################### # -import difflib -import filecmp import logging import os +from datetime import datetime, timedelta import pytest from testenv import Env, CurlClient @@ -36,8 +35,7 @@ from testenv import Env, CurlClient log = logging.getLogger(__name__) -@pytest.mark.skipif(condition=Env.curl_uses_lib('bearssl'), reason='BearSSL too slow') -@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason=f"curl without SSL") +@pytest.mark.skipif(condition=not Env.have_ssl_curl(), reason="curl without SSL") class TestReuse: # check if HTTP/1.1 handles 'Connection: close' correctly @@ -46,7 +44,7 @@ class TestReuse: httpd, nghttpx, repeat, proto): httpd.clear_extra_configs() httpd.set_extra_config('base', [ - f'MaxKeepAliveRequests 1', + 'MaxKeepAliveRequests 1', ]) httpd.reload() count = 100 @@ -59,12 +57,14 @@ class TestReuse: delta = 5 assert (count/2 - delta) < r.total_connects < (count/2 + delta) + @pytest.mark.skipif(condition=Env.httpd_is_at_least('2.5.0'), + reason="httpd 2.5+ handles KeepAlives different") @pytest.mark.parametrize("proto", ['http/1.1']) def test_12_02_h1_conn_timeout(self, env: Env, httpd, nghttpx, repeat, proto): httpd.clear_extra_configs() httpd.set_extra_config('base', [ - f'KeepAliveTimeout 1', + 'KeepAliveTimeout 1', ]) httpd.reload() count = 5 @@ -76,3 +76,72 @@ class TestReuse: 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_alt_svc_h2h3(self, env: Env, httpd, nghttpx): + httpd.clear_extra_configs() + httpd.reload() + count = 2 + # write a alt-svc file the advises h3 instead of h2 + asfile = os.path.join(env.gen_dir, 'alt-svc-12_03.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'h2 {env.domain1} {env.https_port} h3 {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, "h2")}/data.json?[0-{count-1}]' + r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ + '--alt-svc', f'{asfile}', + ]) + r.check_response(count=count, http_status=200) + # We expect the connection to be reused + assert r.total_connects == 1 + for s in r.stats: + assert s['http_version'] == '3', f'{s}' + + def test_12_04_alt_svc_h3h2(self, env: Env, httpd, nghttpx): + httpd.clear_extra_configs() + httpd.reload() + count = 2 + # write a 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, "h2")}/data.json?[0-{count-1}]' + r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ + '--alt-svc', f'{asfile}', + ]) + r.check_response(count=count, http_status=200) + # We expect the connection to be reused + assert r.total_connects == 1 + for s in r.stats: + assert s['http_version'] == '2', f'{s}' + + def test_12_05_alt_svc_h3h1(self, env: Env, httpd, nghttpx): + httpd.clear_extra_configs() + httpd.reload() + count = 2 + # write a 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, "h2")}/data.json?[0-{count-1}]' + r = curl.http_download(urls=[urln], with_stats=True, extra_args=[ + '--alt-svc', f'{asfile}', + ]) + r.check_response(count=count, http_status=200) + # We expect the connection to be reused + assert r.total_connects == 1 + # When using http/1.1 from alt-svc, we ALPN-negotiate 'h2,http/1.1' anyway + # which means our server gives us h2 + for s in r.stats: + assert s['http_version'] == '2', f'{s}' diff --git a/deps/curl/tests/http/test_13_proxy_auth.py b/deps/curl/tests/http/test_13_proxy_auth.py index abeae010..0979fbb7 100644 --- a/deps/curl/tests/http/test_13_proxy_auth.py +++ b/deps/curl/tests/http/test_13_proxy_auth.py @@ -24,11 +24,8 @@ # ########################################################################### # -import filecmp import logging -import os import re -import time import pytest from testenv import Env, CurlClient, ExecResult diff --git a/deps/curl/tests/http/test_14_auth.py b/deps/curl/tests/http/test_14_auth.py index b90817b6..8fa6767b 100644 --- a/deps/curl/tests/http/test_14_auth.py +++ b/deps/curl/tests/http/test_14_auth.py @@ -24,13 +24,11 @@ # ########################################################################### # -import difflib -import filecmp import logging import os import pytest -from testenv import Env, CurlClient, LocalClient +from testenv import Env, CurlClient log = logging.getLogger(__name__) diff --git a/deps/curl/tests/http/test_16_info.py b/deps/curl/tests/http/test_16_info.py new file mode 100644 index 00000000..06ab9503 --- /dev/null +++ b/deps/curl/tests/http/test_16_info.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import logging +import os +import pytest + +from testenv import Env, CurlClient + + +log = logging.getLogger(__name__) + + +class TestInfo: + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, httpd, nghttpx): + if env.have_h3(): + nghttpx.start_if_needed() + httpd.clear_extra_configs() + httpd.reload() + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, httpd): + indir = httpd.docs_dir + 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) + + # download plain file + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_16_01_info_download(self, env: Env, httpd, nghttpx, repeat, proto): + 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}]' + r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True) + r.check_stats(count=count, http_status=200, exitcode=0, + remote_port=env.port_for(alpn_proto=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) + + # 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, repeat, proto): + 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}]' + r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True, extra_args=[ + '--location' + ]) + r.check_stats(count=count, http_status=200, exitcode=0, + remote_port=env.port_for(alpn_proto=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) + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_16_03_info_upload(self, env: Env, httpd, nghttpx, proto, repeat): + 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 + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/echo?id=[0-{count-1}]' + r = curl.http_upload(urls=[url], data=f'@{fdata}', alpn_proto=proto, + with_headers=True, extra_args=[ + '--trace-config', 'http/2,http/3' + ]) + r.check_response(count=count, http_status=200) + r.check_stats(count=count, http_status=200, exitcode=0, + remote_port=env.port_for(alpn_proto=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) + + # download plain file via http: ('time_appconnect' is 0) + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_16_04_info_http_download(self, env: Env, httpd, nghttpx, repeat, proto): + count = 2 + curl = CurlClient(env=env) + url = f'http://{env.domain1}:{env.http_port}/data.json?[0-{count-1}]' + r = curl.http_download(urls=[url], alpn_proto=proto, with_stats=True) + r.check_stats(count=count, http_status=200, exitcode=0, + 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) + + 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 + self.check_stat_positive(s, idx, 'size_header') + if ul_size is not None: + assert s['size_upload'] == ul_size, f'stat #{idx}\n{r.dump_logs()}' # the file we sent + assert s['size_request'] >= s['size_upload'], \ + f'stat #{idx}, "size_request" smaller than "size_upload", {s}\n{r.dump_logs()}' + if dl_size is not None: + assert s['size_download'] == dl_size, f'stat #{idx}\n{r.dump_logs()}' # the file we received + + 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_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'] + # all stat keys which reporting timings + all_keys = { + 'time_appconnect', 'time_connect', 'time_redirect', + 'time_pretransfer', 'time_starttransfer', 'time_total' + } + # stat keys where we expect a positive value + pos_keys = {'time_pretransfer', 'time_starttransfer', 'time_total'} + if s['num_connects'] > 0: + pos_keys.add('time_connect') + 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 start is after pretransfer + assert s['time_pretransfer'] <= s['time_starttransfer'], f'"time_pretransfer" '\ + f'greater than "time_starttransfer", {s}' + # assert that transfer start is before total + assert s['time_starttransfer'] <= s['time_total'], f'"time_starttransfer" '\ + f'greater than "time_total", {s}' diff --git a/deps/curl/tests/http/test_17_ssl_use.py b/deps/curl/tests/http/test_17_ssl_use.py new file mode 100644 index 00000000..f129b110 --- /dev/null +++ b/deps/curl/tests/http/test_17_ssl_use.py @@ -0,0 +1,368 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import json +import logging +import os +import re +import pytest + +from testenv import Env, CurlClient, LocalClient + + +log = logging.getLogger(__name__) + + +class TestSSLUse: + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, httpd, nghttpx): + env.make_data_file(indir=httpd.docs_dir, fname="data-10k", fsize=10*1024) + if env.have_h3(): + nghttpx.start_if_needed() + + @pytest.fixture(autouse=True, scope='function') + def _function_scope(self, request, env, httpd): + httpd.clear_extra_configs() + if 'httpd' not in request.node._fixtureinfo.argnames: + httpd.reload_if_config_changed() + + def test_17_01_sslinfo_plain(self, env: Env, nghttpx, repeat): + 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) + assert r.json['HTTPS'] == 'on', f'{r.json}' + assert 'SSL_SESSION_ID' in r.json, f'{r.json}' + assert 'SSL_SESSION_RESUMED' in r.json, f'{r.json}' + assert r.json['SSL_SESSION_RESUMED'] == 'Initial', f'{r.json}' + + @pytest.mark.parametrize("tls_max", ['1.2', '1.3']) + def test_17_02_sslinfo_reconnect(self, env: Env, tls_max): + proto = 'http/1.1' + count = 3 + exp_resumed = 'Resumed' + xargs = ['--sessionid', '--tls-max', tls_max, f'--tlsv{tls_max}'] + if env.curl_uses_lib('libressl'): + if tls_max == '1.3': + exp_resumed = 'Initial' # 1.2 works in LibreSSL, but 1.3 does not, TODO + if env.curl_uses_lib('rustls-ffi'): + exp_resumed = 'Initial' # Rustls does not support sessions, TODO + if env.curl_uses_lib('bearssl') and tls_max == '1.3': + pytest.skip('BearSSL does not support TLSv1.3') + if env.curl_uses_lib('mbedtls') and tls_max == '1.3' and \ + not env.curl_lib_version_at_least('mbedtls', '3.6.0'): + pytest.skip('mbedtls TLSv1.3 session resume not working in 3.6.0') + + run_env = os.environ.copy() + run_env['CURL_DEBUG'] = 'ssl' + curl = CurlClient(env=env, run_env=run_env) + # tell the server to close the connection after each request + urln = f'https://{env.authority_for(env.domain1, proto)}/curltest/sslinfo?'\ + f'id=[0-{count-1}]&close' + r = curl.http_download(urls=[urln], alpn_proto=proto, with_stats=True, + extra_args=xargs) + r.check_response(count=count, http_status=200) + # should have used one connection for each request, sessions after + # first should have been resumed + assert r.total_connects == count, r.dump_logs() + for i in range(count): + dfile = curl.download_file(i) + assert os.path.exists(dfile) + with open(dfile) as f: + djson = json.load(f) + assert djson['HTTPS'] == 'on', f'{i}: {djson}' + if i == 0: + assert djson['SSL_SESSION_RESUMED'] == 'Initial', f'{i}: {djson}\n{r.dump_logs()}' + else: + 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']) + def test_17_03_trailing_dot(self, env: Env, proto): + 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' + r = curl.http_get(url=url, alpn_proto=proto) + assert r.exit_code == 0, f'{r}' + assert r.json, f'{r}' + if proto != 'h3': # we proxy h3 + # 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 + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_17_04_double_dot(self, env: Env, proto): + 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' + r = curl.http_get(url=url, alpn_proto=proto, extra_args=[ + '-H', f'Host: {env.domain1}', + ]) + if r.exit_code == 0: + assert r.json, f'{r.stdout}' + # the SNI the server received is without trailing dot + if proto != 'h3': # we proxy h3 + assert r.json['SSL_TLS_SNI'] == env.domain1, f'{r.json}' + assert False, f'should not have succeeded: {r.json}' + # 7 - Rustls rejects a servername with .. during setup + # 35 - LibreSSL rejects setting an SNI name with trailing dot + # 60 - peer name matching failed against certificate + assert r.exit_code in [7, 35, 60], f'{r}' + + # use ip address for connect + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_17_05_ip_addr(self, env: Env, proto): + if env.curl_uses_lib('bearssl'): + pytest.skip("BearSSL does not support cert verification with IP addresses") + if env.curl_uses_lib('mbedtls'): + pytest.skip("mbedTLS does use IP addresses in SNI") + 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' + r = curl.http_get(url=url, alpn_proto=proto) + assert r.exit_code == 0, f'{r}' + assert r.json, f'{r}' + if proto != 'h3': # we proxy h3 + # the SNI should not have been used + assert 'SSL_TLS_SNI' not in r.json, f'{r.json}' + + # use localhost for connect + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_17_06_localhost(self, env: Env, proto): + 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' + r = curl.http_get(url=url, alpn_proto=proto) + assert r.exit_code == 0, f'{r}' + assert r.json, f'{r}' + if proto != 'h3': # we proxy h3 + assert r.json['SSL_TLS_SNI'] == domain, f'{r.json}' + + @staticmethod + def gen_test_17_07_list(): + tls13_tests = [ + [None, True], + [['TLS_AES_128_GCM_SHA256'], True], + [['TLS_AES_256_GCM_SHA384'], False], + [['TLS_CHACHA20_POLY1305_SHA256'], True], + [['TLS_AES_256_GCM_SHA384', + 'TLS_CHACHA20_POLY1305_SHA256'], True], + ] + tls12_tests = [ + [None, True], + [['ECDHE-ECDSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-GCM-SHA256'], True], + [['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384'], False], + [['ECDHE-ECDSA-CHACHA20-POLY1305', 'ECDHE-RSA-CHACHA20-POLY1305'], True], + [['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384', + 'ECDHE-ECDSA-CHACHA20-POLY1305', 'ECDHE-RSA-CHACHA20-POLY1305'], True], + ] + ret = [] + for tls_proto in ['TLSv1.3 +TLSv1.2', 'TLSv1.3', 'TLSv1.2']: + for [ciphers13, succeed13] in tls13_tests: + for [ciphers12, succeed12] in tls12_tests: + ret.append([tls_proto, ciphers13, ciphers12, succeed13, succeed12]) + return ret + + @pytest.mark.parametrize("tls_proto, ciphers13, ciphers12, succeed13, succeed12", gen_test_17_07_list()) + def test_17_07_ssl_ciphers(self, env: Env, httpd, tls_proto, ciphers13, ciphers12, succeed13, succeed12): + # to test setting cipher suites, the AES 256 ciphers are disabled in the test server + httpd.set_extra_config('base', [ + 'SSLCipherSuite SSL' + ' ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256' + ':ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305', + 'SSLCipherSuite TLSv1.3' + ' TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256', + f'SSLProtocol {tls_proto}' + ]) + httpd.reload_if_config_changed() + proto = 'http/1.1' + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/sslinfo' + # SSL backend specifics + if env.curl_uses_lib('gnutls'): + pytest.skip('GnuTLS does not support setting ciphers') + elif env.curl_uses_lib('boringssl'): + if ciphers13 is not None: + pytest.skip('BoringSSL does not support setting TLSv1.3 ciphers') + elif env.curl_uses_lib('schannel'): # not in CI, so untested + if ciphers12 is not None: + pytest.skip('Schannel does not support setting TLSv1.2 ciphers by name') + elif env.curl_uses_lib('bearssl'): + if tls_proto == 'TLSv1.3': + pytest.skip('BearSSL does not support TLSv1.3') + tls_proto = 'TLSv1.2' + elif env.curl_uses_lib('mbedtls') and not env.curl_lib_version_at_least('mbedtls', '3.6.0'): + if tls_proto == 'TLSv1.3': + pytest.skip('mbedTLS < 3.6.0 does not support TLSv1.3') + elif env.curl_uses_lib('sectransp'): # not in CI, so untested + if tls_proto == 'TLSv1.3': + pytest.skip('Secure Transport does not support TLSv1.3') + tls_proto = 'TLSv1.2' + # test + extra_args = ['--tls13-ciphers', ':'.join(ciphers13)] if ciphers13 else [] + extra_args += ['--ciphers', ':'.join(ciphers12)] if ciphers12 else [] + r = curl.http_get(url=url, alpn_proto=proto, extra_args=extra_args) + if tls_proto != 'TLSv1.2' and succeed13: + assert r.exit_code == 0, r.dump_logs() + assert r.json['HTTPS'] == 'on', r.dump_logs() + assert r.json['SSL_PROTOCOL'] == 'TLSv1.3', r.dump_logs() + assert ciphers13 is None or r.json['SSL_CIPHER'] in ciphers13, r.dump_logs() + elif tls_proto == 'TLSv1.2' and succeed12: + assert r.exit_code == 0, r.dump_logs() + assert r.json['HTTPS'] == 'on', r.dump_logs() + assert r.json['SSL_PROTOCOL'] == 'TLSv1.2', r.dump_logs() + assert ciphers12 is None or r.json['SSL_CIPHER'] in ciphers12, r.dump_logs() + else: + assert r.exit_code != 0, r.dump_logs() + + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_17_08_cert_status(self, env: Env, proto): + 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'): + pytest.skip("TLS library does not support --cert-status") + curl = CurlClient(env=env) + domain = 'localhost' + url = f'https://{env.authority_for(domain, proto)}/' + r = curl.http_get(url=url, alpn_proto=proto, extra_args=[ + '--cert-status' + ]) + # CURLE_SSL_INVALIDCERTSTATUS, our certs have no OCSP info + assert r.exit_code == 91, f'{r}' + + @staticmethod + def gen_test_17_09_list(): + return [[tls_proto, max_ver, min_ver] + for tls_proto in ['TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3'] + for max_ver in range(5) + for min_ver in range(-2, 4)] + + @pytest.mark.parametrize("tls_proto, max_ver, min_ver", gen_test_17_09_list()) + def test_17_09_ssl_min_max(self, env: Env, httpd, tls_proto, max_ver, min_ver): + httpd.set_extra_config('base', [ + f'SSLProtocol {tls_proto}', + 'SSLCipherSuite ALL:@SECLEVEL=0', + ]) + httpd.reload_if_config_changed() + proto = 'http/1.1' + run_env = os.environ.copy() + if env.curl_uses_lib('gnutls'): + # we need to override any default system configuration since + # we want to test all protocol versions. Ubuntu (or the GH image) + # disable TSL1.0 and TLS1.1 system wide. We do not want. + our_config = os.path.join(env.gen_dir, 'gnutls_config') + if not os.path.exists(our_config): + with open(our_config, 'w') as fd: + fd.write('# empty\n') + run_env['GNUTLS_SYSTEM_PRIORITY_FILE'] = our_config + curl = CurlClient(env=env, run_env=run_env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/sslinfo' + # SSL backend specifics + if env.curl_uses_lib('bearssl'): + supported = ['TLSv1', 'TLSv1.1', 'TLSv1.2', None] + elif env.curl_uses_lib('sectransp'): # not in CI, so untested + supported = ['TLSv1', 'TLSv1.1', 'TLSv1.2', None] + elif env.curl_uses_lib('gnutls'): + supported = ['TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3'] + elif env.curl_uses_lib('quiche'): + supported = ['TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3'] + else: # most SSL backends dropped support for TLSv1.0, TLSv1.1 + supported = [None, None, 'TLSv1.2', 'TLSv1.3'] + # test + extra_args = [[], ['--tlsv1'], ['--tlsv1.0'], ['--tlsv1.1'], ['--tlsv1.2'], ['--tlsv1.3']][min_ver+2] + \ + [['--tls-max', '1.0'], ['--tls-max', '1.1'], ['--tls-max', '1.2'], ['--tls-max', '1.3'], []][max_ver] + extra_args.extend(['--trace-config', 'ssl']) + r = curl.http_get(url=url, alpn_proto=proto, extra_args=extra_args) + if max_ver >= min_ver and tls_proto in supported[max(0, min_ver):min(max_ver, 3)+1]: + assert r.exit_code == 0, f'extra_args={extra_args}\n{r.dump_logs()}' + assert r.json['HTTPS'] == 'on', r.dump_logs() + assert r.json['SSL_PROTOCOL'] == tls_proto, r.dump_logs() + else: + assert r.exit_code != 0, f'extra_args={extra_args}\n{r.dump_logs()}' + + def test_17_10_h3_session_reuse(self, env: Env, httpd, nghttpx): + if not env.have_h3(): + pytest.skip("h3 not supported") + if not env.curl_uses_lib('quictls') and \ + not env.curl_uses_lib('gnutls') and \ + not env.curl_uses_lib('wolfssl'): + pytest.skip("QUIC session reuse not implemented") + count = 2 + docname = 'data-10k' + url = f'https://localhost:{env.https_port}/{docname}' + client = LocalClient(name='hx-download', env=env) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', + '-f', # forbid reuse of connections + '-r', f'{env.domain1}:{env.port_for("h3")}:127.0.0.1', + '-V', 'h3', url + ]) + r.check_exit_code(0) + # check that TLS session was reused as expected + reused_session = False + for line in r.trace_lines: + m = re.match(r'\[1-1] \* SSL reusing session.*', line) + if m: + reused_session = True + 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']) + def test_17_11_wrong_host(self, env: Env, proto): + 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' + 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 + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_17_12_insecure(self, env: Env, proto): + 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' + r = curl.http_get(url=url, alpn_proto=proto, extra_args=[ + '--insecure' + ]) + assert r.exit_code == 0, f'{r}' + assert r.json, f'{r}' diff --git a/deps/curl/tests/http/test_18_methods.py b/deps/curl/tests/http/test_18_methods.py new file mode 100644 index 00000000..f9399db4 --- /dev/null +++ b/deps/curl/tests/http/test_18_methods.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import logging +import pytest + +from testenv import Env, CurlClient + + +log = logging.getLogger(__name__) + + +class TestMethods: + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, httpd, nghttpx): + if env.have_h3(): + nghttpx.start_if_needed() + httpd.clear_extra_configs() + httpd.reload_if_config_changed() + indir = httpd.docs_dir + 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) + + # download 1 file + @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) + def test_18_01_delete(self, env: Env, httpd, nghttpx, repeat, proto): + 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}]' + r = curl.http_delete(urls=[url], alpn_proto=proto) + r.check_stats(count=count, http_status=204, exitcode=0) + + # make HTTP/2 in the server send + # - HEADER frame with 204 and eos=0 + # - 10ms later DATA frame length=0 and eos=1 + # should be accepted + def test_18_02_delete_h2_special(self, env: Env, httpd, nghttpx, repeat): + proto = 'h2' + count = 1 + curl = CurlClient(env=env) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak?id=[0-{count-1}]'\ + '&chunks=1&chunk_size=0&chunk_delay=10ms' + r = curl.http_delete(urls=[url], alpn_proto=proto) + r.check_stats(count=count, http_status=204, exitcode=0) diff --git a/deps/curl/tests/http/test_19_shutdown.py b/deps/curl/tests/http/test_19_shutdown.py new file mode 100644 index 00000000..bbb67d36 --- /dev/null +++ b/deps/curl/tests/http/test_19_shutdown.py @@ -0,0 +1,175 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import logging +import re +import pytest + +from testenv import Env, CurlClient, LocalClient + + +log = logging.getLogger(__name__) + + +class TestShutdown: + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, httpd, nghttpx): + if env.have_h3(): + nghttpx.start_if_needed() + httpd.clear_extra_configs() + httpd.reload() + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, httpd): + indir = httpd.docs_dir + 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) + + # check with `tcpdump` that we see curl TCP RST packets + @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_19_01_check_tcp_rst(self, env: Env, httpd, repeat, proto): + if env.ci_run: + pytest.skip("seems not to work in CI") + 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, with_tcpdump=True, extra_args=[ + '--parallel' + ]) + r.check_response(http_status=200, count=2) + assert r.tcpdump + assert len(r.tcpdump.stats) != 0, f'Expected TCP RSTs packets: {r.tcpdump.stderr}' + + # 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']) + def test_19_02_check_shutdown(self, env: Env, httpd, repeat, proto): + if not env.curl_is_debug(): + pytest.skip('only works for curl debug builds') + curl = CurlClient(env=env, run_env={ + 'CURL_GRACEFUL_SHUTDOWN': '2000', + 'CURL_DEBUG': 'ssl,tcp' + }) + url = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-1]' + r = curl.http_download(urls=[url], alpn_proto=proto, with_tcpdump=True, extra_args=[ + '--parallel' + ]) + r.check_response(http_status=200, count=2) + assert r.tcpdump + assert len(r.tcpdump.stats) == 0, 'Unexpected TCP RSTs packets' + + # run downloads where the server closes the connection after each request + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_19_03_shutdown_by_server(self, env: Env, httpd, repeat, proto): + if not env.curl_is_debug(): + pytest.skip('only works for curl debug builds') + count = 10 + curl = CurlClient(env=env, run_env={ + 'CURL_GRACEFUL_SHUTDOWN': '2000', + 'CURL_DEBUG': 'ssl' + }) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak/?'\ + f'id=[0-{count-1}]&with_cl&close' + r = curl.http_download(urls=[url], alpn_proto=proto) + r.check_response(http_status=200, count=count) + shutdowns = [line for line in r.trace_lines + if re.match(r'.*CCACHE\] shutdown #\d+, done=1', line)] + assert len(shutdowns) == count, f'{shutdowns}' + + # run downloads with CURLOPT_FORBID_REUSE set, meaning *we* close + # the connection after each request + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_19_04_shutdown_by_curl(self, env: Env, httpd, proto, repeat): + if not env.curl_is_debug(): + pytest.skip('only works for curl debug builds') + count = 10 + docname = 'data.json' + url = f'https://localhost:{env.https_port}/{docname}' + client = LocalClient(name='hx-download', env=env, run_env={ + 'CURL_GRACEFUL_SHUTDOWN': '2000', + 'CURL_DEBUG': 'ssl' + }) + if not client.exists(): + pytest.skip(f'example client not built: {client.name}') + r = client.run(args=[ + '-n', f'{count}', '-f', '-V', proto, url + ]) + r.check_exit_code(0) + shutdowns = [line for line in r.trace_lines + if re.match(r'.*CCACHE\] shutdown #\d+, done=1', line)] + assert len(shutdowns) == count, f'{shutdowns}' + + # run event-based downloads with CURLOPT_FORBID_REUSE set, meaning *we* close + # the connection after each request + @pytest.mark.parametrize("proto", ['http/1.1']) + def test_19_05_event_shutdown_by_server(self, env: Env, httpd, proto, repeat): + if not env.curl_is_debug(): + pytest.skip('only works for curl debug builds') + count = 10 + curl = CurlClient(env=env, run_env={ + # forbid connection reuse to trigger shutdowns after transfer + 'CURL_FORBID_REUSE': '1', + # make socket receives block 50% of the time to delay shutdown + 'CURL_DBG_SOCK_RBLOCK': '50', + 'CURL_DEBUG': 'ssl' + }) + url = f'https://{env.authority_for(env.domain1, proto)}/curltest/tweak/?'\ + f'id=[0-{count-1}]&with_cl&' + r = curl.http_download(urls=[url], alpn_proto=proto, extra_args=[ + '--test-event' + ]) + r.check_response(http_status=200, count=count) + # check that we closed all connections + closings = [line for line in r.trace_lines + if re.match(r'.*CCACHE\] closing #\d+', line)] + assert len(closings) == count, f'{closings}' + # check that all connection sockets were removed from event + removes = [line for line in r.trace_lines + if re.match(r'.*socket cb: socket \d+ REMOVED', line)] + assert len(removes) == count, f'{removes}' + + # check graceful shutdown on multiplexed http + @pytest.mark.parametrize("proto", ['h2', 'h3']) + def test_19_06_check_shutdown(self, env: Env, httpd, nghttpx, repeat, proto): + 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') + curl = CurlClient(env=env, run_env={ + 'CURL_GRACEFUL_SHUTDOWN': '2000', + 'CURL_DEBUG': 'all' + }) + url = f'https://{env.authority_for(env.domain1, proto)}/data.json?[0-1]' + r = curl.http_download(urls=[url], alpn_proto=proto, with_tcpdump=True, extra_args=[ + '--parallel' + ]) + r.check_response(http_status=200, count=2) + # check connection cache closings + shutdowns = [line for line in r.trace_lines + if re.match(r'.*CCACHE\] shutdown #\d+, done=1', line)] + assert len(shutdowns) == 1, f'{shutdowns}' diff --git a/deps/curl/tests/http/test_30_vsftpd.py b/deps/curl/tests/http/test_30_vsftpd.py new file mode 100644 index 00000000..238184c2 --- /dev/null +++ b/deps/curl/tests/http/test_30_vsftpd.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import difflib +import filecmp +import logging +import os +import shutil +import pytest + +from testenv import Env, CurlClient, VsFTPD + + +log = logging.getLogger(__name__) + + +@pytest.mark.skipif(condition=not Env.has_vsftpd(), reason="missing vsftpd") +class TestVsFTPD: + + @pytest.fixture(autouse=True, scope='class') + def vsftpd(self, env): + vsftpd = VsFTPD(env=env) + assert vsftpd.start() + yield vsftpd + vsftpd.stop() + + def _make_docs_file(self, docs_dir: str, fname: str, fsize: int): + fpath = os.path.join(docs_dir, fname) + data1k = 1024*'x' + flen = 0 + with open(fpath, 'w') as fd: + while flen < fsize: + fd.write(data1k) + flen += len(data1k) + return flen + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, vsftpd): + if os.path.exists(vsftpd.docs_dir): + 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-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-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) + + def test_30_01_list_dir(self, env: Env, vsftpd: VsFTPD, repeat): + curl = CurlClient(env=env) + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/' + 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}' + + # download 1 file, no SSL + @pytest.mark.parametrize("docname", [ + 'data-1k', 'data-1m', 'data-10m' + ]) + def test_30_02_download_1(self, env: Env, vsftpd: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpd.docs_dir, f'{docname}') + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/{docname}?[0-{count-1}]' + r = curl.ftp_get(urls=[url], with_stats=True) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + @pytest.mark.parametrize("docname", [ + 'data-1k', 'data-1m', 'data-10m' + ]) + def test_30_03_download_10_serial(self, env: Env, vsftpd: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpd.docs_dir, f'{docname}') + count = 10 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/{docname}?[0-{count-1}]' + r = curl.ftp_get(urls=[url], with_stats=True) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + @pytest.mark.parametrize("docname", [ + 'data-1k', 'data-1m', 'data-10m' + ]) + def test_30_04_download_10_parallel(self, env: Env, vsftpd: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpd.docs_dir, f'{docname}') + count = 10 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/{docname}?[0-{count-1}]' + r = curl.ftp_get(urls=[url], with_stats=True, extra_args=[ + '--parallel' + ]) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + @pytest.mark.parametrize("docname", [ + 'upload-1k', 'upload-100k', 'upload-1m' + ]) + def test_30_05_upload_1(self, env: Env, vsftpd: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpd.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/' + 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) + + def _rmf(self, path): + if os.path.exists(path): + return os.remove(path) + + # check with `tcpdump` if curl causes any TCP RST packets + @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") + def test_30_06_shutdownh_download(self, env: Env, vsftpd: VsFTPD, repeat): + docname = 'data-1k' + curl = CurlClient(env=env) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/{docname}?[0-{count-1}]' + r = curl.ftp_get(urls=[url], with_stats=True, with_tcpdump=True) + r.check_stats(count=count, http_status=226) + assert r.tcpdump + assert len(r.tcpdump.stats) == 0, 'Unexpected TCP RSTs packets' + + # check with `tcpdump` if curl causes any TCP RST packets + @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") + def test_30_07_shutdownh_upload(self, env: Env, vsftpd: VsFTPD, repeat): + docname = 'upload-1k' + curl = CurlClient(env=env) + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpd.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/' + r = curl.ftp_upload(urls=[url], fupload=f'{srcfile}', with_stats=True, with_tcpdump=True) + r.check_stats(count=count, http_status=226) + assert r.tcpdump + assert len(r.tcpdump.stats) == 0, 'Unexpected TCP RSTs packets' + + def test_30_08_active_download(self, env: Env, vsftpd: VsFTPD): + docname = 'data-10k' + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpd.docs_dir, f'{docname}') + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/{docname}?[0-{count-1}]' + r = curl.ftp_get(urls=[url], with_stats=True, extra_args=[ + '--ftp-port', '127.0.0.1' + ]) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + def test_30_09_active_upload(self, env: Env, vsftpd: VsFTPD): + docname = 'upload-1k' + curl = CurlClient(env=env) + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpd.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpd.port}/' + r = curl.ftp_upload(urls=[url], fupload=f'{srcfile}', with_stats=True, extra_args=[ + '--ftp-port', '127.0.0.1' + ]) + r.check_stats(count=count, http_status=226) + self.check_upload(env, vsftpd, docname=docname) + + def check_downloads(self, client, srcfile: str, count: int, + complete: bool = True): + for i in range(count): + dfile = client.download_file(i) + assert os.path.exists(dfile) + if complete and not filecmp.cmp(srcfile, dfile, shallow=False): + diff = "".join(difflib.unified_diff(a=open(srcfile).readlines(), + b=open(dfile).readlines(), + fromfile=srcfile, + tofile=dfile, + n=1)) + assert False, f'download {dfile} differs:\n{diff}' + + def check_upload(self, env, vsftpd: VsFTPD, docname): + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpd.docs_dir, docname) + assert os.path.exists(srcfile) + assert os.path.exists(dstfile) + if not filecmp.cmp(srcfile, dstfile, shallow=False): + diff = "".join(difflib.unified_diff(a=open(srcfile).readlines(), + b=open(dstfile).readlines(), + fromfile=srcfile, + tofile=dstfile, + n=1)) + assert False, f'upload {dstfile} differs:\n{diff}' diff --git a/deps/curl/tests/http/test_31_vsftpds.py b/deps/curl/tests/http/test_31_vsftpds.py new file mode 100644 index 00000000..4c7b223e --- /dev/null +++ b/deps/curl/tests/http/test_31_vsftpds.py @@ -0,0 +1,264 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import difflib +import filecmp +import logging +import os +import shutil +import pytest + +from testenv import Env, CurlClient, VsFTPD + + +log = logging.getLogger(__name__) + + +@pytest.mark.skipif(condition=not Env.has_vsftpd(), reason="missing vsftpd") +class TestVsFTPD: + + SUPPORTS_SSL = True + + @pytest.fixture(autouse=True, scope='class') + def vsftpds(self, env): + if not TestVsFTPD.SUPPORTS_SSL: + pytest.skip('vsftpd does not seem to support SSL') + vsftpds = VsFTPD(env=env, with_ssl=True) + if not vsftpds.start(): + vsftpds.stop() + TestVsFTPD.SUPPORTS_SSL = False + pytest.skip('vsftpd does not seem to support SSL') + yield vsftpds + vsftpds.stop() + + def _make_docs_file(self, docs_dir: str, fname: str, fsize: int): + fpath = os.path.join(docs_dir, fname) + data1k = 1024*'x' + flen = 0 + with open(fpath, 'w') as fd: + while flen < fsize: + fd.write(data1k) + flen += len(data1k) + return flen + + @pytest.fixture(autouse=True, scope='class') + def _class_scope(self, env, vsftpds): + if os.path.exists(vsftpds.docs_dir): + shutil.rmtree(vsftpds.docs_dir) + if not os.path.exists(vsftpds.docs_dir): + os.makedirs(vsftpds.docs_dir) + self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1k', fsize=1024) + self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10k', fsize=10*1024) + self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1m', fsize=1024*1024) + self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10m', fsize=10*1024*1024) + 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) + + def test_31_01_list_dir(self, env: Env, vsftpds: VsFTPD, repeat): + curl = CurlClient(env=env) + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/' + r = curl.ftp_ssl_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}' + + # download 1 file, no SSL + @pytest.mark.parametrize("docname", [ + 'data-1k', 'data-1m', 'data-10m' + ]) + def test_31_02_download_1(self, env: Env, vsftpds: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpds.docs_dir, f'{docname}') + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}?[0-{count-1}]' + r = curl.ftp_ssl_get(urls=[url], with_stats=True) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + @pytest.mark.parametrize("docname", [ + 'data-1k', 'data-1m', 'data-10m' + ]) + def test_31_03_download_10_serial(self, env: Env, vsftpds: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpds.docs_dir, f'{docname}') + count = 10 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}?[0-{count-1}]' + r = curl.ftp_ssl_get(urls=[url], with_stats=True) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + @pytest.mark.parametrize("docname", [ + 'data-1k', 'data-1m', 'data-10m' + ]) + def test_31_04_download_10_parallel(self, env: Env, vsftpds: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpds.docs_dir, f'{docname}') + count = 10 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}?[0-{count-1}]' + r = curl.ftp_ssl_get(urls=[url], with_stats=True, extra_args=[ + '--parallel' + ]) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + @pytest.mark.parametrize("docname", [ + 'upload-1k', 'upload-100k', 'upload-1m' + ]) + def test_31_05_upload_1(self, env: Env, vsftpds: VsFTPD, docname, repeat): + curl = CurlClient(env=env) + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpds.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/' + 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) + + def _rmf(self, path): + if os.path.exists(path): + return os.remove(path) + + # check with `tcpdump` if curl causes any TCP RST packets + @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") + def test_31_06_shutdownh_download(self, env: Env, vsftpds: VsFTPD, repeat): + docname = 'data-1k' + curl = CurlClient(env=env) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}?[0-{count-1}]' + r = curl.ftp_ssl_get(urls=[url], with_stats=True, with_tcpdump=True) + r.check_stats(count=count, http_status=226) + # vsftp closes control connection without niceties, + # disregard RST packets it sent from its port to curl + assert len(r.tcpdump.stats_excluding(src_port=env.ftps_port)) == 0, 'Unexpected TCP RSTs packets' + + # check with `tcpdump` if curl causes any TCP RST packets + @pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available") + def test_31_07_shutdownh_upload(self, env: Env, vsftpds: VsFTPD, repeat): + docname = 'upload-1k' + curl = CurlClient(env=env) + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpds.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/' + r = curl.ftp_ssl_upload(urls=[url], fupload=f'{srcfile}', with_stats=True, with_tcpdump=True) + r.check_stats(count=count, http_status=226) + # vsftp closes control connection without niceties, + # disregard RST packets it sent from its port to curl + assert len(r.tcpdump.stats_excluding(src_port=env.ftps_port)) == 0, 'Unexpected TCP RSTs packets' + + def test_31_08_upload_ascii(self, env: Env, vsftpds: VsFTPD): + docname = 'upload-ascii' + line_length = 21 + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpds.docs_dir, docname) + env.make_data_file(indir=env.gen_dir, fname=docname, fsize=100*1024, + line_length=line_length) + srcsize = os.path.getsize(srcfile) + self._rmf(dstfile) + count = 1 + curl = CurlClient(env=env) + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/' + r = curl.ftp_ssl_upload(urls=[url], fupload=f'{srcfile}', with_stats=True, + extra_args=['--use-ascii']) + r.check_stats(count=count, http_status=226) + # expect the uploaded file to be number of converted newlines larger + dstsize = os.path.getsize(dstfile) + newlines = len(open(srcfile).readlines()) + assert (srcsize + newlines) == dstsize, \ + f'expected source with {newlines} lines to be that much larger,'\ + f'instead srcsize={srcsize}, upload size={dstsize}, diff={dstsize-srcsize}' + + def test_31_08_active_download(self, env: Env, vsftpds: VsFTPD): + docname = 'data-10k' + curl = CurlClient(env=env) + srcfile = os.path.join(vsftpds.docs_dir, f'{docname}') + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}?[0-{count-1}]' + r = curl.ftp_ssl_get(urls=[url], with_stats=True, extra_args=[ + '--ftp-port', '127.0.0.1' + ]) + r.check_stats(count=count, http_status=226) + self.check_downloads(curl, srcfile, count) + + def test_31_09_active_upload(self, env: Env, vsftpds: VsFTPD): + docname = 'upload-1k' + curl = CurlClient(env=env) + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpds.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/' + r = curl.ftp_ssl_upload(urls=[url], fupload=f'{srcfile}', with_stats=True, extra_args=[ + '--ftp-port', '127.0.0.1' + ]) + r.check_stats(count=count, http_status=226) + self.check_upload(env, vsftpds, docname=docname) + + @pytest.mark.parametrize("indata", [ + '1234567890', '' + ]) + def test_31_10_upload_stdin(self, env: Env, vsftpds: VsFTPD, indata): + curl = CurlClient(env=env) + docname = "upload_31_10" + dstfile = os.path.join(vsftpds.docs_dir, docname) + self._rmf(dstfile) + count = 1 + url = f'ftp://{env.ftp_domain}:{vsftpds.port}/{docname}' + r = curl.ftp_ssl_upload(urls=[url], updata=indata, with_stats=True) + r.check_stats(count=count, http_status=226) + assert os.path.exists(dstfile) + destdata = open(dstfile).readlines() + expdata = [indata] if len(indata) else [] + assert expdata == destdata, f'exected: {expdata}, got: {destdata}' + + def check_downloads(self, client, srcfile: str, count: int, + complete: bool = True): + for i in range(count): + dfile = client.download_file(i) + assert os.path.exists(dfile) + if complete and not filecmp.cmp(srcfile, dfile, shallow=False): + diff = "".join(difflib.unified_diff(a=open(srcfile).readlines(), + b=open(dfile).readlines(), + fromfile=srcfile, + tofile=dfile, + n=1)) + assert False, f'download {dfile} differs:\n{diff}' + + def check_upload(self, env, vsftpd: VsFTPD, docname): + srcfile = os.path.join(env.gen_dir, docname) + dstfile = os.path.join(vsftpd.docs_dir, docname) + assert os.path.exists(srcfile) + assert os.path.exists(dstfile) + if not filecmp.cmp(srcfile, dstfile, shallow=False): + diff = "".join(difflib.unified_diff(a=open(srcfile).readlines(), + b=open(dstfile).readlines(), + fromfile=srcfile, + tofile=dstfile, + n=1)) + assert False, f'upload {dstfile} differs:\n{diff}' diff --git a/deps/curl/tests/http/testenv/__init__.py b/deps/curl/tests/http/testenv/__init__.py index c4c03202..539af2aa 100644 --- a/deps/curl/tests/http/testenv/__init__.py +++ b/deps/curl/tests/http/testenv/__init__.py @@ -23,7 +23,7 @@ # SPDX-License-Identifier: curl # ########################################################################### -# +# ruff: noqa: F401, E402 import pytest pytest.register_assert_rewrite("testenv.env", "testenv.curl", "testenv.caddy", "testenv.httpd", "testenv.nghttpx") @@ -34,5 +34,5 @@ from .caddy import Caddy from .httpd import Httpd from .curl import CurlClient, ExecResult, RunProfile from .client import LocalClient -from .nghttpx import Nghttpx from .nghttpx import Nghttpx, NghttpxQuic, NghttpxFwd +from .vsftpd import VsFTPD diff --git a/deps/curl/tests/http/testenv/caddy.py b/deps/curl/tests/http/testenv/caddy.py index ea1343a9..748ef3d5 100644 --- a/deps/curl/tests/http/testenv/caddy.py +++ b/deps/curl/tests/http/testenv/caddy.py @@ -56,7 +56,7 @@ class Caddy: return self._docs_dir @property - def port(self) -> str: + def port(self) -> int: return self.env.caddy_https_port def clear_logs(self): @@ -141,6 +141,10 @@ class Caddy: def _write_config(self): domain1 = self.env.domain1 creds1 = self.env.get_credentials(domain1) + assert creds1 # convince pytype this isn't None + domain2 = self.env.domain2 + creds2 = self.env.get_credentials(domain2) + assert creds2 # convince pytype this isn't None self._mkpath(self._docs_dir) self._mkpath(self._tmp_dir) with open(os.path.join(self._docs_dir, 'data.json'), 'w') as fd: @@ -150,18 +154,23 @@ class Caddy: fd.write(JSONEncoder().encode(data)) with open(self._conf_file, 'w') as fd: conf = [ # base server config - f'{{', + '{', f' http_port {self.env.caddy_http_port}', f' https_port {self.env.caddy_https_port}', f' servers :{self.env.caddy_https_port} {{', - f' protocols h3 h2 h1', - f' }}', - f'}}', + ' protocols h3 h2 h1', + ' }', + '}', f'{domain1}:{self.env.caddy_https_port} {{', - f' file_server * {{', + ' file_server * {', f' root {self._docs_dir}', - f' }}', + ' }', f' tls {creds1.cert_file} {creds1.pkey_file}', - f'}}', + '}', + f'{domain2} {{', + f' reverse_proxy /* http://localhost:{self.env.http_port} {{', + ' }', + f' tls {creds2.cert_file} {creds2.pkey_file}', + '}', ] fd.write("\n".join(conf)) diff --git a/deps/curl/tests/http/testenv/certs.py b/deps/curl/tests/http/testenv/certs.py index cdbfed1f..3795ba94 100644 --- a/deps/curl/tests/http/testenv/certs.py +++ b/deps/curl/tests/http/testenv/certs.py @@ -27,7 +27,7 @@ import ipaddress import os import re -from datetime import timedelta, datetime +from datetime import timedelta, datetime, timezone from typing import List, Any, Optional from cryptography import x509 @@ -126,6 +126,7 @@ class Credentials: self._cert_file = None self._pkey_file = None self._store = None + self._combined_file = None @property def name(self) -> str: @@ -315,10 +316,18 @@ class CertStore: if os.path.isfile(cert_file) and os.path.isfile(pkey_file): cert = self.load_pem_cert(cert_file) pkey = self.load_pem_pkey(pkey_file) - if check_valid and \ - ((cert.not_valid_after < datetime.now()) or - (cert.not_valid_before > datetime.now())): - return None + try: + now = datetime.now(tz=timezone.utc) + if check_valid and \ + ((cert.not_valid_after_utc < now) or + (cert.not_valid_before_utc > now)): + return None + except AttributeError: # older python + now = datetime.now() + if check_valid and \ + ((cert.not_valid_after < now) or + (cert.not_valid_before > now)): + return None creds = Credentials(name=name, cert=cert, pkey=pkey, issuer=issuer) creds.set_store(self) creds.set_files(cert_file, pkey_file, comb_file) @@ -344,7 +353,9 @@ class TestCA: valid_from: timedelta = timedelta(days=-1), valid_to: timedelta = timedelta(days=89), ) -> Credentials: - """Create a certificate signed by this CA for the given domains. + """ + Create a certificate signed by this CA for the given domains. + :returns: the certificate and private key PEM file paths """ if spec.domains and len(spec.domains): @@ -364,7 +375,7 @@ class TestCA: return creds @staticmethod - def _make_x509_name(org_name: str = None, common_name: str = None, parent: x509.Name = None) -> x509.Name: + def _make_x509_name(org_name: Optional[str] = None, common_name: Optional[str] = None, parent: x509.Name = None) -> x509.Name: name_pieces = [] if org_name: oid = NameOID.ORGANIZATIONAL_UNIT_NAME if parent else NameOID.ORGANIZATION_NAME @@ -372,7 +383,7 @@ class TestCA: elif common_name: name_pieces.append(x509.NameAttribute(NameOID.COMMON_NAME, common_name)) if parent: - name_pieces.extend([rdn for rdn in parent]) + name_pieces.extend(list(parent)) return x509.Name(name_pieces) @staticmethod @@ -380,8 +391,8 @@ class TestCA: subject: x509.Name, pkey: Any, issuer_subject: Optional[Credentials], - valid_from_delta: timedelta = None, - valid_until_delta: timedelta = None + valid_from_delta: Optional[timedelta] = None, + valid_until_delta: Optional[timedelta] = None ): pubkey = pkey.public_key() issuer_subject = issuer_subject if issuer_subject is not None else subject @@ -439,7 +450,8 @@ class TestCA: for name in domains: try: names.append(x509.IPAddress(ipaddress.ip_address(name))) - except: + # TODO: specify specific exceptions here + except: # noqa: E722 names.append(x509.DNSName(name)) return csr.add_extension( @@ -460,7 +472,7 @@ class TestCA: ) @staticmethod - def _add_client_usages(csr: Any, issuer: Credentials, rfc82name: str = None) -> Any: + def _add_client_usages(csr: Any, issuer: Credentials, rfc82name: Optional[str] = None) -> Any: cert = csr.add_extension( x509.BasicConstraints(ca=False, path_length=None), critical=True, @@ -485,7 +497,7 @@ class TestCA: @staticmethod def _make_ca_credentials(name, key_type: Any, - issuer: Credentials = None, + issuer: Optional[Credentials] = None, valid_from: timedelta = timedelta(days=-1), valid_to: timedelta = timedelta(days=89), ) -> Credentials: @@ -512,7 +524,6 @@ class TestCA: valid_from: timedelta = timedelta(days=-1), valid_to: timedelta = timedelta(days=89), ) -> Credentials: - name = name pkey = _private_key(key_type=key_type) subject = TestCA._make_x509_name(common_name=name, parent=issuer.subject) csr = TestCA._make_csr(subject=subject, diff --git a/deps/curl/tests/http/testenv/client.py b/deps/curl/tests/http/testenv/client.py index e8ffb040..3981752e 100644 --- a/deps/curl/tests/http/testenv/client.py +++ b/deps/curl/tests/http/testenv/client.py @@ -24,16 +24,12 @@ # ########################################################################### # -import pytest -import json import logging import os -import re import shutil import subprocess -from datetime import timedelta, datetime -from typing import List, Optional, Dict, Union -from urllib.parse import urlparse +from datetime import datetime +from typing import Optional, Dict from . import ExecResult from .env import Env @@ -48,9 +44,9 @@ class LocalClient: timeout: Optional[float] = None, run_env: Optional[Dict[str,str]] = None): self.name = name - self.path = os.path.join(env.project_dir, f'tests/http/clients/{name}') + self.path = os.path.join(env.build_dir, f'tests/http/clients/{name}') self.env = env - self._run_env= run_env + self._run_env = run_env self._timeout = timeout if timeout else env.test_timeout self._curl = os.environ['CURL'] if 'CURL' in os.environ else env.curl self._run_dir = run_dir if run_dir else os.path.join(env.gen_dir, name) @@ -92,14 +88,19 @@ class LocalClient: exception = None myargs = [self.path] myargs.extend(args) + run_env = None + if self._run_env: + run_env = self._run_env.copy() + for key in ['CURL_DEBUG']: + if key in os.environ and key not in run_env: + run_env[key] = os.environ[key] try: - with open(self._stdoutfile, 'w') as cout: - with open(self._stderrfile, 'w') as cerr: - p = subprocess.run(myargs, stderr=cerr, stdout=cout, - cwd=self._run_dir, shell=False, - input=None, env=self._run_env, - timeout=self._timeout) - exitcode = p.returncode + with open(self._stdoutfile, 'w') as cout, open(self._stderrfile, 'w') as cerr: + p = subprocess.run(myargs, stderr=cerr, stdout=cout, + cwd=self._run_dir, shell=False, + input=None, env=run_env, + timeout=self._timeout) + exitcode = p.returncode except subprocess.TimeoutExpired: log.warning(f'Timeout after {self._timeout}s: {args}') exitcode = -1 diff --git a/deps/curl/tests/http/testenv/curl.py b/deps/curl/tests/http/testenv/curl.py index bfd6fdef..ee224d9a 100644 --- a/deps/curl/tests/http/testenv/curl.py +++ b/deps/curl/tests/http/testenv/curl.py @@ -27,6 +27,10 @@ import json import logging import os +import sys +import time +from threading import Thread + import psutil import re import shutil @@ -51,7 +55,8 @@ class RunProfile: avg = {} stats = [p.stats for p in profiles] for key in cls.STAT_KEYS: - avg[key] = mean([s[key] for s in stats]) + vals = [s[key] for s in stats] + avg[key] = mean(vals) if len(vals) else 0.0 return avg def __init__(self, pid: int, started_at: datetime, run_dir): @@ -103,6 +108,79 @@ class RunProfile: f'stats={self.stats}]' +class RunTcpDump: + + def __init__(self, env, run_dir): + self._env = env + self._run_dir = run_dir + self._proc = None + self._stdoutfile = os.path.join(self._run_dir, 'tcpdump.out') + self._stderrfile = os.path.join(self._run_dir, 'tcpdump.err') + + @property + def stats(self) -> Optional[List[str]]: + if self._proc: + raise Exception('tcpdump still running') + return [line + for line in open(self._stdoutfile) + if re.match(r'.* IP 127\.0\.0\.1\.\d+ [<>] 127\.0\.0\.1\.\d+:.*', line)] + + def stats_excluding(self, src_port) -> Optional[List[str]]: + if self._proc: + raise Exception('tcpdump still running') + return [line + for line in self.stats + if not re.match(r'.* IP 127\.0\.0\.1\.' + str(src_port) + ' >.*', line)] + + @property + def stderr(self) -> List[str]: + if self._proc: + raise Exception('tcpdump still running') + return open(self._stderrfile).readlines() + + def sample(self): + # not sure how to make that detection reliable for all platforms + local_if = 'lo0' if sys.platform.startswith('darwin') else 'lo' + try: + tcpdump = self._env.tcpdump() + if tcpdump is None: + raise Exception('tcpdump not available') + # look with tcpdump for TCP RST packets which indicate + # we did not shut down connections cleanly + args = [] + # at least on Linux, we need root permissions to run tcpdump + if sys.platform.startswith('linux'): + args.append('sudo') + args.extend([ + tcpdump, '-i', local_if, '-n', 'tcp[tcpflags] & (tcp-rst)!=0' + ]) + with open(self._stdoutfile, 'w') as cout, open(self._stderrfile, 'w') as cerr: + self._proc = subprocess.Popen(args, stdout=cout, stderr=cerr, + text=True, cwd=self._run_dir, + shell=False) + assert self._proc + assert self._proc.returncode is None + while self._proc: + try: + self._proc.wait(timeout=1) + except subprocess.TimeoutExpired: + pass + except Exception: + log.exception('Tcpdump') + + def start(self): + def do_sample(): + self.sample() + t = Thread(target=do_sample) + t.start() + + def finish(self): + if self._proc: + time.sleep(1) + self._proc.terminate() + self._proc = None + + class ExecResult: def __init__(self, args: List[str], exit_code: int, @@ -110,13 +188,15 @@ class ExecResult: duration: Optional[timedelta] = None, with_stats: bool = False, exception: Optional[str] = None, - profile: Optional[RunProfile] = None): + profile: Optional[RunProfile] = None, + tcpdump: Optional[RunTcpDump] = None): self._args = args self._exit_code = exit_code self._exception = exception self._stdout = stdout self._stderr = stderr self._profile = profile + self._tcpdump = tcpdump self._duration = duration if duration is not None else timedelta() self._response = None self._responses = [] @@ -132,7 +212,7 @@ class ExecResult: try: out = ''.join(self._stdout) self._json_out = json.loads(out) - except: + except: # noqa: E722 pass def __repr__(self): @@ -141,11 +221,12 @@ class ExecResult: def _parse_stats(self): self._stats = [] - for l in self._stdout: + for line in self._stdout: try: - self._stats.append(json.loads(l)) - except: - log.error(f'not a JSON stat: {l}') + self._stats.append(json.loads(line)) + # TODO: specify specific exceptions here + except: # noqa: E722 + log.exception(f'not a JSON stat: {line}') break @property @@ -185,6 +266,10 @@ class ExecResult: def profile(self) -> Optional[RunProfile]: return self._profile + @property + def tcpdump(self) -> Optional[RunTcpDump]: + return self._tcpdump + @property def response(self) -> Optional[Dict]: return self._response @@ -301,7 +386,9 @@ class ExecResult: f'were made\n{self.dump_logs()}' def check_stats(self, count: int, http_status: Optional[int] = None, - exitcode: Optional[int] = None): + exitcode: Optional[int] = None, + remote_port: Optional[int] = None, + remote_ip: Optional[str] = None): if exitcode is None: self.check_exit_code(0) assert len(self.stats) == count, \ @@ -319,6 +406,18 @@ class ExecResult: assert x['exitcode'] == exitcode, \ f'status #{idx} exitcode: expected {exitcode}, '\ f'got {x["exitcode"]}\n{self.dump_stat(x)}' + if remote_port is not None: + for idx, x in enumerate(self.stats): + assert 'remote_port' in x, f'remote_port missing\n{self.dump_stat(x)}' + assert x['remote_port'] == remote_port, \ + f'status #{idx} remote_port: expected {remote_port}, '\ + f'got {x["remote_port"]}\n{self.dump_stat(x)}' + if remote_ip is not None: + for idx, x in enumerate(self.stats): + assert 'remote_ip' in x, f'remote_ip missing\n{self.dump_stat(x)}' + assert x['remote_ip'] == remote_ip, \ + f'status #{idx} remote_ip: expected {remote_ip}, '\ + f'got {x["remote_ip"]}\n{self.dump_stat(x)}' def dump_logs(self): lines = ['>>--stdout ----------------------------------------------\n'] @@ -359,8 +458,12 @@ class CurlClient: 'h3': '--http3-only', } - def __init__(self, env: Env, run_dir: Optional[str] = None, - timeout: Optional[float] = None, silent: bool = False): + def __init__(self, env: Env, + run_dir: Optional[str] = None, + timeout: Optional[float] = None, + silent: bool = False, + run_env: Optional[Dict[str, str]] = None, + server_addr: Optional[str] = None): self.env = env self._timeout = timeout if timeout else env.test_timeout self._curl = os.environ['CURL'] if 'CURL' in os.environ else env.curl @@ -370,6 +473,8 @@ class CurlClient: self._headerfile = f'{self._run_dir}/curl.headers' self._log_path = f'{self._run_dir}/curl.log' self._silent = silent + self._run_env = run_env + self._server_addr = server_addr if server_addr else '127.0.0.1' self._rmrf(self._run_dir) self._mkpath(self._run_dir) @@ -395,12 +500,12 @@ class CurlClient: def get_proxy_args(self, proto: str = 'http/1.1', proxys: bool = True, tunnel: bool = False, use_ip: bool = False): - proxy_name = '127.0.0.1' if use_ip else self.env.proxy_domain + proxy_name = self._server_addr if use_ip else self.env.proxy_domain if proxys: pport = self.env.pts_port(proto) if tunnel else self.env.proxys_port xargs = [ '--proxy', f'https://{proxy_name}:{pport}/', - '--resolve', f'{proxy_name}:{pport}:127.0.0.1', + '--resolve', f'{proxy_name}:{pport}:{self._server_addr}', '--proxy-cacert', self.env.ca.cert_file, ] if proto == 'h2': @@ -408,24 +513,33 @@ class CurlClient: else: xargs = [ '--proxy', f'http://{proxy_name}:{self.env.proxy_port}/', - '--resolve', f'{proxy_name}:{self.env.proxy_port}:127.0.0.1', + '--resolve', f'{proxy_name}:{self.env.proxy_port}:{self._server_addr}', ] if tunnel: xargs.append('--proxytunnel') return xargs def http_get(self, url: str, extra_args: Optional[List[str]] = None, - def_tracing: bool = True, with_profile: bool = False): - return self._raw(url, options=extra_args, with_stats=False, - def_tracing=def_tracing, with_profile=with_profile) + alpn_proto: Optional[str] = None, + def_tracing: bool = True, + with_stats: bool = False, + with_profile: bool = False, + with_tcpdump: bool = False): + return self._raw(url, options=extra_args, + with_stats=with_stats, + alpn_proto=alpn_proto, + def_tracing=def_tracing, + with_profile=with_profile, + with_tcpdump=with_tcpdump) def http_download(self, urls: List[str], alpn_proto: Optional[str] = None, with_stats: bool = True, with_headers: bool = False, with_profile: bool = False, + with_tcpdump: bool = False, no_save: bool = False, - extra_args: List[str] = None): + extra_args: Optional[List[str]] = None): if extra_args is None: extra_args = [] if no_save: @@ -446,13 +560,15 @@ class CurlClient: return self._raw(urls, alpn_proto=alpn_proto, options=extra_args, with_stats=with_stats, with_headers=with_headers, - with_profile=with_profile) + with_profile=with_profile, + with_tcpdump=with_tcpdump) def http_upload(self, urls: List[str], data: str, alpn_proto: Optional[str] = None, with_stats: bool = True, with_headers: bool = False, with_profile: bool = False, + with_tcpdump: bool = False, extra_args: Optional[List[str]] = None): if extra_args is None: extra_args = [] @@ -466,6 +582,26 @@ class CurlClient: return self._raw(urls, alpn_proto=alpn_proto, options=extra_args, with_stats=with_stats, with_headers=with_headers, + with_profile=with_profile, + with_tcpdump=with_tcpdump) + + def http_delete(self, urls: List[str], + alpn_proto: Optional[str] = None, + with_stats: bool = True, + with_profile: bool = False, + extra_args: Optional[List[str]] = None): + if extra_args is None: + extra_args = [] + extra_args.extend([ + '-X', 'DELETE', '-o', '/dev/null', + ]) + if with_stats: + extra_args.extend([ + '-w', '%{json}\\n' + ]) + return self._raw(urls, alpn_proto=alpn_proto, options=extra_args, + with_stats=with_stats, + with_headers=False, with_profile=with_profile) def http_put(self, urls: List[str], data=None, fdata=None, @@ -513,6 +649,98 @@ class CurlClient: with_stats=with_stats, with_headers=with_headers) + def ftp_get(self, urls: List[str], + with_stats: bool = True, + with_profile: bool = False, + with_tcpdump: bool = False, + no_save: bool = False, + extra_args: Optional[List[str]] = None): + if extra_args is None: + extra_args = [] + if no_save: + extra_args.extend([ + '-o', '/dev/null', + ]) + else: + extra_args.extend([ + '-o', 'download_#1.data', + ]) + # remove any existing ones + for i in range(100): + self._rmf(self.download_file(i)) + if with_stats: + extra_args.extend([ + '-w', '%{json}\\n' + ]) + return self._raw(urls, options=extra_args, + with_stats=with_stats, + with_headers=False, + with_profile=with_profile, + with_tcpdump=with_tcpdump) + + def ftp_ssl_get(self, urls: List[str], + with_stats: bool = True, + with_profile: bool = False, + with_tcpdump: bool = False, + no_save: bool = False, + extra_args: Optional[List[str]] = None): + if extra_args is None: + extra_args = [] + extra_args.extend([ + '--ssl-reqd', + ]) + return self.ftp_get(urls=urls, with_stats=with_stats, + with_profile=with_profile, no_save=no_save, + with_tcpdump=with_tcpdump, + extra_args=extra_args) + + def ftp_upload(self, urls: List[str], + fupload: Optional[Any] = None, + updata: Optional[str] = None, + with_stats: bool = True, + with_profile: bool = False, + with_tcpdump: bool = False, + extra_args: Optional[List[str]] = None): + if extra_args is None: + extra_args = [] + if fupload is not None: + extra_args.extend([ + '--upload-file', fupload + ]) + elif updata is not None: + extra_args.extend([ + '--upload-file', '-' + ]) + else: + raise Exception('need either file or data to upload') + if with_stats: + extra_args.extend([ + '-w', '%{json}\\n' + ]) + return self._raw(urls, options=extra_args, + intext=updata, + with_stats=with_stats, + with_headers=False, + with_profile=with_profile, + with_tcpdump=with_tcpdump) + + def ftp_ssl_upload(self, urls: List[str], + fupload: Optional[Any] = None, + updata: Optional[str] = None, + with_stats: bool = True, + with_profile: bool = False, + with_tcpdump: bool = False, + extra_args: Optional[List[str]] = None): + if extra_args is None: + extra_args = [] + extra_args.extend([ + '--ssl-reqd', + ]) + return self.ftp_upload(urls=urls, fupload=fupload, updata=updata, + with_stats=with_stats, with_profile=with_profile, + with_tcpdump=with_tcpdump, + extra_args=extra_args) + def response_file(self, idx: int): return os.path.join(self._run_dir, f'download_{idx}.data') @@ -528,57 +756,67 @@ class CurlClient: my_args.extend(args) return self._run(args=my_args, with_stats=with_stats, with_profile=with_profile) - def _run(self, args, intext='', with_stats: bool = False, with_profile: bool = True): + def _run(self, args, intext='', with_stats: bool = False, + with_profile: bool = True, with_tcpdump: bool = False): self._rmf(self._stdoutfile) self._rmf(self._stderrfile) self._rmf(self._headerfile) - started_at = datetime.now() exception = None profile = None + tcpdump = None + started_at = datetime.now() + if with_tcpdump: + tcpdump = RunTcpDump(self.env, self._run_dir) + tcpdump.start() try: - with open(self._stdoutfile, 'w') as cout: - with open(self._stderrfile, 'w') as cerr: - if with_profile: - started_at = datetime.now() - end_at = started_at + timedelta(seconds=self._timeout) \ - if self._timeout else None - log.info(f'starting: {args}') - p = subprocess.Popen(args, stderr=cerr, stdout=cout, - cwd=self._run_dir, shell=False) - profile = RunProfile(p.pid, started_at, self._run_dir) - if intext is not None and False: - p.communicate(input=intext.encode(), timeout=1) - ptimeout = 0.0 - while True: - try: - p.wait(timeout=ptimeout) - break - except subprocess.TimeoutExpired: - if end_at and datetime.now() >= end_at: - p.kill() - raise subprocess.TimeoutExpired(cmd=args, timeout=self._timeout) - profile.sample() - ptimeout = 0.01 - exitcode = p.returncode - profile.finish() - log.info(f'done: exit={exitcode}, profile={profile}') - else: - p = subprocess.run(args, stderr=cerr, stdout=cout, - cwd=self._run_dir, shell=False, - input=intext.encode() if intext else None, - timeout=self._timeout) - exitcode = p.returncode + with open(self._stdoutfile, 'w') as cout, open(self._stderrfile, 'w') as cerr: + if with_profile: + end_at = started_at + timedelta(seconds=self._timeout) \ + if self._timeout else None + log.info(f'starting: {args}') + p = subprocess.Popen(args, stderr=cerr, stdout=cout, + cwd=self._run_dir, shell=False, + env=self._run_env) + profile = RunProfile(p.pid, started_at, self._run_dir) + if intext is not None and False: + p.communicate(input=intext.encode(), timeout=1) + ptimeout = 0.0 + while True: + try: + p.wait(timeout=ptimeout) + break + except subprocess.TimeoutExpired: + if end_at and datetime.now() >= end_at: + p.kill() + raise subprocess.TimeoutExpired(cmd=args, timeout=self._timeout) + profile.sample() + ptimeout = 0.01 + exitcode = p.returncode + profile.finish() + log.info(f'done: exit={exitcode}, profile={profile}') + else: + p = subprocess.run(args, stderr=cerr, stdout=cout, + cwd=self._run_dir, shell=False, + input=intext.encode() if intext else None, + timeout=self._timeout, + env=self._run_env) + exitcode = p.returncode except subprocess.TimeoutExpired: - log.warning(f'Timeout after {self._timeout}s: {args}') + now = datetime.now() + duration = now - started_at + log.warning(f'Timeout at {now} after {duration.total_seconds()}s ' + f'(configured {self._timeout}s): {args}') exitcode = -1 exception = 'TimeoutExpired' + if tcpdump: + tcpdump.finish() coutput = open(self._stdoutfile).readlines() cerrput = open(self._stderrfile).readlines() return ExecResult(args=args, exit_code=exitcode, exception=exception, stdout=coutput, stderr=cerrput, duration=datetime.now() - started_at, with_stats=with_stats, - profile=profile) + profile=profile, tcpdump=tcpdump) def _raw(self, urls, intext='', timeout=None, options=None, insecure=False, alpn_proto: Optional[str] = None, @@ -586,17 +824,16 @@ class CurlClient: with_stats=False, with_headers=True, def_tracing=True, - with_profile=False): + with_profile=False, + with_tcpdump=False): args = self._complete_args( urls=urls, timeout=timeout, options=options, insecure=insecure, alpn_proto=alpn_proto, force_resolve=force_resolve, with_headers=with_headers, def_tracing=def_tracing) r = self._run(args, intext=intext, with_stats=with_stats, - with_profile=with_profile) + with_profile=with_profile, with_tcpdump=with_tcpdump) if r.exit_code == 0 and with_headers: self._parse_headerfile(self._headerfile, r=r) - if r.json: - r.response["json"] = r.json return r def _complete_args(self, urls, timeout=None, options=None, @@ -608,13 +845,15 @@ class CurlClient: urls = [urls] args = [self._curl, "-s", "--path-as-is"] + if 'CURL_TEST_EVENT' in os.environ: + args.append('--test-event') + if with_headers: args.extend(["-D", self._headerfile]) if def_tracing is not False and not self._silent: args.extend(['-v', '--trace-ids', '--trace-time']) if self.env.verbose > 1: args.extend(['--trace-config', 'http/2,http/3,h2-proxy,h1-proxy']) - pass active_options = options if options is not None and '--next' in options: @@ -641,13 +880,15 @@ class CurlClient: if force_resolve and u.hostname and u.hostname != 'localhost' \ and not re.match(r'^(\d+|\[|:).*', u.hostname): port = u.port if u.port else 443 - args.extend(["--resolve", f"{u.hostname}:{port}:127.0.0.1"]) + args.extend([ + '--resolve', f'{u.hostname}:{port}:{self._server_addr}', + ]) if timeout is not None and int(timeout) > 0: args.extend(["--connect-timeout", str(int(timeout))]) args.append(url) return args - def _parse_headerfile(self, headerfile: str, r: ExecResult = None) -> ExecResult: + def _parse_headerfile(self, headerfile: str, r: Optional[ExecResult] = None) -> ExecResult: lines = open(headerfile).readlines() if r is None: r = ExecResult(args=[], exit_code=0, stdout=[], stderr=[]) diff --git a/deps/curl/tests/http/testenv/env.py b/deps/curl/tests/http/testenv/env.py index 29f9726f..aa401800 100644 --- a/deps/curl/tests/http/testenv/env.py +++ b/deps/curl/tests/http/testenv/env.py @@ -27,15 +27,13 @@ import logging import os import re +import shutil import socket import subprocess -import sys +import tempfile from configparser import ConfigParser, ExtendedInterpolation -from datetime import timedelta from typing import Optional -import pytest - from .certs import CertificateSpec, TestCA, Credentials from .ports import alloc_ports @@ -52,10 +50,9 @@ def init_config_from(conf_path): TESTS_HTTPD_PATH = os.path.dirname(os.path.dirname(__file__)) -DEF_CONFIG = init_config_from(os.path.join(TESTS_HTTPD_PATH, 'config.ini')) - -TOP_PATH = os.path.dirname(os.path.dirname(TESTS_HTTPD_PATH)) -CURL = os.path.join(TOP_PATH, 'src/curl') +TOP_PATH = os.path.join(os.getcwd(), os.path.pardir) +DEF_CONFIG = init_config_from(os.path.join(TOP_PATH, 'tests', 'http', 'config.ini')) +CURL = os.path.join(TOP_PATH, 'src', 'curl') class EnvConfig: @@ -64,28 +61,34 @@ class EnvConfig: self.tests_dir = TESTS_HTTPD_PATH self.gen_dir = os.path.join(self.tests_dir, 'gen') self.project_dir = os.path.dirname(os.path.dirname(self.tests_dir)) + self.build_dir = TOP_PATH self.config = DEF_CONFIG # check cur and its features self.curl = CURL if 'CURL' in os.environ: self.curl = os.environ['CURL'] self.curl_props = { - 'version': None, - 'os': None, - 'fullname': None, + 'version': '', + 'os': '', + 'fullname': '', + 'features_string': '', 'features': [], + 'protocols_string': '', 'protocols': [], 'libs': [], 'lib_versions': [], } + self.curl_is_debug = False self.curl_protos = [] p = subprocess.run(args=[self.curl, '-V'], capture_output=True, text=True) if p.returncode != 0: assert False, f'{self.curl} -V failed with exit code: {p.returncode}' - for l in p.stdout.splitlines(keepends=False): - if l.startswith('curl '): - m = re.match(r'^curl (?P\S+) (?P\S+) (?P.*)$', l) + if p.stderr.startswith('WARNING:'): + self.curl_is_debug = True + for line in p.stdout.splitlines(keepends=False): + if line.startswith('curl '): + m = re.match(r'^curl (?P\S+) (?P\S+) (?P.*)$', line) if m: self.curl_props['fullname'] = m.group(0) self.curl_props['version'] = m.group('version') @@ -94,20 +97,25 @@ class EnvConfig: lib.lower() for lib in m.group('libs').split(' ') ] self.curl_props['libs'] = [ - re.sub(r'/.*', '', lib) for lib in self.curl_props['lib_versions'] + re.sub(r'/[a-z0-9.-]*', '', lib) for lib in self.curl_props['lib_versions'] ] - if l.startswith('Features: '): + if line.startswith('Features: '): + self.curl_props['features_string'] = line[10:] self.curl_props['features'] = [ - feat.lower() for feat in l[10:].split(' ') + feat.lower() for feat in line[10:].split(' ') ] - if l.startswith('Protocols: '): + if line.startswith('Protocols: '): + self.curl_props['protocols_string'] = line[11:] self.curl_props['protocols'] = [ - prot.lower() for prot in l[11:].split(' ') + prot.lower() for prot in line[11:].split(' ') ] self.ports = alloc_ports(port_specs={ + 'ftp': socket.SOCK_STREAM, + 'ftps': socket.SOCK_STREAM, 'http': socket.SOCK_STREAM, 'https': socket.SOCK_STREAM, + 'nghttpx_https': socket.SOCK_STREAM, 'proxy': socket.SOCK_STREAM, 'proxys': socket.SOCK_STREAM, 'h2proxys': socket.SOCK_STREAM, @@ -129,11 +137,14 @@ class EnvConfig: self.htdocs_dir = os.path.join(self.gen_dir, 'htdocs') self.tld = 'http.curl.se' self.domain1 = f"one.{self.tld}" + self.domain1brotli = f"brotli.one.{self.tld}" self.domain2 = f"two.{self.tld}" + self.ftp_domain = f"ftp.{self.tld}" self.proxy_domain = f"proxy.{self.tld}" self.cert_specs = [ - CertificateSpec(domains=[self.domain1, 'localhost'], key_type='rsa2048'), + CertificateSpec(domains=[self.domain1, self.domain1brotli, 'localhost', '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'), CertificateSpec(name="clientsX", sub_specs=[ CertificateSpec(name="user1", client=True), @@ -167,10 +178,47 @@ class EnvConfig: if p.returncode != 0: # not a working caddy self.caddy = None - self._caddy_version = re.sub(r' .*', '', p.stdout.strip()) - except: + m = re.match(r'v?(\d+\.\d+\.\d+).*', p.stdout) + if m: + self._caddy_version = m.group(1) + else: + raise f'Unable to determine cadd version from: {p.stdout}' + # TODO: specify specific exceptions here + except: # noqa: E722 self.caddy = None + self.vsftpd = self.config['vsftpd']['vsftpd'] + self._vsftpd_version = None + if self.vsftpd is not None: + try: + with tempfile.TemporaryFile('w+') as tmp: + p = subprocess.run(args=[self.vsftpd, '-v'], + capture_output=True, text=True, stdin=tmp) + if p.returncode != 0: + # not a working vsftpd + self.vsftpd = None + if p.stderr: + ver_text = p.stderr + else: + # Oddly, some versions of vsftpd write to stdin (!) + # instead of stderr, which is odd but works. If there + # is nothing on stderr, read the file on stdin and use + # any data there instead. + tmp.seek(0) + ver_text = tmp.read() + m = re.match(r'vsftpd: version (\d+\.\d+\.\d+)', ver_text) + if m: + self._vsftpd_version = m.group(1) + elif len(p.stderr) == 0: + # vsftp does not use stdout or stderr for printing its version... -.- + self._vsftpd_version = 'unknown' + else: + raise Exception(f'Unable to determine VsFTPD version from: {p.stderr}') + except Exception: + self.vsftpd = None + + self._tcpdump = shutil.which('tcpdump') + @property def httpd_version(self): if self._httpd_version is None and self.apxs is not None: @@ -181,19 +229,25 @@ class EnvConfig: log.error(f'{self.apxs} failed to query HTTPD_VERSION: {p}') else: self._httpd_version = p.stdout.strip() - except Exception as e: - log.error(f'{self.apxs} failed to run: {e}') + except Exception: + log.exception(f'{self.apxs} failed to run') return self._httpd_version - def _versiontuple(self, v): + def versiontuple(self, v): v = re.sub(r'(\d+\.\d+(\.\d+)?)(-\S+)?', r'\1', v) return tuple(map(int, v.split('.'))) def httpd_is_at_least(self, minv): if self.httpd_version is None: return False - hv = self._versiontuple(self.httpd_version) - return hv >= self._versiontuple(minv) + hv = self.versiontuple(self.httpd_version) + return hv >= self.versiontuple(minv) + + def caddy_is_at_least(self, minv): + if self.caddy_version is None: + return False + hv = self.versiontuple(self.caddy_version) + return hv >= self.versiontuple(minv) def is_complete(self) -> bool: return os.path.isfile(self.httpd) and \ @@ -203,13 +257,13 @@ class EnvConfig: def get_incomplete_reason(self) -> Optional[str]: if self.httpd is None or len(self.httpd.strip()) == 0: - return f'httpd not configured, see `--with-test-httpd=`' + return 'httpd not configured, see `--with-test-httpd=`' if not os.path.isfile(self.httpd): return f'httpd ({self.httpd}) not found' if not os.path.isfile(self.apachectl): return f'apachectl ({self.apachectl}) not found' if self.apxs is None: - return f"command apxs not found (commonly provided in apache2-dev)" + return "command apxs not found (commonly provided in apache2-dev)" if not os.path.isfile(self.apxs): return f"apxs ({self.apxs}) not found" return None @@ -222,6 +276,14 @@ class EnvConfig: def caddy_version(self): return self._caddy_version + @property + def vsftpd_version(self): + return self._vsftpd_version + + @property + def tcpdmp(self) -> Optional[str]: + return self._tcpdump + class Env: @@ -245,7 +307,7 @@ class Env: @staticmethod def have_ssl_curl() -> bool: - return 'ssl' in Env.CONFIG.curl_props['features'] + return Env.curl_has_feature('ssl') or Env.curl_has_feature('multissl') @staticmethod def have_h2_curl() -> bool: @@ -259,10 +321,24 @@ class Env: def curl_uses_lib(libname: str) -> bool: return libname.lower() in Env.CONFIG.curl_props['libs'] + @staticmethod + def curl_uses_ossl_quic() -> bool: + if Env.have_h3_curl(): + return not Env.curl_uses_lib('ngtcp2') and Env.curl_uses_lib('nghttp3') + return False + + @staticmethod + def curl_features_string() -> str: + return Env.CONFIG.curl_props['features_string'] + @staticmethod def curl_has_feature(feature: str) -> bool: return feature.lower() in Env.CONFIG.curl_props['features'] + @staticmethod + def curl_protocols_string() -> str: + return Env.CONFIG.curl_props['protocols_string'] + @staticmethod def curl_has_protocol(protocol: str) -> bool: return protocol.lower() in Env.CONFIG.curl_props['protocols'] @@ -275,6 +351,14 @@ class Env: return lversion[len(prefix):] return 'unknown' + @staticmethod + def curl_lib_version_at_least(libname: str, min_version) -> bool: + lversion = Env.curl_lib_version(libname) + if lversion != 'unknown': + return Env.CONFIG.versiontuple(min_version) <= \ + Env.CONFIG.versiontuple(lversion) + return False + @staticmethod def curl_os() -> str: return Env.CONFIG.curl_props['os'] @@ -287,6 +371,10 @@ class Env: def curl_version() -> str: return Env.CONFIG.curl_props['version'] + @staticmethod + def curl_is_debug() -> bool: + return Env.CONFIG.curl_is_debug + @staticmethod def have_h3() -> bool: return Env.have_h3_curl() and Env.have_h3_server() @@ -303,6 +391,10 @@ class Env: def caddy_version() -> str: return Env.CONFIG.caddy_version + @staticmethod + def caddy_is_at_least(minv) -> bool: + return Env.CONFIG.caddy_is_at_least(minv) + @staticmethod def httpd_is_at_least(minv) -> bool: return Env.CONFIG.httpd_is_at_least(minv) @@ -311,6 +403,18 @@ class Env: def has_caddy() -> bool: return Env.CONFIG.caddy is not None + @staticmethod + def has_vsftpd() -> bool: + return Env.CONFIG.vsftpd is not None + + @staticmethod + def vsftpd_version() -> str: + return Env.CONFIG.vsftpd_version + + @staticmethod + def tcpdump() -> Optional[str]: + return Env.CONFIG.tcpdmp + def __init__(self, pytestconfig=None): self._verbose = pytestconfig.option.verbose \ if pytestconfig is not None else 0 @@ -356,6 +460,10 @@ class Env: def project_dir(self) -> str: return self.CONFIG.project_dir + @property + def build_dir(self) -> str: + return self.CONFIG.build_dir + @property def ca(self): return self._ca @@ -364,14 +472,26 @@ class Env: def htdocs_dir(self) -> str: return self.CONFIG.htdocs_dir + @property + def tld(self) -> str: + return self.CONFIG.tld + @property def domain1(self) -> str: return self.CONFIG.domain1 + @property + def domain1brotli(self) -> str: + return self.CONFIG.domain1brotli + @property def domain2(self) -> str: return self.CONFIG.domain2 + @property + def ftp_domain(self) -> str: + return self.CONFIG.ftp_domain + @property def proxy_domain(self) -> str: return self.CONFIG.proxy_domain @@ -384,6 +504,10 @@ class Env: def https_port(self) -> int: return self.CONFIG.ports['https'] + @property + def nghttpx_https_port(self) -> int: + return self.CONFIG.ports['nghttpx_https'] + @property def h3_port(self) -> int: return self.https_port @@ -396,6 +520,14 @@ class Env: def proxys_port(self) -> int: return self.CONFIG.ports['proxys'] + @property + def ftp_port(self) -> int: + return self.CONFIG.ports['ftp'] + + @property + def ftps_port(self) -> int: + return self.CONFIG.ports['ftps'] + @property def h2proxys_port(self) -> int: return self.CONFIG.ports['h2proxys'] @@ -416,6 +548,10 @@ class Env: def caddy_http_port(self) -> int: return self.CONFIG.ports['caddy'] + @property + def vsftpd(self) -> str: + return self.CONFIG.vsftpd + @property def ws_port(self) -> int: return self.CONFIG.ports['ws'] @@ -449,33 +585,30 @@ class Env: def ci_run(self) -> bool: return "CURL_CI" in os.environ - def authority_for(self, domain: str, alpn_proto: Optional[str] = None): + def port_for(self, alpn_proto: Optional[str] = None): if alpn_proto is None or \ alpn_proto in ['h2', 'http/1.1', 'http/1.0', 'http/0.9']: - return f'{domain}:{self.https_port}' + return self.https_port if alpn_proto in ['h3']: - return f'{domain}:{self.h3_port}' - return f'{domain}:{self.http_port}' + return self.h3_port + return self.http_port - def make_data_file(self, indir: str, fname: str, fsize: int) -> str: + def authority_for(self, domain: str, alpn_proto: Optional[str] = None): + return f'{domain}:{self.port_for(alpn_proto=alpn_proto)}' + + def make_data_file(self, indir: str, fname: str, fsize: int, + line_length: int = 1024) -> str: + if line_length < 11: + raise RuntimeError('line_length less than 11 not supported') fpath = os.path.join(indir, fname) s10 = "0123456789" - s = (101 * s10) + s10[0:3] + s = round((line_length / 10) + 1) * s10 + s = s[0:line_length-11] with open(fpath, 'w') as fd: - for i in range(int(fsize / 1024)): + for i in range(int(fsize / line_length)): fd.write(f"{i:09d}-{s}\n") - remain = int(fsize % 1024) + remain = int(fsize % line_length) if remain != 0: - i = int(fsize / 1024) + 1 - s = f"{i:09d}-{s}\n" - fd.write(s[0:remain]) + i = int(fsize / line_length) + 1 + fd.write(f"{i:09d}-{s}"[0:remain-1] + "\n") return fpath - - def make_clients(self): - client_dir = os.path.join(self.project_dir, 'tests/http/clients') - p = subprocess.run(['make'], capture_output=True, text=True, - cwd=client_dir) - if p.returncode != 0: - pytest.exit(f"`make`in {client_dir} failed:\n{p.stderr}") - return False - return True diff --git a/deps/curl/tests/http/testenv/httpd.py b/deps/curl/tests/http/testenv/httpd.py index c04c2269..f3ca46f1 100644 --- a/deps/curl/tests/http/testenv/httpd.py +++ b/deps/curl/tests/http/testenv/httpd.py @@ -32,6 +32,7 @@ from datetime import timedelta, datetime from json import JSONEncoder import time from typing import List, Union, Optional +import copy from .curl import CurlClient, ExecResult from .env import Env @@ -50,6 +51,7 @@ class Httpd: 'alias', 'env', 'filter', 'headers', 'mime', 'setenvif', 'socache_shmcb', 'rewrite', 'http2', 'ssl', 'proxy', 'proxy_http', 'proxy_connect', + 'brotli', 'mpm_event', ] COMMON_MODULES_DIRS = [ @@ -77,6 +79,7 @@ class Httpd: self._auth_digest = True self._proxy_auth_basic = proxy_auth self._extra_configs = {} + self._loaded_extra_configs = None assert env.apxs p = subprocess.run(args=[env.apxs, '-q', 'libexecdir'], capture_output=True, text=True) @@ -84,7 +87,7 @@ class Httpd: raise Exception(f'{env.apxs} failed to query libexecdir: {p}') self._mods_dir = p.stdout.strip() if self._mods_dir is None: - raise Exception(f'apache modules dir cannot be found') + raise Exception('apache modules dir cannot be found') if not os.path.exists(self._mods_dir): raise Exception(f'apache modules dir does not exist: {self._mods_dir}') self._process = None @@ -114,9 +117,7 @@ class Httpd: self._proxy_auth_basic = active def _run(self, args, intext=''): - env = {} - for key, val in os.environ.items(): - env[key] = val + env = os.environ.copy() env['APACHE_RUN_DIR'] = self._run_dir env['APACHE_RUN_USER'] = os.environ['USER'] env['APACHE_LOCK_DIR'] = self._lock_dir @@ -150,10 +151,12 @@ class Httpd: if r.exit_code != 0: log.error(f'failed to start httpd: {r}') return False + self._loaded_extra_configs = copy.deepcopy(self._extra_configs) return self.wait_live(timeout=timedelta(seconds=5)) def stop(self): r = self._apachectl('stop') + self._loaded_extra_configs = None if r.exit_code == 0: return self.wait_dead(timeout=timedelta(seconds=5)) log.fatal(f'stopping httpd failed: {r}') @@ -166,10 +169,17 @@ class Httpd: def reload(self): self._write_config() r = self._apachectl("graceful") + self._loaded_extra_configs = None if r.exit_code != 0: log.error(f'failed to reload httpd: {r}') + self._loaded_extra_configs = copy.deepcopy(self._extra_configs) return self.wait_live(timeout=timedelta(seconds=5)) + def reload_if_config_changed(self): + if self._loaded_extra_configs == self._extra_configs: + return True + return self.reload() + def wait_dead(self, timeout: timedelta): curl = CurlClient(env=self.env, run_dir=self._tmp_dir) try_until = datetime.now() + timeout @@ -203,11 +213,15 @@ class Httpd: def _write_config(self): domain1 = self.env.domain1 + domain1brotli = self.env.domain1brotli creds1 = self.env.get_credentials(domain1) + assert creds1 # convince pytype this isn't None domain2 = self.env.domain2 creds2 = self.env.get_credentials(domain2) + assert creds2 # convince pytype this isn't None proxy_domain = self.env.proxy_domain proxy_creds = self.env.get_credentials(proxy_domain) + assert proxy_creds # convince pytype this isn't None self._mkpath(self._conf_dir) self._mkpath(self._logs_dir) self._mkpath(self._tmp_dir) @@ -236,44 +250,45 @@ class Httpd: if os.path.exists(os.path.join(self._mods_dir, f'mod_{m}.so')): fd.write(f'LoadModule {m}_module "{self._mods_dir}/mod_{m}.so"\n') if Httpd.MOD_CURLTEST is not None: - fd.write(f'LoadModule curltest_module \"{Httpd.MOD_CURLTEST}\"\n') + fd.write(f'LoadModule curltest_module "{Httpd.MOD_CURLTEST}"\n') conf = [ # base server config f'ServerRoot "{self._apache_dir}"', - f'DefaultRuntimeDir logs', - f'PidFile httpd.pid', + 'DefaultRuntimeDir logs', + 'PidFile httpd.pid', f'ErrorLog {self._error_log}', f'LogLevel {self._get_log_level()}', - f'StartServers 4', - f'H2MinWorkers 16', - f'H2MaxWorkers 256', - f'H2Direct on', + 'StartServers 4', + 'ReadBufferSize 16000', + 'H2MinWorkers 16', + 'H2MaxWorkers 256', f'Listen {self.env.http_port}', f'Listen {self.env.https_port}', f'Listen {self.env.proxy_port}', f'Listen {self.env.proxys_port}', f'TypesConfig "{self._conf_dir}/mime.types', - f'SSLSessionCache "shmcb:ssl_gcache_data(32000)"', + 'SSLSessionCache "shmcb:ssl_gcache_data(32000)"', ] if 'base' in self._extra_configs: conf.extend(self._extra_configs['base']) conf.extend([ # plain http host for domain1 f'', f' ServerName {domain1}', - f' ServerAlias localhost', + ' ServerAlias localhost', f' DocumentRoot "{self._docs_dir}"', - f' Protocols h2c http/1.1', + ' Protocols h2c http/1.1', + ' H2Direct on', ]) conf.extend(self._curltest_conf(domain1)) conf.extend([ - f'', - f'', + '', + '', ]) conf.extend([ # https host for domain1, h1 + h2 f'', f' ServerName {domain1}', - f' ServerAlias localhost', - f' Protocols h2 http/1.1', - f' SSLEngine on', + ' ServerAlias localhost', + ' Protocols h2 http/1.1', + ' SSLEngine on', f' SSLCertificateFile {creds1.cert_file}', f' SSLCertificateKeyFile {creds1.pkey_file}', f' DocumentRoot "{self._docs_dir}"', @@ -282,14 +297,44 @@ class Httpd: if domain1 in self._extra_configs: conf.extend(self._extra_configs[domain1]) conf.extend([ - f'', - f'', + '', + '', + ]) + # Alternate to domain1 with BROTLI compression + conf.extend([ # https host for domain1, h1 + h2 + f'', + f' ServerName {domain1brotli}', + ' Protocols h2 http/1.1', + ' SSLEngine on', + f' SSLCertificateFile {creds1.cert_file}', + f' SSLCertificateKeyFile {creds1.pkey_file}', + f' DocumentRoot "{self._docs_dir}"', + ' SetOutputFilter BROTLI_COMPRESS', + ]) + conf.extend(self._curltest_conf(domain1)) + if domain1 in self._extra_configs: + conf.extend(self._extra_configs[domain1]) + conf.extend([ + '', + '', + ]) + conf.extend([ # plain http host for domain2 + f'', + f' ServerName {domain2}', + ' ServerAlias localhost', + f' DocumentRoot "{self._docs_dir}"', + ' Protocols h2c http/1.1', + ]) + conf.extend(self._curltest_conf(domain2)) + conf.extend([ + '', + '', ]) conf.extend([ # https host for domain2, no h2 f'', f' ServerName {domain2}', - f' Protocols http/1.1', - f' SSLEngine on', + ' Protocols http/1.1', + ' SSLEngine on', f' SSLCertificateFile {creds2.cert_file}', f' SSLCertificateKeyFile {creds2.pkey_file}', f' DocumentRoot "{self._docs_dir}/two"', @@ -298,39 +343,39 @@ class Httpd: if domain2 in self._extra_configs: conf.extend(self._extra_configs[domain2]) conf.extend([ - f'', - f'', + '', + '', ]) conf.extend([ # http forward proxy f'', f' ServerName {proxy_domain}', - f' Protocols h2c http/1.1', - f' ProxyRequests On', - f' H2ProxyRequests On', - f' ProxyVia On', + ' Protocols h2c http/1.1', + ' ProxyRequests On', + ' H2ProxyRequests On', + ' ProxyVia On', f' AllowCONNECT {self.env.http_port} {self.env.https_port}', ]) conf.extend(self._get_proxy_conf()) conf.extend([ - f'', - f'', + '', + '', ]) conf.extend([ # https forward proxy f'', f' ServerName {proxy_domain}', - f' Protocols h2 http/1.1', - f' SSLEngine on', + ' Protocols h2 http/1.1', + ' SSLEngine on', f' SSLCertificateFile {proxy_creds.cert_file}', f' SSLCertificateKeyFile {proxy_creds.pkey_file}', - f' ProxyRequests On', - f' H2ProxyRequests On', - f' ProxyVia On', + ' ProxyRequests On', + ' H2ProxyRequests On', + ' ProxyVia On', f' AllowCONNECT {self.env.http_port} {self.env.https_port}', ]) conf.extend(self._get_proxy_conf()) conf.extend([ - f'', - f'', + '', + '', ]) fd.write("\n".join(conf)) @@ -344,19 +389,19 @@ class Httpd: def _get_proxy_conf(self): if self._proxy_auth_basic: return [ - f' ', - f' AuthType Basic', - f' AuthName "Restricted Proxy"', - f' AuthBasicProvider file', + ' ', + ' AuthType Basic', + ' AuthName "Restricted Proxy"', + ' AuthBasicProvider file', f' AuthUserFile "{self._basic_passwords}"', - f' Require user proxy', - f' ', + ' Require user proxy', + ' ', ] else: return [ - f' ', - f' Require ip 127.0.0.1', - f' ', + ' ', + ' Require ip 127.0.0.1', + ' ', ] def _get_log_level(self): @@ -372,39 +417,44 @@ class Httpd: lines = [] if Httpd.MOD_CURLTEST is not None: lines.extend([ - f' Redirect 301 /curltest/echo301 /curltest/echo', - f' Redirect 302 /curltest/echo302 /curltest/echo', - f' Redirect 303 /curltest/echo303 /curltest/echo', - f' Redirect 307 /curltest/echo307 /curltest/echo', - f' ', - f' SetHandler curltest-echo', - f' ', - f' ', - f' SetHandler curltest-put', - f' ', - f' ', - f' SetHandler curltest-tweak', - f' ', - f' Redirect 302 /tweak /curltest/tweak', - f' ', - f' SetHandler curltest-1_1-required', - f' ', - f' ', - f' SetHandler curltest-tweak', - f' SetEnv force-response-1.0 1', - f' ', - f' SetEnvIf Request_URI "/shutdown_unclean" ssl-unclean=1', + ' Redirect 302 /data.json.302 /data.json', + ' Redirect 301 /curltest/echo301 /curltest/echo', + ' Redirect 302 /curltest/echo302 /curltest/echo', + ' Redirect 303 /curltest/echo303 /curltest/echo', + ' Redirect 307 /curltest/echo307 /curltest/echo', + ' ', + ' SSLOptions StdEnvVars', + ' SetHandler curltest-sslinfo', + ' ', + ' ', + ' SetHandler curltest-echo', + ' ', + ' ', + ' SetHandler curltest-put', + ' ', + ' ', + ' SetHandler curltest-tweak', + ' ', + ' Redirect 302 /tweak /curltest/tweak', + ' ', + ' SetHandler curltest-1_1-required', + ' ', + ' ', + ' SetHandler curltest-tweak', + ' SetEnv force-response-1.0 1', + ' ', + ' SetEnvIf Request_URI "/shutdown_unclean" ssl-unclean=1', ]) if self._auth_digest: lines.extend([ f' ', - f' AuthType Digest', - f' AuthName "restricted area"', + ' AuthType Digest', + ' AuthName "restricted area"', f' AuthDigestDomain "https://{servername}"', - f' AuthBasicProvider file', + ' AuthBasicProvider file', f' AuthUserFile "{self._digest_passwords}"', - f' Require valid-user', - f' ', + ' Require valid-user', + ' ', ]) return lines diff --git a/deps/curl/tests/http/testenv/mod_curltest/mod_curltest.c b/deps/curl/tests/http/testenv/mod_curltest/mod_curltest.c index a066be52..2b57a082 100644 --- a/deps/curl/tests/http/testenv/mod_curltest/mod_curltest.c +++ b/deps/curl/tests/http/testenv/mod_curltest/mod_curltest.c @@ -21,6 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#include + #include #include #include @@ -38,8 +40,10 @@ static int curltest_echo_handler(request_rec *r); static int curltest_put_handler(request_rec *r); static int curltest_tweak_handler(request_rec *r); static int curltest_1_1_required(request_rec *r); +static int curltest_sslinfo_handler(request_rec *r); -AP_DECLARE_MODULE(curltest) = { +AP_DECLARE_MODULE(curltest) = +{ STANDARD20_MODULE_STUFF, NULL, /* func to create per dir config */ NULL, /* func to merge per dir config */ @@ -86,13 +90,14 @@ static void curltest_hooks(apr_pool_t *pool) ap_hook_handler(curltest_put_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_handler(curltest_tweak_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_handler(curltest_1_1_required, NULL, NULL, APR_HOOK_MIDDLE); + 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) -static apr_status_t duration_parse(apr_interval_time_t *ptimeout, const char *value, - const char *def_unit) +static apr_status_t duration_parse(apr_interval_time_t *ptimeout, + const char *value, const char *def_unit) { char *endp; apr_int64_t n; @@ -102,7 +107,8 @@ static apr_status_t duration_parse(apr_interval_time_t *ptimeout, const char *va return errno; } if(!endp || !*endp) { - if (!def_unit) def_unit = "s"; + if(!def_unit) + def_unit = "s"; } else if(endp == value) { return APR_EINVAL; @@ -181,6 +187,8 @@ static int curltest_echo_handler(request_rec *r) apr_status_t rv; char buffer[8192]; const char *ct; + apr_off_t die_after_len = -1, total_read_len = 0; + int just_die = 0, die_after_100 = 0; long l; if(strcmp(r->handler, "curltest-echo")) { @@ -191,29 +199,94 @@ static int curltest_echo_handler(request_rec *r) } ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "echo_handler: processing"); + if(r->args) { + apr_array_header_t *args = NULL; + int i; + args = apr_cstr_split(r->args, "&", 1, r->pool); + for(i = 0; i < args->nelts; ++i) { + char *s, *val, *arg = APR_ARRAY_IDX(args, i, char *); + s = strchr(arg, '='); + if(s) { + *s = '\0'; + val = s + 1; + if(!strcmp("die_after", arg)) { + die_after_len = (apr_off_t)apr_atoi64(val); + continue; + } + else if(!strcmp("just_die", arg)) { + just_die = 1; + continue; + } + else if(!strcmp("die_after_100", arg)) { + die_after_100 = 1; + continue; + } + } + } + } + + if(just_die) { + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, + "echo_handler: dying right away"); + /* Generate no HTTP response at all. */ + ap_remove_output_filter_byhandle(r->output_filters, "HTTP_HEADER"); + r->connection->keepalive = AP_CONN_CLOSE; + return AP_FILTER_ERROR; + } + r->status = 200; - r->clength = -1; - r->chunked = 1; - apr_table_unset(r->headers_out, "Content-Length"); + if(die_after_len >= 0) { + r->clength = die_after_len + 1; + r->chunked = 0; + apr_table_set(r->headers_out, "Content-Length", + apr_ltoa(r->pool, (long)r->clength)); + } + else { + r->clength = -1; + r->chunked = 1; + apr_table_unset(r->headers_out, "Content-Length"); + } /* Discourage content-encodings */ apr_table_unset(r->headers_out, "Content-Encoding"); apr_table_setn(r->subprocess_env, "no-brotli", "1"); apr_table_setn(r->subprocess_env, "no-gzip", "1"); ct = apr_table_get(r->headers_in, "content-type"); - ap_set_content_type(r, ct? ct : "application/octet-stream"); + ap_set_content_type(r, ct ? ct : "application/octet-stream"); bb = apr_brigade_create(r->pool, c->bucket_alloc); /* copy any request body into the response */ - if((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) goto cleanup; + rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK); + if(rv) + goto cleanup; + if(die_after_100) { + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, + "echo_handler: dying after 100-continue"); + /* Generate no HTTP response at all. */ + ap_remove_output_filter_byhandle(r->output_filters, "HTTP_HEADER"); + r->connection->keepalive = AP_CONN_CLOSE; + return AP_FILTER_ERROR; + } if(ap_should_client_block(r)) { while(0 < (l = ap_get_client_block(r, &buffer[0], sizeof(buffer)))) { + total_read_len += l; + if(die_after_len >= 0 && total_read_len >= die_after_len) { + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, + "echo_handler: dying after %ld bytes as requested", + (long)total_read_len); + ap_pass_brigade(r->output_filters, bb); + ap_remove_output_filter_byhandle(r->output_filters, "HTTP_HEADER"); + r->connection->keepalive = AP_CONN_CLOSE; + return DONE; + } ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "echo_handler: copying %ld bytes from request body", l); rv = apr_brigade_write(bb, NULL, NULL, buffer, l); - if (APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; rv = ap_pass_brigade(r->output_filters, bb); - if (APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "echo_handler: passed %ld bytes from request body", l); } @@ -257,22 +330,27 @@ static int curltest_tweak_handler(request_rec *r) int i, chunks = 3, error_bucket = 1; size_t chunk_size = sizeof(buffer); const char *request_id = "none"; - apr_time_t delay = 0, chunk_delay = 0; + apr_time_t delay = 0, chunk_delay = 0, close_delay = 0; apr_array_header_t *args = NULL; int http_status = 200; apr_status_t error = APR_SUCCESS, body_error = APR_SUCCESS; + int close_conn = 0, with_cl = 0; if(strcmp(r->handler, "curltest-tweak")) { return DECLINED; } - if(r->method_number != M_GET && r->method_number != M_POST) { + if(r->method_number == M_DELETE) { + http_status = 204; + chunks = 0; + } + else if(r->method_number != M_GET && r->method_number != M_POST) { return DECLINED; } if(r->args) { args = apr_cstr_split(r->args, "&", 1, r->pool); for(i = 0; i < args->nelts; ++i) { - char *s, *val, *arg = APR_ARRAY_IDX(args, i, char*); + char *s, *val, *arg = APR_ARRAY_IDX(args, i, char *); s = strchr(arg, '='); if(s) { *s = '\0'; @@ -334,6 +412,21 @@ static int curltest_tweak_handler(request_rec *r) continue; } } + else if(!strcmp("close_delay", arg)) { + rv = duration_parse(&close_delay, val, "s"); + if(APR_SUCCESS == rv) { + continue; + } + } + } + else if(!strcmp("close", arg)) { + /* we are asked to close the connection */ + close_conn = 1; + continue; + } + else if(!strcmp("with_cl", arg)) { + with_cl = 1; + continue; } ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "query parameter not " "understood: '%s' in %s", @@ -346,10 +439,15 @@ static int curltest_tweak_handler(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "error_handler: processing " "request, %s", r->args? r->args : "(no args)"); r->status = http_status; - r->clength = -1; - r->chunked = (r->proto_num >= HTTP_VERSION(1,1)); + r->clength = with_cl ? (chunks * chunk_size) : -1; + r->chunked = (r->proto_num >= HTTP_VERSION(1, 1)) && !with_cl; apr_table_setn(r->headers_out, "request-id", request_id); - apr_table_unset(r->headers_out, "Content-Length"); + if(r->clength >= 0) { + apr_table_set(r->headers_out, "Content-Length", + apr_ltoa(r->pool, (long)r->clength)); + } + else + apr_table_unset(r->headers_out, "Content-Length"); /* Discourage content-encodings */ apr_table_unset(r->headers_out, "Content-Encoding"); apr_table_setn(r->subprocess_env, "no-brotli", "1"); @@ -368,7 +466,8 @@ static int curltest_tweak_handler(request_rec *r) b = apr_bucket_flush_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); rv = ap_pass_brigade(r->output_filters, bb); - if (APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; memset(buffer, 'X', sizeof(buffer)); for(i = 0; i < chunks; ++i) { @@ -376,9 +475,11 @@ static int curltest_tweak_handler(request_rec *r) apr_sleep(chunk_delay); } rv = apr_brigade_write(bb, NULL, NULL, buffer, chunk_size); - if(APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; rv = ap_pass_brigade(r->output_filters, bb); - if(APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "error_handler: passed %lu bytes as response body", (unsigned long)chunk_size); @@ -396,9 +497,19 @@ static int curltest_tweak_handler(request_rec *r) "error_handler: response passed"); cleanup: + if(close_conn) { + if(close_delay) { + b = apr_bucket_flush_create(c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, b); + rv = ap_pass_brigade(r->output_filters, bb); + apr_brigade_cleanup(bb); + apr_sleep(close_delay); + } + r->connection->keepalive = AP_CONN_CLOSE; + } ap_log_rerror(APLOG_MARK, APLOG_TRACE1, rv, r, - "error_handler: request cleanup, r->status=%d, aborted=%d", - r->status, c->aborted); + "error_handler: request cleanup, r->status=%d, aborted=%d, " + "close=%d", r->status, c->aborted, close_conn); if(rv == APR_SUCCESS) { return OK; } @@ -420,12 +531,13 @@ static int curltest_put_handler(request_rec *r) apr_bucket_brigade *bb; apr_bucket *b; apr_status_t rv; - char buffer[16*1024]; + char buffer[128*1024]; const char *ct; apr_off_t rbody_len = 0; + apr_off_t rbody_max_len = -1; const char *s_rbody_len; const char *request_id = "none"; - apr_time_t chunk_delay = 0; + apr_time_t read_delay = 0, chunk_delay = 0; apr_array_header_t *args = NULL; long l; int i; @@ -440,7 +552,7 @@ static int curltest_put_handler(request_rec *r) if(r->args) { args = apr_cstr_split(r->args, "&", 1, r->pool); for(i = 0; i < args->nelts; ++i) { - char *s, *val, *arg = APR_ARRAY_IDX(args, i, char*); + char *s, *val, *arg = APR_ARRAY_IDX(args, i, char *); s = strchr(arg, '='); if(s) { *s = '\0'; @@ -450,12 +562,22 @@ static int curltest_put_handler(request_rec *r) request_id = val; continue; } + else if(!strcmp("read_delay", arg)) { + rv = duration_parse(&read_delay, val, "s"); + if(APR_SUCCESS == rv) { + continue; + } + } else if(!strcmp("chunk_delay", arg)) { rv = duration_parse(&chunk_delay, val, "s"); if(APR_SUCCESS == rv) { continue; } } + else if(!strcmp("max_upload", arg)) { + rbody_max_len = (int)apr_atoi64(val); + continue; + } } ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "query parameter not " "understood: '%s' in %s", @@ -476,11 +598,16 @@ static int curltest_put_handler(request_rec *r) apr_table_setn(r->subprocess_env, "no-gzip", "1"); ct = apr_table_get(r->headers_in, "content-type"); - ap_set_content_type(r, ct? ct : "text/plain"); + ap_set_content_type(r, ct ? ct : "text/plain"); + if(read_delay) { + apr_sleep(read_delay); + } bb = apr_brigade_create(r->pool, c->bucket_alloc); /* copy any request body into the response */ - if((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) goto cleanup; + rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK); + if(rv) + goto cleanup; if(ap_should_client_block(r)) { while(0 < (l = ap_get_client_block(r, &buffer[0], sizeof(buffer)))) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, @@ -489,19 +616,28 @@ static int curltest_put_handler(request_rec *r) apr_sleep(chunk_delay); } rbody_len += l; + if((rbody_max_len > 0) && (rbody_len > rbody_max_len)) { + r->status = 413; + break; + } } } /* we are done */ 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) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; b = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "put_handler: request read"); rv = ap_pass_brigade(r->output_filters, bb); + if(r->status == 413) { + apr_sleep(apr_time_from_sec(1)); + } + cleanup: if(rv == APR_SUCCESS || r->status != HTTP_OK @@ -535,7 +671,7 @@ static int curltest_1_1_required(request_rec *r) return DECLINED; } - if (HTTP_VERSION_MAJOR(r->proto_num) > 1) { + if(HTTP_VERSION_MAJOR(r->proto_num) > 1) { apr_table_setn(r->notes, "ssl-renegotiate-forbidden", "1"); ap_die(HTTP_FORBIDDEN, r); return OK; @@ -552,18 +688,20 @@ static int curltest_1_1_required(request_rec *r) apr_table_setn(r->subprocess_env, "no-gzip", "1"); ct = apr_table_get(r->headers_in, "content-type"); - ap_set_content_type(r, ct? ct : "text/plain"); + ap_set_content_type(r, ct ? ct : "text/plain"); bb = apr_brigade_create(r->pool, c->bucket_alloc); /* flush response */ b = apr_bucket_flush_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); rv = ap_pass_brigade(r->output_filters, bb); - if (APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; /* we are done */ rv = apr_brigade_printf(bb, NULL, NULL, "well done!"); - if(APR_SUCCESS != rv) goto cleanup; + if(APR_SUCCESS != rv) + goto cleanup; b = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "1_1_handler: request read"); @@ -584,3 +722,115 @@ cleanup: } return DECLINED; } + +static int brigade_env_var(request_rec *r, apr_bucket_brigade *bb, + const char *name) +{ + const char *s; + s = apr_table_get(r->subprocess_env, name); + if(s) + return apr_brigade_printf(bb, NULL, NULL, ",\n \"%s\": \"%s\"", name, s); + return 0; +} + +static int curltest_sslinfo_handler(request_rec *r) +{ + conn_rec *c = r->connection; + 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")) { + return DECLINED; + } + if(r->method_number != M_GET) { + return DECLINED; + } + + if(r->args) { + apr_array_header_t *args = apr_cstr_split(r->args, "&", 1, r->pool); + for(i = 0; i < args->nelts; ++i) { + char *s, *val, *arg = APR_ARRAY_IDX(args, i, char *); + s = strchr(arg, '='); + if(s) { + *s = '\0'; + val = s + 1; + if(!strcmp("id", arg)) { + /* just an id for repeated requests with curl's url globbing */ + request_id = val; + continue; + } + } + else if(!strcmp("close", arg)) { + /* we are asked to close the connection */ + close_conn = 1; + continue; + } + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "query parameter not " + "understood: '%s' in %s", + arg, r->args); + ap_die(HTTP_BAD_REQUEST, r); + return OK; + } + } + + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "sslinfo: processing"); + r->status = 200; + r->clength = -1; + r->chunked = 1; + apr_table_unset(r->headers_out, "Content-Length"); + /* Discourage content-encodings */ + apr_table_unset(r->headers_out, "Content-Encoding"); + apr_table_setn(r->subprocess_env, "no-brotli", "1"); + apr_table_setn(r->subprocess_env, "no-gzip", "1"); + + ap_set_content_type(r, "application/json"); + + bb = apr_brigade_create(r->pool, c->bucket_alloc); + + apr_brigade_puts(bb, NULL, NULL, "{\n \"Name\": \"SSL-Information\""); + brigade_env_var(r, bb, "HTTPS"); + brigade_env_var(r, bb, "SSL_PROTOCOL"); + brigade_env_var(r, bb, "SSL_CIPHER"); + brigade_env_var(r, bb, "SSL_SESSION_ID"); + brigade_env_var(r, bb, "SSL_SESSION_RESUMED"); + brigade_env_var(r, bb, "SSL_SRP_USER"); + brigade_env_var(r, bb, "SSL_SRP_USERINFO"); + brigade_env_var(r, bb, "SSL_TLS_SNI"); + apr_brigade_puts(bb, NULL, NULL, "}\n"); + + /* flush response */ + b = apr_bucket_flush_create(c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, b); + rv = ap_pass_brigade(r->output_filters, bb); + if(APR_SUCCESS != rv) + goto cleanup; + + /* we are done */ + b = apr_bucket_eos_create(c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, b); + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "1_1_handler: request read"); + + rv = ap_pass_brigade(r->output_filters, bb); + +cleanup: + if(close_conn) + r->connection->keepalive = AP_CONN_CLOSE; + 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; + } + else { + /* no way to know what type of error occurred */ + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, rv, r, "1_1_handler failed"); + return AP_FILTER_ERROR; + } + return DECLINED; +} diff --git a/deps/curl/tests/http/testenv/nghttpx.py b/deps/curl/tests/http/testenv/nghttpx.py index 9544ce05..801d9a63 100644 --- a/deps/curl/tests/http/testenv/nghttpx.py +++ b/deps/curl/tests/http/testenv/nghttpx.py @@ -41,10 +41,11 @@ log = logging.getLogger(__name__) class Nghttpx: - def __init__(self, env: Env, port: int, name: str): + def __init__(self, env: Env, port: int, https_port: int, name: str): self.env = env self._name = name self._port = port + self._https_port = https_port self._cmd = env.nghttpx self._run_dir = os.path.join(env.gen_dir, name) self._pid_file = os.path.join(self._run_dir, 'nghttpx.pid') @@ -52,15 +53,18 @@ class Nghttpx: self._error_log = os.path.join(self._run_dir, 'nghttpx.log') self._stderr = os.path.join(self._run_dir, 'nghttpx.stderr') self._tmp_dir = os.path.join(self._run_dir, 'tmp') - self._process = None self._process: Optional[subprocess.Popen] = None self._rmf(self._pid_file) self._rmf(self._error_log) self._mkpath(self._run_dir) self._write_config() + @property + def https_port(self): + return self._https_port + def exists(self): - return os.path.exists(self._cmd) + return self._cmd and os.path.exists(self._cmd) def clear_logs(self): self._rmf(self._error_log) @@ -128,10 +132,18 @@ class Nghttpx: curl = CurlClient(env=self.env, run_dir=self._tmp_dir) try_until = datetime.now() + timeout while datetime.now() < try_until: - check_url = f'https://{self.env.domain1}:{self._port}/' - r = curl.http_get(url=check_url, extra_args=[ - '--http3-only', '--connect-timeout', '1' - ]) + if self._https_port > 0: + check_url = f'https://{self.env.domain1}:{self._https_port}/' + r = curl.http_get(url=check_url, extra_args=[ + '--trace', 'curl.trace', '--trace-time', + '--connect-timeout', '1' + ]) + else: + check_url = f'https://{self.env.domain1}:{self._port}/' + r = curl.http_get(url=check_url, extra_args=[ + '--trace', 'curl.trace', '--trace-time', + '--http3-only', '--connect-timeout', '1' + ]) if r.exit_code != 0: return True log.debug(f'waiting for nghttpx to stop responding: {r}') @@ -143,11 +155,18 @@ class Nghttpx: curl = CurlClient(env=self.env, run_dir=self._tmp_dir) try_until = datetime.now() + timeout while datetime.now() < try_until: - check_url = f'https://{self.env.domain1}:{self._port}/' - r = curl.http_get(url=check_url, extra_args=[ - '--http3-only', '--trace', 'curl.trace', '--trace-time', - '--connect-timeout', '1' - ]) + if self._https_port > 0: + check_url = f'https://{self.env.domain1}:{self._https_port}/' + r = curl.http_get(url=check_url, extra_args=[ + '--trace', 'curl.trace', '--trace-time', + '--connect-timeout', '1' + ]) + else: + check_url = f'https://{self.env.domain1}:{self._port}/' + r = curl.http_get(url=check_url, extra_args=[ + '--http3-only', '--trace', 'curl.trace', '--trace-time', + '--connect-timeout', '1' + ]) if r.exit_code == 0: return True log.debug(f'waiting for nghttpx to become responsive: {r}') @@ -165,7 +184,7 @@ class Nghttpx: def _write_config(self): with open(self._conf_file, 'w') as fd: - fd.write(f'# nghttpx test config'), + fd.write('# nghttpx test config') fd.write("\n".join([ '# do we need something here?' ])) @@ -174,28 +193,32 @@ class Nghttpx: class NghttpxQuic(Nghttpx): def __init__(self, env: Env): - super().__init__(env=env, name='nghttpx-quic', port=env.h3_port) + super().__init__(env=env, name='nghttpx-quic', port=env.h3_port, + https_port=env.nghttpx_https_port) def start(self, wait_live=True): self._mkpath(self._tmp_dir) if self._process: self.stop() + creds = self.env.get_credentials(self.env.domain1) + assert creds # convince pytype this isn't None args = [ self._cmd, f'--frontend=*,{self.env.h3_port};quic', + f'--frontend=*,{self.env.nghttpx_https_port};tls', f'--backend=127.0.0.1,{self.env.https_port};{self.env.domain1};sni={self.env.domain1};proto=h2;tls', f'--backend=127.0.0.1,{self.env.http_port}', - f'--log-level=INFO', + '--log-level=INFO', f'--pid-file={self._pid_file}', f'--errorlog-file={self._error_log}', f'--conf={self._conf_file}', f'--cacert={self.env.ca.cert_file}', - self.env.get_credentials(self.env.domain1).pkey_file, - self.env.get_credentials(self.env.domain1).cert_file, - f'--frontend-http3-window-size=1M', - f'--frontend-http3-max-window-size=10M', - f'--frontend-http3-connection-window-size=10M', - f'--frontend-http3-max-connection-window-size=100M', + creds.pkey_file, + creds.cert_file, + '--frontend-http3-window-size=1M', + '--frontend-http3-max-window-size=10M', + '--frontend-http3-connection-window-size=10M', + '--frontend-http3-max-connection-window-size=100M', # f'--frontend-quic-debug-log', ] ngerr = open(self._stderr, 'a') @@ -208,24 +231,27 @@ class NghttpxQuic(Nghttpx): class NghttpxFwd(Nghttpx): def __init__(self, env: Env): - super().__init__(env=env, name='nghttpx-fwd', port=env.h2proxys_port) + super().__init__(env=env, name='nghttpx-fwd', port=env.h2proxys_port, + https_port=0) def start(self, wait_live=True): self._mkpath(self._tmp_dir) if self._process: self.stop() + creds = self.env.get_credentials(self.env.proxy_domain) + assert creds # convince pytype this isn't None args = [ self._cmd, - f'--http2-proxy', + '--http2-proxy', f'--frontend=*,{self.env.h2proxys_port}', f'--backend=127.0.0.1,{self.env.proxy_port}', - f'--log-level=INFO', + '--log-level=INFO', f'--pid-file={self._pid_file}', f'--errorlog-file={self._error_log}', f'--conf={self._conf_file}', f'--cacert={self.env.ca.cert_file}', - self.env.get_credentials(self.env.proxy_domain).pkey_file, - self.env.get_credentials(self.env.proxy_domain).cert_file, + creds.pkey_file, + creds.cert_file, ] ngerr = open(self._stderr, 'a') self._process = subprocess.Popen(args=args, stderr=ngerr) diff --git a/deps/curl/tests/http/testenv/vsftpd.py b/deps/curl/tests/http/testenv/vsftpd.py new file mode 100644 index 00000000..5f4f0c06 --- /dev/null +++ b/deps/curl/tests/http/testenv/vsftpd.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#*************************************************************************** +# _ _ ____ _ +# 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 +# +########################################################################### +# +import logging +import os +import subprocess +import time + +from datetime import datetime, timedelta + +from .curl import CurlClient +from .env import Env + + +log = logging.getLogger(__name__) + + +class VsFTPD: + + def __init__(self, env: Env, with_ssl=False): + self.env = env + self._cmd = env.vsftpd + self._scheme = 'ftp' + self._with_ssl = with_ssl + if self._with_ssl: + self._port = self.env.ftps_port + name = 'vsftpds' + else: + self._port = self.env.ftp_port + name = 'vsftpd' + self._vsftpd_dir = os.path.join(env.gen_dir, name) + self._run_dir = os.path.join(self._vsftpd_dir, 'run') + self._docs_dir = os.path.join(self._vsftpd_dir, 'docs') + self._tmp_dir = os.path.join(self._vsftpd_dir, 'tmp') + self._conf_file = os.path.join(self._vsftpd_dir, 'test.conf') + self._pid_file = os.path.join(self._vsftpd_dir, 'vsftpd.pid') + self._error_log = os.path.join(self._vsftpd_dir, 'vsftpd.log') + self._process = None + + self.clear_logs() + + @property + def domain(self): + return self.env.ftp_domain + + @property + def docs_dir(self): + return self._docs_dir + + @property + def port(self) -> int: + return self._port + + def clear_logs(self): + self._rmf(self._error_log) + + def exists(self): + return os.path.exists(self._cmd) + + def is_running(self): + if self._process: + self._process.poll() + return self._process.returncode is None + return False + + def start_if_needed(self): + if not self.is_running(): + return self.start() + return True + + def stop_if_running(self): + if self.is_running(): + return self.stop() + return True + + def stop(self, wait_dead=True): + self._mkpath(self._tmp_dir) + if self._process: + self._process.terminate() + self._process.wait(timeout=2) + self._process = None + return not wait_dead or self.wait_dead(timeout=timedelta(seconds=5)) + return True + + def restart(self): + self.stop() + return self.start() + + def start(self, wait_live=True): + self._mkpath(self._tmp_dir) + if self._process: + self.stop() + self._write_config() + args = [ + self._cmd, + f'{self._conf_file}', + ] + procerr = open(self._error_log, 'a') + self._process = subprocess.Popen(args=args, stderr=procerr) + if self._process.returncode is not None: + return False + return not wait_live or self.wait_live(timeout=timedelta(seconds=5)) + + def wait_dead(self, timeout: timedelta): + curl = CurlClient(env=self.env, run_dir=self._tmp_dir) + try_until = datetime.now() + timeout + while datetime.now() < try_until: + check_url = f'{self._scheme}://{self.domain}:{self.port}/' + r = curl.ftp_get(urls=[check_url], extra_args=['-v']) + if r.exit_code != 0: + return True + log.debug(f'waiting for vsftpd to stop responding: {r}') + time.sleep(.1) + log.debug(f"Server still responding after {timeout}") + return False + + def wait_live(self, timeout: timedelta): + curl = CurlClient(env=self.env, run_dir=self._tmp_dir) + try_until = datetime.now() + timeout + while datetime.now() < try_until: + check_url = f'{self._scheme}://{self.domain}:{self.port}/' + r = curl.ftp_get(urls=[check_url], extra_args=[ + '--trace', 'curl-start.trace', '--trace-time' + ]) + if r.exit_code == 0: + return True + log.debug(f'waiting for vsftpd to become responsive: {r}') + time.sleep(.1) + log.error(f"Server still not responding after {timeout}") + return False + + def _rmf(self, path): + if os.path.exists(path): + return os.remove(path) + + def _mkpath(self, path): + if not os.path.exists(path): + return os.makedirs(path) + + def _write_config(self): + self._mkpath(self._docs_dir) + self._mkpath(self._tmp_dir) + conf = [ # base server config + 'listen=YES', + 'run_as_launching_user=YES', + '#listen_address=127.0.0.1', + f'listen_port={self.port}', + 'local_enable=NO', + 'anonymous_enable=YES', + f'anon_root={self._docs_dir}', + 'dirmessage_enable=YES', + 'write_enable=YES', + 'anon_upload_enable=YES', + 'log_ftp_protocol=YES', + 'xferlog_enable=YES', + 'xferlog_std_format=NO', + f'vsftpd_log_file={self._error_log}', + '\n', + ] + if self._with_ssl: + creds = self.env.get_credentials(self.domain) + assert creds # convince pytype this isn't None + conf.extend([ + 'ssl_enable=YES', + 'debug_ssl=YES', + 'allow_anon_ssl=YES', + f'rsa_cert_file={creds.cert_file}', + f'rsa_private_key_file={creds.pkey_file}', + # require_ssl_reuse=YES means ctrl and data connection need to use the same session + 'require_ssl_reuse=NO', + ]) + + with open(self._conf_file, 'w') as fd: + fd.write("\n".join(conf)) diff --git a/deps/curl/tests/http/testenv/ws_echo_server.py b/deps/curl/tests/http/testenv/ws_echo_server.py index d13f757c..99eaa628 100644 --- a/deps/curl/tests/http/testenv/ws_echo_server.py +++ b/deps/curl/tests/http/testenv/ws_echo_server.py @@ -27,7 +27,6 @@ import argparse import asyncio import logging -from asyncio import IncompleteReadError from websockets import server from websockets.exceptions import ConnectionClosedError diff --git a/deps/curl/tests/http2-server.pl b/deps/curl/tests/http2-server.pl index 52c5284c..fef17680 100644 --- a/deps/curl/tests/http2-server.pl +++ b/deps/curl/tests/http2-server.pl @@ -38,6 +38,7 @@ my $listenport2 = 9016; my $connect = "127.0.0.1,8990"; my $conf = "nghttpx.conf"; my $cert = "Server-localhost-sv"; +my $dev_null = ($^O eq 'MSWin32' ? 'NUL' : '/dev/null'); #*************************************************************************** # Process command line options @@ -108,6 +109,7 @@ $certfile = abs_path($certfile); $keyfile = abs_path($keyfile); my $cmdline="$nghttpx --backend=$connect ". + "--backend-keep-alive-timeout=500ms ". "--frontend=\"*,$listenport;no-tls\" ". "--frontend=\"*,$listenport2\" ". "--log-level=INFO ". @@ -116,4 +118,4 @@ my $cmdline="$nghttpx --backend=$connect ". "--errorlog-file=$logfile ". "$keyfile $certfile"; print "RUN: $cmdline\n" if($verbose); -system("$cmdline 2>/dev/null"); +exec("exec $cmdline 2>$dev_null"); diff --git a/deps/curl/tests/http3-server.pl b/deps/curl/tests/http3-server.pl index bc9e98ad..489053c1 100644 --- a/deps/curl/tests/http3-server.pl +++ b/deps/curl/tests/http3-server.pl @@ -38,6 +38,7 @@ my $listenport = 9017; my $connect = "127.0.0.1,8990"; my $cert = "Server-localhost-sv"; my $conf = "nghttpx.conf"; +my $dev_null = ($^O eq 'MSWin32' ? 'NUL' : '/dev/null'); #*************************************************************************** # Process command line options @@ -108,6 +109,7 @@ $certfile = abs_path($certfile); $keyfile = abs_path($keyfile); my $cmdline="$nghttpx --http2-proxy --backend=$connect ". + "--backend-keep-alive-timeout=500ms ". "--frontend=\"*,$listenport\" ". "--frontend=\"*,$listenport;quic\" ". "--log-level=INFO ". @@ -116,4 +118,4 @@ my $cmdline="$nghttpx --http2-proxy --backend=$connect ". "--conf=$conf ". "$keyfile $certfile"; print "RUN: $cmdline\n" if($verbose); -system("$cmdline 2>/dev/null"); +exec("exec $cmdline 2>$dev_null"); diff --git a/deps/curl/tests/libtest/.gitignore b/deps/curl/tests/libtest/.gitignore index 9541d16e..9fd1a098 100644 --- a/deps/curl/tests/libtest/.gitignore +++ b/deps/curl/tests/libtest/.gitignore @@ -2,10 +2,10 @@ # # SPDX-License-Identifier: curl -chkhostname lib[1234][0-9][0-9][0-9] lib[56][0-9][0-9] lib1521.c +libtests.c libauthretry libntlmconnect libprereq diff --git a/deps/curl/tests/libtest/CMakeLists.txt b/deps/curl/tests/libtest/CMakeLists.txt index b6450ff3..d60f7a33 100644 --- a/deps/curl/tests/libtest/CMakeLists.txt +++ b/deps/curl/tests/libtest/CMakeLists.txt @@ -21,68 +21,66 @@ # SPDX-License-Identifier: curl # ########################################################################### -set(TARGET_LABEL_PREFIX "Test ") - -function(setup_test TEST_NAME) # ARGN are the files in the test - - if(LIB_SELECTED STREQUAL LIB_STATIC) - # These are part of the libcurl static lib. Do not compile/link them again. - list(REMOVE_ITEM ARGN ${WARNLESS} ${MULTIBYTE} ${TIMEDIFF}) - endif() - - add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) - add_dependencies(testdeps ${TEST_NAME}) - string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME) - - include_directories( - ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" - ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" - ${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h" - ${CURL_SOURCE_DIR}/tests/libtest # To be able to build generated tests - ) - if(USE_ARES) - include_directories(${CARES_INCLUDE_DIR}) - endif() - - target_link_libraries(${TEST_NAME} ${LIB_SELECTED} ${CURL_LIBS}) - - set_target_properties(${TEST_NAME} - PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME}) - set_target_properties(${TEST_NAME} - PROPERTIES PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}") -endfunction() - +# Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'TIMEDIFF', 'THREADS', 'FIRSTFILES' variables transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) +include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -foreach(TEST_NAME ${noinst_PROGRAMS}) - if(DEFINED ${TEST_NAME}_SOURCES) - setup_test(${TEST_NAME} ${${TEST_NAME}_SOURCES}) - else() - setup_test(${TEST_NAME} ${nodist_${TEST_NAME}_SOURCES}) - endif() -endforeach() +set_source_files_properties("../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) -# Allows for hostname override to make tests machine independent. -# TODO this cmake build assumes a shared build, detect static linking here! -if(NOT WIN32) - add_library(hostname MODULE EXCLUDE_FROM_ALL sethostname.c) - add_dependencies(testdeps hostname) - # Output to .libs for compatibility with autotools, the test data expects a - # library at (tests)/libtest/.libs/libhostname.so - set_target_properties(hostname PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.libs) - if(HIDES_CURL_PRIVATE_SYMBOLS) - set_property(TARGET hostname APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS") - set_property(TARGET hostname APPEND PROPERTY COMPILE_FLAGS ${CURL_CFLAG_SYMBOLS_HIDE}) +add_custom_command( + OUTPUT "lib1521.c" + COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" < "${PROJECT_SOURCE_DIR}/include/curl/curl.h" "lib1521.c" + DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" + "${PROJECT_SOURCE_DIR}/include/curl/curl.h" + VERBATIM) + +if(CURL_TEST_BUNDLES) + add_custom_command( + OUTPUT "libtest_bundle.c" + COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "libtest_bundle.c" + DEPENDS + "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" ${FIRSTFILES} "lib1521.c" + "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" + VERBATIM) + + set(LIBTESTPROGS "libtests") + set(libtests_SOURCES "libtest_bundle.c") + list(APPEND libtests_SOURCES ${TESTUTIL} ${TSTTRACE}) + if(LIB_SELECTED STREQUAL LIB_SHARED) + # These are part of the libcurl static lib. Add them here when linking shared. + list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${TIMEDIFF} ${THREADS}) endif() endif() -add_custom_command( - OUTPUT lib1521.c - COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl < ${CURL_SOURCE_DIR}/include/curl/curl.h > lib1521.c - DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" - "${CURL_SOURCE_DIR}/include/curl/curl.h" - VERBATIM) +foreach(_target IN LISTS LIBTESTPROGS) + if(DEFINED ${_target}_SOURCES) + set(_sources ${${_target}_SOURCES}) + else() + set(_sources ${nodist_${_target}_SOURCES}) + endif() + + if(LIB_SELECTED STREQUAL LIB_STATIC) + # These are part of the libcurl static lib. Do not compile/link them again. + list(REMOVE_ITEM _sources ${WARNLESS} ${MULTIBYTE} ${TIMEDIFF} ${THREADS}) + endif() + + string(TOUPPER ${_target} _upper_target) + set(_target_name "${_target}") + add_executable(${_target_name} EXCLUDE_FROM_ALL ${_sources}) + add_dependencies(testdeps ${_target_name}) + target_link_libraries(${_target_name} ${LIB_SELECTED} ${CURL_LIBS}) + target_include_directories(${_target_name} PRIVATE + "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" + "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" + "${PROJECT_SOURCE_DIR}/tests/libtest" # to be able to build generated tests + ) + if(NOT CURL_TEST_BUNDLES) + set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS ${_upper_target}) + endif() + set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_GETADDRINFO_OVERRIDE") + set_target_properties(${_target_name} PROPERTIES + OUTPUT_NAME "${_target}" + PROJECT_LABEL "Test libtest ${_target}") +endforeach() diff --git a/deps/curl/tests/libtest/Makefile.am b/deps/curl/tests/libtest/Makefile.am index 8ae972a2..809731d0 100644 --- a/deps/curl/tests/libtest/Makefile.am +++ b/deps/curl/tests/libtest/Makefile.am @@ -34,10 +34,11 @@ AUTOMAKE_OPTIONS = foreign nostdinc AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ - -I$(top_srcdir)/lib + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/tests/libtest EXTRA_DIST = test307.pl test610.pl test613.pl test1013.pl test1022.pl \ - Makefile.inc notexists.pl CMakeLists.txt mk-lib1521.pl .checksrc + CMakeLists.txt mk-lib1521.pl .checksrc CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ @@ -48,29 +49,17 @@ CLEANFILES = lib1521.c # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) -if USE_EXPLICIT_LIB_DEPS -SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ -TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@ -else -SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_LIBS@ -TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_AND_TIME_LIBS@ -endif +SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@ +TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@ # Dependencies (may need to be overridden) LDADD = $(SUPPORTFILES_LIBS) # Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES, -# noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS) +# LIBTESTPROGS, lib*_SOURCES, and lib*_CFLAGS) include Makefile.inc -# Preloading of libhostname allows host name overriding, -# this is used to make some tests machine independent. - -if BUILD_LIBHOSTNAME -noinst_LTLIBRARIES = libhostname.la -else noinst_LTLIBRARIES = -endif if USE_CPPFLAG_CURL_STATICLIB AM_CPPFLAGS += -DCURL_STATICLIB @@ -79,35 +68,12 @@ endif AM_LDFLAGS = AM_CFLAGS = -libhostname_la_CPPFLAGS_EXTRA = -libhostname_la_LDFLAGS_EXTRA = -module -avoid-version -rpath /nowhere -libhostname_la_CFLAGS_EXTRA = - libstubgss_la_LDFLAGS_EXTRA = if CURL_LT_SHLIB_USE_NO_UNDEFINED -libhostname_la_LDFLAGS_EXTRA += -no-undefined libstubgss_la_LDFLAGS_EXTRA += -no-undefined endif -if CURL_LT_SHLIB_USE_MIMPURE_TEXT -libhostname_la_LDFLAGS_EXTRA += -mimpure-text -endif - -if DOING_CURL_SYMBOL_HIDING -libhostname_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS -libhostname_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) -endif - -libhostname_la_CPPFLAGS = $(AM_CPPFLAGS) $(libhostname_la_CPPFLAGS_EXTRA) -libhostname_la_LDFLAGS = $(AM_LDFLAGS) $(libhostname_la_LDFLAGS_EXTRA) -libhostname_la_CFLAGS = $(AM_CFLAGS) $(libhostname_la_CFLAGS_EXTRA) - -libhostname_la_SOURCES = sethostname.c - -libhostname_la_LIBADD = -libhostname_la_DEPENDENCIES = - # Build a stub gssapi implementation for testing if BUILD_STUB_GSS noinst_LTLIBRARIES += libstubgss.la @@ -122,9 +88,29 @@ libstubgss_la_LIBADD = libstubgss_la_DEPENDENCIES = endif +if USE_TEST_BUNDLES +AM_CPPFLAGS += -DCURL_NO_GETADDRINFO_OVERRIDE + +libtest_bundle.c: $(top_srcdir)/tests/mk-bundle.pl lib1521.c + @PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > libtest_bundle.c + +noinst_PROGRAMS = libtests +nodist_libtests_SOURCES = libtest_bundle.c +libtests_SOURCES = $(TESTUTIL) $(TSTTRACE) +libtests_LDADD = $(TESTUTIL_LIBS) +CLEANFILES += libtest_bundle.c + +if USE_CPPFLAG_CURL_STATICLIB +else +# These are part of the libcurl static lib. Add them here when linking shared. +libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(TIMEDIFF) $(THREADS) +endif +else +noinst_PROGRAMS = $(LIBTESTPROGS) +endif lib1521.c: $(top_srcdir)/tests/libtest/mk-lib1521.pl $(top_srcdir)/include/curl/curl.h - @PERL@ $(top_srcdir)/tests/libtest/mk-lib1521.pl < $(top_srcdir)/include/curl/curl.h > lib1521.c + @PERL@ $(top_srcdir)/tests/libtest/mk-lib1521.pl < $(top_srcdir)/include/curl/curl.h lib1521.c CHECKSRC = $(CS_$(V)) CS_0 = @echo " RUN " $@; @@ -134,7 +120,7 @@ CS_ = $(CS_0) checksrc: $(CHECKSRC)@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) $(srcdir)/*.[ch] -if CURLDEBUG +if DEBUGBUILD # for debug builds, we scan the sources on all regular make invokes all-local: checksrc endif diff --git a/deps/curl/tests/libtest/Makefile.inc b/deps/curl/tests/libtest/Makefile.inc index 32cc180b..339a00fc 100644 --- a/deps/curl/tests/libtest/Makefile.inc +++ b/deps/curl/tests/libtest/Makefile.inc @@ -35,10 +35,13 @@ MULTIBYTE = ../../lib/curl_multibyte.c ../../lib/curl_multibyte.h # these files are used in every single test program below TIMEDIFF = ../../lib/timediff.c ../../lib/timediff.h -SUPPORTFILES = $(TIMEDIFF) first.c test.h +FIRSTFILES = first.c first.h +SUPPORTFILES = $(TIMEDIFF) $(FIRSTFILES) test.h + +THREADS = ../../lib/curl_threads.c ../../lib/curl_threads.h # These are all libcurl test programs -noinst_PROGRAMS = chkhostname libauthretry libntlmconnect libprereq \ +LIBTESTPROGS = libauthretry libntlmconnect libprereq \ lib500 lib501 lib502 lib503 lib504 lib505 lib506 lib507 lib508 lib509 \ lib510 lib511 lib512 lib513 lib514 lib515 lib516 lib517 lib518 lib519 \ lib520 lib521 lib523 lib524 lib525 lib526 lib527 lib529 lib530 lib532 \ @@ -54,39 +57,37 @@ noinst_PROGRAMS = chkhostname libauthretry libntlmconnect libprereq \ lib670 lib671 lib672 lib673 lib674 lib676 lib677 lib678 \ lib1156 \ lib1301 \ + lib1485 \ lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506 lib1507 lib1508 \ lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \ lib1518 lib1520 lib1521 lib1522 lib1523 \ lib1525 lib1526 lib1527 lib1528 lib1529 lib1530 lib1531 lib1532 lib1533 \ lib1534 lib1535 lib1536 lib1537 lib1538 lib1539 \ - lib1540 lib1542 lib1543 lib1545 \ + lib1540 lib1541 lib1542 lib1543 lib1545 \ lib1550 lib1551 lib1552 lib1553 lib1554 lib1555 lib1556 lib1557 \ lib1558 lib1559 lib1560 lib1564 lib1565 lib1567 lib1568 lib1569 \ lib1591 lib1592 lib1593 lib1594 lib1596 lib1597 lib1598 \ \ lib1662 \ \ - lib1900 \ + lib1900 lib1901 \ lib1903 lib1905 lib1906 lib1907 lib1908 lib1910 lib1911 lib1912 lib1913 \ lib1915 lib1916 lib1917 lib1918 lib1919 \ lib1933 lib1934 lib1935 lib1936 lib1937 lib1938 lib1939 lib1940 \ lib1945 lib1946 lib1947 lib1948 lib1955 lib1956 lib1957 lib1958 lib1959 \ lib1960 lib1964 \ lib1970 lib1971 lib1972 lib1973 lib1974 lib1975 \ - lib2301 lib2302 lib2304 lib2305 lib2306 \ - lib2402 lib2404 \ + lib2301 lib2302 lib2304 lib2305 lib2306 lib2308 \ + lib2402 lib2404 lib2405 \ lib2502 \ lib3010 lib3025 lib3026 lib3027 \ - lib3100 lib3101 lib3102 lib3103 - -chkhostname_SOURCES = chkhostname.c ../../lib/curl_gethostname.c -chkhostname_LDADD = @CURL_NETWORK_LIBS@ -chkhostname_DEPENDENCIES = + lib3100 lib3101 lib3102 lib3103 lib3207 libntlmconnect_SOURCES = libntlmconnect.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) libntlmconnect_LDADD = $(TESTUTIL_LIBS) libauthretry_SOURCES = libauthretry.c $(SUPPORTFILES) +libauthretry_LDADD = $(TESTUTIL_LIBS) libprereq_SOURCES = libprereq.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) libprereq_LDADD = $(TESTUTIL_LIBS) @@ -346,6 +347,9 @@ lib678_LDADD = $(TESTUTIL_LIBS) lib1301_SOURCES = lib1301.c $(SUPPORTFILES) $(TESTUTIL) lib1301_LDADD = $(TESTUTIL_LIBS) +lib1485_SOURCES = lib1485.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib1485_LDADD = $(TESTUTIL_LIBS) + lib1500_SOURCES = lib1500.c $(SUPPORTFILES) $(TESTUTIL) lib1500_LDADD = $(TESTUTIL_LIBS) @@ -398,7 +402,7 @@ lib1513_LDADD = $(TESTUTIL_LIBS) lib1514_SOURCES = lib1514.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib1514_LDADD = $(TESTUTIL_LIBS) -lib1515_SOURCES = lib1515.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib1515_SOURCES = lib1515.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS) lib1515_LDADD = $(TESTUTIL_LIBS) lib1517_SOURCES = lib1517.c $(SUPPORTFILES) @@ -461,9 +465,12 @@ lib1539_SOURCES = lib1514.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib1539_LDADD = $(TESTUTIL_LIBS) lib1539_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1539 -lib1540_SOURCES = lib1540.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib1540_SOURCES = lib1540.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS) lib1540_LDADD = $(TESTUTIL_LIBS) +lib1541_SOURCES = lib1541.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib1541_LDADD = $(TESTUTIL_LIBS) + lib1542_SOURCES = lib1542.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS) lib1542_LDADD = $(TESTUTIL_LIBS) @@ -471,7 +478,6 @@ lib1543_SOURCES = lib1518.c $(SUPPORTFILES) lib1543_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1543 lib1545_SOURCES = lib1545.c $(SUPPORTFILES) -lib1545_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_DISABLE_DEPRECATION lib1550_SOURCES = lib1550.c $(SUPPORTFILES) @@ -480,7 +486,7 @@ lib1551_SOURCES = lib1551.c $(SUPPORTFILES) lib1552_SOURCES = lib1552.c $(SUPPORTFILES) $(TESTUTIL) lib1552_LDADD = $(TESTUTIL_LIBS) -lib1553_SOURCES = lib1553.c $(SUPPORTFILES) $(TESTUTIL) +lib1553_SOURCES = lib1553.c $(SUPPORTFILES) $(TSTTRACE) $(TESTUTIL) lib1553_LDADD = $(TESTUTIL_LIBS) lib1554_SOURCES = lib1554.c $(SUPPORTFILES) @@ -542,6 +548,8 @@ lib1662_LDADD = $(TESTUTIL_LIBS) lib1900_SOURCES = lib1900.c $(SUPPORTFILES) +lib1901_SOURCES = lib1901.c $(SUPPORTFILES) + lib1903_SOURCES = lib1903.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib1903_LDADD = $(TESTUTIL_LIBS) @@ -569,7 +577,7 @@ lib1912_LDADD = $(TESTUTIL_LIBS) lib1913_SOURCES = lib1913.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib1913_LDADD = $(TESTUTIL_LIBS) -lib1915_SOURCES = lib1915.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib1915_SOURCES = lib1915.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS) lib1915_LDADD = $(TESTUTIL_LIBS) lib1916_SOURCES = lib1916.c $(SUPPORTFILES) $(WARNLESS) @@ -672,13 +680,19 @@ lib2305_LDADD = $(TESTUTIL_LIBS) lib2306_SOURCES = lib2306.c $(SUPPORTFILES) lib2306_LDADD = $(TESTUTIL_LIBS) +lib2308_SOURCES = lib2308.c $(SUPPORTFILES) +lib2308_LDADD = $(TESTUTIL_LIBS) + lib2402_SOURCES = lib2402.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib2402_LDADD = $(TESTUTIL_LIBS) lib2404_SOURCES = lib2404.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib2404_LDADD = $(TESTUTIL_LIBS) -lib2502_SOURCES = lib2502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib2405_SOURCES = lib2405.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib2405_LDADD = $(TESTUTIL_LIBS) + +lib2502_SOURCES = lib2502.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS) lib2502_LDADD = $(TESTUTIL_LIBS) lib3010_SOURCES = lib3010.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) @@ -704,3 +718,6 @@ lib3102_LDADD = $(TESTUTIL_LIBS) lib3103_SOURCES = lib3103.c $(SUPPORTFILES) lib3103_LDADD = $(TESTUTIL_LIBS) + +lib3207_SOURCES = lib3207.c $(SUPPORTFILES) $(TESTUTIL) $(THREADS) $(WARNLESS) $(MULTIBYTE) +lib3207_LDADD = $(TESTUTIL_LIBS) diff --git a/deps/curl/tests/libtest/first.c b/deps/curl/tests/libtest/first.c index 42c53c69..68c649e0 100644 --- a/deps/curl/tests/libtest/first.c +++ b/deps/curl/tests/libtest/first.c @@ -22,6 +22,7 @@ * ***************************************************************************/ #include "test.h" +#include "first.h" #ifdef HAVE_LOCALE_H # include /* for setlocale() */ @@ -120,15 +121,15 @@ static void memory_tracking_init(void) #endif /* returns a hexdump in a static memory area */ -char *hexdump(const unsigned char *buffer, size_t len) +char *hexdump(const unsigned char *buf, size_t len) { static char dump[200 * 3 + 1]; char *p = dump; size_t i; if(len > 200) return NULL; - for(i = 0; i2) - libtest_arg2 = argv[2]; + if(argc > (basearg + 1)) + libtest_arg2 = argv[basearg + 1]; - if(argc>3) - libtest_arg3 = argv[3]; + if(argc > (basearg + 2)) + libtest_arg3 = argv[basearg + 2]; - URL = argv[1]; /* provide this to the rest */ + URL = argv[basearg]; /* provide this to the rest */ fprintf(stderr, "URL: %s\n", URL); - result = test(URL); + result = test_func(URL); fprintf(stderr, "Test ended with result %d\n", result); #ifdef _WIN32 @@ -185,5 +227,5 @@ int main(int argc, 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 result <= 125 ? result : 125; + return (int)result <= 125 ? (int)result : 125; } diff --git a/deps/curl/tests/libtest/sethostname.c b/deps/curl/tests/libtest/first.h similarity index 72% rename from deps/curl/tests/libtest/sethostname.c rename to deps/curl/tests/libtest/first.h index 1e07d26b..1e4ae5fc 100644 --- a/deps/curl/tests/libtest/sethostname.c +++ b/deps/curl/tests/libtest/first.h @@ -1,3 +1,5 @@ +#ifndef HEADER_LIBTEST_FIRST_H +#define HEADER_LIBTEST_FIRST_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -22,20 +24,15 @@ * ***************************************************************************/ #include "curl_setup.h" +#include -/* - * we force our own host name, in order to make some tests machine independent - */ +typedef CURLcode (*test_func_t)(char *); -int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) -{ - const char *force_hostname = getenv("CURL_GETHOSTNAME"); - if(force_hostname) { - strncpy(name, force_hostname, namelen); - name[namelen-1] = '\0'; - return 0; - } +#ifdef CURLTESTS_BUNDLED +struct onetest { + const char *name; + test_func_t ptr; +}; +#endif - /* LD_PRELOAD used, but no hostname set, we'll just return a failure */ - return -1; -} +#endif /* HEADER_LIBTEST_FIRST_H */ diff --git a/deps/curl/tests/libtest/lib1156.c b/deps/curl/tests/libtest/lib1156.c index b512ef67..6854e3bc 100644 --- a/deps/curl/tests/libtest/lib1156.c +++ b/deps/curl/tests/libtest/lib1156.c @@ -47,7 +47,7 @@ struct testparams { CURLcode result; /* Code that should be returned by curl_easy_perform(). */ }; -static const struct testparams params[] = { +static const struct testparams testparams[] = { { 0, CURLE_OK }, { F_CONTENTRANGE, CURLE_OK }, { F_FAIL, CURLE_OK }, @@ -90,35 +90,35 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p, unsigned int replyselector; char urlbuf[256]; - replyselector = (p->flags & F_CONTENTRANGE)? 1: 0; + replyselector = (p->flags & F_CONTENTRANGE) ? 1 : 0; if(p->flags & F_HTTP416) replyselector += 2; msnprintf(urlbuf, sizeof(urlbuf), "%s%04u", url, replyselector); test_setopt(curl, CURLOPT_URL, urlbuf); test_setopt(curl, CURLOPT_VERBOSE, 1L); - test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME)? 3: 0); - test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME)? + test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME) ? 3 : 0); + test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME) ? "3-1000000": (char *) NULL); - test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL)? 1: 0); + test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL) ? 1 : 0); hasbody = 0; res = curl_easy_perform(curl); if(res != p->result) { printf("%zd: 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->result); return 1; } if(hasbody && (p->flags & F_IGNOREBODY)) { printf("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; @@ -131,7 +131,7 @@ test_cleanup: /* for debugging: */ /* #define SINGLETEST 9 */ -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -143,7 +143,7 @@ int test(char *URL) return TEST_ERR_MAJOR_BAD; } - for(i = 0; i < sizeof(params) / sizeof(params[0]); i++) { + for(i = 0; i < sizeof(testparams) / sizeof(testparams[0]); i++) { curl = curl_easy_init(); if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); @@ -156,18 +156,18 @@ int test(char *URL) #ifdef SINGLETEST if(SINGLETEST == i) #endif - status |= onetest(curl, URL, params + i, i); + status |= onetest(curl, URL, testparams + i, i); curl_easy_cleanup(curl); } curl_global_cleanup(); printf("%d\n", status); - return status; + return (CURLcode)status; test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1301.c b/deps/curl/tests/libtest/lib1301.c index f63b94cc..de3aaeac 100644 --- a/deps/curl/tests/libtest/lib1301.c +++ b/deps/curl/tests/libtest/lib1301.c @@ -28,11 +28,11 @@ if(!(expr)) { \ fprintf(stderr, "%s:%d Assertion '%s' failed: %s\n", \ __FILE__, __LINE__, #expr, msg); \ - return 1; \ + return (CURLcode)1; \ } \ } while(0) -int test(char *URL) +CURLcode test(char *URL) { int rc; (void)URL; @@ -58,5 +58,5 @@ int test(char *URL) rc = curl_strnequal("ii", "II", 3); fail_unless(rc != 0, "return code should be non-zero"); - return 0; + return CURLE_OK; } diff --git a/deps/curl/tests/libtest/lib1485.c b/deps/curl/tests/libtest/lib1485.c new file mode 100644 index 00000000..650746a3 --- /dev/null +++ b/deps/curl/tests/libtest/lib1485.c @@ -0,0 +1,120 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 "test.h" + +#include "testutil.h" +#include "warnless.h" +#include "memdebug.h" + +struct transfer_status { + CURL *easy; + curl_off_t out_len; + size_t hd_line; + CURLcode result; + int http_status; +}; + +static size_t header_callback(char *ptr, size_t size, size_t nmemb, + void *userp) +{ + struct transfer_status *st = (struct transfer_status *)userp; + const char *hd = ptr; + size_t len = size * nmemb; + CURLcode result; + + (void)fwrite(ptr, size, nmemb, stdout); + ++st->hd_line; + if(len == 2 && hd[0] == '\r' && hd[1] == '\n') { + curl_off_t clen; + long httpcode = 0; + /* end of a response */ + result = curl_easy_getinfo(st->easy, CURLINFO_RESPONSE_CODE, &httpcode); + fprintf(stderr, "header_callback, get status: %ld, %d\n", + httpcode, result); + if(httpcode < 100 || httpcode >= 1000) { + fprintf(stderr, "header_callback, invalid status: %ld, %d\n", + httpcode, result); + return CURLE_WRITE_ERROR; + } + 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, + &clen); + fprintf(stderr, "header_callback, info Content-Length: %ld, %d\n", + (long)clen, result); + if(result) { + st->result = result; + return CURLE_WRITE_ERROR; + } + if(clen < 0) { + fprintf(stderr, "header_callback, expected known Content-Length, " + "got: %ld\n", (long)clen); + return CURLE_WRITE_ERROR; + } + } + } + return len; +} + +static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userp) +{ + struct transfer_status *st = (struct transfer_status *)userp; + size_t len = size * nmemb; + fwrite(ptr, size, nmemb, stdout); + st->out_len += (curl_off_t)len; + return len; +} + +CURLcode test(char *URL) +{ + CURL *curls = NULL; + CURLcode res = CURLE_OK; + struct transfer_status st; + + start_test_timing(); + + memset(&st, 0, sizeof(st)); + + global_init(CURL_GLOBAL_ALL); + + easy_init(curls); + st.easy = curls; /* to allow callbacks access */ + + easy_setopt(curls, CURLOPT_URL, URL); + easy_setopt(curls, CURLOPT_WRITEFUNCTION, write_callback); + easy_setopt(curls, CURLOPT_WRITEDATA, &st); + easy_setopt(curls, CURLOPT_HEADERFUNCTION, header_callback); + easy_setopt(curls, CURLOPT_HEADERDATA, &st); + + easy_setopt(curls, CURLOPT_NOPROGRESS, 1L); + + res = curl_easy_perform(curls); + +test_cleanup: + + curl_easy_cleanup(curls); + curl_global_cleanup(); + + return res; /* return the final return code */ +} diff --git a/deps/curl/tests/libtest/lib1500.c b/deps/curl/tests/libtest/lib1500.c index 3f237a03..9f4ff07e 100644 --- a/deps/curl/tests/libtest/lib1500.c +++ b/deps/curl/tests/libtest/lib1500.c @@ -29,13 +29,13 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { CURL *curls = NULL; CURLM *multi = NULL; int still_running; - int i = TEST_ERR_FAILURE; - int res = 0; + CURLcode i = TEST_ERR_FAILURE; + CURLcode res = CURLE_OK; CURLMsg *msg; start_test_timing(); @@ -56,10 +56,11 @@ int test(char *URL) abort_on_test_timeout(); while(still_running) { + CURLMcode mres; int num; - res = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); - if(res != CURLM_OK) { - printf("curl_multi_wait() returned %d\n", res); + mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); + if(mres != CURLM_OK) { + printf("curl_multi_wait() returned %d\n", mres); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/deps/curl/tests/libtest/lib1501.c b/deps/curl/tests/libtest/lib1501.c index a4816c77..ced1d5d9 100644 --- a/deps/curl/tests/libtest/lib1501.c +++ b/deps/curl/tests/libtest/lib1501.c @@ -35,11 +35,11 @@ to allow old and slow machines to run this test too */ #define MAX_BLOCKED_TIME_MS 500 -int test(char *URL) +CURLcode test(char *URL) { CURL *handle = NULL; CURLM *mhandle = NULL; - int res = 0; + CURLcode res = CURLE_OK; int still_running = 0; start_test_timing(); @@ -96,7 +96,7 @@ int test(char *URL) fprintf(stderr, "pong = %ld\n", e); if(e > MAX_BLOCKED_TIME_MS) { - res = 100; + res = (CURLcode) 100; break; } } diff --git a/deps/curl/tests/libtest/lib1502.c b/deps/curl/tests/libtest/lib1502.c index 2e2415b7..d4ebdf50 100644 --- a/deps/curl/tests/libtest/lib1502.c +++ b/deps/curl/tests/libtest/lib1502.c @@ -39,13 +39,13 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; CURL *dup; CURLM *multi = NULL; int still_running; - int res = 0; + CURLcode res = CURLE_OK; char redirect[160]; diff --git a/deps/curl/tests/libtest/lib1506.c b/deps/curl/tests/libtest/lib1506.c index a1a72b2a..2dbda6d0 100644 --- a/deps/curl/tests/libtest/lib1506.c +++ b/deps/curl/tests/libtest/lib1506.c @@ -31,9 +31,9 @@ #define NUM_HANDLES 4 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; CURLM *m = NULL; diff --git a/deps/curl/tests/libtest/lib1507.c b/deps/curl/tests/libtest/lib1507.c index d23e0b18..fc788459 100644 --- a/deps/curl/tests/libtest/lib1507.c +++ b/deps/curl/tests/libtest/lib1507.c @@ -47,9 +47,9 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return CURL_READFUNC_ABORT; } -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; CURLM *mcurl = NULL; int still_running = 1; diff --git a/deps/curl/tests/libtest/lib1508.c b/deps/curl/tests/libtest/lib1508.c index 98103913..bece5fc9 100644 --- a/deps/curl/tests/libtest/lib1508.c +++ b/deps/curl/tests/libtest/lib1508.c @@ -27,9 +27,9 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURLM *m = NULL; (void)URL; diff --git a/deps/curl/tests/libtest/lib1509.c b/deps/curl/tests/libtest/lib1509.c index 2277e6ce..328ebd5d 100644 --- a/deps/curl/tests/libtest/lib1509.c +++ b/deps/curl/tests/libtest/lib1509.c @@ -27,17 +27,17 @@ #include "warnless.h" #include "memdebug.h" -size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream); -size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream); +size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream); +size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream); static unsigned long realHeaderSize = 0; -int test(char *URL) +CURLcode test(char *URL) { long headerSize; CURLcode code; CURL *curl = NULL; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); @@ -57,7 +57,7 @@ int test(char *URL) if(CURLE_OK != code) { fprintf(stderr, "%s:%d curl_easy_perform() failed, " "with code %d (%s)\n", - __FILE__, __LINE__, (int)code, curl_easy_strerror(code)); + __FILE__, __LINE__, code, curl_easy_strerror(code)); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -66,7 +66,7 @@ int test(char *URL) if(CURLE_OK != code) { fprintf(stderr, "%s:%d curl_easy_getinfo() failed, " "with code %d (%s)\n", - __FILE__, __LINE__, (int)code, curl_easy_strerror(code)); + __FILE__, __LINE__, code, curl_easy_strerror(code)); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -82,13 +82,13 @@ test_cleanup: return res; } -size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream) +size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream) { fwrite(ptr, size, nmemb, stream); return nmemb * size; } -size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream) +size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream) { (void)ptr; (void)stream; diff --git a/deps/curl/tests/libtest/lib1510.c b/deps/curl/tests/libtest/lib1510.c index 927927e4..b3764b8b 100644 --- a/deps/curl/tests/libtest/lib1510.c +++ b/deps/curl/tests/libtest/lib1510.c @@ -31,9 +31,9 @@ #define NUM_URLS 4 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; int i; char target_url[256]; diff --git a/deps/curl/tests/libtest/lib1511.c b/deps/curl/tests/libtest/lib1511.c index d093a5bd..abc1356e 100644 --- a/deps/curl/tests/libtest/lib1511.c +++ b/deps/curl/tests/libtest/lib1511.c @@ -25,11 +25,11 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { long unmet; CURL *curl = NULL; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1512.c b/deps/curl/tests/libtest/lib1512.c index 67078198..a93bfc02 100644 --- a/deps/curl/tests/libtest/lib1512.c +++ b/deps/curl/tests/libtest/lib1512.c @@ -34,9 +34,9 @@ #define NUM_HANDLES 2 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {NULL, NULL}; char *port = libtest_arg3; char *address = libtest_arg2; diff --git a/deps/curl/tests/libtest/lib1513.c b/deps/curl/tests/libtest/lib1513.c index 19c23c06..392e6c61 100644 --- a/deps/curl/tests/libtest/lib1513.c +++ b/deps/curl/tests/libtest/lib1513.c @@ -47,10 +47,10 @@ static int progressKiller(void *arg, return 1; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1514.c b/deps/curl/tests/libtest/lib1514.c index 6582b597..6b4e18ba 100644 --- a/deps/curl/tests/libtest/lib1514.c +++ b/deps/curl/tests/libtest/lib1514.c @@ -30,7 +30,7 @@ #include "memdebug.h" -static char data[]="dummy"; +static char testdata[]="dummy"; struct WriteThis { char *readptr; @@ -54,12 +54,12 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode result = CURLE_OK; - int res = 0; - struct WriteThis pooh = { data, sizeof(data)-1 }; + CURLcode res = CURLE_OK; + struct WriteThis pooh = { testdata, sizeof(testdata)-1 }; global_init(CURL_GLOBAL_ALL); @@ -82,5 +82,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)result; + return result; } diff --git a/deps/curl/tests/libtest/lib1515.c b/deps/curl/tests/libtest/lib1515.c index d210ed3b..f772d9e3 100644 --- a/deps/curl/tests/libtest/lib1515.c +++ b/deps/curl/tests/libtest/lib1515.c @@ -29,6 +29,7 @@ */ #include "test.h" +#include "testtrace.h" #include "testutil.h" #include "warnless.h" #include "memdebug.h" @@ -37,24 +38,12 @@ #define DNS_TIMEOUT 1 -static int debug_callback(CURL *curl, curl_infotype info, char *msg, - size_t len, void *ptr) -{ - (void)curl; - (void)ptr; - - if(info == CURLINFO_TEXT) - fprintf(stderr, "debug: %.*s", (int) len, msg); - - return 0; -} - -static int do_one_request(CURLM *m, char *URL, char *resolve) +static CURLcode do_one_request(CURLM *m, char *URL, char *resolve) { CURL *curls; struct curl_slist *resolve_list = NULL; int still_running; - int res = 0; + CURLcode res = CURLE_OK; CURLMsg *msg; int msgs_left; @@ -64,10 +53,14 @@ static int do_one_request(CURLM *m, char *URL, char *resolve) easy_setopt(curls, CURLOPT_URL, URL); easy_setopt(curls, CURLOPT_RESOLVE, resolve_list); - easy_setopt(curls, CURLOPT_DEBUGFUNCTION, debug_callback); - easy_setopt(curls, CURLOPT_VERBOSE, 1); easy_setopt(curls, CURLOPT_DNS_CACHE_TIMEOUT, DNS_TIMEOUT); + libtest_debug_config.nohex = 1; + libtest_debug_config.tracetime = 1; + easy_setopt(curls, CURLOPT_DEBUGDATA, &libtest_debug_config); + easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curls, CURLOPT_VERBOSE, 1L); + multi_add_handle(m, curls); multi_perform(m, &still_running); @@ -110,10 +103,10 @@ test_cleanup: return res; } -int test(char *URL) +CURLcode test(char *URL) { CURLM *multi = NULL; - int res = 0; + CURLcode res = CURLE_OK; char *address = libtest_arg2; char *port = libtest_arg3; char *path = URL; @@ -127,6 +120,7 @@ int test(char *URL) start_test_timing(); global_init(CURL_GLOBAL_ALL); + curl_global_trace("all"); multi_init(multi); for(i = 1; i <= count; i++) { @@ -136,8 +130,10 @@ int test(char *URL) /* second request must succeed like the first one */ res = do_one_request(multi, target_url, dns_entry); - if(res) + if(res != CURLE_OK) { + fprintf(stderr, "request %s failed with %d\n", target_url, res); goto test_cleanup; + } if(i < count) sleep(DNS_TIMEOUT + 1); @@ -148,5 +144,5 @@ test_cleanup: curl_multi_cleanup(multi); curl_global_cleanup(); - return (int) res; + return res; } diff --git a/deps/curl/tests/libtest/lib1517.c b/deps/curl/tests/libtest/lib1517.c index 12679201..3957eb19 100644 --- a/deps/curl/tests/libtest/lib1517.c +++ b/deps/curl/tests/libtest/lib1517.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static char data[]="this is what we post to the silly web server\n"; +static char testdata[]="this is what we post to the silly web server\n"; struct WriteThis { char *readptr; @@ -53,7 +53,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return tocopy; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -64,14 +64,14 @@ int test(char *URL) #if (defined(_WIN32) || defined(__CYGWIN__)) printf("Windows TCP does not deliver response data but reports " "CONNABORTED\n"); - return 1; /* skip since test will fail on Windows without workaround */ + return (CURLcode)1; /* skip since it fails on Windows without workaround */ #else - return 0; /* sure, run this! */ + return CURLE_OK; /* sure, run this! */ #endif } - pooh.readptr = data; - pooh.sizeleft = strlen(data); + pooh.readptr = testdata; + pooh.sizeleft = strlen(testdata); if(curl_global_init(CURL_GLOBAL_ALL)) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/deps/curl/tests/libtest/lib1518.c b/deps/curl/tests/libtest/lib1518.c index aa0de415..560d79ce 100644 --- a/deps/curl/tests/libtest/lib1518.c +++ b/deps/curl/tests/libtest/lib1518.c @@ -37,7 +37,7 @@ static size_t writecb(char *buffer, size_t size, size_t nitems, return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -84,13 +84,13 @@ int test(char *URL) test_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); printf("res %d\n" - "status %d\n" - "redirects %d\n" + "status %ld\n" + "redirects %ld\n" "effectiveurl %s\n" "redirecturl %s\n", - (int)res, - (int)curlResponseCode, - (int)curlRedirectCount, + res, + curlResponseCode, + curlRedirectCount, effectiveUrl, redirectUrl ? redirectUrl : "blank"); diff --git a/deps/curl/tests/libtest/lib1520.c b/deps/curl/tests/libtest/lib1520.c index 5b6c3dcf..8e5f6a9b 100644 --- a/deps/curl/tests/libtest/lib1520.c +++ b/deps/curl/tests/libtest/lib1520.c @@ -71,7 +71,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -111,5 +111,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1522.c b/deps/curl/tests/libtest/lib1522.c index f5e87e01..3d171009 100644 --- a/deps/curl/tests/libtest/lib1522.c +++ b/deps/curl/tests/libtest/lib1522.c @@ -49,7 +49,7 @@ static int sockopt_callback(void *clientp, curl_socket_t curlfd, return CURL_SOCKOPT_OK; } -int test(char *URL) +CURLcode test(char *URL) { CURLcode code = TEST_ERR_MAJOR_BAD; CURLcode res; @@ -97,5 +97,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)code; + return code; } diff --git a/deps/curl/tests/libtest/lib1523.c b/deps/curl/tests/libtest/lib1523.c index 9aa9e3cb..529bbf83 100644 --- a/deps/curl/tests/libtest/lib1523.c +++ b/deps/curl/tests/libtest/lib1523.c @@ -55,7 +55,7 @@ static CURLcode run(CURL *hnd, long limit, long time) return curl_easy_perform(hnd); } -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret; CURL *hnd; @@ -81,5 +81,5 @@ int test(char *URL) curl_easy_cleanup(hnd); curl_global_cleanup(); - return (int)ret; + return ret; } diff --git a/deps/curl/tests/libtest/lib1525.c b/deps/curl/tests/libtest/lib1525.c index 591eb413..c8a3063f 100644 --- a/deps/curl/tests/libtest/lib1525.c +++ b/deps/curl/tests/libtest/lib1525.c @@ -32,21 +32,21 @@ #include "memdebug.h" -static char data [] = "Hello Cloud!\n"; +static char testdata[] = "Hello Cloud!\n"; static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) { size_t amount = nmemb * size; /* Total bytes curl wants */ - if(amount < strlen(data)) { - return strlen(data); + if(amount < strlen(testdata)) { + return strlen(testdata); } (void)stream; - memcpy(ptr, data, strlen(data)); - return strlen(data); + memcpy(ptr, testdata, strlen(testdata)); + return strlen(testdata); } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -84,7 +84,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); test_setopt(curl, CURLOPT_READFUNCTION, read_callback); test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); - test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data)); + test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(testdata)); res = curl_easy_perform(curl); @@ -96,5 +96,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1526.c b/deps/curl/tests/libtest/lib1526.c index c11e536e..8093079f 100644 --- a/deps/curl/tests/libtest/lib1526.c +++ b/deps/curl/tests/libtest/lib1526.c @@ -31,20 +31,20 @@ #include "memdebug.h" -static char data [] = "Hello Cloud!\n"; +static char testdata[] = "Hello Cloud!\n"; static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) { size_t amount = nmemb * size; /* Total bytes curl wants */ - if(amount < strlen(data)) { - return strlen(data); + if(amount < strlen(testdata)) { + return strlen(testdata); } (void)stream; - memcpy(ptr, data, strlen(data)); - return strlen(data); + memcpy(ptr, testdata, strlen(testdata)); + return strlen(testdata); } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -87,7 +87,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); test_setopt(curl, CURLOPT_READFUNCTION, read_callback); test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); - test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data)); + test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(testdata)); res = curl_easy_perform(curl); @@ -101,5 +101,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1527.c b/deps/curl/tests/libtest/lib1527.c index e5987058..26581b2a 100644 --- a/deps/curl/tests/libtest/lib1527.c +++ b/deps/curl/tests/libtest/lib1527.c @@ -31,21 +31,21 @@ #include "memdebug.h" -static char data [] = "Hello Cloud!\n"; +static char testdata[] = "Hello Cloud!\n"; static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) { size_t amount = nmemb * size; /* Total bytes curl wants */ - if(amount < strlen(data)) { - return strlen(data); + if(amount < strlen(testdata)) { + return strlen(testdata); } (void)stream; - memcpy(ptr, data, strlen(data)); - return strlen(data); + memcpy(ptr, testdata, strlen(testdata)); + return strlen(testdata); } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -85,7 +85,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); test_setopt(curl, CURLOPT_READFUNCTION, read_callback); test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); - test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data)); + test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(testdata)); test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED); res = curl_easy_perform(curl); @@ -98,5 +98,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1528.c b/deps/curl/tests/libtest/lib1528.c index ae236041..396910a5 100644 --- a/deps/curl/tests/libtest/lib1528.c +++ b/deps/curl/tests/libtest/lib1528.c @@ -26,7 +26,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -71,5 +71,5 @@ test_cleanup: curl_slist_free_all(phl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1529.c b/deps/curl/tests/libtest/lib1529.c index 5b0f990f..8a1f52cd 100644 --- a/deps/curl/tests/libtest/lib1529.c +++ b/deps/curl/tests/libtest/lib1529.c @@ -26,7 +26,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -59,5 +59,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1530.c b/deps/curl/tests/libtest/lib1530.c index e4594929..6b86cdb6 100644 --- a/deps/curl/tests/libtest/lib1530.c +++ b/deps/curl/tests/libtest/lib1530.c @@ -37,7 +37,7 @@ static curl_socket_t opensocket(void *clientp, return CURL_SOCKET_BAD; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -66,5 +66,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1531.c b/deps/curl/tests/libtest/lib1531.c index b64e1660..f4814f12 100644 --- a/deps/curl/tests/libtest/lib1531.c +++ b/deps/curl/tests/libtest/lib1531.c @@ -33,14 +33,14 @@ static char const testData[] = ".abc\0xyz"; static off_t const testDataSize = sizeof(testData) - 1; -int test(char *URL) +CURLcode test(char *URL) { CURL *easy; CURLM *multi_handle; 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 */ - int res = CURLE_OK; + CURLcode res = CURLE_OK; start_test_timing(); diff --git a/deps/curl/tests/libtest/lib1532.c b/deps/curl/tests/libtest/lib1532.c index a3ac7092..22b1aada 100644 --- a/deps/curl/tests/libtest/lib1532.c +++ b/deps/curl/tests/libtest/lib1532.c @@ -27,7 +27,7 @@ /* Test CURLINFO_RESPONSE_CODE */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; long httpcode; @@ -78,5 +78,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1533.c b/deps/curl/tests/libtest/lib1533.c index 0c9f8fa9..e1dd16c9 100644 --- a/deps/curl/tests/libtest/lib1533.c +++ b/deps/curl/tests/libtest/lib1533.c @@ -106,7 +106,7 @@ static int perform_and_check_connections(CURL *curl, const char *description, res = curl_easy_perform(curl); if(res != CURLE_OK) { - fprintf(stderr, "curl_easy_perform() failed with %d\n", (int)res); + fprintf(stderr, "curl_easy_perform() failed with %d\n", res); return TEST_ERR_MAJOR_BAD; } @@ -127,11 +127,12 @@ static int perform_and_check_connections(CURL *curl, const char *description, } -int test(char *URL) +CURLcode test(char *URL) { struct cb_data data; CURL *curl = NULL; - int res = TEST_ERR_FAILURE; + CURLcode res = TEST_ERR_FAILURE; + int result; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); @@ -157,17 +158,19 @@ int test(char *URL) test_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); test_setopt(curl, CURLOPT_WRITEDATA, &data); - res = perform_and_check_connections(curl, + result = perform_and_check_connections(curl, "First request without CURLOPT_KEEP_SENDING_ON_ERROR", 1); - if(res != TEST_ERR_SUCCESS) { + if(result != TEST_ERR_SUCCESS) { + res = (CURLcode) result; goto test_cleanup; } reset_data(&data, curl); - res = perform_and_check_connections(curl, + result = perform_and_check_connections(curl, "Second request without CURLOPT_KEEP_SENDING_ON_ERROR", 1); - if(res != TEST_ERR_SUCCESS) { + if(result != TEST_ERR_SUCCESS) { + res = (CURLcode) result; goto test_cleanup; } @@ -175,17 +178,19 @@ int test(char *URL) reset_data(&data, curl); - res = perform_and_check_connections(curl, + result = perform_and_check_connections(curl, "First request with CURLOPT_KEEP_SENDING_ON_ERROR", 1); - if(res != TEST_ERR_SUCCESS) { + if(result != TEST_ERR_SUCCESS) { + res = (CURLcode) result; goto test_cleanup; } reset_data(&data, curl); - res = perform_and_check_connections(curl, + result = perform_and_check_connections(curl, "Second request with CURLOPT_KEEP_SENDING_ON_ERROR", 0); - if(res != TEST_ERR_SUCCESS) { + if(result != TEST_ERR_SUCCESS) { + res = (CURLcode) result; goto test_cleanup; } @@ -197,5 +202,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1534.c b/deps/curl/tests/libtest/lib1534.c index 620e3833..a9a7d73d 100644 --- a/deps/curl/tests/libtest/lib1534.c +++ b/deps/curl/tests/libtest/lib1534.c @@ -27,7 +27,7 @@ /* Test CURLINFO_FILETIME */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl, *dupe = NULL; long filetime; @@ -127,5 +127,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_easy_cleanup(dupe); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1535.c b/deps/curl/tests/libtest/lib1535.c index 6edf8873..80589d89 100644 --- a/deps/curl/tests/libtest/lib1535.c +++ b/deps/curl/tests/libtest/lib1535.c @@ -27,7 +27,7 @@ /* Test CURLINFO_PROTOCOL */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl, *dupe = NULL; long protocol; @@ -134,5 +134,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_easy_cleanup(dupe); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1536.c b/deps/curl/tests/libtest/lib1536.c index 9ba7ec18..7bc9e718 100644 --- a/deps/curl/tests/libtest/lib1536.c +++ b/deps/curl/tests/libtest/lib1536.c @@ -27,7 +27,7 @@ /* Test CURLINFO_SCHEME */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl, *dupe = NULL; char *scheme; @@ -71,9 +71,9 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(!scheme || memcmp(scheme, "HTTP", 5) != 0) { + if(!scheme || memcmp(scheme, "http", 5) != 0) { fprintf(stderr, "%s:%d scheme of http resource is incorrect; " - "expected 'HTTP' but is %s\n", + "expected 'http' but is %s\n", __FILE__, __LINE__, (scheme == NULL ? "NULL" : "invalid")); res = CURLE_HTTP_RETURNED_ERROR; @@ -127,5 +127,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_easy_cleanup(dupe); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1537.c b/deps/curl/tests/libtest/lib1537.c index 21252fb7..9c991e83 100644 --- a/deps/curl/tests/libtest/lib1537.c +++ b/deps/curl/tests/libtest/lib1537.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7}; @@ -87,5 +87,5 @@ test_cleanup: curl_free(ptr); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1538.c b/deps/curl/tests/libtest/lib1538.c index cd9e3f65..ebc68573 100644 --- a/deps/curl/tests/libtest/lib1538.c +++ b/deps/curl/tests/libtest/lib1538.c @@ -25,9 +25,9 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURLcode easyret; CURLMcode multiret; CURLSHcode shareret; @@ -56,5 +56,5 @@ int test(char *URL) printf("u%d: %s\n", (int)urlret, curl_url_strerror(urlret)); } - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1540.c b/deps/curl/tests/libtest/lib1540.c index ea1cb1cd..21087944 100644 --- a/deps/curl/tests/libtest/lib1540.c +++ b/deps/curl/tests/libtest/lib1540.c @@ -23,6 +23,7 @@ ***************************************************************************/ #include "test.h" +#include "testtrace.h" #include "testutil.h" #include "warnless.h" #include "memdebug.h" @@ -56,7 +57,7 @@ static int please_continue(void *userp, return 0; /* go on */ } -static size_t header_callback(void *ptr, size_t size, size_t nmemb, +static size_t header_callback(char *ptr, size_t size, size_t nmemb, void *userp) { size_t len = size * nmemb; @@ -65,7 +66,7 @@ static size_t header_callback(void *ptr, size_t size, size_t nmemb, return len; } -static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *userp) +static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userp) { struct transfer_status *st = (struct transfer_status *)userp; size_t len = size * nmemb; @@ -82,10 +83,10 @@ static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *userp) return CURL_WRITEFUNC_PAUSE; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curls = NULL; - int res = 0; + CURLcode res = CURLE_OK; struct transfer_status st; start_test_timing(); @@ -107,6 +108,12 @@ int test(char *URL) easy_setopt(curls, CURLOPT_XFERINFODATA, &st); easy_setopt(curls, CURLOPT_NOPROGRESS, 0L); + libtest_debug_config.nohex = 1; + libtest_debug_config.tracetime = 1; + test_setopt(curls, CURLOPT_DEBUGDATA, &libtest_debug_config); + easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curls, CURLOPT_VERBOSE, 1L); + res = curl_easy_perform(curls); test_cleanup: @@ -114,5 +121,5 @@ test_cleanup: curl_easy_cleanup(curls); curl_global_cleanup(); - return (int)res; /* return the final return code */ + return res; /* return the final return code */ } diff --git a/deps/curl/tests/libtest/lib1541.c b/deps/curl/tests/libtest/lib1541.c index 71462886..a60d61a7 100644 --- a/deps/curl/tests/libtest/lib1541.c +++ b/deps/curl/tests/libtest/lib1541.c @@ -21,140 +21,133 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -/* - * KNOW_BUGS "A shared connection cache is not thread-safe" - * - * This source code was used to verify shared connection cache but since this - * is a known issue the test is no longer built or run. This code is here to - * allow for testing once someone gets to work on fixing this. - */ #include "test.h" #include "testutil.h" #include "warnless.h" #include "memdebug.h" -#ifdef HAVE_PTHREAD_H -#include -#include - -/* number of threads to fire up in parallel */ -#define NUM_THREADS 67 - -/* for how many seconds each thread will loop */ -#define RUN_FOR_SECONDS 7 - -static pthread_mutex_t connlock; - -static size_t write_db(void *ptr, size_t size, size_t nmemb, void *data) -{ - /* not interested in the downloaded bytes, return the size */ - (void)ptr; /* unused */ - (void)data; /* unused */ - return (size_t)(size * nmemb); -} - -static void lock_cb(CURL *handle, curl_lock_data data, - curl_lock_access access, void *userptr) -{ - (void)access; /* unused */ - (void)userptr; /* unused */ - (void)handle; /* unused */ - (void)data; /* unused */ - pthread_mutex_lock(&connlock); -} - -static void unlock_cb(CURL *handle, curl_lock_data data, - void *userptr) -{ - (void)userptr; /* unused */ - (void)handle; /* unused */ - (void)data; /* unused */ - pthread_mutex_unlock(&connlock); -} - -static void init_locks(void) -{ - pthread_mutex_init(&connlock, NULL); -} - -static void kill_locks(void) -{ - pthread_mutex_destroy(&connlock); -} - -struct initurl { - const char *url; - CURLSH *share; - int threadno; +struct transfer_status { + CURL *easy; + int hd_count; + int bd_count; + CURLcode result; }; -static void *run_thread(void *ptr) +#define KN(a) a, #a + +static int geterr(const char *name, CURLcode val, int lineno) { - struct initurl *u = (struct initurl *)ptr; - int i; - time_t end = time(NULL) + RUN_FOR_SECONDS; - - for(i = 0; time(NULL) < end; i++) { - CURL *curl = curl_easy_init(); - curl_easy_setopt(curl, CURLOPT_URL, u->url); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); - curl_easy_setopt(curl, CURLOPT_SHARE, u->share); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_db); - curl_easy_perform(curl); /* ignores error */ - curl_easy_cleanup(curl); - fprintf(stderr, "Thread %d transfer %d\n", u->threadno, i); - } - - return NULL; + printf("CURLINFO_%s returned %d, \"%s\" on line %d\n", + name, val, curl_easy_strerror(val), lineno); + return (int)val; } -int test(char *URL) +static void report_time(const char *key, const char *where, curl_off_t time, + bool ok) { - pthread_t tid[NUM_THREADS]; - int i; - CURLSH *share; - struct initurl url[NUM_THREADS]; + if(ok) + printf("%s on %s is OK\n", key, where); + else + printf("%s on %s is WRONG: %" CURL_FORMAT_CURL_OFF_T "\n", + key, where, time); +} - /* Must initialize libcurl before any threads are started */ - curl_global_init(CURL_GLOBAL_ALL); - - share = curl_share_init(); - curl_share_setopt(share, CURLSHOPT_LOCKFUNC, lock_cb); - curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, unlock_cb); - curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); - - init_locks(); - - for(i = 0; i< NUM_THREADS; i++) { - int error; - url[i].url = URL; - url[i].share = share; - url[i].threadno = i; - error = pthread_create(&tid[i], NULL, run_thread, &url[i]); - if(0 != error) - fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error); - else - fprintf(stderr, "Thread %d, gets %s\n", i, URL); +static void check_time(CURL *easy, int key, const char *name, + const char *where) +{ + curl_off_t tval; + CURLcode res = curl_easy_getinfo(easy, (CURLINFO)key, &tval); + if(res) { + geterr(name, res, __LINE__); } + else + report_time(name, where, tval, tval > 0); +} - /* now wait for all threads to terminate */ - for(i = 0; i< NUM_THREADS; i++) { - pthread_join(tid[i], NULL); - fprintf(stderr, "Thread %d terminated\n", i); +static void check_time0(CURL *easy, int key, const char *name, + const char *where) +{ + curl_off_t tval; + CURLcode res = curl_easy_getinfo(easy, (CURLINFO)key, &tval); + if(res) { + geterr(name, res, __LINE__); } + else + report_time(name, where, tval, !tval); +} - kill_locks(); +static size_t header_callback(char *ptr, size_t size, size_t nmemb, + void *userp) +{ + struct transfer_status *st = (struct transfer_status *)userp; + size_t len = size * nmemb; - curl_share_cleanup(share); + (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"); + /* continuously updated */ + check_time(st->easy, KN(CURLINFO_TOTAL_TIME_T), "1st header"); + /* no SSL, must be 0 */ + check_time0(st->easy, KN(CURLINFO_APPCONNECT_TIME_T), "1st header"); + /* download not really started */ + check_time0(st->easy, KN(CURLINFO_SPEED_DOWNLOAD_T), "1st header"); + } + (void)fwrite(ptr, size, nmemb, stdout); + return len; +} + +static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userp) +{ + struct transfer_status *st = (struct transfer_status *)userp; + + (void)ptr; + (void)st; + fwrite(ptr, size, nmemb, stdout); + return size * nmemb; +} + +CURLcode test(char *URL) +{ + CURL *curls = NULL; + CURLcode res = CURLE_OK; + struct transfer_status st; + + start_test_timing(); + + memset(&st, 0, sizeof(st)); + + global_init(CURL_GLOBAL_ALL); + + easy_init(curls); + st.easy = curls; /* to allow callbacks access */ + + easy_setopt(curls, CURLOPT_URL, URL); + easy_setopt(curls, CURLOPT_WRITEFUNCTION, write_callback); + easy_setopt(curls, CURLOPT_WRITEDATA, &st); + easy_setopt(curls, CURLOPT_HEADERFUNCTION, header_callback); + easy_setopt(curls, CURLOPT_HEADERDATA, &st); + + easy_setopt(curls, CURLOPT_NOPROGRESS, 0L); + + res = curl_easy_perform(curls); + + 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"); + /* 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"); + +test_cleanup: + + curl_easy_cleanup(curls); curl_global_cleanup(); - return 0; -} -#else /* without pthread, this test doesn't work */ -int test(char *URL) -{ - (void)URL; - return 0; + return res; /* return the final return code */ } -#endif diff --git a/deps/curl/tests/libtest/lib1542.c b/deps/curl/tests/libtest/lib1542.c index 2570ea3c..5a892658 100644 --- a/deps/curl/tests/libtest/lib1542.c +++ b/deps/curl/tests/libtest/lib1542.c @@ -36,10 +36,10 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1545.c b/deps/curl/tests/libtest/lib1545.c index f31baa0c..a1891375 100644 --- a/deps/curl/tests/libtest/lib1545.c +++ b/deps/curl/tests/libtest/lib1545.c @@ -21,15 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#ifndef CURL_DISABLE_DEPRECATION -#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */ -#endif #include "test.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *eh = NULL; - int res = 0; + CURLcode res = CURLE_OK; struct curl_httppost *lastptr = NULL; struct curl_httppost *m_formpost = NULL; @@ -38,17 +35,20 @@ int test(char *URL) easy_init(eh); easy_setopt(eh, 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_IGNORE_DEPRECATION( + curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file", + CURLFORM_FILE, "missing-file", CURLFORM_END); + curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost); + ) (void)curl_easy_perform(eh); (void)curl_easy_perform(eh); test_cleanup: - curl_formfree(m_formpost); - + CURL_IGNORE_DEPRECATION( + curl_formfree(m_formpost); + ) curl_easy_cleanup(eh); curl_global_cleanup(); diff --git a/deps/curl/tests/libtest/lib1550.c b/deps/curl/tests/libtest/lib1550.c index 4c34be86..ddc0c16a 100644 --- a/deps/curl/tests/libtest/lib1550.c +++ b/deps/curl/tests/libtest/lib1550.c @@ -27,10 +27,10 @@ #include -int test(char *URL) +CURLcode test(char *URL) { CURLM *handle; - int res = CURLE_OK; + CURLcode res = CURLE_OK; static const char * const bl_servers[] = {"Microsoft-IIS/6.0", "nginx/0.8.54", NULL}; static const char * const bl_sites[] = @@ -44,5 +44,5 @@ int test(char *URL) curl_multi_setopt(handle, CURLMOPT_PIPELINING_SITE_BL, bl_sites); curl_multi_cleanup(handle); curl_global_cleanup(); - return 0; + return CURLE_OK; } diff --git a/deps/curl/tests/libtest/lib1551.c b/deps/curl/tests/libtest/lib1551.c index 784113aa..20e938ec 100644 --- a/deps/curl/tests/libtest/lib1551.c +++ b/deps/curl/tests/libtest/lib1551.c @@ -27,7 +27,7 @@ #include -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -49,5 +49,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1552.c b/deps/curl/tests/libtest/lib1552.c index c48d640d..821fba27 100644 --- a/deps/curl/tests/libtest/lib1552.c +++ b/deps/curl/tests/libtest/lib1552.c @@ -29,13 +29,13 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { CURL *curls = NULL; CURLM *multi = NULL; int still_running; - int i = 0; - int res = 0; + CURLcode i = CURLE_OK; + CURLcode res = CURLE_OK; CURLMsg *msg; int counter = 3; @@ -59,10 +59,11 @@ int test(char *URL) abort_on_test_timeout(); while(still_running && counter--) { + CURLMcode mres; int num; - res = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); - if(res != CURLM_OK) { - printf("curl_multi_wait() returned %d\n", res); + mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); + if(mres != CURLM_OK) { + printf("curl_multi_wait() returned %d\n", mres); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/deps/curl/tests/libtest/lib1553.c b/deps/curl/tests/libtest/lib1553.c index 8bf15684..998c0762 100644 --- a/deps/curl/tests/libtest/lib1553.c +++ b/deps/curl/tests/libtest/lib1553.c @@ -24,6 +24,7 @@ #include "test.h" #include "testutil.h" +#include "testtrace.h" #include "warnless.h" #include "memdebug.h" @@ -42,13 +43,13 @@ static int xferinfo(void *p, return 1; /* fail as fast as we can */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *curls = NULL; CURLM *multi = NULL; int still_running; - int i = 0; - int res = 0; + CURLcode i = CURLE_OK; + CURLcode res = CURLE_OK; curl_mimepart *field = NULL; curl_mime *mime = NULL; int counter = 1; @@ -74,6 +75,12 @@ int test(char *URL) easy_setopt(curls, CURLOPT_XFERINFOFUNCTION, xferinfo); easy_setopt(curls, CURLOPT_NOPROGRESS, 1L); + libtest_debug_config.nohex = 1; + libtest_debug_config.tracetime = 1; + test_setopt(curls, CURLOPT_DEBUGDATA, &libtest_debug_config); + easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curls, CURLOPT_VERBOSE, 1L); + multi_add_handle(multi, curls); multi_perform(multi, &still_running); @@ -81,10 +88,11 @@ int test(char *URL) abort_on_test_timeout(); while(still_running && counter--) { + CURLMcode mres; int num; - res = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); - if(res != CURLM_OK) { - printf("curl_multi_wait() returned %d\n", res); + mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); + if(mres != CURLM_OK) { + printf("curl_multi_wait() returned %d\n", mres); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/deps/curl/tests/libtest/lib1554.c b/deps/curl/tests/libtest/lib1554.c index 181044d0..3c48f3fe 100644 --- a/deps/curl/tests/libtest/lib1554.c +++ b/deps/curl/tests/libtest/lib1554.c @@ -24,26 +24,38 @@ #include "test.h" #include "memdebug.h" -static void my_lock(CURL *handle, curl_lock_data data, - curl_lock_access laccess, void *useptr) +static const char *ldata_names[] = { + "NONE", + "SHARE", + "COOKIE", + "DNS", + "SESSION", + "CONNECT", + "PSL", + "HSTS", + "NULL", +}; + +static void test_lock(CURL *handle, curl_lock_data data, + curl_lock_access laccess, void *useptr) { (void)handle; (void)data; (void)laccess; (void)useptr; - printf("-> Mutex lock\n"); + printf("-> Mutex lock %s\n", ldata_names[data]); } -static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) { (void)handle; (void)data; (void)useptr; - printf("<- Mutex unlock\n"); + printf("<- Mutex unlock %s\n", ldata_names[data]); } /* test function */ -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURLSH *share = NULL; @@ -58,8 +70,8 @@ int test(char *URL) } curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); - curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); - curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); + curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); + curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); /* Loop the transfer and cleanup the handle properly every lap. This will still reuse connections since the pool is in the shared object! */ @@ -91,5 +103,5 @@ test_cleanup: curl_share_cleanup(share); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1555.c b/deps/curl/tests/libtest/lib1555.c index 1ff6f28d..59db1fbd 100644 --- a/deps/curl/tests/libtest/lib1555.c +++ b/deps/curl/tests/libtest/lib1555.c @@ -53,9 +53,9 @@ static int progressCallback(void *arg, return 1; } -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1556.c b/deps/curl/tests/libtest/lib1556.c index 6f8a2143..25be5e50 100644 --- a/deps/curl/tests/libtest/lib1556.c +++ b/deps/curl/tests/libtest/lib1556.c @@ -31,7 +31,7 @@ struct headerinfo { size_t largest; }; -static size_t header(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t header(char *ptr, size_t size, size_t nmemb, void *stream) { size_t headersize = size * nmemb; struct headerinfo *info = (struct headerinfo *)stream; @@ -44,11 +44,11 @@ static size_t header(void *ptr, size_t size, size_t nmemb, void *stream) return nmemb * size; } -int test(char *URL) +CURLcode test(char *URL) { CURLcode code; CURL *curl = NULL; - int res = 0; + CURLcode res = CURLE_OK; struct headerinfo info = {0}; global_init(CURL_GLOBAL_ALL); @@ -64,7 +64,7 @@ int test(char *URL) if(CURLE_OK != code) { fprintf(stderr, "%s:%d curl_easy_perform() failed, " "with code %d (%s)\n", - __FILE__, __LINE__, (int)code, curl_easy_strerror(code)); + __FILE__, __LINE__, code, curl_easy_strerror(code)); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/deps/curl/tests/libtest/lib1557.c b/deps/curl/tests/libtest/lib1557.c index 2fa34ada..6f0b99ac 100644 --- a/deps/curl/tests/libtest/lib1557.c +++ b/deps/curl/tests/libtest/lib1557.c @@ -27,13 +27,13 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLM *curlm = NULL; CURL *curl1 = NULL; CURL *curl2 = NULL; int running_handles = 0; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1558.c b/deps/curl/tests/libtest/lib1558.c index d64b5980..e3a648f3 100644 --- a/deps/curl/tests/libtest/lib1558.c +++ b/deps/curl/tests/libtest/lib1558.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *curl = NULL; @@ -58,7 +58,7 @@ int test(char *URL) curl_easy_cleanup(curl); curl_global_cleanup(); - return 0; + return CURLE_OK; test_cleanup: diff --git a/deps/curl/tests/libtest/lib1559.c b/deps/curl/tests/libtest/lib1559.c index 402fee3d..37c0b8aa 100644 --- a/deps/curl/tests/libtest/lib1559.c +++ b/deps/curl/tests/libtest/lib1559.c @@ -28,7 +28,7 @@ #include "memdebug.h" #define EXCESSIVE 10*1000*1000 -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *curl = NULL; @@ -37,7 +37,7 @@ int test(char *URL) (void)URL; if(!longurl) - return 1; + return (CURLcode)1; memset(longurl, 'a', EXCESSIVE); longurl[EXCESSIVE-1] = 0; @@ -47,11 +47,11 @@ int test(char *URL) res = curl_easy_setopt(curl, CURLOPT_URL, longurl); printf("CURLOPT_URL %d bytes URL == %d\n", - EXCESSIVE, (int)res); + EXCESSIVE, res); res = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, longurl); printf("CURLOPT_POSTFIELDS %d bytes data == %d\n", - EXCESSIVE, (int)res); + EXCESSIVE, res); u = curl_url(); if(u) { diff --git a/deps/curl/tests/libtest/lib1560.c b/deps/curl/tests/libtest/lib1560.c index 1509c76a..d5253a73 100644 --- a/deps/curl/tests/libtest/lib1560.c +++ b/deps/curl/tests/libtest/lib1560.c @@ -31,7 +31,7 @@ */ #include "test.h" -#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) +#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN) #define USE_IDN #endif @@ -151,6 +151,27 @@ struct clearurlcase { }; static const struct testcase get_parts_list[] ={ + {"curl.se", + "[10] | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]", + CURLU_GUESS_SCHEME, CURLU_NO_GUESS_SCHEME, CURLUE_OK}, + {"https://curl.se:0/#", + "https | [11] | [12] | [13] | curl.se | 0 | / | [16] | ", + 0, CURLU_GET_EMPTY, CURLUE_OK}, + {"https://curl.se/#", + "https | [11] | [12] | [13] | curl.se | [15] | / | [16] | ", + 0, CURLU_GET_EMPTY, CURLUE_OK}, + {"https://curl.se/?#", + "https | [11] | [12] | [13] | curl.se | [15] | / | | ", + 0, CURLU_GET_EMPTY, CURLUE_OK}, + {"https://curl.se/?", + "https | [11] | [12] | [13] | curl.se | [15] | / | | [17]", + 0, CURLU_GET_EMPTY, CURLUE_OK}, + {"https://curl.se/?", + "https | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]", + 0, 0, CURLUE_OK}, + {"https://curl.se/?#", + "https | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]", + 0, 0, CURLUE_OK}, {"https://curl.se/# ", "https | [11] | [12] | [13] | curl.se | [15] | / | [16] | %20%20", CURLU_URLENCODE|CURLU_ALLOW_SPACE, 0, CURLUE_OK}, @@ -253,7 +274,7 @@ static const struct testcase get_parts_list[] ={ {"https://user@example.net", "https | user | [12] | [13] | example.net | [15] | / | [16] | [17]", 0, 0, CURLUE_OK}, -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS {"ws://example.com/color/?green", "ws | [11] | [12] | [13] | example.com | [15] | /color/ | green |" " [17]", @@ -508,6 +529,23 @@ static const struct testcase get_parts_list[] ={ }; static const struct urltestcase get_url_list[] = { + {"example.com", + "example.com/", + CURLU_GUESS_SCHEME, CURLU_NO_GUESS_SCHEME, CURLUE_OK}, + {"http://user@example.com?#", + "http://user@example.com/?#", + 0, CURLU_GET_EMPTY, CURLUE_OK}, + /* WHATWG disgrees, it wants "https:/0.0.0.0/" */ + {"https://0x.0x.0", "https://0x.0x.0/", 0, 0, CURLUE_OK}, + + {"https://example.com:000000000000000000000443/foo", + "https://example.com/foo", + 0, CURLU_NO_DEFAULT_PORT, CURLUE_OK}, + {"https://example.com:000000000000000000000/foo", + "https://example.com:0/foo", + 0, CURLU_NO_DEFAULT_PORT, CURLUE_OK}, + {"https://192.0x0000A80001", "https://192.168.0.1/", 0, 0, CURLUE_OK}, + {"https://0xffffffff", "https://255.255.255.255/", 0, 0, CURLUE_OK}, {"https://1.0x1000000", "https://1.0x1000000/", 0, 0, CURLUE_OK}, {"https://0x7f.1", "https://127.0.0.1/", 0, 0, CURLUE_OK}, {"https://1.2.3.256.com", "https://1.2.3.256.com/", 0, 0, CURLUE_OK}, @@ -527,6 +565,10 @@ static const struct urltestcase get_url_list[] = { {"https://[fe80:0:0:0:409b::]:80/moo", "https://[fe80::409b:0:0:0]:80/moo", 0, 0, CURLUE_OK}, + /* normalize to lower case */ + {"https://[FE80:0:A:0:409B:0:0:0]:80/moo", + "https://[fe80:0:a:0:409b::]:80/moo", + 0, 0, CURLUE_OK}, {"https://[::%25fakeit];80/moo", "", 0, 0, CURLUE_BAD_PORT_NUMBER}, @@ -770,6 +812,18 @@ static int checkurl(const char *org, const char *url, const char *out) 3. Extract all components (not URL) */ static const struct setgetcase setget_parts_list[] = { + {"https://example.com/", + "query=\"\",", + "https | [11] | [12] | [13] | example.com | [15] | / | | [17]", + 0, 0, CURLU_GET_EMPTY, CURLUE_OK}, + {"https://example.com/", + "fragment=\"\",", + "https | [11] | [12] | [13] | example.com | [15] | / | [16] | ", + 0, 0, CURLU_GET_EMPTY, CURLUE_OK}, + {"https://example.com/", + "query=\"\",", + "https | [11] | [12] | [13] | example.com | [15] | / | [16] | [17]", + 0, 0, 0, CURLUE_OK}, {"https://example.com", "path=get,", "https | [11] | [12] | [13] | example.com | [15] | /get | [16] | [17]", @@ -788,6 +842,14 @@ static const struct setgetcase setget_parts_list[] = { /* !checksrc! disable SPACEBEFORECOMMA 1 */ static const struct setcase set_parts_list[] = { + {"https://example.com/", + "host=%43url.se,", + "https://%43url.se/", + 0, 0, CURLUE_OK, CURLUE_OK}, + {"https://example.com/", + "host=%25url.se,", + "", + 0, 0, CURLUE_OK, CURLUE_BAD_HOSTNAME}, {"https://example.com/?param=value", "query=\"\",", "https://example.com/", @@ -900,8 +962,8 @@ static const struct setcase set_parts_list[] = { 0, 0, CURLUE_OK, CURLUE_BAD_PORT_NUMBER}, {"https://host:1234/", "port=0,", - "https://host:1234/", - 0, 0, CURLUE_OK, CURLUE_BAD_PORT_NUMBER}, + "https://host:0/", + 0, 0, CURLUE_OK, CURLUE_OK}, {"https://host:1234/", "port=65535,", "https://host:65535/", @@ -1081,6 +1143,54 @@ static CURLUcode updateurl(CURLU *u, const char *cmd, unsigned int setflags) } static const struct redircase set_url_list[] = { + {"http://example.org/", + "../path/././../../moo", + "http://example.org/moo", + 0, 0, CURLUE_OK}, + {"http://example.org/", + "//example.org/../path/../../", + "http://example.org/", + 0, 0, CURLUE_OK}, + {"http://example.org/", + "///example.org/../path/../../", + "http://example.org/", + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + ":23", + "http://example.org/foo/:23", + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "\\x", + "http://example.org/foo/\\x", + /* WHATWG disagrees */ + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "#/", + "http://example.org/foo/bar#/", + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "?/", + "http://example.org/foo/bar?/", + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "#;?", + "http://example.org/foo/bar#;?", + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "#", + "http://example.org/foo/bar", + /* This happens because the parser removes empty fragments */ + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "?", + "http://example.org/foo/bar", + /* This happens because the parser removes empty queries */ + 0, 0, CURLUE_OK}, + {"http://example.org/foo/bar", + "?#", + "http://example.org/foo/bar", + /* This happens because the parser removes empty queries and fragments */ + 0, 0, CURLUE_OK}, {"http://example.com/please/../gimme/%TESTNUMBER?foobar#hello", "http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no", "http://example.net/there/tes%20t%20case=/%TESTNUMBER0002?+yes+no", @@ -1663,13 +1773,13 @@ static int huge(void) char *partp; msnprintf(total, sizeof(total), "%s://%s:%s@%s/%s?%s#%s", - (i == 0)? &bigpart[1] : smallpart, - (i == 1)? &bigpart[1] : smallpart, - (i == 2)? &bigpart[1] : smallpart, - (i == 3)? &bigpart[1] : smallpart, - (i == 4)? &bigpart[1] : smallpart, - (i == 5)? &bigpart[1] : smallpart, - (i == 6)? &bigpart[1] : smallpart); + (i == 0) ? &bigpart[1] : smallpart, + (i == 1) ? &bigpart[1] : smallpart, + (i == 2) ? &bigpart[1] : smallpart, + (i == 3) ? &bigpart[1] : smallpart, + (i == 4) ? &bigpart[1] : smallpart, + (i == 5) ? &bigpart[1] : smallpart, + (i == 6) ? &bigpart[1] : smallpart); rc = curl_url_set(urlp, CURLUPART_URL, total, CURLU_NON_SUPPORT_SCHEME); if((!i && (rc != CURLUE_BAD_SCHEME)) || (i && rc)) { @@ -1755,43 +1865,43 @@ err: return 1; } -int test(char *URL) +CURLcode test(char *URL) { (void)URL; /* not used */ if(urldup()) - return 11; + return (CURLcode)11; if(setget_parts()) - return 10; + return (CURLcode)10; if(get_url()) - return 3; + return (CURLcode)3; if(huge()) - return 9; + return (CURLcode)9; if(get_nothing()) - return 7; + return (CURLcode)7; if(scopeid()) - return 6; + return (CURLcode)6; if(append()) - return 5; + return (CURLcode)5; if(set_url()) - return 1; + return (CURLcode)1; if(set_parts()) - return 2; + return (CURLcode)2; if(get_parts()) - return 4; + return (CURLcode)4; if(clear_url()) - return 8; + return (CURLcode)8; printf("success\n"); - return 0; + return CURLE_OK; } diff --git a/deps/curl/tests/libtest/lib1564.c b/deps/curl/tests/libtest/lib1564.c index b10d0344..851d02c4 100644 --- a/deps/curl/tests/libtest/lib1564.c +++ b/deps/curl/tests/libtest/lib1564.c @@ -30,12 +30,12 @@ #define TEST_HANG_TIMEOUT 60 * 1000 #define WAKEUP_NUM 10 -int test(char *URL) +CURLcode test(char *URL) { CURLM *multi = NULL; int numfds; int i; - int res = 0; + CURLcode res = CURLE_OK; struct timeval time_before_wait, time_after_wait; (void)URL; diff --git a/deps/curl/tests/libtest/lib1565.c b/deps/curl/tests/libtest/lib1565.c index 90039514..b6b8ecf1 100644 --- a/deps/curl/tests/libtest/lib1565.c +++ b/deps/curl/tests/libtest/lib1565.c @@ -38,15 +38,15 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static CURL *pending_handles[CONN_NUM]; static int pending_num = 0; -static int test_failure = 0; +static CURLcode test_failure = CURLE_OK; -static CURLM *multi = NULL; +static CURLM *testmulti = NULL; static const char *url; static void *run_thread(void *ptr) { CURL *easy = NULL; - int res = 0; + CURLcode res = CURLE_OK; int i; (void)ptr; @@ -72,7 +72,7 @@ static void *run_thread(void *ptr) pthread_mutex_unlock(&lock); - res_multi_wakeup(multi); + res_multi_wakeup(testmulti); } test_cleanup: @@ -89,12 +89,13 @@ test_cleanup: return NULL; } -int test(char *URL) +CURLcode test(char *URL) { int still_running; int num; int i; - int res = 0; + int result; + CURLcode res = CURLE_OK; CURL *started_handles[CONN_NUM]; int started_num = 0; int finished_num = 0; @@ -106,30 +107,30 @@ int test(char *URL) global_init(CURL_GLOBAL_ALL); - multi_init(multi); + multi_init(testmulti); url = URL; - res = pthread_create(&tid, NULL, run_thread, NULL); - if(!res) + result = pthread_create(&tid, NULL, run_thread, NULL); + if(!result) tid_valid = true; else { fprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", - __FILE__, __LINE__, res); + __FILE__, __LINE__, result); goto test_cleanup; } while(1) { - multi_perform(multi, &still_running); + multi_perform(testmulti, &still_running); abort_on_test_timeout(); - while((message = curl_multi_info_read(multi, &num))) { + while((message = curl_multi_info_read(testmulti, &num))) { if(message->msg == CURLMSG_DONE) { res = message->data.result; if(res) goto test_cleanup; - multi_remove_handle(multi, message->easy_handle); + multi_remove_handle(testmulti, message->easy_handle); finished_num++; } else { @@ -145,14 +146,14 @@ int test(char *URL) if(CONN_NUM == finished_num) break; - multi_poll(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); + multi_poll(testmulti, NULL, 0, TEST_HANG_TIMEOUT, &num); abort_on_test_timeout(); pthread_mutex_lock(&lock); while(pending_num > 0) { - res_multi_add_handle(multi, pending_handles[pending_num - 1]); + res_multi_add_handle(testmulti, pending_handles[pending_num - 1]); if(res) { pthread_mutex_unlock(&lock); goto test_cleanup; @@ -190,7 +191,7 @@ test_cleanup: if(tid_valid) pthread_join(tid, NULL); - curl_multi_cleanup(multi); + curl_multi_cleanup(testmulti); for(i = 0; i < pending_num; i++) curl_easy_cleanup(pending_handles[i]); for(i = 0; i < started_num; i++) @@ -201,7 +202,7 @@ test_cleanup: } #else /* without pthread, this test doesn't work */ -int test(char *URL) +CURLcode test(char *URL) { (void)URL; return 0; diff --git a/deps/curl/tests/libtest/lib1567.c b/deps/curl/tests/libtest/lib1567.c index 26b438dd..fae8cc12 100644 --- a/deps/curl/tests/libtest/lib1567.c +++ b/deps/curl/tests/libtest/lib1567.c @@ -27,7 +27,7 @@ #include -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_OK; @@ -55,5 +55,5 @@ test_cleanup: curl_url_cleanup(u); curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1568.c b/deps/curl/tests/libtest/lib1568.c index 78e7e6b8..383d517a 100644 --- a/deps/curl/tests/libtest/lib1568.c +++ b/deps/curl/tests/libtest/lib1568.c @@ -26,7 +26,7 @@ #include "testtrace.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret; CURL *hnd; @@ -48,5 +48,5 @@ int test(char *URL) hnd = NULL; curl_global_cleanup(); - return (int)ret; + return ret; } diff --git a/deps/curl/tests/libtest/lib1569.c b/deps/curl/tests/libtest/lib1569.c index e24a387e..767d8816 100644 --- a/deps/curl/tests/libtest/lib1569.c +++ b/deps/curl/tests/libtest/lib1569.c @@ -26,7 +26,7 @@ #include "testtrace.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *hnd; @@ -47,5 +47,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(hnd); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1591.c b/deps/curl/tests/libtest/lib1591.c index 5701e10a..c0200d54 100644 --- a/deps/curl/tests/libtest/lib1591.c +++ b/deps/curl/tests/libtest/lib1591.c @@ -31,24 +31,24 @@ #include #include "memdebug.h" -static char data [] = "Hello Cloud!\r\n"; +static char testdata[] = "Hello Cloud!\r\n"; static size_t consumed = 0; static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) { size_t amount = nmemb * size; /* Total bytes curl wants */ - if(consumed == strlen(data)) { + if(consumed == strlen(testdata)) { return 0; } - if(amount > strlen(data)-consumed) { - amount = strlen(data); + if(amount > strlen(testdata)-consumed) { + amount = strlen(testdata); } consumed += amount; (void)stream; - memcpy(ptr, data, amount); + memcpy(ptr, testdata, amount); return amount; } @@ -73,7 +73,7 @@ static int trailers_callback(struct curl_slist **list, void *userdata) } } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -116,5 +116,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1592.c b/deps/curl/tests/libtest/lib1592.c index 974dd256..ebfcf74b 100644 --- a/deps/curl/tests/libtest/lib1592.c +++ b/deps/curl/tests/libtest/lib1592.c @@ -41,7 +41,7 @@ #include -int test(char *URL) +CURLcode test(char *URL) { int stillRunning; CURLM *multiHandle = NULL; @@ -103,8 +103,7 @@ int test(char *URL) start_test_timing(); mres = curl_multi_remove_handle(multiHandle, curl); if(mres) { - fprintf(stderr, "curl_multi_remove_handle() failed, " - "with code %d\n", (int)res); + fprintf(stderr, "curl_multi_remove_handle() failed, with code %d\n", mres); res = TEST_ERR_MULTI; goto test_cleanup; } @@ -120,5 +119,5 @@ test_cleanup: curl_multi_cleanup(multiHandle); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1593.c b/deps/curl/tests/libtest/lib1593.c index b0a91b9f..f5239fda 100644 --- a/deps/curl/tests/libtest/lib1593.c +++ b/deps/curl/tests/libtest/lib1593.c @@ -28,12 +28,12 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { struct curl_slist *header = NULL; long unmet; CURL *curl = NULL; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1594.c b/deps/curl/tests/libtest/lib1594.c index 5346c662..bf25ffbe 100644 --- a/deps/curl/tests/libtest/lib1594.c +++ b/deps/curl/tests/libtest/lib1594.c @@ -28,12 +28,12 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { struct curl_slist *header = NULL; curl_off_t retry; CURL *curl = NULL; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_ALL); diff --git a/deps/curl/tests/libtest/lib1597.c b/deps/curl/tests/libtest/lib1597.c index 44769f9c..fa09e71d 100644 --- a/deps/curl/tests/libtest/lib1597.c +++ b/deps/curl/tests/libtest/lib1597.c @@ -33,10 +33,10 @@ struct pair { CURLcode *exp; }; -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; - int res = 0; + CURLcode res = CURLE_OK; CURLcode result = CURLE_OK; curl_version_info_data *curlinfo; const char *const *proto; @@ -77,7 +77,7 @@ int test(char *URL) curlinfo = curl_version_info(CURLVERSION_NOW); if(!curlinfo) { fputs("curl_version_info failed\n", stderr); - res = (int) TEST_ERR_FAILURE; + res = TEST_ERR_FAILURE; goto test_cleanup; } @@ -85,7 +85,7 @@ int test(char *URL) for(proto = curlinfo->protocols; *proto; proto++) { if((size_t) n >= sizeof(protolist)) { puts("protolist buffer too small\n"); - res = (int) TEST_ERR_FAILURE; + res = TEST_ERR_FAILURE; goto test_cleanup; } n += msnprintf(protolist + n, sizeof(protolist) - n, ",%s", *proto); @@ -99,17 +99,15 @@ int test(char *URL) for(i = 0; prots[i].in; i++) { result = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, prots[i].in); if(result != *prots[i].exp) { - printf("unexpectedly '%s' returned %u\n", - prots[i].in, result); + printf("unexpectedly '%s' returned %d\n", prots[i].in, result); break; } } printf("Tested %u strings\n", i); - res = (int)result; test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)result; + return result; } diff --git a/deps/curl/tests/libtest/lib1598.c b/deps/curl/tests/libtest/lib1598.c index 63cdfcfb..904ba65b 100644 --- a/deps/curl/tests/libtest/lib1598.c +++ b/deps/curl/tests/libtest/lib1598.c @@ -54,7 +54,7 @@ static int trailers_callback(struct curl_slist **list, void *userdata) static const char *post_data = "xxx=yyy&aaa=bbbbb"; -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_FAILED_INIT; @@ -87,7 +87,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_URL, URL); test_setopt(curl, CURLOPT_HTTPHEADER, hhl); - test_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(post_data)); + test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(post_data)); test_setopt(curl, CURLOPT_POSTFIELDS, post_data); test_setopt(curl, CURLOPT_TRAILERFUNCTION, trailers_callback); test_setopt(curl, CURLOPT_TRAILERDATA, NULL); @@ -103,5 +103,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1662.c b/deps/curl/tests/libtest/lib1662.c index 93c08003..1e9e2b06 100644 --- a/deps/curl/tests/libtest/lib1662.c +++ b/deps/curl/tests/libtest/lib1662.c @@ -23,7 +23,7 @@ ***************************************************************************/ #include "test.h" -static char data[]="mooaaa"; +static char testdata[]="mooaaa"; struct WriteThis { size_t sizeleft; @@ -32,13 +32,13 @@ struct WriteThis { static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) { struct WriteThis *pooh = (struct WriteThis *)userp; - size_t len = strlen(data); + size_t len = strlen(testdata); if(size*nmemb < len) return 0; if(pooh->sizeleft) { - memcpy(ptr, data, strlen(data)); + memcpy(ptr, testdata, strlen(testdata)); pooh->sizeleft = 0; return len; } @@ -47,7 +47,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) } -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *hnd; @@ -86,5 +86,5 @@ int test(char *URL) curl_easy_cleanup(hnd); curl_mime_free(mime1); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1900.c b/deps/curl/tests/libtest/lib1900.c index 92f89c4c..1b26e7b9 100644 --- a/deps/curl/tests/libtest/lib1900.c +++ b/deps/curl/tests/libtest/lib1900.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *hnd = NULL; @@ -45,11 +45,11 @@ int test(char *URL) curl_easy_cleanup(hnd); curl_easy_cleanup(second); curl_global_cleanup(); - return 0; + return CURLE_OK; test_cleanup: curl_easy_cleanup(hnd); curl_easy_cleanup(second); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1901.c b/deps/curl/tests/libtest/lib1901.c new file mode 100644 index 00000000..314f0354 --- /dev/null +++ b/deps/curl/tests/libtest/lib1901.c @@ -0,0 +1,95 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 "test.h" + +#include "testutil.h" +#include "warnless.h" +#include "memdebug.h" + + + +static const char *chunks[]={ + "one", + "two", + "three", + "four", + NULL +}; + + +static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) +{ + static int ix = 0; + (void)size; + (void)nmemb; + (void)stream; + if(chunks[ix]) { + size_t len = strlen(chunks[ix]); + strcpy(ptr, chunks[ix]); + ix++; + return len; + } + return 0; +} + +CURLcode test(char *URL) +{ + CURL *curl; + CURLcode res = CURLE_OK; + struct curl_slist *chunk = NULL; + + curl_global_init(CURL_GLOBAL_ALL); + + curl = curl_easy_init(); + if(curl) { + /* deliberately setting the size - to a wrong value to make sure libcurl + ignores it */ + easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 4L); + easy_setopt(curl, CURLOPT_POSTFIELDS, NULL); + easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); + easy_setopt(curl, CURLOPT_POST, 1L); + easy_setopt(curl, CURLOPT_VERBOSE, 1L); + easy_setopt(curl, CURLOPT_HTTP_VERSION, (long)CURL_HTTP_VERSION_1_1); + easy_setopt(curl, CURLOPT_URL, URL); + easy_setopt(curl, CURLOPT_READDATA, NULL); + + chunk = curl_slist_append(chunk, "Expect:"); + if(chunk) { + struct curl_slist *n = + curl_slist_append(chunk, "Transfer-Encoding: chunked"); + if(n) + chunk = n; + if(n) + easy_setopt(curl, CURLOPT_HTTPHEADER, n); + } + + res = curl_easy_perform(curl); + } +test_cleanup: + curl_easy_cleanup(curl); + curl_slist_free_all(chunk); + + curl_global_cleanup(); + return res; +} diff --git a/deps/curl/tests/libtest/lib1903.c b/deps/curl/tests/libtest/lib1903.c index 3c4ae307..0ffbb14a 100644 --- a/deps/curl/tests/libtest/lib1903.c +++ b/deps/curl/tests/libtest/lib1903.c @@ -28,7 +28,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *ch = NULL; @@ -53,5 +53,5 @@ test_cleanup: curl_easy_cleanup(ch); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1905.c b/deps/curl/tests/libtest/lib1905.c index 62b9c60c..bba0400c 100644 --- a/deps/curl/tests/libtest/lib1905.c +++ b/deps/curl/tests/libtest/lib1905.c @@ -28,7 +28,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLSH *sh = NULL; CURL *ch = NULL; @@ -40,7 +40,7 @@ int test(char *URL) cm = curl_multi_init(); if(!cm) { curl_global_cleanup(); - return 1; + return (CURLcode)1; } sh = curl_share_init(); if(!sh) @@ -96,5 +96,5 @@ cleanup: curl_multi_cleanup(cm); curl_global_cleanup(); - return 0; + return CURLE_OK; } diff --git a/deps/curl/tests/libtest/lib1906.c b/deps/curl/tests/libtest/lib1906.c index b60587f8..fded3bfb 100644 --- a/deps/curl/tests/libtest/lib1906.c +++ b/deps/curl/tests/libtest/lib1906.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; char *url_after = NULL; @@ -49,7 +49,7 @@ int test(char *URL) if(res != CURLE_COULDNT_CONNECT && res != CURLE_OPERATION_TIMEDOUT) { fprintf(stderr, "failure expected, " "curl_easy_perform returned %d: <%s>, <%s>\n", - (int) res, curl_easy_strerror(res), error_buffer); + res, curl_easy_strerror(res), error_buffer); if(res == CURLE_OK) res = TEST_ERR_MAJOR_BAD; /* force an error return */ goto test_cleanup; @@ -68,8 +68,8 @@ int test(char *URL) res = curl_easy_perform(curl); if(res) fprintf(stderr, "success expected, " - "curl_easy_perform returned %ld: <%s>, <%s>\n", - (long) res, curl_easy_strerror(res), error_buffer); + "curl_easy_perform returned %d: <%s>, <%s>\n", + res, curl_easy_strerror(res), error_buffer); /* print url */ curl_url_get(curlu, CURLUPART_URL, &url_after, 0); @@ -81,5 +81,5 @@ test_cleanup: curl_url_cleanup(curlu); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1907.c b/deps/curl/tests/libtest/lib1907.c index 41cea379..82026f23 100644 --- a/deps/curl/tests/libtest/lib1907.c +++ b/deps/curl/tests/libtest/lib1907.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { char *url_after; CURL *curl; @@ -52,5 +52,5 @@ int test(char *URL) curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1908.c b/deps/curl/tests/libtest/lib1908.c index ff92dafb..3c7187c5 100644 --- a/deps/curl/tests/libtest/lib1908.c +++ b/deps/curl/tests/libtest/lib1908.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret = CURLE_OK; CURL *hnd; @@ -60,5 +60,5 @@ int test(char *URL) curl_easy_cleanup(hnd); } curl_global_cleanup(); - return (int)ret; + return ret; } diff --git a/deps/curl/tests/libtest/lib1910.c b/deps/curl/tests/libtest/lib1910.c index fed1ca22..9d3f1b3a 100644 --- a/deps/curl/tests/libtest/lib1910.c +++ b/deps/curl/tests/libtest/lib1910.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret = CURLE_OK; CURL *hnd; @@ -45,5 +45,5 @@ int test(char *URL) curl_easy_cleanup(hnd); } curl_global_cleanup(); - return (int)ret; + return ret; } diff --git a/deps/curl/tests/libtest/lib1911.c b/deps/curl/tests/libtest/lib1911.c index b7c50fc5..0fd62a8b 100644 --- a/deps/curl/tests/libtest/lib1911.c +++ b/deps/curl/tests/libtest/lib1911.c @@ -31,9 +31,9 @@ define not publicly exposed so we set our own */ #define MAX_INPUT_LENGTH 8000000 -static char buffer[MAX_INPUT_LENGTH + 2]; +static char testbuf[MAX_INPUT_LENGTH + 2]; -int test(char *URL) +CURLcode test(char *URL) { const struct curl_easyoption *o; CURL *easy; @@ -44,14 +44,14 @@ int test(char *URL) easy = curl_easy_init(); if(!easy) { curl_global_cleanup(); - return 1; + return (CURLcode)1; } /* make it a null-terminated C string with just As */ - memset(buffer, 'A', MAX_INPUT_LENGTH + 1); - buffer[MAX_INPUT_LENGTH + 1] = 0; + memset(testbuf, 'A', MAX_INPUT_LENGTH + 1); + testbuf[MAX_INPUT_LENGTH + 1] = 0; - printf("string length: %d\n", (int)strlen(buffer)); + printf("string length: %d\n", (int)strlen(testbuf)); for(o = curl_easy_option_next(NULL); o; @@ -76,7 +76,7 @@ int test(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, buffer); + result = curl_easy_setopt(easy, o->id, testbuf); switch(result) { case CURLE_BAD_FUNCTION_ARGUMENT: /* the most normal */ case CURLE_UNKNOWN_OPTION: /* left out from the build */ @@ -86,7 +86,7 @@ int test(char *URL) default: /* all other return codes are unexpected */ fprintf(stderr, "curl_easy_setopt(%s...) returned %d\n", - o->name, (int)result); + o->name, result); error++; break; } @@ -94,5 +94,5 @@ int test(char *URL) } curl_easy_cleanup(easy); curl_global_cleanup(); - return error; + return error == 0 ? CURLE_OK : TEST_ERR_FAILURE; } diff --git a/deps/curl/tests/libtest/lib1912.c b/deps/curl/tests/libtest/lib1912.c index 13f25bc9..b6667c00 100644 --- a/deps/curl/tests/libtest/lib1912.c +++ b/deps/curl/tests/libtest/lib1912.c @@ -30,7 +30,7 @@ #define print_err(name, exp) \ fprintf(stderr, "Type mismatch for CURLOPT_%s (expected %s)\n", name, exp); -int test(char *URL) +CURLcode test(char *URL) { /* Only test if GCC typechecking is available */ int error = 0; @@ -80,5 +80,5 @@ int test(char *URL) } #endif (void)URL; - return error; + return error == 0 ? CURLE_OK : TEST_ERR_FAILURE; } diff --git a/deps/curl/tests/libtest/lib1913.c b/deps/curl/tests/libtest/lib1913.c index a2838636..84684200 100644 --- a/deps/curl/tests/libtest/lib1913.c +++ b/deps/curl/tests/libtest/lib1913.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret = CURLE_OK; CURL *hnd; @@ -46,5 +46,5 @@ int test(char *URL) curl_easy_cleanup(hnd); } curl_global_cleanup(); - return (int)ret; + return ret; } diff --git a/deps/curl/tests/libtest/lib1915.c b/deps/curl/tests/libtest/lib1915.c index 0672c70d..ead6713a 100644 --- a/deps/curl/tests/libtest/lib1915.c +++ b/deps/curl/tests/libtest/lib1915.c @@ -23,6 +23,7 @@ ***************************************************************************/ #include "test.h" +#include "testtrace.h" #include "testutil.h" #include "warnless.h" #include "memdebug.h" @@ -96,7 +97,7 @@ static CURLSTScode hstswrite(CURL *easy, struct curl_hstsentry *e, * Read/write HSTS cache entries via callback. */ -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *hnd; @@ -104,33 +105,46 @@ int test(char *URL) global_init(CURL_GLOBAL_ALL); + libtest_debug_config.nohex = 1; + libtest_debug_config.tracetime = 1; + 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, &libtest_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; - printf("First request returned %d\n", (int)res); + if(res == CURLE_OPERATION_TIMEDOUT) /* we expect that on Windows */ + res = CURLE_COULDNT_CONNECT; + printf("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, &libtest_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; - printf("Second request returned %d\n", (int)res); + printf("Second request returned %d\n", res); test_cleanup: curl_easy_cleanup(hnd); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1916.c b/deps/curl/tests/libtest/lib1916.c index b97263c2..36a938b6 100644 --- a/deps/curl/tests/libtest/lib1916.c +++ b/deps/curl/tests/libtest/lib1916.c @@ -26,7 +26,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -52,5 +52,5 @@ int test(char *URL) curl_easy_cleanup(curl); } curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1918.c b/deps/curl/tests/libtest/lib1918.c index 34c36088..7eaf41bd 100644 --- a/deps/curl/tests/libtest/lib1918.c +++ b/deps/curl/tests/libtest/lib1918.c @@ -27,10 +27,9 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { const struct curl_easyoption *o; - int error = 0; (void)URL; curl_global_init(CURL_GLOBAL_ALL); @@ -53,5 +52,5 @@ int test(char *URL) } } curl_global_cleanup(); - return error; + return CURLE_OK; } diff --git a/deps/curl/tests/libtest/lib1919.c b/deps/curl/tests/libtest/lib1919.c index 37457c06..68ce7a19 100644 --- a/deps/curl/tests/libtest/lib1919.c +++ b/deps/curl/tests/libtest/lib1919.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *curl; @@ -52,5 +52,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1933.c b/deps/curl/tests/libtest/lib1933.c index cc3af078..554756c3 100644 --- a/deps/curl/tests/libtest/lib1933.c +++ b/deps/curl/tests/libtest/lib1933.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1934.c b/deps/curl/tests/libtest/lib1934.c index 36fc8f70..6257759f 100644 --- a/deps/curl/tests/libtest/lib1934.c +++ b/deps/curl/tests/libtest/lib1934.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1935.c b/deps/curl/tests/libtest/lib1935.c index ee52d441..8800916c 100644 --- a/deps/curl/tests/libtest/lib1935.c +++ b/deps/curl/tests/libtest/lib1935.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1936.c b/deps/curl/tests/libtest/lib1936.c index b86eee7b..c136fc0a 100644 --- a/deps/curl/tests/libtest/lib1936.c +++ b/deps/curl/tests/libtest/lib1936.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1937.c b/deps/curl/tests/libtest/lib1937.c index 74249666..61f71127 100644 --- a/deps/curl/tests/libtest/lib1937.c +++ b/deps/curl/tests/libtest/lib1937.c @@ -26,7 +26,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1938.c b/deps/curl/tests/libtest/lib1938.c index 4b5218bd..02ab6cc2 100644 --- a/deps/curl/tests/libtest/lib1938.c +++ b/deps/curl/tests/libtest/lib1938.c @@ -26,7 +26,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1939.c b/deps/curl/tests/libtest/lib1939.c index 4adc8766..c7365e5f 100644 --- a/deps/curl/tests/libtest/lib1939.c +++ b/deps/curl/tests/libtest/lib1939.c @@ -26,7 +26,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLM *multi; CURL *easy; diff --git a/deps/curl/tests/libtest/lib1940.c b/deps/curl/tests/libtest/lib1940.c index 05da9de3..e8dbcdd1 100644 --- a/deps/curl/tests/libtest/lib1940.c +++ b/deps/curl/tests/libtest/lib1940.c @@ -26,7 +26,7 @@ #include "memdebug.h" -static const char *show[]={ +static const char *testdata[]={ "daTE", "Server", "content-type", @@ -50,9 +50,9 @@ static void showem(CURL *easy, unsigned int type) { int i; struct curl_header *header; - for(i = 0; show[i]; i++) { - if(CURLHE_OK == curl_easy_header(easy, show[i], 0, type, HEADER_REQUEST, - &header)) { + for(i = 0; testdata[i]; i++) { + if(CURLHE_OK == curl_easy_header(easy, testdata[i], 0, type, + HEADER_REQUEST, &header)) { if(header->amount > 1) { /* more than one, iterate over them */ size_t index = 0; @@ -63,7 +63,7 @@ static void showem(CURL *easy, unsigned int type) if(++index == amount) break; - if(CURLHE_OK != curl_easy_header(easy, show[i], index, type, + if(CURLHE_OK != curl_easy_header(easy, testdata[i], index, type, HEADER_REQUEST, &header)) break; } while(1); @@ -83,7 +83,7 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp) (void)userp; return n*l; } -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; CURLcode res = CURLE_OK; @@ -116,5 +116,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(easy); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1945.c b/deps/curl/tests/libtest/lib1945.c index 2483402f..8cbb01ec 100644 --- a/deps/curl/tests/libtest/lib1945.c +++ b/deps/curl/tests/libtest/lib1945.c @@ -49,7 +49,7 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp) (void)userp; return n*l; } -int test(char *URL) +CURLcode test(char *URL) { CURL *easy; CURLcode res = CURLE_OK; @@ -70,12 +70,12 @@ int test(char *URL) } res = curl_easy_perform(easy); if(res) { - printf("badness: %d\n", (int)res); + printf("badness: %d\n", res); } showem(easy, CURLH_CONNECT|CURLH_HEADER|CURLH_TRAILER|CURLH_1XX); test_cleanup: curl_easy_cleanup(easy); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1947.c b/deps/curl/tests/libtest/lib1947.c index c81345f9..cd14e266 100644 --- a/deps/curl/tests/libtest/lib1947.c +++ b/deps/curl/tests/libtest/lib1947.c @@ -33,7 +33,7 @@ static size_t writecb(char *data, size_t n, size_t l, void *userp) (void)userp; return n*l; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -88,5 +88,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1948.c b/deps/curl/tests/libtest/lib1948.c index a30244c2..45c7f199 100644 --- a/deps/curl/tests/libtest/lib1948.c +++ b/deps/curl/tests/libtest/lib1948.c @@ -41,7 +41,7 @@ static size_t put_callback(char *ptr, size_t size, size_t nmemb, void *stream) return tocopy; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -74,5 +74,5 @@ int test(char *URL) test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib1955.c b/deps/curl/tests/libtest/lib1955.c index 3328d7ef..39b5754a 100644 --- a/deps/curl/tests/libtest/lib1955.c +++ b/deps/curl/tests/libtest/lib1955.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1956.c b/deps/curl/tests/libtest/lib1956.c index 105418dc..669e1439 100644 --- a/deps/curl/tests/libtest/lib1956.c +++ b/deps/curl/tests/libtest/lib1956.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1957.c b/deps/curl/tests/libtest/lib1957.c index 8397d9d2..7cc35e42 100644 --- a/deps/curl/tests/libtest/lib1957.c +++ b/deps/curl/tests/libtest/lib1957.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1958.c b/deps/curl/tests/libtest/lib1958.c index 66b8d5df..58b4ea79 100644 --- a/deps/curl/tests/libtest/lib1958.c +++ b/deps/curl/tests/libtest/lib1958.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1959.c b/deps/curl/tests/libtest/lib1959.c index 5eee4f01..1fbf26c0 100644 --- a/deps/curl/tests/libtest/lib1959.c +++ b/deps/curl/tests/libtest/lib1959.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1960.c b/deps/curl/tests/libtest/lib1960.c index 9b82128e..020ee4ba 100644 --- a/deps/curl/tests/libtest/lib1960.c +++ b/deps/curl/tests/libtest/lib1960.c @@ -68,7 +68,7 @@ static int sockopt_cb(void *clientp, } /* Expected args: URL IP PORT */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = TEST_ERR_MAJOR_BAD; @@ -78,7 +78,7 @@ int test(char *URL) unsigned short port; if(!strcmp("check", URL)) - return 0; /* no output makes it not skipped */ + return CURLE_OK; /* no output makes it not skipped */ port = (unsigned short)atoi(libtest_arg3); @@ -140,10 +140,10 @@ test_cleanup: return res; } #else -int test(char *URL) +CURLcode test(char *URL) { (void)URL; printf("lacks inet_pton\n"); - return 0; + return CURLE_OK; } #endif diff --git a/deps/curl/tests/libtest/lib1964.c b/deps/curl/tests/libtest/lib1964.c index a9881e98..9e17f926 100644 --- a/deps/curl/tests/libtest/lib1964.c +++ b/deps/curl/tests/libtest/lib1964.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib1970.c b/deps/curl/tests/libtest/lib1970.c index ff86fdd2..f0b9d517 100644 --- a/deps/curl/tests/libtest/lib1970.c +++ b/deps/curl/tests/libtest/lib1970.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel 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 @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1971.c b/deps/curl/tests/libtest/lib1971.c index 173fc2f1..8f4be08b 100644 --- a/deps/curl/tests/libtest/lib1971.c +++ b/deps/curl/tests/libtest/lib1971.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel 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 @@ -35,7 +35,7 @@ static size_t read_callback(char *buffer, size_t size, size_t nitems, return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1972.c b/deps/curl/tests/libtest/lib1972.c index c21e8da9..a51c4501 100644 --- a/deps/curl/tests/libtest/lib1972.c +++ b/deps/curl/tests/libtest/lib1972.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel 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 @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; curl_mime *mime = NULL; diff --git a/deps/curl/tests/libtest/lib1973.c b/deps/curl/tests/libtest/lib1973.c index d95744fc..4b2ba95c 100644 --- a/deps/curl/tests/libtest/lib1973.c +++ b/deps/curl/tests/libtest/lib1973.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel 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 @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1974.c b/deps/curl/tests/libtest/lib1974.c index 948d44df..41922fa6 100644 --- a/deps/curl/tests/libtest/lib1974.c +++ b/deps/curl/tests/libtest/lib1974.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel 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 @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib1975.c b/deps/curl/tests/libtest/lib1975.c index bca0c763..0cd9be24 100644 --- a/deps/curl/tests/libtest/lib1975.c +++ b/deps/curl/tests/libtest/lib1975.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel 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 @@ -35,7 +35,7 @@ static size_t read_callback(char *buffer, size_t size, size_t nitems, return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = TEST_ERR_MAJOR_BAD; diff --git a/deps/curl/tests/libtest/lib2301.c b/deps/curl/tests/libtest/lib2301.c index e654f816..15615145 100644 --- a/deps/curl/tests/libtest/lib2301.c +++ b/deps/curl/tests/libtest/lib2301.c @@ -24,21 +24,21 @@ #include "test.h" -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS #if 0 -static int ping(CURL *curl, const char *send_payload) +static CURLcode send_ping(CURL *curl, const char *send_payload) { size_t sent; CURLcode result = curl_ws_send(curl, send_payload, strlen(send_payload), &sent, CURLWS_PING); fprintf(stderr, - "ws: curl_ws_send returned %u, sent %u\n", (int)result, (int)sent); + "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); - return (int)result; + return result; } -static int recv_pong(CURL *curl, const char *expected_payload) +static CURLcode recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; unsigned int rflags; @@ -58,11 +58,11 @@ static int recv_pong(CURL *curl, const char *expected_payload) fprintf(stderr, "ws: did NOT get the same payload back\n"); } else { - fprintf(stderr, "recv_pong: got %u bytes rflags %x\n", (int)rlen, rflags); + fprintf(stderr, "recv_pong: got %d bytes rflags %x\n", (int)rlen, rflags); } - fprintf(stderr, "ws: curl_ws_recv returned %u, received %u\n", (int)result, - rlen); - return (int)result; + fprintf(stderr, "ws: curl_ws_recv returned %d, received %d\n", result, + (int)rlen); + return result; } /* just close the connection */ @@ -72,7 +72,7 @@ static void websocket_close(CURL *curl) CURLcode result = curl_ws_send(curl, "", 0, &sent, CURLWS_CLOSE); fprintf(stderr, - "ws: curl_ws_send returned %u, sent %u\n", (int)result, (int)sent); + "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); } static void websocket(CURL *curl) @@ -80,7 +80,7 @@ static void websocket(CURL *curl) int i = 0; fprintf(stderr, "ws: websocket() starts\n"); do { - if(ping(curl, "foobar")) + if(send_ping(curl, "foobar")) return; if(recv_pong(curl, "foobar")) return; @@ -101,7 +101,7 @@ static size_t writecb(char *b, size_t size, size_t nitems, void *p) 0x8a, 0x0 }; size_t incoming = nitems; - fprintf(stderr, "Called CURLOPT_WRITEFUNCTION with %u bytes: ", + fprintf(stderr, "Called CURLOPT_WRITEFUNCTION with %d bytes: ", (int)nitems); for(i = 0; i < nitems; i++) fprintf(stderr, "%02x ", (unsigned char)buffer[i]); @@ -119,7 +119,7 @@ static size_t writecb(char *b, size_t size, size_t nitems, void *p) return nitems; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -137,7 +137,7 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); res = curl_easy_perform(curl); - fprintf(stderr, "curl_easy_perform() returned %u\n", (int)res); + fprintf(stderr, "curl_easy_perform() returned %d\n", res); #if 0 if(res == CURLE_OK) websocket(curl); @@ -146,9 +146,9 @@ int test(char *URL) curl_easy_cleanup(curl); } curl_global_cleanup(); - return (int)res; + return res; } -#else /* no websockets */ +#else /* no WebSockets */ NO_SUPPORT_BUILT_IN #endif diff --git a/deps/curl/tests/libtest/lib2302.c b/deps/curl/tests/libtest/lib2302.c index 9e2b8004..415ab9ff 100644 --- a/deps/curl/tests/libtest/lib2302.c +++ b/deps/curl/tests/libtest/lib2302.c @@ -24,7 +24,7 @@ #include "test.h" -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS struct ws_data { CURL *easy; @@ -63,7 +63,7 @@ static size_t add_data(struct ws_data *wd, const char *buf, size_t blen, if(wd->nwrites > 0) flush_data(wd); wd->has_meta = (meta != NULL); - wd->meta_flags = meta? meta->flags : 0; + wd->meta_flags = meta ? meta->flags : 0; } if(wd->blen + blen > sizeof(wd->buf)) { @@ -91,7 +91,7 @@ static size_t writecb(char *buffer, size_t size, size_t nitems, void *p) return nitems; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -112,13 +112,13 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ws_data); res = curl_easy_perform(curl); - fprintf(stderr, "curl_easy_perform() returned %u\n", (int)res); + fprintf(stderr, "curl_easy_perform() returned %d\n", res); /* always cleanup */ curl_easy_cleanup(curl); flush_data(&ws_data); } curl_global_cleanup(); - return (int)res; + return res; } #else diff --git a/deps/curl/tests/libtest/lib2304.c b/deps/curl/tests/libtest/lib2304.c index a8ee8754..bc8a1f34 100644 --- a/deps/curl/tests/libtest/lib2304.c +++ b/deps/curl/tests/libtest/lib2304.c @@ -24,21 +24,21 @@ #include "test.h" -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS -static int ping(CURL *curl, const char *send_payload) +static CURLcode 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); fprintf(stderr, - "ws: curl_ws_send returned %u, sent %u\n", (int)result, (int)sent); + "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); - return (int)result; + return result; } -static int recv_pong(CURL *curl, const char *expected_payload) +static CURLcode recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; const struct curl_ws_frame *meta; @@ -58,16 +58,16 @@ static int recv_pong(CURL *curl, const char *expected_payload) fprintf(stderr, "ws: did NOT get the same payload back\n"); } else { - fprintf(stderr, "recv_pong: got %u bytes rflags %x\n", (int)rlen, + fprintf(stderr, "recv_pong: got %d bytes rflags %x\n", (int)rlen, meta->flags); } } - fprintf(stderr, "ws: curl_ws_recv returned %u, received %u\n", (int)result, + fprintf(stderr, "ws: curl_ws_recv returned %d, received %d\n", result, (int)rlen); - return (int)result; + return result; } -static int recv_any(CURL *curl) +static CURLcode recv_any(CURL *curl) { size_t rlen; const struct curl_ws_frame *meta; @@ -78,7 +78,7 @@ static int recv_any(CURL *curl) fprintf(stderr, "recv_any: got %u bytes rflags %x\n", (int)rlen, meta->flags); - return 0; + return CURLE_OK; } /* just close the connection */ @@ -88,7 +88,7 @@ static void websocket_close(CURL *curl) CURLcode result = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); fprintf(stderr, - "ws: curl_ws_send returned %u, sent %u\n", (int)result, (int)sent); + "ws: curl_ws_send returned %d, sent %u\n", result, (int)sent); } static void websocket(CURL *curl) @@ -98,7 +98,7 @@ static void websocket(CURL *curl) do { recv_any(curl); fprintf(stderr, "Send ping\n"); - if(ping(curl, "foobar")) + if(send_ping(curl, "foobar")) return; fprintf(stderr, "Receive pong\n"); if(recv_pong(curl, "foobar")) { @@ -110,7 +110,7 @@ static void websocket(CURL *curl) websocket_close(curl); } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -126,7 +126,7 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ res = curl_easy_perform(curl); - fprintf(stderr, "curl_easy_perform() returned %u\n", (int)res); + fprintf(stderr, "curl_easy_perform() returned %d\n", res); if(res == CURLE_OK) websocket(curl); @@ -134,7 +134,7 @@ int test(char *URL) curl_easy_cleanup(curl); } curl_global_cleanup(); - return (int)res; + return res; } #else diff --git a/deps/curl/tests/libtest/lib2305.c b/deps/curl/tests/libtest/lib2305.c index 374423f0..71ee1949 100644 --- a/deps/curl/tests/libtest/lib2305.c +++ b/deps/curl/tests/libtest/lib2305.c @@ -24,8 +24,9 @@ #include "test.h" #include "testtrace.h" +#include "memdebug.h" -#ifdef USE_WEBSOCKETS +#ifndef CURL_DISABLE_WEBSOCKETS /* just close the connection */ static void websocket_close(CURL *curl) @@ -34,7 +35,7 @@ static void websocket_close(CURL *curl) CURLcode result = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); fprintf(stderr, - "ws: curl_ws_send returned %u, sent %u\n", (int)result, (int)sent); + "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); } static void websocket(CURL *curl) @@ -55,10 +56,11 @@ static void websocket(CURL *curl) if(result == CURLE_AGAIN) /* crude busy-loop */ continue; - printf("curl_ws_recv returned %d\n", (int)result); + fclose(save); + printf("curl_ws_recv returned %d\n", result); return; } - printf("%u: nread %zu Age %u Flags %x " + printf("%d: nread %zu Age %d Flags %x " "Offset %" CURL_FORMAT_CURL_OFF_T " " "Bytesleft %" CURL_FORMAT_CURL_OFF_T "\n", (int)i, @@ -71,7 +73,7 @@ static void websocket(CURL *curl) websocket_close(curl); } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -91,7 +93,7 @@ int test(char *URL) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ res = curl_easy_perform(curl); - fprintf(stderr, "curl_easy_perform() returned %u\n", (int)res); + fprintf(stderr, "curl_easy_perform() returned %d\n", res); if(res == CURLE_OK) websocket(curl); @@ -99,7 +101,7 @@ int test(char *URL) curl_easy_cleanup(curl); } curl_global_cleanup(); - return (int)res; + return res; } #else diff --git a/deps/curl/tests/libtest/lib2306.c b/deps/curl/tests/libtest/lib2306.c index 839bdcc0..cde75193 100644 --- a/deps/curl/tests/libtest/lib2306.c +++ b/deps/curl/tests/libtest/lib2306.c @@ -29,7 +29,7 @@ #define URL2 libtest_arg2 -int test(char *URL) +CURLcode test(char *URL) { /* first a fine GET response, then a bad one */ CURL *cl; diff --git a/deps/curl/lib/curl_ntlm_wb.h b/deps/curl/tests/libtest/lib2308.c similarity index 59% rename from deps/curl/lib/curl_ntlm_wb.h rename to deps/curl/tests/libtest/lib2308.c index 37704c0f..47e0763c 100644 --- a/deps/curl/lib/curl_ntlm_wb.h +++ b/deps/curl/tests/libtest/lib2308.c @@ -1,5 +1,3 @@ -#ifndef HEADER_CURL_NTLM_WB_H -#define HEADER_CURL_NTLM_WB_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -24,22 +22,33 @@ * ***************************************************************************/ -#include "curl_setup.h" +#include "test.h" +#include "testtrace.h" -#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) && \ - defined(NTLM_WB_ENABLED) +#include -/* this is for ntlm header input */ -CURLcode Curl_input_ntlm_wb(struct Curl_easy *data, - struct connectdata *conn, bool proxy, - const char *header); +static size_t cb_curl(char *buffer, size_t size, size_t nmemb, void *userp) +{ + (void)buffer; + (void)size; + (void)nmemb; + (void)userp; + return CURL_WRITEFUNC_ERROR; +} -/* this is for creating ntlm header output */ -CURLcode Curl_output_ntlm_wb(struct Curl_easy *data, struct connectdata *conn, - bool proxy); +CURLcode test(char *URL) +{ + CURL *curl; + CURLcode res = CURLE_OK; -void Curl_http_auth_cleanup_ntlm_wb(struct connectdata *conn); - -#endif /* !CURL_DISABLE_HTTP && USE_NTLM && NTLM_WB_ENABLED */ - -#endif /* HEADER_CURL_NTLM_WB_H */ + global_init(CURL_GLOBAL_ALL); + curl = curl_easy_init(); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cb_curl); + curl_easy_setopt(curl, CURLOPT_URL, URL); + res = curl_easy_perform(curl); + printf("Returned %d, should be %d.\n", res, CURLE_WRITE_ERROR); + fflush(stdout); + curl_easy_cleanup(curl); + curl_global_cleanup(); + return CURLE_OK; +} diff --git a/deps/curl/tests/libtest/lib2402.c b/deps/curl/tests/libtest/lib2402.c index ab20f92c..c58946bb 100644 --- a/deps/curl/tests/libtest/lib2402.c +++ b/deps/curl/tests/libtest/lib2402.c @@ -31,9 +31,9 @@ #define NUM_HANDLES 4 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; CURLM *m = NULL; diff --git a/deps/curl/tests/libtest/lib2404.c b/deps/curl/tests/libtest/lib2404.c index 1a282ffe..ed47d425 100644 --- a/deps/curl/tests/libtest/lib2404.c +++ b/deps/curl/tests/libtest/lib2404.c @@ -31,9 +31,9 @@ #define NUM_HANDLES 4 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; CURLM *m = NULL; diff --git a/deps/curl/tests/libtest/lib2405.c b/deps/curl/tests/libtest/lib2405.c new file mode 100644 index 00000000..5b01cd8c --- /dev/null +++ b/deps/curl/tests/libtest/lib2405.c @@ -0,0 +1,310 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) Dmitry Karpov + * + * 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 + * + ***************************************************************************/ + +/* + * The purpose of this test is to test behavior of curl_multi_waitfds + * function in different scenarios: + * empty multi handle (expected zero descriptors), + * HTTP1 amd HTTP2 (no multiplexing) two transfers (expected two descriptors), + * HTTP2 with multiplexing (expected one descriptors) + * + * It is also expected that all transfers run by multi-handle should complete + * successfully. + */ + +#include "test.h" + +#include "testutil.h" +#include "warnless.h" +#include "memdebug.h" + + + /* ---------------------------------------------------------------- */ + +#define test_check(expected_fds) \ + if(res != CURLE_OK) { \ + fprintf(stderr, "test failed with code: %d\n", res); \ + goto test_cleanup; \ + } \ + else if(fd_count != expected_fds) { \ + fprintf(stderr, "Max number of waitfds: %d not as expected: %d\n", \ + 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) + + /* ---------------------------------------------------------------- */ + +enum { + TEST_USE_HTTP1 = 0, + TEST_USE_HTTP2, + TEST_USE_HTTP2_MPLEX +}; + +static size_t emptyWriteFunc(void *ptr, size_t size, size_t nmemb, + void *data) { + (void)ptr; (void)data; + return size * nmemb; +} + +static CURLcode set_easy(char *URL, CURL *easy, long option) +{ + CURLcode res = CURLE_OK; + + /* First set the URL that is about to receive our POST. */ + easy_setopt(easy, CURLOPT_URL, URL); + + /* get verbose debug output please */ + easy_setopt(easy, CURLOPT_VERBOSE, 1L); + + switch(option) { + case TEST_USE_HTTP1: + /* go http1 */ + easy_setopt(easy, 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); + 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); + break; + } + + /* no peer verify */ + easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L); + easy_setopt(easy, CURLOPT_SSL_VERIFYHOST, 0L); + + /* include headers */ + easy_setopt(easy, CURLOPT_HEADER, 1L); + + /* empty write function */ + easy_setopt(easy, CURLOPT_WRITEFUNCTION, emptyWriteFunc); + +test_cleanup: + return res; +} + +static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) +{ + CURLMcode mc = CURLM_OK; + CURLM *multi = NULL; + CURLM *multi1 = NULL; + + CURL *easy1 = NULL; + CURL *easy2 = NULL; + + unsigned int max_count = 0; + + 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 */ + + CURLcode result; + CURLcode res = CURLE_OK; + + struct curl_waitfd ufds[10]; + struct curl_waitfd ufds1[10]; + int numfds; + + easy_init(easy1); + easy_init(easy2); + + if(set_easy(URL, easy1, option) != CURLE_OK) + goto test_cleanup; + + if(set_easy(URL, easy2, option) != CURLE_OK) + goto test_cleanup; + + multi_init(multi); + multi_init(multi1); + + if(option == TEST_USE_HTTP2_MPLEX) + multi_setopt(multi, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); + + multi_add_handle(multi, easy1); + multi_add_handle(multi, easy2); + + while(!mc) { + /* get the count of file descriptors from the transfers */ + unsigned int fd_count = 0; + + mc = curl_multi_perform(multi, &still_running); + if(!still_running || mc != CURLM_OK) + break; + + mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); + + if(mc != CURLM_OK) { + fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); + res = TEST_ERR_FAILURE; + break; + } + + if(!fd_count) + continue; /* no descriptors yet */ + + /* checking case when we don't have enough space for waitfds */ + mc = curl_multi_waitfds(multi, ufds1, fd_count - 1, NULL); + + if(mc != CURLM_OUT_OF_MEMORY) { + fprintf(stderr, "curl_multi_waitfds() return code %d instead of " + "CURLM_OUT_OF_MEMORY.\n", mc); + res = TEST_ERR_FAILURE; + break; + } + + if(fd_count > max_count) + max_count = fd_count; + + /* Do polling on descriptors in ufds in Multi 1 */ + mc = curl_multi_poll(multi1, ufds, fd_count, 500, &numfds); + + if(mc != CURLM_OK) { + fprintf(stderr, "curl_multi_poll() failed, code %d.\\n", mc); + res = TEST_ERR_FAILURE; + break; + } + } + + for(;;) { + msg = curl_multi_info_read(multi, &msgs_left); + if(!msg) + break; + if(msg->msg == CURLMSG_DONE) { + result = msg->data.result; + + if(!res) + res = result; + } + } + + curl_multi_remove_handle(multi, easy1); + curl_multi_remove_handle(multi, easy2); + +test_cleanup: + curl_easy_cleanup(easy1); + curl_easy_cleanup(easy2); + + curl_multi_cleanup(multi); + curl_multi_cleanup(multi1); + + if(max_fd_count) + *max_fd_count = max_count; + + return res; +} + +static CURLcode empty_multi_test(void) +{ + CURLMcode mc = CURLM_OK; + CURLM *multi = NULL; + CURL *easy = NULL; + + struct curl_waitfd ufds[10]; + + CURLcode res = CURLE_OK; + unsigned int fd_count = 0; + + multi_init(multi); + + /* calling curl_multi_waitfds() on an empty multi handle. */ + mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); + + if(mc != CURLM_OK) { + fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); + res = TEST_ERR_FAILURE; + goto test_cleanup; + } + else if(fd_count > 0) { + fprintf(stderr, "curl_multi_waitfds() returned non-zero count of " + "waitfds: %d.\n", fd_count); + res = TEST_ERR_FAILURE; + goto test_cleanup; + } + + /* calling curl_multi_waitfds() on multi handle with added easy handle. */ + easy_init(easy); + + if(set_easy((char *)"http://example.com", easy, TEST_USE_HTTP1) != CURLE_OK) + goto test_cleanup; + + multi_add_handle(multi, easy); + + mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); + + if(mc != CURLM_OK) { + fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); + res = TEST_ERR_FAILURE; + goto test_cleanup; + } + else if(fd_count > 0) { + fprintf(stderr, "curl_multi_waitfds() returned non-zero count of " + "waitfds: %d.\n", fd_count); + res = TEST_ERR_FAILURE; + goto test_cleanup; + } + + curl_multi_remove_handle(multi, easy); + +test_cleanup: + curl_easy_cleanup(easy); + curl_multi_cleanup(multi); + return res; +} + +CURLcode test(char *URL) +{ + CURLcode res = CURLE_OK; + unsigned int fd_count = 0; + + global_init(CURL_GLOBAL_ALL); + + /* Testing curl_multi_waitfds on empty and not started handles */ + res = empty_multi_test(); + if(res != CURLE_OK) + goto test_cleanup; + + /* HTTP1, expected 2 waitfds - one for each transfer */ + test_run_check(TEST_USE_HTTP1, 2); + + /* HTTP2, expected 2 waitfds - one for each transfer */ + test_run_check(TEST_USE_HTTP2, 2); + + /* HTTP2 with multiplexing, expected 1 waitfds - one for all transfers */ + test_run_check(TEST_USE_HTTP2_MPLEX, 1); + +test_cleanup: + curl_global_cleanup(); + return res; +} diff --git a/deps/curl/tests/libtest/lib2502.c b/deps/curl/tests/libtest/lib2502.c index e5a7061b..f01fbe0c 100644 --- a/deps/curl/tests/libtest/lib2502.c +++ b/deps/curl/tests/libtest/lib2502.c @@ -23,6 +23,7 @@ ***************************************************************************/ #include "test.h" +#include "testtrace.h" #include "testutil.h" #include "warnless.h" #include "memdebug.h" @@ -31,9 +32,9 @@ #define NUM_HANDLES 4 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES] = {0}; int running; CURLM *m = NULL; @@ -80,6 +81,10 @@ int test(char *URL) /* wait for first connection established to see if we can share it */ easy_setopt(curl[i], CURLOPT_PIPEWAIT, 1L); /* go verbose */ + libtest_debug_config.nohex = 1; + libtest_debug_config.tracetime = 0; + test_setopt(curl[i], CURLOPT_DEBUGDATA, &libtest_debug_config); + easy_setopt(curl[i], CURLOPT_DEBUGFUNCTION, libtest_debug_cb); easy_setopt(curl[i], CURLOPT_VERBOSE, 1L); /* include headers */ easy_setopt(curl[i], CURLOPT_HEADER, 1L); diff --git a/deps/curl/tests/libtest/lib3010.c b/deps/curl/tests/libtest/lib3010.c index 598b79fc..ce0fa305 100644 --- a/deps/curl/tests/libtest/lib3010.c +++ b/deps/curl/tests/libtest/lib3010.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret = CURLE_OK; CURL *curl = NULL; diff --git a/deps/curl/tests/libtest/lib3025.c b/deps/curl/tests/libtest/lib3025.c index f3e3f920..80f80eae 100644 --- a/deps/curl/tests/libtest/lib3025.c +++ b/deps/curl/tests/libtest/lib3025.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -57,5 +57,5 @@ test_cleanup: curl_slist_free_all(icy); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib3026.c b/deps/curl/tests/libtest/lib3026.c index 6f31dabd..61c70eb3 100644 --- a/deps/curl/tests/libtest/lib3026.c +++ b/deps/curl/tests/libtest/lib3026.c @@ -29,7 +29,7 @@ #define NUM_THREADS 100 #ifdef _WIN32 -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) static DWORD WINAPI run_thread(LPVOID ptr) #else #include @@ -45,9 +45,9 @@ static unsigned int WINAPI run_thread(void *ptr) return 0; } -int test(char *URL) +CURLcode test(char *URL) { -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) typedef HANDLE curl_win_thread_handle_t; #else typedef uintptr_t curl_win_thread_handle_t; @@ -64,7 +64,7 @@ int test(char *URL) fprintf(stderr, "%s:%d On Windows but the " "CURL_VERSION_THREADSAFE feature flag is not set\n", __FILE__, __LINE__); - return -1; + return (CURLcode)-1; } /* On Windows libcurl global init/cleanup calls LoadLibrary/FreeLibrary for @@ -78,7 +78,7 @@ int test(char *URL) for(i = 0; i < tid_count; i++) { curl_win_thread_handle_t th; results[i] = CURL_LAST; /* initialize with invalid value */ -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) th = CreateThread(NULL, 0, run_thread, &results[i], 0, NULL); #else th = _beginthreadex(NULL, 0, run_thread, &results[i], 0, NULL); @@ -105,7 +105,7 @@ cleanup: } } - return test_failure; + return (CURLcode)test_failure; } #elif defined(HAVE_PTHREAD_H) @@ -123,12 +123,12 @@ static void *run_thread(void *ptr) return NULL; } -int test(char *URL) +CURLcode test(char *URL) { CURLcode results[NUM_THREADS]; pthread_t tids[NUM_THREADS]; unsigned tid_count = NUM_THREADS, i; - int test_failure = 0; + CURLcode test_failure = CURLE_OK; curl_version_info_data *ver; (void) URL; @@ -137,7 +137,7 @@ int test(char *URL) fprintf(stderr, "%s:%d Have pthread but the " "CURL_VERSION_THREADSAFE feature flag is not set\n", __FILE__, __LINE__); - return -1; + return (CURLcode)-1; } for(i = 0; i < tid_count; i++) { @@ -148,7 +148,7 @@ int test(char *URL) fprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", __FILE__, __LINE__, res); tid_count = i; - test_failure = -1; + test_failure = (CURLcode)-1; goto cleanup; } } @@ -160,7 +160,7 @@ cleanup: fprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed," "with code %d (%s)\n", __FILE__, __LINE__, i, (int) results[i], curl_easy_strerror(results[i])); - test_failure = -1; + test_failure = (CURLcode)-1; } } @@ -168,7 +168,7 @@ cleanup: } #else /* without pthread or Windows, this test doesn't work */ -int test(char *URL) +CURLcode test(char *URL) { curl_version_info_data *ver; (void)URL; @@ -178,8 +178,8 @@ int test(char *URL) fprintf(stderr, "%s:%d No pthread but the " "CURL_VERSION_THREADSAFE feature flag is set\n", __FILE__, __LINE__); - return -1; + return (CURLcode)-1; } - return 0; + return CURLE_OK; } #endif diff --git a/deps/curl/tests/libtest/lib3027.c b/deps/curl/tests/libtest/lib3027.c index 6808f29f..4ddee1b6 100644 --- a/deps/curl/tests/libtest/lib3027.c +++ b/deps/curl/tests/libtest/lib3027.c @@ -27,7 +27,7 @@ #include "warnless.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode ret = CURLE_OK; CURL *hnd; @@ -52,5 +52,5 @@ int test(char *URL) curl_easy_cleanup(hnd); } curl_global_cleanup(); - return (int)ret; + return ret; } diff --git a/deps/curl/tests/libtest/lib3100.c b/deps/curl/tests/libtest/lib3100.c index a508d5c7..82132b94 100644 --- a/deps/curl/tests/libtest/lib3100.c +++ b/deps/curl/tests/libtest/lib3100.c @@ -24,9 +24,9 @@ #include "test.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { @@ -54,7 +54,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_DESCRIBE); res = curl_easy_perform(curl); - if(res != (int)CURLE_OK) { + if(res != CURLE_OK) { fprintf(stderr, "Failed to send DESCRIBE: %d\n", res); res = TEST_ERR_MAJOR_BAD; goto test_cleanup; diff --git a/deps/curl/tests/libtest/lib3101.c b/deps/curl/tests/libtest/lib3101.c index dbcf3a6c..3f2e9771 100644 --- a/deps/curl/tests/libtest/lib3101.c +++ b/deps/curl/tests/libtest/lib3101.c @@ -24,9 +24,9 @@ #include "test.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { @@ -51,7 +51,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, "https"); res = curl_easy_perform(curl); - if(res != (int)CURLE_OK) { + if(res != CURLE_OK) { res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } diff --git a/deps/curl/tests/libtest/lib3102.c b/deps/curl/tests/libtest/lib3102.c index abc0a27e..7f1b0562 100644 --- a/deps/curl/tests/libtest/lib3102.c +++ b/deps/curl/tests/libtest/lib3102.c @@ -88,7 +88,7 @@ static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) return size * nmemb; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib3103.c b/deps/curl/tests/libtest/lib3103.c index 01d62f65..8d602849 100644 --- a/deps/curl/tests/libtest/lib3103.c +++ b/deps/curl/tests/libtest/lib3103.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURLSH *share; @@ -59,8 +59,8 @@ test_cleanup: /* always cleanup */ curl_easy_cleanup(curl); - curl_share_cleanup(share); + curl_share_cleanup(share); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib3207.c b/deps/curl/tests/libtest/lib3207.c new file mode 100644 index 00000000..a7860815 --- /dev/null +++ b/deps/curl/tests/libtest/lib3207.c @@ -0,0 +1,231 @@ +/*************************************************************************** + * _ _ ____ _ + * 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 "test.h" +#include "testutil.h" +#include "memdebug.h" + +#include + +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) +#if defined(USE_THREADS_POSIX) +#include +#endif +#include "curl_threads.h" +#endif + +#define CAINFO libtest_arg2 +#define THREAD_SIZE 16 +#define PER_THREAD_SIZE 8 + +struct Ctx { + const char *URL; + CURLSH *share; + int result; + int thread_id; + struct curl_slist *contents; +}; + +static size_t write_memory_callback(char *contents, size_t size, + size_t nmemb, void *userp) +{ + /* append the data to contents */ + size_t realsize = size * nmemb; + struct Ctx *mem = (struct Ctx *)userp; + char *data = (char *)malloc(realsize + 1); + struct curl_slist *item_append = NULL; + if(!data) { + printf("not enough memory (malloc returned NULL)\n"); + return 0; + } + memcpy(data, contents, realsize); + data[realsize] = '\0'; + item_append = curl_slist_append(mem->contents, data); + free(data); + if(item_append) { + mem->contents = item_append; + } + else { + printf("not enough memory (curl_slist_append returned NULL)\n"); + return 0; + } + return realsize; +} + +static +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_UWP) +DWORD +#else +unsigned int +#endif +CURL_STDCALL +#else +unsigned int +#endif +test_thread(void *ptr) +{ + struct Ctx *ctx = (struct Ctx *)ptr; + CURLcode res = CURLE_OK; + + int i; + + /* Loop the transfer and cleanup the handle properly every lap. This will + still reuse ssl session since the pool is in the shared object! */ + for(i = 0; i < PER_THREAD_SIZE; i++) { + CURL *curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, (char *)ctx->URL); + + /* use the share object */ + curl_easy_setopt(curl, CURLOPT_SHARE, ctx->share); + curl_easy_setopt(curl, CURLOPT_CAINFO, CAINFO); + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_memory_callback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, ptr); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); + + /* Perform the request, res will get the return code */ + res = curl_easy_perform(curl); + + /* always cleanup */ + curl_easy_cleanup(curl); + /* Check for errors */ + if(res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); + goto test_cleanup; + } + } + } + +test_cleanup: + ctx->result = (int)res; + return 0; +} + +#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) + +static void test_lock(CURL *handle, curl_lock_data data, + curl_lock_access laccess, void *useptr) +{ + curl_mutex_t *mutexes = (curl_mutex_t*) useptr; + (void)handle; + (void)laccess; + Curl_mutex_acquire(&mutexes[data]); +} + +static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) +{ + curl_mutex_t *mutexes = (curl_mutex_t*) useptr; + (void)handle; + Curl_mutex_release(&mutexes[data]); +} + +static void execute(CURLSH *share, struct Ctx *ctx) +{ + int i; + curl_mutex_t mutexes[CURL_LOCK_DATA_LAST - 1]; + curl_thread_t thread[THREAD_SIZE]; + for(i = 0; i < CURL_LOCK_DATA_LAST - 1; i++) { + Curl_mutex_init(&mutexes[i]); + } + curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); + curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); + curl_share_setopt(share, CURLSHOPT_USERDATA, (void *)mutexes); + curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); + + for(i = 0; i < THREAD_SIZE; i++) { + thread[i] = Curl_thread_create(test_thread, (void *)&ctx[i]); + } + for(i = 0; i < THREAD_SIZE; i++) { + if(thread[i]) { + Curl_thread_join(&thread[i]); + Curl_thread_destroy(thread[i]); + } + } + curl_share_setopt(share, CURLSHOPT_LOCKFUNC, NULL); + curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, NULL); + for(i = 0; i < CURL_LOCK_DATA_LAST - 1; i++) { + Curl_mutex_destroy(&mutexes[i]); + } +} + +#else /* without pthread, run serially */ + +static void execute(CURLSH *share, struct Ctx *ctx) +{ + int i; + (void) share; + for(i = 0; i < THREAD_SIZE; i++) { + test_thread((void *)&ctx[i]); + } +} + +#endif + +CURLcode test(char *URL) +{ + int res = 0; + int i; + CURLSH* share; + struct Ctx ctx[THREAD_SIZE]; + + curl_global_init(CURL_GLOBAL_ALL); + + share = curl_share_init(); + if(!share) { + fprintf(stderr, "curl_share_init() failed\n"); + goto test_cleanup; + } + + for(i = 0; i < THREAD_SIZE; i++) { + ctx[i].share = share; + ctx[i].URL = URL; + ctx[i].thread_id = i; + ctx[i].result = 0; + ctx[i].contents = NULL; + } + + execute(share, ctx); + + for(i = 0; i < THREAD_SIZE; i++) { + if(ctx[i].result) { + res = ctx[i].result; + } + else { + struct curl_slist *item = ctx[i].contents; + while(item) { + printf("%s", item->data); + item = item->next; + } + } + curl_slist_free_all(ctx[i].contents); + } + +test_cleanup: + if(share) + curl_share_cleanup(share); + curl_global_cleanup(); + return (CURLcode)res; +} diff --git a/deps/curl/tests/libtest/lib500.c b/deps/curl/tests/libtest/lib500.c index f99b244b..9aa34666 100644 --- a/deps/curl/tests/libtest/lib500.c +++ b/deps/curl/tests/libtest/lib500.c @@ -28,7 +28,7 @@ #ifdef LIB585 -static int counter; +static int testcounter; static curl_socket_t tst_opensocket(void *clientp, curlsocktype purpose, @@ -36,14 +36,14 @@ static curl_socket_t tst_opensocket(void *clientp, { (void)clientp; (void)purpose; - printf("[OPEN] counter: %d\n", ++counter); + printf("[OPEN] counter: %d\n", ++testcounter); return socket(addr->family, addr->socktype, addr->protocol); } static int tst_closesocket(void *clientp, curl_socket_t sock) { (void)clientp; - printf("[CLOSE] counter: %d\n", counter--); + printf("[CLOSE] counter: %d\n", testcounter--); return sclose(sock); } @@ -51,7 +51,7 @@ static void setupcallbacks(CURL *curl) { curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, tst_opensocket); curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, tst_closesocket); - counter = 0; + testcounter = 0; } #else @@ -59,7 +59,7 @@ static void setupcallbacks(CURL *curl) #endif -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -101,6 +101,7 @@ int test(char *URL) curl_off_t time_namelookup; curl_off_t time_connect; curl_off_t time_pretransfer; + curl_off_t time_posttransfer; curl_off_t time_starttransfer; curl_off_t time_total; fprintf(moo, "IP %s\n", ipstr); @@ -108,6 +109,8 @@ int test(char *URL) curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &time_connect); curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, &time_pretransfer); + curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T, + &time_posttransfer); curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T, &time_starttransfer); curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &time_total); @@ -128,6 +131,14 @@ int test(char *URL) (time_pretransfer / 1000000), (long)(time_pretransfer % 1000000)); } + if(time_pretransfer > time_posttransfer) { + fprintf(moo, "pretransfer vs posttransfer: %" CURL_FORMAT_CURL_OFF_T + ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", + (time_pretransfer / 1000000), + (long)(time_pretransfer % 1000000), + (time_posttransfer / 1000000), + (long)(time_posttransfer % 1000000)); + } if(time_pretransfer > time_starttransfer) { fprintf(moo, "pretransfer vs starttransfer: %" CURL_FORMAT_CURL_OFF_T ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", @@ -143,6 +154,13 @@ int test(char *URL) (long)(time_starttransfer % 1000000), (time_total / 1000000), (long)(time_total % 1000000)); } + if(time_posttransfer > time_total) { + fprintf(moo, "posttransfer vs total: %" CURL_FORMAT_CURL_OFF_T + ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", + (time_posttransfer / 1000000), + (long)(time_posttransfer % 1000000), + (time_total / 1000000), (long)(time_total % 1000000)); + } fclose(moo); } @@ -154,5 +172,7 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } + +#undef setupcallbacks diff --git a/deps/curl/tests/libtest/lib501.c b/deps/curl/tests/libtest/lib501.c index 7ef85011..94c9adb4 100644 --- a/deps/curl/tests/libtest/lib501.c +++ b/deps/curl/tests/libtest/lib501.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -56,5 +56,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib502.c b/deps/curl/tests/libtest/lib502.c index 91f96e6f..44ad6f67 100644 --- a/deps/curl/tests/libtest/lib502.c +++ b/deps/curl/tests/libtest/lib502.c @@ -33,11 +33,11 @@ * Get a single URL without select(). */ -int test(char *URL) +CURLcode test(char *URL) { CURL *c = NULL; CURLM *m = NULL; - int res = 0; + CURLcode res = CURLE_OK; int running; start_test_timing(); diff --git a/deps/curl/tests/libtest/lib503.c b/deps/curl/tests/libtest/lib503.c index 15b09476..cac2a755 100644 --- a/deps/curl/tests/libtest/lib503.c +++ b/deps/curl/tests/libtest/lib503.c @@ -37,11 +37,11 @@ * auth info. */ -int test(char *URL) +CURLcode test(char *URL) { CURL *c = NULL; CURLM *m = NULL; - int res = 0; + CURLcode res = CURLE_OK; int running; start_test_timing(); @@ -53,7 +53,8 @@ int test(char *URL) 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_PROXYUSERPWD, "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); diff --git a/deps/curl/tests/libtest/lib504.c b/deps/curl/tests/libtest/lib504.c index cbe1d577..a9f96c8d 100644 --- a/deps/curl/tests/libtest/lib504.c +++ b/deps/curl/tests/libtest/lib504.c @@ -36,10 +36,10 @@ * Use multi interface to get document over proxy with bad port number. * This caused the interface to "hang" in libcurl 7.10.2. */ -int test(char *URL) +CURLcode test(char *URL) { CURL *c = NULL; - int res = 0; + CURLcode res = CURLE_OK; CURLM *m = NULL; fd_set rd, wr, exc; int running; @@ -72,6 +72,21 @@ int test(char *URL) multi_perform(m, &running); + while(running) { + CURLMcode mres; + int num; + mres = curl_multi_wait(m, NULL, 0, TEST_HANG_TIMEOUT, &num); + if(mres != CURLM_OK) { + printf("curl_multi_wait() returned %d\n", mres); + res = TEST_ERR_MAJOR_BAD; + goto test_cleanup; + } + + abort_on_test_timeout(); + multi_perform(m, &running); + abort_on_test_timeout(); + } + abort_on_test_timeout(); if(!running) { diff --git a/deps/curl/tests/libtest/lib505.c b/deps/curl/tests/libtest/lib505.c index 6c67ed90..de383232 100644 --- a/deps/curl/tests/libtest/lib505.c +++ b/deps/curl/tests/libtest/lib505.c @@ -36,7 +36,7 @@ * Example based on source code provided by Erick Nuwendam. Thanks! */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib506.c b/deps/curl/tests/libtest/lib506.c index dd4759ac..03eb11dd 100644 --- a/deps/curl/tests/libtest/lib506.c +++ b/deps/curl/tests/libtest/lib506.c @@ -42,8 +42,8 @@ struct userdata { static int locks[3]; /* lock callback */ -static void my_lock(CURL *handle, curl_lock_data data, - curl_lock_access laccess, void *useptr) +static void test_lock(CURL *handle, curl_lock_data data, + curl_lock_access laccess, void *useptr) { const char *what; struct userdata *user = (struct userdata *)useptr; @@ -82,7 +82,7 @@ static void my_lock(CURL *handle, curl_lock_data data, } /* unlock callback */ -static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) { const char *what; struct userdata *user = (struct userdata *)useptr; @@ -127,7 +127,7 @@ static struct curl_slist *sethost(struct curl_slist *headers) /* the dummy thread function */ -static void *fire(void *ptr) +static void *test_fire(void *ptr) { CURLcode code; struct curl_slist *headers; @@ -172,9 +172,9 @@ static char *suburl(const char *base, int i) /* test function */ -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURLSHcode scode = CURLSHE_OK; CURLcode code = CURLE_OK; char *url = NULL; @@ -207,11 +207,11 @@ int test(char *URL) if(CURLSHE_OK == scode) { printf("CURLSHOPT_LOCKFUNC\n"); - scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); + scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); } if(CURLSHE_OK == scode) { printf("CURLSHOPT_UNLOCKFUNC\n"); - scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); + scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); } if(CURLSHE_OK == scode) { printf("CURLSHOPT_USERDATA\n"); @@ -261,7 +261,7 @@ int test(char *URL) curl_easy_cleanup(curl); - res = 0; + res = CURLE_OK; /* start treads */ for(i = 1; i <= THREADS; i++) { @@ -272,13 +272,13 @@ int test(char *URL) /* simulate thread, direct call of "thread" function */ printf("*** run %d\n",i); - fire(&tdata); + test_fire(&tdata); curl_free(tdata.url); } - /* fetch a another one and save cookies */ + /* fetch another one and save cookies */ printf("*** run %d\n", i); curl = curl_easy_init(); if(!curl) { diff --git a/deps/curl/tests/libtest/lib507.c b/deps/curl/tests/libtest/lib507.c index be6dd7ee..a228d08a 100644 --- a/deps/curl/tests/libtest/lib507.c +++ b/deps/curl/tests/libtest/lib507.c @@ -29,13 +29,13 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { CURL *curls = NULL; CURLM *multi = NULL; int still_running; - int i = -1; - int res = 0; + CURLcode i = (CURLcode)-1; + CURLcode res = CURLE_OK; CURLMsg *msg; start_test_timing(); diff --git a/deps/curl/tests/libtest/lib508.c b/deps/curl/tests/libtest/lib508.c index b793731b..fc25a0df 100644 --- a/deps/curl/tests/libtest/lib508.c +++ b/deps/curl/tests/libtest/lib508.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static char data[]="this is what we post to the silly web server\n"; +static char testdata[]="this is what we post to the silly web server\n"; struct WriteThis { char *readptr; @@ -49,15 +49,15 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; struct WriteThis pooh; - pooh.readptr = data; - pooh.sizeleft = strlen(data); + pooh.readptr = testdata; + pooh.sizeleft = strlen(testdata); if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/deps/curl/tests/libtest/lib509.c b/deps/curl/tests/libtest/lib509.c index cb510ef2..8a03b3b1 100644 --- a/deps/curl/tests/libtest/lib509.c +++ b/deps/curl/tests/libtest/lib509.c @@ -69,7 +69,7 @@ static void custom_free(void *ptr) } -int test(char *URL) +CURLcode test(char *URL) { unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7}; @@ -113,5 +113,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib510.c b/deps/curl/tests/libtest/lib510.c index 87a85a55..2abd1cb7 100644 --- a/deps/curl/tests/libtest/lib510.c +++ b/deps/curl/tests/libtest/lib510.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static const char *post[]={ +static const char * const testpost[]={ "one", "two", "three", @@ -46,7 +46,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) if(size*nmemb < 1) return 0; - data = post[pooh->counter]; + data = testpost[pooh->counter]; if(data) { size_t len = strlen(data); @@ -61,7 +61,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib511.c b/deps/curl/tests/libtest/lib511.c index c5322480..b357e4d6 100644 --- a/deps/curl/tests/libtest/lib511.c +++ b/deps/curl/tests/libtest/lib511.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -54,5 +54,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib512.c b/deps/curl/tests/libtest/lib512.c index 706acb2e..02e0d487 100644 --- a/deps/curl/tests/libtest/lib512.c +++ b/deps/curl/tests/libtest/lib512.c @@ -28,7 +28,7 @@ /* Test case code based on source in a bug report filed by James Bursa on 28 Apr 2004 */ -int test(char *URL) +CURLcode test(char *URL) { CURLcode code; int rc = 99; @@ -72,5 +72,5 @@ int test(char *URL) else rc = 5; - return rc; + return (CURLcode)rc; } diff --git a/deps/curl/tests/libtest/lib513.c b/deps/curl/tests/libtest/lib513.c index b381098f..208245ac 100644 --- a/deps/curl/tests/libtest/lib513.c +++ b/deps/curl/tests/libtest/lib513.c @@ -34,7 +34,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return CURL_READFUNC_ABORT; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -81,5 +81,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib514.c b/deps/curl/tests/libtest/lib514.c index 0f31c8c4..73877061 100644 --- a/deps/curl/tests/libtest/lib514.c +++ b/deps/curl/tests/libtest/lib514.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -77,5 +77,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib515.c b/deps/curl/tests/libtest/lib515.c index 3c744fb9..7edfe4e5 100644 --- a/deps/curl/tests/libtest/lib515.c +++ b/deps/curl/tests/libtest/lib515.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -58,5 +58,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib516.c b/deps/curl/tests/libtest/lib516.c index 59abb091..fc94eaab 100644 --- a/deps/curl/tests/libtest/lib516.c +++ b/deps/curl/tests/libtest/lib516.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -59,5 +59,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib517.c b/deps/curl/tests/libtest/lib517.c index 0d1ea2eb..e769ae5a 100644 --- a/deps/curl/tests/libtest/lib517.c +++ b/deps/curl/tests/libtest/lib517.c @@ -153,7 +153,7 @@ static const struct dcheck dates[] = { { NULL, 0 } }; -int test(char *URL) +CURLcode test(char *URL) { int i; int error = 0; @@ -169,5 +169,5 @@ int test(char *URL) } } - return error; + return error == 0 ? CURLE_OK : TEST_ERR_FAILURE; } diff --git a/deps/curl/tests/libtest/lib518.c b/deps/curl/tests/libtest/lib518.c index 28a50b22..289692c3 100644 --- a/deps/curl/tests/libtest/lib518.c +++ b/deps/curl/tests/libtest/lib518.c @@ -50,7 +50,7 @@ #if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) -static int *fd = NULL; +static int *testfd = NULL; static struct rlimit num_open; static char msgbuff[256]; @@ -68,10 +68,10 @@ static void close_file_descriptors(void) for(num_open.rlim_cur = 0; num_open.rlim_cur < num_open.rlim_max; num_open.rlim_cur++) - if(fd[num_open.rlim_cur] > 0) - close(fd[num_open.rlim_cur]); - free(fd); - fd = NULL; + if(testfd[num_open.rlim_cur] > 0) + close(testfd[num_open.rlim_cur]); + free(testfd); + testfd = NULL; } static int fopen_works(void) @@ -120,7 +120,7 @@ static void rlim2str(char *buf, size_t len, rlim_t val) } } -static int rlimit(int keep_open) +static int test_rlimit(int keep_open) { rlim_t nitems, i; int *memchunk = NULL; @@ -239,7 +239,7 @@ static int 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 rlimit() function so + * be always free()ed before exiting the test_rlimit() function so * that it becomes available to the test. */ @@ -276,7 +276,7 @@ static int rlimit(int keep_open) /* verify that we won't overflow size_t in malloc() */ - if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) { + if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*testfd)) { rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); msnprintf(strbuff, sizeof(strbuff), "unable to allocate an array for %s " "file descriptors, would overflow size_t", strbuff1); @@ -291,9 +291,9 @@ static int rlimit(int keep_open) rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); fprintf(stderr, "allocating array for %s file descriptors\n", strbuff); - fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max)); - if(!fd) { - store_errmsg("fd, malloc() failed", errno); + testfd = malloc(sizeof(*testfd) * (size_t)(num_open.rlim_max)); + if(!testfd) { + store_errmsg("testfd, malloc() failed", errno); fprintf(stderr, "%s\n", msgbuff); free(memchunk); return -7; @@ -301,25 +301,25 @@ static int rlimit(int keep_open) /* initialize it to fight lazy allocation */ - fprintf(stderr, "initializing fd array\n"); + fprintf(stderr, "initializing testfd array\n"); for(num_open.rlim_cur = 0; num_open.rlim_cur < num_open.rlim_max; num_open.rlim_cur++) - fd[num_open.rlim_cur] = -1; + testfd[num_open.rlim_cur] = -1; rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); fprintf(stderr, "trying to open %s file descriptors\n", strbuff); /* open a dummy descriptor */ - fd[0] = open(DEV_NULL, O_RDONLY); - if(fd[0] < 0) { + testfd[0] = open(DEV_NULL, O_RDONLY); + if(testfd[0] < 0) { msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); store_errmsg(strbuff, errno); fprintf(stderr, "%s\n", msgbuff); - free(fd); - fd = NULL; + free(testfd); + testfd = NULL; free(memchunk); return -8; } @@ -330,11 +330,11 @@ static int rlimit(int keep_open) num_open.rlim_cur < num_open.rlim_max; num_open.rlim_cur++) { - fd[num_open.rlim_cur] = dup(fd[0]); + testfd[num_open.rlim_cur] = dup(testfd[0]); - if(fd[num_open.rlim_cur] < 0) { + if(testfd[num_open.rlim_cur] < 0) { - fd[num_open.rlim_cur] = -1; + testfd[num_open.rlim_cur] = -1; rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", strbuff1); @@ -355,11 +355,11 @@ static int rlimit(int keep_open) fprintf(stderr, "%s\n", msgbuff); for(num_open.rlim_cur = 0; - fd[num_open.rlim_cur] >= 0; + testfd[num_open.rlim_cur] >= 0; num_open.rlim_cur++) - close(fd[num_open.rlim_cur]); - free(fd); - fd = NULL; + close(testfd[num_open.rlim_cur]); + free(testfd); + testfd = NULL; free(memchunk); return -9; } @@ -368,7 +368,7 @@ static int rlimit(int keep_open) rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); fprintf(stderr, "%s file descriptors open\n", strbuff); -#if !defined(HAVE_POLL_FINE) && !defined(USE_WINSOCK) +#if !defined(HAVE_POLL) && !defined(USE_WINSOCK) /* * when using select() instead of poll() we cannot test @@ -396,8 +396,8 @@ static int rlimit(int keep_open) for(rl.rlim_cur = 0; rl.rlim_cur < num_open.rlim_max; rl.rlim_cur++) { - if((fd[rl.rlim_cur] > 0) && - ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) { + if((testfd[rl.rlim_cur] > 0) && + ((unsigned int)testfd[rl.rlim_cur] > num_open.rlim_cur)) { msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", FD_SETSIZE); store_errmsg(strbuff, 0); @@ -445,21 +445,21 @@ static int rlimit(int keep_open) return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; if(!strcmp(URL, "check")) { /* used by the test script to ask if we can run this test or not */ - if(rlimit(FALSE)) { - fprintf(stdout, "rlimit problem: %s\n", msgbuff); - return 1; + if(test_rlimit(FALSE)) { + fprintf(stdout, "test_rlimit problem: %s\n", msgbuff); + return (CURLcode)1; } - return 0; /* sure, run this! */ + return CURLE_OK; /* sure, run this! */ } - if(rlimit(TRUE)) { + if(test_rlimit(TRUE)) { /* failure */ return TEST_ERR_MAJOR_BAD; } @@ -492,12 +492,12 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } #else /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */ -int test(char *URL) +CURLcode test(char *URL) { (void)URL; printf("system lacks necessary system function(s)"); diff --git a/deps/curl/tests/libtest/lib519.c b/deps/curl/tests/libtest/lib519.c index bf950bd4..fcc8a6a0 100644 --- a/deps/curl/tests/libtest/lib519.c +++ b/deps/curl/tests/libtest/lib519.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -62,5 +62,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib520.c b/deps/curl/tests/libtest/lib520.c index 7e5d0abd..13257c47 100644 --- a/deps/curl/tests/libtest/lib520.c +++ b/deps/curl/tests/libtest/lib520.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -53,5 +53,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib521.c b/deps/curl/tests/libtest/lib521.c index e3611685..dc884437 100644 --- a/deps/curl/tests/libtest/lib521.c +++ b/deps/curl/tests/libtest/lib521.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -54,5 +54,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib523.c b/deps/curl/tests/libtest/lib523.c index 86128e6c..5c7338e7 100644 --- a/deps/curl/tests/libtest/lib523.c +++ b/deps/curl/tests/libtest/lib523.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -55,5 +55,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib524.c b/deps/curl/tests/libtest/lib524.c index 6b8cc207..ec721bee 100644 --- a/deps/curl/tests/libtest/lib524.c +++ b/deps/curl/tests/libtest/lib524.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -53,5 +53,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib525.c b/deps/curl/tests/libtest/lib525.c index 3f8abeef..f64070b5 100644 --- a/deps/curl/tests/libtest/lib525.c +++ b/deps/curl/tests/libtest/lib525.c @@ -31,9 +31,9 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; FILE *hd_src = NULL; int hd; diff --git a/deps/curl/tests/libtest/lib526.c b/deps/curl/tests/libtest/lib526.c index 12b65c02..5fd81b51 100644 --- a/deps/curl/tests/libtest/lib526.c +++ b/deps/curl/tests/libtest/lib526.c @@ -52,9 +52,9 @@ #define NUM_HANDLES 4 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl[NUM_HANDLES]; int running; CURLM *m = NULL; @@ -163,7 +163,7 @@ test_cleanup: cleanup'ed yet, in this case we have to cleanup them or otherwise these will be leaked, let's use undocumented cleanup sequence - type UB */ - if(res) + if(res != CURLE_OK) for(i = 0; i < NUM_HANDLES; i++) curl_easy_cleanup(curl[i]); diff --git a/deps/curl/tests/libtest/lib530.c b/deps/curl/tests/libtest/lib530.c index 0173dd97..5f24c904 100644 --- a/deps/curl/tests/libtest/lib530.c +++ b/deps/curl/tests/libtest/lib530.c @@ -38,15 +38,13 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -struct Sockets -{ +struct Sockets { curl_socket_t *sockets; int count; /* number of sockets actually stored in array */ int max_count; /* max number of sockets that fit in allocated array */ }; -struct ReadWriteSockets -{ +struct ReadWriteSockets { struct Sockets read, write; }; @@ -191,7 +189,7 @@ static int checkForCompletion(CURLM *curl, int *success) } else { fprintf(stderr, "Got an unexpected message from curl: %i\n", - (int)message->msg); + message->msg); result = 1; *success = 0; } @@ -228,7 +226,7 @@ static void updateFdSet(struct Sockets *sockets, fd_set* fdset, } static int socket_action(CURLM *curl, curl_socket_t s, int evBitmask, - const char *info) + const char *info) { int numhandles = 0; CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); @@ -258,9 +256,9 @@ static int checkFdSet(CURLM *curl, return result; } -static int testone(char *URL, int timercb, int socketcb) +static CURLcode testone(char *URL, int timercb, int socketcb) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; CURLM *m = NULL; struct ReadWriteSockets sockets = {{NULL, 0, 0}, {NULL, 0, 0}}; struct timeval timeout = {-1, 0}; @@ -276,7 +274,7 @@ static int testone(char *URL, int timercb, int socketcb) start_test_timing(); res_global_init(CURL_GLOBAL_ALL); - if(res) + if(res != CURLE_OK) return res; easy_init(curl); @@ -297,9 +295,10 @@ static int testone(char *URL, int timercb, int socketcb) multi_add_handle(m, curl); - res = socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout"); - if(res) + if(socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; + } while(!checkForCompletion(m, &success)) { fd_set readSet, writeSet; @@ -325,18 +324,21 @@ static int testone(char *URL, int timercb, int socketcb) select_test((int)maxFd, &readSet, &writeSet, NULL, &tv); /* Check the sockets for reading / writing */ - res = checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, "read"); - if(res) + if(checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, "read")) { + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; - res = checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write"); - if(res) + } + if(checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write")) { + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; + } if(timeout.tv_sec != -1 && getMicroSecondTimeout(&timeout) == 0) { /* Curl's timer has elapsed. */ - res = socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout"); - if(res) + if(socket_action(m, CURL_SOCKET_TIMEOUT, 0, "timeout")) { + res = TEST_ERR_BAD_TIMEOUT; goto test_cleanup; + } } abort_on_test_timeout(); @@ -362,9 +364,9 @@ test_cleanup: return res; } -int test(char *URL) +CURLcode test(char *URL) { - int rc; + CURLcode rc; /* rerun the same transfer multiple times and make it fail in different callback calls */ rc = testone(URL, 0, 0); @@ -387,5 +389,5 @@ int test(char *URL) if(!rc) fprintf(stderr, "test 0/2 failed: %d\n", rc); - return 0; + return CURLE_OK; } diff --git a/deps/curl/tests/libtest/lib533.c b/deps/curl/tests/libtest/lib533.c index 0f6a89c2..dc48bb46 100644 --- a/deps/curl/tests/libtest/lib533.c +++ b/deps/curl/tests/libtest/lib533.c @@ -33,9 +33,9 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; int running; CURLM *m = NULL; diff --git a/deps/curl/tests/libtest/lib536.c b/deps/curl/tests/libtest/lib536.c index 7e53e225..73edf43d 100644 --- a/deps/curl/tests/libtest/lib536.c +++ b/deps/curl/tests/libtest/lib536.c @@ -37,7 +37,7 @@ static void proxystat(CURL *curl) } } -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURL *curl; @@ -80,5 +80,5 @@ test_cleanup: curl_slist_free_all(host); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib537.c b/deps/curl/tests/libtest/lib537.c index c35aea1b..6e1baee7 100644 --- a/deps/curl/tests/libtest/lib537.c +++ b/deps/curl/tests/libtest/lib537.c @@ -34,9 +34,7 @@ #include "warnless.h" #include "memdebug.h" -#if !defined(HAVE_POLL_FINE) && \ - !defined(USE_WINSOCK) && \ - !defined(FD_SETSIZE) +#if !defined(HAVE_POLL) && !defined(USE_WINSOCK) && !defined(FD_SETSIZE) #error "this test requires FD_SETSIZE" #endif @@ -50,7 +48,7 @@ #if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) -static int *fd = NULL; +static int *testfd = NULL; static struct rlimit num_open; static char msgbuff[256]; @@ -68,10 +66,10 @@ static void close_file_descriptors(void) for(num_open.rlim_cur = 0; num_open.rlim_cur < num_open.rlim_max; num_open.rlim_cur++) - if(fd[num_open.rlim_cur] > 0) - close(fd[num_open.rlim_cur]); - free(fd); - fd = NULL; + if(testfd[num_open.rlim_cur] > 0) + close(testfd[num_open.rlim_cur]); + free(testfd); + testfd = NULL; } static int fopen_works(void) @@ -120,7 +118,7 @@ static void rlim2str(char *buf, size_t len, rlim_t val) } } -static int rlimit(int keep_open) +static int test_rlimit(int keep_open) { int *tmpfd; rlim_t nitems, i; @@ -145,6 +143,15 @@ static int rlimit(int keep_open) rlim2str(strbuff, sizeof(strbuff), rl.rlim_max); fprintf(stderr, "initial hard limit: %s\n", strbuff); + /* 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) + if(rl.rlim_cur > LIMIT_CAP) { + fprintf(stderr, "soft limit above %ld, not running\n", (long)LIMIT_CAP); + return -2; + } + /* * if soft limit and hard limit are different we ask the * system to raise soft limit all the way up to the hard @@ -212,7 +219,7 @@ static int 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 rlimit() function so + * be always free()ed before exiting the test_rlimit() function so * that it becomes available to the test. */ @@ -264,7 +271,7 @@ static int rlimit(int keep_open) /* verify that we won't overflow size_t in malloc() */ - if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) { + if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*testfd)) { rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); msnprintf(strbuff, sizeof(strbuff), "unable to allocate an array for %s " "file descriptors, would overflow size_t", strbuff1); @@ -280,14 +287,14 @@ static int rlimit(int keep_open) rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); fprintf(stderr, "allocating array for %s file descriptors\n", strbuff); - fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max)); - if(!fd) { - fprintf(stderr, "fd, malloc() failed\n"); + testfd = malloc(sizeof(*testfd) * (size_t)(num_open.rlim_max)); + if(!testfd) { + fprintf(stderr, "testfd, malloc() failed\n"); num_open.rlim_max /= 2; } - } while(num_open.rlim_max && !fd); - if(!fd) { - store_errmsg("fd, malloc() failed", errno); + } while(num_open.rlim_max && !testfd); + if(!testfd) { + store_errmsg("testfd, malloc() failed", errno); fprintf(stderr, "%s\n", msgbuff); free(memchunk); return -6; @@ -295,25 +302,25 @@ static int rlimit(int keep_open) /* initialize it to fight lazy allocation */ - fprintf(stderr, "initializing fd array\n"); + fprintf(stderr, "initializing testfd array\n"); for(num_open.rlim_cur = 0; num_open.rlim_cur < num_open.rlim_max; num_open.rlim_cur++) - fd[num_open.rlim_cur] = -1; + testfd[num_open.rlim_cur] = -1; rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); fprintf(stderr, "trying to open %s file descriptors\n", strbuff); /* open a dummy descriptor */ - fd[0] = open(DEV_NULL, O_RDONLY); - if(fd[0] < 0) { + testfd[0] = open(DEV_NULL, O_RDONLY); + if(testfd[0] < 0) { msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); store_errmsg(strbuff, errno); fprintf(stderr, "%s\n", msgbuff); - free(fd); - fd = NULL; + free(testfd); + testfd = NULL; free(memchunk); return -7; } @@ -324,11 +331,11 @@ static int rlimit(int keep_open) num_open.rlim_cur < num_open.rlim_max; num_open.rlim_cur++) { - fd[num_open.rlim_cur] = dup(fd[0]); + testfd[num_open.rlim_cur] = dup(testfd[0]); - if(fd[num_open.rlim_cur] < 0) { + if(testfd[num_open.rlim_cur] < 0) { - fd[num_open.rlim_cur] = -1; + testfd[num_open.rlim_cur] = -1; rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", strbuff1); @@ -348,10 +355,10 @@ static int rlimit(int keep_open) fprintf(stderr, "%s\n", strbuff); for(num_open.rlim_cur = num_open.rlim_max; - fd[num_open.rlim_cur] >= 0; + testfd[num_open.rlim_cur] >= 0; num_open.rlim_cur++) { - close(fd[num_open.rlim_cur]); - fd[num_open.rlim_cur] = -1; + close(testfd[num_open.rlim_cur]); + testfd[num_open.rlim_cur] = -1; } rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); @@ -359,9 +366,9 @@ static int rlimit(int keep_open) /* we don't care if we can't shrink it */ - tmpfd = realloc(fd, sizeof(*fd) * (size_t)(num_open.rlim_max)); + tmpfd = realloc(testfd, sizeof(*testfd) * (size_t)(num_open.rlim_max)); if(tmpfd) { - fd = tmpfd; + testfd = tmpfd; tmpfd = NULL; } @@ -372,7 +379,7 @@ static int rlimit(int keep_open) rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); fprintf(stderr, "%s file descriptors open\n", strbuff); -#if !defined(HAVE_POLL_FINE) && !defined(USE_WINSOCK) +#if !defined(HAVE_POLL) && !defined(USE_WINSOCK) /* * when using select() instead of poll() we cannot test @@ -400,8 +407,8 @@ static int rlimit(int keep_open) for(rl.rlim_cur = 0; rl.rlim_cur < num_open.rlim_max; rl.rlim_cur++) { - if((fd[rl.rlim_cur] > 0) && - ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) { + if((testfd[rl.rlim_cur] > 0) && + ((unsigned int)testfd[rl.rlim_cur] > num_open.rlim_cur)) { msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", FD_SETSIZE); store_errmsg(strbuff, 0); @@ -449,21 +456,21 @@ static int rlimit(int keep_open) return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; if(!strcmp(URL, "check")) { /* used by the test script to ask if we can run this test or not */ - if(rlimit(FALSE)) { - fprintf(stdout, "rlimit problem: %s\n", msgbuff); - return 1; + if(test_rlimit(FALSE)) { + fprintf(stdout, "test_rlimit problem: %s\n", msgbuff); + return (CURLcode)1; } - return 0; /* sure, run this! */ + return CURLE_OK; /* sure, run this! */ } - if(rlimit(TRUE)) { + if(test_rlimit(TRUE)) { /* failure */ return TEST_ERR_MAJOR_BAD; } @@ -496,16 +503,16 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } #else /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */ -int test(char *URL) +CURLcode test(char *URL) { (void)URL; printf("system lacks necessary system function(s)"); - return 1; /* skip test */ + return (CURLcode)1; /* skip test */ } #endif /* defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) */ diff --git a/deps/curl/tests/libtest/lib539.c b/deps/curl/tests/libtest/lib539.c index 75f146c0..2e079fae 100644 --- a/deps/curl/tests/libtest/lib539.c +++ b/deps/curl/tests/libtest/lib539.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -55,18 +55,11 @@ int test(char *URL) /* * Change the FTP_FILEMETHOD option to use full paths rather than a CWD - * command. Alter the URL's path a bit, appending a "./". Use an innocuous - * QUOTE command, after which curl will CWD to ftp_conn->entrypath and then - * (on the next call to ftp_statemach_act) find a non-zero ftpconn->dirdepth - * even though no directories are stored in the ftpconn->dirs array (after a - * call to freedirs). + * command. Use an innocuous QUOTE command, after which curl will CWD to + * ftp_conn->entrypath and then (on the next call to ftp_statemach_act) + * find a non-zero ftpconn->dirdepth even though no directories are stored + * in the ftpconn->dirs array (after a call to freedirs). */ - newURL = aprintf("%s./", URL); - if(!newURL) { - curl_easy_cleanup(curl); - curl_global_cleanup(); - return TEST_ERR_MAJOR_BAD; - } slist = curl_slist_append(NULL, "SYST"); if(!slist) { @@ -76,7 +69,7 @@ int test(char *URL) return TEST_ERR_MAJOR_BAD; } - test_setopt(curl, CURLOPT_URL, newURL); + test_setopt(curl, CURLOPT_URL, libtest_arg2); test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD); test_setopt(curl, CURLOPT_QUOTE, slist); @@ -89,5 +82,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib540.c b/deps/curl/tests/libtest/lib540.c index ab9fef9b..b53b9556 100644 --- a/deps/curl/tests/libtest/lib540.c +++ b/deps/curl/tests/libtest/lib540.c @@ -46,68 +46,68 @@ #define NUM_HANDLES 2 -static CURL *eh[NUM_HANDLES]; +static CURL *testeh[NUM_HANDLES]; -static int init(int num, CURLM *cm, const char *url, const char *userpwd, - struct curl_slist *headers) +static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd, + struct curl_slist *headers) { - int res = 0; + CURLcode res = CURLE_OK; - res_easy_init(eh[num]); + res_easy_init(testeh[num]); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_URL, url); + res_easy_setopt(testeh[num], CURLOPT_URL, url); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_PROXY, PROXY); + res_easy_setopt(testeh[num], CURLOPT_PROXY, PROXY); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_PROXYUSERPWD, userpwd); + res_easy_setopt(testeh[num], CURLOPT_PROXYUSERPWD, userpwd); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); + res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_VERBOSE, 1L); + res_easy_setopt(testeh[num], CURLOPT_VERBOSE, 1L); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_HEADER, 1L); + res_easy_setopt(testeh[num], CURLOPT_HEADER, 1L); if(res) goto init_failed; - res_easy_setopt(eh[num], CURLOPT_HTTPHEADER, headers); /* custom Host: */ + res_easy_setopt(testeh[num], CURLOPT_HTTPHEADER, headers); /* custom Host: */ if(res) goto init_failed; - res_multi_add_handle(cm, eh[num]); + res_multi_add_handle(cm, testeh[num]); if(res) goto init_failed; - return 0; /* success */ + return CURLE_OK; /* success */ init_failed: - curl_easy_cleanup(eh[num]); - eh[num] = NULL; + curl_easy_cleanup(testeh[num]); + testeh[num] = NULL; return res; /* failure */ } -static int loop(int num, CURLM *cm, const char *url, const char *userpwd, - struct curl_slist *headers) +static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, + struct curl_slist *headers) { CURLMsg *msg; long L; int Q, U = -1; fd_set R, W, E; struct timeval T; - int res = 0; + CURLcode res = CURLE_OK; res = init(num, cm, url, userpwd, headers); if(res) @@ -174,8 +174,8 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd, curl_multi_remove_handle(cm, e); curl_easy_cleanup(e); for(i = 0; i < NUM_HANDLES; i++) { - if(eh[i] == e) { - eh[i] = NULL; + if(testeh[i] == e) { + testeh[i] = NULL; break; } } @@ -189,24 +189,24 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd, return res; } - return 0; /* success */ + return CURLE_OK; } -int test(char *URL) +CURLcode test(char *URL) { CURLM *cm = NULL; struct curl_slist *headers = NULL; char buffer[246]; /* naively fixed-size */ - int res = 0; + CURLcode res = CURLE_OK; int i; for(i = 0; i < NUM_HANDLES; i++) - eh[i] = NULL; + testeh[i] = NULL; start_test_timing(); if(test_argc < 4) - return 99; + return (CURLcode)99; msnprintf(buffer, sizeof(buffer), "Host: %s", HOST); @@ -243,8 +243,8 @@ test_cleanup: /* proper cleanup sequence - type PB */ for(i = 0; i < NUM_HANDLES; i++) { - curl_multi_remove_handle(cm, eh[i]); - curl_easy_cleanup(eh[i]); + curl_multi_remove_handle(cm, testeh[i]); + curl_easy_cleanup(testeh[i]); } curl_multi_cleanup(cm); diff --git a/deps/curl/tests/libtest/lib541.c b/deps/curl/tests/libtest/lib541.c index 75c74fbf..7dd53195 100644 --- a/deps/curl/tests/libtest/lib541.c +++ b/deps/curl/tests/libtest/lib541.c @@ -33,7 +33,7 @@ * Two FTP uploads, the second with no content sent. */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -51,7 +51,7 @@ int test(char *URL) fprintf(stderr, "fopen failed with error: %d %s\n", errno, strerror(errno)); fprintf(stderr, "Error opening file: %s\n", libtest_arg2); - return -2; /* if this happens things are major weird */ + return (CURLcode)-2; /* if this happens things are major weird */ } /* get the file size of the local file */ diff --git a/deps/curl/tests/libtest/lib542.c b/deps/curl/tests/libtest/lib542.c index 27429fd6..2be67488 100644 --- a/deps/curl/tests/libtest/lib542.c +++ b/deps/curl/tests/libtest/lib542.c @@ -33,7 +33,7 @@ * FTP get with NOBODY but no HEADER */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib543.c b/deps/curl/tests/libtest/lib543.c index 2bec2f1a..077cf16b 100644 --- a/deps/curl/tests/libtest/lib543.c +++ b/deps/curl/tests/libtest/lib543.c @@ -27,7 +27,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { static const unsigned char a[] = { 0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1, @@ -68,5 +68,5 @@ int test(char *URL) } curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib544.c b/deps/curl/tests/libtest/lib544.c index a58fa05e..6228e7d9 100644 --- a/deps/curl/tests/libtest/lib544.c +++ b/deps/curl/tests/libtest/lib544.c @@ -31,7 +31,7 @@ static char teststring[] = 'w', 'i', 't', 'h', ' ', 'a', 'n', ' ', 'e', 'm', 'b', 'e', 'd', 'd', 'e', 'd', ' ', 'N', 'U', 'L'}; -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -80,5 +80,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib547.c b/deps/curl/tests/libtest/lib547.c index e65f33b7..a84ce999 100644 --- a/deps/curl/tests/libtest/lib547.c +++ b/deps/curl/tests/libtest/lib547.c @@ -72,7 +72,7 @@ static curlioerr ioctlcallback(CURL *handle, #endif -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -123,5 +123,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib549.c b/deps/curl/tests/libtest/lib549.c index 8e91d935..7bd67093 100644 --- a/deps/curl/tests/libtest/lib549.c +++ b/deps/curl/tests/libtest/lib549.c @@ -30,7 +30,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -52,7 +52,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L); test_setopt(curl, CURLOPT_VERBOSE, 1L); if(libtest_arg3) { - /* enable ascii/text mode */ + /* enable ASCII/text mode */ test_setopt(curl, CURLOPT_TRANSFERTEXT, 1L); } @@ -63,5 +63,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib552.c b/deps/curl/tests/libtest/lib552.c index 436b86ec..0920b025 100644 --- a/deps/curl/tests/libtest/lib552.c +++ b/deps/curl/tests/libtest/lib552.c @@ -30,7 +30,7 @@ #include "warnless.h" #include "memdebug.h" -struct data { +struct testdata { char trace_ascii; /* 1 or 0 */ }; @@ -50,7 +50,7 @@ void dump(const char *text, fprintf(stream, "%s, %zu bytes (0x%zx)\n", text, size, size); - for(i = 0; i= 0x20) && (ptr[i + c]<0x80)? ptr[i + 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 */ if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D && ptr[i + c + 2] == 0x0A) { @@ -89,7 +89,7 @@ int my_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp) { - struct data *config = (struct data *)userp; + struct testdata *config = (struct testdata *)userp; const char *text; (void)handle; /* prevent compiler warning */ @@ -141,7 +141,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) } -static size_t write_callback(void *ptr, size_t size, size_t nmemb, +static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *stream) { int amount = curlx_uztosi(size * nmemb); @@ -166,15 +166,15 @@ static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp) -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; - struct data config; + struct testdata config; size_t i; static const char fill[] = "test data"; - config.trace_ascii = 1; /* enable ascii tracing */ + config.trace_ascii = 1; /* enable ASCII tracing */ global_init(CURL_GLOBAL_ALL); easy_init(curl); @@ -217,5 +217,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib553.c b/deps/curl/tests/libtest/lib553.c index f282c895..e33cf148 100644 --- a/deps/curl/tests/libtest/lib553.c +++ b/deps/curl/tests/libtest/lib553.c @@ -55,9 +55,9 @@ static size_t myreadfunc(char *ptr, size_t size, size_t nmemb, void *stream) #define NUM_HEADERS 8 #define SIZE_HEADERS 5000 -static char buf[SIZE_HEADERS + 100]; +static char testbuf[SIZE_HEADERS + 100]; -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_FAILED_INIT; @@ -77,10 +77,10 @@ int test(char *URL) } for(i = 0; i < NUM_HEADERS; i++) { - int len = msnprintf(buf, sizeof(buf), "Header%d: ", i); - memset(&buf[len], 'A', SIZE_HEADERS); - buf[len + SIZE_HEADERS] = 0; /* null-terminate */ - hl = curl_slist_append(headerlist, buf); + int len = msnprintf(testbuf, sizeof(testbuf), "Header%d: ", i); + memset(&testbuf[len], 'A', SIZE_HEADERS); + testbuf[len + SIZE_HEADERS] = 0; /* null-terminate */ + hl = curl_slist_append(headerlist, testbuf); if(!hl) goto test_cleanup; headerlist = hl; @@ -109,5 +109,5 @@ test_cleanup: curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib554.c b/deps/curl/tests/libtest/lib554.c index 1d049815..10c19a38 100644 --- a/deps/curl/tests/libtest/lib554.c +++ b/deps/curl/tests/libtest/lib554.c @@ -21,12 +21,11 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */ #include "test.h" #include "memdebug.h" -static char data[]= +static char testdata[]= "this is what we post to the silly web server\n"; struct WriteThis { @@ -60,7 +59,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) #endif } -static int once(char *URL, bool oldstyle) +static CURLcode test_once(char *URL, bool oldstyle) { CURL *curl; CURLcode res = CURLE_OK; @@ -71,28 +70,32 @@ static int once(char *URL, bool oldstyle) struct WriteThis pooh; struct WriteThis pooh2; - pooh.readptr = data; - pooh.sizeleft = strlen(data); + pooh.readptr = testdata; + pooh.sizeleft = strlen(testdata); /* Fill in the file upload field */ if(oldstyle) { - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "sendfile", - CURLFORM_STREAM, &pooh, - CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft, - CURLFORM_FILENAME, "postit2.c", - CURLFORM_END); + CURL_IGNORE_DEPRECATION( + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "sendfile", + CURLFORM_STREAM, &pooh, + CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft, + CURLFORM_FILENAME, "postit2.c", + CURLFORM_END); + ) } else { - /* new style */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "sendfile alternative", - CURLFORM_STREAM, &pooh, - CURLFORM_CONTENTLEN, (curl_off_t)pooh.sizeleft, - CURLFORM_FILENAME, "file name 2", - CURLFORM_END); + CURL_IGNORE_DEPRECATION( + /* new style */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "sendfile alternative", + CURLFORM_STREAM, &pooh, + CURLFORM_CONTENTLEN, (curl_off_t)pooh.sizeleft, + CURLFORM_FILENAME, "file name 2", + CURLFORM_END); + ) } if(formrc) @@ -101,55 +104,61 @@ static int once(char *URL, bool oldstyle) /* Now add the same data with another name and make it not look like a file upload but still using the callback */ - pooh2.readptr = data; - pooh2.sizeleft = strlen(data); - - /* Fill in the file upload field */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "callbackdata", - CURLFORM_STREAM, &pooh2, - CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft, - CURLFORM_END); + pooh2.readptr = testdata; + pooh2.sizeleft = strlen(testdata); + CURL_IGNORE_DEPRECATION( + /* Fill in the file upload field */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "callbackdata", + CURLFORM_STREAM, &pooh2, + CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft, + CURLFORM_END); + ) if(formrc) printf("curl_formadd(2) = %d\n", (int)formrc); - /* Fill in the filename field */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "filename", - CURLFORM_COPYCONTENTS, "postit2.c", - CURLFORM_END); - + CURL_IGNORE_DEPRECATION( + /* Fill in the filename field */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "filename", + CURLFORM_COPYCONTENTS, "postit2.c", + CURLFORM_END); + ) if(formrc) printf("curl_formadd(3) = %d\n", (int)formrc); - /* Fill in a submit field too */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "submit", - CURLFORM_COPYCONTENTS, "send", - CURLFORM_CONTENTTYPE, "text/plain", - CURLFORM_END); - + CURL_IGNORE_DEPRECATION( + /* Fill in a submit field too */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "submit", + CURLFORM_COPYCONTENTS, "send", + CURLFORM_CONTENTTYPE, "text/plain", + CURLFORM_END); + ) if(formrc) printf("curl_formadd(4) = %d\n", (int)formrc); - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, "somename", - CURLFORM_BUFFER, "somefile.txt", - CURLFORM_BUFFERPTR, "blah blah", - CURLFORM_BUFFERLENGTH, (long)9, - CURLFORM_END); - + CURL_IGNORE_DEPRECATION( + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "somename", + CURLFORM_BUFFER, "somefile.txt", + CURLFORM_BUFFERPTR, "blah blah", + CURLFORM_BUFFERLENGTH, (long)9, + CURLFORM_END); + ) if(formrc) printf("curl_formadd(5) = %d\n", (int)formrc); curl = curl_easy_init(); if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + curl_formfree(formpost); + ) curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } @@ -166,8 +175,10 @@ static int once(char *URL, bool oldstyle) /* we want to use our own read function */ test_setopt(curl, CURLOPT_READFUNCTION, read_callback); - /* send a multi-part formpost */ - test_setopt(curl, CURLOPT_HTTPPOST, formpost); + CURL_IGNORE_DEPRECATION( + /* send a multi-part formpost */ + test_setopt(curl, CURLOPT_HTTPPOST, formpost); + ) /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -180,27 +191,31 @@ static int once(char *URL, bool oldstyle) test_cleanup: - /* always cleanup */ - curl_easy_cleanup(curl); + CURL_IGNORE_DEPRECATION( + /* always cleanup */ + curl_easy_cleanup(curl); + ) - /* now cleanup the formpost chain */ - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + /* now cleanup the formpost chain */ + curl_formfree(formpost); + ) return res; } -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); return TEST_ERR_MAJOR_BAD; } - res = once(URL, TRUE); /* old */ + res = test_once(URL, TRUE); /* old */ if(!res) - res = once(URL, FALSE); /* new */ + res = test_once(URL, FALSE); /* new */ curl_global_cleanup(); diff --git a/deps/curl/tests/libtest/lib555.c b/deps/curl/tests/libtest/lib555.c index 2e595b68..7a16e2e2 100644 --- a/deps/curl/tests/libtest/lib555.c +++ b/deps/curl/tests/libtest/lib555.c @@ -76,9 +76,9 @@ static curlioerr ioctlcallback(CURL *handle, } -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; int counter = 0; CURLM *m = NULL; diff --git a/deps/curl/tests/libtest/lib556.c b/deps/curl/tests/libtest/lib556.c index ead6529e..06532c61 100644 --- a/deps/curl/tests/libtest/lib556.c +++ b/deps/curl/tests/libtest/lib556.c @@ -37,7 +37,7 @@ #define STDERR_FILENO 2 #endif -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -65,29 +65,36 @@ int test(char *URL) const char *request = "GET /556 HTTP/1.1\r\n" "Host: ninja\r\n\r\n"; - size_t iolen = 0; + const char *sbuf = request; + size_t sblen = strlen(request); + size_t nwritten = 0, nread = 0; - res = curl_easy_send(curl, request, strlen(request), &iolen); + do { + char buf[1024]; - if(!res) { - /* we assume that sending always work */ - - do { - char buf[1024]; - /* busy-read like crazy */ - res = curl_easy_recv(curl, buf, sizeof(buf), &iolen); - - if(iolen) { - /* send received stuff to stdout */ - if(!write(STDOUT_FILENO, buf, iolen)) - break; + if(sblen) { + res = curl_easy_send(curl, sbuf, sblen, &nwritten); + if(res && res != CURLE_AGAIN) + break; + if(nwritten > 0) { + sbuf += nwritten; + sblen -= nwritten; } + } - } while((res == CURLE_OK && iolen) || (res == CURLE_AGAIN)); - } + /* busy-read like crazy */ + res = curl_easy_recv(curl, buf, sizeof(buf), &nread); - if(iolen) - res = (CURLcode)TEST_ERR_FAILURE; + if(nread) { + /* send received stuff to stdout */ + if(!write(STDOUT_FILENO, buf, nread)) + break; + } + + } while((res == CURLE_OK && nread) || (res == CURLE_AGAIN)); + + if(res && res != CURLE_AGAIN) + res = TEST_ERR_FAILURE; } test_cleanup: @@ -95,5 +102,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib557.c b/deps/curl/tests/libtest/lib557.c index c1576947..d8462603 100644 --- a/deps/curl/tests/libtest/lib557.c +++ b/deps/curl/tests/libtest/lib557.c @@ -27,8 +27,6 @@ * curl_m*printf formatting capabilities and handling of some data types. */ -#define CURL_NO_FMT_CHECKS /* disable compiler *printf format checks */ - #include "test.h" #include @@ -39,6 +37,15 @@ #include "memdebug.h" +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#if !defined(__clang__) && __GNUC__ >= 7 +#pragma GCC diagnostic ignored "-Wformat-overflow" +#endif +#endif + #if (SIZEOF_CURL_OFF_T > SIZEOF_LONG) # define MPRNT_SUFFIX_CURL_OFF_T LL #else @@ -150,7 +157,7 @@ static int test_unsigned_short_formatting(void) for(i = 1; i <= num_ushort_tests; i++) { - for(j = 0; jServer ANNOUNCE functionality (PUT style) */ -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; int sdp; FILE *sdpf = NULL; diff --git a/deps/curl/tests/libtest/lib569.c b/deps/curl/tests/libtest/lib569.c index da95bb95..847116a3 100644 --- a/deps/curl/tests/libtest/lib569.c +++ b/deps/curl/tests/libtest/lib569.c @@ -33,9 +33,9 @@ static char *suburl(const char *base, int i) /* * Test Session ID capture */ -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; char *stream_uri = NULL; char *rtsp_session_id; diff --git a/deps/curl/tests/libtest/lib570.c b/deps/curl/tests/libtest/lib570.c index 392c398a..3d15e9bc 100644 --- a/deps/curl/tests/libtest/lib570.c +++ b/deps/curl/tests/libtest/lib570.c @@ -30,9 +30,9 @@ static char *suburl(const char *base, int i) return curl_maprintf("%s%.4d", base, i); } -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; int request = 1; char *stream_uri = NULL; @@ -104,11 +104,11 @@ int test(char *URL) res = curl_easy_perform(curl); if(res == CURLE_RTSP_SESSION_ERROR) { - res = 0; + res = CURLE_OK; } else { fprintf(stderr, "Failed to detect a Session ID mismatch"); - res = 1; + res = (CURLcode)1; } test_cleanup: diff --git a/deps/curl/tests/libtest/lib571.c b/deps/curl/tests/libtest/lib571.c index c4ae67d4..b7868e0a 100644 --- a/deps/curl/tests/libtest/lib571.c +++ b/deps/curl/tests/libtest/lib571.c @@ -52,7 +52,7 @@ static const char *RTP_DATA = "$_1234\n\0Rsdf"; static int rtp_packet_count = 0; -static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream) +static size_t rtp_write(char *ptr, size_t size, size_t nmemb, void *stream) { char *data = (char *)ptr; int channel = RTP_PKT_CHANNEL(data); @@ -100,9 +100,9 @@ static char *suburl(const char *base, int i) return curl_maprintf("%s%.4d", base, i); } -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; char *stream_uri = NULL; int request = 1; diff --git a/deps/curl/tests/libtest/lib572.c b/deps/curl/tests/libtest/lib572.c index b199c489..f28b741b 100644 --- a/deps/curl/tests/libtest/lib572.c +++ b/deps/curl/tests/libtest/lib572.c @@ -41,9 +41,9 @@ static char *suburl(const char *base, int i) /* * Test GET_PARAMETER: PUT, HEARTBEAT, and POST */ -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; int params; FILE *paramsf = NULL; diff --git a/deps/curl/tests/libtest/lib573.c b/deps/curl/tests/libtest/lib573.c index af140e2d..04bc9ded 100644 --- a/deps/curl/tests/libtest/lib573.c +++ b/deps/curl/tests/libtest/lib573.c @@ -34,11 +34,11 @@ * Get a single URL without select(). */ -int test(char *URL) +CURLcode test(char *URL) { CURL *c = NULL; CURLM *m = NULL; - int res = 0; + CURLcode res = CURLE_OK; int running = 1; double connect_time = 0.0; double dbl_epsilon; diff --git a/deps/curl/tests/libtest/lib574.c b/deps/curl/tests/libtest/lib574.c index 79a9b167..0d107ef1 100644 --- a/deps/curl/tests/libtest/lib574.c +++ b/deps/curl/tests/libtest/lib574.c @@ -31,14 +31,14 @@ static int new_fnmatch(void *ptr, const char *pattern, const char *string) { (void)ptr; - (void)pattern; - (void)string; + fprintf(stderr, "lib574: match string '%s' against pattern '%s'\n", + string, pattern); return CURL_FNMATCHFUNC_MATCH; } -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; CURL *curl; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { diff --git a/deps/curl/tests/libtest/lib575.c b/deps/curl/tests/libtest/lib575.c index 1de6e328..d64f70d7 100644 --- a/deps/curl/tests/libtest/lib575.c +++ b/deps/curl/tests/libtest/lib575.c @@ -37,12 +37,12 @@ * 3. with multi interface */ -int test(char *URL) +CURLcode test(char *URL) { CURL *handle = NULL; CURL *duphandle = NULL; CURLM *mhandle = NULL; - int res = 0; + CURLcode res = CURLE_OK; int still_running = 0; start_test_timing(); diff --git a/deps/curl/tests/libtest/lib576.c b/deps/curl/tests/libtest/lib576.c index 7bc47508..db5a41aa 100644 --- a/deps/curl/tests/libtest/lib576.c +++ b/deps/curl/tests/libtest/lib576.c @@ -32,8 +32,9 @@ struct chunk_data { }; static -long chunk_bgn(const struct curl_fileinfo *finfo, void *ptr, int remains) +long chunk_bgn(const void *f, void *ptr, int remains) { + const struct curl_fileinfo *finfo = f; struct chunk_data *ch_d = ptr; ch_d->remains = remains; @@ -94,7 +95,7 @@ long chunk_end(void *ptr) return CURL_CHUNK_END_FUNC_OK; } -int test(char *URL) +CURLcode test(char *URL) { CURL *handle = NULL; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib578.c b/deps/curl/tests/libtest/lib578.c index 7c6af994..6be64a1a 100644 --- a/deps/curl/tests/libtest/lib578.c +++ b/deps/curl/tests/libtest/lib578.c @@ -26,9 +26,9 @@ #include "memdebug.h" /* The size of data should be kept below MAX_INITIAL_POST_SIZE! */ -static char data[]="this is a short string.\n"; +static char testdata[]="this is a short string.\n"; -static size_t data_size = sizeof(data) / sizeof(char); +static size_t data_size = sizeof(testdata) / sizeof(char); static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) @@ -50,7 +50,7 @@ static int progress_callback(void *clientp, double dltotal, double dlnow, return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -75,7 +75,7 @@ int test(char *URL) /* Set the expected POST size */ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)data_size); - test_setopt(curl, CURLOPT_POSTFIELDS, data); + test_setopt(curl, CURLOPT_POSTFIELDS, testdata); /* we want to use our own progress function */ CURL_IGNORE_DEPRECATION( diff --git a/deps/curl/tests/libtest/lib579.c b/deps/curl/tests/libtest/lib579.c index 5f962179..9b1591fa 100644 --- a/deps/curl/tests/libtest/lib579.c +++ b/deps/curl/tests/libtest/lib579.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static const char * const post[]={ +static const char * const testpost[]={ "one", "two", "three", @@ -38,31 +38,38 @@ struct WriteThis { int counter; }; +static bool started = FALSE; +static size_t last_ul = 0; +static size_t last_ul_total = 0; + +static void progress_final_report(void) +{ + FILE *moo = fopen(libtest_arg2, "ab"); + fprintf(moo, "Progress: end UL %zu/%zu\n", last_ul, last_ul_total); + started = FALSE; + fclose(moo); +} + static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { - static int prev_ultotal = -1; - static int prev_ulnow = -1; (void)clientp; /* UNUSED */ (void)dltotal; /* UNUSED */ (void)dlnow; /* UNUSED */ - /* to avoid depending on timing, which will cause this progress function to - get called a different number of times depending on circumstances, we - only log these lines if the numbers are different from the previous - invoke */ - if((prev_ultotal != (int)ultotal) || - (prev_ulnow != (int)ulnow)) { - - FILE *moo = fopen(libtest_arg2, "ab"); - if(moo) { - fprintf(moo, "Progress callback called with UL %d out of %d\n", - (int)ulnow, (int)ultotal); - fclose(moo); - } - prev_ulnow = (int) ulnow; - prev_ultotal = (int) ultotal; + if(started && ulnow <= 0.0 && last_ul) { + progress_final_report(); } + + last_ul = (size_t)ulnow; + last_ul_total = (size_t)ultotal; + if(!started) { + FILE *moo = fopen(libtest_arg2, "ab"); + fprintf(moo, "Progress: start UL %zu/%zu\n", last_ul, last_ul_total); + started = TRUE; + fclose(moo); + } + return 0; } @@ -74,7 +81,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) if(size*nmemb < 1) return 0; - data = post[pooh->counter]; + data = testpost[pooh->counter]; if(data) { size_t len = strlen(data); @@ -85,7 +92,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -146,6 +153,8 @@ int test(char *URL) /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); + progress_final_report(); + test_cleanup: /* clean up the headers list */ diff --git a/deps/curl/tests/libtest/lib582.c b/deps/curl/tests/libtest/lib582.c index 8fe6402a..d1609a83 100644 --- a/deps/curl/tests/libtest/lib582.c +++ b/deps/curl/tests/libtest/lib582.c @@ -31,15 +31,13 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -struct Sockets -{ +struct Sockets { curl_socket_t *sockets; int count; /* number of sockets actually stored in array */ int max_count; /* max number of sockets that fit in allocated array */ }; -struct ReadWriteSockets -{ +struct ReadWriteSockets { struct Sockets read, write; }; @@ -220,9 +218,9 @@ static void checkFdSet(CURLM *curl, struct Sockets *sockets, fd_set *fdset, } } -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; CURL *curl = NULL; FILE *hd_src = NULL; int hd; diff --git a/deps/curl/tests/libtest/lib583.c b/deps/curl/tests/libtest/lib583.c index ba44b5d2..0ccf5c65 100644 --- a/deps/curl/tests/libtest/lib583.c +++ b/deps/curl/tests/libtest/lib583.c @@ -32,7 +32,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { int stillRunning; CURLM *multiHandle = NULL; @@ -87,5 +87,5 @@ test_cleanup: curl_multi_cleanup(multiHandle); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib586.c b/deps/curl/tests/libtest/lib586.c index f6e60773..c6d9f7d7 100644 --- a/deps/curl/tests/libtest/lib586.c +++ b/deps/curl/tests/libtest/lib586.c @@ -38,8 +38,8 @@ struct userdata { }; /* lock callback */ -static void my_lock(CURL *handle, curl_lock_data data, - curl_lock_access laccess, void *useptr) +static void test_lock(CURL *handle, curl_lock_data data, + curl_lock_access laccess, void *useptr) { const char *what; struct userdata *user = (struct userdata *)useptr; @@ -69,7 +69,7 @@ static void my_lock(CURL *handle, curl_lock_data data, } /* unlock callback */ -static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) +static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) { const char *what; struct userdata *user = (struct userdata *)useptr; @@ -96,7 +96,7 @@ static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) } /* the dummy thread function */ -static void *fire(void *ptr) +static void *test_fire(void *ptr) { CURLcode code; struct Tdata *tdata = (struct Tdata*)ptr; @@ -129,7 +129,7 @@ static void *fire(void *ptr) } /* test function */ -int test(char *URL) +CURLcode test(char *URL) { CURLcode res = CURLE_OK; CURLSHcode scode = CURLSHE_OK; @@ -160,11 +160,11 @@ int test(char *URL) if(CURLSHE_OK == scode) { printf("CURLSHOPT_LOCKFUNC\n"); - scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); + scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); } if(CURLSHE_OK == scode) { printf("CURLSHOPT_UNLOCKFUNC\n"); - scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); + scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); } if(CURLSHE_OK == scode) { printf("CURLSHOPT_USERDATA\n"); @@ -193,11 +193,11 @@ int test(char *URL) /* simulate thread, direct call of "thread" function */ printf("*** run %d\n",i); - fire(&tdata); + test_fire(&tdata); } - /* fetch a another one */ + /* fetch another one */ printf("*** run %d\n", i); curl = curl_easy_init(); if(!curl) { diff --git a/deps/curl/tests/libtest/lib589.c b/deps/curl/tests/libtest/lib589.c index 3a17e31c..eb800f85 100644 --- a/deps/curl/tests/libtest/lib589.c +++ b/deps/curl/tests/libtest/lib589.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -72,5 +72,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib590.c b/deps/curl/tests/libtest/lib590.c index babcd195..cda3b029 100644 --- a/deps/curl/tests/libtest/lib590.c +++ b/deps/curl/tests/libtest/lib590.c @@ -38,7 +38,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -69,5 +69,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib591.c b/deps/curl/tests/libtest/lib591.c index 445bb0a9..742baf20 100644 --- a/deps/curl/tests/libtest/lib591.c +++ b/deps/curl/tests/libtest/lib591.c @@ -35,11 +35,11 @@ #define TEST_HANG_TIMEOUT 60 * 1000 -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; CURLM *multi = NULL; - int res = 0; + CURLcode res = CURLE_OK; int running; int msgs_left; CURLMsg *msg; diff --git a/deps/curl/tests/libtest/lib597.c b/deps/curl/tests/libtest/lib597.c index 77ab8941..71535b04 100644 --- a/deps/curl/tests/libtest/lib597.c +++ b/deps/curl/tests/libtest/lib597.c @@ -40,11 +40,11 @@ * with function curl_multi_info_read(). */ -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; CURLM *multi = NULL; - int res = 0; + CURLcode res = CURLE_OK; int running; int msgs_left; CURLMsg *msg; diff --git a/deps/curl/tests/libtest/lib598.c b/deps/curl/tests/libtest/lib598.c index 62b36551..8c67076b 100644 --- a/deps/curl/tests/libtest/lib598.c +++ b/deps/curl/tests/libtest/lib598.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -70,5 +70,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib599.c b/deps/curl/tests/libtest/lib599.c index 6002e0fb..391b9f2d 100644 --- a/deps/curl/tests/libtest/lib599.c +++ b/deps/curl/tests/libtest/lib599.c @@ -41,7 +41,7 @@ static int progress_callback(void *clientp, double dltotal, return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib643.c b/deps/curl/tests/libtest/lib643.c index efd508f8..bd7f5e0f 100644 --- a/deps/curl/tests/libtest/lib643.c +++ b/deps/curl/tests/libtest/lib643.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static char data[]= +static char testdata[]= "dummy\n"; struct WriteThis { @@ -56,7 +56,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -static int once(char *URL, bool oldstyle) +static CURLcode test_once(char *URL, bool oldstyle) { CURL *curl; CURLcode res = CURLE_OK; @@ -67,9 +67,9 @@ static int once(char *URL, bool oldstyle) struct WriteThis pooh2; curl_off_t datasize = -1; - pooh.readptr = data; + pooh.readptr = testdata; #ifndef LIB645 - datasize = (curl_off_t)strlen(data); + datasize = (curl_off_t)strlen(testdata); #endif pooh.sizeleft = datasize; @@ -122,9 +122,9 @@ static int once(char *URL, bool oldstyle) /* Now add the same data with another name and make it not look like a file upload but still using the callback */ - pooh2.readptr = data; + pooh2.readptr = testdata; #ifndef LIB645 - datasize = (curl_off_t)strlen(data); + datasize = (curl_off_t)strlen(testdata); #endif pooh2.sizeleft = datasize; @@ -223,7 +223,7 @@ test_cleanup: return res; } -static int cyclic_add(void) +static CURLcode cyclic_add(void) { CURL *easy = curl_easy_init(); curl_mime *mime = curl_mime_init(easy); @@ -242,23 +242,23 @@ static int cyclic_add(void) curl_easy_cleanup(easy); if(a1 != CURLE_BAD_FUNCTION_ARGUMENT) /* that should have failed */ - return 1; + return (CURLcode)1; - return 0; + return CURLE_OK; } -int test(char *URL) +CURLcode test(char *URL) { - int res; + CURLcode res; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); return TEST_ERR_MAJOR_BAD; } - res = once(URL, TRUE); /* old */ + res = test_once(URL, TRUE); /* old */ if(!res) - res = once(URL, FALSE); /* new */ + res = test_once(URL, FALSE); /* new */ if(!res) res = cyclic_add(); diff --git a/deps/curl/tests/libtest/lib650.c b/deps/curl/tests/libtest/lib650.c index 14c79e94..f0d459e6 100644 --- a/deps/curl/tests/libtest/lib650.c +++ b/deps/curl/tests/libtest/lib650.c @@ -21,15 +21,14 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */ #include "test.h" #include "memdebug.h" -static char data[] = +static char testdata[] = "this is what we post to the silly web server"; -static const char name[] = "fieldname"; +static const char testname[] = "fieldname"; /* This test attempts to use all form API features that are not @@ -47,7 +46,7 @@ static size_t count_chars(void *userp, const char *buf, size_t len) } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = TEST_ERR_MAJOR_BAD; @@ -80,34 +79,36 @@ int test(char *URL) goto test_cleanup; } headers = headers2; - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, &name, - CURLFORM_COPYCONTENTS, &data, - CURLFORM_CONTENTHEADER, headers, - CURLFORM_END); - + CURL_IGNORE_DEPRECATION( + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, &testname, + CURLFORM_COPYCONTENTS, &testdata, + CURLFORM_CONTENTHEADER, headers, + CURLFORM_END); + ) if(formrc) { printf("curl_formadd(1) = %d\n", (int) formrc); goto test_cleanup; } - contentlength = (long)(strlen(data) - 1); - - /* Use a form array for the non-copy test. */ - formarray[0].option = CURLFORM_PTRCONTENTS; - formarray[0].value = data; - formarray[1].option = CURLFORM_CONTENTSLENGTH; - formarray[1].value = (char *)(size_t)contentlength; - formarray[2].option = CURLFORM_END; - formarray[2].value = NULL; - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_PTRNAME, name, - CURLFORM_NAMELENGTH, strlen(name) - 1, - CURLFORM_ARRAY, formarray, - CURLFORM_FILENAME, "remotefile.txt", - CURLFORM_END); + contentlength = (long)(strlen(testdata) - 1); + CURL_IGNORE_DEPRECATION( + /* Use a form array for the non-copy test. */ + formarray[0].option = CURLFORM_PTRCONTENTS; + formarray[0].value = testdata; + formarray[1].option = CURLFORM_CONTENTSLENGTH; + formarray[1].value = (char *)(size_t)contentlength; + formarray[2].option = CURLFORM_END; + formarray[2].value = NULL; + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_PTRNAME, testname, + CURLFORM_NAMELENGTH, strlen(testname) - 1, + CURLFORM_ARRAY, formarray, + CURLFORM_FILENAME, "remotefile.txt", + CURLFORM_END); + ) if(formrc) { printf("curl_formadd(2) = %d\n", (int) formrc); goto test_cleanup; @@ -116,59 +117,67 @@ int test(char *URL) /* Now change in-memory data to affect CURLOPT_PTRCONTENTS value. Copied values (first field) must not be affected. CURLOPT_PTRNAME actually copies the name thus we do not test this here. */ - data[0]++; - - /* Check multi-files and content type propagation. */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "multifile", - CURLFORM_FILE, libtest_arg2, /* Set in first.c. */ - CURLFORM_FILE, libtest_arg2, - CURLFORM_CONTENTTYPE, "text/whatever", - CURLFORM_FILE, libtest_arg2, - CURLFORM_END); + testdata[0]++; + CURL_IGNORE_DEPRECATION( + /* Check multi-files and content type propagation. */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "multifile", + CURLFORM_FILE, libtest_arg2, /* Set in first.c. */ + CURLFORM_FILE, libtest_arg2, + CURLFORM_CONTENTTYPE, "text/whatever", + CURLFORM_FILE, libtest_arg2, + CURLFORM_END); + ) if(formrc) { printf("curl_formadd(3) = %d\n", (int) formrc); goto test_cleanup; } - /* Check data from file content. */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "filecontents", - CURLFORM_FILECONTENT, libtest_arg2, - CURLFORM_END); - + CURL_IGNORE_DEPRECATION( + /* Check data from file content. */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "filecontents", + CURLFORM_FILECONTENT, libtest_arg2, + CURLFORM_END); + ) if(formrc) { printf("curl_formadd(4) = %d\n", (int) formrc); goto test_cleanup; } - /* Measure the current form length. - * 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_IGNORE_DEPRECATION( + /* Measure the current form length. + * 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); + ) /* Include length in data for external check. */ curl_msnprintf(flbuf, sizeof(flbuf), "%lu", (unsigned long) formlength); - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "formlength", - CURLFORM_COPYCONTENTS, &flbuf, - CURLFORM_END); + CURL_IGNORE_DEPRECATION( + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "formlength", + CURLFORM_COPYCONTENTS, &flbuf, + CURLFORM_END); + ) if(formrc) { printf("curl_formadd(5) = %d\n", (int) formrc); goto test_cleanup; } - /* Check stdin (may be problematic on some platforms). */ - formrc = curl_formadd(&formpost, - &lastptr, - CURLFORM_COPYNAME, "standardinput", - CURLFORM_FILE, "-", - CURLFORM_END); + CURL_IGNORE_DEPRECATION( + /* Check stdin (may be problematic on some platforms). */ + formrc = curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, "standardinput", + CURLFORM_FILE, "-", + CURLFORM_END); + ) if(formrc) { printf("curl_formadd(6) = %d\n", (int) formrc); goto test_cleanup; @@ -183,8 +192,10 @@ int test(char *URL) /* First set the URL that is about to receive our POST. */ test_setopt(curl, CURLOPT_URL, URL); - /* send a multi-part formpost */ - test_setopt(curl, CURLOPT_HTTPPOST, formpost); + CURL_IGNORE_DEPRECATION( + /* send a multi-part formpost */ + test_setopt(curl, CURLOPT_HTTPPOST, formpost); + ) /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -203,8 +214,10 @@ test_cleanup: /* always cleanup */ curl_easy_cleanup(curl); - /* now cleanup the formpost chain */ - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + /* now cleanup the formpost chain */ + curl_formfree(formpost); + ) curl_slist_free_all(headers); curl_global_cleanup(); diff --git a/deps/curl/tests/libtest/lib651.c b/deps/curl/tests/libtest/lib651.c index 2e45ccc2..7fb97def 100644 --- a/deps/curl/tests/libtest/lib651.c +++ b/deps/curl/tests/libtest/lib651.c @@ -21,14 +21,13 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */ #include "test.h" #include "memdebug.h" -static char buffer[17000]; /* more than 16K */ +static char testbuf[17000]; /* more than 16K */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -38,24 +37,25 @@ int test(char *URL) /* create a buffer with AAAA...BBBBB...CCCC...etc */ int i; - int size = (int)sizeof(buffer)/1000; + int size = (int)sizeof(testbuf)/1000; for(i = 0; i < size ; i++) - memset(&buffer[i * 1000], 65 + i, 1000); + memset(&testbuf[i * 1000], 65 + i, 1000); - buffer[ sizeof(buffer)-1] = 0; /* null-terminate */ + testbuf[sizeof(testbuf)-1] = 0; /* null-terminate */ if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); return TEST_ERR_MAJOR_BAD; } - /* Check proper name and data copying. */ - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, "hello", - CURLFORM_COPYCONTENTS, buffer, - CURLFORM_END); - + CURL_IGNORE_DEPRECATION( + /* Check proper name and data copying. */ + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "hello", + CURLFORM_COPYCONTENTS, testbuf, + CURLFORM_END); + ) if(formrc) printf("curl_formadd(1) = %d\n", (int) formrc); @@ -63,7 +63,9 @@ int test(char *URL) curl = curl_easy_init(); if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + curl_formfree(formpost); + ) curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } @@ -71,8 +73,10 @@ int test(char *URL) /* First set the URL that is about to receive our POST. */ test_setopt(curl, CURLOPT_URL, URL); - /* send a multi-part formpost */ - test_setopt(curl, CURLOPT_HTTPPOST, formpost); + CURL_IGNORE_DEPRECATION( + /* send a multi-part formpost */ + test_setopt(curl, CURLOPT_HTTPPOST, formpost); + ) /* get verbose debug output please */ test_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -88,8 +92,10 @@ test_cleanup: /* always cleanup */ curl_easy_cleanup(curl); - /* now cleanup the formpost chain */ - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + /* now cleanup the formpost chain */ + curl_formfree(formpost); + ) curl_global_cleanup(); diff --git a/deps/curl/tests/libtest/lib652.c b/deps/curl/tests/libtest/lib652.c index 7a100b73..591aa726 100644 --- a/deps/curl/tests/libtest/lib652.c +++ b/deps/curl/tests/libtest/lib652.c @@ -25,9 +25,9 @@ #include "memdebug.h" -static char buffer[17000]; /* more than 16K */ +static char testbuf[17000]; /* more than 16K */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_OK; @@ -35,12 +35,12 @@ int test(char *URL) curl_mimepart *part; struct curl_slist *recipients = NULL; - /* create a buffer with AAAA...BBBBB...CCCC...etc */ + /* create a testbuf with AAAA...BBBBB...CCCC...etc */ int i; - int size = (int)sizeof(buffer) / 10; + int size = (int)sizeof(testbuf) / 10; for(i = 0; i < size ; i++) - memset(&buffer[i * 10], 65 + (i % 26), 10); + memset(&testbuf[i * 10], 65 + (i % 26), 10); if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); @@ -50,7 +50,7 @@ int test(char *URL) curl = curl_easy_init(); if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); - res = (CURLcode) TEST_ERR_MAJOR_BAD; + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -58,13 +58,13 @@ int test(char *URL) mime = curl_mime_init(curl); if(!mime) { fprintf(stderr, "curl_mime_init() failed\n"); - res = (CURLcode) TEST_ERR_MAJOR_BAD; + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } part = curl_mime_addpart(mime); if(!part) { fprintf(stderr, "curl_mime_addpart() failed\n"); - res = (CURLcode) TEST_ERR_MAJOR_BAD; + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } res = curl_mime_filename(part, "myfile.jpg"); @@ -77,7 +77,7 @@ int test(char *URL) fprintf(stderr, "curl_mime_type() failed\n"); goto test_cleanup; } - res = curl_mime_data(part, buffer, sizeof(buffer)); + res = curl_mime_data(part, testbuf, sizeof(testbuf)); if(res) { fprintf(stderr, "curl_mime_data() failed\n"); goto test_cleanup; diff --git a/deps/curl/tests/libtest/lib653.c b/deps/curl/tests/libtest/lib653.c index 8a6fff34..a1be0df1 100644 --- a/deps/curl/tests/libtest/lib653.c +++ b/deps/curl/tests/libtest/lib653.c @@ -28,10 +28,10 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURL *curls = NULL; - int res = 0; + CURLcode res = CURLE_OK; curl_mimepart *field = NULL; curl_mime *mime = NULL; @@ -61,5 +61,5 @@ test_cleanup: curl_mime_free(mime); curl_easy_cleanup(curls); curl_global_cleanup(); - return (int) res; /* return the final return code */ + return res; /* return the final return code */ } diff --git a/deps/curl/tests/libtest/lib654.c b/deps/curl/tests/libtest/lib654.c index 96551637..66ec29d1 100644 --- a/deps/curl/tests/libtest/lib654.c +++ b/deps/curl/tests/libtest/lib654.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static char data[]= +static char testdata[]= "dummy\n"; struct WriteThis { @@ -62,15 +62,14 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; CURL *easy2 = NULL; curl_mime *mime = NULL; curl_mimepart *part; struct curl_slist *hdrs = NULL; - CURLcode result; - int res = TEST_ERR_FAILURE; + CURLcode res = TEST_ERR_FAILURE; struct WriteThis pooh; /* @@ -95,8 +94,8 @@ int test(char *URL) test_setopt(easy, CURLOPT_HEADER, 1L); /* Prepare the callback structure. */ - pooh.readptr = data; - pooh.sizeleft = (curl_off_t) strlen(data); + pooh.readptr = testdata; + pooh.sizeleft = (curl_off_t) strlen(testdata); pooh.freecount = 0; /* Build the mime tree. */ @@ -131,19 +130,17 @@ int test(char *URL) mime = NULL; /* Already cleaned up. */ /* Perform on the first handle: should not send any data. */ - result = curl_easy_perform(easy); - if(result) { + res = curl_easy_perform(easy); + if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform(original) failed\n"); - res = (int) result; goto test_cleanup; } /* Perform on the second handle: if the bound mime structure has not been duplicated properly, it should cause a valgrind error. */ - result = curl_easy_perform(easy2); - if(result) { + res = curl_easy_perform(easy2); + if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform(duplicated) failed\n"); - res = (int) result; goto test_cleanup; } diff --git a/deps/curl/tests/libtest/lib655.c b/deps/curl/tests/libtest/lib655.c index 83525e57..79654cb0 100644 --- a/deps/curl/tests/libtest/lib655.c +++ b/deps/curl/tests/libtest/lib655.c @@ -58,7 +58,7 @@ resolver_alloc_cb_pass(void *resolver_state, void *reserved, void *userdata) return 0; } -int test(char *URL) +CURLcode test(char *URL) { CURL *curl; CURLcode res = CURLE_OK; @@ -110,5 +110,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib658.c b/deps/curl/tests/libtest/lib658.c index 5be239f6..59d947e2 100644 --- a/deps/curl/tests/libtest/lib658.c +++ b/deps/curl/tests/libtest/lib658.c @@ -31,7 +31,7 @@ * Get a single URL without select(). */ -int test(char *URL) +CURLcode test(char *URL) { CURL *handle = NULL; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib659.c b/deps/curl/tests/libtest/lib659.c index 97efbec6..bdd879b0 100644 --- a/deps/curl/tests/libtest/lib659.c +++ b/deps/curl/tests/libtest/lib659.c @@ -31,7 +31,7 @@ * Get a single URL without select(). */ -int test(char *URL) +CURLcode test(char *URL) { CURL *handle = NULL; CURLcode res = CURLE_OK; diff --git a/deps/curl/tests/libtest/lib661.c b/deps/curl/tests/libtest/lib661.c index 5145937a..10df4988 100644 --- a/deps/curl/tests/libtest/lib661.c +++ b/deps/curl/tests/libtest/lib661.c @@ -24,7 +24,7 @@ #include "test.h" #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl = NULL; @@ -164,5 +164,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib666.c b/deps/curl/tests/libtest/lib666.c index 62590702..dd172be4 100644 --- a/deps/curl/tests/libtest/lib666.c +++ b/deps/curl/tests/libtest/lib666.c @@ -25,9 +25,9 @@ #include "memdebug.h" -static char buffer[17000]; /* more than 16K */ +static char testbuf[17000]; /* more than 16K */ -int test(char *URL) +CURLcode test(char *URL) { CURL *curl = NULL; CURLcode res = CURLE_OK; @@ -37,12 +37,12 @@ int test(char *URL) /* Checks huge binary-encoded mime post. */ - /* Create a buffer with pseudo-binary data. */ - for(i = 0; i < sizeof(buffer); i++) + /* Create a testbuf with pseudo-binary data. */ + for(i = 0; i < sizeof(testbuf); i++) if(i % 77 == 76) - buffer[i] = '\n'; + testbuf[i] = '\n'; else - buffer[i] = (char) (0x41 + i % 26); /* A...Z */ + testbuf[i] = (char) (0x41 + i % 26); /* A...Z */ if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); @@ -52,7 +52,7 @@ int test(char *URL) curl = curl_easy_init(); if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); - res = (CURLcode) TEST_ERR_MAJOR_BAD; + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } @@ -60,13 +60,13 @@ int test(char *URL) mime = curl_mime_init(curl); if(!mime) { fprintf(stderr, "curl_mime_init() failed\n"); - res = (CURLcode) TEST_ERR_MAJOR_BAD; + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } part = curl_mime_addpart(mime); if(!part) { fprintf(stderr, "curl_mime_addpart() failed\n"); - res = (CURLcode) TEST_ERR_MAJOR_BAD; + res = TEST_ERR_MAJOR_BAD; goto test_cleanup; } res = curl_mime_name(part, "upfile"); @@ -79,7 +79,7 @@ int test(char *URL) fprintf(stderr, "curl_mime_filename() failed\n"); goto test_cleanup; } - res = curl_mime_data(part, buffer, sizeof(buffer)); + res = curl_mime_data(part, testbuf, sizeof(testbuf)); if(res) { fprintf(stderr, "curl_mime_data() failed\n"); goto test_cleanup; diff --git a/deps/curl/tests/libtest/lib667.c b/deps/curl/tests/libtest/lib667.c index 076361ad..d1906014 100644 --- a/deps/curl/tests/libtest/lib667.c +++ b/deps/curl/tests/libtest/lib667.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static char data[]= +static char testdata[]= "dummy"; struct WriteThis { @@ -54,13 +54,12 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return 0; /* no more data left to deliver */ } -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; curl_mime *mime = NULL; curl_mimepart *part; - CURLcode result; - int res = TEST_ERR_FAILURE; + CURLcode res = TEST_ERR_FAILURE; struct WriteThis pooh; /* @@ -85,8 +84,8 @@ int test(char *URL) test_setopt(easy, CURLOPT_HEADER, 1L); /* Prepare the callback structure. */ - pooh.readptr = data; - pooh.sizeleft = (curl_off_t) strlen(data); + pooh.readptr = testdata; + pooh.sizeleft = (curl_off_t) strlen(testdata); /* Build the mime tree. */ mime = curl_mime_init(easy); @@ -100,10 +99,9 @@ int test(char *URL) test_setopt(easy, CURLOPT_MIMEPOST, mime); /* Send data. */ - result = curl_easy_perform(easy); - if(result) { + res = curl_easy_perform(easy); + if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed\n"); - res = (int) result; } test_cleanup: diff --git a/deps/curl/tests/libtest/lib668.c b/deps/curl/tests/libtest/lib668.c index 35ab758f..141e0ea5 100644 --- a/deps/curl/tests/libtest/lib668.c +++ b/deps/curl/tests/libtest/lib668.c @@ -25,7 +25,7 @@ #include "memdebug.h" -static char data[]= "dummy"; +static char testdata[]= "dummy"; struct WriteThis { char *readptr; @@ -48,13 +48,12 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return len; } -int test(char *URL) +CURLcode test(char *URL) { CURL *easy = NULL; curl_mime *mime = NULL; curl_mimepart *part; - CURLcode result; - int res = TEST_ERR_FAILURE; + CURLcode res = TEST_ERR_FAILURE; struct WriteThis pooh1, pooh2; /* @@ -78,8 +77,8 @@ int test(char *URL) test_setopt(easy, CURLOPT_HEADER, 1L); /* Prepare the callback structures. */ - pooh1.readptr = data; - pooh1.sizeleft = (curl_off_t) strlen(data); + pooh1.readptr = testdata; + pooh1.sizeleft = (curl_off_t) strlen(testdata); pooh2 = pooh1; /* Build the mime tree. */ @@ -87,7 +86,7 @@ int test(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(data), + curl_mime_data_cb(part, (curl_off_t) strlen(testdata), read_callback, NULL, NULL, &pooh1); part = curl_mime_addpart(mime); curl_mime_name(part, "field2"); @@ -104,10 +103,9 @@ int test(char *URL) test_setopt(easy, CURLOPT_MIMEPOST, mime); /* Send data. */ - result = curl_easy_perform(easy); - if(result) { + res = curl_easy_perform(easy); + if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed\n"); - res = (int) result; } test_cleanup: diff --git a/deps/curl/tests/libtest/lib670.c b/deps/curl/tests/libtest/lib670.c index b348343c..e03e8abe 100644 --- a/deps/curl/tests/libtest/lib670.c +++ b/deps/curl/tests/libtest/lib670.c @@ -21,11 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - -#if !defined(LIB670) && !defined(LIB671) -#define CURL_DISABLE_DEPRECATION /* Using and testing the form api */ -#endif - #include "test.h" #include @@ -35,7 +30,7 @@ #define PAUSE_TIME 5 -static const char name[] = "field"; +static const char testname[] = "field"; struct ReadThis { CURL *easy; @@ -61,7 +56,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) return CURL_READFUNC_PAUSE; case 2: delta = time(NULL) - pooh->origin; - *ptr = delta >= PAUSE_TIME? '\x42': '\x41'; /* ASCII A or B. */ + *ptr = delta >= PAUSE_TIME ? '\x42' : '\x41'; /* ASCII A or B. */ return 1; case 3: return 0; @@ -97,7 +92,7 @@ static int xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow, } #endif -int test(char *URL) +CURLcode test(char *URL) { #if defined(LIB670) || defined(LIB671) curl_mime *mime = NULL; @@ -116,8 +111,7 @@ int test(char *URL) #endif struct ReadThis pooh; - CURLcode result; - int res = TEST_ERR_FAILURE; + CURLcode res = TEST_ERR_FAILURE; /* * Check proper pausing/unpausing from a mime or form read callback. @@ -145,11 +139,11 @@ int test(char *URL) /* Build the mime tree. */ mime = curl_mime_init(pooh.easy); part = curl_mime_addpart(mime); - result = curl_mime_name(part, name); - if(result) { + res = curl_mime_name(part, testname); + if(res != CURLE_OK) { fprintf(stderr, "Something went wrong when building the mime structure: %d\n", - (int) result); + res); goto test_cleanup; } @@ -157,15 +151,17 @@ int test(char *URL) NULL, NULL, &pooh); /* Bind mime data to its easy handle. */ - if(!res) + if(res == CURLE_OK) test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime); #else - /* Build the form. */ - formrc = curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, name, - CURLFORM_STREAM, &pooh, - CURLFORM_CONTENTLEN, (curl_off_t) 2, - CURLFORM_END); + CURL_IGNORE_DEPRECATION( + /* Build the form. */ + formrc = curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, testname, + CURLFORM_STREAM, &pooh, + CURLFORM_CONTENTLEN, (curl_off_t) 2, + CURLFORM_END); + ) if(formrc) { fprintf(stderr, "curl_formadd() = %d\n", (int) formrc); goto test_cleanup; @@ -174,8 +170,10 @@ int test(char *URL) /* We want to use our own read function. */ test_setopt(pooh.easy, CURLOPT_READFUNCTION, read_callback); - /* Send a multi-part formpost. */ - test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost); + CURL_IGNORE_DEPRECATION( + /* Send a multi-part formpost. */ + test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost); + ) #endif #if defined(LIB670) || defined(LIB672) @@ -233,8 +231,7 @@ int test(char *URL) if(!msg) break; if(msg->msg == CURLMSG_DONE) { - result = msg->data.result; - res = (int) result; + res = msg->data.result; } } @@ -246,8 +243,7 @@ int test(char *URL) test_setopt(pooh.easy, CURLOPT_XFERINFODATA, &pooh); test_setopt(pooh.easy, CURLOPT_XFERINFOFUNCTION, xferinfo); test_setopt(pooh.easy, CURLOPT_NOPROGRESS, 0L); - result = curl_easy_perform(pooh.easy); - res = (int) result; + res = curl_easy_perform(pooh.easy); #endif @@ -256,7 +252,9 @@ test_cleanup: #if defined(LIB670) || defined(LIB671) curl_mime_free(mime); #else - curl_formfree(formpost); + CURL_IGNORE_DEPRECATION( + curl_formfree(formpost); + ) #endif curl_global_cleanup(); diff --git a/deps/curl/tests/libtest/lib674.c b/deps/curl/tests/libtest/lib674.c index 1a01d9c1..39e16e0f 100644 --- a/deps/curl/tests/libtest/lib674.c +++ b/deps/curl/tests/libtest/lib674.c @@ -31,7 +31,7 @@ * Get a single URL without select(). */ -int test(char *URL) +CURLcode test(char *URL) { CURL *handle = NULL; CURL *handle2; diff --git a/deps/curl/tests/libtest/lib676.c b/deps/curl/tests/libtest/lib676.c index 478d5f3a..fc292705 100644 --- a/deps/curl/tests/libtest/lib676.c +++ b/deps/curl/tests/libtest/lib676.c @@ -25,7 +25,7 @@ #include "memdebug.h" -int test(char *URL) +CURLcode test(char *URL) { CURLcode res; CURL *curl; @@ -66,5 +66,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/lib677.c b/deps/curl/tests/libtest/lib677.c index 6dc7e8e1..ebb9f408 100644 --- a/deps/curl/tests/libtest/lib677.c +++ b/deps/curl/tests/libtest/lib677.c @@ -27,10 +27,10 @@ #include "warnless.h" #include "memdebug.h" -static const char cmd[] = "A1 IDLE\r\n"; -static char buf[1024]; +static const char testcmd[] = "A1 IDLE\r\n"; +static char testbuf[1024]; -int test(char *URL) +CURLcode test(char *URL) { CURLM *mcurl; CURL *curl = NULL; @@ -39,7 +39,7 @@ int test(char *URL) time_t start = time(NULL); int state = 0; ssize_t pos = 0; - int res = 0; + CURLcode res = CURLE_OK; global_init(CURL_GLOBAL_DEFAULT); multi_init(mcurl); @@ -75,15 +75,19 @@ int test(char *URL) curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sock); waitfd.fd = sock; } - curl_multi_wait(mcurl, &waitfd, sock == CURL_SOCKET_BAD ? 0 : 1, 500, + curl_multi_wait(mcurl, &waitfd, sock == CURL_SOCKET_BAD ? 0 : 1, 50, &mrun); if((sock != CURL_SOCKET_BAD) && (waitfd.revents & waitfd.events)) { size_t len = 0; if(!state) { CURLcode ec; - ec = curl_easy_send(curl, cmd + pos, sizeof(cmd) - 1 - pos, &len); - if(ec != CURLE_OK) { + ec = curl_easy_send(curl, testcmd + pos, + sizeof(testcmd) - 1 - pos, &len); + if(ec == CURLE_AGAIN) { + continue; + } + else if(ec) { fprintf(stderr, "curl_easy_send() failed, with code %d (%s)\n", (int)ec, curl_easy_strerror(ec)); res = ec; @@ -93,15 +97,18 @@ int test(char *URL) pos += len; else pos = 0; - if(pos == sizeof(cmd) - 1) { + if(pos == sizeof(testcmd) - 1) { state++; pos = 0; } } - else if(pos < (ssize_t)sizeof(buf)) { + else if(pos < (ssize_t)sizeof(testbuf)) { CURLcode ec; - ec = curl_easy_recv(curl, buf + pos, sizeof(buf) - pos, &len); - if(ec != CURLE_OK) { + ec = curl_easy_recv(curl, testbuf + pos, sizeof(testbuf) - pos, &len); + if(ec == CURLE_AGAIN) { + continue; + } + else if(ec) { fprintf(stderr, "curl_easy_recv() failed, with code %d (%s)\n", (int)ec, curl_easy_strerror(ec)); res = ec; @@ -116,7 +123,7 @@ int test(char *URL) } if(state) { - fwrite(buf, pos, 1, stdout); + fwrite(testbuf, pos, 1, stdout); putchar('\n'); } diff --git a/deps/curl/tests/libtest/lib678.c b/deps/curl/tests/libtest/lib678.c index 942808e2..9a8ab767 100644 --- a/deps/curl/tests/libtest/lib678.c +++ b/deps/curl/tests/libtest/lib678.c @@ -63,7 +63,7 @@ static int loadfile(const char *filename, void **filedata, size_t *filesize) return data ? 1 : 0; } -static int test_cert_blob(const char *url, const char *cafile) +static CURLcode test_cert_blob(const char *url, const char *cafile) { CURLcode code = CURLE_OUT_OF_MEMORY; CURL *curl; @@ -94,12 +94,12 @@ static int test_cert_blob(const char *url, const char *cafile) } curl_easy_cleanup(curl); - return (int)code; + return code; } -int test(char *URL) +CURLcode test(char *URL) { - int res = 0; + CURLcode res = CURLE_OK; curl_global_init(CURL_GLOBAL_DEFAULT); if(!strcmp("check", URL)) { CURL *e; @@ -112,7 +112,7 @@ int test(char *URL) printf("CURLOPT_CAINFO_BLOB is not supported\n"); curl_easy_cleanup(e); } - res = (int)w; + res = w; } else res = test_cert_blob(URL, libtest_arg2); diff --git a/deps/curl/tests/libtest/libauthretry.c b/deps/curl/tests/libtest/libauthretry.c index a71fe20e..db648f35 100644 --- a/deps/curl/tests/libtest/libauthretry.c +++ b/deps/curl/tests/libtest/libauthretry.c @@ -60,13 +60,13 @@ test_cleanup: static CURLcode send_wrong_password(CURL *curl, const char *url, int seq, long auth_scheme) { - return send_request(curl, url, seq, auth_scheme, "testuser:wrongpass"); + return send_request(curl, url, seq, auth_scheme, "testuser:wrongpass"); } static CURLcode send_right_password(CURL *curl, const char *url, int seq, long auth_scheme) { - return send_request(curl, url, seq, auth_scheme, "testuser:testpass"); + return send_request(curl, url, seq, auth_scheme, "testuser:testpass"); } static long parse_auth_name(const char *arg) @@ -82,7 +82,7 @@ static long parse_auth_name(const char *arg) return CURLAUTH_NONE; } -int test(char *url) +CURLcode test(char *url) { CURLcode res; CURL *curl = NULL; @@ -145,5 +145,5 @@ test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); - return (int)res; + return res; } diff --git a/deps/curl/tests/libtest/libntlmconnect.c b/deps/curl/tests/libtest/libntlmconnect.c index 462b5481..9cbcb50b 100644 --- a/deps/curl/tests/libtest/libntlmconnect.c +++ b/deps/curl/tests/libtest/libntlmconnect.c @@ -33,31 +33,31 @@ #define TEST_HANG_TIMEOUT 60 * 1000 #define MAX_EASY_HANDLES 3 -static int counter[MAX_EASY_HANDLES]; -static CURL *easy[MAX_EASY_HANDLES]; -static curl_socket_t sockets[MAX_EASY_HANDLES]; -static int res = 0; +static int ntlm_counter[MAX_EASY_HANDLES]; +static CURL *ntlm_easy[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) - easy; + ssize_t idx = ((CURL **) data) - ntlm_easy; curl_socket_t sock; long longdata; CURLcode code; const size_t failure = (size && nmemb) ? 0 : 1; (void)ptr; - counter[idx] += (int)(size * nmemb); + ntlm_counter[idx] += (int)(size * nmemb); /* Get socket being used for this easy handle, otherwise CURL_SOCKET_BAD */ CURL_IGNORE_DEPRECATION( - code = curl_easy_getinfo(easy[idx], CURLINFO_LASTSOCKET, &longdata); + code = curl_easy_getinfo(ntlm_easy[idx], CURLINFO_LASTSOCKET, &longdata); ) if(CURLE_OK != code) { fprintf(stderr, "%s:%d curl_easy_getinfo() failed, " "with code %d (%s)\n", __FILE__, __LINE__, (int)code, curl_easy_strerror(code)); - res = TEST_ERR_MAJOR_BAD; + ntlmcb_res = TEST_ERR_MAJOR_BAD; return failure; } if(longdata == -1L) @@ -67,16 +67,16 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) if(sock != CURL_SOCKET_BAD) { /* Track relationship between this easy handle and the socket. */ - if(sockets[idx] == CURL_SOCKET_BAD) { + if(ntlm_sockets[idx] == CURL_SOCKET_BAD) { /* An easy handle without previous socket, record the socket. */ - sockets[idx] = sock; + ntlm_sockets[idx] = sock; } - else if(sock != sockets[idx]) { + else if(sock != ntlm_sockets[idx]) { /* An easy handle with a socket different to previously tracked one, log and fail right away. Known bug #37. */ fprintf(stderr, "Handle %d started on socket %d and moved to %d\n", - curlx_sztosi(idx), (int)sockets[idx], (int)sock); - res = TEST_ERR_MAJOR_BAD; + curlx_sztosi(idx), (int)ntlm_sockets[idx], (int)sock); + ntlmcb_res = TEST_ERR_MAJOR_BAD; return failure; } } @@ -89,8 +89,9 @@ enum HandleState { NoMoreHandles }; -int test(char *url) +CURLcode test(char *url) { + CURLcode res = CURLE_OK; CURLM *multi = NULL; int running; int i; @@ -107,8 +108,8 @@ int test(char *url) } for(i = 0; i < MAX_EASY_HANDLES; ++i) { - easy[i] = NULL; - sockets[i] = CURL_SOCKET_BAD; + ntlm_easy[i] = NULL; + ntlm_sockets[i] = CURL_SOCKET_BAD; } res_global_init(CURL_GLOBAL_ALL); @@ -130,28 +131,31 @@ int test(char *url) /* Start a new handle if we aren't at the max */ if(state == ReadyForNewHandle) { - easy_init(easy[num_handles]); + easy_init(ntlm_easy[num_handles]); if(num_handles % 3 == 2) { msnprintf(full_url, urllen, "%s0200", url); - easy_setopt(easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); + easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); } else { msnprintf(full_url, urllen, "%s0100", url); - easy_setopt(easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); } - easy_setopt(easy[num_handles], CURLOPT_FRESH_CONNECT, 1L); - easy_setopt(easy[num_handles], CURLOPT_URL, full_url); - easy_setopt(easy[num_handles], CURLOPT_VERBOSE, 1L); - easy_setopt(easy[num_handles], CURLOPT_HTTPGET, 1L); - easy_setopt(easy[num_handles], CURLOPT_USERPWD, "testuser:testpass"); - easy_setopt(easy[num_handles], CURLOPT_WRITEFUNCTION, callback); - easy_setopt(easy[num_handles], CURLOPT_WRITEDATA, easy + num_handles); - easy_setopt(easy[num_handles], CURLOPT_HEADER, 1L); + 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, + "testuser:testpass"); + easy_setopt(ntlm_easy[num_handles], CURLOPT_WRITEFUNCTION, callback); + easy_setopt(ntlm_easy[num_handles], CURLOPT_WRITEDATA, + ntlm_easy + num_handles); + easy_setopt(ntlm_easy[num_handles], CURLOPT_HEADER, 1L); - multi_add_handle(multi, easy[num_handles]); + multi_add_handle(multi, ntlm_easy[num_handles]); num_handles += 1; state = NeedSocketForNewHandle; + res = ntlmcb_res; } multi_perform(multi, &running); @@ -223,9 +227,9 @@ test_cleanup: /* proper cleanup sequence - type PB */ for(i = 0; i < MAX_EASY_HANDLES; i++) { - printf("Data connection %d: %d\n", i, counter[i]); - curl_multi_remove_handle(multi, easy[i]); - curl_easy_cleanup(easy[i]); + printf("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_cleanup(multi); diff --git a/deps/curl/tests/libtest/libprereq.c b/deps/curl/tests/libtest/libprereq.c index 92369d83..3eef5f36 100644 --- a/deps/curl/tests/libtest/libprereq.c +++ b/deps/curl/tests/libtest/libprereq.c @@ -51,7 +51,7 @@ static int prereq_callback(void *clientp, return prereq_cb->prereq_retcode; } -int test(char *URL) +CURLcode test(char *URL) { PRCS prereq_cb; CURLcode ret = CURLE_OK; diff --git a/deps/curl/tests/libtest/mk-lib1521.pl b/deps/curl/tests/libtest/mk-lib1521.pl index e1418a01..e6688746 100644 --- a/deps/curl/tests/libtest/mk-lib1521.pl +++ b/deps/curl/tests/libtest/mk-lib1521.pl @@ -24,17 +24,162 @@ ########################################################################### # Usage: -# perl mk-lib1521.pl < ../../include/curl/curl.h > lib1521.c +# perl mk-lib1521.pl < ../../include/curl/curl.h lib1521.c # minimum and maximum long signed values my $minlong = "LONG_MIN"; my $maxlong = "LONG_MAX"; -# maximum long unsigned value -my $maxulong = "ULONG_MAX"; +# maximum curl_off_t +my $maxofft = "CURL_OFF_T_MAX"; my $line = ""; my $incomment = 0; -print <
, 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 @@ -58,37 +203,22 @@ print <
/* This source code is generated by mk-lib1521.pl ! */ -struct data { +struct testdata { char *blaha; }; #define LO $minlong #define HI $maxlong #define OFF_LO (curl_off_t) LO -#define OFF_HI (curl_off_t) $maxulong +#define OFF_HI (curl_off_t) $maxofft #define OFF_NO (curl_off_t) 0 -/* Unexpected error. - CURLE_NOT_BUILT_IN - means disabled at build - CURLE_UNKNOWN_OPTION - means no such option (anymore?) - CURLE_SSL_ENGINE_NOTFOUND - set unknown ssl engine - CURLE_UNSUPPORTED_PROTOCOL - set bad HTTP version - CURLE_BAD_FUNCTION_ARGUMENT - unsupported value - */ -#define UNEX(x) ((x) && \\ - ((x) != CURLE_NOT_BUILT_IN) && \\ - ((x) != CURLE_UNKNOWN_OPTION) && \\ - ((x) != CURLE_SSL_ENGINE_NOTFOUND) && \\ - ((x) != CURLE_UNSUPPORTED_PROTOCOL) && \\ - ((x) != CURLE_BAD_FUNCTION_ARGUMENT) ) - static size_t writecb(char *buffer, size_t size, size_t nitems, void *outstream) { @@ -111,18 +241,44 @@ static size_t readcb(char *buffer, return 0; } -static int err(const char *name, CURLcode val, int lineno) +static void errlongzero(const char *name, CURLcode code, int lineno) { - printf("CURLOPT_%s returned %d, \\"%s\\" on line %d\\n", - name, val, curl_easy_strerror(val), lineno); - return (int)val; + printf("%s set to 0 returned %d, \\"%s\\" on line %d\\n", + name, code, curl_easy_strerror(code), lineno); } -static int geterr(const char *name, CURLcode val, int lineno) +static void errlong(const char *name, CURLcode code, int lineno) +{ +$allowednumerrors + printf("%s set to non-zero returned %d, \\"%s\\" on line %d\\n", + name, code, curl_easy_strerror(code), lineno); +} + +static void errstring(const char *name, CURLcode code, int lineno) +{ + /* allow this set of options to return CURLE_BAD_FUNCTION_ARGUMENT + when given a strange string input */ +$allowedstringerrors + printf("%s set to a string returned %d, \\"%s\\" on line %d\\n", + name, code, curl_easy_strerror(code), lineno); +} + +static void err(const char *name, CURLcode val, int lineno) +{ + printf("%s returned %d, \\"%s\\" on line %d\\n", + name, val, curl_easy_strerror(val), lineno); +} + +static void errnull(const char *name, CURLcode val, int lineno) +{ + printf("%s set to NULL returned %d, \\"%s\\" on line %d\\n", + name, val, curl_easy_strerror(val), lineno); +} + +static void geterr(const char *name, CURLcode val, int lineno) { printf("CURLINFO_%s returned %d, \\"%s\\" on line %d\\n", name, val, curl_easy_strerror(val), lineno); - return (int)val; } static curl_progress_callback progresscb; @@ -146,7 +302,30 @@ static curl_hstswrite_callback hstswritecb; static curl_resolver_start_callback resolver_start_cb; static curl_prereq_callback prereqcb; -int test(char *URL) +/* long options that are okay to return + CURLE_BAD_FUNCTION_ARGUMENT */ +static bool bad_long(CURLcode res, int check) +{ + if(res != CURLE_BAD_FUNCTION_ARGUMENT) + return 0; /* not okay */ + + if(check < CURLOPTTYPE_OBJECTPOINT) { + /* LONG */ + return 1; + } + else if((check >= CURLOPTTYPE_OFF_T) && + (check < CURLOPTTYPE_BLOB)) { + /* OFF_T */ + return 1; + } + return 0; +} + +/* macro to check the first setopt of an option which then is allowed to get a + non-existing function return code back */ +#define present(x) ((x != CURLE_NOT_BUILT_IN) && (x != CURLE_UNKNOWN_OPTION)) + +CURLcode test(char *URL) { CURL *curl = NULL; CURL *dep = NULL; @@ -161,7 +340,7 @@ int test(char *URL) struct curl_httppost *httppost = NULL; curl_mime *mimepost = NULL; FILE *stream = stderr; - struct data object; + struct testdata object; char *charp; long val; curl_off_t oval; @@ -181,6 +360,7 @@ int test(char *URL) goto test_cleanup; } + CURL_IGNORE_DEPRECATION( HEADER ; @@ -235,78 +415,136 @@ while() { if($_ =~ /^CURLOPT(?:DEPRECATED)?\(([^ ]*), ([^ ]*), (\d*)[,)]/) { my ($name, $type, $val)=($1, $2, $3); my $w=" "; - my $pref = "${w}res = curl_easy_setopt(curl, $name,"; - my $i = ' ' x (length($w) + 23); - my $check = " if(UNEX(res)) {\n err(\"$name\", res, __LINE__);\n goto test_cleanup;\n }\n"; + my $w2="$w$w"; + my $w3="$w$w$w"; + my $opt = $name; + $opt =~ s/^CURLOPT_//; + my $exists = "${w}{\n"; + # the first check for an option + my $fpref = "${exists}${w2}CURLcode first =\n${w3}curl_easy_setopt(curl, $name,"; + my $ifpresent = "${w2}if(present(first)) {\n"; + my $pref = "${w3}res = curl_easy_setopt(curl, $name,"; + my $i = ' ' x (length($w) + 25); + my $fcheck = <) { ($_ =~ /^CURLINFO_([^ ]*) *= *CURLINFO_([^ ]*)/)) { my ($info, $type)=($1, $2); my $c = " res = curl_easy_getinfo(curl, CURLINFO_$info,"; - my $check = " if(UNEX(res)) {\n geterr(\"$info\", res, __LINE__);\n goto test_cleanup;\n }\n"; + my $check = " if(res)\n geterr(\"$info\", res, __LINE__);\n"; if($type eq "STRING") { - print "$c &charp);\n$check"; + print $fh "$c &charp);\n$check"; } elsif($type eq "LONG") { - print "$c &val);\n$check"; + print $fh "$c &val);\n$check"; } elsif($type eq "OFF_T") { - print "$c &oval);\n$check"; + print $fh "$c &oval);\n$check"; } elsif($type eq "DOUBLE") { - print "$c &dval);\n$check"; + print $fh "$c &dval);\n$check"; } elsif($type eq "SLIST") { - print "$c &slist);\n$check"; - print " if(slist)\n curl_slist_free_all(slist);\n"; + print $fh "$c &slist);\n$check"; + print $fh " if(slist)\n curl_slist_free_all(slist);\n"; } elsif($type eq "SOCKET") { - print "$c &sockfd);\n$check"; + print $fh "$c &sockfd);\n$check"; } elsif($type eq "PTR") { if($info eq "CERTINFO") { - print "$c &certinfo);\n$check"; + print $fh "$c &certinfo);\n$check"; } elsif(($info eq "TLS_SESSION") || ($info eq "TLS_SSL_PTR")) { - print "$c &tlssession);\n$check"; + print $fh "$c &tlssession);\n$check"; } else { print STDERR "$info/$type is unsupported\n"; @@ -354,7 +592,8 @@ while() { } -print <